#include /* 31 March 2020, by R. Harmsen This is a wrapper around the library net/libmaxminddb by MaxMind. See https://www.maxmind.com/en/geolite2-commercial-redistribution All it does is find the country that belongs to the given IP address, either IPv4 or IPv6. Return value: 0 on succes, non-zero otherwise ISO-country: This must be a character array of no less than three bytes. It will be populated with a null-terminated ISO 3166 country code (two characters, uppercase), or with "??" is not found. fperr: optional parameter, if set to a valid, opened file handle, error message will be written (appended) there. If NULL, nothing is written 23 Nov 2025: I no longer use Maxmind’s library and database, but online tools instead. For more explanations, see https://rudhar.com/sfreview/IP2cntry.htm The function interface remains the same. */ int IP2cntr (char *IPadress, char ISO_country[3], FILE *fperr);