home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 198_01 / emacs.c < prev    next >
C/C++ Source or Header  |  1990-01-23  |  735b  |  40 lines

  1. /*
  2.  * The routine in this file
  3.  * is just a main program.  For the
  4.  * callable interface, the main program must be in its own file.
  5.  */
  6.  
  7. #include    <stdio.h>
  8. #include    "estruct.h"
  9. #include    "edef.h"
  10.  
  11. #if    CALLABLE
  12. main(argc, argv)
  13. char *argv[];    {
  14.  
  15. #if    1
  16.     /* normal entry and exit */
  17.     exit( emacspgm(argc, argv) );
  18. #else
  19.     /* allow -? for testing ram usage with emacsone and RAMSHOW */
  20.  
  21.     char name[NFILEN];
  22.     char *fgets();
  23.  
  24.     if (argc == 2 && argv[1][0] == '-' && argv[1][1] == '?') {
  25.         for(;;)    {
  26.             printf("$_Emacs_File:\t");
  27.             if (fgets(name, sizeof(name), stdin) == NULL) exit();
  28.             if (*name == '\0') exit();
  29.             emacsone(name);
  30.             }
  31.         }
  32.     else    {
  33.         exit( emacspgm(argc, argv) );
  34.         }
  35. #endif
  36. }
  37.  
  38. #endif
  39.  
  40.