mutt stable branch with some hacks

Make some functions static.

+49 -49
+1 -1
enter.c
··· 120 120 } 121 121 } 122 122 123 - size_t my_mbstowcs (wchar_t **pwbuf, size_t *pwbuflen, size_t i, char *buf) 123 + static size_t my_mbstowcs (wchar_t **pwbuf, size_t *pwbuflen, size_t i, char *buf) 124 124 { 125 125 wchar_t wc; 126 126 mbstate_t st;
+1 -1
group.c
··· 96 96 *p = q; 97 97 } 98 98 99 - int mutt_group_add_rx (group_t *g, const char *s, int flags, BUFFER *err) 99 + static int mutt_group_add_rx (group_t *g, const char *s, int flags, BUFFER *err) 100 100 { 101 101 return mutt_add_to_rx_list (&g->rs, s, flags, err); 102 102 }
+9 -9
handler.c
··· 74 74 fwrite (d, dlen, 1, s->fpout); 75 75 } 76 76 77 - void mutt_convert_to_state(iconv_t cd, char *bufi, size_t *l, STATE *s) 77 + static void mutt_convert_to_state(iconv_t cd, char *bufi, size_t *l, STATE *s) 78 78 { 79 79 char bufo[BUFO_SIZE]; 80 80 ICONV_CONST char *ib; ··· 113 113 *l = ibl; 114 114 } 115 115 116 - void mutt_decode_xbit (STATE *s, long len, int istext, iconv_t cd) 116 + static void mutt_decode_xbit (STATE *s, long len, int istext, iconv_t cd) 117 117 { 118 118 int c, ch; 119 119 char bufi[BUFI_SIZE]; ··· 221 221 * 222 222 */ 223 223 224 - void mutt_decode_quoted (STATE *s, long len, int istext, iconv_t cd) 224 + static void mutt_decode_quoted (STATE *s, long len, int istext, iconv_t cd) 225 225 { 226 226 char line[STRING]; 227 227 char decline[2*STRING]; ··· 357 357 state_reset_prefix(s); 358 358 } 359 359 360 - unsigned char decode_byte (char ch) 360 + static unsigned char decode_byte (char ch) 361 361 { 362 362 if (ch == 96) 363 363 return 0; 364 364 return ch - 32; 365 365 } 366 366 367 - void mutt_decode_uuencoded (STATE *s, long len, int istext, iconv_t cd) 367 + static void mutt_decode_uuencoded (STATE *s, long len, int istext, iconv_t cd) 368 368 { 369 369 char tmps[SHORT_STRING]; 370 370 char linelen, c, l, out; ··· 787 787 } 788 788 } 789 789 790 - int text_enriched_handler (BODY *a, STATE *s) 790 + static int text_enriched_handler (BODY *a, STATE *s) 791 791 { 792 792 enum { 793 793 TEXT, LANGLE, TAG, BOGUS_TAG, NEWLINE, ST_EOF, DONE ··· 1078 1078 } 1079 1079 1080 1080 /* handles message/rfc822 body parts */ 1081 - int message_handler (BODY *a, STATE *s) 1081 + static int message_handler (BODY *a, STATE *s) 1082 1082 { 1083 1083 struct stat st; 1084 1084 BODY *b; ··· 1158 1158 return (0); 1159 1159 } 1160 1160 1161 - int multipart_handler (BODY *a, STATE *s) 1161 + static int multipart_handler (BODY *a, STATE *s) 1162 1162 { 1163 1163 BODY *b, *p; 1164 1164 char length[5]; ··· 1239 1239 return rc; 1240 1240 } 1241 1241 1242 - int autoview_handler (BODY *a, STATE *s) 1242 + static int autoview_handler (BODY *a, STATE *s) 1243 1243 { 1244 1244 rfc1524_entry *entry = rfc1524_new_entry (); 1245 1245 char buffer[LONG_STRING];
+2 -2
init.c
··· 73 73 static const char* myvar_get (const char* var); 74 74 static void myvar_del (const char* var); 75 75 76 - void toggle_quadoption (int opt) 76 + static void toggle_quadoption (int opt) 77 77 { 78 78 int n = opt/4; 79 79 int b = (opt % 4) * 2; ··· 119 119 120 120 /* given the variable ``s'', return the index into the rc_vars array which 121 121 matches, or -1 if the variable is not found. */ 122 - int mutt_option_index (char *s) 122 + static int mutt_option_index (char *s) 123 123 { 124 124 int i; 125 125
+2 -2
lib.c
··· 543 543 544 544 /* Create a temporary directory next to a file name */ 545 545 546 - int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen, 546 + static int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen, 547 547 char *newdir, size_t ndlen) 548 548 { 549 549 const char *basename; ··· 618 618 return rc; 619 619 } 620 620 621 - int mutt_put_file_in_place (const char *path, const char *safe_file, const char *safe_dir) 621 + static int mutt_put_file_in_place (const char *path, const char *safe_file, const char *safe_dir) 622 622 { 623 623 int rv; 624 624
+5 -5
menu.c
··· 150 150 menu->make_entry (s, l, menu, i); 151 151 } 152 152 153 - void menu_pad_string (char *s, size_t n) 153 + static void menu_pad_string (char *s, size_t n) 154 154 { 155 155 char *scratch = safe_strdup (s); 156 156 int shift = option (OPTARROWCURSOR) ? 3 : 0; ··· 351 351 menu->redraw &= REDRAW_STATUS; 352 352 } 353 353 354 - void menu_redraw_prompt (MUTTMENU *menu) 354 + static void menu_redraw_prompt (MUTTMENU *menu) 355 355 { 356 356 if (menu->dialog) 357 357 { ··· 477 477 * halfdown: jumplen == pagelen/2 478 478 */ 479 479 #define DIRECTION ((neg * 2) + 1) 480 - void menu_length_jump (MUTTMENU *menu, int jumplen) 480 + static void menu_length_jump (MUTTMENU *menu, int jumplen) 481 481 { 482 482 int tmp, neg = (jumplen >= 0) ? 0 : -1; 483 483 int c = MIN (MenuContext, menu->pagelen / 2); ··· 638 638 mutt_error _("No entries."); 639 639 } 640 640 641 - void menu_next_entry (MUTTMENU *menu) 641 + static void menu_next_entry (MUTTMENU *menu) 642 642 { 643 643 if (menu->current < menu->max - 1) 644 644 { ··· 649 649 mutt_error _("You are on the last entry."); 650 650 } 651 651 652 - void menu_prev_entry (MUTTMENU *menu) 652 + static void menu_prev_entry (MUTTMENU *menu) 653 653 { 654 654 if (menu->current) 655 655 {
+4 -4
mh.c
··· 312 312 313 313 /* XXX - we don't currently remove deleted messages from sequences we don't know. Should we? */ 314 314 315 - void mh_update_sequences (CONTEXT * ctx) 315 + static void mh_update_sequences (CONTEXT * ctx) 316 316 { 317 317 FILE *ofp, *nfp; 318 318 ··· 978 978 /* 979 979 * This function does the second parsing pass 980 980 */ 981 - void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md, 981 + static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md, 982 982 progress_t *progress) 983 983 { 984 984 struct maildir *p, *last = NULL; ··· 1175 1175 return mh_mkstemp (dest, &msg->fp, &msg->path); 1176 1176 } 1177 1177 1178 - int ch_compar (const void *a, const void *b) 1178 + static int ch_compar (const void *a, const void *b) 1179 1179 { 1180 1180 return (int)( *((const char *) a) - *((const char *) b)); 1181 1181 } ··· 2067 2067 * then again, it's called rarely. 2068 2068 */ 2069 2069 2070 - FILE *_maildir_open_find_message (const char *folder, const char *unique, 2070 + static FILE *_maildir_open_find_message (const char *folder, const char *unique, 2071 2071 const char *subfolder) 2072 2072 { 2073 2073 char dir[_POSIX_PATH_MAX];
+2 -2
mutt_idna.c
··· 51 51 return ap->is_idn; 52 52 } 53 53 54 - int mutt_idna_to_local (const char *in, char **out, int flags) 54 + static int mutt_idna_to_local (const char *in, char **out, int flags) 55 55 { 56 56 *out = NULL; 57 57 ··· 107 107 return 1; 108 108 } 109 109 110 - int mutt_local_to_idna (const char *in, char **out) 110 + static int mutt_local_to_idna (const char *in, char **out) 111 111 { 112 112 int rv = 0; 113 113 char *tmp = safe_strdup (in);
+2 -2
mutt_ssl.c
··· 69 69 sslsockdata; 70 70 71 71 /* local prototypes */ 72 - int ssl_init (void); 72 + static int ssl_init (void); 73 73 static int add_entropy (const char *file); 74 74 static int ssl_socket_read (CONNECTION* conn, char* buf, size_t len); 75 75 static int ssl_socket_write (CONNECTION* conn, const char* buf, size_t len); ··· 147 147 * versions also. (That's the reason for the ugly #ifdefs and macros, 148 148 * otherwise I could have simply #ifdef'd the whole ssl_init funcion) 149 149 */ 150 - int ssl_init (void) 150 + static int ssl_init (void) 151 151 { 152 152 char path[_POSIX_PATH_MAX]; 153 153 static unsigned char init_complete = 0;
+3 -3
mx.c
··· 271 271 return 0; 272 272 } 273 273 274 - void mx_unlink_empty (const char *path) 274 + static void mx_unlink_empty (const char *path) 275 275 { 276 276 int fd; 277 277 #ifndef USE_DOTLOCK ··· 1207 1207 1208 1208 /* {maildir,mh}_open_new_message are in mh.c. */ 1209 1209 1210 - int mbox_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr) 1210 + static int mbox_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr) 1211 1211 { 1212 1212 msg->fp = dest->fp; 1213 1213 return 0; 1214 1214 } 1215 1215 1216 1216 #ifdef USE_IMAP 1217 - int imap_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr) 1217 + static int imap_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr) 1218 1218 { 1219 1219 char tmp[_POSIX_PATH_MAX]; 1220 1220
+2 -2
parse.c
··· 1484 1484 } 1485 1485 1486 1486 /* Compares mime types to the ok and except lists */ 1487 - int count_body_parts_check(LIST **checklist, BODY *b, int dflt) 1487 + static int count_body_parts_check(LIST **checklist, BODY *b, int dflt) 1488 1488 { 1489 1489 LIST *type; 1490 1490 ATTACH_MATCH *a; ··· 1520 1520 #define AT_COUNT(why) { shallcount = 1; } 1521 1521 #define AT_NOCOUNT(why) { shallcount = 0; } 1522 1522 1523 - int count_body_parts (BODY *body, int flags) 1523 + static int count_body_parts (BODY *body, int flags) 1524 1524 { 1525 1525 int count = 0; 1526 1526 int shallcount, shallrecurse;
+2 -2
recvattach.c
··· 363 363 return (src); 364 364 } 365 365 366 - void attach_entry (char *b, size_t blen, MUTTMENU *menu, int num) 366 + static void attach_entry (char *b, size_t blen, MUTTMENU *menu, int num) 367 367 { 368 368 mutt_FormatString (b, blen, 0, NONULL (AttachFormat), mutt_attach_fmt, (unsigned long) (((ATTACHPTR **)menu->data)[num]), M_FORMAT_ARROWCURSOR); 369 369 } ··· 780 780 print_attachment_list (fp, tag, top, &state); 781 781 } 782 782 783 - void 783 + static void 784 784 mutt_update_attach_index (BODY *cur, ATTACHPTR ***idxp, 785 785 short *idxlen, short *idxmax, 786 786 MUTTMENU *menu)
+1 -1
rfc822.c
··· 60 60 "bad address spec" 61 61 }; 62 62 63 - void rfc822_dequote_comment (char *s) 63 + static void rfc822_dequote_comment (char *s) 64 64 { 65 65 char *w = s; 66 66
+3 -3
signal.c
··· 35 35 static int IsEndwin = 0; 36 36 37 37 /* Attempt to catch "ordinary" signals and shut down gracefully. */ 38 - RETSIGTYPE exit_handler (int sig) 38 + static RETSIGTYPE exit_handler (int sig) 39 39 { 40 40 curs_set (1); 41 41 endwin (); /* just to be safe */ ··· 55 55 exit (0); 56 56 } 57 57 58 - RETSIGTYPE chld_handler (int sig) 58 + static RETSIGTYPE chld_handler (int sig) 59 59 { 60 60 /* empty */ 61 61 } 62 62 63 - RETSIGTYPE sighandler (int sig) 63 + static RETSIGTYPE sighandler (int sig) 64 64 { 65 65 int save_errno = errno; 66 66
+9 -9
sort.c
··· 42 42 if (!code) \ 43 43 code = (*((HEADER **)a))->index - (*((HEADER **)b))->index; 44 44 45 - int compare_score (const void *a, const void *b) 45 + static int compare_score (const void *a, const void *b) 46 46 { 47 47 HEADER **pa = (HEADER **) a; 48 48 HEADER **pb = (HEADER **) b; ··· 51 51 return (SORTCODE (result)); 52 52 } 53 53 54 - int compare_size (const void *a, const void *b) 54 + static int compare_size (const void *a, const void *b) 55 55 { 56 56 HEADER **pa = (HEADER **) a; 57 57 HEADER **pb = (HEADER **) b; ··· 60 60 return (SORTCODE (result)); 61 61 } 62 62 63 - int compare_date_sent (const void *a, const void *b) 63 + static int compare_date_sent (const void *a, const void *b) 64 64 { 65 65 HEADER **pa = (HEADER **) a; 66 66 HEADER **pb = (HEADER **) b; ··· 69 69 return (SORTCODE (result)); 70 70 } 71 71 72 - int compare_subject (const void *a, const void *b) 72 + static int compare_subject (const void *a, const void *b) 73 73 { 74 74 HEADER **pa = (HEADER **) a; 75 75 HEADER **pb = (HEADER **) b; ··· 107 107 return (""); 108 108 } 109 109 110 - int compare_to (const void *a, const void *b) 110 + static int compare_to (const void *a, const void *b) 111 111 { 112 112 HEADER **ppa = (HEADER **) a; 113 113 HEADER **ppb = (HEADER **) b; ··· 122 122 return (SORTCODE (result)); 123 123 } 124 124 125 - int compare_from (const void *a, const void *b) 125 + static int compare_from (const void *a, const void *b) 126 126 { 127 127 HEADER **ppa = (HEADER **) a; 128 128 HEADER **ppb = (HEADER **) b; ··· 137 137 return (SORTCODE (result)); 138 138 } 139 139 140 - int compare_date_received (const void *a, const void *b) 140 + static int compare_date_received (const void *a, const void *b) 141 141 { 142 142 HEADER **pa = (HEADER **) a; 143 143 HEADER **pb = (HEADER **) b; ··· 146 146 return (SORTCODE (result)); 147 147 } 148 148 149 - int compare_order (const void *a, const void *b) 149 + static int compare_order (const void *a, const void *b) 150 150 { 151 151 HEADER **ha = (HEADER **) a; 152 152 HEADER **hb = (HEADER **) b; ··· 155 155 return (SORTCODE ((*ha)->index - (*hb)->index)); 156 156 } 157 157 158 - int compare_spam (const void *a, const void *b) 158 + static int compare_spam (const void *a, const void *b) 159 159 { 160 160 HEADER **ppa = (HEADER **) a; 161 161 HEADER **ppb = (HEADER **) b;
+1 -1
thread.c
··· 568 568 hash_destroy (&ctx->thread_hash, *free); 569 569 } 570 570 571 - int compare_threads (const void *a, const void *b) 571 + static int compare_threads (const void *a, const void *b) 572 572 { 573 573 static sort_t *sort_func = NULL; 574 574