use nitg to bootstrap; drop bootstrap of nitc
[nit.git] / c_src / nit.common.h
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <gc_chooser.h>
5 typedef void(*nitmethod_t)(void); /* general C type representing a Nit method. */
6 typedef union {
7 void* val;
8 long l;
9 short int s;
10 char c;
11 double d;
12 char* str;
13 void* ptr;
14 } nitattribute_t; /* general C type representing a Nit attribute. */
15 struct class { int box_kind; nitmethod_t vft[]; }; /* general C type representing a Nit class. */
16 struct type { int id; const char *name; int color; short int is_nullable; const struct types *resolution_table; int table_size; int type_table[]; }; /* general C type representing a Nit type. */
17 struct instance { const struct type *type; const struct class *class; nitattribute_t attrs[]; }; /* general C type representing a Nit instance. */
18 struct types { int dummy; const struct type *types[]; }; /* a list types (used for vts, fts and unresolved lists). */
19 typedef struct instance val; /* general C type representing a Nit instance. */
20 extern int glob_argc;
21 extern char **glob_argv;
22 extern val *glob_sys;
23 struct instance_posix__Passwd {
24 const struct type *type;
25 const struct class *class;
26 void* value;
27 };
28 struct instance_posix__Group {
29 const struct type *type;
30 const struct class *class;
31 void* value;
32 };
33 struct instance_string__NativeString {
34 const struct type *type;
35 const struct class *class;
36 char* value;
37 };
38 val* BOX_string__NativeString(char*);
39 struct instance_kernel__Bool {
40 const struct type *type;
41 const struct class *class;
42 short int value;
43 };
44 val* BOX_kernel__Bool(short int);
45 struct instance_kernel__Float {
46 const struct type *type;
47 const struct class *class;
48 double value;
49 };
50 val* BOX_kernel__Float(double);
51 struct instance_kernel__Int {
52 const struct type *type;
53 const struct class *class;
54 long value;
55 };
56 val* BOX_kernel__Int(long);
57 struct instance_kernel__Char {
58 const struct type *type;
59 const struct class *class;
60 char value;
61 };
62 val* BOX_kernel__Char(char);
63 struct instance_kernel__Pointer {
64 const struct type *type;
65 const struct class *class;
66 void* value;
67 };
68 struct instance_array__NativeArray {
69 const struct type *type;
70 const struct class *class;
71 val* values[0];
72 };
73 struct instance_file__FileStat {
74 const struct type *type;
75 const struct class *class;
76 void* value;
77 };
78 struct instance_file__NativeFile {
79 const struct type *type;
80 const struct class *class;
81 void* value;
82 };
83 val* BOX_file__NativeFile(void*);
84 struct instance_time__TimeT {
85 const struct type *type;
86 const struct class *class;
87 void* value;
88 };
89 struct instance_time__Tm {
90 const struct type *type;
91 const struct class *class;
92 void* value;
93 };
94 struct instance_exec__NativeProcess {
95 const struct type *type;
96 const struct class *class;
97 void* value;
98 };