aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Farina <tfransosi@gmail.com>2010-08-13 00:19:22 -0300
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-13 12:04:12 -0700
commitdfc102ce3a47dfd63a98cad7930e223b2597e3ac (patch)
tree239bbe02b960eb8b2ccb8c2326cd33ce0f7b98cd
parent1f271323f8bd6b3d12fbc31fd432b4903cf633de (diff)
downloaduemacs-dfc102ce3a47dfd63a98cad7930e223b2597e3ac.tar.gz
uemacs: Add --version option.
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--main.c50
1 files changed, 27 insertions, 23 deletions
diff --git a/main.c b/main.c
index c00dc3d..873fbf8 100644
--- a/main.c
+++ b/main.c
@@ -1,14 +1,16 @@
/*
+ * main.c
+
* uEmacs/PK 4.0
*
- * based on
+ * Based on:
*
* MicroEMACS 3.9
- * written by Dave G. Conroy.
- * substatially modified by Daniel M. Lawrence
- * modified by Petri Kutvonen
- *
- * MicroEMACS 3.9 (C)opyright 1987 by Daniel M. Lawrence
+ * Written by Dave G. Conroy.
+ * Substatially modified by Daniel M. Lawrence
+ * Modified by Petri Kutvonen
+ *
+ * MicroEMACS 3.9 (c) Copyright 1987 by Daniel M. Lawrence
*
* Original statement of copying policy:
*
@@ -18,8 +20,6 @@
*
* No copyright claimed for modifications made by Petri Kutvonen.
*
- * MAIN.C
- *
* This file contains the main driving routine, and some keyboard
* processing code.
*
@@ -51,28 +51,27 @@
*
*/
-#include <stdio.h>
+#include <stdio.h>
-/* make global definitions not external */
+/* Make global definitions not external. */
#define maindef
-#include "estruct.h" /* global structures and defines */
-#include "edef.h" /* global definitions */
-#include "efunc.h" /* function declarations and name table */
-#include "ebind.h" /* default key bindings */
+#include "estruct.h" /* Global structures and defines. */
+#include "edef.h" /* Global definitions. */
+#include "efunc.h" /* Function declarations and name table. */
+#include "ebind.h" /* Default key bindings. */
-/* for MSDOS, increase the default stack space */
-
-#if MSDOS & TURBO
-#if PKCODE
+/* For MSDOS, increase the default stack space. */
+#if MSDOS & TURBO
+#if PKCODE
extern unsigned _stklen = 20000;
#else
extern unsigned _stklen = 32766;
#endif
#endif
-#if VMS
-#include <ssdef.h>
+#if VMS
+#include <ssdef.h>
#define GOOD (SS$_NORMAL)
#endif
@@ -80,7 +79,7 @@ extern unsigned _stklen = 32766;
#define GOOD 0
#endif
-#if UNIX
+#if UNIX
#include <signal.h>
static void emergencyexit(int);
#ifdef SIGWINCH
@@ -88,7 +87,7 @@ extern void sizesignal(int);
#endif
#endif
-#if CALLED
+#if CALLED
int emacs(int argc, char **argv)
#else
int main(int argc, char **argv)
@@ -130,6 +129,12 @@ int main(int argc, char **argv)
signal(SIGWINCH, sizesignal);
#endif
#endif
+ if (argc == 2) {
+ if (!strcmp(argv[1], "--version")) {
+ printf("%s version %s\n", PROGNAME, VERSION);
+ exit(EXIT_SUCCESS);
+ }
+ }
/* initialize the editor */
vtinit(); /* Display */
@@ -151,7 +156,6 @@ int main(int argc, char **argv)
/* Parse the command line */
for (carg = 1; carg < argc; ++carg) {
-
/* Process Switches */
#if PKCODE
if (argv[carg][0] == '+') {