From: Dmitry Bogatov Date: Thu, 8 Sep 2016 10:03:52 +0000 (+0300) Subject: Remove unused code X-Git-Tag: mmh-0.4~53 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=f78e7c6e6e616cc4ff2bee8a726365fafef2d8ce;ds=sidebyside Remove unused code The unsude code is: struct zone, macro strbase64, macro isatom, function unset_unseen(), function pref_encoding(), function cpydgst(), macro base64len --- diff --git a/h/mime.h b/h/mime.h index 22c2349..d8551cb 100644 --- a/h/mime.h +++ b/h/mime.h @@ -11,12 +11,6 @@ #define DESCR_FIELD "Content-Description" #define DISPO_FIELD "Content-Disposition" -#define isatom(c) (!isspace (c) && !iscntrl (c) && (c) != '(' \ - && (c) != ')' && (c) != '<' && (c) != '>' \ - && (c) != '@' && (c) != ',' && (c) != ';' \ - && (c) != ':' && (c) != '\\' && (c) != '"' \ - && (c) != '.' && (c) != '[' && (c) != ']') - /* ** Test for valid characters used in "token" ** as defined in RFC2045 diff --git a/sbr/Makefile.in b/sbr/Makefile.in index a9fa2d4..02038e7 100644 --- a/sbr/Makefile.in +++ b/sbr/Makefile.in @@ -51,7 +51,7 @@ SRCS = addrsbr.c ambigsw.c brkstring.c \ charset.c concat.c context_del.c \ context_find.c context_read.c \ context_replace.c context_save.c \ - cpydata.c cpydgst.c crawl_folders.c \ + cpydata.c crawl_folders.c \ dtime.c dtimep.c \ error.c execprog.c ext_hook.c folder_addmsg.c folder_delmsgs.c \ folder_free.c folder_read.c \ @@ -132,4 +132,3 @@ subdir = sbr Makefile: Makefile.in ../config.status cd .. && ./config.status $(subdir)/$@ - diff --git a/sbr/cpydgst.c b/sbr/cpydgst.c deleted file mode 100644 index 5e5ef87..0000000 --- a/sbr/cpydgst.c +++ /dev/null @@ -1,68 +0,0 @@ -/* -** cpydgst.c -- copy from one fd to another in encapsulating mode -** -- (do dashstuffing of input data). -** -** This code is Copyright (c) 2002, by the authors of nmh. See the -** COPYRIGHT file in the root directory of the nmh distribution for -** complete copyright information. -*/ - -#include -#include -#include - -/* -** We want to perform the substitution -** -** \n(-.*)\n --> \n- \1\n -** -** This is equivalent to the sed substitution -** -** sed -e 's%^-%- -%' < ifile > ofile -** -** but the routine below is faster than the pipe, fork, and exec. -*/ - -#define S1 0 -#define S2 1 - -#define output(c) if (bp >= dp) {flush(); *bp++ = c;} else *bp++ = c -#define flush() if ((j = bp - outbuf) && write(out, outbuf, j) != j) \ - adios(EX_IOERR, ofile, "error writing"); \ - else \ - bp = outbuf - - -void -cpydgst(int in, int out, char *ifile, char *ofile) -{ - int i, j, state; - char *cp, *ep; - char *bp, *dp; - char buffer[BUFSIZ], outbuf[BUFSIZ]; - - dp = (bp = outbuf) + sizeof outbuf; - for (state = S1; (i = read(in, buffer, sizeof buffer)) > 0;) - for (ep = (cp = buffer) + i; cp < ep; cp++) { - if (*cp == '\0') - continue; - switch (state) { - case S1: - if (*cp == '-') { - output('-'); - output(' '); - } - state = S2; /* fall */ - - case S2: - output(*cp); - if (*cp == '\n') - state = S1; - break; - } - } - - if (i == -1) - adios(EX_IOERR, ifile, "error reading"); - flush(); -} diff --git a/sbr/dtime.c b/sbr/dtime.c index 47ae79e..1d3bc06 100644 --- a/sbr/dtime.c +++ b/sbr/dtime.c @@ -39,12 +39,6 @@ char *tw_ldotw[] = { "Saturday", NULL }; -struct zone { - char *std; - char *dst; - int shift; -}; - static int dmsize[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; diff --git a/sbr/encode_rfc2047.c b/sbr/encode_rfc2047.c index 4e4cbef..72d27ce 100644 --- a/sbr/encode_rfc2047.c +++ b/sbr/encode_rfc2047.c @@ -48,9 +48,6 @@ static char *address_headers[] = { c == '/' || c == '=' || c == '_') #define qpspecial(c) (c < ' ' || c == '=' || c == '?' || c == '_') -#define base64len(n) ((((n) + 2) / 3) * 4) /* String len to base64 len */ -#define strbase64(n) ((n) / 4 * 3) /* Chars that fit in base64 */ - #define ENCODELINELIMIT 76 static void unfold_header(char **, int); @@ -59,7 +56,6 @@ static int field_encode_quoted(const char *, char **, const char *, int, int, int); static int scanstring(const char *, int *, int *, int *); static int utf8len(const char *); -/*static int pref_encoding(int, int, int);*/ /* ** Encode a message header using RFC 2047 encoding. We make the assumption @@ -634,38 +630,3 @@ scanstring(const char *string, int *asciilen, int *eightbitchars, return *eightbitchars > 0; } - -#if 0 - -/* -** This function is to be used to decide which encoding algorithm we should -** use if one is not given. Basically, we pick whichever one is the shorter -** of the two. -** -** Arguments are: -** -** ascii - Number of ASCII characters in to-be-encoded string. -** specials - Number of ASCII characters in to-be-encoded string that -** still require encoding under quoted-printable. Note that -** these are included in the "ascii" total. -** eightbit - Eight-bit characters in the to-be-encoded string. -** -** Returns one of CE_BASE64 or CE_QUOTED. -**/ -static int -pref_encoding(int ascii, int specials, int eightbits) -{ - /* - ** The length of the q-p encoding is: - ** - ** ascii - specials + (specials + eightbits) * 3. - ** - ** The length of the base64 encoding is: - ** - ** base64len(ascii + eightbits) (See macro for details) - */ - return base64len(ascii + eightbits) < (ascii - specials + - (specials + eightbits) * 3) ? CE_BASE64 : CE_QUOTED; -} - -#endif diff --git a/sbr/seq_msgstats.c b/sbr/seq_msgstats.c index 50ae7c6..7ffbde1 100644 --- a/sbr/seq_msgstats.c +++ b/sbr/seq_msgstats.c @@ -142,13 +142,6 @@ unset_selected(struct msgs *mp, int msgnum) } } -void -unset_unseen(struct msgs *mp, int msgnum) -{ - assert_msg_range(mp, msgnum); - mp->msgstats[msgnum - mp->lowoff] &= ~SELECT_UNSEEN; -} - /* ** private/public sequences