4 * Copyright (C) 2008 Vincent Geddes
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 #ifndef __ST_CONTEXT_H__
26 #define __ST_CONTEXT_H__
29 #include <st-object.h>
31 struct st_context_part
33 struct st_header __parent__
;
41 struct st_method_context
43 struct st_context_part __parent__
;
50 struct st_block_context
52 struct st_context_part __parent__
;
60 #define ST_CONTEXT_PART(oop) ((struct st_context_part *) st_detag_pointer (oop))
61 #define ST_METHOD_CONTEXT(oop) ((struct st_method_context *) st_detag_pointer (oop))
62 #define ST_BLOCK_CONTEXT(oop) ((struct st_block_context *) st_detag_pointer (oop))
65 #define ST_CONTEXT_PART_SENDER(oop) (ST_CONTEXT_PART (oop)->sender)
66 #define ST_CONTEXT_PART_IP(oop) (ST_CONTEXT_PART (oop)->ip)
67 #define ST_CONTEXT_PART_SP(oop) (ST_CONTEXT_PART (oop)->sp)
69 #define ST_METHOD_CONTEXT_METHOD(oop) (ST_METHOD_CONTEXT (oop)->method)
70 #define ST_METHOD_CONTEXT_RECEIVER(oop) (ST_METHOD_CONTEXT (oop)->receiver)
71 #define ST_METHOD_CONTEXT_STACK(oop) (ST_METHOD_CONTEXT (oop)->stack)
73 #define ST_BLOCK_CONTEXT_INITIALIP(oop) (ST_BLOCK_CONTEXT (oop)->initial_ip)
74 #define ST_BLOCK_CONTEXT_ARGCOUNT(oop) (ST_BLOCK_CONTEXT (oop)->argcount)
75 #define ST_BLOCK_CONTEXT_HOME(oop) (ST_BLOCK_CONTEXT (oop)->home)
76 #define ST_BLOCK_CONTEXT_STACK(oop) (ST_BLOCK_CONTEXT (oop)->stack)
78 #endif /* __ST_CONTEXT_H__ */