This is done to avoid possible undesired clashes by too generic naming.pull/585/head
@@ -321,13 +321,13 @@ set(JSON_C_HEADERS | |||||
${JSON_C_PUBLIC_HEADERS} | ${JSON_C_PUBLIC_HEADERS} | ||||
${PROJECT_BINARY_DIR}/config.h | ${PROJECT_BINARY_DIR}/config.h | ||||
${PROJECT_SOURCE_DIR}/json_object_private.h | ${PROJECT_SOURCE_DIR}/json_object_private.h | ||||
${PROJECT_SOURCE_DIR}/random_seed.h | |||||
${PROJECT_SOURCE_DIR}/strerror_override.h | |||||
${PROJECT_SOURCE_DIR}/strerror_override_private.h | |||||
${PROJECT_SOURCE_DIR}/math_compat.h | |||||
${PROJECT_SOURCE_DIR}/snprintf_compat.h | |||||
${PROJECT_SOURCE_DIR}/strdup_compat.h | |||||
${PROJECT_SOURCE_DIR}/vasprintf_compat.h | |||||
${PROJECT_SOURCE_DIR}/json_c_random_seed.h | |||||
${PROJECT_SOURCE_DIR}/json_c_strerror_override.h | |||||
${PROJECT_SOURCE_DIR}/json_c_strerror_override_private.h | |||||
${PROJECT_SOURCE_DIR}/json_c_math_compat.h | |||||
${PROJECT_SOURCE_DIR}/json_c_snprintf_compat.h | |||||
${PROJECT_SOURCE_DIR}/json_c_strdup_compat.h | |||||
${PROJECT_SOURCE_DIR}/json_c_vasprintf_compat.h | |||||
) | ) | ||||
set(JSON_C_SOURCES | set(JSON_C_SOURCES | ||||
@@ -342,8 +342,8 @@ set(JSON_C_SOURCES | |||||
${PROJECT_SOURCE_DIR}/json_visit.c | ${PROJECT_SOURCE_DIR}/json_visit.c | ||||
${PROJECT_SOURCE_DIR}/json_c_linkhash.c | ${PROJECT_SOURCE_DIR}/json_c_linkhash.c | ||||
${PROJECT_SOURCE_DIR}/json_c_printbuf.c | ${PROJECT_SOURCE_DIR}/json_c_printbuf.c | ||||
${PROJECT_SOURCE_DIR}/random_seed.c | |||||
${PROJECT_SOURCE_DIR}/strerror_override.c | |||||
${PROJECT_SOURCE_DIR}/json_c_random_seed.c | |||||
${PROJECT_SOURCE_DIR}/json_c_strerror_override.c | |||||
) | ) | ||||
include_directories(${PROJECT_SOURCE_DIR}) | include_directories(${PROJECT_SOURCE_DIR}) | ||||
@@ -29,7 +29,7 @@ | |||||
#endif | #endif | ||||
#include "json_c_linkhash.h" | #include "json_c_linkhash.h" | ||||
#include "random_seed.h" | |||||
#include "json_c_random_seed.h" | |||||
/* hash functions */ | /* hash functions */ | ||||
static unsigned long lh_char_hash(const void *k); | static unsigned long lh_char_hash(const void *k); | ||||
@@ -1,5 +1,5 @@ | |||||
#ifndef __math_compat_h | |||||
#define __math_compat_h | |||||
#ifndef __json_c_math_compat_h | |||||
#define __json_c_math_compat_h | |||||
/** | /** | ||||
* @file | * @file |
@@ -27,8 +27,8 @@ | |||||
#include "json_c_debug.h" | #include "json_c_debug.h" | ||||
#include "json_c_printbuf.h" | #include "json_c_printbuf.h" | ||||
#include "snprintf_compat.h" | |||||
#include "vasprintf_compat.h" | |||||
#include "json_c_snprintf_compat.h" | |||||
#include "json_c_vasprintf_compat.h" | |||||
static int printbuf_extend(struct printbuf *p, int min_size); | static int printbuf_extend(struct printbuf *p, int min_size); | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
* random_seed.c | |||||
* json_c_random_seed.c | |||||
* | * | ||||
* Copyright (c) 2013 Metaparadigm Pte. Ltd. | * Copyright (c) 2013 Metaparadigm Pte. Ltd. | ||||
* Michael Clark <michael@metaparadigm.com> | * Michael Clark <michael@metaparadigm.com> | ||||
@@ -9,9 +9,9 @@ | |||||
* | * | ||||
*/ | */ | ||||
#include "random_seed.h" | |||||
#include "json_c_random_seed.h" | |||||
#include "config.h" | #include "config.h" | ||||
#include "strerror_override.h" | |||||
#include "json_c_strerror_override.h" | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#define DEBUG_SEED(s) | #define DEBUG_SEED(s) |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
* random_seed.h | |||||
* json_c_random_seed.h | |||||
* | * | ||||
* Copyright (c) 2013 Metaparadigm Pte. Ltd. | * Copyright (c) 2013 Metaparadigm Pte. Ltd. | ||||
* Michael Clark <michael@metaparadigm.com> | * Michael Clark <michael@metaparadigm.com> |
@@ -1,5 +1,5 @@ | |||||
#ifndef __snprintf_compat_h | |||||
#define __snprintf_compat_h | |||||
#ifndef __json_c_snprintf_compat_h | |||||
#define __json_c_snprintf_compat_h | |||||
/** | /** | ||||
* @file | * @file | ||||
@@ -38,4 +38,4 @@ static int json_c_snprintf(char *str, size_t size, const char *format, ...) | |||||
#error Need vsnprintf! | #error Need vsnprintf! | ||||
#endif /* !HAVE_SNPRINTF && defined(WIN32) */ | #endif /* !HAVE_SNPRINTF && defined(WIN32) */ | ||||
#endif /* __snprintf_compat_h */ | |||||
#endif /* __json_c_snprintf_compat_h */ |
@@ -1,5 +1,5 @@ | |||||
#ifndef __strdup_compat_h | |||||
#define __strdup_compat_h | |||||
#ifndef __json_c_strdup_compat_h | |||||
#define __json_c_strdup_compat_h | |||||
/** | /** | ||||
* @file | * @file |
@@ -1,5 +1,5 @@ | |||||
#define STRERROR_OVERRIDE_IMPL 1 | #define STRERROR_OVERRIDE_IMPL 1 | ||||
#include "strerror_override.h" | |||||
#include "json_c_strerror_override.h" | |||||
/* | /* | ||||
* Override strerror() to get consistent output across platforms. | * Override strerror() to get consistent output across platforms. |
@@ -1,5 +1,5 @@ | |||||
#ifndef _json_strerror_override_h_ | |||||
#define _json_strerror_override_h_ | |||||
#ifndef _json_json_c_strerror_override_h_ | |||||
#define _json_json_c_strerror_override_h_ | |||||
/** | /** | ||||
* @file | * @file | ||||
@@ -27,4 +27,4 @@ JSON_EXPORT char *_json_c_strerror(int errno_in); | |||||
} | } | ||||
#endif | #endif | ||||
#endif /* _json_strerror_override_h_ */ | |||||
#endif /* _json_json_c_strerror_override_h_ */ |
@@ -1,5 +1,5 @@ | |||||
#ifndef __json_strerror_override_private_h__ | |||||
#define __json_strerror_override_private_h__ | |||||
#ifndef __json_json_c_strerror_override_private_h__ | |||||
#define __json_json_c_strerror_override_private_h__ | |||||
/** | /** | ||||
* @file | * @file |
@@ -1,12 +1,12 @@ | |||||
#ifndef __vasprintf_compat_h | |||||
#define __vasprintf_compat_h | |||||
#ifndef __json_c_vasprintf_compat_h | |||||
#define __json_c_vasprintf_compat_h | |||||
/** | /** | ||||
* @file | * @file | ||||
* @brief Do not use, json-c internal, may be changed or removed at any time. | * @brief Do not use, json-c internal, may be changed or removed at any time. | ||||
*/ | */ | ||||
#include "snprintf_compat.h" | |||||
#include "json_c_snprintf_compat.h" | |||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -57,4 +57,4 @@ static int vasprintf(char **buf, const char *fmt, va_list ap) | |||||
} | } | ||||
#endif /* !HAVE_VASPRINTF */ | #endif /* !HAVE_VASPRINTF */ | ||||
#endif /* __vasprintf_compat_h */ | |||||
#endif /* __json_c_vasprintf_compat_h */ |
@@ -12,7 +12,7 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "strerror_override.h" | |||||
#include "json_c_strerror_override.h" | |||||
#include <assert.h> | #include <assert.h> | ||||
#include <ctype.h> | #include <ctype.h> | ||||
@@ -29,10 +29,10 @@ | |||||
#include "json_object_private.h" | #include "json_object_private.h" | ||||
#include "json_util.h" | #include "json_util.h" | ||||
#include "json_c_linkhash.h" | #include "json_c_linkhash.h" | ||||
#include "math_compat.h" | |||||
#include "json_c_math_compat.h" | |||||
#include "json_c_printbuf.h" | #include "json_c_printbuf.h" | ||||
#include "snprintf_compat.h" | |||||
#include "strdup_compat.h" | |||||
#include "json_c_snprintf_compat.h" | |||||
#include "json_c_strdup_compat.h" | |||||
#if SIZEOF_LONG_LONG != SIZEOF_INT64_T | #if SIZEOF_LONG_LONG != SIZEOF_INT64_T | ||||
#error "The long long type isn't 64-bits" | #error "The long long type isn't 64-bits" | ||||
@@ -8,7 +8,7 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "strerror_override.h" | |||||
#include "json_c_strerror_override.h" | |||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <stdarg.h> | #include <stdarg.h> | ||||
@@ -17,8 +17,8 @@ | |||||
#include <string.h> | #include <string.h> | ||||
#include "json_pointer.h" | #include "json_pointer.h" | ||||
#include "strdup_compat.h" | |||||
#include "vasprintf_compat.h" | |||||
#include "json_c_strdup_compat.h" | |||||
#include "json_c_vasprintf_compat.h" | |||||
/** | /** | ||||
* JavaScript Object Notation (JSON) Pointer | * JavaScript Object Notation (JSON) Pointer | ||||
@@ -15,7 +15,7 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "math_compat.h" | |||||
#include "json_c_math_compat.h" | |||||
#include <assert.h> | #include <assert.h> | ||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <limits.h> | #include <limits.h> | ||||
@@ -33,7 +33,7 @@ | |||||
#include "json_tokener.h" | #include "json_tokener.h" | ||||
#include "json_util.h" | #include "json_util.h" | ||||
#include "json_c_printbuf.h" | #include "json_c_printbuf.h" | ||||
#include "strdup_compat.h" | |||||
#include "json_c_strdup_compat.h" | |||||
#ifdef HAVE_LOCALE_H | #ifdef HAVE_LOCALE_H | ||||
#include <locale.h> | #include <locale.h> | ||||
@@ -12,7 +12,7 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#undef realloc | #undef realloc | ||||
#include "strerror_override.h" | |||||
#include "json_c_strerror_override.h" | |||||
#include <ctype.h> | #include <ctype.h> | ||||
#include <limits.h> | #include <limits.h> | ||||
@@ -48,7 +48,7 @@ | |||||
#define open _open | #define open _open | ||||
#endif | #endif | ||||
#include "snprintf_compat.h" | |||||
#include "json_c_snprintf_compat.h" | |||||
#include "json_c_debug.h" | #include "json_c_debug.h" | ||||
#include "json_inttypes.h" | #include "json_inttypes.h" | ||||
@@ -1,5 +1,5 @@ | |||||
#include "strerror_override.h" | |||||
#include "strerror_override_private.h" | |||||
#include "json_c_strerror_override.h" | |||||
#include "json_c_strerror_override_private.h" | |||||
#ifdef NDEBUG | #ifdef NDEBUG | ||||
#undef NDEBUG | #undef NDEBUG | ||||
#endif | #endif | ||||
@@ -7,7 +7,7 @@ | |||||
#include "config.h" | #include "config.h" | ||||
#include "json.h" | #include "json.h" | ||||
#include "json_tokener.h" | #include "json_tokener.h" | ||||
#include "snprintf_compat.h" | |||||
#include "json_c_snprintf_compat.h" | |||||
#ifdef HAVE_LOCALE_H | #ifdef HAVE_LOCALE_H | ||||
#include <locale.h> | #include <locale.h> | ||||
@@ -1,5 +1,5 @@ | |||||
#include "strerror_override.h" | |||||
#include "strerror_override_private.h" | |||||
#include "json_c_strerror_override.h" | |||||
#include "json_c_strerror_override_private.h" | |||||
#ifdef WIN32 | #ifdef WIN32 | ||||
#define WIN32_LEAN_AND_MEAN | #define WIN32_LEAN_AND_MEAN | ||||
#include <io.h> | #include <io.h> | ||||
@@ -20,7 +20,7 @@ | |||||
#include "json.h" | #include "json.h" | ||||
#include "json_util.h" | #include "json_util.h" | ||||
#include "snprintf_compat.h" | |||||
#include "json_c_snprintf_compat.h" | |||||
static void test_read_valid_with_fd(const char *testdir); | static void test_read_valid_with_fd(const char *testdir); | ||||
static void test_read_valid_nested_with_fd(const char *testdir); | static void test_read_valid_nested_with_fd(const char *testdir); | ||||