mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
CHG: (@pwpiwi) d940ebfbad
This commit is contained in:
parent
25b173ea20
commit
02af3b9e1d
7 changed files with 47 additions and 25 deletions
|
@ -308,7 +308,7 @@ void tlvdb_add(struct tlvdb *tlvdb, struct tlvdb *other)
|
|||
tlvdb->next = other;
|
||||
}
|
||||
|
||||
void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data)
|
||||
void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data, int level)
|
||||
{
|
||||
struct tlvdb *next = NULL;
|
||||
|
||||
|
@ -317,8 +317,9 @@ void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data)
|
|||
|
||||
for (; tlvdb; tlvdb = next) {
|
||||
next = tlvdb->next;
|
||||
cb(data, &tlvdb->tag);
|
||||
tlvdb_visit(tlvdb->children, cb, data);
|
||||
bool is_leaf = (tlvdb->children == NULL);
|
||||
cb(data, &tlvdb->tag, level, is_leaf);
|
||||
tlvdb_visit(tlvdb->children, cb, data, level+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue