Merge branch '1.3'
[jansson.git] / src / load.c
index 2a360ff..925a850 100644 (file)
@@ -401,7 +401,7 @@ out:
     free(lex->value.string);
 }
 
-#ifdef JSON_INTEGER_IS_LONG_LONG
+#if JSON_INTEGER_IS_LONG_LONG
 #define json_strtoint     strtoll
 #else
 #define json_strtoint     strtol
@@ -811,15 +811,13 @@ static int string_eof(void *data)
     return (stream->data[stream->pos] == '\0');
 }
 
-json_t *json_loads(const char *string, json_error_t *error)
+json_t *json_loads(const char *string, size_t flags, json_error_t *error)
 {
     lex_t lex;
     json_t *result;
+    (void)flags; /* unused */
 
-    string_data_t stream_data = {
-        .data = string,
-        .pos = 0
-    };
+    string_data_t stream_data = {string, 0};
 
     if(lex_init(&lex, string_get, string_eof, (void *)&stream_data))
         return NULL;
@@ -840,10 +838,11 @@ out:
     return result;
 }
 
-json_t *json_loadf(FILE *input, json_error_t *error)
+json_t *json_loadf(FILE *input, size_t flags, json_error_t *error)
 {
     lex_t lex;
     json_t *result;
+    (void)flags; /* unused */
 
     if(lex_init(&lex, (get_func)fgetc, (eof_func)feof, input))
         return NULL;
@@ -864,7 +863,7 @@ out:
     return result;
 }
 
-json_t *json_load_file(const char *path, json_error_t *error)
+json_t *json_load_file(const char *path, size_t flags, json_error_t *error)
 {
     json_t *result;
     FILE *fp;
@@ -879,7 +878,7 @@ json_t *json_load_file(const char *path, json_error_t *error)
         return NULL;
     }
 
-    result = json_loadf(fp, error);
+    result = json_loadf(fp, flags, error);
 
     fclose(fp);
     return result;