merge: add embryo

please check and report problems (not cosmetic ones)

someone should update the efl.spec.in file, i don't know that stuff


SVN revision: 78512
devs/devilhorns/wayland_egl
Vincent Torri 10 years ago
parent 124e0d4afd
commit 5bdb5d3763
  1. 6
      AUTHORS
  2. 2
      COPYING
  3. 8
      Makefile.am
  4. 2
      NEWS
  5. 79
      configure.ac
  6. 6
      data/Makefile.am
  7. 0
      data/embryo/default.inc
  8. 47
      m4/efl_check_funcs.m4
  9. 0
      old/ChangeLog.embryo
  10. 0
      old/NEWS.embryo
  11. 0
      old/README.embryo
  12. 2
      pc/embryo.pc.in
  13. 2
      src/bin/Makefile.am
  14. 49
      src/bin/embryo/Makefile.am
  15. 0
      src/bin/embryo/embryo_cc_amx.h
  16. 0
      src/bin/embryo/embryo_cc_osdefs.h
  17. 0
      src/bin/embryo/embryo_cc_prefix.c
  18. 0
      src/bin/embryo/embryo_cc_prefix.h
  19. 0
      src/bin/embryo/embryo_cc_sc.h
  20. 8
      src/bin/embryo/embryo_cc_sc1.c
  21. 0
      src/bin/embryo/embryo_cc_sc2.c
  22. 32
      src/bin/embryo/embryo_cc_sc3.c
  23. 4
      src/bin/embryo/embryo_cc_sc4.c
  24. 2
      src/bin/embryo/embryo_cc_sc5.c
  25. 0
      src/bin/embryo/embryo_cc_sc5.scp
  26. 47
      src/bin/embryo/embryo_cc_sc6.c
  27. 14
      src/bin/embryo/embryo_cc_sc7.c
  28. 0
      src/bin/embryo/embryo_cc_sc7.scp
  29. 0
      src/bin/embryo/embryo_cc_scexpand.c
  30. 6
      src/bin/embryo/embryo_cc_sclist.c
  31. 0
      src/bin/embryo/embryo_cc_scvars.c
  32. 2
      src/lib/Makefile.am
  33. 0
      src/lib/embryo/Embryo.h
  34. 38
      src/lib/embryo/Makefile.am
  35. 6
      src/lib/embryo/embryo_amx.c
  36. 4
      src/lib/embryo/embryo_args.c
  37. 46
      src/lib/embryo/embryo_float.c
  38. 0
      src/lib/embryo/embryo_main.c
  39. 8
      src/lib/embryo/embryo_private.h
  40. 6
      src/lib/embryo/embryo_rand.c
  41. 0
      src/lib/embryo/embryo_str.c
  42. 8
      src/lib/embryo/embryo_time.c

@ -62,3 +62,9 @@ Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Lionel Orry <lionel.orry@gmail.com>
Jérôme Pinot <ngc891@gmail.com>
Leandro Santiago <leandrosansilva@gmail.com>
Embryo
------
The Rasterman (Carsten Haitzler) <raster@rasterman.com>
Jérôme Pinot <ngc891@gmail.com>

@ -4,3 +4,5 @@ name and the license file covering it.
evil: licenses/COPYING.BSD
eet: licenses/COPYING.BSD
eina: licenses/COPYING.LGPL
eo: licenses/COPYING.BSD
embryo: licenses/COPYING.BSD

@ -1,6 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src doc
SUBDIRS = src data doc
MAINTAINERCLEANFILES = \
Makefile.in \
@ -48,7 +48,8 @@ spec/efl.spec \
pc/evil.pc \
pc/eina.pc \
pc/eet.pc \
pc/eo.pc
pc/eo.pc \
pc/embryo.pc
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA =
@ -60,7 +61,8 @@ endif
pkgconfig_DATA += \
pc/eina.pc \
pc/eo.pc \
pc/eet.pc
pc/eet.pc \
pc/embryo.pc
.PHONY: doc benchmark examples install-examples

@ -10,7 +10,7 @@ Additions:
* Add eina_barrier thread API
* Add eina_tmpstr_add() and eina_tmpstr_del()
* Add eina_thread API
Improvements:
* Single EFL tree now covring all EFL library components.
* Speedup Eina Rbtree Iterator by recycling memory instead of

