From 91fc277fb9ad0557f7dacf1b940bfa2d0f43d434 Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Fri, 19 Jan 2007 02:23:04 +0000 Subject: [PATCH] new geoip natives --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40324 --- plugins/include/geoip.inc | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 plugins/include/geoip.inc diff --git a/plugins/include/geoip.inc b/plugins/include/geoip.inc new file mode 100644 index 00000000..aa82ac98 --- /dev/null +++ b/plugins/include/geoip.inc @@ -0,0 +1,41 @@ +/** + * :TODO: license info + */ + +#if defined _geoip_included + #endinput +#endif +#define _geoip_included + +/** + * @GLOBAL@ + * IP address can contain ports, the ports will be stripped out. + */ + +/** + * Gets the two character country code from an IP address. (US, CA, etc) + * + * @param ip Ip to determine the country code. + * @param ccode Destination string buffer to store the code. + * @noreturn + */ +native Geoip_Code2(const String:ip[], String:ccode[3]); + +/** + * Gets the three character country code from an IP address. (USA, CAN, etc) + * + * @param ip Ip to determine the country code. + * @param ccode Destination string buffer to store the code. + * @noreturn + */ +native Geoip_Code3(const String:ip[], String:ccode[4]); + +/** + * Gets the full country name. (max length of output string is 45) + * + * @param ip Ip to determine the country code. + * @param ccode Destination string buffer to store the country name. + * @param len Maximum length of output string buffer. + * @noreturn + */ +native Geoip_Country(const String:ip[], String:name[], len=45);