1 WINElib resources: a proposal
3 One of the current issues with WINElib is the inadequate support for accessing
4 resources by name. I propose the following technique (which I have already
5 begun to implement) to allow this:
7 An internal table of resource entries is provided along with a registering
8 function for adding a resource to this table. 'winerc' should construct
9 *.c files much the same way as it does now with the inclusion of a single
10 static 'constructor' function that registers the associated resources with
11 the internal mechanism like so:
13 static void DoIt() __attribute__ ((constructor));
16 LIBRES_RegisterResource(hello3_MENU_MAIN__bytes,
17 sizeof(hello3_MENU_MAIN__bytes),
20 LIBRES_RegisterResource(hello3_DIALOG_DIADEMO__bytes,
21 sizeof(hello3_DIALOG_DIADEMO__bytes),
27 The internal table can then be searched for the resource by name.
29 The only potential drawback I've determined so far is this technique's
30 reliance on gcc's 'constructor' attribute, which disallows compilation with
31 some other compiler. However, I'm guessing that WINE is already heavily
32 dependent on gcc, so this is probably not too much of a factor.
34 Any comments/suggestions/criticisms will be greatly appreciated.