Browse Source

Update json_util

filename should be passed as const char* to functions
json_object_to_file and json_object_to_file
tags/json-c-0.12-20140410
Pascal Bach Pascal Bach 12 years ago
parent
commit
20e4708c8a
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      json_util.c
  2. +2
    -2
      json_util.h

+ 2
- 2
json_util.c View File

@@ -99,7 +99,7 @@ struct json_object* json_object_from_file(const char *filename)


/* extended "format and write to file" function */ /* extended "format and write to file" function */


int json_object_to_file_ext(char *filename, struct json_object *obj, int flags)
int json_object_to_file_ext(const char *filename, struct json_object *obj, int flags)
{ {
const char *json_str; const char *json_str;
int fd, ret; int fd, ret;
@@ -141,7 +141,7 @@ int json_object_to_file_ext(char *filename, struct json_object *obj, int flags)


// backwards compatible "format and write to file" function // backwards compatible "format and write to file" function


int json_object_to_file(char *filename, struct json_object *obj)
int json_object_to_file(const char *filename, struct json_object *obj)
{ {
return json_object_to_file_ext(filename, obj, JSON_C_TO_STRING_PLAIN); return json_object_to_file_ext(filename, obj, JSON_C_TO_STRING_PLAIN);
} }


+ 2
- 2
json_util.h View File

@@ -22,8 +22,8 @@ extern "C" {


/* utility functions */ /* utility functions */
extern struct json_object* json_object_from_file(const char *filename); extern struct json_object* json_object_from_file(const char *filename);
extern int json_object_to_file(char *filename, struct json_object *obj);
extern int json_object_to_file_ext(char *filename, struct json_object *obj, int flags);
extern int json_object_to_file(const char *filename, struct json_object *obj);
extern int json_object_to_file_ext(const char *filename, struct json_object *obj, int flags);
extern int json_parse_int64(const char *buf, int64_t *retval); extern int json_parse_int64(const char *buf, int64_t *retval);
extern int json_parse_double(const char *buf, double *retval); extern int json_parse_double(const char *buf, double *retval);




Loading…
Cancel
Save