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