ni: adds system to manage native local references to Nit objects

This ensures that references to Nit objects from C within an extern
method are preserved when the GC is invoqued. Theses references
are registered automatically when any callback to the Nit system is
made. They are registered in a stack, local to the currently executing
extern method (ie the one on the top of the execution stack). All
registered references are cleared on the function return.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: adds local reference tests

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
ni: adds global references to Nit objects from C code

Allows to preserve a reference during program execution. It is valid
no matter the extern method invoked.

Uses a global list to preserve all references explicitly asked to be
kept in the program. The user must call Object_incr_ref( Object obj )
to increment the reference count of obj. If it's reference count was
at 0, then it will be added to the global list.

The same Nit object may be present multiple times in the global list.
Only reference incrementation on the same C structure represernting
the object will increment the same counter.

This algorithm allows for fast increment, no matter how many global
references are already registered.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: adds global reference tests

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
nitc: allows other modules to append to native interface options

By appending options from the command line instead of replacing
the existing array, tihs allows any modules to append to the same list.

This is a clean fix for problems with separate_options.nit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
gccx: fix for linking with C libs for native interface

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
ni: fix duplication of null getters genereated in frontier

This could happened when the same null was used in two different hybrid
modules.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
ni: supports virtypes used in signatures of methods called from C

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
separate_options: allows .args files with multiple lines

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: adds test for separate_options module

Testing simple and multiple lines.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
example: adds a basic extern method example

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
c_src: updates for latest fixes

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib: updates module exec to new attributes style

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib: updates module stream to new attributes styles

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib: adds poll function to stream module

Call this function with a list of FDStreams. Will wait for writing on
FDIStream and reading and FDOStream. It can do both and also check for
hang ups.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib: adds function to list files within a directory

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib: intro module to manage C signals

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib: intro module to generate md5 hash from a string

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
mmbuilder: detect type of some attributes

Allows to automaticaly determine the static type of some attributes assigned
where introduced. Works for literal Int, Char, Bool and String, as well as
"new" and boolean expressions.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib: adds String::to_f

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>