SMBIOS Library
SystemInfo.h
Go to the documentation of this file.
1 // vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=c:
2 /*
3  * Copyright (C) 2005 Dell Inc.
4  * by Michael Brown <Michael_E_Brown@dell.com>
5  * Licensed under the Open Software License version 2.1
6  *
7  * Alternatively, you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published
9  * by the Free Software Foundation; either version 2 of the License,
10  * or (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  * See the GNU General Public License for more details.
16  */
17 
18 
19 #ifndef SYSTEMINFO_H
20 #define SYSTEMINFO_H
21 
22 // C-header files do not include compat.h
23 // Instead, they should include auto_link.hpp, which sets up automatic
24 // library selection on MSVC
26 
27 #include <stdio.h> // for size_t
28 
29 #define SMBIOSEXCEPTION 0x01
30 #define SMBIOSPARSEEXCEPTION 0x02
31 #define SMBIOSITEMDATAOUTOFBOUNDS 0x03
32 #define SMBIOSITEMSTRINGUNAVAILABLE 0x04
33 #define SMBIOSPERMISSIONEXCEPTION 0x05
34 #define SMBIOSPARAMETEREXCEPTION 0x06
35 #define INTERNALERROR 0x07
36 #define NOTIMPLEMENTED 0x08
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
44  //
45  // Stable API section.
46  //
47  // All of the functions in this section have a strong guarantee that we
48  // will not break API compatibility.
49  //
51 
53 
55  const char *SMBIOSGetLibraryVersionString();
56 
57 
59 
63  int SMBIOSGetDellSystemId();
64 
66 
69  const char *SMBIOSGetSystemName();
70 
72 
75  const char *SMBIOSGetBiosVersion();
76 
78 
81  const char *SMBIOSGetAssetTag();
82 
84 
87  const char *SMBIOSGetServiceTag();
88 
90 
93  void SMBIOSFreeMemory( const char * );
94 
99  const char *SMBIOSGetSysInfoErrorString();
100 
102  //
103  // UNStable API section.
104  //
105  // API for the following functions has not been frozen yet and is
106  // subject to change.
107  //
109 
110  // Almost stable
111  int SMBIOSHasBootToUp();
112  int SMBIOSGetBootToUp(); // -- gets BIOS boot-to-UP flag
113  void SMBIOSSetBootToUp(int state); //
114 
115  // Almost stable
117  int SMBIOSGetNvramStateBytes(int user);
118  void SMBIOSSetNvramStateBytes(int value, int user);
119 
120  // Almost stable
123  void SMBIOSMapAsciiTo_en_US_ScanCode(char *outputScanCodeBuf, const char *inputAsciiBuf, size_t outputBufSize);
124 
125  // Almost stable
132 
133  // Almost stable
135  int SMBIOSIsDellSystem();
136 
140  const char *SMBIOSGetVendorName(); // -- Dell or OEM vendor
141 
142  // almost stable, CMOS-only implemented at this time
144 
153  int SMBIOSSetServiceTag(const char *password, const char *newTag, size_t len);
154 
155  // almost stable, CMOS-only implemented at this time
157 
165  int SMBIOSSetAssetTag(const char *password, const char *newTag, size_t len);
166 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif /* SYSTEMINFO_H */