File: linuxinfo.h

package info (click to toggle)
linuxinfo 1.1.8-21
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 348 kB
  • ctags: 49
  • sloc: sh: 1,729; ansic: 564; makefile: 80
file content (96 lines) | stat: -rw-r--r-- 1,905 bytes parent folder | download | duplicates (5)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
	linuxinfo.h

	Header file for linuxinfo

	Copyright (C) 1998-2000
	All Rights Reserved.

	Alex Buell <alex.buell@munted.org.uk>

        Version Author  Date            Comments
        ----------------------------------------------------------------------
        1.0.1   AIB     199803??        Initial development
	1.0.2	AIB	1998????	Modification for compatibility with 
					both libc5 & glibc2 libraries
	1.0.4	AIB	1998????	Removed the glibc ifdefs.
	1.0.5	AIB	1998????	Added a new field to hw_stat struct.
	1.0.8	AIB	1999????	Ported to ARM architecture.
	1.1.3	AIB	1999????	mc68000 define replaced with __mc68000__
	1.1.4	AIB	20000405	Moved strstr() to linuxinfo_common.h

*/

#ifndef _LINUXINFO_H_
#define _LINUXINFO_H_

#if !defined(linux)
#define system_unknown
#endif

#if defined(__i386__)
#define system_intel
#endif

#if defined(m68000)
#define system_m68k
#endif 

#if defined(__alpha__)
#define system_alpha
#endif

#if defined(__sparc__)
#define system_sparc
#endif

#if defined(__PPC__)
#define system_ppc
#endif

#if defined(__arm__)
#define system_arm
#endif

#if (SIZEOF_LONG > 4)
#define LONGLONG long int
#define LONGSPEC "%ld"
#else
#define LONGLONG long long int
#define LONGSPEC "%lld"
#endif

struct os_stat 
{
	char os_hostname[BUFSIZ];
	char os_name[BUFSIZ];
	char os_version[BUFSIZ];
	char os_revision[BUFSIZ];
}; 

struct hw_stat 
{
	char hw_cpuinfo[BUFSIZ];
	char hw_bogomips[BUFSIZ];
	char hw_memory[BUFSIZ];
	char hw_megahertz[BUFSIZ];
	int hw_processors;
};

struct lib_stat 
{
	char lib_version[BUFSIZ];
};

void GetOperatingSystemInfo(struct os_stat *os);
void GetHardwareInfo(int fd, struct hw_stat *hw);
void GetSystemLibcInfo(struct lib_stat *lib);

int read_line(int fd, char *buffer, size_t length);
int splitstring(char *first_string, char *second_string); 

LONGLONG getphysicalmemory(void);

#define CPUINFO_FILE	"/proc/cpuinfo"

#endif /* _LINUXINFO_H_ */