iPXE
Data Fields
setting_type Struct Reference

A setting type. More...

#include <settings.h>

Data Fields

const char * name
 Name.
int(* parse )(const struct setting_type *type, const char *value, void *buf, size_t len)
 Parse formatted string to setting value.
int(* format )(const struct setting_type *type, const void *raw, size_t raw_len, char *buf, size_t len)
 Format setting value as a string.
int(* denumerate )(const struct setting_type *type, unsigned long value, void *buf, size_t len)
 Convert number to setting value.
int(* numerate )(const struct setting_type *type, const void *raw, size_t raw_len, unsigned long *value)
 Convert setting value to number.

Detailed Description

A setting type.

This represents a type of setting (e.g. string, IPv4 address, etc.).

Definition at line 191 of file settings.h.


Field Documentation

const char* setting_type::name

Name.

This is the name exposed to the user (e.g. "string").

Definition at line 196 of file settings.h.

Referenced by find_setting_type(), guestinfo_fetch_type(), setting_name(), setting_type_int_index(), and setting_type_int_is_signed().

int( * setting_type::parse)(const struct setting_type *type, const char *value, void *buf, size_t len)

Parse formatted string to setting value.

Parameters:
typeSetting type
valueFormatted setting value
bufBuffer to contain raw value
lenLength of buffer
Return values:
lenLength of raw value, or negative error

Definition at line 205 of file settings.h.

Referenced by setting_parse().

int( * setting_type::format)(const struct setting_type *type, const void *raw, size_t raw_len, char *buf, size_t len)

Format setting value as a string.

Parameters:
typeSetting type
rawRaw setting value
raw_lenLength of raw setting value
bufBuffer to contain formatted value
lenLength of buffer
Return values:
lenLength of formatted value, or negative error

Definition at line 216 of file settings.h.

Referenced by setting_format().

int( * setting_type::denumerate)(const struct setting_type *type, unsigned long value, void *buf, size_t len)

Convert number to setting value.

Parameters:
typeSetting type
valueNumeric value
bufBuffer to contain raw value
lenLength of buffer
Return values:
lenLength of raw value, or negative error

Definition at line 226 of file settings.h.

Referenced by parse_int_setting(), and setting_denumerate().

int( * setting_type::numerate)(const struct setting_type *type, const void *raw, size_t raw_len, unsigned long *value)

Convert setting value to number.

Parameters:
typeSetting type
rawRaw setting value
raw_lenLength of raw setting value
valueNumeric value to fill in
Return values:
rcReturn status code

Definition at line 237 of file settings.h.

Referenced by acpi_settings_fetch(), format_int_setting(), format_uint_setting(), and setting_numerate().


The documentation for this struct was generated from the following file: