mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Rename struct pubkey to pukey_s and add pubkey_t.
* g10/keydb.h (struct pubkey): Rename to pubkey_s. (pubkey_t): New. Change all struct pubkey_s to use this type. * g10/getkey.c (get_pubkeys): Rename arg keys to r_keys. -- It is common in GnuPG to use a suffix of _s for struct names. There is no technical need for this (actually this pattern comes from pre ANSI C compilers which had no separate namespaces) but it avoid surprises when reading the code. Adding the pubkey_t type is mainly to improve font locking by using the common suffix _t for a typedefed type. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
363ed2e892
commit
a9cbdcfd9c
2 changed files with 17 additions and 16 deletions
22
g10/getkey.c
22
g10/getkey.c
|
@ -367,7 +367,7 @@ getkey_disable_caches ()
|
|||
|
||||
|
||||
void
|
||||
pubkey_free (struct pubkey *key)
|
||||
pubkey_free (pubkey_t key)
|
||||
{
|
||||
if (key)
|
||||
{
|
||||
|
@ -378,11 +378,11 @@ pubkey_free (struct pubkey *key)
|
|||
}
|
||||
|
||||
void
|
||||
pubkeys_free (struct pubkey *keys)
|
||||
pubkeys_free (pubkey_t keys)
|
||||
{
|
||||
while (keys)
|
||||
{
|
||||
struct pubkey *next = keys->next;
|
||||
pubkey_t next = keys->next;
|
||||
pubkey_free (keys);
|
||||
keys = next;
|
||||
}
|
||||
|
@ -420,7 +420,7 @@ gpg_error_t
|
|||
get_pubkeys (ctrl_t ctrl,
|
||||
char *search_terms, int use, int include_unusable, char *source,
|
||||
int warn_possibly_ambiguous,
|
||||
struct pubkey **keys)
|
||||
pubkey_t *r_keys)
|
||||
{
|
||||
/* We show a warning when a key appears multiple times in the DB.
|
||||
This can happen for two reasons:
|
||||
|
@ -442,8 +442,8 @@ get_pubkeys (ctrl_t ctrl,
|
|||
KEYDB_SEARCH_DESC desc;
|
||||
|
||||
GETKEY_CTX ctx;
|
||||
struct pubkey *results = NULL;
|
||||
struct pubkey *r;
|
||||
pubkey_t results = NULL;
|
||||
pubkey_t r;
|
||||
|
||||
int count;
|
||||
|
||||
|
@ -456,7 +456,7 @@ get_pubkeys (ctrl_t ctrl,
|
|||
__func__, source ? source : "user input", search_terms);
|
||||
}
|
||||
|
||||
if (*keys)
|
||||
if (*r_keys)
|
||||
log_bug ("%s: KEYS should be NULL!\n", __func__);
|
||||
|
||||
switch (use)
|
||||
|
@ -571,9 +571,9 @@ get_pubkeys (ctrl_t ctrl,
|
|||
count = 0;
|
||||
for (r = results; r; r = r->next)
|
||||
{
|
||||
struct pubkey **prevp;
|
||||
struct pubkey *next;
|
||||
struct pubkey *r2;
|
||||
pubkey_t *prevp;
|
||||
pubkey_t next;
|
||||
pubkey_t r2;
|
||||
int dups = 0;
|
||||
|
||||
prevp = &r->next;
|
||||
|
@ -639,7 +639,7 @@ get_pubkeys (ctrl_t ctrl,
|
|||
}
|
||||
}
|
||||
else
|
||||
*keys = results;
|
||||
*r_keys = results;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue