Constants

geoip.inc

Untitled constant

Global

IP addresses passed to these natives can contain ports, the ports will be ignored.

Lookup the two character country code for a given IP address. Sets the buffer to "error" on an unsuccessful lookup.

Deprecated

This native will overflow the buffer by one cell on an unknown ip lookup!
Use geoip_code2_ex instead.

Return

The result length.

#pragma deprecated Use geoip_code2_ex() instead.

Lookup the three character country code for a given IP address. Sets the buffer to "error" on an unsuccessful lookup.

Deprecated

This native will overflow the buffer by one cell on an unknown ip lookup!
Use geoip_code3_ex instead.

Return

The result length.

#pragma deprecated Use geoip_code3_ex() instead.

Lookup the full country name for the given IP address. Sets the buffer to "error" on an unsuccessful lookup.

Return

The result length.

#pragma deprecated Use geoip_country_ex() instead.

Calculate the distance between geographical coordinates, latitude and longitude.

SYSTEM_METRIC

Note

This native requires GeoIP City database, which can be retrieved from:
http://dev.maxmind.com/geoip/geoip2/geolite2/ (MaxMind DB binary)

Return

The distance as result in specified system of measurement.

#define SYSTEM_METRIC   0 // kilometers
#define SYSTEM_IMPERIAL 1 // statute miles

Look up the continent code for a given IP address.

Continent

Note

This native requires GeoIP City database, which can be retrieved from:
http://dev.maxmind.com/geoip/geoip2/geolite2/ (MaxMind DB binary)

Note

The code can be retrieved as integer (See CONTINENT_* constants.) or string (2 characters).

Note

Possible continent codes are AF, AN, AS, EU, NA, OC, SA for
Africa(1), Antarctica(2), Asia(3), Europe(4), North America(5), Oceania(6), South America(7).

Return

The continent id on successful lookup, 0 otherwise.

enum Continent
{
	CONTINENT_UNKNOWN = 0,
	CONTINENT_AFRICA,
	CONTINENT_ANTARCTICA,
	CONTINENT_ASIA,
	CONTINENT_EUROPE,
	CONTINENT_NORTH_AMERICA,
	CONTINENT_OCEANIA,
	CONTINENT_SOUTH_AMERICA,
};