- Timestamp:
- 2015-02-22T17:01:53Z (10 years ago)
- Children:
- 56b57b1a
- Parents:
- 989f431
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/parson.c
r989f431 ree170a1 873 873 return NULL; 874 874 return object->names[index]; 875 } 876 877 int json_object_get_tuple(const JSON_Object *object, size_t index, 878 const char **key, const JSON_Value **value) { 879 if (index >= json_object_get_count(object)) 880 return 0; 881 *key = object->names[index]; 882 *value = object->values[index]; 883 return 1; 875 884 } 876 885 -
lib/parson.h
r989f431 ree170a1 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 63 /* Like json_parse_string, but *end is set to wherever it stopped parsing. */ 64 64 JSON_Value * json_parse_first(const char *string, const char **end); 65 65 66 66 /* Parses first JSON value in a string, returns NULL in case of error */ 67 67 JSON_Value * json_parse_string(const char *string); … … 117 117 size_t json_object_get_count(const JSON_Object *object); 118 118 const char * json_object_get_name (const JSON_Object *object, size_t index); 119 119 int json_object_get_tuple(const JSON_Object *object, size_t index, 120 const char **key, const JSON_Value **value); /* 0 == fail */ 121 120 122 /* Creates new name-value pair or frees and replaces old value with new one. */ 121 123 JSON_Status json_object_set_value(JSON_Object *object, const char *name, JSON_Value *value);
Note: See TracChangeset
for help on using the changeset viewer.