IP-Geolocation-MMDB
view release on metacpan or search on metacpan
INIT:
const char *ip_address;
int gai_error, mmdb_error;
const char *error;
MMDB_lookup_result_s result;
MMDB_entry_data_list_s *list;
SV *data = &PL_sv_undef;
int wants_prefix_length = 0;
uint16_t prefix_length = 0;
U8 gimme = GIMME_V;
PPCODE:
ip_address = NULL;
if (items > 1) {
ip_address = SvPVbyte_nolen(ST(1));
}
if (NULL == ip_address || '\0' == *ip_address) {
croak("%s", "You must provide an IP address to look up");
}
result =
MMDB_lookup_string(&self->mmdb, ip_address, &gai_error, &mmdb_error);
if (0 != gai_error) {
( run in 1.269 second using v1.01-cache-2.11-cpan-5511b514fd6 )