@ -57,7 +57,7 @@ requirements_libs_eo=""
requirements_libs_eet=""
#requirements_libs_evas=""
#requirements_libs_ecore=""
#requirements_libs_embryo=""
requirements_libs_embryo=""
#requirements_libs_eio=""
#requirements_libs_edje=""
#requirements_libs_efreet=""
@ -73,7 +73,7 @@ requirements_libs_deps_eo=""
requirements_libs_deps_eet=""
#requirements_libs_deps_evas=""
#requirements_libs_deps_ecore=""
#requirements_libs_deps_embryo=""
requirements_libs_deps_embryo=""
#requirements_libs_deps_eio=""
#requirements_libs_deps_edje=""
#requirements_libs_deps_efreet=""
@ -88,7 +88,7 @@ requirements_pc_eo=""
requirements_pc_eet=""
#requirements_pc_evas=""
#requirements_pc_ecore=""
#requirements_pc_embryo=""
requirements_pc_embryo=""
#requirements_pc_eio=""
#requirements_pc_edje=""
#requirements_pc_efreet=""
@ -103,7 +103,7 @@ requirements_pc_deps_eo=""
requirements_pc_deps_eet=""
#requirements_pc_deps_evas=""
#requirements_pc_deps_ecore=""
#requirements_pc_deps_embryo=""
requirements_pc_deps_embryo=""
#requirements_pc_deps_eio=""
#requirements_pc_deps_edje=""
#requirements_pc_deps_efreet=""
@ -119,7 +119,7 @@ AC_SUBST([requirements_libs_eo])
AC_SUBST([requirements_libs_eet])
#AC_SUBST([requirements_libs_evas])
#AC_SUBST([requirements_libs_ecore])
#AC_SUBST([requirements_libs_embryo])
AC_SUBST([requirements_libs_embryo])
#AC_SUBST([requirements_libs_eio])
#AC_SUBST([requirements_libs_edje])
#AC_SUBST([requirements_libs_efreet])
@ -134,7 +134,7 @@ AC_SUBST([requirements_pc_eo])
AC_SUBST([requirements_pc_eet])
#AC_SUBST([requirements_pc_evas])
#AC_SUBST([requirements_pc_ecore])
#AC_SUBST([requirements_pc_embryo])
AC_SUBST([requirements_pc_embryo])
#AC_SUBST([requirements_pc_eio])
#AC_SUBST([requirements_pc_edje])
#AC_SUBST([requirements_pc_efreet])
@ -331,6 +331,9 @@ strlcpy \
AC_FUNC_ALLOCA
EFL_CHECK_FUNCS([EFL], [fnmatch gettimeofday])
###################### EFL ######################
@ -583,7 +586,7 @@ EFL_CHECK_LINKER_FLAGS([EINA], [-fno-strict-aliasing])
### Checks for library functions
EFL_CHECK_FUNCS([EINA], [dirfd dlopen dladdr fnmatch iconv shm_open setxattr])
EFL_CHECK_FUNCS([EINA], [dirfd dlopen dladdr iconv shm_open setxattr])
enable_log="no"
if test "x${efl_func_fnmatch}" = "xyes" && test "x${want_log}" = "xyes" ; then
@ -752,8 +755,6 @@ EET_LIBS="${EET_LIBS} ${requirements_libs_deps_eet}"
### Checks for compiler characteristics
EFL_CHECK_COMPILER_FLAGS([EET], [-Wshadow -Wpointer-arith])
### Checks for linker characteristics
case "${host_os}" in
@ -815,8 +816,65 @@ AM_CONDITIONAL([EO_BUILD_EXAMPLE_EVAS], [test "x${have_elm}" = "xyes"])
#### End of Eo
#### Embryo
AC_MSG_NOTICE([Embryo checks])
### Default values
### Additional options to configure
### Checks for programs
### Checks for libraries
## Compatibility layers
# Evil library for compilation on Windows
case "$host_os" in
mingw*)
requirements_pc_embryo="${requirements_pc_embryo} evil >= ${PACKAGE_VERSION}"
;;
esac
# Eina library
requirements_pc_embryo="eina >= ${PACKAGE_VERSION} ${requirements_pc_embryo}"
AC_ARG_VAR([EMBRYO_CFLAGS], [preprocessor flags for Embryo])
AC_SUBST([EMBRYO_CFLAGS])
AC_ARG_VAR([EMBRYO_LIBS], [linker flags for Embryo])
AC_SUBST([EMBRYO_LIBS])
### Checks for header files
### Checks for types
### Checks for structures
### Checks for compiler characteristics
### Checks for linker characteristics
### Checks for library functions
if ! test "x${efl_func_fnmatch}" = "xyes" ; then
AC_MSG_ERROR([Cannot find fnmatch()])
fi
if ! test "x${efl_func_gettimeofday}" = "xyes" ; then
AC_MSG_ERROR([Cannot find gettimeofday()])
fi
### Check availability
#### End of Embryo
AC_CONFIG_FILES([
Makefile
data/Makefile
doc/Makefile
doc/Doxyfile
src/Makefile
@ -826,6 +884,7 @@ src/benchmarks/eo/Makefile
src/bin/Makefile
src/bin/evil/Makefile
src/bin/eet/Makefile
src/bin/embryo/Makefile
src/examples/Makefile
src/examples/eina/Makefile
src/examples/eet/Makefile
@ -836,6 +895,7 @@ src/lib/eina/Makefile
src/lib/eina/eina_config.h
src/lib/eet/Makefile
src/lib/eo/Makefile
src/lib/embryo/Makefile
src/modules/Makefile
src/modules/eina/Makefile
src/modules/eina/mp/Makefile
@ -853,6 +913,7 @@ pc/evil.pc
pc/eina.pc
pc/eet.pc
pc/eo.pc
pc/embryo.pc
])
AC_OUTPUT

