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   
Text File  |  1991-03-12  |  3KB  |  64 lines

  1.         TECHINCAL NOTES FOR SHELL VERSION: 5.00 17-Feb-91
  2.         =================================================
  3.  
  4. STRUCTURE
  5. ---------
  6.  
  7. The  heart  of  CShell  is  still the old parser of Matt Dillon, which went
  8. through  its  first  major change in this version (Matt abused bit 7 of the
  9. characters,  so  international characters would not work).  Everything else
  10. were  just  minor  enhancements, which are very useful, though.  It's quite
  11. hard  to read, and it's huge (took me DAYS to understand it), but maybe all
  12. interpreters look like this...
  13.  
  14. The other side of the shell are the built in commands.  They look much like
  15. CLI commands in C, but they have helluva lot of support functions for their
  16. needs.
  17.  
  18. To  write a builtin command for CShell, you use the global variables av and
  19. ac  instead of argv and argc, and use printf() for output.  That's it.  Any
  20. other changes, if necessary, will be done by me.
  21.  
  22. Every  builtin  command  has its equivalent as a C function with the prefix
  23. do_ (example:  do_addbuffers).  The are no hard coded jumps to any of those
  24. functions,  instead there is a table with the descriptions of all functions
  25. (like  name, usage, minimum arguments and, last but not least, a pointer to
  26. that function).
  27.  
  28. I'll  probably  create  a  .doc that descibes the insides of the thell more
  29. precisely, and distribute it along with the source if I find the time to do
  30. it (not everybody is a 24 hour programmer like Matt :-)
  31.  
  32. WHY BUILT IN COMMANDS?
  33. ----------------------
  34.  
  35. The reasons why does C-Shell still relies heavily on internal
  36. commands:
  37. - They can take advantage from each other (e.g. class recognition in the
  38.   'dir' command, use of 'search' command in quick cd)
  39. - They have a fast calling sequence
  40. - They need no hard disk seeks, so the startup can be accelerated
  41.   significantly
  42. - They are shorter than external commands
  43. - And finally, if you don't like them, don't use them. The wasted resources
  44.   become more and more negligible nowadays.
  45.  
  46. SOURCE
  47. ------
  48.  
  49. The  source  for CShell is available, if you don't have it, request it from
  50. me.   It consists of 10 modules, together 190K.  It is compilable under SAS
  51. (Lattice)  &  Manx  C,  although  the  executables produced by Manx are not
  52. residentable.   If you want to modify it, ask me for an up-to-date version
  53. first.   You  may  not  release  modified  versions  (imagine  the chaos if
  54. everbody  releases his private csh), but if you send them to me, you have a
  55. very good chance that I'll build it in.  You'll be, of course, be mentioned
  56. in the docs.
  57.  
  58. Even  if  you  don't  intend to modify it, I still encourage you to get the
  59. source,  because  there  are  so many things you can look up there once you
  60. need  it  (did *you* know how to set the system date?).  I apologize for my
  61. poor to nonexistent comments, I'll go through again when I've got the time.
  62. Ah,  yes,  that  famous  Dillon-formatting  is gone, now it's traditionally
  63. formatted.
  64.