Reorganize build system
[qemu/aliguori.git] / test-variant.c
blob2ca287a017d0235f9c08cad01e3856ed3dcc5715
1 typedef struct Plug Plug;
2 typedef struct Visitor Visitor;
3 typedef struct Error Error;
5 #include "variant.h"
6 #include <stdio.h>
8 static void plug_add_property_full(Plug *plug, const char *name,
9 const char *type,
10 EtterTrampoline *getter,
11 EtterTrampoline *setter)
13 printf("%s %s\n", name, type);
16 static void foo_set_bar(Plug *plug, int bar)
20 static int foo_get_bar(Plug *plug)
22 return 32;
25 int main(int argc, char **argv)
27 printf("%s\n", typename(int8_t));
28 printf("%s\n", typename(int16_t));
29 printf("%s\n", typename(int32_t));
30 printf("%s\n", typename(int64_t));
31 printf("%s\n", typename(uint8_t));
32 printf("%s\n", typename(uint16_t));
33 printf("%s\n", typename(uint32_t));
34 printf("%s\n", typename(uint64_t));
35 printf("%s\n", typename(char *));
36 printf("%s\n", typename(void *));
38 plug_add_property(0, "bar", int, &foo_get_bar, &foo_set_bar);
40 return 0;