00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef C_SMBIOS_H
00020 #define C_SMBIOS_H
00021
00022
00023 #include "smbios_c/compat.h"
00024 #include "smbios_c/types.h"
00025
00026 EXTERN_C_BEGIN;
00027
00028 struct smbios_struct;
00029
00037 struct smbios_struct * DLL_SPEC smbios_get_next_struct(const struct smbios_struct *cur);
00038
00039
00049 struct smbios_struct * DLL_SPEC smbios_get_next_struct_by_type(const struct smbios_struct *cur, u8 type);
00050
00060 struct smbios_struct * DLL_SPEC smbios_get_next_struct_by_handle(const struct smbios_struct *cur, u16 handle);
00061
00068 void DLL_SPEC smbios_walk(void (*fn)(const struct smbios_struct *, void *userdata), void *userdata);
00069
00073 #define smbios_for_each_struct(struct_name) \
00074 for( \
00075 const struct smbios_struct *struct_name = smbios_get_next_struct(0);\
00076 struct_name;\
00077 struct_name = smbios_get_next_struct(struct_name)\
00078 )
00079
00084 #define smbios_for_each_struct_type(struct_name, struct_type) \
00085 for( \
00086 const struct smbios_struct *struct_name = smbios_get_next_struct_by_type(0, struct_type);\
00087 struct_name;\
00088 struct_name = smbios_get_next_struct_by_type(struct_name, struct_type)\
00089 )
00090
00092 u8 DLL_SPEC smbios_struct_get_type(const struct smbios_struct *);
00093
00095 u8 DLL_SPEC smbios_struct_get_length(const struct smbios_struct *);
00096
00098 u16 DLL_SPEC smbios_struct_get_handle(const struct smbios_struct *);
00099
00108 int DLL_SPEC smbios_struct_get_data(const struct smbios_struct *s, void *dest, u8 offset, size_t len);
00109
00117 const char * DLL_SPEC smbios_struct_get_string_from_offset(const struct smbios_struct *s, u8 offset);
00118
00124 const char * DLL_SPEC smbios_struct_get_string_number(const struct smbios_struct *s, u8 which);
00125
00130 const char * DLL_SPEC smbios_strerror();
00131
00132 EXTERN_C_END;
00133
00134 #endif