On 27 July 2010 01:35, Kris Maglione <maglion...@gmail.com> wrote: ... > Not so much. There's quite easy if you allow C99, anyway. > > typedef struct { > char *class; > char *regex; > int ord; > } Prop; > > struct { > char *Rule; > RuleFn fn; > RuleArg arg; > } rules[] = { > { (Rule[]){ {"WM_CLASS", "foo", 1}, {"WM_NAME", "bar"}, {0}}, > retag, { .s = "baz" } }, > }; > > Or something to that effect. Although a macro to wrap up the simple cases > would probably help.
Oh yeah, forgot about C99 :D.