Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up header files somewhat #620

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/github_commits.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <string.h>

#include <curl/curl.h>
#include <jansson.h>
#include "jansson.h"

#define BUFFER_SIZE (256 * 1024) /* 256 KB */

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* it under the terms of the MIT license. See LICENSE for details.
*/

#include <jansson.h>
#include "jansson.h"
#include <stdio.h>
#include <stdlib.h>

Expand Down
2 changes: 2 additions & 0 deletions src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#include <unistd.h>
#endif

#include "hashtable.h"
#include "jansson.h"
#include "jansson_config.h"
#include "strbuffer.h"
#include "utf.h"

Expand Down
3 changes: 3 additions & 0 deletions src/error.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include "jansson.h"
#include "jansson_private.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>

void jsonp_error_init(json_error_t *error, const char *source) {
Expand Down
4 changes: 2 additions & 2 deletions src/hashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#if HAVE_CONFIG_H
#include <jansson_private_config.h>
#include "jansson_private_config.h"
#endif

#include <stdlib.h>
Expand All @@ -18,7 +18,7 @@

#include "hashtable.h"
#include "jansson_private.h" /* for container_of() */
#include <jansson_config.h> /* for JSON_INLINE */
#include "jansson_config.h" /* for JSON_INLINE */

#ifndef INITIAL_HASHTABLE_ORDER
#define INITIAL_HASHTABLE_ORDER 3
Expand Down
4 changes: 1 addition & 3 deletions src/hashtable_seed.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

#ifdef HAVE_CONFIG_H
#include <jansson_private_config.h>
#include "jansson_private_config.h"
#endif

#include <stdio.h>
Expand Down Expand Up @@ -42,8 +42,6 @@
#include <windows.h>
#endif

#include "jansson.h"

static uint32_t buf_to_uint32(char *data) {
size_t i;
uint32_t result = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/load.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
#define _GNU_SOURCE
#endif

#include "jansson_config.h"
#include "jansson_private.h"

#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion src/lookup3.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy.
#include <stdlib.h>

#ifdef HAVE_CONFIG_H
#include <jansson_private_config.h>
#include "jansson_private_config.h"
#endif

#ifdef HAVE_STDINT_H
Expand Down
4 changes: 4 additions & 0 deletions src/pack_unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
*/

#include "jansson.h"
#include "jansson_config.h"
#include "jansson_private.h"
#include "hashtable.h"
#include "strbuffer.h"
#include "utf.h"
#include <stdarg.h>
#include <string.h>

typedef struct {
Expand Down
1 change: 1 addition & 0 deletions src/strbuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "strbuffer.h"
#include "jansson_private.h"
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

Expand Down
4 changes: 3 additions & 1 deletion src/strconv.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
#include "jansson_config.h"
#include "jansson_private.h"
#include "strbuffer.h"
#include <assert.h>
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* need jansson_private_config.h to get the correct snprintf */
#ifdef HAVE_CONFIG_H
#include <jansson_private_config.h>
#include "jansson_private_config.h"
#endif

#if JSON_HAVE_LOCALECONV
Expand Down
1 change: 0 additions & 1 deletion src/utf.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

#include "utf.h"
#include <string.h>

int utf8_encode(int32_t codepoint, char *buffer, size_t *size) {
if (codepoint < 0)
Expand Down
2 changes: 1 addition & 1 deletion src/utf.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define UTF_H

#ifdef HAVE_CONFIG_H
#include <jansson_private_config.h>
#include "jansson_private_config.h"
#endif

#include <stddef.h>
Expand Down
5 changes: 4 additions & 1 deletion src/value.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
#endif

#ifdef HAVE_CONFIG_H
#include <jansson_private_config.h>
#include "jansson_private_config.h"
#endif

#include <math.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Expand All @@ -24,6 +26,7 @@

#include "hashtable.h"
#include "jansson.h"
#include "jansson_config.h"
#include "jansson_private.h"
#include "utf.h"

Expand Down
4 changes: 2 additions & 2 deletions test/bin/json_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
*/

#ifdef HAVE_CONFIG_H
#include <jansson_private_config.h>
#include "jansson_private_config.h"
#endif

#include "jansson.h"
#include <ctype.h>
#include <jansson.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_array.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"

static void test_misc(void) {
json_t *array, *five, *seven, *value;
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_chaos.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#endif

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <stdio.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <string.h>

static void test_copy_simple(void) {
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "jansson_private_config.h"

#include <jansson.h>
#include "jansson.h"
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_dump_callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <stdlib.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_equal.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"

static void test_equal_simple() {
json_t *value1, *value2;
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_fixed_size.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <string.h>

static void test_keylen_iterator(json_t *object) {
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <string.h>

static void file_not_found() {
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_load_callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <stdlib.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_loadb.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <string.h>

static void run_tests() {
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_memory_funcs.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <jansson.h>
#include "jansson.h"
#include <string.h>

#include "util.h"
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_number.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <math.h>

#ifdef INFINITY
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <string.h>

static void test_clear() {
Expand Down
6 changes: 3 additions & 3 deletions test/suites/api/test_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
*/

#ifdef HAVE_CONFIG_H
#include <jansson_private_config.h>
#include "jansson_private_config.h"
#endif

#include <jansson_config.h>
#include "jansson_config.h"

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <string.h>

static void test_bad_args(void) {
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_sprintf.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <string.h>

static void test_sprintf() {
Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <stdio.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion test/suites/api/test_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "util.h"
#include <jansson.h>
#include "jansson.h"
#include <string.h>

static void test_version_str(void) {
Expand Down
4 changes: 2 additions & 2 deletions test/suites/api/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define UTIL_H

#ifdef HAVE_CONFIG_H
#include <jansson_private_config.h>
#include "jansson_private_config.h"
#endif

#include <stdio.h>
Expand All @@ -18,7 +18,7 @@
#include <locale.h>
#endif

#include <jansson.h>
#include "jansson.h"

#define failhdr fprintf(stderr, "%s:%d: ", __FILE__, __LINE__)

Expand Down