Commit 85e3a1a4 authored by Emanuele Giaquinta's avatar Emanuele Giaquinta

Make some functions static.

parent 1520cb4e
......@@ -120,7 +120,7 @@ static void my_wcstombs (char *dest, size_t dlen, const wchar_t *src, size_t sle
}
}
size_t my_mbstowcs (wchar_t **pwbuf, size_t *pwbuflen, size_t i, char *buf)
static size_t my_mbstowcs (wchar_t **pwbuf, size_t *pwbuflen, size_t i, char *buf)
{
wchar_t wc;
mbstate_t st;
......
......@@ -96,7 +96,7 @@ void mutt_group_add_adrlist (group_t *g, ADDRESS *a)
*p = q;
}
int mutt_group_add_rx (group_t *g, const char *s, int flags, BUFFER *err)
static int mutt_group_add_rx (group_t *g, const char *s, int flags, BUFFER *err)
{
return mutt_add_to_rx_list (&g->rs, s, flags, err);
}
......
......@@ -74,7 +74,7 @@ static void state_prefix_put (const char *d, size_t dlen, STATE *s)
fwrite (d, dlen, 1, s->fpout);
}
void mutt_convert_to_state(iconv_t cd, char *bufi, size_t *l, STATE *s)
static void mutt_convert_to_state(iconv_t cd, char *bufi, size_t *l, STATE *s)
{
char bufo[BUFO_SIZE];
ICONV_CONST char *ib;
......@@ -113,7 +113,7 @@ void mutt_convert_to_state(iconv_t cd, char *bufi, size_t *l, STATE *s)
*l = ibl;
}
void mutt_decode_xbit (STATE *s, long len, int istext, iconv_t cd)
static void mutt_decode_xbit (STATE *s, long len, int istext, iconv_t cd)
{
int c, ch;
char bufi[BUFI_SIZE];
......@@ -221,7 +221,7 @@ static void qp_decode_line (char *dest, char *src, size_t *l,
*
*/
void mutt_decode_quoted (STATE *s, long len, int istext, iconv_t cd)
static void mutt_decode_quoted (STATE *s, long len, int istext, iconv_t cd)
{
char line[STRING];
char decline[2*STRING];
......@@ -357,14 +357,14 @@ void mutt_decode_base64 (STATE *s, long len, int istext, iconv_t cd)
state_reset_prefix(s);
}
unsigned char decode_byte (char ch)
static unsigned char decode_byte (char ch)
{
if (ch == 96)
return 0;
return ch - 32;
}
void mutt_decode_uuencoded (STATE *s, long len, int istext, iconv_t cd)
static void mutt_decode_uuencoded (STATE *s, long len, int istext, iconv_t cd)
{
char tmps[SHORT_STRING];
char linelen, c, l, out;
......@@ -787,7 +787,7 @@ static void enriched_set_flags (const wchar_t *tag, struct enriched_state *stte)
}
}
int text_enriched_handler (BODY *a, STATE *s)
static int text_enriched_handler (BODY *a, STATE *s)
{
enum {
TEXT, LANGLE, TAG, BOGUS_TAG, NEWLINE, ST_EOF, DONE
......@@ -1078,7 +1078,7 @@ static int alternative_handler (BODY *a, STATE *s)
}
/* handles message/rfc822 body parts */
int message_handler (BODY *a, STATE *s)
static int message_handler (BODY *a, STATE *s)
{
struct stat st;
BODY *b;
......@@ -1158,7 +1158,7 @@ int mutt_can_decode (BODY *a)
return (0);
}
int multipart_handler (BODY *a, STATE *s)
static int multipart_handler (BODY *a, STATE *s)
{
BODY *b, *p;
char length[5];
......@@ -1239,7 +1239,7 @@ int multipart_handler (BODY *a, STATE *s)
return rc;
}
int autoview_handler (BODY *a, STATE *s)
static int autoview_handler (BODY *a, STATE *s)
{
rfc1524_entry *entry = rfc1524_new_entry ();
char buffer[LONG_STRING];
......
......@@ -73,7 +73,7 @@ static void myvar_set (const char* var, const char* val);
static const char* myvar_get (const char* var);
static void myvar_del (const char* var);
void toggle_quadoption (int opt)
static void toggle_quadoption (int opt)
{
int n = opt/4;
int b = (opt % 4) * 2;
......@@ -119,7 +119,7 @@ int query_quadoption (int opt, const char *prompt)
/* given the variable ``s'', return the index into the rc_vars array which
matches, or -1 if the variable is not found. */
int mutt_option_index (char *s)
static int mutt_option_index (char *s)
{
int i;
......
......@@ -543,7 +543,7 @@ int safe_rename (const char *src, const char *target)
/* Create a temporary directory next to a file name */
int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen,
static int mutt_mkwrapdir (const char *path, char *newfile, size_t nflen,
char *newdir, size_t ndlen)
{
const char *basename;
......@@ -618,7 +618,7 @@ int mutt_rmtree (const char* path)
return rc;
}
int mutt_put_file_in_place (const char *path, const char *safe_file, const char *safe_dir)
static int mutt_put_file_in_place (const char *path, const char *safe_file, const char *safe_dir)
{
int rv;
......
......@@ -150,7 +150,7 @@ static void menu_make_entry (char *s, int l, MUTTMENU *menu, int i)
menu->make_entry (s, l, menu, i);
}
void menu_pad_string (char *s, size_t n)
static void menu_pad_string (char *s, size_t n)
{
char *scratch = safe_strdup (s);
int shift = option (OPTARROWCURSOR) ? 3 : 0;
......@@ -351,7 +351,7 @@ void menu_redraw_current (MUTTMENU *menu)
menu->redraw &= REDRAW_STATUS;
}
void menu_redraw_prompt (MUTTMENU *menu)
static void menu_redraw_prompt (MUTTMENU *menu)
{
if (menu->dialog)
{
......@@ -477,7 +477,7 @@ void menu_prev_line (MUTTMENU *menu)
* halfdown: jumplen == pagelen/2
*/
#define DIRECTION ((neg * 2) + 1)
void menu_length_jump (MUTTMENU *menu, int jumplen)
static void menu_length_jump (MUTTMENU *menu, int jumplen)
{
int tmp, neg = (jumplen >= 0) ? 0 : -1;
int c = MIN (MenuContext, menu->pagelen / 2);
......@@ -638,7 +638,7 @@ void menu_current_bottom (MUTTMENU *menu)
mutt_error _("No entries.");
}
void menu_next_entry (MUTTMENU *menu)
static void menu_next_entry (MUTTMENU *menu)
{
if (menu->current < menu->max - 1)
{
......@@ -649,7 +649,7 @@ void menu_next_entry (MUTTMENU *menu)
mutt_error _("You are on the last entry.");
}
void menu_prev_entry (MUTTMENU *menu)
static void menu_prev_entry (MUTTMENU *menu)
{
if (menu->current)
{
......
......@@ -312,7 +312,7 @@ static void mhs_write_one_sequence (FILE * fp, struct mh_sequences *mhs,
/* XXX - we don't currently remove deleted messages from sequences we don't know. Should we? */
void mh_update_sequences (CONTEXT * ctx)
static void mh_update_sequences (CONTEXT * ctx)
{
FILE *ofp, *nfp;
......@@ -978,7 +978,7 @@ static struct maildir *skip_duplicates (struct maildir *p, struct maildir **last
/*
* This function does the second parsing pass
*/
void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
static void maildir_delayed_parsing (CONTEXT * ctx, struct maildir **md,
progress_t *progress)
{
struct maildir *p, *last = NULL;
......@@ -1175,7 +1175,7 @@ int mh_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr)
return mh_mkstemp (dest, &msg->fp, &msg->path);
}
int ch_compar (const void *a, const void *b)
static int ch_compar (const void *a, const void *b)
{
return (int)( *((const char *) a) - *((const char *) b));
}
......@@ -2067,7 +2067,7 @@ int mh_check_mailbox (CONTEXT * ctx, int *index_hint)
* then again, it's called rarely.
*/
FILE *_maildir_open_find_message (const char *folder, const char *unique,
static FILE *_maildir_open_find_message (const char *folder, const char *unique,
const char *subfolder)
{
char dir[_POSIX_PATH_MAX];
......
......@@ -51,7 +51,7 @@ static int check_idn (ADDRESS *ap)
return ap->is_idn;
}
int mutt_idna_to_local (const char *in, char **out, int flags)
static int mutt_idna_to_local (const char *in, char **out, int flags)
{
*out = NULL;
......@@ -107,7 +107,7 @@ int mutt_idna_to_local (const char *in, char **out, int flags)
return 1;
}
int mutt_local_to_idna (const char *in, char **out)
static int mutt_local_to_idna (const char *in, char **out)
{
int rv = 0;
char *tmp = safe_strdup (in);
......
......@@ -69,7 +69,7 @@ typedef struct _sslsockdata
sslsockdata;
/* local prototypes */
int ssl_init (void);
static int ssl_init (void);
static int add_entropy (const char *file);
static int ssl_socket_read (CONNECTION* conn, char* buf, size_t len);
static int ssl_socket_write (CONNECTION* conn, const char* buf, size_t len);
......@@ -147,7 +147,7 @@ int mutt_ssl_starttls (CONNECTION* conn)
* versions also. (That's the reason for the ugly #ifdefs and macros,
* otherwise I could have simply #ifdef'd the whole ssl_init funcion)
*/
int ssl_init (void)
static int ssl_init (void)
{
char path[_POSIX_PATH_MAX];
static unsigned char init_complete = 0;
......
......@@ -271,7 +271,7 @@ int mx_unlock_file (const char *path, int fd, int dot)
return 0;
}
void mx_unlink_empty (const char *path)
static void mx_unlink_empty (const char *path)
{
int fd;
#ifndef USE_DOTLOCK
......@@ -1207,14 +1207,14 @@ int mx_sync_mailbox (CONTEXT *ctx, int *index_hint)
/* {maildir,mh}_open_new_message are in mh.c. */
int mbox_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
static int mbox_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
{
msg->fp = dest->fp;
return 0;
}
#ifdef USE_IMAP
int imap_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
static int imap_open_new_message (MESSAGE *msg, CONTEXT *dest, HEADER *hdr)
{
char tmp[_POSIX_PATH_MAX];
......
......@@ -1484,7 +1484,7 @@ ADDRESS *mutt_parse_adrlist (ADDRESS *p, const char *s)
}
/* Compares mime types to the ok and except lists */
int count_body_parts_check(LIST **checklist, BODY *b, int dflt)
static int count_body_parts_check(LIST **checklist, BODY *b, int dflt)
{
LIST *type;
ATTACH_MATCH *a;
......@@ -1520,7 +1520,7 @@ int count_body_parts_check(LIST **checklist, BODY *b, int dflt)
#define AT_COUNT(why) { shallcount = 1; }
#define AT_NOCOUNT(why) { shallcount = 0; }
int count_body_parts (BODY *body, int flags)
static int count_body_parts (BODY *body, int flags)
{
int count = 0;
int shallcount, shallrecurse;
......
......@@ -363,7 +363,7 @@ const char *mutt_attach_fmt (char *dest,
return (src);
}
void attach_entry (char *b, size_t blen, MUTTMENU *menu, int num)
static void attach_entry (char *b, size_t blen, MUTTMENU *menu, int num)
{
mutt_FormatString (b, blen, 0, NONULL (AttachFormat), mutt_attach_fmt, (unsigned long) (((ATTACHPTR **)menu->data)[num]), M_FORMAT_ARROWCURSOR);
}
......@@ -780,7 +780,7 @@ void mutt_print_attachment_list (FILE *fp, int tag, BODY *top)
print_attachment_list (fp, tag, top, &state);
}
void
static void
mutt_update_attach_index (BODY *cur, ATTACHPTR ***idxp,
short *idxlen, short *idxmax,
MUTTMENU *menu)
......
......@@ -60,7 +60,7 @@ const char *RFC822Errors[] = {
"bad address spec"
};
void rfc822_dequote_comment (char *s)
static void rfc822_dequote_comment (char *s)
{
char *w = s;
......
......@@ -35,7 +35,7 @@ static struct sigaction SysOldQuit;
static int IsEndwin = 0;
/* Attempt to catch "ordinary" signals and shut down gracefully. */
RETSIGTYPE exit_handler (int sig)
static RETSIGTYPE exit_handler (int sig)
{
curs_set (1);
endwin (); /* just to be safe */
......@@ -55,12 +55,12 @@ RETSIGTYPE exit_handler (int sig)
exit (0);
}
RETSIGTYPE chld_handler (int sig)
static RETSIGTYPE chld_handler (int sig)
{
/* empty */
}
RETSIGTYPE sighandler (int sig)
static RETSIGTYPE sighandler (int sig)
{
int save_errno = errno;
......
......@@ -42,7 +42,7 @@ static sort_t *AuxSort = NULL;
if (!code) \
code = (*((HEADER **)a))->index - (*((HEADER **)b))->index;
int compare_score (const void *a, const void *b)
static int compare_score (const void *a, const void *b)
{
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
......@@ -51,7 +51,7 @@ int compare_score (const void *a, const void *b)
return (SORTCODE (result));
}
int compare_size (const void *a, const void *b)
static int compare_size (const void *a, const void *b)
{
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
......@@ -60,7 +60,7 @@ int compare_size (const void *a, const void *b)
return (SORTCODE (result));
}
int compare_date_sent (const void *a, const void *b)
static int compare_date_sent (const void *a, const void *b)
{
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
......@@ -69,7 +69,7 @@ int compare_date_sent (const void *a, const void *b)
return (SORTCODE (result));
}
int compare_subject (const void *a, const void *b)
static int compare_subject (const void *a, const void *b)
{
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
......@@ -107,7 +107,7 @@ const char *mutt_get_name (ADDRESS *a)
return ("");
}
int compare_to (const void *a, const void *b)
static int compare_to (const void *a, const void *b)
{
HEADER **ppa = (HEADER **) a;
HEADER **ppb = (HEADER **) b;
......@@ -122,7 +122,7 @@ int compare_to (const void *a, const void *b)
return (SORTCODE (result));
}
int compare_from (const void *a, const void *b)
static int compare_from (const void *a, const void *b)
{
HEADER **ppa = (HEADER **) a;
HEADER **ppb = (HEADER **) b;
......@@ -137,7 +137,7 @@ int compare_from (const void *a, const void *b)
return (SORTCODE (result));
}
int compare_date_received (const void *a, const void *b)
static int compare_date_received (const void *a, const void *b)
{
HEADER **pa = (HEADER **) a;
HEADER **pb = (HEADER **) b;
......@@ -146,7 +146,7 @@ int compare_date_received (const void *a, const void *b)
return (SORTCODE (result));
}
int compare_order (const void *a, const void *b)
static int compare_order (const void *a, const void *b)
{
HEADER **ha = (HEADER **) a;
HEADER **hb = (HEADER **) b;
......@@ -155,7 +155,7 @@ int compare_order (const void *a, const void *b)
return (SORTCODE ((*ha)->index - (*hb)->index));
}
int compare_spam (const void *a, const void *b)
static int compare_spam (const void *a, const void *b)
{
HEADER **ppa = (HEADER **) a;
HEADER **ppb = (HEADER **) b;
......
......@@ -568,7 +568,7 @@ void mutt_clear_threads (CONTEXT *ctx)
hash_destroy (&ctx->thread_hash, *free);
}
int compare_threads (const void *a, const void *b)
static int compare_threads (const void *a, const void *b)
{
static sort_t *sort_func = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment