From 4659fe499233a2dda8e772138fe5f889cab617ed Mon Sep 17 00:00:00 2001 From: Jeremy Tan Date: Tue, 27 Aug 2013 21:00:30 +0800 Subject: [PATCH 1/1] Add JSON bool function --- server/fastcgi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. -- 2.20.1