git.ucc.asn.au
/
matches
/
MCTX3420.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b1bc7e
)
Add JSON bool function
author
Jeremy Tan
<
[email protected]
>
Tue, 27 Aug 2013 13:00:30 +0000
(21:00 +0800)
committer
Jeremy Tan
<
[email protected]
>
Tue, 27 Aug 2013 13:00:30 +0000
(21:00 +0800)
server/fastcgi.c
patch
|
blob
|
history
diff --git
a/server/fastcgi.c
b/server/fastcgi.c
index
5922616
..
49bf197
100644
(file)
--- 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.
UCC
git Repository :: git.ucc.asn.au