diff --git a/legacy/embryo/src/lib/Embryo.h b/legacy/embryo/src/lib/Embryo.h index c9f97ce51e..e7c1a7217a 100644 --- a/legacy/embryo/src/lib/Embryo.h +++ b/legacy/embryo/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; + /* program run return values */ + 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 */ - /** 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 unsigned int Embryo_UCell; - typedef int Embryo_Cell; - typedef struct _Embryo_Program Embryo_Program; - typedef int Embryo_Function; 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/legacy/embryo/src/lib/embryo_amx.c b/legacy/embryo/src/lib/embryo_amx.c index b4dd3c75b6..ab96ab7d2d 100644 --- a/legacy/embryo/src/lib/embryo_amx.c +++ b/legacy/embryo/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;