-
Notifications
You must be signed in to change notification settings - Fork 0
/
AnyType.h
45 lines (38 loc) · 1.4 KB
/
AnyType.h
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
#ifndef ANYTYPE_H_
#define ANYTYPE_H_
#include "Bool.h"
//#include "inceos.h"
#include "unix.h"
// The union definition for anys
typedef union any_type {
int int_value;
unsigned unsigned_value;
float real_value;
bool bool_value;
uint8_t byte_value;
void* pointer_value;
} AnyTypeUNION;
// The object definition for anys
typedef struct AnyType_data *AnyTypePNTR, AnyTypeStruct;
struct AnyType_data {
void (*decRef)(AnyTypePNTR pntr);
struct AnyType_funcs *impl;
char* type;
AnyTypeUNION value;
};
extern AnyTypePNTR Construct_IntAnyType0(int value, char* type);
extern AnyTypePNTR Construct_UnsignedIntAnyType0(unsigned value, char* type);
extern AnyTypePNTR Construct_RealAnyType0(float value, char* type);
extern AnyTypePNTR Construct_BoolAnyType0(bool value, char* type);
extern AnyTypePNTR Construct_ByteAnyType0(uint8_t value, char* type);
extern AnyTypePNTR Construct_PointerAnyType0(void* value, char* type);
extern AnyTypePNTR Construct_AnyType();
extern bool anyTypeIsEqual(AnyTypePNTR this, char* compare);
extern char* anyTypeGetType(AnyTypePNTR this);
extern int anyTypeGetIntValue(AnyTypePNTR this);
extern unsigned anyTypeGetUnsignedIntValue(AnyTypePNTR this);
extern float anyTypeGetRealValue(AnyTypePNTR this);
extern bool anyTypeGetBoolValue(AnyTypePNTR this);
extern uint8_t anyTypeGetByteValue(AnyTypePNTR this);
extern void* anyTypeGetPointerValue(AnyTypePNTR this);
#endif /*ANYTYPE_H_ */