@ -0,0 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
filesdir = $(pkgdatadir)/include
files_DATA = embryo/default.inc
EXTRA_DIST = $(files_DATA)

@ -7,6 +7,7 @@ dnl dirfd
dnl dladdr
dnl dlopen
dnl fnmatch
dnl gettimeofday
dnl iconv
dnl setxattr (an al.)
dnl shm_open
@ -232,6 +233,52 @@ esac
AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
])
dnl _EFL_CHECK_FUNC_GETTIMEOFDAY is for internal use
dnl _EFL_CHECK_FUNC_GETTIMEOFDAY(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
AC_DEFUN([_EFL_CHECK_FUNC_GETTIMEOFDAY],
[
case "$host_os" in
mingw*)
_efl_have_fct="yes"
;;
*)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
#include <stdlib.h>
#include <sys/time.h>
]],
[[
int res;
res = gettimeofday(NULL, NULL);
]])],
[_efl_have_fct="yes"],
[_efl_have_fct="no"])
if test "x${_efl_have_fct}" = "xno" && test "x${enable_exotic}" = "xyes"; then
SAVE_LIBS="${LIBS}"
SAVE_CFLAGS="${CFLAGS}"
LIBS="${LIBS} ${EXOTIC_LIBS}"
CFLAGS="${CFLAGS} ${EXOTIC_CFLAGS}"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
#include <Exotic.h>
]],
[[
int res;
res = gettimeofday(NULL, NULL);
]])],
[_efl_have_fct="yes"],
[_efl_have_fct="no"])
LIBS="${SAVE_LIBS}"
CFLAGS="${SAVE_CFLAGS}"
fi
;;
esac
AS_IF([test "x${_efl_have_fct}" = "xyes"], [$2], [$3])
])
dnl _EFL_CHECK_FUNC_ICONV_PRIV is for internal use
dnl _EFL_CHECK_FUNC_ICONV_PRIV(EFL, LIB, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)

@ -8,8 +8,8 @@ embryoincludedir=@datadir@/include
Name: embryo
Description: A small virtual machine engine and bytecode compiler
@pkgconfig_requires_private@: @requirement_embryo@
Version: @VERSION@
Requires.private: @requirements_pc_embryo@
Libs: -L${libdir} -lembryo
Libs.private: @EFL_FNMATCH_LIBS@ -lm
Cflags: -I${includedir}/embryo-@VMAJ@

