Merge: Pep8analysis Web Version
[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 struct nitni_instance {struct instance *value;};
21 void show_backtrace(int);
22 extern int glob_argc;
23 extern char **glob_argv;
24 extern val *glob_sys;
25 struct instance_string__NativeString {
26 const struct type *type;
27 const struct class *class;
28 char* value;
29 };
30 struct instance_kernel__Bool {
31 const struct type *type;
32 const struct class *class;
33 short int value;
34 };
35 struct instance_kernel__Float {
36 const struct type *type;
37 const struct class *class;
38 double value;
39 };
40 struct instance_kernel__Int {
41 const struct type *type;
42 const struct class *class;
43 long value;
44 };
45 struct instance_kernel__Char {
46 const struct type *type;
47 const struct class *class;
48 char value;
49 };
50 struct instance_kernel__Pointer {
51 const struct type *type;
52 const struct class *class;
53 void* value;
54 };
55 struct instance_array__NativeArray {
56 const struct type *type;
57 const struct class *class;
58 val* values[0];
59 };