>>2
You can't do compile time list or struct initialization in C89 AFAIK. Because nobody has ever read the C99 standard, much less implemented it, you are going to have to use C++ if you want to do this.
Name:
Anonymous2010-10-22 4:21
>>2
No, the idea is that i do not do them right away, but that they will be defined later troughout all the files and that i dont know how many i will have.
Name:
Anonymous2010-10-22 4:31
>>4
Write a program to parse your files and generate code for you. There is no preprocessor magic that will allow you to do this in pure C. Or you can use C++ constructors for this (store pointer to last node of list in global, and append a node to it in constructor of some dummy class), but then order will be undefined.
Name:
Anonymous2010-10-22 4:36
>>5 There is no preprocessor magic that will allow you to do this in pure C
I was only asking for this since i hoped /prog/ would know a "pure C" way of doing this, it try to avoid external programs. But its not a problem for me doing this without C.
>>6
Preprocessors for each .c are completely independent from each other. What you want is to send information about "dong" from preprocessor of one .c file to some other, so that it can put a reference to dong into structure somewhere, but there is no way this can work.
Name:
Anonymous2010-10-22 4:55
If you know what the list contains at compile time, then why not store it in an array?
Name:
Anonymous2010-10-22 5:00
>>10
Unfortunetly, i try to do this with functions, instead of ints.
I didnt try to confuse things more than they already are.
What i precisely want is a list with nodes whose first element is a name and the second a function pointer.