Lines Matching refs:gi
44 function _get_record_v6($gi, $ipnum)
46 $seek_country = _geoip_seek_country_v6($gi, $ipnum);
47 if ($seek_country == $gi->databaseSegments) {
50 return _common_get_record($gi, $seek_country);
53 function _common_get_record($gi, $seek_country)
63 $record_pointer = $seek_country + (2 * $gi->record_length - 1) * $gi->databaseSegments;
65 if ($gi->flags & GEOIP_MEMORY_CACHE) {
66 $record_buf = substr($gi->memory_buffer, $record_pointer, FULL_RECORD_LENGTH);
67 } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
68 $record_buf = @shmop_read($gi->shmid, $record_pointer, FULL_RECORD_LENGTH);
70 fseek($gi->filehandle, $record_pointer, SEEK_SET);
71 $record_buf = fread($gi->filehandle, FULL_RECORD_LENGTH);
76 $record->country_code = $gi->GEOIP_COUNTRY_CODES[$char];
77 $record->country_code3 = $gi->GEOIP_COUNTRY_CODES3[$char];
78 $record->country_name = $gi->GEOIP_COUNTRY_NAMES[$char];
79 $record->continent_code = $gi->GEOIP_CONTINENT_CODES[$char];
129 if (GEOIP_CITY_EDITION_REV1 == $gi->databaseType) {
146 function GeoIP_record_by_addr_v6($gi, $addr)
152 return _get_record_v6($gi, $ipnum);
155 function _get_record($gi, $ipnum)
157 $seek_country = _geoip_seek_country($gi, $ipnum);
158 if ($seek_country == $gi->databaseSegments) {
161 return _common_get_record($gi, $seek_country);
164 function GeoIP_record_by_addr($gi, $addr)
170 return _get_record($gi, $ipnum);