]> gitweb.factorcode.org Git - factor.git/blob - native/word.h
6e04db02be08295317a597fa037dd5eb1f77fb4b
[factor.git] / native / word.h
1 typedef void (*XT)(void);
2
3 typedef struct {
4         /* TAGGED execution token: jump here to execute word */
5         CELL xt;
6         /* on-disk primitive number */
7         CELL primitive;
8         /* TAGGED parameter to xt; used for colon definitions */
9         CELL parameter;
10         /* TAGGED property list for library code */
11         CELL plist;
12 } WORD;
13
14 INLINE WORD* untag_word(CELL tagged)
15 {
16         type_check(WORD_TYPE,tagged);
17         return (WORD*)UNTAG(tagged);
18 }
19
20 INLINE CELL tag_word(WORD* word)
21 {
22         return RETAG(word,WORD_TYPE);
23 }
24
25 WORD* word(FIXNUM primitive, CELL parameter, CELL plist);
26 void update_xt(WORD* word);
27 void fixup_word(WORD* word);
28 void collect_word(WORD* word);
29 void primitive_wordp(void);
30 void primitive_word(void);
31 void primitive_word_primitive(void);
32 void primitive_set_word_primitive(void);
33 void primitive_word_parameter(void);
34 void primitive_set_word_parameter(void);
35 void primitive_word_plist(void);
36 void primitive_set_word_plist(void);