summaryrefslogtreecommitdiff
path: root/src/lib/eolian/eolian_database.h
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-06-21 15:05:50 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-06-24 15:15:30 +0200
commit1bbf4380abce4c704eb101d1bbfd8795ee31044b (patch)
treee0117464464d17ea8be870172e48d3c9bafc1495 /src/lib/eolian/eolian_database.h
parent61235a6e5c47a564d217576fbcdef4e3c0a59b6f (diff)
eolian: add library support for declaring and using errors
You can now declare errors like this: error Foo = "message"; [[documentation]] Then you can use them as types like this: foo { return: error(Error1, Error2, ...); } They have a separate type category and storage. They are checked for redefinitions the same as anything else though. This does not add any generator support nor it adds any advanced checking. Ref T6890
Diffstat (limited to 'src/lib/eolian/eolian_database.h')
-rw-r--r--src/lib/eolian/eolian_database.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index 0dce769..950e411 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -41,6 +41,7 @@ struct _Eolian_Unit
41 Eina_Hash *classes; 41 Eina_Hash *classes;
42 Eina_Hash *globals; 42 Eina_Hash *globals;
43 Eina_Hash *constants; 43 Eina_Hash *constants;
44 Eina_Hash *errors;
44 Eina_Hash *aliases; 45 Eina_Hash *aliases;
45 Eina_Hash *structs; 46 Eina_Hash *structs;
46 Eina_Hash *enums; 47 Eina_Hash *enums;
@@ -60,6 +61,7 @@ typedef struct _Eolian_State_Area
60 Eina_Hash *enums_f; 61 Eina_Hash *enums_f;
61 Eina_Hash *globals_f; 62 Eina_Hash *globals_f;
62 Eina_Hash *constants_f; 63 Eina_Hash *constants_f;
64 Eina_Hash *errors_f;
63 Eina_Hash *objects_f; 65 Eina_Hash *objects_f;
64} Eolian_State_Area; 66} Eolian_State_Area;
65 67
@@ -267,6 +269,7 @@ struct _Eolian_Type
267 { 269 {
268 Eolian_Class *klass; 270 Eolian_Class *klass;
269 Eolian_Typedecl *tdecl; 271 Eolian_Typedecl *tdecl;
272 Eolian_Error *error;
270 }; 273 };
271 Eina_Bool is_const :1; 274 Eina_Bool is_const :1;
272 Eina_Bool is_ptr :1; 275 Eina_Bool is_ptr :1;
@@ -325,6 +328,14 @@ struct _Eolian_Event
325 Eina_Bool is_restart :1; 328 Eina_Bool is_restart :1;
326}; 329};
327 330
331struct _Eolian_Error
332{
333 Eolian_Object base;
334 Eina_Stringshare *msg;
335 Eolian_Documentation *doc;
336 Eina_Bool is_extern :1;
337};
338
328struct _Eolian_Struct_Type_Field 339struct _Eolian_Struct_Type_Field
329{ 340{
330 Eolian_Object base; 341 Eolian_Object base;
@@ -448,4 +459,8 @@ void database_event_del(Eolian_Event *event);
448/* parts */ 459/* parts */
449void database_part_del(Eolian_Part *part); 460void database_part_del(Eolian_Part *part);
450 461
462/* errors */
463void database_error_del(Eolian_Error *err);
464void database_error_add(Eolian_Unit *unit, Eolian_Error *err);
465
451#endif 466#endif