summaryrefslogtreecommitdiff
path: root/src/lib/eolian/eolian_database.h
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-08-30 16:08:31 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-08-30 16:22:20 +0200
commitfbcad90fece71a55391056fdc41d59edd32a1dfd (patch)
treee486bf313a2b5bd74b07cdaad6218c3631d5a18e /src/lib/eolian/eolian_database.h
parentbbd213bcfb4e8dc3a809b8346cdfba2144f963ed (diff)
eolian: add parsing for @move and @by_ref
The @by_ref qualifier is now allowed on parameters, returns and struct fields in the usual qualifier section. It will mean that this type is passed around by reference, and will only be allowed on types that are not already pointer-like. The @move qualifier will replace @owned as one with a clearer meaning. It means "transfer of ownership". It has the same semantics as the current @owned, i.e. on return values it transfers ownership of the value to the caller, on parameters it transfers ownership to the callee (the inverse is the default when not specified). On struct fields, it means the field will transfer together with the struct that contains it.
Diffstat (limited to 'src/lib/eolian/eolian_database.h')
-rw-r--r--src/lib/eolian/eolian_database.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index 1e26e24..e66543f 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -227,12 +227,16 @@ struct _Eolian_Function
227 Eolian_Implement *impl; 227 Eolian_Implement *impl;
228 Eolian_Documentation *get_return_doc; 228 Eolian_Documentation *get_return_doc;
229 Eolian_Documentation *set_return_doc; 229 Eolian_Documentation *set_return_doc;
230 Eina_List *ctor_of;
231 Eolian_Class *klass;
230 Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */ 232 Eina_Bool obj_is_const :1; /* True if the object has to be const. Useful for a few methods. */
231 Eina_Bool get_return_no_unused :1; /* also used for methods */ 233 Eina_Bool get_return_no_unused :1; /* also used for methods */
232 Eina_Bool set_return_no_unused :1; 234 Eina_Bool set_return_no_unused :1;
235 Eina_Bool get_return_move :1;
236 Eina_Bool set_return_move :1;
237 Eina_Bool get_return_by_ref :1;
238 Eina_Bool set_return_by_ref :1;
233 Eina_Bool is_static :1; 239 Eina_Bool is_static :1;
234 Eina_List *ctor_of;
235 Eolian_Class *klass;
236}; 240};
237 241
238struct _Eolian_Part 242struct _Eolian_Part
@@ -255,6 +259,8 @@ struct _Eolian_Function_Parameter
255 Eolian_Documentation *doc; 259 Eolian_Documentation *doc;
256 Eolian_Parameter_Dir param_dir; 260 Eolian_Parameter_Dir param_dir;
257 Eina_Bool optional :1; /* True if this argument is optional */ 261 Eina_Bool optional :1; /* True if this argument is optional */
262 Eina_Bool by_ref :1;
263 Eina_Bool move :1;
258}; 264};
259 265
260struct _Eolian_Type 266struct _Eolian_Type
@@ -342,6 +348,8 @@ struct _Eolian_Struct_Type_Field
342 Eolian_Object base; 348 Eolian_Object base;
343 Eolian_Type *type; 349 Eolian_Type *type;
344 Eolian_Documentation *doc; 350 Eolian_Documentation *doc;
351 Eina_Bool move :1;
352 Eina_Bool by_ref :1;
345}; 353};
346 354
347struct _Eolian_Enum_Type_Field 355struct _Eolian_Enum_Type_Field