Rename json_{load,dump} to json_{load,dump}_file
[profile/ivi/jansson.git] / src / dump.c
index e5af458..9645e9f 100644 (file)
@@ -225,20 +225,6 @@ static int do_dump(const json_t *json, uint32_t flags, int depth,
 }
 
 
-int json_dump(const json_t *json, const char *path, uint32_t flags)
-{
-    int result;
-
-    FILE *output = fopen(path, "w");
-    if(!output)
-        return -1;
-
-    result = json_dumpf(json, output, flags);
-
-    fclose(output);
-    return result;
-}
-
 char *json_dumps(const json_t *json, uint32_t flags)
 {
     strbuffer_t strbuff;
@@ -265,3 +251,17 @@ int json_dumpf(const json_t *json, FILE *output, uint32_t flags)
         return -1;
     return dump_to_file("\n", 1, (void *)output);
 }
+
+int json_dump_file(const json_t *json, const char *path, uint32_t flags)
+{
+    int result;
+
+    FILE *output = fopen(path, "w");
+    if(!output)
+        return -1;
+
+    result = json_dumpf(json, output, flags);
+
+    fclose(output);
+    return result;
+}