Path: utzoo!attcan!uunet!jarthur!nntp-server.caltech.edu!toddpw From: toddpw@nntp-server.caltech.edu (Todd P. Whitesel) Newsgroups: comp.sys.apple2 Subject: Re: Making Inits in ORCA/C... Message-ID: <1991Jan12.100403.20139@nntp-server.caltech.edu> Date: 12 Jan 91 10:04:03 GMT References: <20696@netcom.UUCP> Organization: California Institute of Technology, Pasadena Lines: 46 avery@netcom.UUCP (Avery Colter) writes: >Fellow ORCA/C buffs... >Does any of you know whether initialization files can be made from ORCA/C? They most certainly can. >Also, do Init files have to be non-interactive? Doubt it. >Are there any books with any detail of the subject? Not really. But the documentation that does exist makes it clear that Inits are loaded/executed/disposed of in exactly the same way except for one: inits end with an RTL and not a Quit call. trivial example: #include void main (void) { printf("Hello, World.\n"); getchar(); } #compile hello.cc #rm hello.root #link hello (I assume your KEEPNAME and LINKNAME are $) #filetype hello $b7 (temp init) What happened? We killed the code that Orca adds onto every C program that parses the shell command line into argc/argv variables, before creating the final program. The problem is that when you have more subroutines and source files, you have to remember this simple rule: If the first filename given to the linker has no .ROOT file, then the first function in that object file will be the one called by the O/S and not main(). Try some experiments and see what works. I suspect that parts of the stdio library are dependent on the Orca shell being available. When I get some time I am going to work on replacements that are purely GS/OS and tool dependent so Orca's weak library will not be a problem. Todd Whitesel toddpw @ tybalt.caltech.edu