[flashrom] Contexts in the libflashrom interface (was: Using libflashrom from fwupd)
Nico Huber
nico.h at gmx.de
Thu Aug 17 23:38:43 CEST 2017
Yet another thread (YAT?).
>
> flashrom_set_progress_callbacks(flashrom_progress_cb *cb_progress,
> flashrom_progress_event_cb *cb_event, void *user_data); < We might need
> to add a flashrom context here? No idea how the current staging
> implementation works but eventually we want to fix the hidden internal
> state...
Yes, there should be a context. I've already started to add an imaginary
flashrom_programmer context but forgot the even lower functions like
flashrom_init(), flashrom_set_log_callback()...
So add a third one? `struct flashrom_context`? It wouldn't matter how
we handle them internally, e.g. they could all point to the same object
or even be NULL pointers for the start. Just having one for the global
stuff like logging, one for the programmer and one for the chip seems
reasonable and should give us all the flexibility we need for the future.
Nico
More information about the flashrom
mailing list