From 6a777afc079c2a8d3af3ecd2145fe8dd50567a39 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Wed, 22 Mar 2017 17:56:34 +0100 Subject: Funko sources as released by Rotacak. --- src/qcommon/IpToCountryResolver.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/qcommon/IpToCountryResolver.h (limited to 'src/qcommon/IpToCountryResolver.h') diff --git a/src/qcommon/IpToCountryResolver.h b/src/qcommon/IpToCountryResolver.h new file mode 100644 index 0000000..cf97cf8 --- /dev/null +++ b/src/qcommon/IpToCountryResolver.h @@ -0,0 +1,30 @@ +#ifndef IPTOCOUNTRYRESOLVER_H_INCLUDED +#define IPTOCOUNTRYRESOLVER_H_INCLUDED + +#define FULL_NAME_LENGTH 64 + +typedef struct { + unsigned int ipFrom; + unsigned int ipTo; + char name2[2+1]; //1 for zero character (line end) + char name3[3+1]; + char nameFull[FULL_NAME_LENGTH]; +} IpToCountryInfo; + +typedef struct { + unsigned int size; + IpToCountryInfo *infoArray; +} IpToCountryList; + +unsigned int ipstr_to_int (const char *cp_arg); +unsigned int ipbyte_to_int(unsigned int parts[4], unsigned int length); +unsigned int LoadIp2CountryInfo(const char *fileName, IpToCountryList *infoList, int camelCaseNames); +IpToCountryInfo *FindCountryInfoS(const char *ip_addr, IpToCountryList *infoList); +IpToCountryInfo *FindCountryInfoB(unsigned int parts[4], unsigned int length, IpToCountryList *infoList); +IpToCountryInfo *FindCountryInfoUI(unsigned int ip, IpToCountryList *infoList); + +#endif // IPTOCOUNTRYRESOLVER_H_INCLUDED + + + + -- cgit