Enlightenment CVS committal Author : raster Project : e17 Module : libs/embryo
Dir : e17/libs/embryo/src/bin Modified Files: embryo_main.c Log Message: woop! it works... 64bit cleanliness left. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_main.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- embryo_main.c 25 Mar 2004 02:07:28 -0000 1.4 +++ embryo_main.c 26 Mar 2004 04:12:36 -0000 1.5 @@ -127,6 +127,42 @@ return EMBRYO_ERROR_NONE; } +static Embryo_Cell +exported_rec(Embryo_Program *ep, Embryo_Cell *params) +{ + Embryo_Cell *cptr; + Embryo_Function fn; + Embryo_Cell ret, arg1, arg2; + + // params[0] = number of bytes of params passed + if (params[0] != 3 * sizeof(Embryo_Cell)) return -1; + arg1 = params[1]; + arg2 = params[3]; + arg1++; + + if (arg1 > 7) + { + printf("arg1 == %i\n", arg1); + return arg1; + } + + // call the rec1 again + fn = embryo_program_function_find(ep, "rec1"); + if (fn != EMBRYO_FUNCTION_NONE) + { + char buf[128]; + + printf("... recurse!\n"); + snprintf(buf, sizeof(buf), "SMELLY %i", arg1); + embryo_parameter_cell_push(ep, arg1); + embryo_parameter_string_push(ep, buf); + embryo_parameter_cell_push(ep, arg2); + while (embryo_program_run(ep, fn) == EMBRYO_PROGRAM_SLEEP); + ret = embryo_program_return_value_get(ep); + } + return ret + 1; +} + /* another example native call */ /* static Embryo_Cell @@ -209,6 +245,7 @@ exit(-1); } embryo_program_native_call_add(ep, "printf", exported_printf); + embryo_program_native_call_add(ep, "native_rec", exported_rec); embryo_program_vm_push(ep); if (args > 0) ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs