Commit Graph

278 Commits

Author SHA1 Message Date
Felipe Magno de Almeida 46903d76f5 eolian: Fix promise generation with multiple parameters
When generating multiple parameters, they inadvertedly got
replaced by __eo_promise. Replacing all arguments to the
promise pointer.
2016-04-29 17:15:51 -03:00
Cedric BAIL 842a020e1f eolian: add support for restartable event. 2016-04-20 15:53:16 -07:00
Stefan Schmidt 28dfe2f0ff eolian: free impl_full_params strbuf before going out of scope
Just missed impl_full_params here while all others are free'd fine.

CID: 1354287
2016-04-18 16:00:49 +02:00
Felipe Magno de Almeida 62841aee3c eolian: Make promise eolian generation use macros for hooks
Modify the way hooks are defined and used by promise generation in
Eolian in the Eo API.

Instead of passing macro names as parameters to EO_FUNC_BODY macros,
just re-define the actual hooks when it is needed.
2016-04-11 01:28:50 -03:00
Felipe Magno de Almeida dc954d8dba eolian: add Eolian support for Eina Promises
Add a promise object to allows Eolian interface to include promises
as a way to have asynchronous value return and composibility.

The usage is like this in a .eo file:

class Foo {
   methods {
      bar {
         params {
            @inout promise: Promise<int>;
         }
      }
   }
}

Which will create the following API interface:

void foo_bar(Eo* obj, Eina_Promise** promise);

and a Eina_Promise_Owner for the implementation, like this:

void _foo_bar(Eo* obj, Private_Data* pdata, Eina_Promise_Owner* promise);

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-04-06 14:34:15 -07:00
Felipe Magno de Almeida 944e11559c eo: add before and after macro hooks for API generation functions
Add two parameters for macros that generate API functions in Eo so
that the generation can be customized with macros used by Eolian.

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-04-06 14:32:04 -07:00
Jean-Philippe Andre 78bb21a2d9 Eolian: Mark all EO class_get() as weak
This follows the previous commit for the same reasons.
2016-04-01 12:09:06 +09:00
Daniel Kolesa fbd9defdd4 eolian generator: simplify typedef gen 2016-03-14 16:58:09 +00:00
Daniel Kolesa d558c0122f eolian generator: close the file with zero write 2016-03-11 16:19:53 +00:00
Daniel Kolesa 97adf6d52b eolian generator: check fwrite return value currectly
This fixes CID 1327247.

