hdb: decorate HDB_entry with context member

Decorate HDB_entry with context and move free_entry callback into HDB structure
itself. Requires updating hdb_free_entry() signature to include HDB parameter.
A follow-up commit will consolidate hdb_entry_ex (which has a single hdb_entry
member) into hdb_entry.
This commit is contained in:
Luke Howard
2022-01-07 12:15:55 +11:00
parent 923067e099
commit c5551775e2
40 changed files with 150 additions and 137 deletions

View File

@@ -110,9 +110,7 @@ typedef struct hdb_master_key_data *hdb_master_key;
*/
typedef struct hdb_entry_ex {
void *ctx;
hdb_entry entry;
void (*free_entry)(krb5_context, struct hdb_entry_ex *);
} hdb_entry_ex;
@@ -165,9 +163,9 @@ typedef struct HDB {
*/
krb5_error_code (*hdb_close)(krb5_context, struct HDB*);
/**
* Free an entry after use.
* Free backend-specific entry context.
*/
void (*hdb_free)(krb5_context, struct HDB*, hdb_entry_ex*);
void (*hdb_free_entry_context)(krb5_context, struct HDB*, hdb_entry_ex*);
/**
* Fetch an entry from the backend
*