]> git.ipfire.org Git - people/ms/libloc.git/blob - src/loc/network-list.h
bee21c4bdbbc5b6bbd7d42f1540787335d06684f
[people/ms/libloc.git] / src / loc / network-list.h
1 /*
2 libloc - A library to determine the location of someone on the Internet
3
4 Copyright (C) 2020 IPFire Development Team <info@ipfire.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15 */
16
17 #ifndef LIBLOC_NETWORK_LIST_H
18 #define LIBLOC_NETWORK_LIST_H
19
20 #include <loc/network.h>
21
22 struct loc_network_list;
23 int loc_network_list_new(struct loc_ctx* ctx, struct loc_network_list** list);
24 struct loc_network_list* loc_network_list_ref(struct loc_network_list* list);
25 struct loc_network_list* loc_network_list_unref(struct loc_network_list* list);
26 size_t loc_network_list_size(struct loc_network_list* list);
27 int loc_network_list_empty(struct loc_network_list* list);
28 void loc_network_list_clear(struct loc_network_list* list);
29 void loc_network_list_dump(struct loc_network_list* list);
30 struct loc_network* loc_network_list_get(struct loc_network_list* list, size_t index);
31 int loc_network_list_push(struct loc_network_list* list, struct loc_network* network);
32 struct loc_network* loc_network_list_pop(struct loc_network_list* list);
33 struct loc_network* loc_network_list_pop_first(struct loc_network_list* list);
34 int loc_network_list_contains(struct loc_network_list* list, struct loc_network* network);
35 int loc_network_list_merge(struct loc_network_list* self, struct loc_network_list* other);
36
37 #endif