aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Farina <tfransosi@gmail.com>2010-08-29 20:39:06 -0300
committerLinus Torvalds <torvalds@linux-foundation.org>2010-09-07 13:55:02 -0700
commit5664b10291a34c978137b70be199d3f473e0e347 (patch)
treea799fec2bd8f99638ab6d73e2dae9d0828ae2500
parent74336ca924c45d46b9fafffb9309878e368cc301 (diff)
downloaduemacs-5664b10291a34c978137b70be199d3f473e0e347.tar.gz
uemacs/version.c: Add version function to output the version string information.
Signed-off-by: Thiago Farina <tfransosi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--Makefile6
-rw-r--r--main.c2
-rw-r--r--version.c7
-rw-r--r--version.h7
4 files changed, 16 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 5d96580..e73c883 100644
--- a/Makefile
+++ b/Makefile
@@ -19,14 +19,14 @@ PROGRAM=em
SRC=ansi.c basic.c bind.c buffer.c crypt.c display.c eval.c exec.c \
file.c fileio.c ibmpc.c input.c isearch.c line.c lock.c main.c \
pklock.c posix.c random.c region.c search.c spawn.c tcap.c \
- termio.c vmsvt.c vt52.c window.c word.c names.c globals.c
+ termio.c vmsvt.c vt52.c window.c word.c names.c globals.c version.c
OBJ=ansi.o basic.o bind.o buffer.o crypt.o display.o eval.o exec.o \
file.o fileio.o ibmpc.o input.o isearch.o line.o lock.o main.o \
pklock.o posix.o random.o region.o search.o spawn.o tcap.o \
- termio.o vmsvt.o vt52.o window.o word.o names.o globals.o
+ termio.o vmsvt.o vt52.o window.o word.o names.o globals.o version.o
-HDR=ebind.h edef.h efunc.h epath.h estruct.h evar.h
+HDR=ebind.h edef.h efunc.h epath.h estruct.h evar.h util.h version.h
# DO NOT ADD OR MODIFY ANY LINES ABOVE THIS -- make source creates them
diff --git a/main.c b/main.c
index 0aa4dfc..9d286b3 100644
--- a/main.c
+++ b/main.c
@@ -143,7 +143,7 @@ int main(int argc, char **argv)
usage(EXIT_FAILURE);
}
if (strcmp(argv[1], "--version") == 0) {
- printf("%s version %s\n", PROGRAM_NAME_LONG, VERSION);
+ version();
exit(EXIT_SUCCESS);
}
}
diff --git a/version.c b/version.c
new file mode 100644
index 0000000..d974764
--- /dev/null
+++ b/version.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include "version.h"
+
+void version(void)
+{
+ printf("%s version %s\n", PROGRAM_NAME_LONG, VERSION);
+}
diff --git a/version.h b/version.h
index 5f9c6ff..1647462 100644
--- a/version.h
+++ b/version.h
@@ -4,6 +4,9 @@
#define PROGRAM_NAME "em"
#define PROGRAM_NAME_LONG "uEmacs/Pk"
-#define VERSION "4.0.15"
+#define VERSION "4.0.15"
-#endif // VERSION_H_
+/* Print the version string. */
+void version(void);
+
+#endif /* VERSION_H_ */