diff options
| author | Joey Adams | 2010-07-24 22:28:46 +0000 |
|---|---|---|
| committer | Joey Adams | 2010-07-24 22:28:46 +0000 |
| commit | f475e581b72b8c42cf951f6653610d15e71caeee (patch) | |
| tree | 0a30a239ae10b3ed799688ecbd6791d4488a2cff /json.h | |
| parent | b32257221b4b8e15fada7aabd0fe6e129e00d3e8 (diff) | |
* Migrated my Unicode functions to util.c and made them rely more on
PostgreSQL's pg_wchar.h routines.
* Touched up various functions' documentation.
json_node's are currently encoded in UTF-8, and the JSON module is not
100% compatible with arbitrary server encodings yet. I plan to switch
from UTF-8 to the server encoding pretty soon, after which JSON should be
a well-behaved datatype as far as charsets go.
Diffstat (limited to 'json.h')
| -rw-r--r-- | json.h | 29 |
1 files changed, 0 insertions, 29 deletions
@@ -162,32 +162,7 @@ json_head(json_node * parent) } } - -/* - * Decodes a JSON-encoded string literal - * (If you're interested in the decoding JSON in general, see json_decode). - * If strict is true, string must be double-quoted, - * as is required by the JSON RFC. - * Otherwise, the string may be single- or double-quoted. - * Also, no whitespace skipping is done, so the caller should only - * call this function when it expects **sp to be either " or ' - * - * On success, returns the decoded string and passes that string's length - * through *length (which must not be NULL). On failure (parse error), - * returns NULL and leaves *length untouched. - */ char *json_decode_string(const char **sp, size_t *length, bool strict); - -/* - * Encodes a string literal JSON-style using the given quote character, - * only escaping characters when necessary - * (If you're interested in encoding JSON in general, see json_encode). - * Note that using anything but '"' as the quote character will result in - * invalid JSON. - * - * Returns NULL if input is invalid UTF-8 or if an invalid quote character - * (such as backslash) is given. - */ char *json_encode_string(const char *str, size_t length, char quote, bool escape_unicode); /* Add child to parent, putting it at the end. */ @@ -199,10 +174,6 @@ void json_remove(json_node * node); /* Update the value of a node, preserving position and key information. */ void json_replace_value(json_node * node, json_node * replacement); -/* Note that the factory functions and get/set functions do not validate input. - * However, json_encode validates node contents to avoid producing - * invalid JSON. */ - /* Node factory functions */ json_node *json_mknode(json_type type); json_node *json_mkbool(bool v_bool); |
