home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume17 / e2 / part02 / main.c < prev    next >
C/C++ Source or Header  |  1989-02-08  |  3KB  |  58 lines

  1.  
  2. /*******************************************************************************
  3. #  E - command line preprocessor for vi.  Version 1.3 - November 1988.         #
  4. #  ===================================================================         #
  5. #                                                                              #
  6. #  Terry Jones, Department of Computer Science, University of Waterloo         #
  7. #  Waterloo, Ontario, Canada. N2L 3G1                                          #
  8. #                                                                              #
  9. #  {ihnp4,allegra,decvax,utzoo,utcsri,clyde}!watmath!watdragon!tcjones         #
  10. #  tcjones@dragon.waterloo.{cdn,edu} tcjones@WATER.bitnet                      #
  11. #  tcjones%watdragon@waterloo.csnet                                            #
  12. *******************************************************************************/
  13.  
  14.  
  15. #include "e.h"
  16.  
  17. FILE *hist_fp = NULL;        /* The original .e file                        */
  18. FILE *tmp_fp = NULL;         /* The new .e file                             */
  19. char *hist[HIST_LINES];      /* Pointers to history items.                  */
  20. char *home;                  /* Home directory.                             */
  21. char *myname;                /* argv[0]                                     */
  22. char *saved_line = NULL;     /* In case we read one line too many later on. */
  23. char arg[ARG_CHARS];         /* The arguments that vi will be invoked with. */
  24. char cwd[MAXPATHLEN];        /* The directory from which we're invoked.     */
  25. char ehist[MAXPATHLEN];      /* The name of the original .e file.           */
  26. char erase;                  /* The terminal's erase character.             */
  27. char tmp_file[MAXPATHLEN];   /* The name of the new .e file.                */
  28. int emode;                   /* The protection mode of the original .e.     */
  29. int hist_count;              /* The # of items in the history for this dir. */
  30. int safe_inherit = 0;        /* Never inherit other people's .exrc's        */
  31. int inherit = 0;             /* Inherit .exrc files?                        */
  32. int uid;                     /* The user's uid.                             */
  33.  
  34.  
  35. main(argc, argv)
  36. int argc;
  37. char **argv;
  38. {
  39.     /*
  40.      * Do some preliminary things. Grab the name we were invoked with,
  41.      * record the status of the terminal so we can restore it later if
  42.      * we have to alter it for some reason, arrange to catch SIGINT and
  43.      * read and split up the history for this directory.
  44.      *
  45.      * Then call e which handles the arguments and calls other things
  46.      * to get the job done. e should never return.
  47.      */
  48.  
  49.     myname = argv[0];
  50.     terminal(TERM_RECORD);
  51.     catch_signals();
  52.     inheritance();
  53.     find_hist();
  54.     hist_count = read_hist();
  55.     e(argc, argv);
  56.     return 1;
  57. }
  58.