]>
jfr.im git - irc/quakenet/newserv.git/blob - geoip/libGeoIP/GeoIPCity.h
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
4 * Copyright (C) 2006 MaxMind LLC
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.
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.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30 typedef struct GeoIPRecordTag
{
40 int metro_code
; /* metro_code is a alias for dma_code */
48 GeoIPRecord
* GeoIP_record_by_ipnum (GeoIP
* gi
, unsigned long ipnum
);
49 GeoIPRecord
* GeoIP_record_by_addr (GeoIP
* gi
, const char *addr
);
50 GeoIPRecord
* GeoIP_record_by_name (GeoIP
* gi
, const char *host
);
52 GeoIPRecord
* GeoIP_record_by_ipnum_v6 (GeoIP
* gi
, geoipv6_t ipnum
);
53 GeoIPRecord
* GeoIP_record_by_addr_v6 (GeoIP
* gi
, const char *addr
);
54 GeoIPRecord
* GeoIP_record_by_name_v6 (GeoIP
* gi
, const char *host
);
56 int GeoIP_record_id_by_addr (GeoIP
* gi
, const char *addr
);
57 int GeoIP_record_id_by_addr_v6 (GeoIP
* gi
, const char *addr
);
59 int GeoIP_init_record_iter (GeoIP
* gi
);
60 /* returns 0 on success, 1 on failure */
61 int GeoIP_next_record (GeoIP
* gi
, GeoIPRecord
**gir
, int *record_iter
);
63 void GeoIPRecord_delete (GeoIPRecord
*gir
);
65 /* NULL on failure otherwise a malloced string in utf8 */
66 char * _iso_8859_1__utf8(const char *);
72 #endif /* GEOIPCITY_H */