API -&nbspSmartSlog KP Library
structures.h
Go to the documentation of this file.
1 
35 #include <stdio.h>
36 #include <stdlib.h>
37 #include "utils/kp_bool.h"
38 #include "utils/list.h"
39 
40 #ifndef _STRUCTURES_H
41 #define _STRUCTURES_H
42 
43 #if defined(WIN32) || defined(WINCE) || defined(SMARTSLOG_WIN_EXPORTS)
44 #define SSLOG_EXTERN __declspec(dllexport)
45 #else
46 #define SSLOG_EXTERN
47 #endif
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
53 /******************************************************************************/
54 /******************************** Enums list **********************************/
56 
60 enum rtti_types {
63  RTTI_CLASS = 2,
71 };
72 
73 
80 };
81 
82 
98 };
99 
101 typedef enum action_type_enum {
106 } action_type;
107 
109 
111 
115 enum subscribe_status {
116  SBCR_STATUS_MIN,
117  SBCR_STATUS_NO,
118  SBCR_STATUS_SUBSCRIBED,
119  SBCR_STATUS_UPDATING,
120  SBCR_STATUS_MAX
121 };
122 
124 
125 /******************************************************************************/
126 
127 
128 
129 /******************************************************************************/
130 /****************************** Structures list *******************************/
132 
136 typedef struct property_s {
137  int rtti;
138  int type;
139  char *name;
140  char *domain;
141  char *about;
142  list_t *subpropertyof;
143  list_t *oneof;
146 } property_t;
147 
148 
154 typedef struct prop_val_s {
156  void *prop_value;
157 } prop_val_t;
158 
159 
163 typedef struct class_s {
164  int rtti;
165  char *classtype;
166  list_t *superclasses;
167  list_t *oneof;
168  list_t *properties;
169  list_t *instances;
170 } class_t;
171 
172 
176 typedef struct individual_s {
177  int rtti;
178  char *uuid;
179  char *classtype;
180  list_t *properties;
183 } individual_t;
184 
185 
187 /******************************************************************************/
188 
189 
190 
191 /******************************************************************************/
192 /****************************** Functions list ********************************/
194 
197 SSLOG_EXTERN void sslog_free_value_struct_with_func(prop_val_t *prop_val, void (*free_data_func)(void*));
199 SSLOG_EXTERN void sslog_free_class(class_t *ont_class);
201 
202 SSLOG_EXTERN prop_val_t* sslog_new_value_struct(property_t *prop, const void *data);
203 
204 SSLOG_EXTERN int sslog_get_rtti_type(const void* entity);
205 
207 
208 
210 
211 int get_sbcr_status(individual_t *individual);
212 int set_sbcr_status(individual_t *individual, int status);
213 
215 /******************************************************************************/
216 
217 #ifdef __cplusplus
218 }
219 #endif
220 
221 #endif /* _STRUCTURES_H */