From: Jeremy Tan Date: Tue, 27 Aug 2013 13:00:30 +0000 (+0800) Subject: Add JSON bool function X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=4659fe499233a2dda8e772138fe5f889cab617ed;p=matches%2FMCTX3420.git Add JSON bool function --- diff --git a/server/fastcgi.c b/server/fastcgi.c index 5922616..49bf197 100644 --- a/server/fastcgi.c +++ b/server/fastcgi.c @@ -213,6 +213,16 @@ void FCGI_JSONDouble(const char *key, double value) printf(",\r\n\t\"%s\" : %f", key, value); } +/** + * Similar to FCGI_JsonPair except for boolean values. + * @param key The key of the JSON entry + * @param value The value associated with the key + */ +void FCGI_JSONBool(const char *key, bool value) +{ + printf(",\r\n\t\"%s\" : %s", key, value ? "true" : "false"); +} + /** * Begins a JSON entry by writing the key. To be used in conjunction * with FCGI_JsonValue.