summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2017-09-22 20:25:31 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2017-09-22 20:25:31 +0200
commit9009d3dae40bb702de940a995f2830d5a72a2ab2 (patch)
tree65cc04ef978b42097b4857b208426bed8869b113
parent3d8081d08529bbeaf2fe96bcb3667fc8c449e8aa (diff)
downloadefl-9009d3dae40bb702de940a995f2830d5a72a2ab2.tar.gz
eolian: add any_value_ptr
Because pointer Eina_Values and value Eina_Values have slightly different semantics (when it comes to resource management) it's better to split them.
-rw-r--r--src/lib/efl/interfaces/efl_config.eo6
-rw-r--r--src/lib/efl/interfaces/efl_model.eo2
-rw-r--r--src/lib/elementary/elm_prefs.eo2
-rw-r--r--src/lib/eolian/database_validate.c6
-rw-r--r--src/lib/eolian/eo_lexer.c3
-rw-r--r--src/lib/eolian/eo_lexer.h2
6 files changed, 13 insertions, 8 deletions
diff --git a/src/lib/efl/interfaces/efl_config.eo b/src/lib/efl/interfaces/efl_config.eo
index 5adf7b25fa..7dec728efd 100644
--- a/src/lib/efl/interfaces/efl_config.eo
+++ b/src/lib/efl/interfaces/efl_config.eo
@@ -7,7 +7,7 @@ interface Efl.Config ()
[[Set configuration]]
params {
name: string; [[Configuration option name]]
- val: ptr(const(any_value)); [[Configuration option value]]
+ val: const(any_value_ptr); [[Configuration option value]]
}
return: bool; [[$false in case of error: value type was invalid, the
config can't be changed, config does not exist...]]
@@ -17,14 +17,14 @@ interface Efl.Config ()
params {
name: string; [[Configuration option name]]
}
- return: ptr(any_value) @owned; [[Configuration option value]]
+ return: any_value_ptr @owned; [[Configuration option value]]
}
config_list_get @const {
[[Returns a list of generic values under a given key.]]
params {
@in name: string; [[Configuration option name]]
}
- return: iterator<ptr(any_value)> @owned; [[
+ return: iterator<any_value_ptr> @owned; [[
List of configuration option values]]
}
}
diff --git a/src/lib/efl/interfaces/efl_model.eo b/src/lib/efl/interfaces/efl_model.eo
index 7ff10a1aef..39db6c4fa0 100644
--- a/src/lib/efl/interfaces/efl_model.eo
+++ b/src/lib/efl/interfaces/efl_model.eo
@@ -47,7 +47,7 @@ interface Efl.Model ()
]]
params {
@in property: string; [[Property name]]
- @in value: ptr(const(any_value)); [[New value]]
+ @in value: const(any_value_ptr); [[New value]]
}
return: future<any_value>; [[Future returning the recorded value or error]]
}
diff --git a/src/lib/elementary/elm_prefs.eo b/src/lib/elementary/elm_prefs.eo
index 32f72cba26..aba13e64a7 100644
--- a/src/lib/elementary/elm_prefs.eo
+++ b/src/lib/elementary/elm_prefs.eo
@@ -93,7 +93,7 @@ class Elm.Prefs (Elm.Widget, Efl.File)
return: bool; [[$true, on success, $false otherwise]]
params {
@in name: string; [[The name of the item (as declared in the prefs collection)]]
- @in value: ptr(const(any_value)); [[The value to set on the item. It should be typed as the item expects, preferably, or a conversion will take place]]
+ @in value: const(any_value_ptr); [[The value to set on the item. It should be typed as the item expects, preferably, or a conversion will take place]]
}
}
item_value_get @const {
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index 5f9a6b2f71..dd4ea21c9b 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -142,7 +142,8 @@ static const char * const eo_complex_frees[] =
static const char *eo_obj_free = "efl_del";
static const char *eo_str_free = "free";
static const char *eo_strshare_free = "eina_stringshare_del";
-static const char *eo_value_free = "eina_value_free";
+static const char *eo_value_free = "eina_value_flush";
+static const char *eo_value_ptr_free = "eina_value_free";
static Eina_Bool
_validate_type(Eolian_Type *tp)
@@ -190,6 +191,9 @@ _validate_type(Eolian_Type *tp)
case KW_any_value:
tp->freefunc = eina_stringshare_add(eo_value_free);
break;
+ case KW_any_value_ptr:
+ tp->freefunc = eina_stringshare_add(eo_value_ptr_free);
+ break;
default:
break;
}
diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c
index 188af3c20e..c081fce4a7 100644
--- a/src/lib/eolian/eo_lexer.c
+++ b/src/lib/eolian/eo_lexer.c
@@ -74,7 +74,8 @@ static const char * const ctypes[] =
"Eina_Accessor *", "Eina_Array *", "Eina_Iterator *", "Eina_Hash *",
"Eina_List *",
"Efl_Future *",
- "Eina_Value", "char *", "const char *", "Eina_Stringshare *",
+ "Eina_Value", "Eina_Value *",
+ "char *", "const char *", "Eina_Stringshare *",
"void *",
diff --git a/src/lib/eolian/eo_lexer.h b/src/lib/eolian/eo_lexer.h
index 2235806e6c..657bf5b168 100644
--- a/src/lib/eolian/eo_lexer.h
+++ b/src/lib/eolian/eo_lexer.h
@@ -52,7 +52,7 @@ enum Tokens
\
KW(accessor), KW(array), KW(iterator), KW(hash), KW(list), \
KW(future), \
- KW(any_value), \
+ KW(any_value), KW(any_value_ptr), \
KW(mstring), KW(string), KW(stringshare), \
\
KW(void_ptr), \