Imported Upstream version 2.7.1
This commit is contained in:
parent
a1fa151fc7
commit
0121794af9
451 changed files with 41339 additions and 10887 deletions
|
|
@ -19,6 +19,22 @@
|
|||
#ifndef SCAN_DEVICE
|
||||
#define SCAN_DEVICE
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Device type string getter
|
||||
*
|
||||
* \param type Device type
|
||||
*
|
||||
* \return Type string
|
||||
*/
|
||||
#define nutscan_device_type_string(type) \
|
||||
(assert(0 < (type) && (type) < TYPE_END), nutscan_device_type_strings[type - 1])
|
||||
|
||||
typedef enum nutscan_device_type {
|
||||
TYPE_NONE=0,
|
||||
TYPE_USB,
|
||||
|
|
@ -27,9 +43,13 @@ typedef enum nutscan_device_type {
|
|||
TYPE_NUT,
|
||||
TYPE_IPMI,
|
||||
TYPE_AVAHI,
|
||||
TYPE_EATON_SERIAL,
|
||||
TYPE_END
|
||||
} nutscan_device_type_t;
|
||||
|
||||
/** Device type -> string mapping */
|
||||
extern const char * nutscan_device_type_strings[TYPE_END - 1];
|
||||
|
||||
typedef struct nutscan_options {
|
||||
char * option;
|
||||
char * value;
|
||||
|
|
@ -40,7 +60,7 @@ typedef struct nutscan_device {
|
|||
nutscan_device_type_t type;
|
||||
char * driver;
|
||||
char * port;
|
||||
nutscan_options_t opt;
|
||||
nutscan_options_t * opt;
|
||||
struct nutscan_device * prev;
|
||||
struct nutscan_device * next;
|
||||
} nutscan_device_t;
|
||||
|
|
@ -49,4 +69,20 @@ nutscan_device_t * nutscan_new_device();
|
|||
void nutscan_free_device(nutscan_device_t * device);
|
||||
void nutscan_add_option_to_device(nutscan_device_t * device,char * option, char * value);
|
||||
nutscan_device_t * nutscan_add_device_to_device(nutscan_device_t * first, nutscan_device_t * second);
|
||||
|
||||
/**
|
||||
* \brief Rewind device list
|
||||
*
|
||||
* \param device Device list item
|
||||
*
|
||||
* \return Device list head
|
||||
*/
|
||||
nutscan_device_t * nutscan_rewind_device(nutscan_device_t * device);
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
}
|
||||
/* *INDENT-ON* */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue