Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!algor2.algorists.com!jeffrey From: jeffrey@algor2.algorists.com (Jeffrey Kegler) Newsgroups: comp.lang.c Subject: Re: want to know Message-ID: <1989Aug28.202551.9514@algor2.algorists.com> Date: 28 Aug 89 20:25:51 GMT References: <8487@bsu-cs.bsu.edu> <2980@solo9.cs.vu.nl> <182@sunquest.UUCP> <14269@haddock.ima.isc.com> <1496@l.cc.purdue.edu> <1701@crdgw1.crd.ge.com> <2538@trantor.harris-atd.com> <10760@smoke.BRL.MIL> <2563@trantor.harris-atd.com> <10781@smoke.BRL.MIL> Reply-To: jeffrey@algor2.UUCP (Jeffrey Kegler) Organization: Algorists, Inc. Lines: 22 In article <10781@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >I've never felt the need to "program around" C's use >of main() as the entry point for (hosted) programs. I have, occasionally. Consider a directory (bigapp.d) containing a large applications (bigapp), where you want you have some smaller associated utilities (ut1, ut2, ...) which use routines in bigapp. It does not always make sense to group the routines shared by the large application with one or more of the utilities into a library in a separate directory. Now bigapp.c, ut1.c, ut2.c, etc., each must have a main(). This is annoying for use with debuggers, cross-referencers, etc. In the above situation it makes a lot of sense to have each routine in bigapp.d named differently. It would be nice for the entry point for the ut1, ut2, ... executables to be named ut1(), ut2(), etc. The entry point in bigapp.c could be called main() or bigapp() depending on taste. -- Jeffrey Kegler, Independent UNIX Consultant, Algorists, Inc. jeffrey@algor2.ALGORISTS.COM or uunet!algor2!jeffrey 1762 Wainwright DR, Reston VA 22090