X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=src%2Floc%2Fas-list.h;fp=src%2Floc%2Fas-list.h;h=7b5c4e859d915621e73ee6fa1d7f92036fb39f22;hb=84a2f0c2d9cbf8ae4225802c29ccba86561c77ed;hp=0000000000000000000000000000000000000000;hpb=bd1dc6bf6fe4ce40bf12e7426e283b31afd274e1;p=people%2Fms%2Flibloc.git diff --git a/src/loc/as-list.h b/src/loc/as-list.h new file mode 100644 index 0000000..7b5c4e8 --- /dev/null +++ b/src/loc/as-list.h @@ -0,0 +1,41 @@ +/* + libloc - A library to determine the location of someone on the Internet + + Copyright (C) 2017 IPFire Development Team + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. +*/ + +#ifndef LIBLOC_AS_LIST_H +#define LIBLOC_AS_LIST_H + +#include +#include + +struct loc_as_list; + +int loc_as_list_new(struct loc_ctx* ctx, struct loc_as_list** list); +struct loc_as_list* loc_as_list_ref(struct loc_as_list* list); +struct loc_as_list* loc_as_list_unref(struct loc_as_list* list); + +size_t loc_as_list_size(struct loc_as_list* list); +int loc_as_list_empty(struct loc_as_list* list); +void loc_as_list_clear(struct loc_as_list* list); + +struct loc_as* loc_as_list_get(struct loc_as_list* list, size_t index); +int loc_as_list_append(struct loc_as_list* list, struct loc_as* as); + +int loc_as_list_contains( + struct loc_as_list* list, struct loc_as* as); +int loc_as_list_contains_number( + struct loc_as_list* list, uint32_t number); + +#endif