mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
fpi-ssm: Support named SSMs and use a fallback macro
Add fpi_ssm_new_full() that allows to pass a name to the state-machine constructor, not to change all the drivers, provide a fpi_ssm_new() macro that stringifies the nr_parameters value (usually an enum value) as the name so that we can use it for better debugging.
This commit is contained in:
@@ -60,9 +60,12 @@ typedef void (*FpiSsmHandlerCallback)(FpiSsm *ssm,
|
||||
FpDevice *dev);
|
||||
|
||||
/* for library and drivers */
|
||||
FpiSsm *fpi_ssm_new (FpDevice *dev,
|
||||
FpiSsmHandlerCallback handler,
|
||||
int nr_states);
|
||||
#define fpi_ssm_new(dev, handler, nr_states) \
|
||||
fpi_ssm_new_full (dev, handler, nr_states, #nr_states)
|
||||
FpiSsm *fpi_ssm_new_full (FpDevice *dev,
|
||||
FpiSsmHandlerCallback handler,
|
||||
int nr_states,
|
||||
const char *machine_name);
|
||||
void fpi_ssm_free (FpiSsm *machine);
|
||||
void fpi_ssm_start (FpiSsm *ssm,
|
||||
FpiSsmCompletedCallback callback);
|
||||
|
||||
Reference in New Issue
Block a user