Skip to content

Commit 8e3e2ea

Browse files
committed
Restored internal variables.
1 parent 58d9e68 commit 8e3e2ea

File tree

6 files changed

+79
-72
lines changed

6 files changed

+79
-72
lines changed

Developers_Guide.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ When IP2Location_clear_memory() function is called, and if any other process(es)
7272
After calling IP2Location_clear_memory(), the next call to IP2Location_set_lookup_mode() with IP2LOCATION_SHARED_MEMORY option will result in a new shared memory and will not reuse the old one if one exists and used by any other process. Please refer shm_open and shm_unlink man pages for more info.
7373

7474

75-
Version 8.1.3 27/09/2020
75+
Version 8.1.4 30/09/2020

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AC_PREREQ(2.59)
2-
AC_INIT([IP2Loc], [8.1.3], [[email protected]])
3-
AM_INIT_AUTOMAKE([IP2Loc], [8.1.3])
2+
AC_INIT([IP2Loc], [8.1.4], [[email protected]])
3+
AM_INIT_AUTOMAKE([IP2Loc], [8.1.4])
44

55
#AC_PREFIX_DEFAULT(/usr/)
66
AM_CONFIG_HEADER([config.h])

contrib/IP2Location.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,11 @@ install -p data/IPV6-COUNTRY.BIN %{buildroot}%{_datadir}/%{name}/IPV6-COUNTRY.SA
122122

123123

124124
%changelog
125+
* Wed Sep 30 2020 IP2Location <[email protected]> - 8.1.4
126+
- restored internal variables
127+
125128
* Fri Sep 27 2020 IP2Location <[email protected]> - 8.1.3
126-
- restored functions deleted in 8.1.0.
129+
- restored functions deleted in 8.1.0
127130

128131
* Fri Sep 25 2020 IP2Location <[email protected]> - 8.1.2
129132
- fixed version number in multiple places

contrib/IP2Location.spec.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ install -p data/IPV6-COUNTRY.BIN %{buildroot}%{_datadir}/%{name}/IPV6-COUNTRY.SA
122122

123123

124124
%changelog
125+
* Wed Sep 30 2020 IP2Location <[email protected]> - 8.1.4
126+
- restored internal variables
127+
125128
* Fri Sep 27 2020 IP2Location <[email protected]> - 8.1.3
126129
- restored functions renamed in 8.1.0.
127130

libIP2Location/IP2Location.c

Lines changed: 56 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ uint32_t IP2Location_close(IP2Location *handler)
176176
}
177177

178178
// Clear memory object (Will deprecate in coming major version update)
179-
void IP2Location_delete_shm()
179+
void IP2Location_DB_del_shm()
180180
{
181181
IP2Location_delete_shared_memory();
182182
}
@@ -386,18 +386,18 @@ static IP2LocationRecord *IP2Location_bad_record(const char *message)
386386
record->latitude = 0;
387387
record->longitude = 0;
388388
record->domain = strdup(message);
389-
record->zip_code = strdup(message);
390-
record->time_zone = strdup(message);
391-
record->net_speed = strdup(message);
392-
record->idd_code = strdup(message);
393-
record->area_code = strdup(message);
394-
record->weather_station_code = strdup(message);
395-
record->weather_station_name = strdup(message);
389+
record->zipcode = strdup(message);
390+
record->timezone = strdup(message);
391+
record->netspeed = strdup(message);
392+
record->iddcode = strdup(message);
393+
record->areacode = strdup(message);
394+
record->weatherstationcode = strdup(message);
395+
record->weatherstationname = strdup(message);
396396
record->mcc = strdup(message);
397397
record->mnc = strdup(message);
398-
record->mobile_brand = strdup(message);
398+
record->mobilebrand = strdup(message);
399399
record->elevation = 0;
400-
record->usage_type = strdup(message);
400+
record->usagetype = strdup(message);
401401

402402
return record;
403403
}
@@ -480,72 +480,72 @@ static IP2LocationRecord *IP2Location_read_record(IP2Location *handler, uint32_t
480480
}
481481

