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
On 17 August 2017 at 22:38, Nico Huber nico.h@gmx.de wrote:
Yes, there should be a context.
Agreed, I was confused to not see a init/shutdown context in this day-and-age. I'm guessing most people won't be running libflashrom multithreaded (!) but it certain feels better than knowing there's allocated static data somewhere.
Richard.