summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-08-09 16:09:25 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-08-09 16:10:41 +0200
commit510d43724654891e28a1e92ccdc93cdf98b1aaf4 (patch)
tree158e3eaedc134656627ab795e0b78846cf327253 /src/lib
parent7248812a5155281cfcc3ea9a807734fa5129c63f (diff)
eolian: add an envvar to warn about unimplemented beta funcs
This changes the behavior of the existing env var to only check unimplemented functions in stable APIs by default. Beta checks can be enabled with an additional environment var, so use EOLIAN_CLASS_UNIMPLEMENTED_WARN for stable and EOLIAN_CLASS_UNIMPLEMENTED_BETA_WARN for extra beta checks.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/eolian/database_validate.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c
index f831b08dc7..7e3547b79b 100644
--- a/src/lib/eolian/database_validate.c
+++ b/src/lib/eolian/database_validate.c
@@ -13,6 +13,7 @@ typedef struct _Validate_State
13 Eina_Bool warned; 13 Eina_Bool warned;
14 Eina_Bool stable; 14 Eina_Bool stable;
15 Eina_Bool unimplemented; 15 Eina_Bool unimplemented;
16 Eina_Bool unimplemented_beta;
16} Validate_State; 17} Validate_State;
17 18
18static Eina_Bool 19static Eina_Bool
@@ -870,14 +871,21 @@ _db_check_implemented(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fs,
870 871
871 Eina_Bool succ = EINA_TRUE; 872 Eina_Bool succ = EINA_TRUE;
872 873
874 /* unimplemented checks are not enabled for any objects */
873 if (!vals->unimplemented) 875 if (!vals->unimplemented)
874 return EINA_TRUE; 876 return EINA_TRUE;
875 877
878 /* class is beta and we didn't enable unimplemented checking for those */
879 if (!vals->unimplemented_beta && cl->base.is_beta)
880 return EINA_TRUE;
881
876 Eina_List *l; 882 Eina_List *l;
877 Eolian_Implement *impl; 883 Eolian_Implement *impl;
878 EINA_LIST_FOREACH(cl->callables, l, impl) 884 EINA_LIST_FOREACH(cl->callables, l, impl)
879 { 885 {
880 const Eolian_Function *fid = impl->foo_id; 886 const Eolian_Function *fid = impl->foo_id;
887 if (!vals->unimplemented_beta && fid->base.is_beta)
888 continue;
881 Impl_Status st = (Impl_Status)eina_hash_find(fs, &fid); 889 Impl_Status st = (Impl_Status)eina_hash_find(fs, &fid);
882 /* found an interface this func was originally defined in in the 890 /* found an interface this func was originally defined in in the
883 * composite list; in that case, ignore it and assume it will come 891 * composite list; in that case, ignore it and assume it will come
@@ -1427,6 +1435,7 @@ database_validate(const Eolian_Unit *src)
1427 EINA_FALSE, 1435 EINA_FALSE,
1428 EINA_TRUE, 1436 EINA_TRUE,
1429 !!getenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN"), 1437 !!getenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN"),
1438 !!getenv("EOLIAN_CLASS_UNIMPLEMENTED_BETA_WARN"),
1430 }; 1439 };
1431 1440
1432 /* do an initial pass to refill inherits */ 1441 /* do an initial pass to refill inherits */