server/src/util/variant.h

26 lines
570 B
C
Raw Normal View History

2010-08-08 10:06:34 +02:00
#ifndef STRUCT_VARIANT_H
#define STRUCT_VARIANT_H
#ifdef __cplusplus
extern "C" {
#endif
2011-03-07 08:02:35 +01:00
typedef union variant {
2015-07-12 13:15:10 +02:00
void *v; //TODO: V117 http://www.viva64.com/en/V117 Memsize type is used in the union.
2011-03-07 08:02:35 +01:00
int i;
char c;
short s;
short sa[2];
2015-07-12 13:15:10 +02:00
char ca[4]; //TODO: V112 http://www.viva64.com/en/V112 Dangerous magic number 4 used: char ca[4];.
2011-03-07 08:02:35 +01:00
float f;
} variant;
2010-08-08 10:06:34 +02:00
2011-03-07 08:02:35 +01:00
typedef enum variant_type {
VAR_NONE, VAR_INT, VAR_VOIDPTR, VAR_CHAR, VAR_SHORT, VAR_SHORTA, VAR_CHARA,
VAR_FLOAT
} variant_type;
2010-08-08 10:06:34 +02:00
#ifdef __cplusplus
}
#endif
#endif