@ -8,4 +8,4 @@ SUBDIRS += evil
endif
SUBDIRS += eet
SUBDIRS += eet embryo

@ -0,0 +1,49 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib/eina \
-I$(top_srcdir)/src/lib/embryo \
-I$(top_builddir)/src/lib/eina \
-I$(top_builddir)/src/lib/embryo \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@EFL_CFLAGS@
if HAVE_WINDOWS
AM_CPPFLAGS += \
-I$(top_srcdir)/src/lib/evil \
-I$(top_builddir)/src/lib/evil
endif
bin_PROGRAMS = embryo_cc
embryo_cc_SOURCES = \
embryo_cc_amx.h \
embryo_cc_sc.h \
embryo_cc_sc1.c \
embryo_cc_sc2.c \
embryo_cc_sc3.c \
embryo_cc_sc4.c \
embryo_cc_sc5.c \
embryo_cc_sc6.c \
embryo_cc_sc7.c \
embryo_cc_scexpand.c \
embryo_cc_sclist.c \
embryo_cc_scvars.c \
embryo_cc_prefix.c \
embryo_cc_prefix.h
embryo_cc_LDADD = \
$(top_builddir)/src/lib/embryo/libembryo.la \
$(top_builddir)/src/lib/eina/libeina.la \
-lm
if HAVE_WINDOWS
embryo_cc_LDADD += $(top_builddir)/src/lib/evil/libevil.la
endif
EXTRA_DIST = \
embryo_cc_sc5.scp \
embryo_cc_sc7.scp

