From a8d850d06efc8d70a19f55ec93fe83df51e99077 Mon Sep 17 00:00:00 2001
From: Gerlof Langeveld <gerlof.langeveld@atoptool.nl>
Date: Sat, 25 Mar 2017 13:06:05 +0100
Subject: [PATCH] Preparation for github

---
 Makefile  |  2 +-
 version.c | 29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 version.c

diff --git a/Makefile b/Makefile
index 24cb089..a6583f8 100644
--- a/Makefile
+++ b/Makefile
@@ -176,6 +176,6 @@ showgeneric.o:	atop.h	photoproc.h photosyst.h  showgeneric.h showlinux.h
 showlinux.o:	atop.h	photoproc.h photosyst.h  showgeneric.h showlinux.h
 showsys.o:	atop.h  photoproc.h photosyst.h  showgeneric.h 
 showprocs.o:	atop.h	photoproc.h photosyst.h  showgeneric.h showlinux.h
-version.o:	version.h
+version.o:	version.c version.h
 
 atopacctd.o:	atop.h  photoproc.h acctproc.h   version.h     atopacctd.h
diff --git a/version.c b/version.c
new file mode 100644
index 0000000..eea7113
--- /dev/null
+++ b/version.c
@@ -0,0 +1,29 @@
+/* No manual changes in this file */
+#include <stdio.h>
+#include <string.h>
+#include "version.h"
+
+static char atopversion[] = ATOPVERS;
+static char atopdate[]    = ATOPDATE;
+
+char *
+getstrvers(void)
+{
+	static char vers[256];
+
+	snprintf(vers, sizeof vers,
+		"Version: %s - %s     <gerlof.langeveld@atoptool.nl>",
+		atopversion, atopdate);
+
+	return vers;
+}
+
+unsigned short
+getnumvers(void)
+{
+	int	vers1, vers2;
+
+	sscanf(atopversion, "%u.%u", &vers1, &vers2);
+
+	return (unsigned short) ((vers1 << 8) + vers2);
+}
