version.h 312 Bytes
Newer Older
Alastair McKinstry's avatar
Alastair McKinstry committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include <string.h>
#include <stdlib.h>

#define VERSION "1.08"

char *progname;

static inline void
set_progname(char *name) {
	char *p;

	p = rindex(name, '/');
	progname = (p ? p+1 : name);
}

static inline void
print_version_and_exit(void) {
	printf(_("%s from %s\n"), progname, "kbd-" VERSION);
	exit(0);
}