Path: utzoo!utgpu!watmath!clyde!att!alberta!ubc-cs!van-bc!rsoft!frank From: frank@rsoft.UUCP (Frank I. Reiter) Newsgroups: comp.lang.c Subject: Re: Subroutine layout in C Message-ID: <9@rsoft.UUCP> Date: 22 Dec 88 17:37:11 GMT References: <2800002@uxg.cso.uiuc.edu> Reply-To: frank@rsoft.UUCP (Frank I. Reiter) Organization: Reiter Software Inc., British Columbia Canada Lines: 20 In article <2800002@uxg.cso.uiuc.edu> phil@uxg.cso.uiuc.edu writes: > > I want S to be known outside. >I also want to have two subroutines X and Y to be known ONLY to S (not known >outside of S). Either can be called by S, and each calls the other in a >recursive way. I also need to share several variables entirely within >this context (shared between S, X, Y). They can be static. Put S(), X(), and Y() in their own file. Declare X() and Y() to be static and do the same with any global variables to be accessed only by S(), X(), and Y(). Other modules will be able to call S() but not X() or Y() or any of the static variables. -- *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* Frank I. Reiter \ / UUCP: {uunet,ubc-cs}!van-bc!rsoft!frank Langley, British Columbia / \ BBS: Mind Link @ (604)533-2312 *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*