chrislim2888 / IP2Location-C-Library

IP2Location C library enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather station code, weather station name, mobile, usage types, etc that any IP address or hostname originates from.
https://www.ip2location.com
MIT License
61 stars 30 forks source link

IP2Location_api_version_num changed to IP2Location_api_version_number #38

Closed pbiering closed 4 years ago

pbiering commented 4 years ago

it was a terrible idea to rename the api_version_number function - this totally kills backwards compatibilty for existing programs which already checking the version number (e.g. using dynload mechanism):

-unsigned long int IP2Location_api_version_number(void)
+unsigned long int IP2Location_api_version_num(void)
-unsigned long int IP2Location_api_version_number(void);
+unsigned long int IP2Location_api_version_num(void);
-   printf("IP2Location API version: %s (%lu)\n", IP2Location_api_version_string(), IP2Location_api_version_number());
+   printf("IP2Location API version: %s (%lu)\n", IP2Location_api_version_string(), IP2Location_api_version_num());

-> please re-add IP2Location_api_version_num and call then internally to IP2Location_api_version_number

BTW: such function should kept forever after introduced

pbiering commented 4 years ago

In addition please strongly avoid API changes in the future in minor releases, add is ok, but replace or change is not good in minor releases, this has a big chance to break any other software which will be take of of the library in Fedora/EPEL next -> please keep that in mind and maintain backwards compatibility all the time in minor releases. Otherwise I can't update the library in Fedora/EPEL further on to be on the safe side not breaking by accident existing software.

ip2location commented 4 years ago

As this library was developed by multiple authors, it was a mistake to simply standardize the functions at this time.

I have restored all the missing functions and it will be no future updates on these names to prevent further issues.