~subsetpark/jnj

ref: cab71b923fc7bf642fb9c663c6329a5e6b27708d jnj/jnj.h -rw-r--r-- 1.3 KiB
cab71b92 — Zach Smith remove second header 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/// Response Types
#define JTBoolean 1
#define JTChar 2
#define JTInteger 4
#define JTFloat 8
#define JTComplex 16
#define JTBox 32
#define JTExtendedInt 64
#define JTRational 128
#define JTSymbol 65536
#define JTWide 131072
#define JNJPassThrough -1

typedef void V;
typedef long long I;
typedef char C;
typedef double D;
typedef struct {
  I k, flag, m, t, c, n, r, s[1];
} * A; // J array struct used in Jwd
typedef V *J;
typedef V *(*JIT)();
typedef V *(*JFT)(J);
typedef int (*JDT)(J, C *);
typedef C *(*JGT)(J);
typedef V *(*JFT)(J);
typedef V *(*JSXT)(J, V *, V *, V *, V *, I);
typedef int (*JGMT)(J, C *, I *, I *, I *, I *);
typedef int (*JSMT)(J, C *, I *, I *, I *, I *);
typedef A (*JGAT)(J jt, I n, C *name);
typedef I (*JSAT)(J jt, I n, C *name, I x, C *d);

// Get pointer to J engine
static JIT JInit;
static JFT JFree;
// Load J callbacks
// Format: {Output callback, Jwd(?), Input Callback, Console type flag}
static JSXT JSMX;
// Execute J sentence
static JDT JDo;
// Get J variable
static JGMT JGetM;
static JSMT JSetM;
static JGT JGetR;
static JGAT JGetA; /* get 3!:1 from name */
static JSAT JSetA;

V *jinit();
V jfree(J);
int jdo(J, C *);
V *loaddl();
int jgetm(J, C *, I *, I *, I *, I *);
int jsetm(J, C *, I *, I *, I *, I *);
C *jgetr(J);
A jgeta(J, I, C *);
I jseta(J, I, C *, I, C *);