Angband 3.0.9b.
[angband.git] / src / z-type.h
blob1f57fd5212adc2be046af68c258fdf381c60f64c
3 typedef struct data_panel data_panel;
4 typedef struct type_union type_union;
6 typedef enum type_val {
7 T_END = 0,
8 T_INT,
9 T_FLOAT,
10 T_CHAR,
11 T_STRING
12 } type_val;
14 struct type_union
16 type_val t;
17 union {
18 float f;
19 int i;
20 char c;
21 const char *s;
22 } u;
25 extern type_union i2u(int i);
26 extern type_union f2u(float f);
27 extern type_union c2u(char c);
28 extern type_union s2u(const char *s);
30 static const type_union END = { T_END, { 0 } };
32 /*
33 * Helper classes for the display of typed data
36 #define MAX_FMT 2
37 struct data_panel
39 byte color;
40 const char *label;
41 const char *fmt; /* printf format argument */
42 type_union value[MAX_FMT]; /* (short) arugment list */