diff --git a/mail/faces/files/patch-compface_arith.c b/mail/faces/files/patch-compface_arith.c index b76ad572de07..7da58d04e68c 100644 --- a/mail/faces/files/patch-compface_arith.c +++ b/mail/faces/files/patch-compface_arith.c @@ -1,447 +1,313 @@ -*** compface/arith.c Tue Jan 15 23:58:46 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/arith.c Thu Oct 24 03:28:07 1991 -*************** -*** 17,33 **** - #include "compface.h" - - void -! RevPush(Prob *p) - { -! if (NumProbs >= PIXELS * 2 - 1) { - longjmp(comp_env, ERR_INTERNAL); -- } - ProbBuf[NumProbs++] = p; - } - -- - void -! BigPush(Prob *p) - { - static WORD tmp; - ---- 16,32 ---- - #include "compface.h" - - void -! RevPush(p) -! Prob *p; - { -! if (NumProbs >= PIXELS * 2 - 1) - longjmp(comp_env, ERR_INTERNAL); - ProbBuf[NumProbs++] = p; - } - - void -! BigPush(p) -! Prob *p; - { - static WORD tmp; - -*************** -*** 36,76 **** - BigAdd(tmp + p->p_offset); - } - +--- compface/arith.c.orig ++++ compface/arith.c +@@ -17,17 +17,17 @@ + #include "compface.h" + + void +-RevPush(Prob *p) ++RevPush(p) ++Prob *p; + { +- if (NumProbs >= PIXELS * 2 - 1) { ++ if (NumProbs >= PIXELS * 2 - 1) + longjmp(comp_env, ERR_INTERNAL); +- } + ProbBuf[NumProbs++] = p; + } + - - int -! BigPop(Prob *p) - { - static WORD tmp; -! int i; - - BigDiv(0, &tmp); - i = 0; -! while ((tmp < p->p_offset) || (tmp >= p->p_range + p->p_offset)) { - p++; - i++; - } - BigMul(p->p_range); - BigAdd(tmp - p->p_offset); -! return(i); - } - -- - #ifdef DEBUG - void -! BigPrint() /* Print a BigInt in HexaDecimal. */ - { -! int i, c, count; -! WORD *w; - - count = 0; - w = B.b_word + (i = B.b_words); -! while (i--) { - w--; - c = *((*w >> 4) + HexDigits); - putc(c, stderr); - c = *((*w & 0xf) + HexDigits); - putc(c, stderr); -! if (++count >= 36) { - putc('\\', stderr); - putc('\n', stderr); - count = 0; ---- 35,79 ---- - BigAdd(tmp + p->p_offset); - } - - int -! BigPop(p) -! register Prob *p; - { - static WORD tmp; -! register int i; - - BigDiv(0, &tmp); - i = 0; -! while ((tmp < p->p_offset) || (tmp >= p->p_range + p->p_offset)) -! { - p++; - i++; - } - BigMul(p->p_range); - BigAdd(tmp - p->p_offset); -! return i; - } - - #ifdef DEBUG -+ /* Print a BigInt in HexaDecimal -+ */ - void -! BigPrint() - { -! register int i, c, count; -! register WORD *w; - - count = 0; - w = B.b_word + (i = B.b_words); -! while (i--) -! { - w--; - c = *((*w >> 4) + HexDigits); - putc(c, stderr); - c = *((*w & 0xf) + HexDigits); - putc(c, stderr); -! if (++count >= 36) -! { - putc('\\', stderr); - putc('\n', stderr); - count = 0; -*************** -*** 78,110 **** - } - putc('\n', stderr); - } -! #endif /*DEBUG*/ -! - - /* Divide B by a storing the result in B and the remainder in the word -! * pointer to by r. - */ -- - void -! BigDiv(WORD a, WORD *r) - { -! int i; -! WORD *w; -! COMP c, d; - - a &= WORDMASK; -! if ((a == 1) || (B.b_words == 0)) { - *r = 0; - return; - } -! -! /* Treat this as a == WORDCARRY and just shift everything right a WORD */ -! -! if (a == 0) { - i = --B.b_words; - w = B.b_word; - *r = *w; -! while (i--) { - *w = *(w + 1); - w++; - } ---- 81,112 ---- - } - putc('\n', stderr); - } -! #endif - - /* Divide B by a storing the result in B and the remainder in the word -! * pointer to by r - */ - void -! BigDiv(a, r) -! register WORD a, *r; - { -! register int i; -! register WORD *w; -! register COMP c, d; - - a &= WORDMASK; -! if ((a == 1) || (B.b_words == 0)) -! { - *r = 0; - return; - } -! if (a == 0) /* treat this as a == WORDCARRY */ -! { /* and just shift everything right a WORD */ - i = --B.b_words; - w = B.b_word; - *r = *w; -! while (i--) -! { - *w = *(w + 1); - w++; - } -*************** -*** 113,154 **** - } - w = B.b_word + (i = B.b_words); - c = 0; -! while (i--) { - c <<= BITSPERWORD; -! c += (COMP) *--w; -! d = c / (COMP) a; -! c = c % (COMP) a; -! *w = (WORD) (d & WORDMASK); - } - *r = c; -! if (B.b_word[B.b_words - 1] == 0) { - B.b_words--; -- } - } - -! -! /* Multiply a by B storing the result in B. */ -! - void -! BigMul(WORD a) - { -! int i; -! WORD *w; -! COMP c; - - a &= WORDMASK; -! if ((a == 1) || (B.b_words == 0)) { - return; -! } -! -! /* Treat this as a == WORDCARRY and just shift everything left a WORD */ -! -! if (a == 0) { -! if ((i = B.b_words++) >= MAXWORDS - 1) { - longjmp(comp_env, ERR_INTERNAL); -- } - w = B.b_word + i; -! while (i--) { - *w = *(w - 1); - w--; - } ---- 115,153 ---- - } - w = B.b_word + (i = B.b_words); - c = 0; -! while (i--) -! { - c <<= BITSPERWORD; -! c += (COMP)*--w; -! d = c / (COMP)a; -! c = c % (COMP)a; -! *w = (WORD)(d & WORDMASK); - } - *r = c; -! if (B.b_word[B.b_words - 1] == 0) - B.b_words--; - } - -! /* Multiply a by B storing the result in B -! */ - void -! BigMul(a) -! register WORD a; - { -! register int i; -! register WORD *w; -! register COMP c; - - a &= WORDMASK; -! if ((a == 1) || (B.b_words == 0)) - return; -! if (a == 0) /* treat this as a == WORDCARRY */ -! { /* and just shift everything left a WORD */ -! if ((i = B.b_words++) >= MAXWORDS - 1) - longjmp(comp_env, ERR_INTERNAL); - w = B.b_word + i; -! while (i--) -! { - *w = *(w - 1); - w--; - } -*************** -*** 158,239 **** - i = B.b_words; - w = B.b_word; - c = 0; -! while (i--) { - c += (COMP)*w * (COMP)a; - *(w++) = (WORD)(c & WORDMASK); - c >>= BITSPERWORD; - } -! if (c) { -! if (B.b_words++ >= MAXWORDS) { - longjmp(comp_env, ERR_INTERNAL); -- } - *w = (COMP)(c & WORDMASK); - } - } - -! -! /* Subtract a from B storing the result in B. */ -! - void -! BigSub(WORD a) - { -! int i; -! WORD *w; -! COMP c; - - a &= WORDMASK; -! if (a == 0) { - return; -- } - i = 1; - w = B.b_word; -! c = (COMP) *w - (COMP) a; -! *w = (WORD) (c & WORDMASK); -! while (c & WORDCARRY) { -! if (i >= B.b_words) { - longjmp(comp_env, ERR_INTERNAL); -! } -! c = (COMP) *++w - 1; -! *w = (WORD) (c & WORDMASK); - i++; - } -! if ((i == B.b_words) && (*w == 0) && (i > 0)) { - B.b_words--; -- } - } - -! -! /* Add to a to B storing the result in B. */ -! - void -! BigAdd(WORD a) - { -! int i; -! WORD *w; -! COMP c; - - a &= WORDMASK; -! if (a == 0) { - return; -- } - i = 0; - w = B.b_word; - c = a; -! while ((i < B.b_words) && c) { -! c += (COMP) *w; -! *w++ = (WORD) (c & WORDMASK); - c >>= BITSPERWORD; - i++; - } -! if ((i == B.b_words) && c) { -! if (B.b_words++ >= MAXWORDS) { - longjmp(comp_env, ERR_INTERNAL); -! } -! *w = (COMP) (c & WORDMASK); - } - } - -- - void - BigClear() - { ---- 157,238 ---- - i = B.b_words; - w = B.b_word; - c = 0; -! while (i--) -! { - c += (COMP)*w * (COMP)a; - *(w++) = (WORD)(c & WORDMASK); - c >>= BITSPERWORD; - } -! if (c) -! { -! if (B.b_words++ >= MAXWORDS) - longjmp(comp_env, ERR_INTERNAL); - *w = (COMP)(c & WORDMASK); - } - } - -! #if 0 -! /* Subtract a from B storing the result in B -! */ - void -! BigSub(a) -! WORD a; - { -! register int i; -! register WORD *w; -! register COMP c; - - a &= WORDMASK; -! if (a == 0) - return; - i = 1; - w = B.b_word; -! c = (COMP)*w - (COMP)a; -! *w = (WORD)(c & WORDMASK); -! while (c & WORDCARRY) -! { -! if (i >= B.b_words) - longjmp(comp_env, ERR_INTERNAL); -! c = (COMP)*++w - 1; -! *w = (WORD)(c & WORDMASK); - i++; - } -! if ((i == B.b_words) && (*w == 0) && (i > 0)) - B.b_words--; - } -+ #endif - -! /* Add to a to B storing the result in B -! */ - void -! BigAdd(a) -! WORD a; - { -! register int i; -! register WORD *w; -! register COMP c; - - a &= WORDMASK; -! if (a == 0) - return; - i = 0; - w = B.b_word; - c = a; -! while ((i < B.b_words) && c) -! { -! c += (COMP)*w; -! *w++ = (WORD)(c & WORDMASK); - c >>= BITSPERWORD; - i++; - } -! if ((i == B.b_words) && c) -! { -! if (B.b_words++ >= MAXWORDS) - longjmp(comp_env, ERR_INTERNAL); -! *w = (COMP)(c & WORDMASK); - } - } - - void - BigClear() - { + void +-BigPush(Prob *p) ++BigPush(p) ++Prob *p; + { + static WORD tmp; + +@@ -36,41 +36,45 @@ + BigAdd(tmp + p->p_offset); + } + +- + int +-BigPop(Prob *p) ++BigPop(p) ++register Prob *p; + { + static WORD tmp; +- int i; ++ register int i; + + BigDiv(0, &tmp); + i = 0; +- while ((tmp < p->p_offset) || (tmp >= p->p_range + p->p_offset)) { ++ while ((tmp < p->p_offset) || (tmp >= p->p_range + p->p_offset)) ++ { + p++; + i++; + } + BigMul(p->p_range); + BigAdd(tmp - p->p_offset); +- return(i); ++ return i; + } + +- + #ifdef DEBUG ++/* Print a BigInt in HexaDecimal ++ */ + void +-BigPrint() /* Print a BigInt in HexaDecimal. */ ++BigPrint() + { +- int i, c, count; +- WORD *w; ++ register int i, c, count; ++ register WORD *w; + + count = 0; + w = B.b_word + (i = B.b_words); +- while (i--) { ++ while (i--) ++ { + w--; + c = *((*w >> 4) + HexDigits); + putc(c, stderr); + c = *((*w & 0xf) + HexDigits); + putc(c, stderr); +- if (++count >= 36) { ++ if (++count >= 36) ++ { + putc('\\', stderr); + putc('\n', stderr); + count = 0; +@@ -78,33 +82,32 @@ + } + putc('\n', stderr); + } +-#endif /*DEBUG*/ ++#endif + +- + /* Divide B by a storing the result in B and the remainder in the word +- * pointer to by r. ++ * pointer to by r + */ +- + void +-BigDiv(WORD a, WORD *r) ++BigDiv(a, r) ++register WORD a, *r; + { +- int i; +- WORD *w; +- COMP c, d; ++ register int i; ++ register WORD *w; ++ register COMP c, d; + + a &= WORDMASK; +- if ((a == 1) || (B.b_words == 0)) { ++ if ((a == 1) || (B.b_words == 0)) ++ { + *r = 0; + return; + } +- +-/* Treat this as a == WORDCARRY and just shift everything right a WORD */ +- +- if (a == 0) { ++ if (a == 0) /* treat this as a == WORDCARRY */ ++ { /* and just shift everything right a WORD */ + i = --B.b_words; + w = B.b_word; + *r = *w; +- while (i--) { ++ while (i--) ++ { + *w = *(w + 1); + w++; + } +@@ -113,42 +116,39 @@ + } + w = B.b_word + (i = B.b_words); + c = 0; +- while (i--) { ++ while (i--) ++ { + c <<= BITSPERWORD; +- c += (COMP) *--w; +- d = c / (COMP) a; +- c = c % (COMP) a; +- *w = (WORD) (d & WORDMASK); ++ c += (COMP)*--w; ++ d = c / (COMP)a; ++ c = c % (COMP)a; ++ *w = (WORD)(d & WORDMASK); + } + *r = c; +- if (B.b_word[B.b_words - 1] == 0) { ++ if (B.b_word[B.b_words - 1] == 0) + B.b_words--; +- } + } + +- +-/* Multiply a by B storing the result in B. */ +- ++/* Multiply a by B storing the result in B ++ */ + void +-BigMul(WORD a) ++BigMul(a) ++register WORD a; + { +- int i; +- WORD *w; +- COMP c; ++ register int i; ++ register WORD *w; ++ register COMP c; + + a &= WORDMASK; +- if ((a == 1) || (B.b_words == 0)) { ++ if ((a == 1) || (B.b_words == 0)) + return; +- } +- +-/* Treat this as a == WORDCARRY and just shift everything left a WORD */ +- +- if (a == 0) { +- if ((i = B.b_words++) >= MAXWORDS - 1) { ++ if (a == 0) /* treat this as a == WORDCARRY */ ++ { /* and just shift everything left a WORD */ ++ if ((i = B.b_words++) >= MAXWORDS - 1) + longjmp(comp_env, ERR_INTERNAL); +- } + w = B.b_word + i; +- while (i--) { ++ while (i--) ++ { + *w = *(w - 1); + w--; + } +@@ -158,81 +158,81 @@ + i = B.b_words; + w = B.b_word; + c = 0; +- while (i--) { ++ while (i--) ++ { + c += (COMP)*w * (COMP)a; + *(w++) = (WORD)(c & WORDMASK); + c >>= BITSPERWORD; + } +- if (c) { +- if (B.b_words++ >= MAXWORDS) { ++ if (c) ++ { ++ if (B.b_words++ >= MAXWORDS) + longjmp(comp_env, ERR_INTERNAL); +- } + *w = (COMP)(c & WORDMASK); + } + } + +- +-/* Subtract a from B storing the result in B. */ +- ++#if 0 ++/* Subtract a from B storing the result in B ++ */ + void +-BigSub(WORD a) ++BigSub(a) ++WORD a; + { +- int i; +- WORD *w; +- COMP c; ++ register int i; ++ register WORD *w; ++ register COMP c; + + a &= WORDMASK; +- if (a == 0) { ++ if (a == 0) + return; +- } + i = 1; + w = B.b_word; +- c = (COMP) *w - (COMP) a; +- *w = (WORD) (c & WORDMASK); +- while (c & WORDCARRY) { +- if (i >= B.b_words) { ++ c = (COMP)*w - (COMP)a; ++ *w = (WORD)(c & WORDMASK); ++ while (c & WORDCARRY) ++ { ++ if (i >= B.b_words) + longjmp(comp_env, ERR_INTERNAL); +- } +- c = (COMP) *++w - 1; +- *w = (WORD) (c & WORDMASK); ++ c = (COMP)*++w - 1; ++ *w = (WORD)(c & WORDMASK); + i++; + } +- if ((i == B.b_words) && (*w == 0) && (i > 0)) { ++ if ((i == B.b_words) && (*w == 0) && (i > 0)) + B.b_words--; +- } + } ++#endif + +- +-/* Add to a to B storing the result in B. */ +- ++/* Add to a to B storing the result in B ++ */ + void +-BigAdd(WORD a) ++BigAdd(a) ++WORD a; + { +- int i; +- WORD *w; +- COMP c; ++ register int i; ++ register WORD *w; ++ register COMP c; + + a &= WORDMASK; +- if (a == 0) { ++ if (a == 0) + return; +- } + i = 0; + w = B.b_word; + c = a; +- while ((i < B.b_words) && c) { +- c += (COMP) *w; +- *w++ = (WORD) (c & WORDMASK); ++ while ((i < B.b_words) && c) ++ { ++ c += (COMP)*w; ++ *w++ = (WORD)(c & WORDMASK); + c >>= BITSPERWORD; + i++; + } +- if ((i == B.b_words) && c) { +- if (B.b_words++ >= MAXWORDS) { ++ if ((i == B.b_words) && c) ++ { ++ if (B.b_words++ >= MAXWORDS) + longjmp(comp_env, ERR_INTERNAL); +- } +- *w = (COMP) (c & WORDMASK); ++ *w = (COMP)(c & WORDMASK); + } + } +- + + void + BigClear() diff --git a/mail/faces/files/patch-compface_cmain.c b/mail/faces/files/patch-compface_cmain.c index 31f64942af3b..c3f144a65ad0 100644 --- a/mail/faces/files/patch-compface_cmain.c +++ b/mail/faces/files/patch-compface_cmain.c @@ -1,292 +1,197 @@ -*** compface/cmain.c Thu Feb 21 16:42:54 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/cmain.c Thu Oct 24 03:28:07 1991 -*************** -*** 13,89 **** - * to me, then an attempt will be made to fix them. - */ - -- #include -- #include - #include - #include "compface.h" - -! #define STRCAT (void) strcat -! #define STRCPY (void) strcpy -! #define WRITE (void) write -! -! /* The buffer is longer than needed to handle sparse input formats */ -! - #define FACEBUFLEN 2048 - char fbuf[FACEBUFLEN]; - - /* IO file descriptors and their names */ -- - int infile = 0; - char *inname = ""; - int outfile = 1; - char *outname = ""; - -! char *cmdname; /* Basename of executable */ - -! /* Error handling definitions follow */ - - extern int errno, sys_nerr; - extern char *sys_errlist[]; - - #define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "") -! #define INITERR(s) { \ -! STRCPY(fbuf, cmdname); \ -! STRCAT(fbuf, ": "); \ -! STRCAT(fbuf, (s));\ -! } -! #define ADDERR(s) STRCAT(fbuf, (s)); -! #define ERROR { \ -! STRCAT(fbuf, "\n"); \ -! WRITE(2, fbuf, strlen(fbuf)); \ -! exit(1); \ -! } -! #define INITWARN(s) { \ -! STRCPY(fbuf, cmdname); \ -! STRCAT(fbuf, ": (warning) "); \ -! STRCAT(fbuf, (s)); \ -! } -! #define ADDWARN(s) STRCAT(fbuf, (s)); -! #define WARN { \ -! STRCAT(fbuf, "\n"); \ -! WRITE(2, fbuf, strlen(fbuf)); \ -! } - - int -! main(int argc, char *argv[]) - { - cmdname = *argv; -! while (**argv) { -! if (*((*argv)++) == '/') { -! cmdname = *argv; /* Find the command's basename */ -! } -! } - -! if (argc > 3) { - INITERR("usage: ") - ADDERR(cmdname) - ADDERR(" [infile [outfile]]") - ERROR - } - -! if ((argc > 1) && strcmp(*++argv, "-")) { - inname = *argv; -! if ((infile = open(inname, O_RDONLY)) == -1) { - INITERR(inname) - ADDERR(": ") - ADDERR(ERR) ---- 15,78 ---- - * to me, then an attempt will be made to fix them. - */ - - #include - #include "compface.h" - -! /* the buffer is longer than needed to handle sparse input formats */ - #define FACEBUFLEN 2048 - char fbuf[FACEBUFLEN]; - - /* IO file descriptors and their names */ - int infile = 0; - char *inname = ""; - int outfile = 1; - char *outname = ""; - -! /* basename of executable */ -! char *cmdname; - -! /* error handling definitions follow */ - - extern int errno, sys_nerr; - extern char *sys_errlist[]; - -+ extern void exit P((int)) ; -+ - #define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "") -! #define INITERR(s) {(void)strcpy(fbuf, cmdname); (void)strcat(fbuf, ": ");\ -! (void)strcat(fbuf, (s));} -! #define ADDERR(s) (void)strcat(fbuf, (s)); -! #define ERROR {(void)strcat(fbuf, "\n");\ -! (void)write(2, fbuf, strlen(fbuf)); exit(1);} -! #define INITWARN(s) {(void)strcpy(fbuf, cmdname);\ -! (void)strcat(fbuf, ": (warning) ");\ -! (void)strcat(fbuf, (s));} -! #define ADDWARN(s) (void)strcat(fbuf, (s)); -! #define WARN {(void)strcat(fbuf, "\n"); (void)write(2, fbuf, strlen(fbuf));} - - int -! main(argc, argv) -! int argc; -! char *argv[]; - { - cmdname = *argv; -! while (**argv) -! if (*((*argv)++) == '/') -! cmdname = *argv; /* find the command's basename */ - -! if (argc > 3) -! { - INITERR("usage: ") - ADDERR(cmdname) - ADDERR(" [infile [outfile]]") - ERROR - } - -! if ((argc > 1) && strcmp(*++argv, "-")) -! { - inname = *argv; -! if ((infile = open(inname, O_RDONLY)) == -1) -! { - INITERR(inname) - ADDERR(": ") - ADDERR(ERR) -*************** -*** 91,100 **** - } - } - -! if (argc > 2) { - outname = *++argv; -! if ((outfile = open(outname, O_WRONLY | O_CREAT | -! O_TRUNC, 0644)) == -1) { - INITERR(outname) - ADDERR(": ") - ADDERR(ERR) ---- 80,90 ---- - } - } - -! if (argc > 2) -! { - outname = *++argv; -! if ((outfile = open(outname, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) -! { - INITERR(outname) - ADDERR(": ") - ADDERR(ERR) -*************** -*** 103,109 **** - } - - (void) ReadBuf(); -! switch (compface(fbuf)) { - case -2 : INITERR("internal error") - ERROR - case -1 : INITERR(inname) ---- 93,100 ---- - } - - (void) ReadBuf(); -! switch (compface(fbuf)) -! { - case -2 : INITERR("internal error") - ERROR - case -1 : INITERR(inname) -*************** -*** 123,135 **** - int - WriteBuf() - { -! char *s, *t; -! int len; - - s = fbuf; - t = s + strlen(s); -! while (s < t) { -! if ((len = write(outfile, s, t - s)) == -1) { - INITERR(outname) - ADDERR(": ") - ADDERR(ERR) ---- 114,128 ---- - int - WriteBuf() - { -! register char *s, *t; -! register int len; - - s = fbuf; - t = s + strlen(s); -! while (s < t) -! { -! if ((len = write(outfile, s, t - s)) == -1) -! { - INITERR(outname) - ADDERR(": ") - ADDERR(ERR) -*************** -*** 137,163 **** - } - s += len; - } -! return(0); - } - - - int - ReadBuf() - { -! int count, len; -! char *t; - - count = 0; - t = fbuf; -! while ((len = read(infile, t, FACEBUFLEN - count))) { -! if (len == -1) { - INITERR(inname) - ADDERR(": ") - ADDERR(ERR) - ERROR - } - t += len; -! if ((count += len) >= FACEBUFLEN) { - INITWARN(inname) - ADDWARN(" exceeds internal buffer size. Data may be lost") - WARN ---- 130,159 ---- - } - s += len; - } -! return 0; - } - - - int - ReadBuf() - { -! register int count, len; -! register char *t; - - count = 0; - t = fbuf; -! while (len = read(infile, t, FACEBUFLEN - count)) -! { -! if (len == -1) -! { - INITERR(inname) - ADDERR(": ") - ADDERR(ERR) - ERROR - } - t += len; -! if ((count += len) >= FACEBUFLEN) -! { - INITWARN(inname) - ADDWARN(" exceeds internal buffer size. Data may be lost") - WARN -*************** -*** 165,169 **** - } - } - *t = '\0'; -! return(count); - } ---- 161,165 ---- - } - } - *t = '\0'; -! return count; - } +--- compface/cmain.c.orig ++++ compface/cmain.c +@@ -13,77 +13,64 @@ + * to me, then an attempt will be made to fix them. + */ + +-#include +-#include + #include + #include "compface.h" + +-#define STRCAT (void) strcat +-#define STRCPY (void) strcpy +-#define WRITE (void) write +- +-/* The buffer is longer than needed to handle sparse input formats */ +- ++/* the buffer is longer than needed to handle sparse input formats */ + #define FACEBUFLEN 2048 + char fbuf[FACEBUFLEN]; + + /* IO file descriptors and their names */ +- + int infile = 0; + char *inname = ""; + int outfile = 1; + char *outname = ""; + +-char *cmdname; /* Basename of executable */ ++/* basename of executable */ ++char *cmdname; + +-/* Error handling definitions follow */ ++/* error handling definitions follow */ + + extern int errno, sys_nerr; + extern char *sys_errlist[]; + ++extern void exit P((int)) ; ++ + #define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "") +-#define INITERR(s) { \ +- STRCPY(fbuf, cmdname); \ +- STRCAT(fbuf, ": "); \ +- STRCAT(fbuf, (s));\ +- } +-#define ADDERR(s) STRCAT(fbuf, (s)); +-#define ERROR { \ +- STRCAT(fbuf, "\n"); \ +- WRITE(2, fbuf, strlen(fbuf)); \ +- exit(1); \ +- } +-#define INITWARN(s) { \ +- STRCPY(fbuf, cmdname); \ +- STRCAT(fbuf, ": (warning) "); \ +- STRCAT(fbuf, (s)); \ +- } +-#define ADDWARN(s) STRCAT(fbuf, (s)); +-#define WARN { \ +- STRCAT(fbuf, "\n"); \ +- WRITE(2, fbuf, strlen(fbuf)); \ +- } ++#define INITERR(s) {(void)strcpy(fbuf, cmdname); (void)strcat(fbuf, ": ");\ ++ (void)strcat(fbuf, (s));} ++#define ADDERR(s) (void)strcat(fbuf, (s)); ++#define ERROR {(void)strcat(fbuf, "\n");\ ++ (void)write(2, fbuf, strlen(fbuf)); exit(1);} ++#define INITWARN(s) {(void)strcpy(fbuf, cmdname);\ ++ (void)strcat(fbuf, ": (warning) ");\ ++ (void)strcat(fbuf, (s));} ++#define ADDWARN(s) (void)strcat(fbuf, (s)); ++#define WARN {(void)strcat(fbuf, "\n"); (void)write(2, fbuf, strlen(fbuf));} + + int +-main(int argc, char *argv[]) ++main(argc, argv) ++int argc; ++char *argv[]; + { + cmdname = *argv; +- while (**argv) { +- if (*((*argv)++) == '/') { +- cmdname = *argv; /* Find the command's basename */ +- } +- } ++ while (**argv) ++ if (*((*argv)++) == '/') ++ cmdname = *argv; /* find the command's basename */ + +- if (argc > 3) { ++ if (argc > 3) ++ { + INITERR("usage: ") + ADDERR(cmdname) + ADDERR(" [infile [outfile]]") + ERROR + } + +- if ((argc > 1) && strcmp(*++argv, "-")) { ++ if ((argc > 1) && strcmp(*++argv, "-")) ++ { + inname = *argv; +- if ((infile = open(inname, O_RDONLY)) == -1) { ++ if ((infile = open(inname, O_RDONLY)) == -1) ++ { + INITERR(inname) + ADDERR(": ") + ADDERR(ERR) +@@ -91,10 +78,11 @@ + } + } + +- if (argc > 2) { ++ if (argc > 2) ++ { + outname = *++argv; +- if ((outfile = open(outname, O_WRONLY | O_CREAT | +- O_TRUNC, 0644)) == -1) { ++ if ((outfile = open(outname, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) ++ { + INITERR(outname) + ADDERR(": ") + ADDERR(ERR) +@@ -103,7 +91,8 @@ + } + + (void) ReadBuf(); +- switch (compface(fbuf)) { ++ switch (compface(fbuf)) ++ { + case -2 : INITERR("internal error") + ERROR + case -1 : INITERR(inname) +@@ -123,13 +112,15 @@ + int + WriteBuf() + { +- char *s, *t; +- int len; ++ register char *s, *t; ++ register int len; + + s = fbuf; + t = s + strlen(s); +- while (s < t) { +- if ((len = write(outfile, s, t - s)) == -1) { ++ while (s < t) ++ { ++ if ((len = write(outfile, s, t - s)) == -1) ++ { + INITERR(outname) + ADDERR(": ") + ADDERR(ERR) +@@ -137,27 +128,30 @@ + } + s += len; + } +- return(0); ++ return 0; + } + + + int + ReadBuf() + { +- int count, len; +- char *t; ++ register int count, len; ++ register char *t; + + count = 0; + t = fbuf; +- while ((len = read(infile, t, FACEBUFLEN - count))) { +- if (len == -1) { ++ while (len = read(infile, t, FACEBUFLEN - count)) ++ { ++ if (len == -1) ++ { + INITERR(inname) + ADDERR(": ") + ADDERR(ERR) + ERROR + } + t += len; +- if ((count += len) >= FACEBUFLEN) { ++ if ((count += len) >= FACEBUFLEN) ++ { + INITWARN(inname) + ADDWARN(" exceeds internal buffer size. Data may be lost") + WARN +@@ -165,5 +159,5 @@ + } + } + *t = '\0'; +- return(count); ++ return count; + } diff --git a/mail/faces/files/patch-compface_compface.1 b/mail/faces/files/patch-compface_compface.1 index 9f2a15e6ea4d..e1f6b8abbd8c 100644 --- a/mail/faces/files/patch-compface_compface.1 +++ b/mail/faces/files/patch-compface_compface.1 @@ -1,17 +1,15 @@ -*** compface/compface.1 Tue Jan 15 23:58:46 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/compface.1 Sun Jan 19 19:35:35 2003 -*************** -*** 56,61 **** ---- 58,69 ---- - .I compface - averages less than 200 characters. - The average number of output lines is three. -+ .SH OPTIONS -+ .TP 12 -+ .B \-X -+ The same as -+ .I uncompface -+ | ikon2xbm. Usefull for exmh! - .SH DIAGNOSTICS - Exit status is normally 0. - Possible errors include IO errors when opening, reading or writing +--- compface/compface.1.orig ++++ compface/compface.1 +@@ -56,6 +56,12 @@ + .I compface + averages less than 200 characters. + The average number of output lines is three. ++.SH OPTIONS ++.TP 12 ++.B \-X ++The same as ++.I uncompface ++| ikon2xbm. Usefull for exmh! + .SH DIAGNOSTICS + Exit status is normally 0. + Possible errors include IO errors when opening, reading or writing diff --git a/mail/faces/files/patch-compface_compface.c b/mail/faces/files/patch-compface_compface.c index 177e6ed7d9db..ad5ce01e6f0f 100644 --- a/mail/faces/files/patch-compface_compface.c +++ b/mail/faces/files/patch-compface_compface.c @@ -1,40 +1,26 @@ -*** compface/compface.c Thu Feb 21 16:42:54 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/compface.c Wed Jun 19 08:29:12 1991 -*************** -*** 14,29 **** - * to me, then an attempt will be made to fix them. - */ - - #include "compface.h" -- #include "vars.h" - - int -! compface(char *fbuf) - { -! if (!(status = setjmp(comp_env))) { - ReadFace(fbuf); - GenFace(); - CompAll(fbuf); - } -! return(status); - } ---- 13,31 ---- - * to me, then an attempt will be made to fix them. - */ - -+ #define MAIN -+ - #include "compface.h" - - int -! compface(fbuf) -! char *fbuf; - { -! if (!(status = setjmp(comp_env))) -! { - ReadFace(fbuf); - GenFace(); - CompAll(fbuf); - } -! return status; - } +--- compface/compface.c.orig ++++ compface/compface.c +@@ -14,16 +14,19 @@ + * to me, then an attempt will be made to fix them. + */ + ++#define MAIN ++ + #include "compface.h" +-#include "vars.h" + + int +-compface(char *fbuf) ++compface(fbuf) ++char *fbuf; + { +- if (!(status = setjmp(comp_env))) { ++ if (!(status = setjmp(comp_env))) ++ { + ReadFace(fbuf); + GenFace(); + CompAll(fbuf); + } +- return(status); ++ return status; + } diff --git a/mail/faces/files/patch-compface_compface.h b/mail/faces/files/patch-compface_compface.h index 41db8268a5db..9867ee34b6e0 100644 --- a/mail/faces/files/patch-compface_compface.h +++ b/mail/faces/files/patch-compface_compface.h @@ -1,306 +1,233 @@ -*** compface/compface.h Thu Feb 21 16:42:54 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/compface.h Thu Sep 5 07:24:42 1991 -*************** -*** 14,45 **** - * to me, then an attempt will be made to fix them. - */ - - #include - #include - #include - -! /* Need to know how many bits per hexadecimal digit for io */ - #define BITSPERDIG 4 -! extern char HexDigits[]; - -! /* Define the face size - 48x48x1 */ - #define WIDTH 48 - #define HEIGHT WIDTH - -! /* Total number of pixels and digits */ - #define PIXELS (WIDTH * HEIGHT) - #define DIGITS (PIXELS / BITSPERDIG) - -! extern char F[PIXELS]; - -! /* Output formatting word lengths and line lengths */ - #define DIGSPERWORD 4 - #define WORDSPERLINE (WIDTH / DIGSPERWORD / BITSPERDIG) - -! /* Compressed output uses the full range of printable characters. - * in ascii these are in a contiguous block so we just need to know -! * the first and last. The total number of printables is needed too. -! */ - #define FIRSTPRINT '!' - #define LASTPRINT '~' - #define NUMPRINTS (LASTPRINT - FIRSTPRINT + 1) ---- 13,64 ---- - * to me, then an attempt will be made to fix them. - */ - -+ #if defined(SYSV32) || defined(hpux) - #include -+ #else -+ #include -+ #endif /* SYSV32 || hpux */ - #include - #include - -! /* For all function declarations, if ANSI then use a prototype. */ -! -! #if defined(__STDC__) -! #define P(args) args -! #else /* ! __STDC__ */ -! #define P(args) () -! #endif /* STDC */ -! -! #ifdef MAIN -! #define EXTERN -! #define INIT(x) = x -! #else -! #define EXTERN extern -! #define INIT(x) -! #endif -! -! /* need to know how many bits per hexadecimal digit for io */ - #define BITSPERDIG 4 -! EXTERN char HexDigits[] INIT("0123456789ABCDEF"); - -! /* define the face size - 48x48x1 */ - #define WIDTH 48 - #define HEIGHT WIDTH - -! /* total number of pixels and digits */ - #define PIXELS (WIDTH * HEIGHT) - #define DIGITS (PIXELS / BITSPERDIG) - -! /* internal face representation - 1 char per pixel is faster */ -! EXTERN char F[PIXELS]; - -! /* output formatting word lengths and line lengths */ - #define DIGSPERWORD 4 - #define WORDSPERLINE (WIDTH / DIGSPERWORD / BITSPERDIG) - -! /* compressed output uses the full range of printable characters. - * in ascii these are in a contiguous block so we just need to know -! * the first and last. The total number of printables is needed too */ - #define FIRSTPRINT '!' - #define LASTPRINT '~' - #define NUMPRINTS (LASTPRINT - FIRSTPRINT + 1) -*************** -*** 49,56 **** - - /* Portable, very large unsigned integer arithmetic is needed. - * Implementation uses arrays of WORDs. COMPs must have at least -! * twice as many bits as WORDs to handle intermediate results. -! */ - #define WORD unsigned char - #define COMP unsigned long - #define BITSPERWORD 8 ---- 68,74 ---- - - /* Portable, very large unsigned integer arithmetic is needed. - * Implementation uses arrays of WORDs. COMPs must have at least -! * twice as many bits as WORDs to handle intermediate results */ - #define WORD unsigned char - #define COMP unsigned long - #define BITSPERWORD 8 -*************** -*** 64,76 **** - WORD b_word[MAXWORDS]; - } BigInt; - -! extern BigInt B; - - /* This is the guess the next pixel table. Normally there are 12 neighbour - * pixels used to give 1<<12 cases but in the upper left corner lesser -! * numbers of neighbours are available, leading to 6231 different guesses. -! */ -! typedef struct guesses { - char g_00[1<<12]; - char g_01[1<<7]; - char g_02[1<<2]; ---- 82,94 ---- - WORD b_word[MAXWORDS]; - } BigInt; - -! EXTERN BigInt B; - - /* This is the guess the next pixel table. Normally there are 12 neighbour - * pixels used to give 1<<12 cases but in the upper left corner lesser -! * numbers of neighbours are available, leading to 6231 different guesses */ -! typedef struct guesses -! { - char g_00[1<<12]; - char g_01[1<<7]; - char g_02[1<<2]; -*************** -*** 88,155 **** - char g_42[1<<2]; - } Guesses; - -! extern Guesses G; - - /* Data of varying probabilities are encoded by a value in the range 0 - 255. - * The probability of the data determines the range of possible encodings. -! * Offset gives the first possible encoding of the range. -! */ -! typedef struct prob { - WORD p_range; - WORD p_offset; - } Prob; - -! extern Prob *ProbBuf[PIXELS * 2]; -! extern int NumProbs; - - /* Each face is encoded using 9 octrees of 16x16 each. Each level of the - * trees has varying probabilities of being white, grey or black. -! * The table below is based on sampling many faces. -! */ - - #define BLACK 0 - #define GREY 1 - #define WHITE 2 - -! extern Prob levels[4][3]; -! extern Prob freqs[16]; - - #define ERR_OK 0 /* successful completion */ - #define ERR_EXCESS 1 /* completed OK but some input was ignored */ - #define ERR_INSUFF -1 /* insufficient input. Bad face format? */ - #define ERR_INTERNAL -2 /* Arithmetic overflow or buffer overflow */ - -! extern int status; - -! extern jmp_buf comp_env; - -! int AllBlack(char *, int, int); -! int AllWhite(char *, int, int); -! int BigPop(Prob *); -! int compface(char *); -! int main(int, char *[]); -! int ReadBuf(); -! int Same(char *, int, int); -! int uncompface(char *); -! int WriteBuf(); -! -! void BigAdd(WORD); -! void BigClear(); -! void BigDiv(WORD, WORD *); -! void BigMul(WORD); -! void BigPrint(); -! void BigPush(Prob *); -! void BigRead(char *); -! void BigSub(WORD); -! void BigWrite(char *); -! void CompAll(char *); -! void Compress(char *, int, int, int); -! void GenFace(); -! void PopGreys(char *, int, int); -! void PushGreys(char *, int, int); -! void ReadFace(char *); -! void RevPush(Prob *); -! void UnCompAll(char *); -! void UnCompress(char *, int, int, int); -! void UnGenFace(); -! void WriteFace(char *); ---- 106,204 ---- - char g_42[1<<2]; - } Guesses; - -! /* data.h was established by sampling over 1000 faces and icons */ -! EXTERN Guesses G -! #ifdef MAIN -! = -! #include "data.h" -! #endif -! ; - - /* Data of varying probabilities are encoded by a value in the range 0 - 255. - * The probability of the data determines the range of possible encodings. -! * Offset gives the first possible encoding of the range */ -! typedef struct prob -! { - WORD p_range; - WORD p_offset; - } Prob; - -! /* A stack of probability values */ -! EXTERN Prob *ProbBuf[PIXELS * 2]; -! EXTERN int NumProbs INIT(0); - - /* Each face is encoded using 9 octrees of 16x16 each. Each level of the - * trees has varying probabilities of being white, grey or black. -! * The table below is based on sampling many faces */ - - #define BLACK 0 - #define GREY 1 - #define WHITE 2 - -! EXTERN Prob levels[4][3] -! #ifdef MAIN -! = -! { -! {{1, 255}, {251, 0}, {4, 251}}, /* Top of tree almost always grey */ -! {{1, 255}, {200, 0}, {55, 200}}, -! {{33, 223}, {159, 0}, {64, 159}}, -! {{131, 0}, {0, 0}, {125, 131}} /* Grey disallowed at bottom */ -! } -! #endif -! ; -! -! /* At the bottom of the octree 2x2 elements are considered black if any -! * pixel is black. The probabilities below give the distribution of the -! * 16 possible 2x2 patterns. All white is not really a possibility and -! * has a probability range of zero. Again, experimentally derived data */ -! EXTERN Prob freqs[16] -! #ifdef MAIN -! = -! { -! {0, 0}, {38, 0}, {38, 38}, {13, 152}, -! {38, 76}, {13, 165}, {13, 178}, {6, 230}, -! {38, 114}, {13, 191}, {13, 204}, {6, 236}, -! {13, 217}, {6, 242}, {5, 248}, {3, 253} -! } -! #endif -! ; - - #define ERR_OK 0 /* successful completion */ - #define ERR_EXCESS 1 /* completed OK but some input was ignored */ - #define ERR_INSUFF -1 /* insufficient input. Bad face format? */ - #define ERR_INTERNAL -2 /* Arithmetic overflow or buffer overflow */ - -! EXTERN int status; - -! EXTERN jmp_buf comp_env; - -! int AllBlack P((char *, int, int)) ; -! int AllWhite P((char *, int, int)) ; -! int BigPop P((Prob *)) ; -! int compface P((char *)) ; -! int main P((int, char *[])) ; -! int ReadBuf P(()) ; -! int Same P((char *, int, int)) ; -! int uncompface P((char *)) ; -! int WriteBuf P(()) ; -! -! void BigAdd P((unsigned char)) ; -! void BigClear P(()) ; -! void BigDiv P((unsigned char, unsigned char *)) ; -! void BigMul P((unsigned char)) ; -! void BigPrint P(()) ; -! void BigPush P((Prob *)) ; -! void BigRead P((char *)) ; -! void BigSub P((unsigned int)) ; -! void BigWrite P((char *)) ; -! void CompAll P((char *)) ; -! void Compress P((char *, int, int, int)) ; -! void GenFace P(()) ; -! void PopGreys P((char *, int, int)) ; -! void PushGreys P((char *, int, int)) ; -! void ReadFace P((char *)) ; -! void RevPush P((Prob *)) ; -! void UnCompAll P((char *)) ; -! void UnCompress P((char *, int, int, int)) ; -! void UnGenFace P(()) ; -! void WriteFace P((char *)) ; +--- compface/compface.h.orig ++++ compface/compface.h +@@ -14,32 +14,52 @@ + * to me, then an attempt will be made to fix them. + */ + ++#if defined(SYSV32) || defined(hpux) + #include ++#else ++#include ++#endif /* SYSV32 || hpux */ + #include + #include + +-/* Need to know how many bits per hexadecimal digit for io */ ++/* For all function declarations, if ANSI then use a prototype. */ ++ ++#if defined(__STDC__) ++#define P(args) args ++#else /* ! __STDC__ */ ++#define P(args) () ++#endif /* STDC */ ++ ++#ifdef MAIN ++#define EXTERN ++#define INIT(x) = x ++#else ++#define EXTERN extern ++#define INIT(x) ++#endif ++ ++/* need to know how many bits per hexadecimal digit for io */ + #define BITSPERDIG 4 +-extern char HexDigits[]; ++EXTERN char HexDigits[] INIT("0123456789ABCDEF"); + +-/* Define the face size - 48x48x1 */ ++/* define the face size - 48x48x1 */ + #define WIDTH 48 + #define HEIGHT WIDTH + +-/* Total number of pixels and digits */ ++/* total number of pixels and digits */ + #define PIXELS (WIDTH * HEIGHT) + #define DIGITS (PIXELS / BITSPERDIG) + +-extern char F[PIXELS]; ++/* internal face representation - 1 char per pixel is faster */ ++EXTERN char F[PIXELS]; + +-/* Output formatting word lengths and line lengths */ ++/* output formatting word lengths and line lengths */ + #define DIGSPERWORD 4 + #define WORDSPERLINE (WIDTH / DIGSPERWORD / BITSPERDIG) + +-/* Compressed output uses the full range of printable characters. ++/* compressed output uses the full range of printable characters. + * in ascii these are in a contiguous block so we just need to know +- * the first and last. The total number of printables is needed too. +- */ ++ * the first and last. The total number of printables is needed too */ + #define FIRSTPRINT '!' + #define LASTPRINT '~' + #define NUMPRINTS (LASTPRINT - FIRSTPRINT + 1) +@@ -49,8 +69,7 @@ + + /* Portable, very large unsigned integer arithmetic is needed. + * Implementation uses arrays of WORDs. COMPs must have at least +- * twice as many bits as WORDs to handle intermediate results. +- */ ++ * twice as many bits as WORDs to handle intermediate results */ + #define WORD unsigned char + #define COMP unsigned long + #define BITSPERWORD 8 +@@ -64,13 +83,13 @@ + WORD b_word[MAXWORDS]; + } BigInt; + +-extern BigInt B; ++EXTERN BigInt B; + + /* This is the guess the next pixel table. Normally there are 12 neighbour + * pixels used to give 1<<12 cases but in the upper left corner lesser +- * numbers of neighbours are available, leading to 6231 different guesses. +- */ +-typedef struct guesses { ++ * numbers of neighbours are available, leading to 6231 different guesses */ ++typedef struct guesses ++{ + char g_00[1<<12]; + char g_01[1<<7]; + char g_02[1<<2]; +@@ -88,68 +107,99 @@ + char g_42[1<<2]; + } Guesses; + +-extern Guesses G; ++/* data.h was established by sampling over 1000 faces and icons */ ++EXTERN Guesses G ++#ifdef MAIN ++= ++#include "data.h" ++#endif ++; + + /* Data of varying probabilities are encoded by a value in the range 0 - 255. + * The probability of the data determines the range of possible encodings. +- * Offset gives the first possible encoding of the range. +- */ +-typedef struct prob { ++ * Offset gives the first possible encoding of the range */ ++typedef struct prob ++{ + WORD p_range; + WORD p_offset; + } Prob; + +-extern Prob *ProbBuf[PIXELS * 2]; +-extern int NumProbs; ++/* A stack of probability values */ ++EXTERN Prob *ProbBuf[PIXELS * 2]; ++EXTERN int NumProbs INIT(0); + + /* Each face is encoded using 9 octrees of 16x16 each. Each level of the + * trees has varying probabilities of being white, grey or black. +- * The table below is based on sampling many faces. +- */ ++ * The table below is based on sampling many faces */ + + #define BLACK 0 + #define GREY 1 + #define WHITE 2 + +-extern Prob levels[4][3]; +-extern Prob freqs[16]; ++EXTERN Prob levels[4][3] ++#ifdef MAIN ++= ++{ ++ {{1, 255}, {251, 0}, {4, 251}}, /* Top of tree almost always grey */ ++ {{1, 255}, {200, 0}, {55, 200}}, ++ {{33, 223}, {159, 0}, {64, 159}}, ++ {{131, 0}, {0, 0}, {125, 131}} /* Grey disallowed at bottom */ ++} ++#endif ++; + ++/* At the bottom of the octree 2x2 elements are considered black if any ++ * pixel is black. The probabilities below give the distribution of the ++ * 16 possible 2x2 patterns. All white is not really a possibility and ++ * has a probability range of zero. Again, experimentally derived data */ ++EXTERN Prob freqs[16] ++#ifdef MAIN ++= ++{ ++ {0, 0}, {38, 0}, {38, 38}, {13, 152}, ++ {38, 76}, {13, 165}, {13, 178}, {6, 230}, ++ {38, 114}, {13, 191}, {13, 204}, {6, 236}, ++ {13, 217}, {6, 242}, {5, 248}, {3, 253} ++} ++#endif ++; ++ + #define ERR_OK 0 /* successful completion */ + #define ERR_EXCESS 1 /* completed OK but some input was ignored */ + #define ERR_INSUFF -1 /* insufficient input. Bad face format? */ + #define ERR_INTERNAL -2 /* Arithmetic overflow or buffer overflow */ + +-extern int status; ++EXTERN int status; + +-extern jmp_buf comp_env; ++EXTERN jmp_buf comp_env; + +-int AllBlack(char *, int, int); +-int AllWhite(char *, int, int); +-int BigPop(Prob *); +-int compface(char *); +-int main(int, char *[]); +-int ReadBuf(); +-int Same(char *, int, int); +-int uncompface(char *); +-int WriteBuf(); ++int AllBlack P((char *, int, int)) ; ++int AllWhite P((char *, int, int)) ; ++int BigPop P((Prob *)) ; ++int compface P((char *)) ; ++int main P((int, char *[])) ; ++int ReadBuf P(()) ; ++int Same P((char *, int, int)) ; ++int uncompface P((char *)) ; ++int WriteBuf P(()) ; + +-void BigAdd(WORD); +-void BigClear(); +-void BigDiv(WORD, WORD *); +-void BigMul(WORD); +-void BigPrint(); +-void BigPush(Prob *); +-void BigRead(char *); +-void BigSub(WORD); +-void BigWrite(char *); +-void CompAll(char *); +-void Compress(char *, int, int, int); +-void GenFace(); +-void PopGreys(char *, int, int); +-void PushGreys(char *, int, int); +-void ReadFace(char *); +-void RevPush(Prob *); +-void UnCompAll(char *); +-void UnCompress(char *, int, int, int); +-void UnGenFace(); +-void WriteFace(char *); ++void BigAdd P((unsigned char)) ; ++void BigClear P(()) ; ++void BigDiv P((unsigned char, unsigned char *)) ; ++void BigMul P((unsigned char)) ; ++void BigPrint P(()) ; ++void BigPush P((Prob *)) ; ++void BigRead P((char *)) ; ++void BigSub P((unsigned int)) ; ++void BigWrite P((char *)) ; ++void CompAll P((char *)) ; ++void Compress P((char *, int, int, int)) ; ++void GenFace P(()) ; ++void PopGreys P((char *, int, int)) ; ++void PushGreys P((char *, int, int)) ; ++void ReadFace P((char *)) ; ++void RevPush P((Prob *)) ; ++void UnCompAll P((char *)) ; ++void UnCompress P((char *, int, int, int)) ; ++void UnGenFace P(()) ; ++void WriteFace P((char *)) ; diff --git a/mail/faces/files/patch-compface_compress.c b/mail/faces/files/patch-compface_compress.c index 1b69b9560297..e1c297497f9a 100644 --- a/mail/faces/files/patch-compface_compress.c +++ b/mail/faces/files/patch-compface_compress.c @@ -1,314 +1,211 @@ -*** compface/compress.c Tue Jan 15 23:58:46 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/compress.c Wed Jun 19 08:29:13 1991 -*************** -*** 17,113 **** - #include "compface.h" - - int -! Same(char *f, int wid, int hei) - { -! char val, *row; -! int x; - - val = *f; -! while (hei--) { - row = f; - x = wid; -! while (x--) { -! if (*(row++) != val) { - return(0); -- } -- } - f += WIDTH; - } -! return(1); - } - -- - int -! AllBlack(char *f, int wid, int hei) - { -! if (wid > 3) { - wid /= 2; - hei /= 2; -! return(AllBlack(f, wid, hei) && AllBlack(f + wid, wid, hei) && - AllBlack(f + WIDTH * hei, wid, hei) && - AllBlack(f + WIDTH * hei + wid, wid, hei)); -- } else { -- return(*f || *(f + 1) || *(f + WIDTH) || *(f + WIDTH + 1)); - } - } - -- - int -! AllWhite(char *f, int wid, int hei) - { -! return((*f == 0) && Same(f, wid, hei)); - } - -- - void -! PopGreys(char *f, int wid, int hei) - { -! if (wid > 3) { - wid /= 2; - hei /= 2; - PopGreys(f, wid, hei); - PopGreys(f + wid, wid, hei); - PopGreys(f + WIDTH * hei, wid, hei); - PopGreys(f + WIDTH * hei + wid, wid, hei); -! } else { - wid = BigPop(freqs); -! if (wid & 1) { - *f = 1; -! } -! if (wid & 2) { - *(f + 1) = 1; -! } -! if (wid & 4) { - *(f + WIDTH) = 1; -! } -! if (wid & 8) { - *(f + WIDTH + 1) = 1; - } -- } - } - -- - void -! PushGreys(char *f, int wid, int hei) - { -! if (wid > 3) { - wid /= 2; - hei /= 2; - PushGreys(f, wid, hei); - PushGreys(f + wid, wid, hei); - PushGreys(f + WIDTH * hei, wid, hei); - PushGreys(f + WIDTH * hei + wid, wid, hei); -- } else { -- RevPush(freqs + *f + 2 * *(f + 1) + -- 4 * *(f + WIDTH) + 8 * *(f + WIDTH + 1)); - } - } - -- - void -! UnCompress(char *f, int wid, int hei, int lev) - { -! switch (BigPop(&levels[lev][0])) { - case WHITE : - return; - case BLACK : ---- 16,120 ---- - #include "compface.h" - - int -! Same(f, wid, hei) -! register char *f; -! register int wid, hei; - { -! register char val, *row; -! register int x; - - val = *f; -! while (hei--) -! { - row = f; - x = wid; -! while (x--) -! if (*(row++) != val) - return(0); - f += WIDTH; - } -! return 1; - } - - int -! AllBlack(f, wid, hei) -! char *f; -! int wid, hei; - { -! if (wid > 3) -! { - wid /= 2; - hei /= 2; -! return (AllBlack(f, wid, hei) && AllBlack(f + wid, wid, hei) && - AllBlack(f + WIDTH * hei, wid, hei) && - AllBlack(f + WIDTH * hei + wid, wid, hei)); - } -+ else -+ return (*f || *(f + 1) || *(f + WIDTH) || *(f + WIDTH + 1)); - } - - int -! AllWhite(f, wid, hei) -! char *f; -! int wid, hei; - { -! return ((*f == 0) && Same(f, wid, hei)); - } - - void -! PopGreys(f, wid, hei) -! char *f; -! int wid, hei; - { -! if (wid > 3) -! { - wid /= 2; - hei /= 2; - PopGreys(f, wid, hei); - PopGreys(f + wid, wid, hei); - PopGreys(f + WIDTH * hei, wid, hei); - PopGreys(f + WIDTH * hei + wid, wid, hei); -! } -! else -! { - wid = BigPop(freqs); -! if (wid & 1) - *f = 1; -! if (wid & 2) - *(f + 1) = 1; -! if (wid & 4) - *(f + WIDTH) = 1; -! if (wid & 8) - *(f + WIDTH + 1) = 1; - } - } - - void -! PushGreys(f, wid, hei) -! char *f; -! int wid, hei; - { -! if (wid > 3) -! { - wid /= 2; - hei /= 2; - PushGreys(f, wid, hei); - PushGreys(f + wid, wid, hei); - PushGreys(f + WIDTH * hei, wid, hei); - PushGreys(f + WIDTH * hei + wid, wid, hei); - } -+ else -+ RevPush(freqs + *f + 2 * *(f + 1) + 4 * *(f + WIDTH) + -+ 8 * *(f + WIDTH + 1)); - } - - void -! UnCompress(f, wid, hei, lev) -! register char *f; -! register int wid, hei, lev; - { -! switch (BigPop(&levels[lev][0])) -! { - case WHITE : - return; - case BLACK : -*************** -*** 125,139 **** - } - } - -- - void -! Compress(char *f, int wid, int hei, int lev) - { -! if (AllWhite(f, wid, hei)) { - RevPush(&levels[lev][WHITE]); - return; - } -! if (AllBlack(f, wid, hei)) { - RevPush(&levels[lev][BLACK]); - PushGreys(f, wid, hei); - return; ---- 132,149 ---- - } - } - - void -! Compress(f, wid, hei, lev) -! register char *f; -! register int wid, hei, lev; - { -! if (AllWhite(f, wid, hei)) -! { - RevPush(&levels[lev][WHITE]); - return; - } -! if (AllBlack(f, wid, hei)) -! { - RevPush(&levels[lev][BLACK]); - PushGreys(f, wid, hei); - return; -*************** -*** 149,164 **** - } - - void -! UnCompAll(char *fbuf) - { -! char *p; - - BigClear(); - BigRead(fbuf); - p = F; -! while (p < F + PIXELS) { - *(p++) = 0; -- } - UnCompress(F, 16, 16, 0); - UnCompress(F + 16, 16, 16, 0); - UnCompress(F + 32, 16, 16, 0); ---- 159,174 ---- - } - - void -! UnCompAll(fbuf) -! char *fbuf; - { -! register char *p; - - BigClear(); - BigRead(fbuf); - p = F; -! while (p < F + PIXELS) - *(p++) = 0; - UnCompress(F, 16, 16, 0); - UnCompress(F + 16, 16, 16, 0); - UnCompress(F + 32, 16, 16, 0); -*************** -*** 171,177 **** - } - - void -! CompAll(char *fbuf) - { - Compress(F, 16, 16, 0); - Compress(F + 16, 16, 16, 0); ---- 181,188 ---- - } - - void -! CompAll(fbuf) -! char *fbuf; - { - Compress(F, 16, 16, 0); - Compress(F + 16, 16, 16, 0); -*************** -*** 183,190 **** - Compress(F + WIDTH * 32 + 16, 16, 16, 0); - Compress(F + WIDTH * 32 + 32, 16, 16, 0); - BigClear(); -! while (NumProbs > 0) { - BigPush(ProbBuf[--NumProbs]); -- } - BigWrite(fbuf); - } ---- 194,200 ---- - Compress(F + WIDTH * 32 + 16, 16, 16, 0); - Compress(F + WIDTH * 32 + 32, 16, 16, 0); - BigClear(); -! while (NumProbs > 0) - BigPush(ProbBuf[--NumProbs]); - BigWrite(fbuf); - } +--- compface/compress.c.orig ++++ compface/compress.c +@@ -17,97 +17,105 @@ + #include "compface.h" + + int +-Same(char *f, int wid, int hei) ++Same(f, wid, hei) ++register char *f; ++register int wid, hei; + { +- char val, *row; +- int x; ++ register char val, *row; ++ register int x; + + val = *f; +- while (hei--) { ++ while (hei--) ++ { + row = f; + x = wid; +- while (x--) { +- if (*(row++) != val) { ++ while (x--) ++ if (*(row++) != val) + return(0); +- } +- } + f += WIDTH; + } +- return(1); ++ return 1; + } + +- + int +-AllBlack(char *f, int wid, int hei) ++AllBlack(f, wid, hei) ++char *f; ++int wid, hei; + { +- if (wid > 3) { ++ if (wid > 3) ++ { + wid /= 2; + hei /= 2; +- return(AllBlack(f, wid, hei) && AllBlack(f + wid, wid, hei) && ++ return (AllBlack(f, wid, hei) && AllBlack(f + wid, wid, hei) && + AllBlack(f + WIDTH * hei, wid, hei) && + AllBlack(f + WIDTH * hei + wid, wid, hei)); +- } else { +- return(*f || *(f + 1) || *(f + WIDTH) || *(f + WIDTH + 1)); + } ++ else ++ return (*f || *(f + 1) || *(f + WIDTH) || *(f + WIDTH + 1)); + } + +- + int +-AllWhite(char *f, int wid, int hei) ++AllWhite(f, wid, hei) ++char *f; ++int wid, hei; + { +- return((*f == 0) && Same(f, wid, hei)); ++ return ((*f == 0) && Same(f, wid, hei)); + } + +- + void +-PopGreys(char *f, int wid, int hei) ++PopGreys(f, wid, hei) ++char *f; ++int wid, hei; + { +- if (wid > 3) { ++ if (wid > 3) ++ { + wid /= 2; + hei /= 2; + PopGreys(f, wid, hei); + PopGreys(f + wid, wid, hei); + PopGreys(f + WIDTH * hei, wid, hei); + PopGreys(f + WIDTH * hei + wid, wid, hei); +- } else { ++ } ++ else ++ { + wid = BigPop(freqs); +- if (wid & 1) { ++ if (wid & 1) + *f = 1; +- } +- if (wid & 2) { ++ if (wid & 2) + *(f + 1) = 1; +- } +- if (wid & 4) { ++ if (wid & 4) + *(f + WIDTH) = 1; +- } +- if (wid & 8) { ++ if (wid & 8) + *(f + WIDTH + 1) = 1; + } +- } + } + +- + void +-PushGreys(char *f, int wid, int hei) ++PushGreys(f, wid, hei) ++char *f; ++int wid, hei; + { +- if (wid > 3) { ++ if (wid > 3) ++ { + wid /= 2; + hei /= 2; + PushGreys(f, wid, hei); + PushGreys(f + wid, wid, hei); + PushGreys(f + WIDTH * hei, wid, hei); + PushGreys(f + WIDTH * hei + wid, wid, hei); +- } else { +- RevPush(freqs + *f + 2 * *(f + 1) + +- 4 * *(f + WIDTH) + 8 * *(f + WIDTH + 1)); + } ++ else ++ RevPush(freqs + *f + 2 * *(f + 1) + 4 * *(f + WIDTH) + ++ 8 * *(f + WIDTH + 1)); + } + +- + void +-UnCompress(char *f, int wid, int hei, int lev) ++UnCompress(f, wid, hei, lev) ++register char *f; ++register int wid, hei, lev; + { +- switch (BigPop(&levels[lev][0])) { ++ switch (BigPop(&levels[lev][0])) ++ { + case WHITE : + return; + case BLACK : +@@ -125,15 +133,18 @@ + } + } + +- + void +-Compress(char *f, int wid, int hei, int lev) ++Compress(f, wid, hei, lev) ++register char *f; ++register int wid, hei, lev; + { +- if (AllWhite(f, wid, hei)) { ++ if (AllWhite(f, wid, hei)) ++ { + RevPush(&levels[lev][WHITE]); + return; + } +- if (AllBlack(f, wid, hei)) { ++ if (AllBlack(f, wid, hei)) ++ { + RevPush(&levels[lev][BLACK]); + PushGreys(f, wid, hei); + return; +@@ -149,16 +160,16 @@ + } + + void +-UnCompAll(char *fbuf) ++UnCompAll(fbuf) ++char *fbuf; + { +- char *p; ++ register char *p; + + BigClear(); + BigRead(fbuf); + p = F; +- while (p < F + PIXELS) { ++ while (p < F + PIXELS) + *(p++) = 0; +- } + UnCompress(F, 16, 16, 0); + UnCompress(F + 16, 16, 16, 0); + UnCompress(F + 32, 16, 16, 0); +@@ -171,7 +182,8 @@ + } + + void +-CompAll(char *fbuf) ++CompAll(fbuf) ++char *fbuf; + { + Compress(F, 16, 16, 0); + Compress(F + 16, 16, 16, 0); +@@ -183,8 +195,7 @@ + Compress(F + WIDTH * 32 + 16, 16, 16, 0); + Compress(F + WIDTH * 32 + 32, 16, 16, 0); + BigClear(); +- while (NumProbs > 0) { ++ while (NumProbs > 0) + BigPush(ProbBuf[--NumProbs]); +- } + BigWrite(fbuf); + } diff --git a/mail/faces/files/patch-compface_file.c b/mail/faces/files/patch-compface_file.c index 836f5a14a3ee..500b671a2860 100644 --- a/mail/faces/files/patch-compface_file.c +++ b/mail/faces/files/patch-compface_file.c @@ -1,314 +1,227 @@ -*** compface/file.c Tue Jan 15 23:58:46 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/file.c Sun Jan 19 19:35:35 2003 -*************** -*** 16,147 **** - - #include "compface.h" - - void -! BigRead(char *fbuf) - { -! int c; - -! while (*fbuf != '\0') { - c = *(fbuf++); -! if ((c < FIRSTPRINT) || (c > LASTPRINT)) { - continue; -- } - BigMul(NUMPRINTS); - BigAdd((WORD)(c - FIRSTPRINT)); - } - } - -- - void -! BigWrite(char *fbuf) - { - static WORD tmp; - static char buf[DIGITS]; -! char *s; -! int i; - - s = buf; -! while (B.b_words > 0) { - BigDiv(NUMPRINTS, &tmp); - *(s++) = tmp + FIRSTPRINT; - } -! i = 7; /* Leave room for the field name on the first line */ - *(fbuf++) = ' '; -! while (s-- > buf) { -! if (i == 0) { - *(fbuf++) = ' '; -- } - *(fbuf++) = *s; -! if (++i >= MAXLINELEN) { - *(fbuf++) = '\n'; - i = 0; - } - } -! if (i > 0) { - *(fbuf++) = '\n'; -- } - *(fbuf++) = '\0'; - } - -- - void -! ReadFace(char *fbuf) - { -! int c, i; -! char *s, *t; - - t = s = fbuf; -! for (i = strlen(s); i > 0; i--) { -! c = (int) *(s++); -! if ((c >= '0') && (c <= '9')) { -! if (t >= fbuf + DIGITS) { - status = ERR_EXCESS; - break; - } - *(t++) = c - '0'; -! } else if ((c >= 'A') && (c <= 'F')) { -! if (t >= fbuf + DIGITS) { - status = ERR_EXCESS; - break; - } - *(t++) = c - 'A' + 10; -! } else if ((c >= 'a') && (c <= 'f')) { -! if (t >= fbuf + DIGITS) { - status = ERR_EXCESS; - break; - } - *(t++) = c - 'a' + 10; -- } else if (((c == 'x') || (c == 'X')) && (t > fbuf) && (*(t-1) == 0)) { -- t--; - } - } -! if (t < fbuf + DIGITS) { - longjmp(comp_env, ERR_INSUFF); -- } - s = fbuf; - t = F; - c = 1 << (BITSPERDIG - 1); -! while (t < F + PIXELS) { - *(t++) = (*s & c) ? 1 : 0; -! if ((c >>= 1) == 0) { - s++; - c = 1 << (BITSPERDIG - 1); - } - } - } - -- - void -! WriteFace(char *fbuf) - { -! char *s, *t; -! int i, bits, digits, words; - - s = F; - t = fbuf; - bits = digits = words = i = 0; -! while (s < F + PIXELS) { -! if ((bits == 0) && (digits == 0)) { - *(t++) = '0'; - *(t++) = 'x'; - } -! if (*(s++)) { - i = i * 2 + 1; -! } else { - i *= 2; - } -! if (++bits == BITSPERDIG) { -! *(t++) = *(i + HexDigits); - bits = i = 0; -! if (++digits == DIGSPERWORD) { - *(t++) = ','; - digits = 0; -! if (++words == WORDSPERLINE) { - *(t++) = '\n'; - words = 0; - } - } - } - } - *(t++) = '\0'; - } ---- 15,191 ---- - - #include "compface.h" - -+ int xbitmap=0; -+ - void -! BigRead(fbuf) -! register char *fbuf; - { -! register int c; - -! while (*fbuf != '\0') -! { - c = *(fbuf++); -! if ((c < FIRSTPRINT) || (c > LASTPRINT)) - continue; - BigMul(NUMPRINTS); - BigAdd((WORD)(c - FIRSTPRINT)); - } - } - - void -! BigWrite(fbuf) -! register char *fbuf; - { - static WORD tmp; - static char buf[DIGITS]; -! register char *s; -! register int i; - - s = buf; -! while (B.b_words > 0) -! { - BigDiv(NUMPRINTS, &tmp); - *(s++) = tmp + FIRSTPRINT; - } -! i = 7; /* leave room for the field name on the first line */ - *(fbuf++) = ' '; -! while (s-- > buf) -! { -! if (i == 0) - *(fbuf++) = ' '; - *(fbuf++) = *s; -! if (++i >= MAXLINELEN) -! { - *(fbuf++) = '\n'; - i = 0; - } - } -! if (i > 0) - *(fbuf++) = '\n'; - *(fbuf++) = '\0'; - } - - void -! ReadFace(fbuf) -! char *fbuf; - { -! register int c, i; -! register char *s, *t; - - t = s = fbuf; -! for(i = strlen(s); i > 0; i--) -! { -! c = (int)*(s++); -! if ((c >= '0') && (c <= '9')) -! { -! if (t >= fbuf + DIGITS) -! { - status = ERR_EXCESS; - break; - } - *(t++) = c - '0'; -! } -! else if ((c >= 'A') && (c <= 'F')) -! { -! if (t >= fbuf + DIGITS) -! { - status = ERR_EXCESS; - break; - } - *(t++) = c - 'A' + 10; -! } -! else if ((c >= 'a') && (c <= 'f')) -! { -! if (t >= fbuf + DIGITS) -! { - status = ERR_EXCESS; - break; - } - *(t++) = c - 'a' + 10; - } -+ else if (((c == 'x') || (c == 'X')) && (t > fbuf) && (*(t-1) == 0)) -+ t--; - } -! if (t < fbuf + DIGITS) - longjmp(comp_env, ERR_INSUFF); - s = fbuf; - t = F; - c = 1 << (BITSPERDIG - 1); -! while (t < F + PIXELS) -! { - *(t++) = (*s & c) ? 1 : 0; -! if ((c >>= 1) == 0) -! { - s++; - c = 1 << (BITSPERDIG - 1); - } - } - } - - void -! WriteFace(fbuf) -! char *fbuf; - { -! register char *s, *t; -! register int i, bits, digits, words; -! extern int xbitmap; -! int digsperword = DIGSPERWORD; -! int wordsperline = WORDSPERLINE; - - s = F; - t = fbuf; - bits = digits = words = i = 0; -! if (xbitmap) { -! sprintf(t,"#define noname_width 48\n#define noname_height 48\nstatic char noname_bits[] = {\n "); -! while (*t) t++; -! digsperword = 2; -! wordsperline = 15; -! } -! while (s < F + PIXELS) -! { -! if ((bits == 0) && (digits == 0)) -! { - *(t++) = '0'; - *(t++) = 'x'; - } -! if (xbitmap) { -! if (*(s++)) -! i = (i >> 1) | 0x8; -! else -! i >>= 1; -! } -! else { -! if (*(s++)) - i = i * 2 + 1; -! else - i *= 2; - } -! if (++bits == BITSPERDIG) -! { -! if (xbitmap) { -! t++; -! t[-(digits & 1) * 2] = *(i + HexDigits); -! } -! else *(t++) = *(i + HexDigits); - bits = i = 0; -! if (++digits == digsperword) -! { -! if (xbitmap && (s >= F + PIXELS)) break; - *(t++) = ','; - digits = 0; -! if (++words == wordsperline) -! { - *(t++) = '\n'; -+ if (xbitmap) *(t++) = ' '; - words = 0; - } - } - } - } -+ if (xbitmap) { -+ sprintf(t, "}\n"); -+ while (*t) t++; -+ } - *(t++) = '\0'; - } +--- compface/file.c.orig ++++ compface/file.c +@@ -16,132 +16,177 @@ + + #include "compface.h" + ++int xbitmap=0; ++ + void +-BigRead(char *fbuf) ++BigRead(fbuf) ++register char *fbuf; + { +- int c; ++ register int c; + +- while (*fbuf != '\0') { ++ while (*fbuf != '\0') ++ { + c = *(fbuf++); +- if ((c < FIRSTPRINT) || (c > LASTPRINT)) { ++ if ((c < FIRSTPRINT) || (c > LASTPRINT)) + continue; +- } + BigMul(NUMPRINTS); + BigAdd((WORD)(c - FIRSTPRINT)); + } + } + +- + void +-BigWrite(char *fbuf) ++BigWrite(fbuf) ++register char *fbuf; + { + static WORD tmp; + static char buf[DIGITS]; +- char *s; +- int i; ++ register char *s; ++ register int i; + + s = buf; +- while (B.b_words > 0) { ++ while (B.b_words > 0) ++ { + BigDiv(NUMPRINTS, &tmp); + *(s++) = tmp + FIRSTPRINT; + } +- i = 7; /* Leave room for the field name on the first line */ ++ i = 7; /* leave room for the field name on the first line */ + *(fbuf++) = ' '; +- while (s-- > buf) { +- if (i == 0) { ++ while (s-- > buf) ++ { ++ if (i == 0) + *(fbuf++) = ' '; +- } + *(fbuf++) = *s; +- if (++i >= MAXLINELEN) { ++ if (++i >= MAXLINELEN) ++ { + *(fbuf++) = '\n'; + i = 0; + } + } +- if (i > 0) { ++ if (i > 0) + *(fbuf++) = '\n'; +- } + *(fbuf++) = '\0'; + } + +- + void +-ReadFace(char *fbuf) ++ReadFace(fbuf) ++char *fbuf; + { +- int c, i; +- char *s, *t; ++ register int c, i; ++ register char *s, *t; + + t = s = fbuf; +- for (i = strlen(s); i > 0; i--) { +- c = (int) *(s++); +- if ((c >= '0') && (c <= '9')) { +- if (t >= fbuf + DIGITS) { ++ for(i = strlen(s); i > 0; i--) ++ { ++ c = (int)*(s++); ++ if ((c >= '0') && (c <= '9')) ++ { ++ if (t >= fbuf + DIGITS) ++ { + status = ERR_EXCESS; + break; + } + *(t++) = c - '0'; +- } else if ((c >= 'A') && (c <= 'F')) { +- if (t >= fbuf + DIGITS) { ++ } ++ else if ((c >= 'A') && (c <= 'F')) ++ { ++ if (t >= fbuf + DIGITS) ++ { + status = ERR_EXCESS; + break; + } + *(t++) = c - 'A' + 10; +- } else if ((c >= 'a') && (c <= 'f')) { +- if (t >= fbuf + DIGITS) { ++ } ++ else if ((c >= 'a') && (c <= 'f')) ++ { ++ if (t >= fbuf + DIGITS) ++ { + status = ERR_EXCESS; + break; + } + *(t++) = c - 'a' + 10; +- } else if (((c == 'x') || (c == 'X')) && (t > fbuf) && (*(t-1) == 0)) { +- t--; + } ++ else if (((c == 'x') || (c == 'X')) && (t > fbuf) && (*(t-1) == 0)) ++ t--; + } +- if (t < fbuf + DIGITS) { ++ if (t < fbuf + DIGITS) + longjmp(comp_env, ERR_INSUFF); +- } + s = fbuf; + t = F; + c = 1 << (BITSPERDIG - 1); +- while (t < F + PIXELS) { ++ while (t < F + PIXELS) ++ { + *(t++) = (*s & c) ? 1 : 0; +- if ((c >>= 1) == 0) { ++ if ((c >>= 1) == 0) ++ { + s++; + c = 1 << (BITSPERDIG - 1); + } + } + } + +- + void +-WriteFace(char *fbuf) ++WriteFace(fbuf) ++char *fbuf; + { +- char *s, *t; +- int i, bits, digits, words; ++ register char *s, *t; ++ register int i, bits, digits, words; ++ extern int xbitmap; ++ int digsperword = DIGSPERWORD; ++ int wordsperline = WORDSPERLINE; + + s = F; + t = fbuf; + bits = digits = words = i = 0; +- while (s < F + PIXELS) { +- if ((bits == 0) && (digits == 0)) { ++ if (xbitmap) { ++ sprintf(t,"#define noname_width 48\n#define noname_height 48\nstatic char noname_bits[] = {\n "); ++ while (*t) t++; ++ digsperword = 2; ++ wordsperline = 15; ++ } ++ while (s < F + PIXELS) ++ { ++ if ((bits == 0) && (digits == 0)) ++ { + *(t++) = '0'; + *(t++) = 'x'; + } +- if (*(s++)) { ++ if (xbitmap) { ++ if (*(s++)) ++ i = (i >> 1) | 0x8; ++ else ++ i >>= 1; ++ } ++ else { ++ if (*(s++)) + i = i * 2 + 1; +- } else { ++ else + i *= 2; + } +- if (++bits == BITSPERDIG) { +- *(t++) = *(i + HexDigits); ++ if (++bits == BITSPERDIG) ++ { ++ if (xbitmap) { ++ t++; ++ t[-(digits & 1) * 2] = *(i + HexDigits); ++ } ++ else *(t++) = *(i + HexDigits); + bits = i = 0; +- if (++digits == DIGSPERWORD) { ++ if (++digits == digsperword) ++ { ++ if (xbitmap && (s >= F + PIXELS)) break; + *(t++) = ','; + digits = 0; +- if (++words == WORDSPERLINE) { ++ if (++words == wordsperline) ++ { + *(t++) = '\n'; ++ if (xbitmap) *(t++) = ' '; + words = 0; + } + } + } + } ++ if (xbitmap) { ++ sprintf(t, "}\n"); ++ while (*t) t++; ++ } + *(t++) = '\0'; + } diff --git a/mail/faces/files/patch-compface_gen.c b/mail/faces/files/patch-compface_gen.c index 9f1e78ef357c..40a5078a2ab6 100644 --- a/mail/faces/files/patch-compface_gen.c +++ b/mail/faces/files/patch-compface_gen.c @@ -1,186 +1,122 @@ -*** compface/gen.c Tue Jan 15 23:58:46 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/gen.c Wed Jun 19 08:29:13 1991 -*************** -*** 18,79 **** - - #define GEN(g) F[h] ^= G.g[k]; break - -! static void Gen(char *); - - static void -! Gen(char *f) - { -! int m, l, k, j, i, h; - -! for (j = 0; j < HEIGHT; j++) { -! for (i = 0; i < WIDTH; i++) { - h = i + j * WIDTH; - k = 0; -! for (l = i - 2; l <= i + 2; l++) { -! for (m = j - 2; m <= j; m++) { -! if ((l >= i) && (m == j)) { - continue; -! } -! if ((l > 0) && (l <= WIDTH) && (m > 0)) { - k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2; - } -! } -! } -! switch (i) { - case 1 : -! switch (j) { - case 1 : GEN(g_22); - case 2 : GEN(g_21); - default : GEN(g_20); - } - break; -- - case 2 : -! switch (j) { - case 1 : GEN(g_12); - case 2 : GEN(g_11); - default : GEN(g_10); - } - break; -- - case WIDTH - 1 : -! switch (j) { - case 1 : GEN(g_42); - case 2 : GEN(g_41); - default : GEN(g_40); - } - break; -- - case WIDTH : -! switch (j) { - case 1 : GEN(g_32); - case 2 : GEN(g_31); - default : GEN(g_30); - } - break; -- - default : -! switch (j) { - case 1 : GEN(g_02); - case 2 : GEN(g_01); - default : GEN(g_00); ---- 17,81 ---- - - #define GEN(g) F[h] ^= G.g[k]; break - -! static void Gen P((char *)) ; - - static void -! Gen(f) -! register char *f; - { -! register int m, l, k, j, i, h; - -! for (j = 0; j < HEIGHT; j++) -! { -! for (i = 0; i < WIDTH; i++) -! { - h = i + j * WIDTH; - k = 0; -! for (l = i - 2; l <= i + 2; l++) -! for (m = j - 2; m <= j; m++) -! { -! if ((l >= i) && (m == j)) - continue; -! if ((l > 0) && (l <= WIDTH) && (m > 0)) - k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2; - } -! switch (i) -! { - case 1 : -! switch (j) -! { - case 1 : GEN(g_22); - case 2 : GEN(g_21); - default : GEN(g_20); - } - break; - case 2 : -! switch (j) -! { - case 1 : GEN(g_12); - case 2 : GEN(g_11); - default : GEN(g_10); - } - break; - case WIDTH - 1 : -! switch (j) -! { - case 1 : GEN(g_42); - case 2 : GEN(g_41); - default : GEN(g_40); - } - break; - case WIDTH : -! switch (j) -! { - case 1 : GEN(g_32); - case 2 : GEN(g_31); - default : GEN(g_30); - } - break; - default : -! switch (j) -! { - case 1 : GEN(g_02); - case 2 : GEN(g_01); - default : GEN(g_00); -*************** -*** 84,109 **** - } - } - -- - void - GenFace() - { - static char new[PIXELS]; -! char *f1, *f2; -! int i; - - f1 = new; - f2 = F; - i = PIXELS; -! while (i-- > 0) { - *(f1++) = *(f2++); -- } - Gen(new); - } - -- - void - UnGenFace() - { - Gen(F); - } ---- 86,110 ---- - } - } - - void - GenFace() - { - static char new[PIXELS]; -! register char *f1; -! register char *f2; -! register int i; - - f1 = new; - f2 = F; - i = PIXELS; -! while (i-- > 0) - *(f1++) = *(f2++); - Gen(new); - } - - void - UnGenFace() - { - Gen(F); - } -+ +--- compface/gen.c.orig ++++ compface/gen.c +@@ -18,62 +18,65 @@ + + #define GEN(g) F[h] ^= G.g[k]; break + +-static void Gen(char *); ++static void Gen P((char *)) ; + + static void +-Gen(char *f) ++Gen(f) ++register char *f; + { +- int m, l, k, j, i, h; ++ register int m, l, k, j, i, h; + +- for (j = 0; j < HEIGHT; j++) { +- for (i = 0; i < WIDTH; i++) { ++ for (j = 0; j < HEIGHT; j++) ++ { ++ for (i = 0; i < WIDTH; i++) ++ { + h = i + j * WIDTH; + k = 0; +- for (l = i - 2; l <= i + 2; l++) { +- for (m = j - 2; m <= j; m++) { +- if ((l >= i) && (m == j)) { ++ for (l = i - 2; l <= i + 2; l++) ++ for (m = j - 2; m <= j; m++) ++ { ++ if ((l >= i) && (m == j)) + continue; +- } +- if ((l > 0) && (l <= WIDTH) && (m > 0)) { ++ if ((l > 0) && (l <= WIDTH) && (m > 0)) + k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2; + } +- } +- } +- switch (i) { ++ switch (i) ++ { + case 1 : +- switch (j) { ++ switch (j) ++ { + case 1 : GEN(g_22); + case 2 : GEN(g_21); + default : GEN(g_20); + } + break; +- + case 2 : +- switch (j) { ++ switch (j) ++ { + case 1 : GEN(g_12); + case 2 : GEN(g_11); + default : GEN(g_10); + } + break; +- + case WIDTH - 1 : +- switch (j) { ++ switch (j) ++ { + case 1 : GEN(g_42); + case 2 : GEN(g_41); + default : GEN(g_40); + } + break; +- + case WIDTH : +- switch (j) { ++ switch (j) ++ { + case 1 : GEN(g_32); + case 2 : GEN(g_31); + default : GEN(g_30); + } + break; +- + default : +- switch (j) { ++ switch (j) ++ { + case 1 : GEN(g_02); + case 2 : GEN(g_01); + default : GEN(g_00); +@@ -84,26 +87,25 @@ + } + } + +- + void + GenFace() + { + static char new[PIXELS]; +- char *f1, *f2; +- int i; ++ register char *f1; ++ register char *f2; ++ register int i; + + f1 = new; + f2 = F; + i = PIXELS; +- while (i-- > 0) { ++ while (i-- > 0) + *(f1++) = *(f2++); +- } + Gen(new); + } + +- + void + UnGenFace() + { + Gen(F); + } ++ diff --git a/mail/faces/files/patch-compface_uncmain.c b/mail/faces/files/patch-compface_uncmain.c index 8df10e250e0f..c71cab16fad7 100644 --- a/mail/faces/files/patch-compface_uncmain.c +++ b/mail/faces/files/patch-compface_uncmain.c @@ -1,296 +1,199 @@ -*** compface/uncmain.c Thu Feb 21 16:42:54 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/uncmain.c Sun Jan 19 19:35:35 2003 -*************** -*** 13,28 **** - * to me, then an attempt will be made to fix them. - */ - -- #include -- #include - #include - #include "compface.h" - -! #define STRCAT (void) strcat -! #define STRCPY (void) strcpy -! #define WRITE (void) write - -! /* The buffer is longer than needed to handle sparse input formats */ - #define FACEBUFLEN 2048 - char fbuf[FACEBUFLEN]; - ---- 15,26 ---- - * to me, then an attempt will be made to fix them. - */ - - #include - #include "compface.h" - -! extern int xbitmap; - -! /* the buffer is longer than needed to handle sparse input formats */ - #define FACEBUFLEN 2048 - char fbuf[FACEBUFLEN]; - -*************** -*** 32,87 **** - int outfile = 1; - char *outname = ""; - -! char *cmdname; /* Basename of executable */ - -! /* Error handling definitions follow */ - - extern int errno, sys_nerr; - extern char *sys_errlist[]; - - #define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "") -! #define INITERR(s) { \ -! STRCPY(fbuf, cmdname); \ -! STRCAT(fbuf, ": "); \ -! STRCAT(fbuf, (s));\ -! } -! #define ADDERR(s) STRCAT(fbuf, (s)); -! #define ERROR { \ -! STRCAT(fbuf, "\n"); \ -! WRITE(2, fbuf, strlen(fbuf)); \ -! exit(1); \ -! } -! #define INITWARN(s) { \ -! STRCPY(fbuf, cmdname); \ -! STRCAT(fbuf, ": (warning) "); \ -! STRCAT(fbuf, (s)); \ -! } -! #define ADDWARN(s) STRCAT(fbuf, (s)); -! #define WARN { \ -! STRCAT(fbuf, "\n"); \ -! WRITE(2, fbuf, strlen(fbuf)); \ -! } - - int -! main(int argc, char *argv[]) - { - cmdname = *argv; -! while (**argv) { -! if (*((*argv)++) == '/') { - cmdname = *argv; /* find the command's basename */ -! } - } - -! if (argc > 3) { - INITERR("usage: ") - ADDERR(cmdname) - ADDERR(" [infile [outfile]]") - ERROR - } - -! if ((argc > 1) && strcmp(*++argv, "-")) { - inname = *argv; -! if ((infile = open(inname, O_RDONLY)) == -1) { - INITERR(inname) - ADDERR(": ") - ADDERR(ERR) ---- 30,87 ---- - int outfile = 1; - char *outname = ""; - -! /* basename of executable */ -! char *cmdname; - -! /* error handling definitions follow */ - - extern int errno, sys_nerr; - extern char *sys_errlist[]; - -+ extern void exit P((int)) ; -+ - #define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "") -! #define INITERR(s) {(void)strcpy(fbuf, cmdname); (void)strcat(fbuf, ": ");\ -! (void)strcat(fbuf, (s));} -! #define ADDERR(s) (void)strcat(fbuf, (s)); -! #define ERROR {(void)strcat(fbuf, "\n");\ -! (void)write(2, fbuf, strlen(fbuf)); exit(1);} -! #define INITWARN(s) {(void)strcpy(fbuf, cmdname);\ -! (void)strcat(fbuf, ": (warning) ");\ -! (void)strcat(fbuf, (s));} -! #define ADDWARN(s) (void)strcat(fbuf, (s)); -! #define WARN {(void)strcat(fbuf, "\n"); (void)write(2, fbuf, strlen(fbuf));} - - int -! main(argc, argv) -! int argc; -! char *argv[]; - { - cmdname = *argv; -! while (**argv) -! if (*((*argv)++) == '/') - cmdname = *argv; /* find the command's basename */ -! -! if (argc > 1 && !strcmp(argv[1], "-X")) -! { -! xbitmap++; -! argc--; -! argv++; - } - -! if (argc > 3) -! { - INITERR("usage: ") - ADDERR(cmdname) - ADDERR(" [infile [outfile]]") - ERROR - } - -! if ((argc > 1) && strcmp(*++argv, "-")) -! { - inname = *argv; -! if ((infile = open(inname, O_RDONLY)) == -1) -! { - INITERR(inname) - ADDERR(": ") - ADDERR(ERR) -*************** -*** 89,98 **** - } - } - -! if (argc > 2) { - outname = *++argv; -! if ((outfile = open(outname, O_WRONLY | O_CREAT | -! O_TRUNC, 0644)) == -1) { - INITERR(outname) - ADDERR(": ") - ADDERR(ERR) ---- 89,99 ---- - } - } - -! if (argc > 2) -! { - outname = *++argv; -! if ((outfile = open(outname, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) -! { - INITERR(outname) - ADDERR(": ") - ADDERR(ERR) -*************** -*** 101,107 **** - } - - (void) ReadBuf(); -! switch (uncompface(fbuf)) { - case -2 : INITERR("internal error") - ERROR - case -1 : INITERR(inname) ---- 102,109 ---- - } - - (void) ReadBuf(); -! switch (uncompface(fbuf)) -! { - case -2 : INITERR("internal error") - ERROR - case -1 : INITERR(inname) -*************** -*** 121,133 **** - int - WriteBuf() - { -! char *s, *t; -! int len; - - s = fbuf; - t = s + strlen(s); -! while (s < t) { -! if ((len = write(outfile, s, t - s)) == -1) { - INITERR(outname) - ADDERR(": ") - ADDERR(ERR) ---- 123,137 ---- - int - WriteBuf() - { -! register char *s, *t; -! register int len; - - s = fbuf; - t = s + strlen(s); -! while (s < t) -! { -! if ((len = write(outfile, s, t - s)) == -1) -! { - INITERR(outname) - ADDERR(": ") - ADDERR(ERR) -*************** -*** 135,161 **** - } - s += len; - } -! return(0); - } - - - int - ReadBuf() - { -! int count, len; -! char *t; - - count = 0; - t = fbuf; -! while ((len = read(infile, t, FACEBUFLEN - count))) { -! if (len == -1) { - INITERR(inname) - ADDERR(": ") - ADDERR(ERR) - ERROR - } - t += len; -! if ((count += len) >= FACEBUFLEN) { - INITWARN(inname) - ADDWARN(" exceeds internal buffer size. Data may be lost") - WARN ---- 139,168 ---- - } - s += len; - } -! return 0; - } - - - int - ReadBuf() - { -! register int count, len; -! register char *t; - - count = 0; - t = fbuf; -! while (len = read(infile, t, FACEBUFLEN - count)) -! { -! if (len == -1) -! { - INITERR(inname) - ADDERR(": ") - ADDERR(ERR) - ERROR - } - t += len; -! if ((count += len) >= FACEBUFLEN) -! { - INITWARN(inname) - ADDWARN(" exceeds internal buffer size. Data may be lost") - WARN -*************** -*** 163,167 **** - } - } - *t = '\0'; -! return(count); - } ---- 170,174 ---- - } - } - *t = '\0'; -! return count; - } +--- compface/uncmain.c.orig ++++ compface/uncmain.c +@@ -13,16 +13,12 @@ + * to me, then an attempt will be made to fix them. + */ + +-#include +-#include + #include + #include "compface.h" + +-#define STRCAT (void) strcat +-#define STRCPY (void) strcpy +-#define WRITE (void) write ++extern int xbitmap; + +-/* The buffer is longer than needed to handle sparse input formats */ ++/* the buffer is longer than needed to handle sparse input formats */ + #define FACEBUFLEN 2048 + char fbuf[FACEBUFLEN]; + +@@ -32,56 +28,58 @@ + int outfile = 1; + char *outname = ""; + +-char *cmdname; /* Basename of executable */ ++/* basename of executable */ ++char *cmdname; + +-/* Error handling definitions follow */ ++/* error handling definitions follow */ + + extern int errno, sys_nerr; + extern char *sys_errlist[]; + ++extern void exit P((int)) ; ++ + #define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "") +-#define INITERR(s) { \ +- STRCPY(fbuf, cmdname); \ +- STRCAT(fbuf, ": "); \ +- STRCAT(fbuf, (s));\ +- } +-#define ADDERR(s) STRCAT(fbuf, (s)); +-#define ERROR { \ +- STRCAT(fbuf, "\n"); \ +- WRITE(2, fbuf, strlen(fbuf)); \ +- exit(1); \ +- } +-#define INITWARN(s) { \ +- STRCPY(fbuf, cmdname); \ +- STRCAT(fbuf, ": (warning) "); \ +- STRCAT(fbuf, (s)); \ +- } +-#define ADDWARN(s) STRCAT(fbuf, (s)); +-#define WARN { \ +- STRCAT(fbuf, "\n"); \ +- WRITE(2, fbuf, strlen(fbuf)); \ +- } ++#define INITERR(s) {(void)strcpy(fbuf, cmdname); (void)strcat(fbuf, ": ");\ ++ (void)strcat(fbuf, (s));} ++#define ADDERR(s) (void)strcat(fbuf, (s)); ++#define ERROR {(void)strcat(fbuf, "\n");\ ++ (void)write(2, fbuf, strlen(fbuf)); exit(1);} ++#define INITWARN(s) {(void)strcpy(fbuf, cmdname);\ ++ (void)strcat(fbuf, ": (warning) ");\ ++ (void)strcat(fbuf, (s));} ++#define ADDWARN(s) (void)strcat(fbuf, (s)); ++#define WARN {(void)strcat(fbuf, "\n"); (void)write(2, fbuf, strlen(fbuf));} + + int +-main(int argc, char *argv[]) ++main(argc, argv) ++int argc; ++char *argv[]; + { + cmdname = *argv; +- while (**argv) { +- if (*((*argv)++) == '/') { ++ while (**argv) ++ if (*((*argv)++) == '/') + cmdname = *argv; /* find the command's basename */ +- } ++ ++ if (argc > 1 && !strcmp(argv[1], "-X")) ++ { ++ xbitmap++; ++ argc--; ++ argv++; + } + +- if (argc > 3) { ++ if (argc > 3) ++ { + INITERR("usage: ") + ADDERR(cmdname) + ADDERR(" [infile [outfile]]") + ERROR + } + +- if ((argc > 1) && strcmp(*++argv, "-")) { ++ if ((argc > 1) && strcmp(*++argv, "-")) ++ { + inname = *argv; +- if ((infile = open(inname, O_RDONLY)) == -1) { ++ if ((infile = open(inname, O_RDONLY)) == -1) ++ { + INITERR(inname) + ADDERR(": ") + ADDERR(ERR) +@@ -89,10 +87,11 @@ + } + } + +- if (argc > 2) { ++ if (argc > 2) ++ { + outname = *++argv; +- if ((outfile = open(outname, O_WRONLY | O_CREAT | +- O_TRUNC, 0644)) == -1) { ++ if ((outfile = open(outname, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) ++ { + INITERR(outname) + ADDERR(": ") + ADDERR(ERR) +@@ -101,7 +100,8 @@ + } + + (void) ReadBuf(); +- switch (uncompface(fbuf)) { ++ switch (uncompface(fbuf)) ++ { + case -2 : INITERR("internal error") + ERROR + case -1 : INITERR(inname) +@@ -121,13 +121,15 @@ + int + WriteBuf() + { +- char *s, *t; +- int len; ++ register char *s, *t; ++ register int len; + + s = fbuf; + t = s + strlen(s); +- while (s < t) { +- if ((len = write(outfile, s, t - s)) == -1) { ++ while (s < t) ++ { ++ if ((len = write(outfile, s, t - s)) == -1) ++ { + INITERR(outname) + ADDERR(": ") + ADDERR(ERR) +@@ -135,27 +137,30 @@ + } + s += len; + } +- return(0); ++ return 0; + } + + + int + ReadBuf() + { +- int count, len; +- char *t; ++ register int count, len; ++ register char *t; + + count = 0; + t = fbuf; +- while ((len = read(infile, t, FACEBUFLEN - count))) { +- if (len == -1) { ++ while (len = read(infile, t, FACEBUFLEN - count)) ++ { ++ if (len == -1) ++ { + INITERR(inname) + ADDERR(": ") + ADDERR(ERR) + ERROR + } + t += len; +- if ((count += len) >= FACEBUFLEN) { ++ if ((count += len) >= FACEBUFLEN) ++ { + INITWARN(inname) + ADDWARN(" exceeds internal buffer size. Data may be lost") + WARN +@@ -163,5 +168,5 @@ + } + } + *t = '\0'; +- return(count); ++ return count; + } diff --git a/mail/faces/files/patch-compface_uncompface.c b/mail/faces/files/patch-compface_uncompface.c index 74d68d31bfc1..96e61279cb20 100644 --- a/mail/faces/files/patch-compface_uncompface.c +++ b/mail/faces/files/patch-compface_uncompface.c @@ -1,40 +1,27 @@ -*** compface/uncompface.c Thu Feb 21 16:42:54 2002 ---- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/uncompface.c Wed Jun 19 08:29:14 1991 -*************** -*** 14,29 **** - * to me, then an attempt will be made to fix them. - */ - - #include "compface.h" -- #include "vars.h" - - int -! uncompface(char *fbuf) - { -! if (!(status = setjmp(comp_env))) { -! UnCompAll(fbuf); /* compress otherwise */ - UnGenFace(); - WriteFace(fbuf); - } -! return(status); - } ---- 13,31 ---- - * to me, then an attempt will be made to fix them. - */ - -+ #define MAIN -+ - #include "compface.h" - - int -! uncompface(fbuf) -! char *fbuf; - { -! if (!(status = setjmp(comp_env))) -! { -! UnCompAll(fbuf);/* compress otherwise */ - UnGenFace(); - WriteFace(fbuf); - } -! return status; - } +--- compface/uncompface.c.orig ++++ compface/uncompface.c +@@ -14,16 +14,19 @@ + * to me, then an attempt will be made to fix them. + */ + ++#define MAIN ++ + #include "compface.h" +-#include "vars.h" + + int +-uncompface(char *fbuf) ++uncompface(fbuf) ++char *fbuf; + { +- if (!(status = setjmp(comp_env))) { +- UnCompAll(fbuf); /* compress otherwise */ ++ if (!(status = setjmp(comp_env))) ++ { ++ UnCompAll(fbuf);/* compress otherwise */ + UnGenFace(); + WriteFace(fbuf); + } +- return(status); ++ return status; + } diff --git a/mail/faces/files/patch-faces_Faces.ad b/mail/faces/files/patch-faces_Faces.ad index 2f32d2cee0de..e59271c222ed 100644 --- a/mail/faces/files/patch-faces_Faces.ad +++ b/mail/faces/files/patch-faces_Faces.ad @@ -1,17 +1,11 @@ -*** faces/Faces.ad.orig Tue Dec 18 05:11:31 2001 ---- faces/Faces.ad Sun Mar 17 21:14:05 2002 -*************** -*** 12,17 **** - faces.button1clear: false - faces.displayHostname: false - -! faces.audioSupport: false -! faces.audioCommand: play - faces.bellAudioFile: ---- 12,17 ---- - faces.button1clear: false - faces.displayHostname: false - -! faces.audioSupport: true -! faces.audioCommand: rplay - faces.bellAudioFile: +--- faces/Faces.ad.orig ++++ faces/Faces.ad +@@ -12,6 +12,6 @@ + faces.button1clear: false + faces.displayHostname: false + +-faces.audioSupport: false +-faces.audioCommand: play ++faces.audioSupport: true ++faces.audioCommand: rplay + faces.bellAudioFile: