Project import generated by Copybara. NOKEYCHECK=True GitOrigin-RevId: 54accd928751d8448200402d0e3d075fbb9b6c8e
diff --git a/mjson.patches/mjson-50.patch b/mjson.patches/mjson-50.patch new file mode 100644 index 0000000..101b625 --- /dev/null +++ b/mjson.patches/mjson-50.patch
@@ -0,0 +1,42 @@ +diff -aruN a/src/json.c b/src/json.c +--- a/src/json.c 2010-09-28 06:50:05.000000000 -0700 ++++ b/src/json.c 2012-04-05 15:40:51.396325939 -0700 +@@ -1134,7 +1134,7 @@ + + + char * +-json_escape (char *text) ++json_escape (const char *text) + { + rcstring *output; + size_t i, length; +@@ -1200,7 +1200,7 @@ + + + char * +-json_unescape (char *text) ++json_unescape (const char *text) + { + char *result = malloc (strlen (text) + 1); + size_t r; /* read cursor */ +diff -aruN a/src/json.h b/src/json.h +--- a/src/json.h 2009-12-19 06:16:26.000000000 -0800 ++++ b/src/json.h 2012-04-05 15:41:07.076245294 -0700 +@@ -277,7 +277,7 @@ + @param text an UTF8 char text string + @return an UTF-8 c-string holding the same text string but with escaped characters + **/ +- char *json_escape (char *text); ++ char *json_escape (const char *text); + + /** + * Outputs a new UTF-8 c-string which has all escaped characters replaced by +@@ -286,7 +286,7 @@ + * @param test a UTF-8 c-string + * @return a newly allocated UTF-8 c-string; free with free() + */ +- char *json_unescape (char *text); ++ char *json_unescape (const char *text); + + + /**
diff --git a/mjson.patches/mjson-51.patch b/mjson.patches/mjson-51.patch new file mode 100644 index 0000000..642df20 --- /dev/null +++ b/mjson.patches/mjson-51.patch
@@ -0,0 +1,60 @@ +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); + + + /**
diff --git a/mjson.patches/mjson-52.patch b/mjson.patches/mjson-52.patch new file mode 100644 index 0000000..ddafc0e --- /dev/null +++ b/mjson.patches/mjson-52.patch
@@ -0,0 +1,14 @@ +diff -aruN json-1.3/src/json.c json-1.3.N/src/json.c +--- json-1.3/src/json.c 2015-06-11 19:17:20.000000000 -0700 ++++ json-1.3.N/src/json.c 2015-06-11 19:16:07.000000000 -0700 +@@ -2153,6 +2153,10 @@ + info->state = 1; /* begin object */ + break; + ++ case LEX_BEGIN_ARRAY: ++ info->state = 7; /* begin array */ ++ break; ++ + case LEX_INVALID_CHARACTER: + return JSON_MALFORMED_DOCUMENT; + break;
diff --git a/mjson.tar.gz b/mjson.tar.gz new file mode 100644 index 0000000..1aafa55 --- /dev/null +++ b/mjson.tar.gz Binary files differ
diff --git a/mjson.url b/mjson.url new file mode 100644 index 0000000..f65ae9b --- /dev/null +++ b/mjson.url
@@ -0,0 +1 @@ +http://download.sourceforge.net/mjson/mjson-1.3.tar.gz
diff --git a/mjson.version b/mjson.version new file mode 100644 index 0000000..7e32cd5 --- /dev/null +++ b/mjson.version
@@ -0,0 +1 @@ +1.3