Browse Source

Prefix all private files of the library with 'json_c_'.

This is done to avoid possible undesired clashes by too generic naming.
pull/585/head
Björn Esser 5 years ago
parent
commit
759ccf62a0
19 changed files with 50 additions and 50 deletions
  1. +9
    -9
      CMakeLists.txt
  2. +1
    -1
      json_c_linkhash.c
  3. +2
    -2
      json_c_math_compat.h
  4. +2
    -2
      json_c_printbuf.c
  5. +3
    -3
      json_c_random_seed.c
  6. +1
    -1
      json_c_random_seed.h
  7. +3
    -3
      json_c_snprintf_compat.h
  8. +2
    -2
      json_c_strdup_compat.h
  9. +1
    -1
      json_c_strerror_override.c
  10. +3
    -3
      json_c_strerror_override.h
  11. +2
    -2
      json_c_strerror_override_private.h
  12. +4
    -4
      json_c_vasprintf_compat.h
  13. +4
    -4
      json_object.c
  14. +3
    -3
      json_pointer.c
  15. +2
    -2
      json_tokener.c
  16. +2
    -2
      json_util.c
  17. +2
    -2
      tests/test_json_pointer.c
  18. +1
    -1
      tests/test_locale.c
  19. +3
    -3
      tests/test_util_file.c

+ 9
- 9
CMakeLists.txt View File

@@ -321,13 +321,13 @@ set(JSON_C_HEADERS
${JSON_C_PUBLIC_HEADERS}
${PROJECT_BINARY_DIR}/config.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
@@ -342,8 +342,8 @@ set(JSON_C_SOURCES
${PROJECT_SOURCE_DIR}/json_visit.c
${PROJECT_SOURCE_DIR}/json_c_linkhash.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})


+ 1
- 1
json_c_linkhash.c View File

@@ -29,7 +29,7 @@
#endif

#include "json_c_linkhash.h"
#include "random_seed.h"
#include "json_c_random_seed.h"

/* hash functions */
static unsigned long lh_char_hash(const void *k);


math_compat.h → json_c_math_compat.h View File

@@ -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

+ 2
- 2
json_c_printbuf.c View File

@@ -27,8 +27,8 @@

#include "json_c_debug.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);



random_seed.c → json_c_random_seed.c View File

@@ -1,5 +1,5 @@
/*
* random_seed.c
* json_c_random_seed.c
*
* Copyright (c) 2013 Metaparadigm Pte. Ltd.
* Michael Clark <michael@metaparadigm.com>
@@ -9,9 +9,9 @@
*
*/

#include "random_seed.h"
#include "json_c_random_seed.h"
#include "config.h"
#include "strerror_override.h"
#include "json_c_strerror_override.h"
#include <stdio.h>

#define DEBUG_SEED(s)

random_seed.h → json_c_random_seed.h View File

@@ -1,5 +1,5 @@
/*
* random_seed.h
* json_c_random_seed.h
*
* Copyright (c) 2013 Metaparadigm Pte. Ltd.
* Michael Clark <michael@metaparadigm.com>

snprintf_compat.h → json_c_snprintf_compat.h View File

@@ -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
@@ -38,4 +38,4 @@ static int json_c_snprintf(char *str, size_t size, const char *format, ...)
#error Need vsnprintf!
#endif /* !HAVE_SNPRINTF && defined(WIN32) */

#endif /* __snprintf_compat_h */
#endif /* __json_c_snprintf_compat_h */

strdup_compat.h → json_c_strdup_compat.h View File

@@ -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

strerror_override.c → json_c_strerror_override.c View File

@@ -1,5 +1,5 @@
#define STRERROR_OVERRIDE_IMPL 1
#include "strerror_override.h"
#include "json_c_strerror_override.h"

/*
* Override strerror() to get consistent output across platforms.

strerror_override.h → json_c_strerror_override.h View File

@@ -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
@@ -27,4 +27,4 @@ JSON_EXPORT char *_json_c_strerror(int errno_in);
}
#endif

#endif /* _json_strerror_override_h_ */
#endif /* _json_json_c_strerror_override_h_ */

strerror_override_private.h → json_c_strerror_override_private.h View File

@@ -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

vasprintf_compat.h → json_c_vasprintf_compat.h View 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
* @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>

@@ -57,4 +57,4 @@ static int vasprintf(char **buf, const char *fmt, va_list ap)
}
#endif /* !HAVE_VASPRINTF */

#endif /* __vasprintf_compat_h */
#endif /* __json_c_vasprintf_compat_h */

+ 4
- 4
json_object.c View File

@@ -12,7 +12,7 @@

#include "config.h"

#include "strerror_override.h"
#include "json_c_strerror_override.h"

#include <assert.h>
#include <ctype.h>
@@ -29,10 +29,10 @@
#include "json_object_private.h"
#include "json_util.h"
#include "json_c_linkhash.h"
#include "math_compat.h"
#include "json_c_math_compat.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
#error "The long long type isn't 64-bits"


+ 3
- 3
json_pointer.c View File

@@ -8,7 +8,7 @@

#include "config.h"

#include "strerror_override.h"
#include "json_c_strerror_override.h"

#include <ctype.h>
#include <stdarg.h>
@@ -17,8 +17,8 @@
#include <string.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


+ 2
- 2
json_tokener.c View File

@@ -15,7 +15,7 @@

#include "config.h"

#include "math_compat.h"
#include "json_c_math_compat.h"
#include <assert.h>
#include <ctype.h>
#include <limits.h>
@@ -33,7 +33,7 @@
#include "json_tokener.h"
#include "json_util.h"
#include "json_c_printbuf.h"
#include "strdup_compat.h"
#include "json_c_strdup_compat.h"

#ifdef HAVE_LOCALE_H
#include <locale.h>


+ 2
- 2
json_util.c View File

@@ -12,7 +12,7 @@
#include "config.h"
#undef realloc

#include "strerror_override.h"
#include "json_c_strerror_override.h"

#include <ctype.h>
#include <limits.h>
@@ -48,7 +48,7 @@
#define open _open
#endif

#include "snprintf_compat.h"
#include "json_c_snprintf_compat.h"

#include "json_c_debug.h"
#include "json_inttypes.h"


+ 2
- 2
tests/test_json_pointer.c View File

@@ -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
#undef NDEBUG
#endif


+ 1
- 1
tests/test_locale.c View File

@@ -7,7 +7,7 @@
#include "config.h"
#include "json.h"
#include "json_tokener.h"
#include "snprintf_compat.h"
#include "json_c_snprintf_compat.h"

#ifdef HAVE_LOCALE_H
#include <locale.h>


+ 3
- 3
tests/test_util_file.c View File

@@ -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
#define WIN32_LEAN_AND_MEAN
#include <io.h>
@@ -20,7 +20,7 @@

#include "json.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_nested_with_fd(const char *testdir);


Loading…
Cancel
Save