p2  0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
p2.h
Go to the documentation of this file.
1 
5 #ifndef P2_H
6 #define P2_H
7 
8 #define P2_VERSION "0.0"
9 #define P2_MINOR 0
10 #define P2_MAJOR 0
11 #define P2_SIG "p\02\10n"
12 #define P2_VMID 0x79
13 
14 #include "potion.h"
15 
16 #ifdef P2
17 # undef NIL_NAME
18 # undef NILKIND_NAME
19 # define NIL_NAME "undef" // nil => undef
20 # define NILKIND_NAME "Undef"
21 # undef POTION_SIG // do not mix compiled potion with p2 bytecode,
22  // though it should be compatible for now
23 # define POTION_SIG P2_SIG
24 
25 extern PN PN_use, PN_no;
26 
27 #endif
28 
29 //
30 // additional p2 functions
31 //
32 
33 PN p2_source_load(Potion *P, PN cl, PN buf);
34 PN p2_parse(Potion *, PN, char*);
35 PN p2_run(Potion *, PN, int);
36 PN p2_eval(Potion *, PN);
37 PN p2_sig(Potion *, char *);
38 PN p2_load(Potion *, PN, PN, PN);
39 
40 // signature syntax is different.
41 // Internally for PN_FUNC we still use the better strongly-typed potion
42 // sigs. i.e "name=S,block=&"
43 // p2_sig should be really p5_sig or p6_sig
44 #define P2_FUNC(f, s) potion_closure_new(P, (PN_F)f, p2_sig(P, s), 0)
45 
46 #ifdef P2
47 PN potion_any_is_defined(Potion *, PN, PN);
48 
49 #define potion_load_code p2_load_code
50 #define potion_load p2_load
51 #define potion_source_load p2_source_load
52 #define potion_parse p2_parse
53 #define potion_run p2_run
54 #define potion_eval p2_eval
55 #endif
56 
57 #endif
PN p2_parse(Potion *, PN, char *)
PN p2_eval(Potion *, PN)
PN p2_run(Potion *, PN, int)
PN p2_load(Potion *, PN, PN, PN)
PN p2_sig(Potion *, char *)
the global interpreter state P. currently singleton (not threads yet)
Definition: potion.h:653
The potion API.
PN p2_source_load(Potion *P, PN cl, PN buf)
volatile _PN PN
Definition: potion.h:81