- Timestamp:
- 2015-02-22T16:15:28Z (10 years ago)
- Children:
- ee170a1
- Parents:
- 782a6ee
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/parson.c
r782a6ee r989f431 769 769 } 770 770 771 JSON_Value * json_parse_string(const char *string) { 771 JSON_Value * json_parse_first(const char *string, const char **end) { 772 const char *pos; 773 JSON_Value *ret; 774 772 775 if (!string) 773 776 return NULL; … … 775 778 if (*string != '{' && *string != '[') 776 779 return NULL; 777 return parse_value((const char**)&string, 0); 780 781 pos = string; 782 ret = parse_value(&pos, 0); 783 if (end) 784 *end = pos; 785 786 return ret; 787 } 788 789 JSON_Value * json_parse_string(const char *string) { 790 return json_parse_first(string, NULL); 778 791 } 779 792 -
lib/parson.h
r782a6ee r989f431 53 53 }; 54 54 typedef int JSON_Status; 55 55 56 56 /* Parses first JSON value in a file, returns NULL in case of error */ 57 57 JSON_Value * json_parse_file(const char *filename); … … 60 60 returns NULL in case of error */ 61 61 JSON_Value * json_parse_file_with_comments(const char *filename); 62 62 63 /* Like json_parse_string, but *end is set to wherever it stopped parsing. */ 64 JSON_Value * json_parse_first(const char *string, const char **end); 65 63 66 /* Parses first JSON value in a string, returns NULL in case of error */ 64 67 JSON_Value * json_parse_string(const char *string);
Note: See TracChangeset
for help on using the changeset viewer.