@fix
2016-03-11 13:16:34 +00:00
Tom Hacohen 7d8cd6c40f Revert "ecore: Create Promises"
Reverting this at Felipe's request following my email. There are many
things I strongly object to in this commit. I've touched the surface of
those on the ML (which doesn't work at the moment), though we need to
better discuss it.

The gist:
1. dlsym is a really bad hack that is not even needed.
2. I don't see why eo should even be aware of promises. It's not aware
of list, hash and etc.
3. The eolian changes were done wrong.

This should have been discussed and consulted before done, even if only
because of the amount of hacks it includes and the cross-domain (ecore,
eo and eolian) nature of it.

This reverts commit f9ba80ab33.
2016-03-08 14:23:57 +00:00
Stefan Schmidt 29028a50ce eolian_gen: mention the option for generating a stub header in the example use
Listed in the available options already but better also list it in the example
usage where the other three generation types are listed as well.
2016-03-08 11:14:56 +01:00
Stefan Schmidt ff215b2f8f eolian_gen: remove unused functions _nextline and _startline
These two have no users and there is no point in keeping them around.
2016-03-08 11:14:55 +01:00
Felipe Magno de Almeida f9ba80ab33 ecore: Create Promises
Add a promise object that allows Eolian interface to include promises
as a way to have asynchronous value return and composibility.

The usage is like this in a .eo file:

class Foo {
   methods {
      bar {
         params {
            promise: Promise<int>;
         }
      }
   }
}

Which will create the following API interface:

void foo_bar(Ecore_Promise** promise);

and the equivalent declaration for implementation.

However, the API function will instantiate the Promise for the
user and the implementer of the class.
2016-03-06 17:55:33 -03:00
Daniel Kolesa cb42da514b eolian: initial conversion of C gen and tests to new type APIs 2016-03-03 18:58:11 +00:00
Daniel Kolesa a6347f88fd eolian generator: @class methods take const object 2016-03-03 09:53:23 +00:00
Daniel Kolesa 8299be03f4 eolian: generate correct const first param on methods where applicable 2016-03-03 09:53:23 +00:00
Daniel Kolesa 737a297a79 eolian generator: use new call syntax 2016-03-03 09:53:23 +00:00
Daniel Kolesa eb5aa57159 eolian generator: add obj as first param to header method prototypes 2016-03-03 09:53:23 +00:00
Daniel Kolesa 30bc1d285b eolian: allow silencing of type errors in validation
This allows generators to silence type errors in validation in order
to reduce duplicate error messages when generating multiple files.
Also adjusted the C generator to only emit type errors when generating
Eo header files.

@feature
2016-02-10 16:05:07 +00:00
Tom Hacohen 668fd4a6e8 Eo: add support for initialising eo after it has been shut down.
Until now it wasn't allowed/possible to init (eo_init) eo after it has
been shut down (eo_shutdown). This commit fixes that, so now that is
fully legal to have as many init/shutdown cycles as you want.

There was a previous workaround for this issue:
e47edc250d.

This should allow more flexibility when using the EFL in loadable
modules and in various other scenarios.

The problem is that the class_get() functions cache the previously
created class for efficiency, but the class is freed if eo is shut down,
so the cached pointer is actually invalid.
The solution to the problem was to maintain a generation count
(incremented every time we shut down eo), and compare that to a locally
saved version in class_get(). If they don't match, recreate the class,
as it has already been freed.

@feature
2016-02-04 09:27:15 +00:00
Daniel Kolesa c95350016d eolian: add parsing and generation of hot events
Unfreezable events can now be marked @hot.

@feature
2016-02-02 17:55:01 +00:00
Jean-Philippe Andre 6dcde68d24 Eolian gen: Don't fail if file is empty (--gi)
@fix
2015-12-14 16:17:52 +09:00
Tom Hacohen c2c7763481 Eolian legacy generator: Make code a bit clearer.
This makes it clear that only one of those conditions can be
true.

This also fixed CID1323087
2015-12-08 10:58:21 +00:00
Andy Williams a0d3e77e55 [eolian_gen] remove documentation for removed argument.
Used to be mandatory, is now not recognised, let's not confuse people @fix
2015-11-19 22:59:09 +00:00
Daniel Kolesa b3867ce395 eolian: turn "undefined type" into its own EOLIAN_TYPE 2015-11-19 14:05:16 +00:00
Daniel Kolesa b5042ff669 eo generator: better output whitespace handling with pointers 2015-11-11 15:15:08 +00:00
Daniel Kolesa 7cb444b601 eo generator: remove unneeded/harmful code 2015-11-10 11:53:35 +00:00
Daniel Kolesa 247c860aac eolian generator: finalize refactoring main.c 2015-11-09 15:02:32 +00:00
Daniel Kolesa 10883d080f eolian generator: refactor the main function (remove cruft) 2015-11-09 15:02:32 +00:00
Daniel Kolesa a29d6aed66 eolian generator: remove useless --eo argument 2015-11-09 15:02:32 +00:00
Daniel Kolesa 653e258eec eolian generator: cleaner file write 2015-10-12 11:45:38 +01:00
Daniel Kolesa 89acf82bff eolian generator: merge legacy and eo header gen entry points 2015-10-12 11:35:59 +01:00
Daniel Kolesa 1853051618 eolian generator: refactoring of file reads 2015-09-29 14:24:44 +01:00
Daniel Kolesa 97cb6c5ca9 eolian generator: no need to replace newlines on win32 (lexer can deal with it) 2015-09-29 13:54:30 +01:00
Tom Hacohen e2344b9b9e Eo: reduce memory usage across applications.
As described by Carsten in his email to edev ML titled:
"[E-devel] eo stability - i think we need to postpone that"
with the switch to Eo2 we significantly increased our usage of RW memory
pages, and thus significantly increased our memory usage when running
multiple applications.

The problem was that during the migration to Eo2 the op id cache and the
op description arrays were merged, causing the op description arrays to
no longer be RO. This patch enables users of Eo (mainly Eolian) to
declare those arrays as const (RO) again, saving that memory.

There might be performance implications with this patch. I had to remove
the op desc array sorting, and I used a hash table for the lookup. I
think the op desc sorting doesn't really affect performance because that
array is seldom accessed and is usually pretty short. The hash table
is not a problem either, because it's  behind the scenes, so it can be
changed to a more efficient data structure if the hash table is not good
enough. The hash table itself is also rarely accessed, so it's mostly
about memory.

Please keep an eye for any bugs, performance or excessive memory usage.
I believe this should be better on all fronts.

This commit *BREAKS ABI*.

@fix
2015-09-28 18:39:15 +01:00
Daniel Kolesa 76bc86716e Eolian generator: remove sentinel generation 2015-09-28 16:18:29 +01:00
Tom Hacohen 37f84b7e96 Eo: Drop doc field from ops and events.
This hasn't been used for a while. Since we are going to break Eo a bit anyway
it's a good opportunity to drop this.

This may cause a slight performance issues with legacy events, such as
smart callbacks. This shouldn't really be a problem as we've migrated away from
them. If it does, we need to migrate the remaining parts. Only relevant
for callbacks that are added before the classes are created, which
shouldn't be possible except for smart, only for old evas callbacks.
2015-09-28 15:09:16 +01:00
Daniel Kolesa c9462b56c8 eolian/generator: support for more paragraph tags 2015-09-16 14:24:16 +01:00
Daniel Kolesa a9968b975f eolian/generator: generation of doxygen @note and @warning tags
@feature
2015-09-14 14:10:32 +01:00
Daniel Kolesa 3f1d29f1ec eolian: remove support for old style docs completely 2015-09-03 15:42:01 +01:00
Daniel Kolesa 9b0cd29268 eolian/generator: fix turning values into @return when generating docs
@fix
2015-08-10 16:25:55 +01:00
Daniel Kolesa ec48df78c3 eolian/generator: actually overrun-safe buffer fill 2015-07-30 13:59:16 +01:00
Daniel Kolesa 1c5bd5e502 eolian/generator: no point in creating tmp_env, it's not used 2015-07-30 13:50:46 +01:00
Stefan Schmidt a76ca97388 eolian/common_funcs: Play safe and use strncpy
Not very likely but better play safe and make sure we don not overrun
our destination buffer here.

CID: 1311352
2015-07-30 14:28:09 +02:00
Daniel Kolesa 8ed6417196 eolian/generator: generate @ingroup in doc comments properly 2015-07-14 14:42:11 +01:00
Daniel Kolesa 80eed1e285 eolian/generator: check if the reference is generatable first 2015-07-08 15:13:26 +01:00
Daniel Kolesa c31a57db00 eolian/generator: delete a stringshare correctly on failure 2015-07-08 13:25:32 +01:00
Daniel Kolesa 42156a7c34 eolian/generator: static-ify some funcs 2015-07-08 12:17:00 +01:00
Daniel Kolesa 825349c7b8 eolian: improve function_full_c_name_get API
It's now generalized to work properly with legacy functions
as well as correctly append suffixes. Thus, it can be easily
used with the documentation generator and in other places.

@feature
2015-07-08 12:10:20 +01:00