Changeset 8e3b7ac for lib/json_util.c
- Timestamp:
- 2012-11-08T22:38:20Z (12 years ago)
- Branches:
- master
- Children:
- fb351ce
- Parents:
- 0688e99
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/json_util.c
r0688e99 r8e3b7ac 27 27 #include "json_util.h" 28 28 29 json_value *json_o_get( json_value *obj,json_char *name )29 json_value *json_o_get( const json_value *obj, const json_char *name ) 30 30 { 31 31 int i; … … 41 41 } 42 42 43 const char *json_o_str( json_value *obj,json_char *name )43 const char *json_o_str( const json_value *obj, const json_char *name ) 44 44 { 45 45 json_value *ret = json_o_get( obj, name ); 46 46 47 if( ret )47 if( ret && ret->type == json_string ) 48 48 return ret->u.string.ptr; 49 49 else 50 50 return NULL; 51 51 } 52 53 char *json_o_strdup( const json_value *obj, const json_char *name ) 54 { 55 json_value *ret = json_o_get( obj, name ); 56 57 if( ret && ret->type == json_string && ret->u.string.ptr ) 58 return g_memdup( ret->u.string.ptr, ret->u.string.length + 1 ); 59 else 60 return NULL; 61 }
Note: See TracChangeset
for help on using the changeset viewer.