1 #include "oils_utils.h"
3 char* oilsFMGetString( jsonObject* object, char* field ) {
4 return jsonObjectToSimpleString(oilsFMGetObject( object, field ));
8 jsonObject* oilsFMGetObject( jsonObject* object, char* field ) {
9 if(!(object && field)) return NULL;
10 if( object->type != JSON_ARRAY || !object->classname ) return NULL;
11 int pos = fm_ntop(object->classname, field);
12 if( pos > -1 ) return jsonObjectGetIndex( object, pos );
17 int oilsFMSetString( jsonObject* object, char* field, char* string ) {
18 if(!(object && field && string)) return -1;
19 int pos = fm_ntop(object->classname, field);
21 jsonObjectSetIndex( object, pos, jsonNewObject(string) );