File: version.c

package info (click to toggle)
atop 2.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,692 kB
  • sloc: ansic: 20,731; python: 253; sh: 220; makefile: 170
file content (30 lines) | stat: -rw-r--r-- 531 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
/* No manual changes in this file */
#include <stdio.h>
#include <string.h>
#include "version.h"
#include "versdate.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);
}