Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!ut-sally!utah-cs!utah-gr!uplherc!sp7040!obie!wes From: wes@obie.UUCP (Barnacle Wes) Newsgroups: comp.sys.atari.st Subject: Re: Three questions. Message-ID: <80@obie.UUCP> Date: 3 Mar 88 03:06:31 GMT References: <1988Feb22.221218.13780@jarvis.csri.toronto.edu> Organization: UinTech, Layton, UT Lines: 38 Keywords: MWC system() malloc() free() In article <1988Feb22.221218.13780@jarvis.csri.toronto.edu>, juancho@dgp.toronto.edu (John Buchanan) writes: > > I have three questions that people out there might have > answers to. > > 1) [....] The > problem is that other mark william tools seem to be able to run > shell commands with out the SHELL variable being set, and if the > environment variable is set then a new copy of the shell is started up > for each cc in a make. I can't say for sure, but I think the tools are probably exec'ing the programs they call directly, rather than using system(). MWC provides two library functions to make this somewhat easier, look up access() and path() in the Lexicon. > 2) How does a typical mwc tool know that it has been called > from a shell. When ever I use a tool it seems to assume that the > program was run from the desktop and I have to press return. I think there is an environment variable called CAMEFROM they are checking. Usual entries are desktop and msh, or something like that. The tools probably assume the worst (desktop) if they don't see anything. > 3) How reliable are the malloc() and free() functions > provided with MWC. I haven't had any problems with them in 2.1.7, but I am (now) very careful to free() objects in the reverse order I malloc() them. As it turns out, this isn't that much of a limitation - I (NOW) always free blocks in the same routine that malloc()'s them. I've been stung by other compilers on other systems when I didn't do this. -- /\ - "Against Stupidity, - {backbones}! /\/\ . /\ - The Gods Themselves - utah-cs!utah-gr! / \/ \/\/ \ - Contend in Vain." - uplherc!sp7040! / U i n T e c h \ - Schiller - obie!wes