diff options
Diffstat (limited to 'src/jsonfmt.c')
-rw-r--r-- | src/jsonfmt.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/jsonfmt.c b/src/jsonfmt.c index 9ccac37..86a9389 100644 --- a/src/jsonfmt.c +++ b/src/jsonfmt.c @@ -1,4 +1,4 @@ -/* grecs - Gray's Extensible Configuration System +/* argot - Gray's Extensible Configuration System Copyright (C) 2007-2016 Sergey Poznyakoff Grecs is free software; you can redistribute it and/or modify it @@ -19,8 +19,8 @@ #endif #include <string.h> #include <stdlib.h> -#include "grecs.h" -#include "grecs/json.h" +#include "argot.h" +#include "argot/json.h" static void json_writez(struct json_format *fmt, char const *str) @@ -90,9 +90,9 @@ json_format_number(struct json_format *fmt, double n) char *buffer = NULL; size_t size = 0; if (fmt->precision == -1) - grecs_asprintf(&buffer, &size, "%e", n); + argot_asprintf(&buffer, &size, "%e", n); else - grecs_asprintf(&buffer, &size, "%.*f", fmt->precision, n); + argot_asprintf(&buffer, &size, "%.*f", fmt->precision, n); json_writez(fmt, buffer); free(buffer); } @@ -124,10 +124,10 @@ json_format_obj(struct json_format *fmt, struct json_value *obj, size_t level) size_t count, i; struct json_pair **keypairs, **kp; - count = grecs_symtab_count_entries(obj->v.o); - keypairs = grecs_calloc(count, sizeof(*keypairs)); + count = argot_symtab_count_entries(obj->v.o); + keypairs = argot_calloc(count, sizeof(*keypairs)); kp = keypairs; - grecs_symtab_enumerate(obj->v.o, collect_keypairs, &kp); + argot_symtab_enumerate(obj->v.o, collect_keypairs, &kp); qsort(keypairs, count, sizeof(*keypairs), keypair_cmp_name); json_writec(fmt, '{'); @@ -148,7 +148,7 @@ json_format_obj(struct json_format *fmt, struct json_value *obj, size_t level) } } json_writec(fmt, '}'); - grecs_free(keypairs); + argot_free(keypairs); } static void |