Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!feg From: feg@clyde.UUCP Newsgroups: comp.lang.c Subject: Re: Accessing argc & argv from a function Message-ID: <11845@clyde.ATT.COM> Date: Tue, 4-Aug-87 16:05:09 EDT Article-I.D.: clyde.11845 Posted: Tue Aug 4 16:05:09 1987 Date-Received: Thu, 6-Aug-87 05:13:13 EDT References: <420@sugar.UUCP> <39@flmis06.ATT.COM> <1260@killer.UUCP> <2616@hoptoad.uucp> Organization: AT&T Bell Labs, Whippany, NJ Lines: 22 Summary: The information is in the PSP In article <2616@hoptoad.uucp>, gnu@hoptoad.uucp (John Gilmore) writes: > > Well, I think we may have lost track of the initial problem. > > > > However I am still looking for a way to get at "argc" and "argv" from > > a function when I don't have access to "main". > > There is no portable way to do this. [deletions] > The solution is to get the source for main() and modify it, or do something > that doesn't involve the arguments, e.g. pass the information you are > looking for in the environment, in a file, etc. You never did get around > to explaining what it is you *really* want to do, or why you are modifying The original poster didn't say he wanted a portable way and he did say he didn't have access to main(). The command line information is in the PSP. DOS 3.+ has the entire command line, while DOS 2.+ does not have the name of the program being executed. If you can't access with C (and I believe that you can), you certainly can do it in assembly. Forrest Gehrke