@@ -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+
0 commit comments