1 typedef struct foo {} foo_t;
2
3 typedef void (*func_t)(foo_t *s);
4
5 void cb_1 (foo_t *s);
6 void cb_2 (foo_t *s);
7
8 typedef struct config_s {
9 func_t func;
10 } config;
11
12 static const config table[2] = {
13 { cb_1 },
14 { cb_2 }
15 };
16
17 int deflate (foo_t *s, int which)
18 {
19 (*(table[which].func))(s);
20 }