Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!uwmcsd1!marque!uunet!mcvax!ukc!harrier.ukc.ac.uk!eagle.ukc.ac.uk!icdoc!doc.ic.ac.uk!dcw
From: dcw@doc.ic.ac.uk (Duncan C White)
Newsgroups: comp.sys.atari.st
Subject: Setting default environment from auto folder
Keywords: auto folder lattice gulam environment
Message-ID: <528@gould.doc.ic.ac.uk>
Date: 6 Dec 88 18:26:48 GMT
Sender: dcw@doc.ic.ac.uk
Reply-To: dcw@doc.ic.ac.uk (Duncan C White)
Organization: Dept. of Computing, Imperial College, London, UK.
Lines: 49


Hello there,

	For some time, I've been trying to get Unix-style environments
	to work on my ST, for programs which may be run from a command shell
	or from the desktop.

	If I run such programs from Gulam, everything is fine.
	I can set up the environment I want in the gulam.g file
	[well, actually binary patched to c:\gl.g], and then getenv
	to my hearts content...
	Incidentally, I use Lattice C 3.04, which [unlike MWC & Alycon, I
	believe??] provides a getenv() call... this works with Gulam perfectly.

	But, if I run a program from the desktop, there is no environment
	set up initially.
	What I'd like to do is write a program to be placed in the auto folder
	which will read a text file of Gulam/Csh-style setenv commands, and
	set up the global environment for the ST.

	I have 1st Publishing's "Anatomy of the Atari ST", which suggests
	[page 253] in the section on ST System Variables, that at $4BC there
	is "the_env: default environment string - 4 zero bytes"

	I had assumed that this was a pointer to the default environment..
	but I've had singular lack of success in setting it [in supervisor
	mode, of course] and doing a TSR call.  My attempts usually end in
	the machine going into a reboot loop until I deactivate the
	environment setter with setinit [first program in my auto folder]

	Is it safe to TSR from the auto folder?   To enter supervisor mode
	in auto folder?  Is the_env a pointer, or if not, is there another
	system variable which is more appropriate?
	If I succeed, will Gulam merge the two environments [ie. inherit
	the global environment] or will it simply ignore the global env?

	Can anybody help me?  Any details on environment format, relevent ST
	System Variables, would be hugely appreciated...

	Please mail suggestions to me and I'll summarise ...

		Duncan

[ Reply to: dcw@doc.ic.ac.uk or ...!ukc!icdoc!dcw ]
----------------------------------------------------------------------------
Duncan White,           |       "Middle East Policy was a fiasco and a
Dept. Of Computing,     |       disaster, but Central American policy was
Imperial College,       |       in better shape - it was merely a disaster!"
London SW7, England     |                  Spitting Image on Reagan...