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)
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 ()
7 [[Set configuration]] 7 [[Set configuration]]
8 params { 8 params {
9 name: string; [[Configuration option name]] 9 name: string; [[Configuration option name]]
10 val: ptr(const(any_value)); [[Configuration option value]] 10 val: const(any_value_ptr); [[Configuration option value]]
11 } 11 }
12 return: bool; [[$false in case of error: value type was invalid, the 12 return: bool; [[$false in case of error: value type was invalid, the
13 config can't be changed, config does not exist...]] 13 config can't be changed, config does not exist...]]
@@ -17,14 +17,14 @@ interface Efl.Config ()
17 params { 17 params {
18 name: string; [[Configuration option name]] 18 name: string; [[Configuration option name]]
19 } 19 }
20 return: ptr(any_value) @owned; [[Configuration option value]] 20 return: any_value_ptr @owned; [[Configuration option value]]
21 } 21 }
22 config_list_get @const { 22 config_list_get @const {
23 [[Returns a list of generic values under a given key.]] 23 [[Returns a list of generic values under a given key.]]
24 params { 24 params {
25 @in name: string; [[Configuration option name]] 25 @in name: string; [[Configuration option name]]
26 } 26 }
27 return: iterator<ptr(any_value)> @owned; [[ 27 return: iterator<any_value_ptr> @owned; [[
28 List of configuration option values]] 28 List of configuration option values]]
29 } 29 }
30 } 30 }
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 ()
47 ]] 47 ]]
48 params { 48 params {
49 @in property: string; [[Property name]] 49 @in property: string; [[Property name]]
50 @in value: ptr(const(any_value)); [[New value]] 50 @in value: const(any_value_ptr); [[New value]]
51 } 51 }
52 return: future<any_value>; [[Future returning the recorded value or error]] 52 return: future<any_value>; [[Future returning the recorded value or error]]
53 } 53 }
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)
93 return: bool; [[$true, on success, $false otherwise]] 93 return: bool; [[$true, on success, $false otherwise]]
94 params { 94 params {
95 @in name: string; [[The name of the item (as declared in the prefs collection)]] 95 @in name: string; [[The name of the item (as declared in the prefs collection)]]
96 @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]] 96 @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]]
97 } 97 }
98 } 98 }
99 item_value_get @const { 99 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[] =
142static const char *eo_obj_free = "efl_del"; 142static const char *eo_obj_free = "efl_del";
143static const char *eo_str_free = "free"; 143static const char *eo_str_free = "free";
144static const char *eo_strshare_free = "eina_stringshare_del"; 144static const char *eo_strshare_free = "eina_stringshare_del";
145static const char *eo_value_free = "eina_value_free"; 145static const char *eo_value_free = "eina_value_flush";
146static const char *eo_value_ptr_free = "eina_value_free";
146 147
147static Eina_Bool 148static Eina_Bool
148_validate_type(Eolian_Type *tp) 149_validate_type(Eolian_Type *tp)
@@ -190,6 +191,9 @@ _validate_type(Eolian_Type *tp)
190 case KW_any_value: 191 case KW_any_value:
191 tp->freefunc = eina_stringshare_add(eo_value_free); 192 tp->freefunc = eina_stringshare_add(eo_value_free);
192 break; 193 break;
194 case KW_any_value_ptr:
195 tp->freefunc = eina_stringshare_add(eo_value_ptr_free);
196 break;
193 default: 197 default:
194 break; 198 break;
195 } 199 }
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[] =
74 "Eina_Accessor *", "Eina_Array *", "Eina_Iterator *", "Eina_Hash *", 74 "Eina_Accessor *", "Eina_Array *", "Eina_Iterator *", "Eina_Hash *",
75 "Eina_List *", 75 "Eina_List *",
76 "Efl_Future *", 76 "Efl_Future *",
77 "Eina_Value", "char *", "const char *", "Eina_Stringshare *", 77 "Eina_Value", "Eina_Value *",
78 "char *", "const char *", "Eina_Stringshare *",
78 79
79 "void *", 80 "void *",
80 81
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
52 \ 52 \
53 KW(accessor), KW(array), KW(iterator), KW(hash), KW(list), \ 53 KW(accessor), KW(array), KW(iterator), KW(hash), KW(list), \
54 KW(future), \ 54 KW(future), \
55 KW(any_value), \ 55 KW(any_value), KW(any_value_ptr), \
56 KW(mstring), KW(string), KW(stringshare), \ 56 KW(mstring), KW(string), KW(stringshare), \
57 \ 57 \
58 KW(void_ptr), \ 58 KW(void_ptr), \