Update the changelog
[opencv] / apps / cvenv / EiC / eicval.h
1 #ifndef EICVALH_
2 #define EICVALH_
3
4 #include <sys/types.h>
5 #ifndef WIN32
6 #include <unistd.h>
7 #endif
8
9 #if !defined(_eic_ptr)
10 #define _eic_ptr
11 typedef struct {void *p, *sp, *ep;} ptr_t;
12 #endif
13
14
15 #ifndef NO_LONG_LONG
16 typedef long long eic_llong;
17 #else
18 typedef long eic_llong;
19 #endif
20
21
22 union VaL {
23   char cval;              /* char value */
24   unsigned char ucval;
25   short sval;             /* short integer val */
26   unsigned short usval;
27   int ival;               /* integer value */
28   unsigned  uival;
29   long lval;              /* long integer */
30   unsigned long ulval;
31
32   /* long longs are not yet supported by ANSI C*/
33
34   eic_llong llval;        /* long long value */
35
36   float fval;            /* float value */
37   double dval;           /* double float value */
38
39   ptr_t p;              /* safe pointer */
40   void *up;             /* unsafe pointer */
41
42   div_t divval;
43   ldiv_t ldivval;
44         
45   int (*func)();             /* function pointer */
46   union VaL (*vfunc)();
47
48   struct symentry_t * sym;/* pointer into symbol table */
49
50 #ifndef WIN32
51   pid_t pid;              /* process ID value */
52 #endif
53   size_t szval;           /* generic size value */
54 #ifndef WIN32
55   ssize_t sszval;         /* POSIX.1 byte count value */
56 #endif
57
58 #ifndef WIN32
59   mode_t mval;            /* mode_t value */
60 #endif
61
62 #ifdef _NETBSD
63   long offval;            /* file offset position */
64 #else
65   off_t offval;           /* file offset position */
66 #endif
67 };
68
69 typedef union VaL val_t;
70
71
72 typedef struct Label_t {
73     char *name;            /* label name */
74     int loc;               /* label location */
75     struct Label_t *nxt;   /* link to next label in list */
76 } Label_t;
77
78 typedef struct {
79     unsigned opcode;
80     val_t  val;
81     int ext;
82     unsigned short line;
83 }InsT_t;
84
85
86 typedef struct {
87     unsigned int nextinst;  /* next instruction */
88     unsigned int binst;     /* physical size */
89     InsT_t * inst;          /* instructions */
90     char * Filename;        /* file with source code */
91     Label_t * labels;
92     Label_t * gotos;
93     void * parent;         /* used for callbacks */
94     void * prev;           /* used for chaining during reentry and callbacks*/
95 }code_t;
96
97 /* methods for code */
98 #define opcode(C,i)   ((C)->inst[i].opcode)
99 #define setopcode(C,i,y) (opcode(C,i) = y)
100 #define ivalcode(C,i) ((C)->inst[i].val.ival)
101 #define pvalcode(C,i) ((C)->inst[i].val.p.p)
102 #define nextinst(C)   ((C)->nextinst)
103 #define instline(C,i) ((C)->inst[i].line)
104 #define codeName(C)   (C)->Filename
105
106
107 #ifndef EICH_
108 typedef struct AR_t {
109     val_t v;
110     type_expr * type;
111 }AR_t;
112
113 #else
114 typedef struct AR_t {
115     val_t v;
116     void * type;
117 }AR_t;
118 #endif
119
120 #endif
121
122
123