blob: 642df20079381633e304707780b598ffabe6ef51 [file] [log] [blame]
diff -ruN a/src/json.c b/src/json.c
--- a/src/json.c 2012-08-14 18:08:21.403880832 -0700
+++ b/src/json.c 2012-08-14 18:12:32.010823782 -0700
@@ -1370,7 +1370,7 @@
int
-lexer (char *buffer, char **p, unsigned int *state, rcstring ** text, size_t *line)
+lexer (const char *buffer, const char **p, unsigned int *state, rcstring ** text, size_t *line)
{
assert (buffer != NULL);
assert (p != NULL);
@@ -2133,7 +2133,7 @@
enum json_error
-json_parse_fragment (struct json_parsing_info *info, char *buffer)
+json_parse_fragment (struct json_parsing_info *info, const char *buffer)
{
json_t *temp = NULL;
@@ -2770,7 +2770,7 @@
enum json_error
-json_parse_document (json_t ** root, char *text)
+json_parse_document (json_t ** root, const char *text)
{
enum json_error error;
struct json_parsing_info *jpi;
diff -ruN a/src/json.h b/src/json.h
--- a/src/json.h 2012-08-14 18:08:21.403880832 -0700
+++ b/src/json.h 2012-08-14 18:10:51.622902467 -0700
@@ -108,7 +108,7 @@
unsigned int state; /*!< the state where the parsing was left on the last parser run */
unsigned int lex_state;
rcstring *lex_text;
- char *p;
+ const char *p;
int string_length_limit_reached; /*!< flag informing if the string limit length defined by JSON_MAX_STRING_LENGTH was reached */
size_t line; // current document line
json_t *cursor; /*!< pointers to nodes belonging to the document tree which aid the document parsing */
@@ -303,7 +303,7 @@
@param buffer a null-terminated c-string containing a JSON document fragment
@return a code describing how the operation ended up
**/
- enum json_error json_parse_fragment (struct json_parsing_info *info, char *buffer);
+ enum json_error json_parse_fragment (struct json_parsing_info *info, const char *buffer);
/**
@@ -312,7 +312,7 @@
@param text a c-string containing a complete JSON text document
@return a pointer to the new document tree or NULL if some error occurred
**/
- enum json_error json_parse_document (json_t ** root, char *text);
+ enum json_error json_parse_document (json_t ** root, const char *text);
/**