1 #ifndef _context__h__included__
2 #define _context__h__included__
14 /******************************************************************************
17 * Pop object from stack. Popping empty stack gives NULL.
25 *****************************************************************************/
26 struct object
* context_pop(struct context
* ctx
);
28 /******************************************************************************
31 * Push object to stack.
35 * obj The object to push.
37 *****************************************************************************/
38 void context_push(struct context
* ctx
, struct object
* obj
);
40 /******************************************************************************
43 * Notify context that execution is starting.
49 * 1 if suitable message was found, 0 if there is no suitable message.
51 *****************************************************************************/
52 unsigned context_prepare(struct context
* ctx
);
54 /******************************************************************************
57 * Notify context that execution is finished.
62 *****************************************************************************/
63 void context_unprepare(struct context
* ctx
);
65 /******************************************************************************
68 * Calculate number of stack slots.
73 *****************************************************************************/
74 size_t context_stacksize(struct context
* ctx
);
76 /******************************************************************************
79 * Single-step context.
84 *****************************************************************************/
85 void context_singlestep(struct context
* ctx
);
87 /******************************************************************************
96 * The context. Pass to free when done.
98 *****************************************************************************/
99 struct context
* context_create(struct vat
* vat
);
101 /******************************************************************************
107 * ctx Context to lock.
109 *****************************************************************************/
110 void context_lock(struct context
* ctx
);
112 /******************************************************************************
115 * Ungrab context lock.
118 * ctx Context to unlock.
120 *****************************************************************************/
121 void context_unlock(struct context
* ctx
);
123 /******************************************************************************
126 * Queue message into message queue.
129 * context The context to use.
130 * message The message to queue.
132 *****************************************************************************/
133 void context_queue_message(struct context
* context
, struct message
* message
);
135 /******************************************************************************
138 * Execute message handler.
141 * context The context to use.
144 * 1 if message got handled, 0 if not.
146 *****************************************************************************/
147 unsigned context_execute_msghandler(struct context
* ctx
);