2002-11-02 15:10:52 +01:00
|
|
|
#ifndef STRUCT_VARIANT_H
|
|
|
|
#define STRUCT_VARIANT_H
|
2003-07-29 11:48:03 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2002-11-02 15:10:52 +01:00
|
|
|
|
2005-06-10 00:10:35 +02:00
|
|
|
typedef union variant {
|
2002-11-02 15:10:52 +01:00
|
|
|
void *v;
|
2005-06-10 00:10:35 +02:00
|
|
|
int i;
|
2002-11-02 15:10:52 +01:00
|
|
|
char c;
|
|
|
|
short s;
|
|
|
|
short sa[2];
|
|
|
|
char ca[4];
|
2005-06-10 00:10:35 +02:00
|
|
|
float f;
|
2002-11-02 15:10:52 +01:00
|
|
|
} variant;
|
|
|
|
|
2005-06-10 00:10:35 +02:00
|
|
|
typedef enum variant_type {
|
|
|
|
VAR_NONE, VAR_INT, VAR_VOIDPTR, VAR_CHAR, VAR_SHORT, VAR_SHORTA, VAR_CHARA, VAR_FLOAT
|
|
|
|
} variant_type;
|
2003-07-29 11:48:03 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2002-11-02 15:10:52 +01:00
|
|
|
#endif
|