home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
488.lha
/
csh_v5.0
/
technotes.doc
< prev
Wrap
Text File
|
1991-03-12
|
3KB
|
64 lines
TECHINCAL NOTES FOR SHELL VERSION: 5.00 17-Feb-91
=================================================
STRUCTURE
---------
The heart of CShell is still the old parser of Matt Dillon, which went
through its first major change in this version (Matt abused bit 7 of the
characters, so international characters would not work). Everything else
were just minor enhancements, which are very useful, though. It's quite
hard to read, and it's huge (took me DAYS to understand it), but maybe all
interpreters look like this...
The other side of the shell are the built in commands. They look much like
CLI commands in C, but they have helluva lot of support functions for their
needs.
To write a builtin command for CShell, you use the global variables av and
ac instead of argv and argc, and use printf() for output. That's it. Any
other changes, if necessary, will be done by me.
Every builtin command has its equivalent as a C function with the prefix
do_ (example: do_addbuffers). The are no hard coded jumps to any of those
functions, instead there is a table with the descriptions of all functions
(like name, usage, minimum arguments and, last but not least, a pointer to
that function).
I'll probably create a .doc that descibes the insides of the thell more
precisely, and distribute it along with the source if I find the time to do
it (not everybody is a 24 hour programmer like Matt :-)
WHY BUILT IN COMMANDS?
----------------------
The reasons why does C-Shell still relies heavily on internal
commands:
- They can take advantage from each other (e.g. class recognition in the
'dir' command, use of 'search' command in quick cd)
- They have a fast calling sequence
- They need no hard disk seeks, so the startup can be accelerated
significantly
- They are shorter than external commands
- And finally, if you don't like them, don't use them. The wasted resources
become more and more negligible nowadays.
SOURCE
------
The source for CShell is available, if you don't have it, request it from
me. It consists of 10 modules, together 190K. It is compilable under SAS
(Lattice) & Manx C, although the executables produced by Manx are not
residentable. If you want to modify it, ask me for an up-to-date version
first. You may not release modified versions (imagine the chaos if
everbody releases his private csh), but if you send them to me, you have a
very good chance that I'll build it in. You'll be, of course, be mentioned
in the docs.
Even if you don't intend to modify it, I still encourage you to get the
source, because there are so many things you can look up there once you
need it (did *you* know how to set the system date?). I apologize for my
poor to nonexistent comments, I'll go through again when I've got the time.
Ah, yes, that famous Dillon-formatting is gone, now it's traditionally
formatted.