Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!ptsfa!hoptoad!academ!killer!jfh From: jfh@killer.UUCP Newsgroups: comp.lang.c Subject: Re: What can I get away with Message-ID: <1101@killer.UUCP> Date: Mon, 6-Jul-87 13:23:37 EDT Article-I.D.: killer.1101 Posted: Mon Jul 6 13:23:37 1987 Date-Received: Sat, 11-Jul-87 16:44:02 EDT References: <608@zen.UUCP> <2299@hoptoad.uucp> <21211@sun.uucp> <830@omepd> <8190@linus.UUCP> Organization: The Unix(tm) Connection, Dallas, Texas Lines: 35 Summary: Should work just fine ... In article <8190@linus.UUCP>, jfjr@mitre-bedford.ARPA (Jerome Freedman) writes: > Suppose I declare an array of pointers to functions in one module. > I write a function, in the same module, which will install functions > in this array -call the function "install". > > In a different module I write a function, call it "new_function". > I make NO attempt at making "new_function" visible anywhere outside > of the module in which it is written. I call install on this > new_function to put it in my array. ... [ Much more stuff deleted ] You should be able to pass that pointer out of the function, say with the code static void new_function () { some_code ; } ins_new_func () { install (new_function); } and install should add the pointer to its list. The reason for all of these "should"s is there has got to be some machine somewheres that does something different. This idea works just fine on every machine I've seen - but somewheres out there there has to be an overlay linker or other strange beast that things new_function isn't needed after ins_new_func goes away. - John. Disclaimer: This space for rent.