]> git.ipfire.org Git - people/ms/libloc.git/blame - src/loc/as.h
Bump database version to "1"
[people/ms/libloc.git] / src / loc / as.h
CommitLineData
a5db3e49
MT
1/*
2 libloc - A library to determine the location of someone on the Internet
3
4 Copyright (C) 2017 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_AS_H
18#define LIBLOC_AS_H
19
20#include <stdint.h>
21
22#include <loc/libloc.h>
23#include <loc/format.h>
9fc7f001 24#include <loc/stringpool.h>
a5db3e49
MT
25
26struct loc_as;
29bd8211 27int loc_as_new(struct loc_ctx* ctx, struct loc_as** as, uint32_t number);
a5db3e49
MT
28struct loc_as* loc_as_ref(struct loc_as* as);
29struct loc_as* loc_as_unref(struct loc_as* as);
30
31uint32_t loc_as_get_number(struct loc_as* as);
32
33const char* loc_as_get_name(struct loc_as* as);
34int loc_as_set_name(struct loc_as* as, const char* name);
35
36int loc_as_cmp(struct loc_as* as1, struct loc_as* as2);
37
30ac38a1
MT
38#ifdef LIBLOC_PRIVATE
39
b904896a
MT
40int loc_as_new_from_database_v1(struct loc_ctx* ctx, struct loc_stringpool* pool,
41 struct loc_as** as, const struct loc_database_as_v1* dbobj);
42int loc_as_to_database_v1(struct loc_as* as, struct loc_stringpool* pool,
43 struct loc_database_as_v1* dbobj);
a5db3e49 44
d3d8ede6
MT
45int loc_as_match_string(struct loc_as* as, const char* string);
46
a5db3e49 47#endif
30ac38a1
MT
48
49#endif