[go: up one dir, main page]

File: version.c

package info (click to toggle)
atop 1.26-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 980 kB
  • ctags: 1,536
  • sloc: ansic: 12,191; sh: 216; makefile: 65
file content (34 lines) | stat: -rw-r--r-- 748 bytes parent folder | download
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
/* No manual changes in this file */
#include <stdio.h>
#include <string.h>

static const char rcsid[] = "$Id: version.c,v 1.26 2010/11/17 13:42:37 root Exp root $";

static char atoprevision[] = "$Revision: 1.26 $";
static char atopdate[]     = "$Date: 2010/11/17 13:42:37 $";

char *
getstrvers(void)
{
	static char vers[256];

	atoprevision[sizeof atoprevision - 3] = '\0';
	atopdate    [sizeof atopdate     - 3] = '\0';

	snprintf(vers, sizeof vers,
		"Version:%s -%s     < gerlof.langeveld@atoptool.nl >",
			strchr(atoprevision, ' '),
			strchr(atopdate    , ' '));

	return vers;
}

unsigned short
getnumvers(void)
{
	int	vers1, vers2;

	sscanf(atoprevision, "%*s %u.%u", &vers1, &vers2);

	return (unsigned short) ((vers1 << 8) + vers2);
}