libflashrom
Data Structures | Typedefs | Enumerations | Functions
General

Data Structures

struct  flashrom_progress
 

Typedefs

typedef int( flashrom_log_callback) (enum flashrom_log_level, const char *format, va_list)
 
typedef void( flashrom_log_callback_v2) (enum flashrom_log_level, const char *message, void *user_data)
 
typedef void( flashrom_progress_callback) (struct flashrom_flashctx *flashctx)
 
typedef void( flashrom_progress_callback_v2) (enum flashrom_progress_stage stage, size_t current, size_t total, void *user_data)
 

Enumerations

enum  flashrom_log_level {
  FLASHROM_MSG_ERROR = 0, FLASHROM_MSG_WARN = 1, FLASHROM_MSG_INFO = 2, FLASHROM_MSG_DEBUG = 3,
  FLASHROM_MSG_DEBUG2 = 4, FLASHROM_MSG_SPEW = 5
}
 
enum  flashrom_progress_stage { FLASHROM_PROGRESS_READ, FLASHROM_PROGRESS_WRITE, FLASHROM_PROGRESS_ERASE, FLASHROM_PROGRESS_NR }
 

Functions

int flashrom_init (int perform_selfcheck)
 Initialize libflashrom. More...
 
int flashrom_shutdown (void)
 Shut down libflashrom. More...
 
void flashrom_set_log_level (enum flashrom_log_level level)
 Set the log level. More...
 
void flashrom_set_log_callback (flashrom_log_callback *log_callback)
 Set the log callback function. More...
 
void flashrom_set_log_callback_v2 (flashrom_log_callback_v2 *log_callback, void *user_data)
 Set the log callback function. More...
 
void flashrom_set_progress_callback (struct flashrom_flashctx *const flashctx, flashrom_progress_callback *progress_callback, struct flashrom_progress *progress_state) __attribute__((deprecated("Use flashrom_set_progress_callback_v2 instead")))
 
void flashrom_set_progress_callback_v2 (struct flashrom_flashctx *const flashctx, flashrom_progress_callback_v2 *progress_callback, void *user_data)
 Set the progress callback function. More...
 

Detailed Description

Function Documentation

int flashrom_init ( int  perform_selfcheck)

Initialize libflashrom.

Parameters
perform_selfcheckIf not zero, perform a self check.
Returns
0 on success
void flashrom_set_log_callback ( flashrom_log_callback *  log_callback)

Set the log callback function.

Set a callback function which will be invoked whenever libflashrom wants to output messages. This allows frontends to do whatever they see fit with such messages, e.g. write them to syslog, or to a file, or print them in a GUI window, etc.

Parameters
log_callbackPointer to the new log callback function.
void flashrom_set_log_callback_v2 ( flashrom_log_callback_v2 *  log_callback,
void *  user_data 
)

Set the log callback function.

Set a callback function which will be invoked whenever libflashrom wants to output messages. This allows frontends to do whatever they see fit with such messages, e.g. write them to syslog, or to a file, or print them in a GUI window, etc. The message is formatted using vsnprintf

Parameters
log_callbackPointer to the new log callback function.
user_dataA pointer to data managed by the caller.
void flashrom_set_log_level ( enum flashrom_log_level  level)

Set the log level.

Set a log level for messages from libflashrom. The print callback will be invoked only for messages with a log level less than or equal to the configured value. The default log level is FLASHROM_MSG_INFO.

Parameters
levelThe log level to be set.
void flashrom_set_progress_callback ( struct flashrom_flashctx *const  flashctx,
flashrom_progress_callback *  progress_callback,
struct flashrom_progress progress_state 
)
Deprecated:
Use flashrom_set_progress_callback_v2 instead
void flashrom_set_progress_callback_v2 ( struct flashrom_flashctx *const  flashctx,
flashrom_progress_callback_v2 *  progress_callback,
void *  user_data 
)

Set the progress callback function.

Set a callback function which will be invoked whenever libflashrom wants to indicate the progress has changed. This allows frontends to do whatever they see fit with such values, e.g. update a progress bar in a GUI tool.

Parameters
flashrom_progress_callback_v2Pointer to the new progress callback function.
user_dataA pointer to a piece of data which is managed by progress caller
int flashrom_shutdown ( void  )

Shut down libflashrom.

Returns
0 on success