aboutsummaryrefslogtreecommitdiffstats
path: root/g10/kdb.h
blob: 55e6962e0e732e83fbdd954d42d47d7eb15dbb2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef GNUPG_KDB_H
#define GNUPG_KDB_H

#include "keydb.h"

typedef struct keydb_handle *KDB_HANDLE;

gpg_error_t kdb_register_file (const char *fname, int read_only, void **ptr);
int kdb_is_writable (void *token);

KDB_HANDLE kdb_new (void *token);
void kdb_release (KDB_HANDLE hd);
void kdb_push_found_state (KDB_HANDLE hd);
void kdb_pop_found_state (KDB_HANDLE hd);
const char *kdb_get_resource_name (KDB_HANDLE hd);
int kdb_lock (KDB_HANDLE hd, int yes);
int kdb_get_keyblock (KDB_HANDLE hd, iobuf_t *iobuf,
                      int *pk_no, int *uid_no, u32 **sigstatus);
int kdb_update_keyblock (KDB_HANDLE hd, kbnode_t kb,
                         const void *image, size_t imagelen);
gpg_error_t kdb_insert_keyblock (KDB_HANDLE hd, kbnode_t kb,
                                 const void *image, size_t imagelen,
                                 u32 *sigstatus);
int kdb_delete (KDB_HANDLE hd);
int kdb_search_reset (KDB_HANDLE hd);
int kdb_search (KDB_HANDLE hd, KEYDB_SEARCH_DESC *desc,
                size_t ndesc, size_t *descindex);

#endif