]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/c-apps/oils_utils.h
added some log statements, fixed some typos
[Evergreen.git] / Open-ILS / src / c-apps / oils_utils.h
1 #include "objson/object.h"
2 #include "opensrf/log.h"
3 #include "openils/fieldmapper_lookup.h"
4
5 /**
6   Returns the string value for field 'field' in the given object.
7   This method calls jsonObjectToSimpleString so numbers will be
8   returned as strings.
9   @param object The object to inspect
10   @param field The field whose value is requsted
11   @return The string at the given position, if none exists, 
12   then NULL is returned.  The caller must free the returned string
13   */
14 char* oilsFMGetString( jsonObject* object, char* field );
15
16
17 /**
18   Returns the jsonObject found at the specified field in the
19   given object.
20   @param object The object to inspect
21   @param field The field whose value is requsted
22   @return The found object or NULL if none exists.  Do NOT free the 
23   returned object.
24   */
25 jsonObject* oilsFMGetObject( jsonObject* object, char* field );
26
27 /**
28   Sets the given field in the given object to the given string
29   @param object The object to update
30   @param field The field to change
31   @param string The new data
32   @return 0 if the field was updated successfully, -1 on error
33   */
34 int oilsFMSetString( jsonObject* object, char* field, char* string );