]> granicus.if.org Git - neomutt/commitdiff
replace 'ATTACHPTR' with 'struct AttachPtr'
authorRichard Russon <rich@flatcap.org>
Mon, 15 May 2017 13:30:05 +0000 (14:30 +0100)
committerRichard Russon <rich@flatcap.org>
Mon, 15 May 2017 23:04:07 +0000 (00:04 +0100)
attach.c
attach.h
compose.c
mutt.h
pager.h
recvattach.c
recvcmd.c

index 7f58b1b845d848c2c4d7acc8d6d6aace51eaff0d..cea3939bf75dbe4a938c04978671b5068589b017 100644 (file)
--- a/attach.c
+++ b/attach.c
@@ -323,7 +323,7 @@ void mutt_check_lookup_list(BODY *b, char *type, int len)
 }
 
 /* returns -1 on error, 0 or the return code from mutt_do_pager() on success */
-int mutt_view_attachment(FILE *fp, BODY *a, int flag, HEADER *hdr, ATTACHPTR **idx, short idxlen)
+int mutt_view_attachment(FILE *fp, BODY *a, int flag, HEADER *hdr, struct AttachPtr **idx, short idxlen)
 {
   char tempfile[_POSIX_PATH_MAX] = "";
   char pagerfile[_POSIX_PATH_MAX] = "";
index 54de30304888fde1eb95de543bed2af628e3704a..8b8d6f15ad40fa2f69fabe024ae1a2ccc2a9d4bd 100644 (file)
--- a/attach.h
+++ b/attach.h
@@ -22,7 +22,7 @@
 
 #include "mutt_menu.h"
 
-typedef struct attachptr
+struct AttachPtr
 {
   BODY *content;
   int parent_type;
@@ -30,27 +30,27 @@ typedef struct attachptr
   int level;
   int num;
   bool unowned : 1; /* don't unlink on detach */
-} ATTACHPTR;
+};
 
-ATTACHPTR **mutt_gen_attach_list(BODY *m, int parent_type, ATTACHPTR **idx,
+struct AttachPtr **mutt_gen_attach_list(BODY *m, int parent_type, struct AttachPtr **idx,
                                  short *idxlen, short *idxmax, int level, int compose);
-void mutt_update_tree(ATTACHPTR **idx, short idxlen);
+void mutt_update_tree(struct AttachPtr **idx, short idxlen);
 int mutt_view_attachment(FILE *fp, BODY *a, int flag, HEADER *hdr,
-                         ATTACHPTR **idx, short idxlen);
+                         struct AttachPtr **idx, short idxlen);
 
 int mutt_tag_attach(MUTTMENU *menu, int n, int m);
 int mutt_attach_display_loop(MUTTMENU *menu, int op, FILE *fp, HEADER *hdr, BODY *cur,
-                             ATTACHPTR ***idxp, short *idxlen, short *idxmax, int recv);
+                             struct AttachPtr ***idxp, short *idxlen, short *idxmax, int recv);
 
 void mutt_save_attachment_list(FILE *fp, int tag, BODY *top, HEADER *hdr, MUTTMENU *menu);
 void mutt_pipe_attachment_list(FILE *fp, int tag, BODY *top, int filter);
 void mutt_print_attachment_list(FILE *fp, int tag, BODY *top);
 