482482
if ((mode & ZIPCODE) && (ZIPCODE_POSITION[database_type] != 0)) {
483-
if (!record->zip_code) {
484-
record->zip_code = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (ZIPCODE_POSITION[database_type] - 1)));
483+
if (!record->zipcode) {
484+
record->zipcode = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (ZIPCODE_POSITION[database_type] - 1)));
485485
}
486486
} else {
487-
if (!record->zip_code) {
488-
record->zip_code = strdup(NOT_SUPPORTED);
487+
if (!record->zipcode) {
488+
record->zipcode = strdup(NOT_SUPPORTED);
489489
}
490490
}
491491

492492
if ((mode & TIMEZONE) && (TIMEZONE_POSITION[database_type] != 0)) {
493-
if (!record->time_zone) {
494-
record->time_zone = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (TIMEZONE_POSITION[database_type] - 1)));
493+
if (!record->timezone) {
494+
record->timezone = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (TIMEZONE_POSITION[database_type] - 1)));
495495
}
496496
} else {
497-
if (!record->time_zone) {
498-
record->time_zone = strdup(NOT_SUPPORTED);
497+
if (!record->timezone) {
498+
record->timezone = strdup(NOT_SUPPORTED);
499499
}
500500
}
501501

502502
if ((mode & NETSPEED) && (NETSPEED_POSITION[database_type] != 0)) {
503-
if (!record->net_speed) {
504-
record->net_speed = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (NETSPEED_POSITION[database_type] - 1)));
503+
if (!record->netspeed) {
504+
record->netspeed = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (NETSPEED_POSITION[database_type] - 1)));
505505
}
506506
} else {
507-
if (!record->net_speed) {
508-
record->net_speed = strdup(NOT_SUPPORTED);
507+
if (!record->netspeed) {
508+
record->netspeed = strdup(NOT_SUPPORTED);
509509
}
510510
}
511511

512512
if ((mode & IDDCODE) && (IDDCODE_POSITION[database_type] != 0)) {
513-
if (!record->idd_code) {
514-
record->idd_code = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (IDDCODE_POSITION[database_type] - 1)));
513+
if (!record->iddcode) {
514+
record->iddcode = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (IDDCODE_POSITION[database_type] - 1)));
515515
}
516516
} else {
517-
if (!record->idd_code) {
518-
record->idd_code = strdup(NOT_SUPPORTED);
517+
if (!record->iddcode) {
518+
record->iddcode = strdup(NOT_SUPPORTED);
519519
}
520520
}
521521

522522
if ((mode & AREACODE) && (AREACODE_POSITION[database_type] != 0)) {
523-
if (!record->area_code) {
524-
record->area_code = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (AREACODE_POSITION[database_type] - 1)));
523+
if (!record->areacode) {
524+
record->areacode = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (AREACODE_POSITION[database_type] - 1)));
525525
}
526526
} else {
527-
if (!record->area_code) {
528-
record->area_code = strdup(NOT_SUPPORTED);
527+
if (!record->areacode) {
528+
record->areacode = strdup(NOT_SUPPORTED);
529529
}
530530
}
531531

532532
if ((mode & WEATHERSTATIONCODE) && (WEATHERSTATIONCODE_POSITION[database_type] != 0)) {
533-
if (!record->weather_station_code) {
534-
record->weather_station_code = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (WEATHERSTATIONCODE_POSITION[database_type] - 1)));
533+
if (!record->weatherstationcode) {
534+
record->weatherstationcode = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (WEATHERSTATIONCODE_POSITION[database_type] - 1)));
535535
}
536536
} else {
537-
if (!record->weather_station_code) {
538-
record->weather_station_code = strdup(NOT_SUPPORTED);
537+
if (!record->weatherstationcode) {
538+
record->weatherstationcode = strdup(NOT_SUPPORTED);
539539
}
540540
}
541541

542542
if ((mode & WEATHERSTATIONNAME) && (WEATHERSTATIONNAME_POSITION[database_type] != 0)) {
543-
if (!record->weather_station_name) {
544-
record->weather_station_name = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (WEATHERSTATIONNAME_POSITION[database_type] - 1)));
543+
if (!record->weatherstationname) {
544+
record->weatherstationname = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (WEATHERSTATIONNAME_POSITION[database_type] - 1)));
545545
}
546546
} else {
547-
if (!record->weather_station_name) {
548-
record->weather_station_name = strdup(NOT_SUPPORTED);
547+
if (!record->weatherstationname) {
548+
record->weatherstationname = strdup(NOT_SUPPORTED);
549549
}
550550
}
551551

@@ -570,12 +570,12 @@ static IP2LocationRecord *IP2Location_read_record(IP2Location *handler, uint32_t
570570
}
571571

572572
if ((mode & MOBILEBRAND) && (MOBILEBRAND_POSITION[database_type] != 0)) {
573-
if (!record->mobile_brand) {
574-
record->mobile_brand = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (MOBILEBRAND_POSITION[database_type] - 1)));
573+
if (!record->mobilebrand) {
574+
record->mobilebrand = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (MOBILEBRAND_POSITION[database_type] - 1)));
575575
}
576576
} else {
577-
if (!record->mobile_brand) {
578-
record->mobile_brand = strdup(NOT_SUPPORTED);
577+
if (!record->mobilebrand) {
578+
record->mobilebrand = strdup(NOT_SUPPORTED);
579579
}
580580
}
581581

@@ -588,12 +588,12 @@ static IP2LocationRecord *IP2Location_read_record(IP2Location *handler, uint32_t
588588
}
589589

590590
if ((mode & USAGETYPE) && (USAGETYPE_POSITION[database_type] != 0)) {
591-
if (!record->usage_type) {
592-
record->usage_type = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (USAGETYPE_POSITION[database_type] - 1)));
591+
if (!record->usagetype) {
592+
record->usagetype = IP2Location_read_string(handle, IP2Location_read32(handle, rowaddr + 4 * (USAGETYPE_POSITION[database_type] - 1)));
593593
}
594594
} else {
595-
if (!record->usage_type) {
596-
record->usage_type = strdup(NOT_SUPPORTED);
595+
if (!record->usagetype) {
596+
record->usagetype = strdup(NOT_SUPPORTED);
597597
}
598598
}
599599
return record;
@@ -731,17 +731,17 @@ void IP2Location_free_record(IP2LocationRecord *record) {
731731
free(record->domain);
732732
free(record->isp);
733733
free(record->region);
734-
free(record->zip_code);
735-
free(record->time_zone);
736-
free(record->net_speed);
737-
free(record->idd_code);
738-
free(record->area_code);
739-
free(record->weather_station_code);
740-
free(record->weather_station_name);
734+
free(record->zipcode);
735+
free(record->timezone);
736+
free(record->netspeed);
737+
free(record->iddcode);
738+
free(record->areacode);
739+
free(record->weatherstationcode);
740+
free(record->weatherstationname);
741741
free(record->mcc);
742742
free(record->mnc);
743-
free(record->mobile_brand);
744-
free(record->usage_type);
743+
free(record->mobilebrand);
744+
free(record->usagetype);
745745
free(record);
746746
}
747747

@@ -1149,3 +1149,4 @@ float IP2Location_read_float(FILE *handle, uint32_t position)
11491149
return ret;
11501150
}
11511151

