From d721c88af095bd60495ec175a10c90e88958e706 Mon Sep 17 00:00:00 2001 From: raster Date: Wed, 22 Sep 2010 14:21:55 +0000 Subject: [PATCH] api cleanups too. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/embryo@52592 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/Embryo.h | 32 ++++++++++++++++++-------------- src/lib/embryo_amx.c | 2 +- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/lib/Embryo.h b/src/lib/Embryo.h index c9f97ce..e7c1a72 100644 --- a/src/lib/Embryo.h +++ b/src/lib/Embryo.h @@ -44,7 +44,7 @@ extern "C" { EAPI extern Embryo_Version *embryo_version; - /* potentioal error values */ + /* potential error values */ typedef enum _Embryo_Error { EMBRYO_ERROR_NONE, @@ -75,23 +75,27 @@ extern "C" { EMBRYO_ERROR_DOMAIN, /** Domain error, expression result does not fit in range */ } Embryo_Error; - /* possible function type values that are enumerated */ -#define EMBRYO_FUNCTION_NONE 0x7fffffff /* An invalid/non existent function */ -#define EMBRYO_FUNCTION_MAIN -1 /* Start at program entry point */ -#define EMBRYO_FUNCTION_CONT -2 /* Continue from last address */ - /** An invalid cell reference */ -#define EMBRYO_CELL_NONE 0x7fffffff /* program run return values */ -#define EMBRYO_PROGRAM_OK 1 -#define EMBRYO_PROGRAM_SLEEP 2 -#define EMBRYO_PROGRAM_BUSY 3 -#define EMBRYO_PROGRAM_TOOLONG 4 -#define EMBRYO_PROGRAM_FAIL 0 - + typedef enum _Embryo_Status + { + EMBRYO_PROGRAM_FAIL = 0, + EMBRYO_PROGRAM_OK = 1, + EMBRYO_PROGRAM_SLEEP = 2, + EMBRYO_PROGRAM_BUSY = 3, + EMBRYO_PROGRAM_TOOLONG = 4 + } Embryo_Status; + typedef unsigned int Embryo_UCell; typedef int Embryo_Cell; + /** An invalid cell reference */ +#define EMBRYO_CELL_NONE 0x7fffffff + typedef struct _Embryo_Program Embryo_Program; typedef int Embryo_Function; + /* possible function type values that are enumerated */ +#define EMBRYO_FUNCTION_NONE 0x7fffffff /* An invalid/non existent function */ +#define EMBRYO_FUNCTION_MAIN -1 /* Start at program entry point */ +#define EMBRYO_FUNCTION_CONT -2 /* Continue from last address */ typedef union { @@ -140,7 +144,7 @@ extern "C" { EAPI Embryo_Cell embryo_data_heap_push(Embryo_Program *ep, int cells); EAPI void embryo_data_heap_pop(Embryo_Program *ep, Embryo_Cell down_to); EAPI int embryo_program_recursion_get(Embryo_Program *ep); - EAPI int embryo_program_run(Embryo_Program *ep, Embryo_Function func); + EAPI Embryo_Status embryo_program_run(Embryo_Program *ep, Embryo_Function func); EAPI Embryo_Cell embryo_program_return_value_get(Embryo_Program *ep); EAPI void embryo_program_max_cycle_run_set(Embryo_Program *ep, int max); EAPI int embryo_program_max_cycle_run_get(Embryo_Program *ep); diff --git a/src/lib/embryo_amx.c b/src/lib/embryo_amx.c index b4dd3c7..ab96ab7 100644 --- a/src/lib/embryo_amx.c +++ b/src/lib/embryo_amx.c @@ -1051,7 +1051,7 @@ embryo_program_recursion_get(Embryo_Program *ep) * it is allowed to in abstract machine instruction count. * @ingroup Embryo_Run_Group */ -EAPI int +EAPI Embryo_Status embryo_program_run(Embryo_Program *ep, Embryo_Function fn) { Embryo_Header *hdr; -- 2.7.4