mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
cJSON_Version: returns a version string
This is useful to programmatically find out the version of cJSON that has been used (useful in case of scripting language bindings for example).
This commit is contained in:
8
cJSON.c
8
cJSON.c
@@ -58,6 +58,14 @@ const char *cJSON_GetErrorPtr(void)
|
||||
return global_ep;
|
||||
}
|
||||
|
||||
extern const char* cJSON_Version(void)
|
||||
{
|
||||
static char version[15];
|
||||
sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH);
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
/* case insensitive strcmp */
|
||||
static int cJSON_strcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user