]> granicus.if.org Git - json-c/commitdiff
Add a json_c_version.h header (included from json.h), and several macros and function...
authorEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 23 Dec 2012 16:57:44 +0000 (10:57 -0600)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Sun, 23 Dec 2012 16:57:44 +0000 (10:57 -0600)
Makefile.am
json.h
json_c_version.c [new file with mode: 0644]
json_c_version.h [new file with mode: 0644]

index 36272f47b0781b5c5e22d4d7079e585d0b26f02f..147d9576fa01d0965613badca3c295eb08339707 100644 (file)
@@ -21,6 +21,7 @@ libjson_cinclude_HEADERS = \
        debug.h \
        json.h \
        json_config.h \
+       json_c_version.h \
        json_inttypes.h \
        json_object.h \
        json_object_iterator.h \
@@ -48,6 +49,7 @@ endif
 libjson_c_la_SOURCES = \
        arraylist.c \
        debug.c \
+       json_c_version.c \
        json_object.c \
        json_object_iterator.c \
        json_tokener.c \
diff --git a/json.h b/json.h
index d49715b3b5ecc9ff95b7bd8d5efd52ae85ac0956..4339b20e9060fbcc28c3ed18b452cb402ef244de 100644 (file)
--- a/json.h
+++ b/json.h
@@ -25,6 +25,7 @@ extern "C" {
 #include "json_object.h"
 #include "json_tokener.h"
 #include "json_object_iterator.h"
+#include "json_c_version.h"
 
 #ifdef __cplusplus
 }
diff --git a/json_c_version.c b/json_c_version.c
new file mode 100644 (file)
index 0000000..13eb188
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2012 Eric Haszlakiewicz
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the MIT license. See COPYING for details.
+ */
+#include "config.h"
+
+#include "json_c_version.h"
+
+const char *json_c_version(void)
+{
+       return JSON_C_VERSION;
+}
+
+int json_c_version_num(void)
+{
+       return JSON_C_VERSION_NUM;
+}
+
diff --git a/json_c_version.h b/json_c_version.h
new file mode 100644 (file)
index 0000000..3e35aff
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2012 Eric Haszlakiewicz
+ *
+ * This library is free software; you can redistribute it and/or modify
+ * it under the terms of the MIT license. See COPYING for details.
+ */
+
+#ifndef _json_c_version_h_
+#define _json_c_version_h_
+
+#define JSON_C_MAJOR_VERSION 0
+#define JSON_C_MINOR_VERSION 10
+#define JSON_C_MICRO_VERSION 0
+#define JSON_C_VERSION_NUM ((JSON_C_MAJOR_VERSION << 16) | \
+                            (JSON_C_MINOR_VERSION << 8) | \
+                            JSON_C_MICRO_VERSION)
+#define JSON_C_VERSION "0.10"
+
+const char *json_c_version(void); /* Returns JSON_C_VERSION */
+int json_c_version_num(void);     /* Returns JSON_C_VERSION_NUM */
+
+#endif