mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: load and save fingerprints to XML
We always use the global fingerprint table - maybe this should just not be a parameter of the accessor functions? The syntax is very simple - the raw data is encoded as a hex string, the rest of the components are hex numbers. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
33527cb9e5
commit
2b1db9da82
4 changed files with 67 additions and 0 deletions
24
core/parse.c
24
core/parse.c
|
@ -186,6 +186,16 @@ void reset_dc_settings(struct parser_state *state)
|
|||
state->cur_settings.dc.deviceid = 0;
|
||||
}
|
||||
|
||||
void reset_fingerprint(struct parser_state *state)
|
||||
{
|
||||
free((void *)state->cur_settings.fingerprint.data);
|
||||
state->cur_settings.fingerprint.data = NULL;
|
||||
state->cur_settings.fingerprint.model = 0;
|
||||
state->cur_settings.fingerprint.serial = 0;
|
||||
state->cur_settings.fingerprint.fdeviceid = 0;
|
||||
state->cur_settings.fingerprint.fdiveid = 0;
|
||||
}
|
||||
|
||||
void settings_start(struct parser_state *state)
|
||||
{
|
||||
state->in_settings = true;
|
||||
|
@ -196,6 +206,20 @@ void settings_end(struct parser_state *state)
|
|||
state->in_settings = false;
|
||||
}
|
||||
|
||||
void fingerprint_settings_start(struct parser_state *state)
|
||||
{
|
||||
reset_fingerprint(state);
|
||||
}
|
||||
|
||||
void fingerprint_settings_end(struct parser_state *state)
|
||||
{
|
||||
create_fingerprint_node_from_hex(state->fingerprints,
|
||||
state->cur_settings.fingerprint.model,
|
||||
state->cur_settings.fingerprint.serial,
|
||||
state->cur_settings.fingerprint.data,
|
||||
state->cur_settings.fingerprint.fdeviceid,
|
||||
state->cur_settings.fingerprint.fdiveid);
|
||||
}
|
||||
void dc_settings_start(struct parser_state *state)
|
||||
{
|
||||
reset_dc_settings(state);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue