crypto: rename notmuch_crypto_t to _notmuch_crypto_t

The notmuch_crypto_t struct isn't used externally, and we have no
plans to explicitly export it.  Prefix its name (and associated
functions) with _ to make that intent clear.
This commit is contained in:
Daniel Kahn Gillmor 2017-10-10 01:49:02 -04:00 committed by David Bremner
parent 008a5e92eb
commit 88f2a72ef1
5 changed files with 17 additions and 17 deletions

View file

@ -22,7 +22,7 @@
#if (GMIME_MAJOR_VERSION < 3) #if (GMIME_MAJOR_VERSION < 3)
/* Create a GPG context (GMime 2.6) */ /* Create a GPG context (GMime 2.6) */
static notmuch_crypto_context_t * static notmuch_crypto_context_t *
create_gpg_context (notmuch_crypto_t *crypto) create_gpg_context (_notmuch_crypto_t *crypto)
{ {
notmuch_crypto_context_t *gpgctx; notmuch_crypto_context_t *gpgctx;
@ -45,7 +45,7 @@ create_gpg_context (notmuch_crypto_t *crypto)
/* Create a PKCS7 context (GMime 2.6) */ /* Create a PKCS7 context (GMime 2.6) */
static notmuch_crypto_context_t * static notmuch_crypto_context_t *
create_pkcs7_context (notmuch_crypto_t *crypto) create_pkcs7_context (_notmuch_crypto_t *crypto)
{ {
notmuch_crypto_context_t *pkcs7ctx; notmuch_crypto_context_t *pkcs7ctx;
@ -67,7 +67,7 @@ create_pkcs7_context (notmuch_crypto_t *crypto)
} }
static const struct { static const struct {
const char *protocol; const char *protocol;
notmuch_crypto_context_t *(*get_context) (notmuch_crypto_t *crypto); notmuch_crypto_context_t *(*get_context) (_notmuch_crypto_t *crypto);
} protocols[] = { } protocols[] = {
{ {
.protocol = "application/pgp-signature", .protocol = "application/pgp-signature",
@ -90,7 +90,7 @@ static const struct {
/* for the specified protocol return the context pointer (initializing /* for the specified protocol return the context pointer (initializing
* if needed) */ * if needed) */
notmuch_crypto_context_t * notmuch_crypto_context_t *
notmuch_crypto_get_context (notmuch_crypto_t *crypto, const char *protocol) _notmuch_crypto_get_context (_notmuch_crypto_t *crypto, const char *protocol)
{ {
notmuch_crypto_context_t *cryptoctx = NULL; notmuch_crypto_context_t *cryptoctx = NULL;
size_t i; size_t i;
@ -118,7 +118,7 @@ notmuch_crypto_get_context (notmuch_crypto_t *crypto, const char *protocol)
} }
int int
notmuch_crypto_cleanup (notmuch_crypto_t *crypto) _notmuch_crypto_cleanup (_notmuch_crypto_t *crypto)
{ {
if (crypto->gpgctx) { if (crypto->gpgctx) {
g_object_unref (crypto->gpgctx); g_object_unref (crypto->gpgctx);
@ -133,7 +133,7 @@ notmuch_crypto_cleanup (notmuch_crypto_t *crypto)
return 0; return 0;
} }
#else #else
int notmuch_crypto_cleanup (unused(notmuch_crypto_t *crypto)) int _notmuch_crypto_cleanup (unused(_notmuch_crypto_t *crypto))
{ {
return 0; return 0;
} }

View file

@ -33,7 +33,7 @@ typedef struct mime_node_context {
GMimeMessage *mime_message; GMimeMessage *mime_message;
/* Context provided by the caller. */ /* Context provided by the caller. */
notmuch_crypto_t *crypto; _notmuch_crypto_t *crypto;
} mime_node_context_t; } mime_node_context_t;
static int static int
@ -56,7 +56,7 @@ _mime_node_context_free (mime_node_context_t *res)
notmuch_status_t notmuch_status_t
mime_node_open (const void *ctx, notmuch_message_t *message, mime_node_open (const void *ctx, notmuch_message_t *message,
notmuch_crypto_t *crypto, mime_node_t **root_out) _notmuch_crypto_t *crypto, mime_node_t **root_out)
{ {
const char *filename = notmuch_message_get_filename (message); const char *filename = notmuch_message_get_filename (message);
mime_node_context_t *mctx; mime_node_context_t *mctx;
@ -265,7 +265,7 @@ _mime_node_create (mime_node_t *parent, GMimeObject *part)
|| (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->crypto->verify)) { || (GMIME_IS_MULTIPART_SIGNED (part) && node->ctx->crypto->verify)) {
GMimeContentType *content_type = g_mime_object_get_content_type (part); GMimeContentType *content_type = g_mime_object_get_content_type (part);
const char *protocol = g_mime_content_type_get_parameter (content_type, "protocol"); const char *protocol = g_mime_content_type_get_parameter (content_type, "protocol");
cryptoctx = notmuch_crypto_get_context (node->ctx->crypto, protocol); cryptoctx = _notmuch_crypto_get_context (node->ctx->crypto, protocol);
if (!cryptoctx) if (!cryptoctx)
return NULL; return NULL;
} }

View file

@ -72,7 +72,7 @@ typedef struct notmuch_show_format {
const struct notmuch_show_params *params); const struct notmuch_show_params *params);
} notmuch_show_format_t; } notmuch_show_format_t;
typedef struct notmuch_crypto { typedef struct _notmuch_crypto {
bool verify; bool verify;
bool decrypt; bool decrypt;
#if (GMIME_MAJOR_VERSION < 3) #if (GMIME_MAJOR_VERSION < 3)
@ -80,14 +80,14 @@ typedef struct notmuch_crypto {
notmuch_crypto_context_t* pkcs7ctx; notmuch_crypto_context_t* pkcs7ctx;
const char *gpgpath; const char *gpgpath;
#endif #endif
} notmuch_crypto_t; } _notmuch_crypto_t;
typedef struct notmuch_show_params { typedef struct notmuch_show_params {
bool entire_thread; bool entire_thread;
bool omit_excluded; bool omit_excluded;
bool output_body; bool output_body;
int part; int part;
notmuch_crypto_t crypto; _notmuch_crypto_t crypto;
bool include_html; bool include_html;
GMimeStream *out_stream; GMimeStream *out_stream;
} notmuch_show_params_t; } notmuch_show_params_t;
@ -183,11 +183,11 @@ notmuch_exit_if_unsupported_format (void);
#if (GMIME_MAJOR_VERSION <3) #if (GMIME_MAJOR_VERSION <3)
notmuch_crypto_context_t * notmuch_crypto_context_t *
notmuch_crypto_get_context (notmuch_crypto_t *crypto, const char *protocol); _notmuch_crypto_get_context (_notmuch_crypto_t *crypto, const char *protocol);
#endif #endif
int int
notmuch_crypto_cleanup (notmuch_crypto_t *crypto); _notmuch_crypto_cleanup (_notmuch_crypto_t *crypto);
int int
notmuch_count_command (notmuch_config_t *config, int argc, char *argv[]); notmuch_count_command (notmuch_config_t *config, int argc, char *argv[]);
@ -449,7 +449,7 @@ struct mime_node {
*/ */
notmuch_status_t notmuch_status_t
mime_node_open (const void *ctx, notmuch_message_t *message, mime_node_open (const void *ctx, notmuch_message_t *message,
notmuch_crypto_t *crypto, mime_node_t **node_out); _notmuch_crypto_t *crypto, mime_node_t **node_out);
/* Return a new MIME node for the requested child part of parent. /* Return a new MIME node for the requested child part of parent.
* parent will be used as the talloc context for the returned child * parent will be used as the talloc context for the returned child

View file

@ -759,7 +759,7 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[])
if (do_reply (config, query, &params, format, reply_all) != 0) if (do_reply (config, query, &params, format, reply_all) != 0)
return EXIT_FAILURE; return EXIT_FAILURE;
notmuch_crypto_cleanup (&params.crypto); _notmuch_crypto_cleanup (&params.crypto);
notmuch_query_destroy (query); notmuch_query_destroy (query);
notmuch_database_destroy (notmuch); notmuch_database_destroy (notmuch);

View file

@ -1234,7 +1234,7 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[])
g_mime_stream_flush (params.out_stream); g_mime_stream_flush (params.out_stream);
g_object_unref (params.out_stream); g_object_unref (params.out_stream);
notmuch_crypto_cleanup (&params.crypto); _notmuch_crypto_cleanup (&params.crypto);
notmuch_query_destroy (query); notmuch_query_destroy (query);
notmuch_database_destroy (notmuch); notmuch_database_destroy (notmuch);