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_progress_callback) (struct flashrom_flashctx *flashctx)
 

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_callback (flashrom_log_callback *log_callback)
 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)
 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_progress_callback ( struct flashrom_flashctx *const  flashctx,
flashrom_progress_callback *  progress_callback,
struct flashrom_progress progress_state 
)

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
progress_callbackPointer to the new progress callback function.
progress_statePointer to progress state to include with the progress callback.
int flashrom_shutdown ( void  )

Shut down libflashrom.

Returns
0 on success