summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-02-13 18:12:59 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-02-13 18:48:02 +0100
commit19fcd6e60fdb702ea0db4a9884c4822e624ecde4 (patch)
tree3b43c4dbbc2efd77787097d7990f0fb6d6f3ea38 /src/lib
parent6b7346b7b2b0db05e76cc217966d3304e4cbc41a (diff)
eolian: allow tagging complete classes as BETA
Summary: This allows using the @beta tag in classes, like this: class @beta Efl.Foo extends Efl.Bar { ... } This will surround the class definition in the .eo.h file with an EFL_BETA_API_SUPPORT #define, equivalent to tag every method and event with @beta. Test Plan: Nothing changes since no class uses this tag yet Reviewers: q66, bu5hm4n, zmike Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7933
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/eolian/Eolian.h10
-rw-r--r--src/lib/eolian/database_class_api.c7
-rw-r--r--src/lib/eolian/eo_parser.c5
-rw-r--r--src/lib/eolian/eolian_database.h1
4 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index fc28058..0320da2 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -2299,6 +2299,16 @@ EAPI Eina_Stringshare *eolian_class_c_name_get(const Eolian_Class *klass);
2299EAPI Eina_Stringshare *eolian_class_c_data_type_get(const Eolian_Class *klass); 2299EAPI Eina_Stringshare *eolian_class_c_data_type_get(const Eolian_Class *klass);
2300 2300
2301/* 2301/*
2302 * @brief Get whether a class is beta.
2303 *
2304 * @param[in] klass the class
2305 * @return EINA_TRUE if the class has been marked as BETA
2306 *
2307 * @ingroup Eolian
2308 */
2309EAPI Eina_Bool eolian_class_is_beta(const Eolian_Class *klass);
2310
2311/*
2302 * @brief Get the type of a type declaration. 2312 * @brief Get the type of a type declaration.
2303 * 2313 *
2304 * @param[in] tp the type declaration. 2314 * @param[in] tp the type declaration.
diff --git a/src/lib/eolian/database_class_api.c b/src/lib/eolian/database_class_api.c
index f79cdb8..73d0136 100644
--- a/src/lib/eolian/database_class_api.c
+++ b/src/lib/eolian/database_class_api.c
@@ -228,3 +228,10 @@ eolian_class_c_data_type_get(const Eolian_Class *cl)
228 *p = '_'; 228 *p = '_';
229 return eina_stringshare_add(buf); 229 return eina_stringshare_add(buf);
230} 230}
231
232EAPI Eina_Bool
233eolian_class_is_beta(const Eolian_Class *cl)
234{
235 EINA_SAFETY_ON_NULL_RETURN_VAL(cl, EINA_FALSE);
236 return cl->is_beta;
237}
diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c
index fe5d153..4346b34 100644
--- a/src/lib/eolian/eo_parser.c
+++ b/src/lib/eolian/eo_parser.c
@@ -2093,6 +2093,11 @@ parse_class(Eo_Lexer *ls, Eolian_Class_Type type)
2093 eo_lexer_get(ls); 2093 eo_lexer_get(ls);
2094 ls->klass->type = type; 2094 ls->klass->type = type;
2095 eo_lexer_context_push(ls); 2095 eo_lexer_context_push(ls);
2096 if (ls->t.kw == KW_at_beta)
2097 {
2098 ls->klass->is_beta = EINA_TRUE;
2099 eo_lexer_get(ls);
2100 }
2096 parse_name(ls, buf); 2101 parse_name(ls, buf);
2097 bnm = eina_stringshare_ref(ls->filename); 2102 bnm = eina_stringshare_ref(ls->filename);
2098 fnm = database_class_to_filename(eina_strbuf_string_get(buf)); 2103 fnm = database_class_to_filename(eina_strbuf_string_get(buf));
diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h
index d0d7873..b70f2b4 100644
--- a/src/lib/eolian/eolian_database.h
+++ b/src/lib/eolian/eolian_database.h
@@ -196,6 +196,7 @@ struct _Eolian_Class
196 Eina_List *callables; /* internal for now */ 196 Eina_List *callables; /* internal for now */
197 Eina_Bool class_ctor_enable:1; 197 Eina_Bool class_ctor_enable:1;
198 Eina_Bool class_dtor_enable:1; 198 Eina_Bool class_dtor_enable:1;
199 Eina_Bool is_beta :1;
199}; 200};
200 201
201struct _Eolian_Function 202struct _Eolian_Function