Skip to content

Commit

Permalink
replace 'STATE' with 'struct State'
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed May 15, 2017
1 parent d233b98 commit f3470cc
Show file tree
Hide file tree
Showing 29 changed files with 139 additions and 139 deletions.
10 changes: 5 additions & 5 deletions attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ int mutt_view_attachment(FILE *fp, struct Body *a, int flag, struct Header *hdr,
* Don't use mutt_save_attachment() because we want to perform charset
* conversion since this will be displayed by the internal pager.
*/
STATE decode_state;
struct State decode_state;

memset(&decode_state, 0, sizeof(decode_state));
decode_state.fpout = safe_fopen(pagerfile, "w");
Expand Down Expand Up @@ -608,9 +608,9 @@ int mutt_pipe_attachment(FILE *fp, struct Body *b, const char *path, char *outfi
{
/* recv case */

STATE s;
struct State s;

memset(&s, 0, sizeof(STATE));
memset(&s, 0, sizeof(struct State));
/* perform charset conversion on text attachments when piping */
s.flags = MUTT_CHARCONV;

Expand Down Expand Up @@ -745,7 +745,7 @@ int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct
{
/* In recv mode, extract from folder and decode */

STATE s;
struct State s;

memset(&s, 0, sizeof(s));
if ((s.fpout = save_attachment_open(path, flags)) == NULL)
Expand Down Expand Up @@ -808,7 +808,7 @@ int mutt_save_attachment(FILE *fp, struct Body *m, char *path, int flags, struct
/* returns 0 on success, -1 on error */
int mutt_decode_save_attachment(FILE *fp, struct Body *m, char *path, int displaying, int flags)
{
STATE s;
struct State s;
unsigned int saved_encoding = 0;
struct Body *saved_parts = NULL;
struct Header *saved_hdr = NULL;
Expand Down
4 changes: 2 additions & 2 deletions copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ static int count_delete_lines(FILE *fp, struct Body *b, LOFF_T *length, size_t d
int _mutt_copy_message(FILE *fpout, FILE *fpin, struct Header *hdr, struct Body *body, int flags, int chflags)
{
char prefix[SHORT_STRING];
STATE s;
struct State s;
LOFF_T new_offset = -1;
int rc = 0;

Expand Down Expand Up @@ -617,7 +617,7 @@ int _mutt_copy_message(FILE *fpout, FILE *fpin, struct Header *hdr, struct Body
if (flags & MUTT_CM_DECODE)
{
/* now make a text/plain version of the message */
memset(&s, 0, sizeof(STATE));
memset(&s, 0, sizeof(struct State));
s.fpin = fpin;
s.fpout = fpout;
if (flags & MUTT_CM_PREFIX)
Expand Down
6 changes: 3 additions & 3 deletions crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


/* print the current time to avoid spoofing of the signature output */
void crypt_current_time(STATE *s, char *app_name)
void crypt_current_time(struct State *s, char *app_name)
{
time_t t;
char p[STRING], tmp[STRING];
Expand Down Expand Up @@ -581,7 +581,7 @@ int crypt_query(struct Body *m)
}


int crypt_write_signed(struct Body *a, STATE *s, const char *tempfile)
int crypt_write_signed(struct Body *a, struct State *s, const char *tempfile)
{
FILE *fp = NULL;
int c;
Expand Down Expand Up @@ -883,7 +883,7 @@ static void crypt_fetch_signatures(struct Body ***signatures, struct Body *a, in
/*
* This routine verifies a "multipart/signed" body.
*/
int mutt_signed_handler(struct Body *a, STATE *s)
int mutt_signed_handler(struct Body *a, struct State *s)
{
char tempfile[_POSIX_PATH_MAX];
int signed_type;
Expand Down
32 changes: 16 additions & 16 deletions crypt_gpgme.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ static int get_micalg(gpgme_ctx_t ctx, int use_smime, char *buf, size_t buflen)
return *buf ? 0 : -1;
}

static void print_time(time_t t, STATE *s)
static void print_time(time_t t, struct State *s)
{
char p[STRING];

Expand Down Expand Up @@ -1102,7 +1102,7 @@ struct Body *smime_gpgme_build_smime_entity(struct Body *a, char *keylist)
Return 1 if there is is a severe warning.
*/
static int show_sig_summary(unsigned long sum, gpgme_ctx_t ctx, gpgme_key_t key,
int idx, STATE *s, gpgme_signature_t sig)
int idx, struct State *s, gpgme_signature_t sig)
{
if (!key)
return 1;
Expand Down Expand Up @@ -1224,7 +1224,7 @@ static int show_sig_summary(unsigned long sum, gpgme_ctx_t ctx, gpgme_key_t key,
}


static void show_fingerprint(gpgme_key_t key, STATE *state)
static void show_fingerprint(gpgme_key_t key, struct State *state)
{
const char *s = NULL;
int i, is_pgp;
Expand Down Expand Up @@ -1276,7 +1276,7 @@ static void show_fingerprint(gpgme_key_t key, STATE *state)
}

/* Show the validity of a key used for one signature. */
static void show_one_sig_validity(gpgme_ctx_t ctx, int idx, STATE *s)
static void show_one_sig_validity(gpgme_ctx_t ctx, int idx, struct State *s)
{
gpgme_verify_result_t result = NULL;
gpgme_signature_t sig = NULL;
Expand Down Expand Up @@ -1314,7 +1314,7 @@ static void show_one_sig_validity(gpgme_ctx_t ctx, int idx, STATE *s)
}

static void print_smime_keyinfo(const char *msg, gpgme_signature_t sig,
gpgme_key_t key, STATE *s)
gpgme_key_t key, struct State *s)
{
int msgwid;
gpgme_user_id_t uids = NULL;
Expand Down Expand Up @@ -1373,7 +1373,7 @@ static void print_smime_keyinfo(const char *msg, gpgme_signature_t sig,
Return values are: 0 for normal procession, 1 for a bad signature,
2 for a signature with a warning or -1 for no more signature. */
static int show_one_sig_status(gpgme_ctx_t ctx, int idx, STATE *s)
static int show_one_sig_status(gpgme_ctx_t ctx, int idx, struct State *s)
{
const char *fpr = NULL;
gpgme_key_t key = NULL;
Expand Down Expand Up @@ -1486,7 +1486,7 @@ static int show_one_sig_status(gpgme_ctx_t ctx, int idx, STATE *s)

/* Do the actual verification step. With IS_SMIME set to true we
assume S/MIME (surprise!) */
static int verify_one(struct Body *sigbdy, STATE *s, const char *tempfile, int is_smime)
static int verify_one(struct Body *sigbdy, struct State *s, const char *tempfile, int is_smime)
{
int badsig = -1;
int anywarn = 0;
Expand Down Expand Up @@ -1611,12 +1611,12 @@ static int verify_one(struct Body *sigbdy, STATE *s, const char *tempfile, int i
return badsig ? 1 : anywarn ? 2 : 0;
}

int pgp_gpgme_verify_one(struct Body *sigbdy, STATE *s, const char *tempfile)
int pgp_gpgme_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile)
{
return verify_one(sigbdy, s, tempfile, 0);
}

int smime_gpgme_verify_one(struct Body *sigbdy, STATE *s, const char *tempfile)
int smime_gpgme_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile)
{
return verify_one(sigbdy, s, tempfile, 1);
}
Expand All @@ -1631,7 +1631,7 @@ int smime_gpgme_verify_one(struct Body *sigbdy, STATE *s, const char *tempfile)
a flag in R_IS_SIGNED to indicate whether this is a combined
encrypted and signed message, for S/MIME it returns true when it is
not a encrypted but a signed message. */
static struct Body *decrypt_part(struct Body *a, STATE *s, FILE *fpout, int is_smime, int *r_is_signed)
static struct Body *decrypt_part(struct Body *a, struct State *s, FILE *fpout, int is_smime, int *r_is_signed)
{
if (!a || !s || !fpout)
return NULL;
Expand Down Expand Up @@ -1778,7 +1778,7 @@ static struct Body *decrypt_part(struct Body *a, STATE *s, FILE *fpout, int is_s
int pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
{
char tempfile[_POSIX_PATH_MAX];
STATE s;
struct State s;
struct Body *first_part = b;
int is_signed = 0;
int need_decode = 0;
Expand Down Expand Up @@ -1864,7 +1864,7 @@ int pgp_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body
int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Body **cur)
{
char tempfile[_POSIX_PATH_MAX];
STATE s;
struct State s;
FILE *tmpfp = NULL;
int is_signed;
LOFF_T saved_b_offset;
Expand Down Expand Up @@ -2247,7 +2247,7 @@ void pgp_gpgme_invoke_import(const char *fname)
(Note that we aren't worse than Outlook & Cie in this, and also
note that we can successfully handle anything produced by any
existing versions of mutt.) */
static void copy_clearsigned(gpgme_data_t data, STATE *s, char *charset)
static void copy_clearsigned(gpgme_data_t data, struct State *s, char *charset)
{
char buf[HUGE_STRING];
short complete, armor_header;
Expand Down Expand Up @@ -2304,7 +2304,7 @@ static void copy_clearsigned(gpgme_data_t data, STATE *s, char *charset)
}

/* Support for classic_application/pgp */
int pgp_gpgme_application_handler(struct Body *m, STATE *s)
int pgp_gpgme_application_handler(struct Body *m, struct State *s)
{
int needpass = -1, pgp_keyblock = 0;
int clearsign = 0;
Expand Down Expand Up @@ -2549,7 +2549,7 @@ int pgp_gpgme_application_handler(struct Body *m, STATE *s)
* This handler is passed the application/octet-stream directly.
* The caller must propagate a->goodsig to its parent.
*/
int pgp_gpgme_encrypted_handler(struct Body *a, STATE *s)
int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s)
{
char tempfile[_POSIX_PATH_MAX];
FILE *fpout = NULL;
Expand Down Expand Up @@ -2623,7 +2623,7 @@ int pgp_gpgme_encrypted_handler(struct Body *a, STATE *s)
}

/* Support for application/smime */
int smime_gpgme_application_handler(struct Body *a, STATE *s)
int smime_gpgme_application_handler(struct Body *a, struct State *s)
{
char tempfile[_POSIX_PATH_MAX];
FILE *fpout = NULL;
Expand Down
10 changes: 5 additions & 5 deletions crypt_gpgme.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ int smime_gpgme_decrypt_mime(FILE *fpin, FILE **fpout, struct Body *b, struct Bo
int pgp_gpgme_check_traditional(FILE *fp, struct Body *b, int tagged_only);
void pgp_gpgme_invoke_import(const char *fname);

int pgp_gpgme_application_handler(struct Body *m, STATE *s);
int smime_gpgme_application_handler(struct Body *a, STATE *s);
int pgp_gpgme_encrypted_handler(struct Body *a, STATE *s);
int pgp_gpgme_application_handler(struct Body *m, struct State *s);
int smime_gpgme_application_handler(struct Body *a, struct State *s);
int pgp_gpgme_encrypted_handler(struct Body *a, struct State *s);

struct Body *pgp_gpgme_make_key_attachment(char *tempf);

struct Body *pgp_gpgme_sign_message(struct Body *a);
struct Body *smime_gpgme_sign_message(struct Body *a);

int pgp_gpgme_verify_one(struct Body *sigbdy, STATE *s, const char *tempfile);
int smime_gpgme_verify_one(struct Body *sigbdy, STATE *s, const char *tempfile);
int pgp_gpgme_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile);
int smime_gpgme_verify_one(struct Body *sigbdy, struct State *s, const char *tempfile);

int pgp_gpgme_send_menu(struct Header *msg);
int smime_gpgme_send_menu(struct Header *msg);
Expand Down
6 changes: 3 additions & 3 deletions crypt_mod.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ typedef int (*crypt_func_valid_passphrase_t)(void);

typedef int (*crypt_func_decrypt_mime_t)(FILE *a, FILE **b, struct Body *c, struct Body **d);

typedef int (*crypt_func_application_handler_t)(struct Body *m, STATE *s);
typedef int (*crypt_func_encrypted_handler_t)(struct Body *m, STATE *s);
typedef int (*crypt_func_application_handler_t)(struct Body *m, struct State *s);
typedef int (*crypt_func_encrypted_handler_t)(struct Body *m, struct State *s);

typedef void (*crypt_func_pgp_invoke_getkeys_t)(struct Address *addr);
typedef int (*crypt_func_pgp_check_traditional_t)(FILE *fp, struct Body *b, int tagged_only);
Expand All @@ -43,7 +43,7 @@ typedef char *(*crypt_func_findkeys_t)(struct Address *adrlist, int oppenc_mode)
typedef struct Body *(*crypt_func_sign_message_t)(struct Body *a);
typedef struct Body *(*crypt_func_pgp_encrypt_message_t)(struct Body *a, char *keylist, int sign);
typedef void (*crypt_func_pgp_invoke_import_t)(const char *fname);
typedef int (*crypt_func_verify_one_t)(struct Body *sigbdy, STATE *s, const char *tempf);
typedef int (*crypt_func_verify_one_t)(struct Body *sigbdy, struct State *s, const char *tempf);
typedef void (*crypt_func_pgp_extract_keys_from_attachment_list_t)(FILE *fp, int tag,
struct Body *top);

Expand Down
6 changes: 3 additions & 3 deletions crypt_mod_pgp_classic.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static int crypt_mod_pgp_decrypt_mime(FILE *a, FILE **b, struct Body *c, struct
{
return pgp_decrypt_mime(a, b, c, d);
}
static int crypt_mod_pgp_application_handler(struct Body *m, STATE *s)
static int crypt_mod_pgp_application_handler(struct Body *m, struct State *s)
{
return pgp_application_pgp_handler(m, s);
}
Expand All @@ -52,7 +52,7 @@ static struct Body *crypt_mod_pgp_sign_message(struct Body *a)
return pgp_sign_message(a);
}

static int crypt_mod_pgp_verify_one(struct Body *sigbdy, STATE *s, const char *tempf)
static int crypt_mod_pgp_verify_one(struct Body *sigbdy, struct State *s, const char *tempf)
{
return pgp_verify_one(sigbdy, s, tempf);
}
Expand Down Expand Up @@ -82,7 +82,7 @@ static struct Body *crypt_mod_pgp_traditional_encryptsign(struct Body *a, int fl
return pgp_traditional_encryptsign(a, flags, keylist);
}

static int crypt_mod_pgp_encrypted_handler(struct Body *m, STATE *s)
static int crypt_mod_pgp_encrypted_handler(struct Body *m, struct State *s)
{
return pgp_encrypted_handler(m, s);
}
Expand Down
6 changes: 3 additions & 3 deletions crypt_mod_pgp_gpgme.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ static int crypt_mod_pgp_decrypt_mime(FILE *a, FILE **b, struct Body *c, struct
return pgp_gpgme_decrypt_mime(a, b, c, d);
}

static int crypt_mod_pgp_application_handler(struct Body *m, STATE *s)
static int crypt_mod_pgp_application_handler(struct Body *m, struct State *s)
{
return pgp_gpgme_application_handler(m, s);
}

static int crypt_mod_pgp_encrypted_handler(struct Body *m, STATE *s)
static int crypt_mod_pgp_encrypted_handler(struct Body *m, struct State *s)
{
return pgp_gpgme_encrypted_handler(m, s);
}
Expand All @@ -74,7 +74,7 @@ static struct Body *crypt_mod_pgp_sign_message(struct Body *a)
return pgp_gpgme_sign_message(a);
}

static int crypt_mod_pgp_verify_one(struct Body *sigbdy, STATE *s, const char *tempf)
static int crypt_mod_pgp_verify_one(struct Body *sigbdy, struct State *s, const char *tempf)
{
return pgp_gpgme_verify_one(sigbdy, s, tempf);
}
Expand Down
4 changes: 2 additions & 2 deletions crypt_mod_smime_classic.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static int crypt_mod_smime_decrypt_mime(FILE *a, FILE **b, struct Body *c, struc
{
return smime_decrypt_mime(a, b, c, d);
}
static int crypt_mod_smime_application_handler(struct Body *m, STATE *s)
static int crypt_mod_smime_application_handler(struct Body *m, struct State *s)
{
return smime_application_smime_handler(m, s);
}
Expand All @@ -52,7 +52,7 @@ static struct Body *crypt_mod_smime_sign_message(struct Body *a)
return smime_sign_message(a);
}

static int crypt_mod_smime_verify_one(struct Body *sigbdy, STATE *s, const char *tempf)
static int crypt_mod_smime_verify_one(struct Body *sigbdy, struct State *s, const char *tempf)
{
return smime_verify_one(sigbdy, s, tempf);
}
Expand Down
4 changes: 2 additions & 2 deletions crypt_mod_smime_gpgme.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static int crypt_mod_smime_decrypt_mime(FILE *a, FILE **b, struct Body *c, struc
return smime_gpgme_decrypt_mime(a, b, c, d);
}

static int crypt_mod_smime_application_handler(struct Body *m, STATE *s)
static int crypt_mod_smime_application_handler(struct Body *m, struct State *s)
{
return smime_gpgme_application_handler(m, s);
}
Expand All @@ -59,7 +59,7 @@ static struct Body *crypt_mod_smime_sign_message(struct Body *a)
return smime_gpgme_sign_message(a);
}

static int crypt_mod_smime_verify_one(struct Body *sigbdy, STATE *s, const char *tempf)
static int crypt_mod_smime_verify_one(struct Body *sigbdy, struct State *s, const char *tempf)
{
return smime_gpgme_verify_one(sigbdy, s, tempf);
}
Expand Down
Loading

0 comments on commit f3470cc

Please sign in to comment.