-void mutt_attach_bounce(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen, BODY *cur);
-void mutt_attach_resend(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen, BODY *cur);
-void mutt_attach_forward(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen,
+void mutt_attach_bounce(FILE *fp, HEADER *hdr, struct AttachPtr **idx, short idxlen, BODY *cur);
+void mutt_attach_resend(FILE *fp, HEADER *hdr, struct AttachPtr **idx, short idxlen, BODY *cur);
+void mutt_attach_forward(FILE *fp, HEADER *hdr, struct AttachPtr **idx, short idxlen,
                          BODY *cur, int flags);
-void mutt_attach_reply(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen,
+void mutt_attach_reply(FILE *fp, HEADER *hdr, struct AttachPtr **idx, short idxlen,
                        BODY *cur, int flags);
 
 #endif /* _MUTT_ATTACH_H */
index dfa56c568ef376c16c617719ee83c87831f479f0..054ac45a64bd12052601e469c057ec3c563b25dc 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -122,7 +122,7 @@ static struct mapping_t ComposeNewsHelp[] = {
 static void snd_entry(char *b, size_t blen, MUTTMENU *menu, int num)
 {
   mutt_FormatString(b, blen, 0, MuttIndexWindow->cols, NONULL(AttachFormat), mutt_attach_fmt,
-                    (unsigned long) (((ATTACHPTR **) menu->data)[num]),
+                    (unsigned long) (((struct AttachPtr **) menu->data)[num]),
                     MUTT_FORMAT_STAT_FILE | MUTT_FORMAT_ARROWCURSOR);
 }
 
@@ -251,7 +251,7 @@ static void redraw_mix_line(LIST *chain)
 }
 #endif /* MIXMASTER */
 
-static int check_attachments(ATTACHPTR **idx, short idxlen)
+static int check_attachments(struct AttachPtr **idx, short idxlen)
 {
   int i, r;
   struct stat st;
@@ -379,7 +379,7 @@ static void edit_address_list(int line, struct Address **addr)
 
 static int delete_attachment(MUTTMENU *menu, short *idxlen, int x)
 {
-  ATTACHPTR **idx = (ATTACHPTR **) menu->data;
+  struct AttachPtr **idx = (struct AttachPtr **) menu->data;
   int y;
 
   menu->redraw = REDRAW_INDEX | REDRAW_STATUS;
@@ -413,7 +413,7 @@ static int delete_attachment(MUTTMENU *menu, short *idxlen, int x)
   return 0;
 }
 
-static void update_idx(MUTTMENU *menu, ATTACHPTR **idx, short idxlen)
+static void update_idx(MUTTMENU *menu, struct AttachPtr **idx, short idxlen)
 {
   idx[idxlen]->level = (idxlen > 0) ? idx[idxlen - 1]->level : 0;
   if (idxlen)
@@ -491,7 +491,7 @@ static unsigned long cum_attachs_size(MUTTMENU *menu)
 {
   size_t s;
   unsigned short i;
-  ATTACHPTR **idx = menu->data;
+  struct AttachPtr **idx = menu->data;
   CONTENT *info = NULL;
   BODY *b = NULL;
 
@@ -604,7 +604,7 @@ int mutt_compose_menu(HEADER *msg, /* structure for new message */
   char buf[LONG_STRING];
   char fname[_POSIX_PATH_MAX];
   MUTTMENU *menu = NULL;
-  ATTACHPTR **idx = NULL;
+  struct AttachPtr **idx = NULL;
   short idxlen = 0;
   short idxmax = 0;
   int i, close = 0;
@@ -844,11 +844,11 @@ int mutt_compose_menu(HEADER *msg, /* structure for new message */
           break;
         if (idxlen == idxmax)
         {
-          safe_realloc(&idx, sizeof(ATTACHPTR *) * (idxmax += 5));
+          safe_realloc(&idx, sizeof(struct AttachPtr *) * (idxmax += 5));
           menu->data = idx;
         }
 
-        idx[idxlen] = safe_calloc(1, sizeof(ATTACHPTR));
+        idx[idxlen] = safe_calloc(1, sizeof(struct AttachPtr));
         if ((idx[idxlen]->content = crypt_pgp_make_key_attachment(NULL)) != NULL)
         {
           update_idx(menu, idx, idxlen++);
@@ -880,7 +880,7 @@ int mutt_compose_menu(HEADER *msg, /* structure for new message */
 
         if (idxlen + numfiles >= idxmax)
         {
-          safe_realloc(&idx, sizeof(ATTACHPTR *) * (idxmax += 5 + numfiles));
+          safe_realloc(&idx, sizeof(struct AttachPtr *) * (idxmax += 5 + numfiles));
           menu->data = idx;
         }
 
@@ -890,7 +890,7 @@ int mutt_compose_menu(HEADER *msg, /* structure for new message */
         for (i = 0; i < numfiles; i++)
         {
           char *att = files[i];
-          idx[idxlen] = safe_calloc(1, sizeof(ATTACHPTR));
+          idx[idxlen] = safe_calloc(1, sizeof(struct AttachPtr));
           idx[idxlen]->unowned = true;
           idx[idxlen]->content = mutt_make_file_attach(att);
           if (idx[idxlen]->content != NULL)
@@ -1010,7 +1010,7 @@ int mutt_compose_menu(HEADER *msg, /* structure for new message */
 
         if (idxlen + Context->tagged >= idxmax)
         {
-          safe_realloc(&idx, sizeof(ATTACHPTR *) * (idxmax += 5 + Context->tagged));
+          safe_realloc(&idx, sizeof(struct AttachPtr *) * (idxmax += 5 + Context->tagged));
           menu->data = idx;
         }
 
@@ -1019,7 +1019,7 @@ int mutt_compose_menu(HEADER *msg, /* structure for new message */
           h = Context->hdrs[i];
           if (h->tagged)
           {
-            idx[idxlen] = safe_calloc(1, sizeof(ATTACHPTR));
+            idx[idxlen] = safe_calloc(1, sizeof(struct AttachPtr));
             idx[idxlen]->content = mutt_make_message_attach(Context, h, 1);
             if (idx[idxlen]->content != NULL)
               update_idx(menu, idx, idxlen++);
@@ -1311,7 +1311,7 @@ int mutt_compose_menu(HEADER *msg, /* structure for new message */
         }
         if (idxlen == idxmax)
         {
-          safe_realloc(&idx, sizeof(ATTACHPTR *) * (idxmax += 5));
+          safe_realloc(&idx, sizeof(struct AttachPtr *) * (idxmax += 5));
           menu->data = idx;
         }
 
@@ -1323,7 +1323,7 @@ int mutt_compose_menu(HEADER *msg, /* structure for new message */
         }
         safe_fclose(&fp);
 
-        idx[idxlen] = safe_calloc(1, sizeof(ATTACHPTR));
+        idx[idxlen] = safe_calloc(1, sizeof(struct AttachPtr));
         if ((idx[idxlen]->content = mutt_make_file_attach(fname)) == NULL)
         {
           mutt_error(_("What we have here is a failure to make an attachment"));
diff --git a/mutt.h b/mutt.h
index 7c1c6ec52db837a5974f1e681cded012d17fdd61..d9b84a80748334b52f9c2f2d9f00359a3f212724 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -751,7 +751,7 @@ typedef struct body
   struct body *parts;   /* parts of a multipart or message/rfc822 */
   struct header *hdr;   /* header information for message/rfc822 */
 
-  struct attachptr *aptr; /* Menu information, used in recvattach.c */
+  struct AttachPtr *aptr; /* Menu information, used in recvattach.c */
 
   signed short attach_count;
 
diff --git a/pager.h b/pager.h
index a8cbbc17985d656be28ed65eba28ee82ee71cc1a..6dcba9ffa15112e2e952e62a940b3eb49341dceb 100644 (file)
--- a/pager.h
+++ b/pager.h
@@ -44,7 +44,7 @@ typedef struct
   HEADER *hdr;     /* current message */
   BODY *bdy;       /* current attachment */
   FILE *fp;        /* source stream */
-  ATTACHPTR **idx; /* attachment information */
+  struct AttachPtr **idx; /* attachment information */
   short idxlen;
 } pager_t;
 
index b5c4596143b4ab9252bae3a77d965ca300214e88..8a0d045251851b7ca3a23364f7207e5d0cd92306 100644 (file)
@@ -51,7 +51,7 @@ static const struct mapping_t AttachHelp[] = {
   { N_("Print"), OP_PRINT }, { N_("Help"), OP_HELP }, { NULL, 0 },
 };
 
-void mutt_update_tree(ATTACHPTR **idx, short idxlen)
+void mutt_update_tree(struct AttachPtr **idx, short idxlen)
 {
   char buf[STRING];
   char *s = NULL;
@@ -91,17 +91,17 @@ void mutt_update_tree(ATTACHPTR **idx, short idxlen)
   }
 }
 
-ATTACHPTR **mutt_gen_attach_list(BODY *m, int parent_type, ATTACHPTR **idx,
+struct AttachPtr **mutt_gen_attach_list(BODY *m, int parent_type, struct AttachPtr **idx,
                                  short *idxlen, short *idxmax, int level, int compose)
 {
-  ATTACHPTR *new = NULL;
+  struct AttachPtr *new = NULL;
   int i;
 
   for (; m; m = m->next)
   {
     if (*idxlen == *idxmax)
     {
-      safe_realloc(&idx, sizeof(ATTACHPTR *) * ((*idxmax) += 5));
+      safe_realloc(&idx, sizeof(struct AttachPtr *) * ((*idxmax) += 5));
       for (i = *idxlen; i < *idxmax; i++)
         idx[i] = NULL;
     }
@@ -115,7 +115,7 @@ ATTACHPTR **mutt_gen_attach_list(BODY *m, int parent_type, ATTACHPTR **idx,
     else
     {
       if (!idx[*idxlen])
-        idx[*idxlen] = safe_calloc(1, sizeof(ATTACHPTR));
+        idx[*idxlen] = safe_calloc(1, sizeof(struct AttachPtr));
 
       new = idx[(*idxlen)++];
       new->content = m;
@@ -164,7 +164,7 @@ const char *mutt_attach_fmt(char *dest, size_t destlen, size_t col, int cols,
   char fmt[16];
   char tmp[SHORT_STRING];
   char charset[SHORT_STRING];
-  ATTACHPTR *aptr = (ATTACHPTR *) data;
+  struct AttachPtr *aptr = (struct AttachPtr *) data;
   int optional = (flags & MUTT_FORMAT_OPTIONAL);
   size_t l;
 
@@ -370,13 +370,13 @@ const char *mutt_attach_fmt(char *dest, size_t destlen, size_t col, int cols,
 static void attach_entry(char *b, size_t blen, MUTTMENU *menu, int num)
 {
   mutt_FormatString(b, blen, 0, MuttIndexWindow->cols, NONULL(AttachFormat), mutt_attach_fmt,
-                    (unsigned long) (((ATTACHPTR **) menu->data)[num]),
+                    (unsigned long) (((struct AttachPtr **) menu->data)[num]),
                     MUTT_FORMAT_ARROWCURSOR);
 }
 
 int mutt_tag_attach(MUTTMENU *menu, int n, int m)
 {
-  BODY *cur = ((ATTACHPTR **) menu->data)[n]->content;
+  BODY *cur = ((struct AttachPtr **) menu->data)[n]->content;
   bool ot = cur->tagged;
 
   cur->tagged = (m >= 0 ? m : !cur->tagged);
@@ -788,10 +788,10 @@ void mutt_print_attachment_list(FILE *fp, int tag, BODY *top)
     print_attachment_list(fp, tag, top, &state);
 }
 
-static void update_attach_index(BODY *cur, ATTACHPTR ***idxp, short *idxlen,
+static void update_attach_index(BODY *cur, struct AttachPtr ***idxp, short *idxlen,
                                 short *idxmax, MUTTMENU *menu)
 {
-  ATTACHPTR **idx = *idxp;
+  struct AttachPtr **idx = *idxp;
   while (--(*idxlen) >= 0)
     idx[(*idxlen)]->content = NULL;
   *idxlen = 0;
@@ -809,9 +809,9 @@ static void update_attach_index(BODY *cur, ATTACHPTR ***idxp, short *idxlen,
 
 
 int mutt_attach_display_loop(MUTTMENU *menu, int op, FILE *fp, HEADER *hdr, BODY *cur,
-                             ATTACHPTR ***idxp, short *idxlen, short *idxmax, int recv)
+                             struct AttachPtr ***idxp, short *idxlen, short *idxmax, int recv)
 {
-  ATTACHPTR **idx = *idxp;
+  struct AttachPtr **idx = *idxp;
 
   do
   {
@@ -927,7 +927,7 @@ void mutt_view_attachments(HEADER *hdr)
   BODY *cur = NULL;
   MESSAGE *msg = NULL;
   FILE *fp = NULL;
-  ATTACHPTR **idx = NULL;
+  struct AttachPtr **idx = NULL;
   short idxlen = 0;
   short idxmax = 0;
   int flags = 0;
index e7aedde88c25b08e0950e021706e1fee9b0454c4..b0b4ad541b854cd0146d9ecdbd7c5df975183c43 100644 (file)
--- a/recvcmd.c
+++ b/recvcmd.c
@@ -38,7 +38,7 @@ static bool check_msg(BODY *b, bool err)
   return true;
 }
 
-static bool check_all_msg(ATTACHPTR **idx, short idxlen, BODY *cur, bool err)
+static bool check_all_msg(struct AttachPtr **idx, short idxlen, BODY *cur, bool err)
 {
   short i;
 
@@ -60,7 +60,7 @@ static bool check_all_msg(ATTACHPTR **idx, short idxlen, BODY *cur, bool err)
 
 
 /* can we decode all tagged attachments? */
-static short check_can_decode(ATTACHPTR **idx, short idxlen, BODY *cur)
+static short check_can_decode(struct AttachPtr **idx, short idxlen, BODY *cur)
 {
   short i;
 
@@ -74,7 +74,7 @@ static short check_can_decode(ATTACHPTR **idx, short idxlen, BODY *cur)
   return 1;
 }
 
-static short count_tagged(ATTACHPTR **idx, short idxlen)
+static short count_tagged(struct AttachPtr **idx, short idxlen)
 {
   short count = 0;
   short i;
@@ -89,7 +89,7 @@ static short count_tagged(ATTACHPTR **idx, short idxlen)
 /* count the number of tagged children below a multipart or message
  * attachment.
  */
-static short count_tagged_children(ATTACHPTR **idx, short idxlen, short i)
+static short count_tagged_children(struct AttachPtr **idx, short idxlen, short i)
 {
   short level = idx[i]->level;
   short count = 0;
@@ -107,7 +107,7 @@ static short count_tagged_children(ATTACHPTR **idx, short idxlen, short i)
  ** The bounce function, from the attachment menu
  **
  **/
-void mutt_attach_bounce(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen, BODY *cur)
+void mutt_attach_bounce(FILE *fp, HEADER *hdr, struct AttachPtr **idx, short idxlen, BODY *cur)
 {
   short i;
   char prompt[STRING];
@@ -231,7 +231,7 @@ void mutt_attach_bounce(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen, BO
  **
  **
  **/
-void mutt_attach_resend(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen, BODY *cur)
+void mutt_attach_resend(FILE *fp, HEADER *hdr, struct AttachPtr **idx, short idxlen, BODY *cur)
 {
   short i;
 
@@ -256,7 +256,7 @@ void mutt_attach_resend(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen, BO
  **/
 
 /* try to find a common parent message for the tagged attachments. */
-static HEADER *find_common_parent(ATTACHPTR **idx, short idxlen, short nattach)
+static HEADER *find_common_parent(struct AttachPtr **idx, short idxlen, short nattach)
 {
   short i;
   short nchildren;
@@ -285,7 +285,7 @@ static HEADER *find_common_parent(ATTACHPTR **idx, short idxlen, short nattach)
  * Note: This and the calling procedure could be optimized quite a
  * bit.  For now, it's not worth the effort.
  */
-static bool is_parent(short i, ATTACHPTR **idx, short idxlen, BODY *cur)
+static bool is_parent(short i, struct AttachPtr **idx, short idxlen, BODY *cur)
 {
   short level = idx[i]->level;
 
@@ -298,7 +298,7 @@ static bool is_parent(short i, ATTACHPTR **idx, short idxlen, BODY *cur)
   return 0;
 }
 
-static HEADER *find_parent(ATTACHPTR **idx, short idxlen, BODY *cur, short nattach)
+static HEADER *find_parent(struct AttachPtr **idx, short idxlen, BODY *cur, short nattach)
 {
   short i;
   HEADER *parent = NULL;
@@ -345,7 +345,7 @@ static void include_header(int quote, FILE *ifp, HEADER *hdr, FILE *ofp, char *_
 
 /* Attach all the body parts which can't be decoded.
  * This code is shared by forwarding and replying. */
-static BODY **copy_problematic_attachments(FILE *fp, BODY **last, ATTACHPTR **idx,
+static BODY **copy_problematic_attachments(FILE *fp, BODY **last, struct AttachPtr **idx,
                                            short idxlen, short force)
 {
   short i;
@@ -366,7 +366,7 @@ static BODY **copy_problematic_attachments(FILE *fp, BODY **last, ATTACHPTR **id
  * forward one or several MIME bodies
  * (non-message types)
  */
-static void attach_forward_bodies(FILE *fp, HEADER *hdr, ATTACHPTR **idx,
+static void attach_forward_bodies(FILE *fp, HEADER *hdr, struct AttachPtr **idx,
                                   short idxlen, BODY *cur, short nattach, int flags)
 {
   short i;
@@ -536,7 +536,7 @@ bail:
  * while, on the attachment menu, messages are referenced through
  * the attachment index.
  */
-static void attach_forward_msgs(FILE *fp, HEADER *hdr, ATTACHPTR **idx,
+static void attach_forward_msgs(FILE *fp, HEADER *hdr, struct AttachPtr **idx,
                                 short idxlen, BODY *cur, int flags)
 {
   HEADER *curhdr = NULL;
@@ -641,7 +641,7 @@ static void attach_forward_msgs(FILE *fp, HEADER *hdr, ATTACHPTR **idx,
   ci_send_message(flags, tmphdr, *tmpbody ? tmpbody : NULL, NULL, curhdr);
 }
 
-void mutt_attach_forward(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen,
+void mutt_attach_forward(FILE *fp, HEADER *hdr, struct AttachPtr **idx, short idxlen,
                          BODY *cur, int flags)
 {
   short nattach;
@@ -676,7 +676,7 @@ void mutt_attach_forward(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen,
  *
  * Note that this code is horribly similar to envelope_defaults () from send.c.
  */
-static int attach_reply_envelope_defaults(ENVELOPE *env, ATTACHPTR **idx,
+static int attach_reply_envelope_defaults(ENVELOPE *env, struct AttachPtr **idx,
                                           short idxlen, HEADER *parent, int flags)
 {
   ENVELOPE *curenv = NULL;
@@ -780,7 +780,7 @@ static void attach_include_reply(FILE *fp, FILE *tmpfp, HEADER *cur, int flags)
   mutt_make_post_indent(Context, cur, tmpfp);
 }
 
-void mutt_attach_reply(FILE *fp, HEADER *hdr, ATTACHPTR **idx, short idxlen,
+void mutt_attach_reply(FILE *fp, HEADER *hdr, struct AttachPtr **idx, short idxlen,
                        BODY *cur, int flags)
 {
   short mime_reply_any = 0;