@ -40,7 +40,9 @@
#ifdef HAVE_EVIL
# include <Evil.h>
#endif /* HAVE_EVIL */
#endif
#include <Eina.h>
#include "embryo_cc_sc.h"
#include "embryo_cc_prefix.h"
@ -117,7 +119,7 @@ static int *wqptr; /* pointer to next entry */
static char binfname[PATH_MAX]; /* binary file name */
int
main(int argc, char *argv[], char *env[] __UNUSED__)
main(int argc, char *argv[], char *env[] EINA_UNUSED)
{
e_prefix_determine(argv[0]);
return sc_compile(argc, argv);
@ -573,7 +575,7 @@ initglobals(void)
static void
parseoptions(int argc, char **argv, char *iname, char *oname,
char *pname __UNUSED__, char *rname __UNUSED__)
char *pname EINA_UNUSED, char *rname EINA_UNUSED)
{
char str[PATH_MAX];
int i, stack_size;

@ -390,10 +390,10 @@ skim(int *opstr, void (*testfunc) (int), int dropval, int endval,
int lvalue, hits, droplab, endlab, opidx;
int allconst;
cell constval;
int index;
int idx;
cell cidx;
stgget(&index, &cidx); /* mark position in code generator */
stgget(&idx, &cidx); /* mark position in code generator */
hits = FALSE; /* no logical operators "hit" yet */
allconst = TRUE; /* assume all values "const" */
constval = 0;
@ -440,7 +440,7 @@ skim(int *opstr, void (*testfunc) (int), int dropval, int endval,
{
lval->ident = iCONSTEXPR;
lval->constval = constval;
stgdel(index, cidx); /* scratch generated code and calculate */
stgdel(idx, cidx); /* scratch generated code and calculate */
}
else
{
@ -589,13 +589,13 @@ plnge_rel(int *opstr, int opoff, int (*hier) (value * lval), value * lval)
static int
plnge1(int (*hier) (value * lval), value * lval)
{
int lvalue, index;
int lvalue, idx;
cell cidx;
stgget(&index, &cidx); /* mark position in code generator */
stgget(&idx, &cidx); /* mark position in code generator */
lvalue = (*hier) (lval);
if (lval->ident == iCONSTEXPR)
stgdel(index, cidx); /* load constant later */
stgdel(idx, cidx); /* load constant later */
return lvalue;
}
@ -608,10 +608,10 @@ static void
plnge2(void (*oper) (void),
int (*hier) (value * lval), value * lval1, value * lval2)
{
int index;
int idx;
cell cidx;
stgget(&index, &cidx); /* mark position in code generator */
stgget(&idx, &cidx); /* mark position in code generator */
if (lval1->ident == iCONSTEXPR)
{ /* constant on left side; it is not yet loaded */
if (plnge1(hier, lval2))
@ -632,7 +632,7 @@ plnge2(void (*oper) (void),
if (commutative(oper))
{ /* test for commutative operators */
value lvaltmp = { NULL, 0, 0, 0, 0, NULL };
stgdel(index, cidx); /* scratch push1() and constant fetch (then
stgdel(idx, cidx); /* scratch push1() and constant fetch (then
* fetch the constant again */
const2(lval2->constval << dbltest(oper, lval1, lval2));
/* now, the primary register has the left operand and the secondary
@ -693,7 +693,7 @@ plnge2(void (*oper) (void),
else if (lval1->ident == iCONSTEXPR && lval2->ident == iCONSTEXPR)
{
/* only constant expression if both constant */
stgdel(index, cidx); /* scratch generated code and calculate */
stgdel(idx, cidx); /* scratch generated code and calculate */
if (!matchtag(lval1->tag, lval2->tag, FALSE))
error(213); /* tagname mismatch */
lval1->constval =
@ -1483,7 +1483,7 @@ hier2(value * lval)
static int
hier1(value * lval1)
{
int lvalue, index, tok, symtok;
int lvalue, idx, tok, symtok;
cell val, cidx;
value lval2 = { NULL, 0, 0, 0, 0, NULL };
char *st;
@ -1527,7 +1527,7 @@ hier1(value * lval1)
needtoken(close);
return FALSE;
} /* if */
stgget(&index, &cidx); /* mark position in code generator */
stgget(&idx, &cidx); /* mark position in code generator */
push1(); /* save base address of the array */
if (hier14(&lval2)) /* create expression for the array index */
rvalue(&lval2);
@ -1538,7 +1538,7 @@ hier1(value * lval1)
error(213);
if (lval2.ident == iCONSTEXPR)
{ /* constant expression */
stgdel(index, cidx); /* scratch generated code */
stgdel(idx, cidx); /* scratch generated code */
if (lval1->arrayidx)
{ /* keep constant index, for checking */
assert(sym->dim.array.level >= 0
@ -2365,7 +2365,7 @@ commutative(void (*oper) ())
static int
constant(value * lval)
{
int tok, index, constant;
int tok, idx, constant;
cell val, item, cidx;
char *st;
symbol *sym;
@ -2413,9 +2413,9 @@ constant(value * lval)
/* cannot call constexpr() here, because "staging" is already turned
* on at this point */
assert(staging);
stgget(&index, &cidx); /* mark position in code generator */
stgget(&idx, &cidx); /* mark position in code generator */
expression(&constant, &item, &tag, FALSE);
stgdel(index, cidx); /* scratch generated code */
stgdel(idx, cidx); /* scratch generated code */
if (constant == 0)
error(8); /* must be constant expression */
if (lasttag < 0)

@ -32,6 +32,8 @@
#include <limits.h> /* for PATH_MAX */
#include <string.h>
#include <Eina.h>
#include "embryo_cc_sc.h"
/* When a subroutine returns to address 0, the AMX must halt. In earlier
@ -216,7 +218,7 @@ endexpr(int fullexpr)
* Global references: funcstatus (referred to only)
*/
void
startfunc(char *fname __UNUSED__)
startfunc(char *fname EINA_UNUSED)
{
stgwrite("\tproc");
stgwrite("\n");

@ -36,6 +36,8 @@
# include <unistd.h>
#endif
#include <Eina.h>
#include "embryo_cc_sc.h"
#include "embryo_cc_sc5.scp"

@ -31,6 +31,9 @@
#include <stdlib.h> /* for macro max() */
#include <string.h>
#include <ctype.h>
#include <Eina.h>
#include "embryo_cc_sc.h"
typedef cell(*OPCODE_PROC) (FILE * fbin, char *params, cell opcode);
@ -164,31 +167,31 @@ write_encoded(FILE * fbin, ucell * c, int num)
ucell p = (ucell) * c;
unsigned char t[5]; /* a 32-bit cell is encoded in max. 5 bytes (3 bytes for a 16-bit cell) */
unsigned char code;
int index;
int idx;
for (index = 0; index < 5; index++)
for (idx = 0; idx < 5; idx++)
{
t[index] = (unsigned char)(p & 0x7f); /* store 7 bits */
t[idx] = (unsigned char)(p & 0x7f); /* store 7 bits */
p >>= 7;
} /* for */
/* skip leading zeros */
while (index > 1 && t[index - 1] == 0
&& (t[index - 2] & 0x40) == 0)
index--;
/* skip leading -1s *//* ??? for BIT16, check for index==3 && t[index-1]==0x03 */
if (index == 5 && t[index - 1] == 0x0f
&& (t[index - 2] & 0x40) != 0)
index--;
while (index > 1 && t[index - 1] == 0x7f
&& (t[index - 2] & 0x40) != 0)
index--;
while (idx > 1 && t[idx - 1] == 0
&& (t[idx - 2] & 0x40) == 0)
idx--;
/* skip leading -1s *//* ??? for BIT16, check for idx==3 && t[idx-1]==0x03 */
if (idx == 5 && t[idx - 1] == 0x0f
&& (t[idx - 2] & 0x40) != 0)
idx--;
while (idx > 1 && t[idx - 1] == 0x7f
&& (t[idx - 2] & 0x40) != 0)
idx--;
/* write high byte first, write continuation bits */
assert(index > 0);
while (index-- > 0)
assert(idx > 0);
while (idx-- > 0)
{
code =
(unsigned char)((index == 0) ? t[index]
: (t[index] | 0x80));
(unsigned char)((idx == 0) ? t[idx]
: (t[idx] | 0x80));
writeerror |= !sc_writebin(fbin, &code, 1);
bytes_out++;
} /* while */
@ -211,7 +214,7 @@ write_encoded(FILE * fbin, ucell * c, int num)
#endif
static cell
noop(FILE * fbin __UNUSED__, char *params __UNUSED__, cell opcode __UNUSED__)
noop(FILE * fbin EINA_UNUSED, char *params EINA_UNUSED, cell opcode EINA_UNUSED)
{
return 0;
}
@ -221,7 +224,7 @@ noop(FILE * fbin __UNUSED__, char *params __UNUSED__, cell opcode __UNUSED__)
#endif
static cell
parm0(FILE * fbin, char *params __UNUSED__, cell opcode)
parm0(FILE * fbin, char *params EINA_UNUSED, cell opcode)
{
if (fbin)
write_encoded(fbin, (ucell *) & opcode, 1);
@ -261,7 +264,7 @@ parm2(FILE * fbin, char *params, cell opcode)
#endif
static cell
do_dump(FILE * fbin, char *params, cell opcode __UNUSED__)
do_dump(FILE * fbin, char *params, cell opcode EINA_UNUSED)
{
ucell p;
int num = 0;
@ -427,7 +430,7 @@ do_switch(FILE * fbin, char *params, cell opcode)
#endif
static cell
do_case(FILE * fbin, char *params, cell opcode __UNUSED__)
do_case(FILE * fbin, char *params, cell opcode EINA_UNUSED)
{
int i;
ucell p, v;
@ -451,7 +454,7 @@ do_case(FILE * fbin, char *params, cell opcode __UNUSED__)
#endif
static cell
curfile(FILE * fbin __UNUSED__, char *params, cell opcode __UNUSED__)
curfile(FILE * fbin EINA_UNUSED, char *params, cell opcode EINA_UNUSED)
{
fcurrent = (int)hex2long(params, NULL);
return 0;

@ -204,12 +204,12 @@ stgwrite(char *st)
* staging (referred to only)
*/
void
stgout(int index)
stgout(int idx)
{
if (!staging)
return;
stgstring(&stgbuf[index], &stgbuf[stgidx]);
stgidx = index;
stgstring(&stgbuf[idx], &stgbuf[stgidx]);
stgidx = idx;
}
typedef struct
@ -319,21 +319,21 @@ stgstring(char *start, char *end)
* staging (referred to only)
*/
void
stgdel(int index, cell code_index)
stgdel(int idx, cell code_index)
{
if (staging)
{
stgidx = index;
stgidx = idx;
code_idx = code_index;
} /* if */
}
int
stgget(int *index, cell * code_index)
stgget(int *idx, cell * code_index)
{
if (staging)
{
*index = stgidx;
*idx = stgidx;
*code_index = code_idx;
} /* if */
return staging;

@ -185,12 +185,12 @@ insert_path(char *path)
return cur;
}
char *
get_path(int index)
char *
get_path(int idx)
{
stringlist *cur = includepaths.next;
while (cur && index-- > 0)
while (cur && idx-- > 0)
cur = cur->next;
if (cur)
{

@ -8,4 +8,4 @@ SUBDIRS += evil
endif
SUBDIRS += eina eo eet
SUBDIRS += eina eo eet embryo

@ -0,0 +1,38 @@
MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I$(top_srcdir)/src/lib/eina \
-I$(top_builddir)/src/lib/eina \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
-DEFL_EMBRYO_BUILD \
@EFL_CFLAGS@
if HAVE_WINDOWS
AM_CPPFLAGS += \
-I$(top_srcdir)/src/lib/evil \
-I$(top_builddir)/src/lib/evil
endif
includes_HEADERS = Embryo.h
includesdir = $(includedir)/embryo-@VMAJ@
lib_LTLIBRARIES = libembryo.la
libembryo_la_SOURCES = \
embryo_amx.c \
embryo_args.c \
embryo_float.c \
embryo_main.c \
embryo_rand.c \
embryo_str.c \
embryo_time.c \
embryo_private.h
libembryo_la_LIBADD = $(top_builddir)/src/lib/eina/libeina.la -lm
if HAVE_WINDOWS
libembryo_la_LIBADD += $(top_builddir)/src/lib/evil/libevil.la
endif
libembryo_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@

@ -33,6 +33,8 @@
# include <Exotic.h>
#endif
#include <Eina.h>
#include "Embryo.h"
#include "embryo_private.h"
@ -450,7 +452,7 @@ embryo_program_vm_pop(Embryo_Program *ep)
EAPI void
embryo_swap_16(unsigned short *v
#ifndef WORDS_BIGENDIAN
__UNUSED__
EINA_UNUSED
#endif
)
{
@ -462,7 +464,7 @@ embryo_swap_16(unsigned short *v
EAPI void
embryo_swap_32(unsigned int *v
#ifndef WORDS_BIGENDIAN
__UNUSED__
EINA_UNUSED
#endif
)
{

@ -19,6 +19,8 @@ extern "C"
void *alloca (size_t);
#endif
#include <Eina.h>
#include "Embryo.h"
#include "embryo_private.h"
@ -31,7 +33,7 @@ void *alloca (size_t);
/* exported args api */
static Embryo_Cell
_embryo_args_numargs(Embryo_Program *ep, Embryo_Cell *params __UNUSED__)
_embryo_args_numargs(Embryo_Program *ep, Embryo_Cell *params EINA_UNUSED)
{
Embryo_Header *hdr;
unsigned char *data;

@ -44,6 +44,8 @@
#include <stdlib.h>
#include <math.h>
#include <Eina.h>
#include "Embryo.h"
#include "embryo_private.h"
@ -72,7 +74,7 @@ _embryo_fp_degrees_to_radians(float angle, int radix)
/* exported float api */
static Embryo_Cell
_embryo_fp(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = long value to convert to a float */
float f;
@ -101,7 +103,7 @@ _embryo_fp_str(Embryo_Program *ep, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_mul(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_mul(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 */
/* params[2] = float operand 2 */
@ -113,7 +115,7 @@ _embryo_fp_mul(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_div(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_div(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float dividend (top) */
/* params[2] = float divisor (bottom) */
@ -136,7 +138,7 @@ _embryo_fp_div(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_add(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_add(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 */
/* params[2] = float operand 2 */
@ -148,7 +150,7 @@ _embryo_fp_add(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_sub(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_sub(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 */
/* params[2] = float operand 2 */
@ -161,7 +163,7 @@ _embryo_fp_sub(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
/* Return fractional part of float */
static Embryo_Cell
_embryo_fp_fract(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_fract(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand */
float f;
@ -174,7 +176,7 @@ _embryo_fp_fract(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
/* Return integer part of float, rounded */
static Embryo_Cell
_embryo_fp_round(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_round(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand */
/* params[2] = Type of rounding (cell) */
@ -202,7 +204,7 @@ _embryo_fp_round(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_cmp(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_cmp(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 */
/* params[2] = float operand 2 */
@ -234,7 +236,7 @@ _embryo_fp_sqroot(Embryo_Program *ep, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_power(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_power(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 */
/* params[2] = float operand 2 */
@ -274,7 +276,7 @@ _embryo_fp_log(Embryo_Program *ep, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_sin(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_sin(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 (angle) */
/* params[2] = float operand 2 (radix) */
@ -288,7 +290,7 @@ _embryo_fp_sin(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_cos(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_cos(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 (angle) */
/* params[2] = float operand 2 (radix) */
@ -302,7 +304,7 @@ _embryo_fp_cos(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_tan(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_tan(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 (angle) */
/* params[2] = float operand 2 (radix) */
@ -316,7 +318,7 @@ _embryo_fp_tan(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_abs(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_abs(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand */
float f;
@ -328,7 +330,7 @@ _embryo_fp_abs(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_asin(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_asin(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 (angle) */
/* params[2] = float operand 2 (radix) */
@ -342,7 +344,7 @@ _embryo_fp_asin(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_acos(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_acos(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 (angle) */
/* params[2] = float operand 2 (radix) */
@ -356,7 +358,7 @@ _embryo_fp_acos(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_atan(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_atan(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 (angle) */
/* params[2] = float operand 2 (radix) */
@ -370,7 +372,7 @@ _embryo_fp_atan(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_atan2(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_atan2(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand 1 (y) */
/* params[2] = float operand 2 (x) */
@ -386,7 +388,7 @@ _embryo_fp_atan2(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_log1p(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_log1p(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand */
float f;
@ -398,7 +400,7 @@ _embryo_fp_log1p(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_cbrt(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_cbrt(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand */
float f;
@ -410,7 +412,7 @@ _embryo_fp_cbrt(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_exp(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_exp(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand */
float f;
@ -422,7 +424,7 @@ _embryo_fp_exp(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_exp2(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_exp2(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand */
float f;
@ -434,7 +436,7 @@ _embryo_fp_exp2(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
}
static Embryo_Cell
_embryo_fp_hypot(Embryo_Program *ep __UNUSED__, Embryo_Cell *params)
_embryo_fp_hypot(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params)
{
/* params[1] = float operand */
float f, ff;

@ -1,14 +1,6 @@
#ifndef _EMBRYO_PRIVATE_H
#define _EMBRYO_PRIVATE_H
#ifdef __GNUC__
# if __GNUC__ >= 4
// BROKEN in gcc 4 on amd64
//# pragma GCC visibility push(hidden)
# endif
#endif
typedef enum _Embryo_Opcode Embryo_Opcode;
enum _Embryo_Opcode

@ -4,19 +4,21 @@
#include <stdlib.h>
#include <Eina.h>
#include "Embryo.h"
#include "embryo_private.h"
/* exported random number api */
static Embryo_Cell
_embryo_rand_rand(Embryo_Program *ep __UNUSED__, Embryo_Cell *params __UNUSED__)
_embryo_rand_rand(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params EINA_UNUSED)
{
return (Embryo_Cell)(rand() & 0xffff);
}
static Embryo_Cell
_embryo_rand_randf(Embryo_Program *ep __UNUSED__, Embryo_Cell *params __UNUSED__)
_embryo_rand_randf(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params EINA_UNUSED)
{
double r;
float f;

@ -2,10 +2,6 @@
# include "config.h"
#endif
#ifndef EFL_HAVE_GETTIMEOFDAY
# error "Your platform isn't supported yet"
#endif
#include <sys/time.h>
#include <time.h>
@ -21,13 +17,15 @@
# include <Exotic.h>
#endif
#include <Eina.h>
#include "Embryo.h"
#include "embryo_private.h"
/* exported time api */
static Embryo_Cell
_embryo_time_seconds(Embryo_Program *ep __UNUSED__, Embryo_Cell *params __UNUSED__)
_embryo_time_seconds(Embryo_Program *ep EINA_UNUSED, Embryo_Cell *params EINA_UNUSED)
{
struct timeval timev;
double t;
Loading…
Cancel
Save