]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/include/openils/oils_idl.h
LP1642337: Reporter Boolean Filters
[Evergreen.git] / Open-ILS / include / openils / oils_idl.h
1 #ifndef OILS_IDL_API
2 #define OILS_IDL_API
3
4 #include "opensrf/log.h"
5 #include "opensrf/utils.h"
6 #include "opensrf/osrf_hash.h"
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 osrfHash* oilsIDLInit( const char* );
13 osrfHash* oilsIDL(void);
14 osrfHash* oilsIDLFindPath( const char*, ... );
15
16 /* The oilsIDL hash looks like this:
17
18 { aws : {
19         classname       : "aws",
20         fieldmapper     : "actor::workstation",
21         tablename       : "actor.workstation",          optional
22         sequence        : "actor.workstation_id_seq",   optional
23         primarykey      : "id",
24         virtual         : "true",                       optional, "true" | "false"
25         fields          : {
26                 isnew : {
27                         name            : "isnew",
28                         array_position  : "0",
29                         virtual         : "true",       "true" | "false"
30                         primitive       : "number"      optional, JSON primitive (number, string, array,
31                                                         object, bool)
32                 },
33                 ...
34         },
35         links           : {
36                 record : {
37                         field           : "owning_lib", field above that links to another class
38                         rel_type        : "has_a",      link type, "has_a" | "has_many" | "might_have"
39                         class           : "aou",        the foreign class that is linked
40                         key             : "id",         the foreign class's key that creates the link to "field"
41                         map             : []            osrfStringArray used by cstore in "has_many" rel_types to
42                                                         point through a linking class
43                 },
44                 ...
45         },
46         ...
47 }
48
49 */
50
51 int oilsIDL_classIsFieldmapper(const char*);
52 osrfHash* oilsIDL_links( const char* classname );
53 osrfHash* oilsIDL_fields( const char* classname );
54 char * oilsIDL_pton(const char *, int);
55 int oilsIDL_ntop(const char *, const char *);
56
57 #ifdef __cplusplus
58 }
59 #endif
60
61 #endif