summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorGravatar default2023-08-08 19:29:34 +0200
committerGravatar default2023-08-08 19:29:34 +0200
commit3e5bb109d14e194958a448a0e2feb55f685afaf2 (patch)
treefb032c24cef0b1ad6c5c41651fff2be6f203fe92 /data.c
parentUpdated RELEASE_NOTES. (diff)
downloadsnac2-3e5bb109d14e194958a448a0e2feb55f685afaf2.tar.gz
snac2-3e5bb109d14e194958a448a0e2feb55f685afaf2.tar.xz
snac2-3e5bb109d14e194958a448a0e2feb55f685afaf2.zip
Renamed json dump functions to new xs spec.
Diffstat (limited to 'data.c')
-rw-r--r--data.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/data.c b/data.c
index e1e5484..982b7c4 100644
--- a/data.c
+++ b/data.c
@@ -632,7 +632,7 @@ int _object_add(const char *id, const xs_dict *obj, int ow)
632 if ((f = fopen(fn, "w")) != NULL) { 632 if ((f = fopen(fn, "w")) != NULL) {
633 flock(fileno(f), LOCK_EX); 633 flock(fileno(f), LOCK_EX);
634 634
635 xs_json_dump_pp(obj, 4, f); 635 xs_json_dump(obj, 4, f);
636 fclose(f); 636 fclose(f);
637 637
638 /* does this object has a parent? */ 638 /* does this object has a parent? */
@@ -1175,7 +1175,7 @@ int following_add(snac *snac, const char *actor, const xs_dict *msg)
1175 FILE *f; 1175 FILE *f;
1176 1176
1177 if ((f = fopen(fn, "w")) != NULL) { 1177 if ((f = fopen(fn, "w")) != NULL) {
1178 xs_json_dump_pp(msg, 4, f); 1178 xs_json_dump(msg, 4, f);
1179 fclose(f); 1179 fclose(f);
1180 1180
1181 /* get the filename of the actor object */ 1181 /* get the filename of the actor object */
@@ -1913,7 +1913,7 @@ void notify_add(snac *snac, const char *type, const char *utype,
1913 noti = xs_dict_append(noti, "objid", objid); 1913 noti = xs_dict_append(noti, "objid", objid);
1914 1914
1915 if ((f = fopen(fn, "w")) != NULL) { 1915 if ((f = fopen(fn, "w")) != NULL) {
1916 xs_json_dump_pp(noti, 4, f); 1916 xs_json_dump(noti, 4, f);
1917 fclose(f); 1917 fclose(f);
1918 } 1918 }
1919} 1919}
@@ -1986,7 +1986,7 @@ static xs_dict *_enqueue_put(const char *fn, xs_dict *msg)
1986 FILE *f; 1986 FILE *f;
1987 1987
1988 if ((f = fopen(tfn, "w")) != NULL) { 1988 if ((f = fopen(tfn, "w")) != NULL) {
1989 xs_json_dump_pp(msg, 4, f); 1989 xs_json_dump(msg, 4, f);
1990 fclose(f); 1990 fclose(f);
1991 1991
1992 rename(tfn, fn); 1992 rename(tfn, fn);
@@ -2484,8 +2484,8 @@ void srv_archive(const char *direction, const char *url, xs_dict *req,
2484 xs *meta_fn = xs_fmt("%s/_META", dir); 2484 xs *meta_fn = xs_fmt("%s/_META", dir);
2485 2485
2486 if ((f = fopen(meta_fn, "w")) != NULL) { 2486 if ((f = fopen(meta_fn, "w")) != NULL) {
2487 xs *j1 = xs_json_dumps_pp(req, 4); 2487 xs *j1 = xs_json_dumps(req, 4);
2488 xs *j2 = xs_json_dumps_pp(headers, 4); 2488 xs *j2 = xs_json_dumps(headers, 4);
2489 2489
2490 fprintf(f, "dir: %s\n", direction); 2490 fprintf(f, "dir: %s\n", direction);
2491 2491
@@ -2513,7 +2513,7 @@ void srv_archive(const char *direction, const char *url, xs_dict *req,
2513 xs *j1 = NULL; 2513 xs *j1 = NULL;
2514 2514
2515 if (v1 != NULL) 2515 if (v1 != NULL)
2516 j1 = xs_json_dumps_pp(v1, 4); 2516 j1 = xs_json_dumps(v1, 4);
2517 2517
2518 if (j1 != NULL) 2518 if (j1 != NULL)
2519 fwrite(j1, strlen(j1), 1, f); 2519 fwrite(j1, strlen(j1), 1, f);
@@ -2544,7 +2544,7 @@ void srv_archive(const char *direction, const char *url, xs_dict *req,
2544 xs *j1 = NULL; 2544 xs *j1 = NULL;
2545 2545
2546 if (v1 != NULL) 2546 if (v1 != NULL)
2547 j1 = xs_json_dumps_pp(v1, 4); 2547 j1 = xs_json_dumps(v1, 4);
2548 2548
2549 if (j1 != NULL) 2549 if (j1 != NULL)
2550 fwrite(j1, strlen(j1), 1, f); 2550 fwrite(j1, strlen(j1), 1, f);
@@ -2581,7 +2581,7 @@ void srv_archive_error(const char *prefix, const xs_str *err,
2581 if (req) { 2581 if (req) {
2582 fprintf(f, "Request headers:\n"); 2582 fprintf(f, "Request headers:\n");
2583 2583
2584 xs_json_dump_pp(req, 4, f); 2584 xs_json_dump(req, 4, f);
2585 2585
2586 fprintf(f, "\n"); 2586 fprintf(f, "\n");
2587 } 2587 }
@@ -2590,7 +2590,7 @@ void srv_archive_error(const char *prefix, const xs_str *err,
2590 fprintf(f, "Data:\n"); 2590 fprintf(f, "Data:\n");
2591 2591
2592 if (xs_type(data) == XSTYPE_LIST || xs_type(data) == XSTYPE_DICT) { 2592 if (xs_type(data) == XSTYPE_LIST || xs_type(data) == XSTYPE_DICT) {
2593 xs_json_dump_pp(data, 4, f); 2593 xs_json_dump(data, 4, f);
2594 } 2594 }
2595 else 2595 else
2596 fprintf(f, "%s", data); 2596 fprintf(f, "%s", data);