1152+

libIP2Location/IP2Location.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ extern "C" {
5454
#endif
5555
#endif
5656

57-
#define API_VERSION 8.1.3
57+
#define API_VERSION 8.1.4
5858
#define API_VERSION_MAJOR 8
5959
#define API_VERSION_MINOR 1
60-
#define API_VERSION_RELEASE 3
60+
#define API_VERSION_RELEASE 4
6161
#define API_VERSION_NUMERIC (((API_VERSION_MAJOR * 100) + API_VERSION_MINOR) * 100 + API_VERSION_RELEASE)
6262

6363
#define MAX_IPV4_RANGE 4294967295U
@@ -129,17 +129,17 @@ typedef struct {
129129
char *city;
130130
char *isp;
131131
char *domain;
132-
char *zip_code;
133-
char *time_zone;
134-
char *net_speed;
135-
char *idd_code;
136-
char *area_code;
137-
char *weather_station_code;
138-
char *weather_station_name;
132+
char *zipcode;
133+
char *timezone;
134+
char *netspeed;
135+
char *iddcode;
136+
char *areacode;
137+
char *weatherstationcode;
138+
char *weatherstationname;
139139
char *mcc;
140140
char *mnc;
141-
char *mobile_brand;
142-
char *usage_type;
141+
char *mobilebrand;
142+
char *usagetype;
143143

144144
float latitude;
145145
float longitude;
@@ -173,7 +173,7 @@ IP2LocationRecord *IP2Location_get_elevation(IP2Location *handler, char *ip);
173173
IP2LocationRecord *IP2Location_get_usagetype(IP2Location *handler, char *ip);
174174
IP2LocationRecord *IP2Location_get_all(IP2Location *handler, char *ip);
175175
void IP2Location_free_record(IP2LocationRecord *record);
176-
void IP2Location_delete_shm();
176+
void IP2Location_DB_del_shm();
177177
void IP2Location_clear_memory();
178178
unsigned long int IP2Location_api_version_number(void);
179179
unsigned long int IP2Location_api_version_num(void);
@@ -192,4 +192,4 @@ void IP2Location_delete_shared_memory();
192192
#ifdef __cplusplus
193193
}
194194
#endif
195-
#endif
195+
#endif

0 commit comments

Comments
 (0)