Article View: comp.sys.atari.st
Article #26873Correct use of _shell_p (Csh-like shell, fast editor, make...)
From: Gert Poletiek
Date: Mon, 18 May 1987 13:40
Date: Mon, 18 May 1987 13:40
65 lines
3018 bytes
3018 bytes
In article <8705161656.AA19592@ucbvax.Berkeley.EDU> K538915@CZHRZU1A.BITNET writes:
>(maybe one day Atari will decide on for what it actually is :-)).
>
> Simon Poole
> K538915@CZHRZU1A.BITNET
OK, here is the description of how _shell_p should be used, that is how at
least one person at Atari wants it to be used.
When writing a shell for the ST I was wondering if it would be possible
to have a 'hook' into the shell such that one could invoke the shell from
any child job *WITHOUT* starting a new shell.
Unix users can now probably guess what I was aiming for: something like the
'system' call in Unix. In order to do this I needed an unused low memory
global that would hold the address of the entry point in the shell. Since I
knew that _shell_p was not used (and none of the books and documentation on
the ST said it was 'reserved') I contacted Allan Pratt about this _shell_p
variable. Here follows a part from the letter he sent me in reply
<start quote>
I talked with Landon about _shell_p: it was intended for one purpose,
then never used for it [..] It should be a pointer to a
procedure which acted like the Unix system() call:
extern int (*shell_p)();
system ( command )
char *command;
{
errcode = (*shell_p)( command );
}
Such a thing would be very handy from applications such as make.
Just think: Emacs could execute the command "make >errlist", then visit
the file errlist and even visit the files / go to the lines with errors!
Without having to know where "make.prg" is, or even how "make" has been
aliased within the shell!
<end quote>
So this is the way I implemented it, and I must say this works perfectly.
Currently we have a development system with each component integrated into my
shell using _shell_p. This developmentent system includes the shell, a C-shell
like shell, with some 60 commands (Pipes and I/O redirection and lots more),
and an editor (beating the hell out of every other editor on the ST, like
searching at 0.5 Mega-bytes per second), and several utilities including a
make.
Both the editor and the make use the _shell_p interface of the shell to
execute commands.
I think that if everybody sticks to the rules as outlined by Atari, shells
and user programs could easily be integrated.
If needed, I will post source code explaining exactly how to use _shell_p
in user programs.
Gert Poletiek.
(gert@nikhefh.uucp)
Technical Details
Message-ID:
<276@nikhefh.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!nikhefh!gertShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!nikhefh!gert From: gert@nikhefh.UUCP (Gert Poletiek) Newsgroups: comp.sys.atari.st Subject: Correct use of _shell_p (Csh-like shell, fast editor, make...) Message-ID: <276@nikhefh.UUCP> Date: Mon, 18-May-87 09:40:56 EDT Article-I.D.: nikhefh.276 Posted: Mon May 18 09:40:56 1987 Date-Received: Tue, 19-May-87 04:17:54 EDT Organization: Nikhef-H, Amsterdam (the Netherlands). Lines: 65 Keywords: _shell_p, shell