Jérémy Zurcher [Thu, 9 Jan 2014 13:43:26 +0000 (14:43 +0100)]
eo2: do not allow ill formed class creation
eo_class_new() returns NULL on error in _eo2_class_funcs_set().
it covers: NULL API func, API redefined, dich func override,
overriding non-existing fct.
Jérémy Zurcher [Thu, 9 Jan 2014 13:42:17 +0000 (14:42 +0100)]
eo2: if _eo2_class_funcs_set() fails eo_class_new() returns NULL
call to _eo2_class_funcs_set() is moved out of _eo_class_constructor()
into eo_class_new().
Jérémy Zurcher [Wed, 8 Jan 2014 13:48:36 +0000 (14:48 +0100)]
eo2: add tests for method call error msgs
Jérémy Zurcher [Wed, 8 Jan 2014 13:10:39 +0000 (14:10 +0100)]
eo2: tests: extract mgs checks into eo_error_msgs.c|h
Jérémy Zurcher [Wed, 8 Jan 2014 11:11:20 +0000 (12:11 +0100)]
eo2: _eo2_call_resolve() fails if op is EO_NOOP
Jérémy Zurcher [Wed, 8 Jan 2014 10:30:44 +0000 (11:30 +0100)]
eo2: add test cases for class construction errors
it covers: NULL API func, overriding non-existing fct,
API redefined, dich func override.
Jérémy Zurcher [Wed, 8 Jan 2014 10:13:34 +0000 (11:13 +0100)]
eo2: improve _eo2_class_funcs_set() errors support
as op descs are sorted, we can't output fct indexes in error msgs, but
as they are sorted using api_fct as key, we can detect multiple usage of
the same api_fct which leads to an unpredictable call to whatever is
returned by _eo2_api_op_id_get()->_eo2_api_desc_get().
it is still possible to instanciate an object of a not well defined class.
Jérémy Zurcher [Wed, 8 Jan 2014 10:10:48 +0000 (11:10 +0100)]
eo2: normalize ERR msgs
Jérémy Zurcher [Fri, 3 Jan 2014 15:02:00 +0000 (16:02 +0100)]
eo2: fix err msg in _dich_func_set()
Jérémy Zurcher [Fri, 3 Jan 2014 15:01:27 +0000 (16:01 +0100)]
eo2: improve _eo_op_id_name_get() to support eo1/2
Jérémy Zurcher [Fri, 3 Jan 2014 15:00:24 +0000 (16:00 +0100)]
eo2: add _eo2_op_id_desc_get()
Jérémy Zurcher [Fri, 3 Jan 2014 14:54:18 +0000 (15:54 +0100)]
eo2: improve err msg in _eo2_api_op_id_get() and _eo2_call_resolve()
Jérémy Zurcher [Mon, 30 Dec 2013 21:16:55 +0000 (22:16 +0100)]
eo2: fix uninitialized vars in tests
because of conditional execution of eo2_do() fct calls
these vars could end up not initialized.
Jérémy Zurcher [Mon, 30 Dec 2013 19:31:40 +0000 (20:31 +0100)]
eo2: fix indentation
Jérémy Zurcher [Mon, 30 Dec 2013 19:23:22 +0000 (20:23 +0100)]
eo2: do not try to unref classes in eo2_do_end()
Jérémy Zurcher [Mon, 30 Dec 2013 19:12:00 +0000 (20:12 +0100)]
eo2: remove memset() in _eo2_do_end() as all stack fields are set in _eo2_do_start()
Jérémy Zurcher [Mon, 30 Dec 2013 16:53:54 +0000 (17:53 +0100)]
eo2: no need to resolve eo_id when we reuse previous stack frame
Jérémy Zurcher [Mon, 30 Dec 2013 14:24:44 +0000 (15:24 +0100)]
eo2: add tests for call stack grow and shrink
Jérémy Zurcher [Mon, 30 Dec 2013 14:24:15 +0000 (15:24 +0100)]
eo2: call stack grows and shrinks
Jérémy Zurcher [Fri, 27 Dec 2013 22:08:30 +0000 (23:08 +0100)]
eo2: rename Eo_Abstract_Class->Eo2_Abstract_Class
Jérémy Zurcher [Fri, 27 Dec 2013 22:07:22 +0000 (23:07 +0100)]
eo2: remove dead code
Jérémy Zurcher [Fri, 27 Dec 2013 16:38:50 +0000 (17:38 +0100)]
eo2: add TODO-eo2
merry XMas eo2 !!
you've been fully rebased,
without the eo2test directory,
luckily without any mistake !?
Tom Hacohen [Mon, 11 Nov 2013 13:27:36 +0000 (13:27 +0000)]
eo2: change the order of EO2_OP_FUNC* to put EAPI first.
This looks cleaner and more aligned. Also, it makes more sense as the
internal function is bound to the EAPI and not the other way around.
Tom Hacohen [Mon, 11 Nov 2013 13:06:51 +0000 (13:06 +0000)]
eo2: optimize eo2_do_super func relove a bit.
no need to call dich_func_get twice, just reuse the value previously
fetched.
Tom Hacohen [Mon, 11 Nov 2013 10:59:54 +0000 (10:59 +0000)]
eo2: get rid of eo2_stack_depth_get.
This is super internal, no reason why it should be exposed.
We should just implement automatic stack growth.
Tom Hacohen [Fri, 8 Nov 2013 15:30:25 +0000 (15:30 +0000)]
eo2: formatting.
Tom Hacohen [Mon, 11 Nov 2013 10:51:47 +0000 (10:51 +0000)]
eo2: prefixed internal functions with _.
This is done to prevent code completion from picking them up.
Tom Hacohen [Mon, 11 Nov 2013 10:47:13 +0000 (10:47 +0000)]
eo2: fixed validity checks for eo2_do_super.
The class should be checked to be valid and non-null.
This fixes the issues with eo_suite.
Tom Hacohen [Mon, 11 Nov 2013 10:34:35 +0000 (10:34 +0000)]
eo2: fixed eo2_do call order.
This fixes the mixin test and general calling order.
"Next class" can only be known per op. That's why super should be
restricted to only one op.
Tom Hacohen [Fri, 8 Nov 2013 16:21:01 +0000 (16:21 +0000)]
eo2: eo2_do_super should only have one func.
This is a limitation that must be respected as eo2_do_super, unlike
eo2_do can end up with having different next class because of mixins.
Tom Hacohen [Fri, 8 Nov 2013 15:54:39 +0000 (15:54 +0000)]
eo2: share code between eo2_do and eo2_do_super.
Tom Hacohen [Fri, 8 Nov 2013 15:30:25 +0000 (15:30 +0000)]
eo2: fixed formatting.
Tom Hacohen [Fri, 8 Nov 2013 15:20:38 +0000 (15:20 +0000)]
eo2: prefix all the eo2_*internal* functions with an underscore.
This prevents them from being auto-completed by IDEs which makes
development nicer.
Tom Hacohen [Fri, 8 Nov 2013 15:16:47 +0000 (15:16 +0000)]
eo2: don't create types starting with __, that's reserved.
__ is a reserved compiler domain, prefix with _Eo2_ instead.
Tom Hacohen [Fri, 8 Nov 2013 15:02:06 +0000 (15:02 +0000)]
eo2: use EO2_CLASS_DESCRIPTION_NOOPS everywhere.
Tom Hacohen [Fri, 8 Nov 2013 14:57:47 +0000 (14:57 +0000)]
eo2: fixed a compliation issue in test suite.
Tom Hacohen [Fri, 8 Nov 2013 14:55:29 +0000 (14:55 +0000)]
eo2: fix eo2_base_class function signatures.
"void func(void)" != "void func()" !
The former is a func that accepts 0 parameters.
The latter is a func that accepts variable number of parameters.
Watch out.
Tom Hacohen [Fri, 8 Nov 2013 13:56:06 +0000 (13:56 +0000)]
eo2 suite: add an important FIXME.
Tom Hacohen [Fri, 8 Nov 2013 12:25:39 +0000 (12:25 +0000)]
eo2: migrated the eo-suite test to eo2.
Tom Hacohen [Fri, 8 Nov 2013 13:02:49 +0000 (13:02 +0000)]
eo2: fixed eo2_class_class.
Tom Hacohen [Fri, 8 Nov 2013 12:24:40 +0000 (12:24 +0000)]
eo2: detach children when object is deleted.
Tom Hacohen [Fri, 8 Nov 2013 12:18:05 +0000 (12:18 +0000)]
eo2: correctly handle eo2_do(NULL, ...).
Jérémy Zurcher [Fri, 8 Nov 2013 11:08:17 +0000 (12:08 +0100)]
eo2: do not restrict search for api in class extensions to some class types
Tom Hacohen [Fri, 8 Nov 2013 10:50:16 +0000 (10:50 +0000)]
eo2: interface test, removed obsolete Eo_Op.
Tom Hacohen [Fri, 8 Nov 2013 10:48:55 +0000 (10:48 +0000)]
eo2: migrated mixin test to eo2.
Tom Hacohen [Fri, 8 Nov 2013 10:30:17 +0000 (10:30 +0000)]
eo2: constructors test, removed obsolete Eo_Op.
Tom Hacohen [Fri, 8 Nov 2013 10:25:38 +0000 (10:25 +0000)]
eo2: cleaned up the function overrides test.
Tom Hacohen [Fri, 8 Nov 2013 10:15:22 +0000 (10:15 +0000)]
eo2: fix function overrides test.
Jérémy Zurcher [Fri, 8 Nov 2013 03:01:04 +0000 (03:01 +0000)]
eo2: _eo2_api_desc_get can look into interfaces extensions too
Jérémy Zurcher [Thu, 7 Nov 2013 23:51:22 +0000 (00:51 +0100)]
eo2: eo2_add_internal_end() return NULL if do_error is set
Jérémy Zurcher [Thu, 7 Nov 2013 23:51:00 +0000 (00:51 +0100)]
eo2: support NULL op_descs
Jérémy Zurcher [Thu, 7 Nov 2013 23:50:05 +0000 (00:50 +0100)]
eo2: fix some op descriptions in constructors tests
Jérémy Zurcher [Thu, 7 Nov 2013 23:49:05 +0000 (00:49 +0100)]
eo2: add EO2_CLASS_DESCRIPTION_NOOPS() macros
Jérémy Zurcher [Thu, 7 Nov 2013 23:42:42 +0000 (00:42 +0100)]
eo2: fix mixim elaboration
a mixin class must not inherit
- _eo2_api_desc_get()
accept NULL klass param
EO_CLASS_TYPE_REGULAR_NO_INSTANT is an acceptable extension class type for
- _eo2_class_funcs_set() do not shout if parent is NULL
Jérémy Zurcher [Thu, 7 Nov 2013 23:09:47 +0000 (00:09 +0100)]
eo2: fix tests, do not use _CLASS_FUNC_, see previous commit
Jérémy Zurcher [Thu, 7 Nov 2013 22:38:36 +0000 (23:38 +0100)]
eo2: remove EO2_CLASS_FUNC_* macros
there is no more difference in class or regular functions prototypes and definitions
- eo2_api_op_id_get() uses _eo_is_a_class() at runtime
- add 'void *class_data EINA_UNUSED' parameter to eo2_base class functions
- Eo2_Op_Call_Data.klass is kept only for eo2_hook_call_pre end eo2_hook_call_post,
but could be removed easily
Tom Hacohen [Thu, 7 Nov 2013 18:00:14 +0000 (18:00 +0000)]
eo2 test composite: migrated things I forgot to migrate.
Tom Hacohen [Thu, 7 Nov 2013 17:49:51 +0000 (17:49 +0000)]
eo2 base class: fixed regular and class event functions confusion.
Tom Hacohen [Thu, 7 Nov 2013 17:47:34 +0000 (17:47 +0000)]
eo2: migrated signals test to eo2.
Tom Hacohen [Thu, 7 Nov 2013 17:20:11 +0000 (17:20 +0000)]
eo2: migrated interface test to eo2.
Tom Hacohen [Thu, 7 Nov 2013 17:00:09 +0000 (17:00 +0000)]
eo2: migrated function_overrides test to eo2.
Tom Hacohen [Thu, 7 Nov 2013 16:55:26 +0000 (16:55 +0000)]
eo2: fixed EO2_VOID_CLASS_FUNC_BODY function.
Tom Hacohen [Thu, 7 Nov 2013 16:06:51 +0000 (16:06 +0000)]
eo2: migrated constructors test to eo2.
Tom Hacohen [Thu, 7 Nov 2013 15:28:55 +0000 (15:28 +0000)]
eo2: migrated the composite test to eo2.
Tom Hacohen [Thu, 7 Nov 2013 15:24:20 +0000 (15:24 +0000)]
eo2: improved error messages on failed resolves.
Tom Hacohen [Thu, 7 Nov 2013 14:47:58 +0000 (14:47 +0000)]
eo2: access tests makeup
Tom Hacohen [Thu, 7 Nov 2013 13:56:34 +0000 (13:56 +0000)]
eo2: changed Eo class names to be consistent.
All the class names are now of the format: Lib_Type_Subtype_Extra.
Jérémy Zurcher [Thu, 26 Dec 2013 23:33:49 +0000 (00:33 +0100)]
eo2: add EO2_CLASS_CLASS
Jérémy Zurcher [Sat, 12 Oct 2013 22:28:40 +0000 (00:28 +0200)]
eo2: base class op_descs must be static
Jérémy Zurcher [Thu, 3 Oct 2013 12:30:31 +0000 (14:30 +0200)]
eo2: support composites object
_eo2_api_desc_get() searches extensions classes
eo2_call_resolve() searches composites objects
Jérémy Zurcher [Thu, 26 Dec 2013 23:18:45 +0000 (00:18 +0100)]
eo2: optimize eo2_call_resolve and call stack
Jérémy Zurcher [Thu, 3 Oct 2013 12:17:03 +0000 (14:17 +0200)]
eo2: fix eo_base_data_get(), eo_composite_attach(), eo_composite_detach()
Jérémy Zurcher [Wed, 2 Oct 2013 12:57:45 +0000 (14:57 +0200)]
eo2: clean up and speed up call stack usage
Jérémy Zurcher [Thu, 26 Dec 2013 23:00:11 +0000 (00:00 +0100)]
eo2: eo2_add_internal_start use trash and fix MAGIC
Jérémy Zurcher [Wed, 2 Oct 2013 09:47:10 +0000 (11:47 +0200)]
eo2: eo2_do() and eo2_do_super() supports objects and classes
Jérémy Zurcher [Wed, 2 Oct 2013 08:44:33 +0000 (10:44 +0200)]
eo2: rewrite eo2_do_start(...)
we need Eo_Class *cur_klass for eo2_do_super
be sure not to update stack pointer before we can't fail anymore
Jérémy Zurcher [Thu, 26 Dec 2013 22:46:50 +0000 (23:46 +0100)]
eo2: change a few variable names
in the EPAI, don't show that Eo* could be IDs.
in the implementation, use klass_id and obj_id
if you know or want it to be a class or an object,
use eo_id in general cases.
Jérémy Zurcher [Thu, 26 Dec 2013 20:11:48 +0000 (21:11 +0100)]
eo2: add eo2_parent_set(), eo2_parent_get(), eo2_children_iterator_new()
imported from eo_base_class.c as is in
a7f417e 2013-12-24 23:45:30 +0900 <Carsten Haitzler (Rasterman)>
Jérémy Zurcher [Thu, 26 Dec 2013 20:00:23 +0000 (21:00 +0100)]
eo2: formatting
Jérémy Zurcher [Thu, 26 Dec 2013 19:56:59 +0000 (20:56 +0100)]
eo2: import
cecd1980, calloc and realloc failure protections
Jérémy Zurcher [Thu, 26 Dec 2013 19:42:18 +0000 (20:42 +0100)]
eo2: minor fixes after huge rebase
indentation
use _Eo_Object * instead of _Eo *
use EO_CLASS_POINTER_RETURN_VAL(), _eo_id_get(), and _eo_class_id_get().
Jérémy Zurcher [Fri, 6 Sep 2013 09:38:25 +0000 (11:38 +0200)]
eo2: eo2_do_start use EO_OBJ_POINTER_ macros not _eo_obj_pointer_get
Jérémy Zurcher [Sun, 1 Sep 2013 21:48:57 +0000 (23:48 +0200)]
eo2: eo2_call_resolve_internal support undef HAVE_EO_ID
Jérémy Zurcher [Wed, 14 Aug 2013 11:48:54 +0000 (13:48 +0200)]
eo2: _eo2_api_desc_get: walks in mro not in klass->parent
Jérémy Zurcher [Wed, 14 Aug 2013 11:46:49 +0000 (13:46 +0200)]
eo2: rename eo2 class 'Eo Base'->'Eo2 Base'
Jérémy Zurcher [Wed, 14 Aug 2013 11:46:06 +0000 (13:46 +0200)]
eo2: add DBG msg in eo2_class_funcs_set
Cedric Bail [Mon, 5 Aug 2013 06:13:21 +0000 (15:13 +0900)]
eo2: memset will be faster, still why not using NULL instead of -1 ?
Cedric Bail [Mon, 5 Aug 2013 03:05:49 +0000 (12:05 +0900)]
eo2: we can rely on LD_PRELOAD for those hook, so removing them.
Jérémy Zurcher [Thu, 1 Aug 2013 13:41:12 +0000 (15:41 +0200)]
eo2: add EO2_HOOK_DO_PREPARE
Cedric Bail [Thu, 1 Aug 2013 09:49:27 +0000 (18:49 +0900)]
eo2: add hook for beinning and start of all function execution and for all _do.
NOTE: I don't know what the _CLASS_FUNC are, so I may have broken stuff there.
Jérémy Zurcher [Thu, 1 Aug 2013 07:47:21 +0000 (09:47 +0200)]
eo2: fix eo2 custom constructors
Jérémy Zurcher [Thu, 26 Dec 2013 15:33:18 +0000 (16:33 +0100)]
eo2: sprinkle with 'const'
Jérémy Zurcher [Wed, 31 Jul 2013 21:37:06 +0000 (23:37 +0200)]
eo2: fixed EO2_CLASS_FUNC_BODY and etc. functions.
Tom Hacohen [Wed, 31 Jul 2013 16:20:40 +0000 (17:20 +0100)]
eo2: revert "fixed EO2_CLASS_FUNC_BODY and etc. functions."
Still need to change it to get call earlier. Oversight because
of incomplete make files.
This reverts commit
1ea966c3bef7384a91e386477dc07015ed18d33f.
Tom Hacohen [Wed, 31 Jul 2013 16:16:59 +0000 (17:16 +0100)]
eo2: fixed EO2_CLASS_FUNC_BODY and etc. functions.
Jérémy Zurcher [Wed, 31 Jul 2013 07:59:15 +0000 (09:59 +0200)]
eo2: remove EO2_OP_FUNC_VIRTUAL
a pure virtual function is an EO2_OP_FUNC
with NULL as private function implementation pointer
Tom Hacohen [Tue, 30 Jul 2013 16:22:26 +0000 (17:22 +0100)]
eo2: fix backslash alignment.
This is one of the reasons why I hate backslash alignments, you end up
fixing style when you should be working on code.
Tom Hacohen [Tue, 30 Jul 2013 15:08:25 +0000 (16:08 +0100)]
eo2: updated the access test to use eo2.
Tom Hacohen [Tue, 30 Jul 2013 13:12:03 +0000 (14:12 +0100)]
eo2: revert "eo2_add accepts non-defauld constructors"
We want to have normal functions as non-default constructors, not va_arg
ones. What we should do is split the object creation to two parts again.
The creation, the constructing (changes using the macro) and the
verification/end part that checks the constructor has been called.
This reverts commit
2ff2ce1894f173b306a896bda595e1a7768c074d.
Jérémy Zurcher [Tue, 30 Jul 2013 13:02:35 +0000 (15:02 +0200)]
eo2: implement class function support