2005-05-15 18:37:00 +00:00
|
|
|
/*
|
2005-08-18 15:28:18 +00:00
|
|
|
* $Id: context.h,v 1.5 2005-08-18 15:28:18 bacon Exp $
|
2005-05-15 18:37:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _XP_STX_CONTEXT_H_
|
|
|
|
#define _XP_STX_CONTEXT_H_
|
|
|
|
|
2005-08-18 15:28:18 +00:00
|
|
|
#include <xp/stx/stx.h>
|
2005-05-15 18:37:00 +00:00
|
|
|
|
|
|
|
#define PUSH_OBJECT 0xA0
|
|
|
|
#define SEND_UNARY_MESSAGE 0xB0
|
|
|
|
#define HALT 0xFF
|
|
|
|
|
2005-05-21 16:11:06 +00:00
|
|
|
#define XP_STX_CONTEXT_SIZE 4
|
|
|
|
#define XP_STX_CONTEXT_IP 0
|
|
|
|
#define XP_STX_CONTEXT_METHOD 1
|
|
|
|
#define XP_STX_CONTEXT_ARGUMENTS 2
|
|
|
|
#define XP_STX_CONTEXT_TEMPORARIES 3
|
|
|
|
|
|
|
|
struct xp_stx_context_t
|
|
|
|
{
|
|
|
|
xp_stx_objhdr_t header;
|
2005-06-08 16:00:51 +00:00
|
|
|
xp_word_t ip;
|
|
|
|
xp_word_t method;
|
|
|
|
xp_word_t arguments;
|
|
|
|
xp_word_t temporaries;
|
2005-05-21 16:11:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct xp_stx_context_t xp_stx_context_t;
|
|
|
|
|
2005-05-15 18:37:00 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2005-06-08 16:00:51 +00:00
|
|
|
xp_word_t xp_stx_new_context (xp_stx_t* stx,
|
|
|
|
xp_word_t method, xp_word_t args, xp_word_t temp);
|
|
|
|
int xp_stx_run_context (xp_stx_t* stx, xp_word_t context);
|
2005-05-15 18:37:00 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|