removed unused variables.
[gnutls.git] / lib / opencdk / keydb.h
blob9b19d4aed828a4f4e1c8ef5a8102af8106846d4b
1 /* keydb.h - Key database routines
2 * Copyright (C) 2002-2012 Free Software Foundation, Inc.
4 * Author: Timo Schulz
6 * This file is part of OpenCDK.
8 * The OpenCDK library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 3 of
11 * the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>
23 /* Internal key index structure. */
24 struct key_idx_s
26 off_t offset;
27 u32 keyid[2];
28 byte fpr[KEY_FPR_LEN];
30 typedef struct key_idx_s *key_idx_t;
32 /* Internal key cache to associate a key with an file offset. */
33 struct key_table_s
35 struct key_table_s *next;
36 off_t offset;
38 typedef struct key_table_s *key_table_t;
40 typedef struct cdk_keydb_search_s
42 off_t off; /* last file offset */
43 union
45 char *pattern; /* A search is performed by pattern. */
46 u32 keyid[2]; /* A search by keyid. */
47 byte fpr[KEY_FPR_LEN]; /* A search by fingerprint. */
48 } u;
49 int type;
50 struct key_table_s *cache;
51 size_t ncache;
52 unsigned int no_cache:1; /* disable the index cache. */
54 cdk_stream_t idx;
55 char *idx_name; /* name of the index file or NULL. */
57 } cdk_keydb_search_s;
59 /* Internal key database handle. */
60 struct cdk_keydb_hd_s
62 int type; /* type of the key db handle. */
63 int fp_ref; /* 1=means it is a reference and shall not be closed. */
64 cdk_stream_t fp;
65 char *name; /* name of the underlying file or NULL. */
66 unsigned int secret:1; /* contain secret keys. */
67 unsigned int isopen:1; /* the underlying stream is opened. */
69 /* structure to store some stats about the keydb. */
70 struct
72 size_t new_keys; /* amount of new keys that were imported. */
73 } stats;