libsmbios_c library
token.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 C_TOKEN_H
20#define C_TOKEN_H
21
22// include smbios_c/compat.h first
23#include "smbios_c/compat.h"
24#include "smbios_c/types.h"
25
27
28#define TOKEN_TYPE_D4 0xD4
29#define TOKEN_TYPE_D5 0xD5
30#define TOKEN_TYPE_D6 0xD6
31#define TOKEN_TYPE_DA 0xDA
32
38
44
49
54
59
64
75
82LIBSMBIOS_C_DLL_SPEC int token_set_string(u16 id, const char *value, size_t size);
83
89
92LIBSMBIOS_C_DLL_SPEC const struct smbios_struct * token_get_smbios_struct(u16 id);
93
97
100LIBSMBIOS_C_DLL_SPEC int token_try_password(u16 id, const char *pass_ascii, const char *pass_scancode);
101
102
104
105#endif /* TOKEN_H */
#define LIBSMBIOS_C_DLL_SPEC
Definition compat.h:48
#define EXTERN_C_BEGIN
Definition compat.h:55
#define EXTERN_C_END
Definition compat.h:56
LIBSMBIOS_C_DLL_SPEC const struct smbios_struct * token_get_smbios_struct(u16 id)
Get a pointer to the smbios struct containing this token.
LIBSMBIOS_C_DLL_SPEC int token_set_string(u16 id, const char *value, size_t size)
Set a string token value.
LIBSMBIOS_C_DLL_SPEC const char * token_strerror()
Returns string describing the last error condition.
LIBSMBIOS_C_DLL_SPEC const void * token_get_ptr(u16 id)
Get a pointer to the actual token structure.
LIBSMBIOS_C_DLL_SPEC bool token_is_bool(u16 id)
Check if a token is a boolean-type token.
LIBSMBIOS_C_DLL_SPEC void token_string_free(char *)
Free allocated memory.
LIBSMBIOS_C_DLL_SPEC bool token_is_string(u16 id)
Check if a token is a string-type token.
LIBSMBIOS_C_DLL_SPEC int token_try_password(u16 id, const char *pass_ascii, const char *pass_scancode)
For tokens that are password protected, check password.
LIBSMBIOS_C_DLL_SPEC int token_is_active(u16 id)
Check if a boolean token is currently set.
LIBSMBIOS_C_DLL_SPEC int token_get_type(u16 id)
Return token type.
LIBSMBIOS_C_DLL_SPEC char * token_get_string(u16 id, size_t *len)
Get a new buffer containing the token string value.
LIBSMBIOS_C_DLL_SPEC int token_activate(u16 id)
Activate a boolean token.
unsigned short u16
Definition types.h:33