> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Linus Torvalds > Sent: Wednesday, August 03, 2005 2:18 PM > > > Yes, you can check the "symbol->scope", but things with global scope will > be in the global "built-in" scope, so checking scope will only help you > with things that are "static" in one file etc. So it's probably not what > you want. > > The thing is, I was somewhat lazy, and I made the "sparse()" > function just > return one big list of everything it parsed. That's really not very > helpful, but it meant that I didn't have to change the calling convention > in the users. > > I should really pass in a "action" function pointer to "sparse()", and > then call that for each file it parses, or something like that. > Or perhaps > return a "list of list of symbols". Or perhaps just make it so that the > caller calls "sparse()" until it returns NULL - and it would do one file > at a time. > > So I can do pretty much anything, but because I wanted to keep the > interface changes to "sparse()" callers minimal I did this really cheezy > and not very friendly thing of just appending everything in one messy > thing. > > Do you have preferences from the list above? > >
I think something like this would be good - first call sparse_init(argc, argv) and do one time init things and options parsing and call sparse_file(filename) in a loop to get the file specific tree back. Somewhat similar to what you are doing now but the caller stores the tree separately somewhere. I guess even the list of list of symbols are fine too if there is some way to relate the tree back to its source filename (even in the same order as the specified filenames will do). - To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
