--- src/metamail/common-h.in +++ src/metamail/common-h.in @@ -144,13 +144,13 @@ END_C_DECLS BEGIN_C_DECLS -extern char **environ, *gets(); +extern char **environ, *gets(char *); -extern char *getenv(); -extern char *index(); -extern char *rindex(); +extern char *getenv(const char *); +extern char *index(const char *, int); +extern char *rindex(const char *, int); -extern FILE *popen(); +extern FILE *popen (const char *, const char *); END_C_DECLS --- src/metamail/error.c +++ src/metamail/error.c @@ -15,19 +15,14 @@ static void error PARAMS((int exit_statu const char *message, va_list ap)); void -set_program_name (path) - const char *path; +set_program_name (const char *path) { METAMAIL_ASSERT (!program_name); program_name = (char*) xstrdup ( (char*) basename (path)); } static void -error (exit_status, mode, message, ap) - int exit_status; - const char *mode; - const char *message; - va_list ap; +error (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); --- src/metamail/xstrdup.c +++ src/metamail/xstrdup.c @@ -25,8 +25,7 @@ #include "common.h" char * -xstrdup (string) - const char *string; +xstrdup (const char *string) { return string ? strcpy (xmalloc (strlen (string) + 1), string) : NULL; } --- src/metamail/xstrerror.c +++ src/metamail/xstrerror.c @@ -9,7 +9,7 @@ #include "common.h" -extern char *strerror (); +extern char *strerror (int); /* If strerror returns NULL, we'll format the number into a static buffer. */ #define ERRSTR_FMT "undocumented error #%d" --- src/src/metamail/codes.c +++ src/src/metamail/codes.c @@ -14,7 +14,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE */ #include -extern char *index(); +extern char *index(const char *, int); static char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -47,9 +47,7 @@ static void output64chunk(int c1, int c2 /* the following gets a character, but fakes it properly into two chars if there's a newline character */ static int InNewline=0; -int nextcharin(infile, PortableNewlines) -FILE *infile; -int PortableNewlines; +int nextcharin(FILE *infile, int PortableNewlines) { int c; @@ -71,9 +69,7 @@ int PortableNewlines; } void -to64(infile, outfile, PortableNewlines) -FILE *infile, *outfile; -int PortableNewlines; +to64(FILE *infile, FILE *outfile, int PortableNewlines) { int c1, c2, c3, ct=0; InNewline = 0; /* always reset it */ @@ -100,9 +96,7 @@ int PortableNewlines; } void -output64chunk(c1, c2, c3, pads, outfile) -int c1, c2, c3, pads; -FILE *outfile; +output64chunk(int c1, int c2, int c3, int pads, FILE *outfile) { putc(basis_64[c1>>2], outfile); putc(basis_64[((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)], outfile); @@ -119,10 +113,7 @@ FILE *outfile; } int -PendingBoundary(s, Boundaries, BoundaryCt) -char *s; -char **Boundaries; -int *BoundaryCt; +PendingBoundary(char *s, char **Boundaries, int *BoundaryCt) { int i, len; @@ -146,10 +137,7 @@ static int CRpending = 0; #ifdef NEWLINE_CHAR void -almostputc(c, outfile, PortableNewlines) -int c; -FILE *outfile; -int PortableNewlines; +almostputc(int c, FILE *outfile, int PortableNewlines) { if (CRpending) { if (c == 10) { @@ -172,21 +160,14 @@ int PortableNewlines; } #else void -almostputc(c, outfile, PortableNewlines) -int c; -FILE *outfile; -int PortableNewlines; +almostputc(int c, FILE *outfile, int PortableNewlines) { putc(c, outfile); } #endif void -from64(infile, outfile, boundaries, boundaryct, PortableNewlines) -FILE *infile, *outfile; -char **boundaries; -int *boundaryct; -int PortableNewlines; +from64(FILE *infile, FILE *outfile, char **boundaries, int *boundaryct, int PortableNewlines) { int c1, c2, c3, c4; int newline = 1, DataDone = 0; @@ -286,8 +267,7 @@ char c; */ void -toqp(infile, outfile) -FILE *infile, *outfile; +toqp(FILE *infile, FILE *outfile) { int c, ct=0, prevc=255; while ((c = getc(infile)) != EOF) { @@ -362,10 +342,7 @@ FILE *infile, *outfile; } void -fromqp(infile, outfile, boundaries, boundaryct) -FILE *infile, *outfile; -char **boundaries; -int *boundaryct; +fromqp(FILE *infile, FILE *outfile, char **boundaries, int *boundaryct) { unsigned int c1, c2; int sawnewline = 1, neednewline = 0; --- src/src/metamail/environment.c +++ src/src/metamail/environment.c @@ -24,8 +24,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE @param auxpath path to add to $PATH (=auxiliary path) */ void -addToPath(auxpath) -char *auxpath; +addToPath(char *auxpath) { if (auxpath && *auxpath) { /* when pointer and auxpath[0] are != NULL */ static char *newpath = 0; /* is needed! since it becomes part ov ENV */ @@ -44,7 +43,7 @@ char *auxpath; this code is needed at several places -> own function */ void -initMailHeadersFromEnvironment() { +initMailHeadersFromEnvironment(void ) { mailheaders = getenv("MM_HEADERS"); if (mailheaders) { char *s; @@ -59,7 +58,7 @@ initMailHeadersFromEnvironment() { values if they are not found in the environment */ void -initVarsFromEnvironment() { +initVarsFromEnvironment(void) { char *QuietStr = NULL, *NoAskStr = NULL; /* temporary directory - where all temporary files are created */ --- src/src/metamail/mailcap.c +++ src/src/metamail/mailcap.c @@ -36,8 +36,7 @@ struct MailcapEntry BuiltInsAlternative[ /** hmm, ... */ int -ProcessMailcapFiles(SquirrelFile) -char *SquirrelFile; +ProcessMailcapFiles(char *SquirrelFile) { char *s, *pathcopy = NULL; char *path = getenv("MAILCAPS"); @@ -68,8 +67,7 @@ char *SquirrelFile; } int -TryBuiltIns(SquirrelFile) -char *SquirrelFile; +TryBuiltIns(char *SquirrelFile) { int i; /* Last resort -- for sites that didn't bother putting a "text" line in @@ -85,8 +83,7 @@ char *SquirrelFile; } int -ProcessMailcapFile(file, SquirrelFile) -char *file, *SquirrelFile; +ProcessMailcapFile(char *file, char *SquirrelFile) { struct MailcapEntry mc; FILE *fp; --- src/src/metamail/mailto.c +++ src/src/metamail/mailto.c @@ -44,8 +44,8 @@ STILL NEED TO DO/SUPPORT: #include "metamail.h" #include "metamail_default.h" -struct mailpart *CreateNewPart(); -char *getmyname(); /* Defined in shared.c */ +struct mailpart *CreateNewPart(void); +char *getmyname(void); /* Defined in shared.c */ /* The main data structure for the multiple parts of the mail */ @@ -138,7 +138,7 @@ int JustificationState = JUST_LEFT; void -EightBitCharHelp() { +EightBitCharHelp(void) { if (!CharacterSet || !strcmp(CharacterSet, "us-ascii")) { printf("There are no extended characters available for your US-ASCII terminal.\n\n"); printf("If you are actually using a terminal or terminal emulator with a richer\ncharacter set, you must use the '-a' option or the 'MM_CHARSET' environment\nvariable to inform this program of that fact.\n"); @@ -178,7 +178,7 @@ EightBitCharHelp() { } char * -tmpname() { +tmpname(void) { char *s = malloc(30); if (!s) nomemabort(); { @@ -259,7 +259,7 @@ TildeHelp(void) { } } -char *gethome() { +char *gethome(void) { struct passwd *p = getpwuid(getuid()); if (!p || !p->pw_dir) { perror("Cannot find your home directory, using /tmp"); @@ -324,7 +324,7 @@ FinalizeTerminal(void) { } struct mailpart * -NewPart() { +NewPart(void) { struct mailpart *p; p = (struct mailpart *) malloc(sizeof(struct mailpart)); if (!p) nomemabort(); @@ -346,8 +346,7 @@ nomemabort(void) { } char * -freshcopy(s) -char *s; +freshcopy(char *s) { char *t = malloc(1+strlen(s)); if (!t) nomemabort(); @@ -356,8 +355,7 @@ char *s; } char * -GetLineMalloced(prompt, def) -char *prompt, *def; +GetLineMalloced(char *prompt, char *def) { char Sbuf[1000], *ans; printf("%s: ", prompt); @@ -379,8 +377,7 @@ char *prompt, *def; } char * -EditString(prompt, s) -char *prompt, *s; +EditString(char *prompt, char *s) { char *ans; char NewPrompt[500]; @@ -393,8 +390,7 @@ char *prompt, *s; } char * -AddCommasToAddressList(s) -char *s; +AddCommasToAddressList(char *s) { int spaces = 0; char *t, *ans, *ansptr; @@ -426,9 +422,7 @@ char *s; } char * -AddToList(List, entry, definitelynew) -char *List, *entry; -int definitelynew; +AddToList(char *List, char *entry, int definitelynew) { int len; char *end = entry+strlen(entry); @@ -455,9 +449,7 @@ int definitelynew; } int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { char *sdum, *LineBuf, CmdBuf[100]; int i, EightBitMode = 0, RightToLeftMode = 0, AllDone=0, EightBitSeen=0, prevaddrdone=1; @@ -992,7 +984,7 @@ char **argv; cleanexit(0); /* Never returns */ } -char *newid() { +char *newid(void) { static char idbuf[100]; static int ctr=0; @@ -1002,10 +994,7 @@ char *newid() { } static void -WriteOutMessage(fp, ToList, Subject, CCList, FirstPart) -FILE *fp; -char *ToList, *Subject, *CCList; -struct mailpart *FirstPart; +WriteOutMessage(FILE *fp, char *ToList, char *Subject, char *CCList, struct mailpart *FirstPart) { FILE *fpin; static int ctr = 0; @@ -1071,9 +1060,7 @@ struct mailpart *FirstPart; } static void -WriteContentTypeAndEncoding(fp, part) -FILE *fp; -struct mailpart *part; +WriteContentTypeAndEncoding(FILE *fp, struct mailpart *part) { fprintf(fp, "Content-ID: %s\n", newid()); if (part->istext) { @@ -1112,10 +1099,7 @@ struct mailpart *part; } static int -TranslateInputToEncodedOutput(InputFP, OutputFP, Ecode, ctype) -FILE *InputFP, *OutputFP; -int Ecode; -char *ctype; +TranslateInputToEncodedOutput(FILE *InputFP, FILE *OutputFP, int Ecode, char *ctype) { int c, EightBitSeen = 0; @@ -1145,8 +1129,7 @@ static char *EnvStartStack[MAX_STACK_SIZ two parts of a multipart message */ static void -TempCloseStyles(fp) -FILE *fp; +TempCloseStyles(FILE *fp) { int i = StackSize; while(--i>=0) { @@ -1170,9 +1153,7 @@ RestoreCurrentStyles(void) { } static void -ReopenStyles(fp, part) -FILE *fp; -struct mailpart *part; +ReopenStyles(FILE *fp, struct mailpart *part) { int i=0; RestoreCurrentStyles(); @@ -1183,8 +1164,7 @@ struct mailpart *part; } static int -AlreadyInStyle(s) -char *s; +AlreadyInStyle(char *s) { int i; for (i=0; i", s); @@ -1211,9 +1188,7 @@ char *envstartstr; } static void -EndStyle(fp, s) -FILE *fp; -char *s; +EndStyle(FILE *fp, char *s) { int i = StackSize, j; while(--i>=0) { @@ -1236,11 +1211,7 @@ char *s; } static void -ToggleStyle(name, fp, part, turnonstr, turnoffstr) -char *name; -FILE *fp; -struct mailpart *part; -char *turnonstr, *turnoffstr; +ToggleStyle(char *name, FILE *fp, struct mailpart *part, char *turnonstr, char *turnoffstr) { part->isrich = 1; if (AlreadyInStyle(name)) { @@ -1256,11 +1227,7 @@ char *turnonstr, *turnoffstr; } static void -TryOpeningStyle(name, fp, part, envstartstr) -char *name; -FILE *fp; -struct mailpart *part; -char *envstartstr; +TryOpeningStyle(char *name, FILE *fp, struct mailpart *part, char *envstartstr) { if (AlreadyInStyle(name)) { printf("mailto: Already in %s style\n", name); @@ -1271,10 +1238,7 @@ char *envstartstr; } static void -TryClosingStyle(name, fp, part) -char *name; -FILE *fp; -struct mailpart *part; +TryClosingStyle(char *name, FILE *fp, struct mailpart *part) { if (AlreadyInStyle(name)) { part->isrich = 1; @@ -1285,11 +1249,7 @@ struct mailpart *part; } static void -FputsQuotingLT(s, fp, part, EightBitMode, RightToLeftMode) -char *s; -FILE *fp; -struct mailpart *part; -int EightBitMode, RightToLeftMode; +FputsQuotingLT(char *s, FILE *fp, struct mailpart *part, int EightBitMode, int RightToLeftMode) { static int InNewLineSequence=1; int c=0; @@ -1351,8 +1311,7 @@ int EightBitMode, RightToLeftMode; } static void -cleanexit(code) -int code; +cleanexit(int code) { finalize(); exit(code); @@ -1368,8 +1327,7 @@ finalize(void) { } void -cleanup(signum) -int signum; +cleanup(int signum) { if (fpout) { TempCloseStyles(fpout); @@ -1440,8 +1398,7 @@ struct MailtoMailcapEntry { /* There are a fair number of core leaks in what follows. That should matter little -- the mailcap files are only parsed once, and are usually pretty small anyway. */ char * -GetCommand(s, t) -char *s, **t; +GetCommand(char *s, char **t) { char *s2; int quoted = 0; @@ -1471,9 +1428,7 @@ char *s, **t; return(NULL); } -char *Cleanse(s, dolc) /* no leading or trailing space, all lower case */ -char *s; -int dolc; +char *Cleanse(char *s, int dolc) /* no leading or trailing space, all lower case */ { char *tmp, *news; @@ -1489,8 +1444,7 @@ int dolc; return(news); } -char *DeQuote(s) -char *s; +char *DeQuote(char *s) { char *retval; s = Cleanse(s, 0); @@ -1509,8 +1463,7 @@ char *s; } static struct MailtoMailcapEntry * -GetMailtoMailcapEntry(fp) -FILE *fp; +GetMailtoMailcapEntry(FILE *fp) { int rawentryalloc = MAX_LINELENGTH, len; char *rawentry, *s, *t, *LineBuf; @@ -1647,7 +1600,7 @@ static int MailtoProcessMailcapFiles(voi } struct mailpart * -CreateNewPart() { +CreateNewPart(void) { struct mailpart *mp; struct MailtoMailcapEntry *mc = FirstMailcapEntry; int i, ans, resultcode; @@ -1903,8 +1856,7 @@ CreateNewPart() { } static void -SetTextFlags(mp) -struct mailpart *mp; +SetTextFlags(struct mailpart *mp) { if (!lc2strncmp(mp->content_type, "text/", 5)) { mp->istext = 1; @@ -1915,8 +1867,7 @@ struct mailpart *mp; } static int -WhichEncodingForFile(fname, ctype) -char *fname, *ctype; +WhichEncodingForFile(char *fname, char *ctype) { int c, linesize=0, total=0, unsafechars=0, longlines=0; char *s; @@ -1952,8 +1903,7 @@ char *fname, *ctype; } static void -BuildCommand(Buf, controlstring, TmpFileName) -char *Buf, *controlstring, *TmpFileName; +BuildCommand(char *Buf, char *controlstring, char *TmpFileName) { char *from, *to; int prefixed = 0; @@ -1991,8 +1941,7 @@ char *Buf, *controlstring, *TmpFileName; } static int -CtypeMatch(ctype, pat) -char *ctype, *pat; +CtypeMatch(char *ctype, char *pat) { int len; char *s; @@ -2013,8 +1962,7 @@ char *ctype, *pat; } static void -EditCurrentMessage(UseVisual) -int UseVisual; +EditCurrentMessage(int UseVisual) { char *editor = NULL; char *CmdBuf, *CmdBuf2, LineBuf[100]; @@ -2120,11 +2068,7 @@ ProcessInitFiles(void) { } char * -NextAliasLine(LineBuf, LineAlloced, LineCount, fp, IsAndrew) -char *LineBuf; -int *LineAlloced, *LineCount; -FILE *fp; -int IsAndrew; +NextAliasLine(char *LineBuf, int *LineAlloced, int *LineCount, FILE *fp, int IsAndrew) { char *sbuf; sbuf = malloc(MAX_LINELENGTH); @@ -2156,9 +2100,7 @@ int IsAndrew; } static void -ProcessOneMailRC(fname, IsAndrew) -char *fname; -int IsAndrew; +ProcessOneMailRC(char *fname, int IsAndrew) { FILE *fp; char *LineBuf = NULL, *sdum; @@ -2191,9 +2133,7 @@ int IsAndrew; } static void -HandleSetCommand(cmd, DoSet) -char *cmd; -int DoSet; +HandleSetCommand(char *cmd, int DoSet) { char *s; int i; @@ -2236,8 +2176,7 @@ struct alias { } *FirstAlias = NULL; static void -HandleAliasCommand(aliasline) -char *aliasline; +HandleAliasCommand(char *aliasline) { struct alias *tmpalias; char *s, *s2; @@ -2266,10 +2205,7 @@ char *aliasline; } static void -EmitHeader(fp, hdr, body) -FILE *fp; -char *hdr; -char *body; +EmitHeader(FILE *fp, char *hdr, char *body) { fputs(hdr, fp); fputs(": ", fp); @@ -2279,8 +2215,7 @@ char *body; } char * -firstbad(s) -char *s; +firstbad(char *s) { char *dum; for (dum=s; *dum; ++dum) { @@ -2292,8 +2227,7 @@ char *s; } char * -firstgood(s) -char *s; +firstgood(char *s) { char *dum; for (dum=s; *dum; ++dum) { @@ -2305,10 +2239,7 @@ char *s; } static void -HeaderFputs(s, fp, hdr) -char *s; -FILE *fp; -char *hdr; +HeaderFputs(char *s, FILE *fp, char *hdr) { char *firstnonascii, *firstascii; @@ -2347,9 +2278,7 @@ char *hdr; static char basis_hex[] = "0123456789ABCDEF"; static void -PutQP(c, fp) -unsigned char c; -FILE *fp; +PutQP(unsigned char c, FILE *fp) { putc('=', fp); putc(basis_hex[c>>4], fp); @@ -2357,10 +2286,7 @@ FILE *fp; } static void -EmitHeaderWithAliases(fp, hdr, names) -FILE *fp; -char *hdr; -char *names; +EmitHeaderWithAliases(FILE *fp, char *hdr, char *names) { fputs(hdr, fp); fputs(": ", fp); @@ -2369,10 +2295,7 @@ char *names; } static void -EmitAddresses(fp, names, hdr) -FILE *fp; -char *names; -char *hdr; +EmitAddresses(FILE *fp, char *names, char *hdr) { char *s; while (names) { @@ -2388,10 +2311,7 @@ char *hdr; } static void -DeAlias(name, fp, hdr) -char *name; -FILE *fp; -char *hdr; +DeAlias(char *name, FILE *fp, char *hdr) { struct alias *tmpalias; char *end, savechar; @@ -2415,9 +2335,7 @@ char *hdr; static void -WriteCtypeNicely(fp, ct) -FILE *fp; -char *ct; +WriteCtypeNicely(FILE *fp, char *ct) { char *semi, *slash, *eq, *s; @@ -2451,9 +2369,7 @@ char *ct; } static void -fputsquoting(s, fp) -char *s; -FILE *fp; +fputsquoting(char *s, FILE *fp) { char *end = s + strlen(s) - 1; while (isspace((unsigned char) *end) && end > s) --end; @@ -2484,23 +2400,20 @@ FILE *fp; static int -controlputc(c) -char c; +controlputc(int c) { return fputc(c, stdout); } /* Do the equivalent of an fputs for the terminal escape stuff */ static void -tfputs(s) -const char *s; +tfputs(const char *s) { tputs(s, 1, controlputc); } static int -ContainsEightBitChar(fname) -char *fname; +ContainsEightBitChar(char *fname) { int c, eightBitSeen = 0; FILE *fp = fopen(fname, "r"); --- src/src/metamail/metamail.c +++ src/src/metamail/metamail.c @@ -36,7 +36,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE char fileToDelete[NAME_MAX]; -char *FindParam(); +char *FindParam(char *); FILE *InputFP = NULL; @@ -125,10 +125,9 @@ static void TranslateInputToOutput(FILE static void usage(void); static int WriteTmpFile(char *fname, char *ctype); -sigtype cleanup(); +sigtype cleanup(int); -char *Cleanse(s) /* no leading or trailing space, all lower case */ -char *s; +char *Cleanse(char *s) /* no leading or trailing space, all lower case */ { char *tmp, *news; @@ -145,8 +144,7 @@ char *s; return(news); } -char *UnquoteString(s) -char *s; +char *UnquoteString(char *s) { char *ans, *t; @@ -169,8 +167,7 @@ char *s; } sigtype -cleanup(signum) -int signum; +cleanup(int signum) { RestoreTtyState(); signal(signum, SIG_DFL); @@ -185,7 +182,7 @@ struct nextfile { } *FileQueue=NULL, *LastInQueue = NULL; void -ResetGlobals() { +ResetGlobals(void) { CParamsAlloced = 0; CParamsUsed = 0; @@ -204,7 +201,7 @@ ResetGlobals() { /** initializes signalhandlers to cleanup function */ void -initSignalHandlers() { +initSignalHandlers(void) { signal(SIGINT, cleanup); signal(SIGILL, cleanup); signal(SIGTRAP, cleanup); @@ -219,9 +216,7 @@ initSignalHandlers() { /** the main function for metamail */ int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { int retcode = 0; @@ -273,8 +268,7 @@ char **argv; } void -QueueNextFile(fname) -char *fname; +QueueNextFile(char *fname) { struct nextfile *tmp = XMALLOC( struct nextfile, 1); tmp->filename = fname; @@ -289,10 +283,8 @@ char *fname; } int -HandleMessage(SquirrelFile, nestingdepth) -char *SquirrelFile; +HandleMessage(char *SquirrelFile, int nestingdepth) /* SquirrelFile, if non-NULL, is a place to save a recognized body instead of executing it. */ -int nestingdepth; { char *boundary; int FileWriteOnly = JustWriteFiles; @@ -594,9 +586,7 @@ int nestingdepth; } int -ProcessArguments(argc, argv) -int argc; -char **argv; +ProcessArguments(int argc, char **argv) { int i; char *SourceFileName = NULL; @@ -786,9 +776,7 @@ usage(void) { } void -RunInNewWindow(argv, argc, SourceFileNamePtr) -char **argv, **SourceFileNamePtr; -int argc; +RunInNewWindow(char **argv, int argc, char **SourceFileNamePtr) { char *FullCmd, TmpName[TMPNAME_MAX]; int i, createdfile=0; @@ -861,8 +849,7 @@ static char *ThingsToSkip[] = { NULL }; -char *ShortCommand(progname) -char *progname; +char *ShortCommand(char *progname) { int i; char *s, *oldprogname; @@ -895,9 +882,7 @@ eatmore: } int -TryMailcapEntry(mc, SquirrelFile) -struct MailcapEntry mc; -char *SquirrelFile; +TryMailcapEntry(struct MailcapEntry mc, char *SquirrelFile) { StripTrailingSpace(mc.contenttype); if (DoDebug) fprintf(stderr, "Trying mailcap entry for '%s'.\n", mc.contenttype); @@ -919,8 +904,7 @@ char *SquirrelFile; } int -SaveSquirrelFile(SquirrelFile) -char *SquirrelFile; +SaveSquirrelFile(char *SquirrelFile) { int j; FILE *outfp; @@ -948,9 +932,7 @@ char *SquirrelFile; } int -ExecuteMailcapEntry(mc, TmpFileName, ThisContentType) -char *TmpFileName, *ThisContentType; -struct MailcapEntry mc; +ExecuteMailcapEntry(struct MailcapEntry mc, char *TmpFileName, char *ThisContentType) { int resultcode=0, DidExecute, UsedTmpFileName; struct part *PartsWritten=NULL; @@ -1088,8 +1070,7 @@ struct MailcapEntry mc; } int -PassesTest(mc) -struct MailcapEntry *mc; +PassesTest(struct MailcapEntry *mc) { int result; char *cmd, TmpFileName[TMPNAME_MAX]; @@ -1105,8 +1086,7 @@ struct MailcapEntry *mc; } char * -GetCommand(s, t) -char *s, **t; +GetCommand(char *s, char **t) { char *s2; int quoted = 0; @@ -1136,9 +1116,7 @@ char *s, **t; } int -GetMailcapEntry(fp, mc) -FILE *fp; -struct MailcapEntry *mc; +GetMailcapEntry(FILE *fp, struct MailcapEntry *mc) { int rawentryalloc = 2000, len; char *rawentry, *s, *t, *LineBuf; @@ -1226,16 +1204,14 @@ struct MailcapEntry *mc; } void -ExitWithError(txt) -char *txt; +ExitWithError(char *txt) { if (txt) fprintf(stderr, "metamail: %s\n", txt); exit(-1); } char * -FreshHeaderCopy(s) -char *s; +FreshHeaderCopy(char *s) { char *t, *newcopy; int len; @@ -1257,8 +1233,7 @@ char *s; } int -Read822Prefix(PrintHeads, nestingdepth) -int PrintHeads, nestingdepth; +Read822Prefix(int PrintHeads, int nestingdepth) { int SawNewline = 1, bytes = 0, alloced = 1000, HasEncodedChars=0; int c, oldbytes; @@ -1501,8 +1476,7 @@ SetUpEnvironment(void) { int -OKToRun(ctype, progname, label) -char *ctype, *progname, *label; +OKToRun(char *ctype, char *progname, char *label) { char AnsBuf[100], *s; @@ -1527,8 +1501,7 @@ char *ctype, *progname, *label; } void -EliminateNastyChars(s) -char *s; +EliminateNastyChars(char *s) { if (s) for( ; *s ;++s) { if (isalnum((unsigned char) *s)) continue; @@ -1542,8 +1515,7 @@ char *s; } void -StripTrailingSpace(s) -char *s; +StripTrailingSpace(char *s) { char *t = s+strlen(s) -1; while (isspace((unsigned char) *t) && (t >= s)) *t-- = 0; @@ -1553,7 +1525,7 @@ static char *KeyHeads=NULL; static char **KeyHeadList; static int KeyKeep = 0; -void setKeyHeads() +void setKeyHeads(void) { char *s; int numkeys = 0; @@ -1583,8 +1555,7 @@ void setKeyHeads() /* find the first colon in a header line which appears before any spaces or control characters */ char * -findcolon(hdr) -char *hdr; +findcolon(char *hdr) { while (*hdr && !isspace(*hdr) && !iscntrl(*hdr)) if (*hdr == ':') return hdr; @@ -1594,8 +1565,7 @@ char *hdr; /* check the header given to see if it matches any in the KeyHeadList */ void -maybephead(hdr) -char *hdr; +maybephead(char *hdr) { char *s; int numkeys=0; @@ -1629,8 +1599,7 @@ char *hdr; /* This next routine prints out a mail header, and needs to deal with the new extended charset headers. */ void -phead(s) -char *s; +phead(char *s) { char *t = s; @@ -1650,9 +1619,7 @@ char *s; static char PrevCharset[100] = "us-ascii"; /* This is the part that actually handles the charset issues */ -void PrintHeader(s, ShowLeadingWhitespace) -char *s; -int ShowLeadingWhitespace; +void PrintHeader(char *s, int ShowLeadingWhitespace) { char *charset, *encoding, *txt, *txtend, TmpFile[TMPNAME_MAX]; int ecode = ENCODING_NONE, CorrectedCharset = 0; @@ -1764,10 +1731,7 @@ int ShowLeadingWhitespace; } void -BuildCommand(Buf, controlstring, TmpFileName, UsedTmpFileName, PartsWritten) -char *Buf, *controlstring, *TmpFileName; -int *UsedTmpFileName; -struct part **PartsWritten; +BuildCommand(char *Buf, char *controlstring, char *TmpFileName, int *UsedTmpFileName, struct part **PartsWritten) { char *from, *to, *s, *p, *tmp; int prefixed = 0, UsedBigFile=0, UsedLittleFiles=0, numparts=0; @@ -1973,8 +1937,7 @@ struct part **PartsWritten; *to = 0; } -void strcpynoquotes(t,f) -char *t, *f; +void strcpynoquotes(char *t, char *f) { static char *badchars="|<>%*?\"`'"; @@ -1985,9 +1948,7 @@ char *t, *f; } int -WriteTmpFile(fname, ctype) -char *fname; -char *ctype; +WriteTmpFile(char *fname, char *ctype) { FILE *fpout; int retval = 0; @@ -2004,10 +1965,7 @@ char *ctype; } void -TranslateInputToOutput(InputFP, OutputFP, Ecode, ctype) -FILE *InputFP, *OutputFP; -int Ecode; -char *ctype; +TranslateInputToOutput(FILE *InputFP, FILE *OutputFP, int Ecode, char *ctype) { int InMultipart = BoundaryCt > 0 ? 1 : 0; @@ -2030,8 +1988,7 @@ char *ctype; } void -CreateNewWindowPrefix(Prefix) -char *Prefix; +CreateNewWindowPrefix(char *Prefix) { char *override = getenv("TERMINAL_CMD"); if (override) { @@ -2070,7 +2027,7 @@ SaveTtyState(void) { } void -RestoreTtyState() { +RestoreTtyState(void) { if (HasSavedTtyState) { tcsetattr(fileno(stdout), TCSANOW, &MyTtyStateOut); tcsetattr(fileno(stdin), TCSANOW, &MyTtyStateIn); @@ -2078,8 +2035,7 @@ RestoreTtyState() { } int -NeedToAskBeforeExecuting(type) -char *type; +NeedToAskBeforeExecuting(char *type) { struct NoAskItem *nai; if (!MightAskBeforeExecuting || DoInBackground) return(0); @@ -2090,8 +2046,7 @@ char *type; } int -NeedToBeQuiet(cmd) -char *cmd; +NeedToBeQuiet(char *cmd) { struct NoAskItem *nai; for (nai = FirstQuietItem; nai; nai = nai->next) { @@ -2101,8 +2056,7 @@ char *cmd; } int -CtypeMatch(ctype, pat) -char *ctype, *pat; +CtypeMatch(char *ctype, char *pat) { int len; char pat2[200]; @@ -2128,9 +2082,7 @@ char *ctype, *pat; } int -ExecuteCommand(cmd, really) -char *cmd; -int really; +ExecuteCommand(char *cmd, int really) { int code; if (!Quiet || DoDebug) { @@ -2151,8 +2103,7 @@ int really; } void -ConsumeRestOfPart(outfp) -FILE *outfp; +ConsumeRestOfPart(FILE *outfp) { char *Buf; int c; @@ -2176,8 +2127,7 @@ FILE *outfp; XFREE(Buf); } -char *paramend(s) -char *s; +char *paramend(char *s) { int inquotes=0; while (*s) { @@ -2198,9 +2148,7 @@ char *s; } void -ParseContentParameters(pc, ct) -int pc; -char *ct; +ParseContentParameters(int pc, char *ct) { char *s, *t, *eq; @@ -2241,8 +2189,7 @@ char *ct; } while (t); } -char *FindParam(s) -char *s; +char *FindParam(char *s) { int i; for (i=0; i 0) { @@ -83,8 +78,7 @@ int len; } int -lc2strcmp(s1, s2) -char *s1, *s2; +lc2strcmp(char *s1, char *s2) { if (!s1 || !s2) return (-1); while (*s1 && *s2) { @@ -94,7 +88,7 @@ char *s1, *s2; return((*s1 == *s2) ? 0 : -1); } -char *getmyname() { +char *getmyname(void) { static int initialized = 0; #ifdef SYSV static struct utsname u; --- src/src/metamail/splitmail.c +++ src/src/metamail/splitmail.c @@ -24,13 +24,13 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE #define MINCHUNKSIZE 20000 /* Better be enough to hold the headers, or we die! */ -extern char *getenv(); -extern char *getmyname(); +extern char *getenv(const char *); +extern char *getmyname(void); #define NORMALDELIVERYCMD "/usr/sbin/sendmail -t -oi" #define VERBOSEDELIVERYCMD "/usr/sbin/sendmail -t -v -oi" void -usageexit() { +usageexit(void) { fprintf(stderr, "Usage: splitmail [-d] [-v] [-s splitsize] [-i id-suffix] [-p prefix] [file-name]\n"); exit(-1); } @@ -54,8 +54,7 @@ static int ShareThisHeader(char *s, char static int ULstrcmp(register char *s1, register char *s2); char * -endofheader(s) -char *s; +endofheader(char *s) { char *orgs = s, c; while (1) { @@ -68,9 +67,7 @@ char *s; } int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { int i, DoDeliver=0, SplitSize=DEFAULT_SPLIT_SIZE, dum, InNewline=1, bytesread, whichpart=1, Verbose=0, numparts = -1, c; char *fname = NULL, *bigbuf, *s, *SharedHeaders, *headend, *from, id[100], *deliverycmd, *prefix, SubjectBuf[250]; @@ -228,9 +225,7 @@ char **argv; } static void -HandleOnePart(DoDeliver, deliverycmd, prefix, numparts, whichpart, SharedHeaders, SubjectBuf, id, MessageID, bigbuf, OrigID) -int DoDeliver, numparts, whichpart; -char *deliverycmd, *prefix, *SharedHeaders, *SubjectBuf, *id, *MessageID, *bigbuf, *OrigID; +HandleOnePart(int DoDeliver, char *deliverycmd, char *prefix, int numparts, int whichpart, char *SharedHeaders, char *SubjectBuf, char *id, char *MessageID, char *bigbuf, char *OrigID) { FILE *fpout; char OutputFile[1000]; @@ -310,11 +305,7 @@ static char *SharedHeads[] = { }; static int -ShareThisHeader(s, SubjectBuf, size, OrigID) -char *s; -char *SubjectBuf; -size_t size; -char **OrigID; +ShareThisHeader(char *s, char *SubjectBuf, size_t size, char **OrigID) { int i; char *colon = index(s, ':'); @@ -353,8 +344,7 @@ char **OrigID; static char *tspecials = "()<>@,;:\\\"/[]?.="; static int -IllegalContentType(ctype) -char *ctype; +IllegalContentType(char *ctype) { char *ct, *semicolon, *st, *s, *param, *eq, *matcheq; ct = malloc(1+strlen(ctype)); @@ -425,8 +415,7 @@ char *ctype; return(0); } -static int ULstrcmp(s1, s2) -register char *s1, *s2; +static int ULstrcmp(register char *s1, register char *s2) { char c1,c2; --- src/src/metamail/tmpfile.c +++ src/src/metamail/tmpfile.c @@ -8,8 +8,7 @@ DList TmpNameList = { NULL, NULL }; void -MkTmpFileName(name) - char *name; +MkTmpFileName(char *name) { int tmpfd = 0; @@ -43,8 +42,7 @@ MkTmpFileName(name) } void -AddTmpFileName(name) - char *name; +AddTmpFileName(char *name) { char *tmpname = NULL; if ( name ) { @@ -58,8 +56,7 @@ AddTmpFileName(name) } void -DelTmpFileName(name) - char *name; +DelTmpFileName(char *name) { DListEntry *help = NULL; @@ -72,8 +69,7 @@ DelTmpFileName(name) } void -RmTmpFileName(name) - char *name; +RmTmpFileName(char *name) { DListEntry* help = NULL; --- src/src/metamail/uue.c +++ src/src/metamail/uue.c @@ -7,10 +7,7 @@ */ void -uueget (ptr, outfp, n) -char *ptr; -FILE *outfp; -int n; +uueget (char *ptr, FILE *outfp, int n) { unsigned char c1, c2, c3; unsigned char p0, p1, p2, p3; @@ -33,10 +30,7 @@ int n; } int -uugetline (buf, size, fp) -char *buf; -int size; -FILE *fp; +uugetline (char *buf, int size, FILE *fp) { int c; char *ptr = buf; @@ -66,10 +60,7 @@ FILE *fp; void -fromuue (infp, outfp, boundaries, ctptr) -FILE *infp, *outfp; -char **boundaries; -int *ctptr; +fromuue (FILE *infp, FILE *outfp, char **boundaries, int *ctptr) { char buf[63]; --- src/src/richmail/iso2022.c +++ src/src/richmail/iso2022.c @@ -76,8 +76,7 @@ static int OutAsciiMode; /* * Initialise the ISO-2022 character set processor. */ -static void iso2022_init (name) -char *name; +static void iso2022_init (char *name) { SwToAscii = 'B'; SwToOther = 'B'; @@ -100,9 +99,7 @@ char *name; /* * Process a command for the ISO-2022 processor. */ -static int iso2022_command (token,negated) -char *token; -int negated; +static int iso2022_command (char *token, int negated) { int swchar; if (!strcmp(token,"iso-2022-jp")) { @@ -227,8 +224,7 @@ int negated; /* * Check for singleton ISO-2022 tokens. */ -static int iso2022_single (token) -char *token; +static int iso2022_single (char *token) { return (!strncmp (token,ISO_GENERIC_PREFIX,ISO_GENERIC_LEN) || !strncmp (token,ISO_SHIFT_PREFIX,ISO_SHIFT_LEN) || @@ -238,8 +234,7 @@ char *token; /* * Determine the width of a ISO-2022 character. */ -static int iso2022_width (ch) -RCHAR ch; +static int iso2022_width (RCHAR ch) { return (ch & 0xFF00 ? 2 : 1); } @@ -247,8 +242,7 @@ RCHAR ch; /* * Determine if the current character can be used as a folding point. */ -static int iso2022_fold (ch) -RCHAR ch; +static int iso2022_fold (RCHAR ch) { if (ch < 0x7F && isspace (ch)) { return (1); @@ -260,9 +254,7 @@ RCHAR ch; /* * Render the given ISO-2022 character. */ -static void iso2022_render (ch,param) -RCHAR ch; -void *param; +static void iso2022_render (RCHAR ch, void *param) { if (ch & 0xFF00) { if (OutCharLen < 2) { @@ -297,8 +289,7 @@ void *param; /* * Enter or leave the ISO-2022 encoding. */ -static void iso2022_encoding (newenc) -int newenc; +static void iso2022_encoding (int newenc) { switch (newenc) { case RICH_ENC_US_ASCII: controloutput("\033(B",0); break; @@ -328,9 +319,7 @@ struct charsetproc iso2022_charset = * Define an output routine for slotting into RichtextPutc so * that ISO-2022 escape sequences are treated correctly. */ -int iso2022_fputc (ch,file) -int ch; -FILE *file; +int iso2022_fputc (int ch, FILE *file) { if (OutPrevChar == ESC && ch == '(') { /* Process escape sequences that end JIS 2-byte modes */ --- src/src/richmail/richlex.c +++ src/src/richmail/richlex.c @@ -49,8 +49,8 @@ int CorrectionEnabled = 1; /* Zero if correction has been disabled */ int RichtextLessThanFlag = 0; /* Non-zero to turn on multi-byte '<' hack */ -int (*RichtextGetc) () = fgetc; /* Function to call to get characters */ -int (*RichtextPutc) () = fputc; /* Function to call to put characters */ +int (*RichtextGetc) (FILE *) = fgetc; /* Function to call to get characters */ +int (*RichtextPutc) (int, FILE *) = fputc; /* Function to call to put characters */ int RichtextCharEncoding = RICH_ENC_US_ASCII; /* Current encoding mode */ #define MAX_STACK_SIZE 500 @@ -100,7 +100,7 @@ static int PushbackExtract=0; /* * Reset the richtext parsing mechanism. */ -void richtextreset() +void richtextreset(void) { StackSize = 0; FlushStack = 0; @@ -118,8 +118,7 @@ void richtextreset() * Push a character into the push-back buffer for later * retrieval by RGET. */ -static void richtextpushback(c) -int c; +static void richtextpushback(int c) { PushbackBuffer[PushbackSize++] = c; } @@ -127,8 +126,7 @@ int c; /* * Unget a character that has been read from the input stream. */ -static void richtextunget(c) -int c; +static void richtextunget(int c) { if (PushbackSize) --PushbackExtract; /* Character was retrieved from push-back */ @@ -139,8 +137,7 @@ int c; /* * Unget two characters that have been read from the input stream. */ -static void richtextunget2(c1,c2) -int c1,c2; +static void richtextunget2(int c1, int c2) { if (PushbackExtract > 1) { PushbackExtract -= 2; /* Go back two characters in the push-back */ @@ -155,7 +152,7 @@ int c1,c2; /* * Retrieve a character from the push-back buffer. */ -static int richtextgetback() +static int richtextgetback(void) { int c; c = PushbackBuffer[PushbackExtract++]; @@ -171,7 +168,7 @@ static int richtextgetback() * Returns the number of elements down from the top it is. * i.e. 0 if not on the stack, 1 if at the top, etc. */ -static int richtextmatchup() +static int richtextmatchup(void) { int i = StackSize; while (i > 0 && i > (StackSize - MAX_FLUSH_SIZE)) { @@ -186,8 +183,7 @@ static int richtextmatchup() * Determine if the current token is one of the singleton * richtext commands: , , . */ -static int richtextsingle(TextEnriched) -int TextEnriched; +static int richtextsingle(int TextEnriched) { return (charsetsingle (NextToken) || (!TextEnriched && @@ -216,11 +212,8 @@ int TextEnriched; * so, for example, errors like "" don't cause * problems: it will be corrected to "hi kids". */ -RCHAR richtextlex(file,token,TextEnriched, nofill) -void *file; -char *token; -int TextEnriched; -int nofill; /* Inside a nofill env we parse newlines differently */ +RCHAR richtextlex(void *file, char *token, int TextEnriched, int nofill) +/* Inside a nofill env we parse newlines differently */ { int c,i,lastch; RCHAR cmd; @@ -411,9 +404,7 @@ int nofill; /* Inside a nofill env we pa /* * Output a string via "RichtextPutc". */ -void static richtextoutstr(str,outparam) -char *str; -void *outparam; +void static richtextoutstr(char *str, void *outparam) { while (*str) { RPUT(*str,outparam); @@ -425,9 +416,7 @@ void *outparam; * Read the input stream, correct the richtext, and write the * results to the output stream. */ -void richtextcorrect(inparam,outparam,TextEnriched) -void *inparam,*outparam; -int TextEnriched; +void richtextcorrect(void *inparam, void *outparam, int TextEnriched) { RCHAR c; char token[MAX_TOKEN_SIZE]; @@ -454,8 +443,7 @@ int TextEnriched; * Change the encoding used for characters not present in * richtext command sequences. */ -void richtextencoding(encoding) -int encoding; +void richtextencoding(int encoding) { RichtextCharEncoding = encoding; switch (RichtextCharEncoding) { --- src/src/richmail/richset.c +++ src/src/richmail/richset.c @@ -59,9 +59,7 @@ static int CharEncStack[MAX_CHAR_SETS]; * a particular base processor. The initialisation function of all * character set processors is called. */ -void charsetinit (charset,name) -struct charsetproc *charset; -char *name; +void charsetinit (struct charsetproc *charset, char *name) { int temp = 0; CharSets[0] = charset; @@ -77,8 +75,7 @@ char *name; * Initialise the stack, starting with a character set processor with * a particular name. */ -void charsetnameinit (name) -char *name; +void charsetnameinit (char *name) { int temp = 0; int succeed = 0; @@ -111,8 +108,7 @@ char *name; /* * Push a new character set processor onto the stack. */ -void charsetpush (charset) -struct charsetproc *charset; +void charsetpush (struct charsetproc *charset) { if (NumCharSets >= MAX_CHAR_SETS) { fprintf (stderr,"Too many nested character sets: aborting\n"); @@ -129,8 +125,7 @@ struct charsetproc *charset; * if it matches the given processor. Note: the base * processor is never popped off. */ -void charsetpop (charset) -struct charsetproc *charset; +void charsetpop (struct charsetproc *charset) { if (NumCharSets > 1 && CharSets[NumCharSets - 1] == charset) { --NumCharSets; @@ -143,8 +138,7 @@ struct charsetproc *charset; * See if the character set processor on the top of the stack * matches the given processor. */ -int charsettop (charset) -struct charsetproc *charset; +int charsettop (struct charsetproc *charset) { if (NumCharSets > 1) { return (CharSets[NumCharSets - 1] == charset); @@ -157,9 +151,7 @@ struct charsetproc *charset; * Set the details for a character set member in the top-most * character set. */ -void charmember (member,ch) -struct charsetmember *member; -RCHAR ch; +void charmember (struct charsetmember *member, RCHAR ch) { member -> ch = ch; member -> charset = CharSets[NumCharSets - 1]; @@ -168,10 +160,7 @@ RCHAR ch; /* * Set the details for a member of a specific character set. */ -void charmemberspec (member,ch,charset) -struct charsetmember *member; -RCHAR ch; -struct charsetproc *charset; +void charmemberspec (struct charsetmember *member, RCHAR ch, struct charsetproc *charset) { member -> ch = ch; member -> charset = charset; @@ -180,9 +169,7 @@ struct charsetproc *charset; /* * Set the details for a output control code character. */ -void charmemberctrl (member,ch) -struct charsetmember *member; -RCHAR ch; +void charmemberctrl (struct charsetmember *member, RCHAR ch) { member -> ch = ch; member -> charset = NULL; @@ -193,9 +180,7 @@ RCHAR ch; * "command" function of all character set processors. Returns * zero if the command was not processed. */ -int charsetcommand (token,negated) -char *token; -int negated; +int charsetcommand (char *token, int negated) { int temp = 0; while (CharacterSets[temp]) { @@ -209,8 +194,7 @@ int negated; /* * Test for an extension singleton command. */ -int charsetsingle (token) -char *token; +int charsetsingle (char *token) { int temp = 0; while (CharacterSets[temp]) { --- src/src/richmail/richtext.c +++ src/src/richmail/richtext.c @@ -21,7 +21,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE #include "richlex.h" #include "richset.h" -int iso2022_fputc (); +int iso2022_fputc (int, FILE *); /* * ######################################################################## @@ -79,7 +79,7 @@ int controlputc(int); #define OUTC(c) (outputc((RCHAR)(c))) static void -InitGlobals() +InitGlobals(void) { linepos = 0; inspace = 0; @@ -108,15 +108,14 @@ InitGlobals() } static void -cleanup(signum) -int signum; +cleanup(int signum) { FinalizeTerminal(); signal(signum, SIG_DFL); kill(getpid(), signum); } -static void InitSignals() { +static void InitSignals(void) { signal(SIGINT, cleanup); signal(SIGILL, cleanup); signal(SIGTRAP, cleanup); @@ -141,9 +140,7 @@ static void InitSignals() { */ int -main(argc, argv) -int argc; -char **argv; +main(int argc, char **argv) { exit(richtext_main(argc, argv)); } @@ -151,9 +148,7 @@ char **argv; #endif static int -richtext_main(argc, argv) -int argc; -char **argv; +richtext_main(int argc, char **argv) { RCHAR c; int i, atstart, negated, @@ -576,8 +571,7 @@ char **argv; static struct charsetmember OutputBuf[1000] = { { 0 }, { 0 } }; static int PendingOutput = 0, PendingControls = 0; -int controlputc(c) -int c; +int controlputc(int c) { charmemberctrl (&OutputBuf[PendingOutput],(RCHAR)c); ++PendingOutput; @@ -585,22 +579,17 @@ int c; return c; } -static int immediate_controlputc(c) -int c; +static int immediate_controlputc(int c) { return (*RichtextPutc) (c, stdout); } -void controloutput(s, immediate) -char *s; -int immediate; +void controloutput(char *s, int immediate) { tputs(s, 1, immediate ? immediate_controlputc : controlputc); } -static int folding_point (buf, pos) -struct charsetmember *buf; -int pos; +static int folding_point (struct charsetmember *buf, int pos) { int i; for (i = pos; i > 0; --i) { @@ -610,9 +599,7 @@ int pos; return (0); } -static int calc_column (buf, pos) -struct charsetmember *buf; -int pos; +static int calc_column (struct charsetmember *buf, int pos) { struct charsetmember *s; int col = 0; @@ -715,17 +702,14 @@ static void FlushOut(void) { StopUnderline, 0, BoldOn, BoldOff, 0); } -static void outputc(c) -RCHAR c; +static void outputc(RCHAR c) { struct charsetmember member; charmember (&member,c); realoutputc(member, 0); } -static void realoutputc(c, alreadyformatted) -struct charsetmember c; -int alreadyformatted; +static void realoutputc(struct charsetmember c, int alreadyformatted) { int newinspace; @@ -823,9 +807,7 @@ static void Pause(void) /* Leading spaces should be output as MoveRight, to avoid having margins that are underlined or reverse video */ -static void fputsmovingright(s, fp) -struct charsetmember *s; -FILE *fp; +static void fputsmovingright(struct charsetmember *s, FILE *fp) { int inmargin=1; if (!s) return; @@ -843,12 +825,9 @@ FILE *fp; } } -static void ResetTerminalCodes(FakeTerminal, highlight, underline, bold, highlightbuf, highlightendbuf, - modifiedhighlight, StartUnderline, StopUnderline, modifiedunderline, - BoldOn, BoldOff, modifiedbold) -int FakeTerminal, highlight, underline, bold, modifiedhighlight, modifiedunderline, modifiedbold; -char *highlightbuf, *highlightendbuf, *StartUnderline, *StopUnderline, - *BoldOn, *BoldOff; +static void ResetTerminalCodes(int FakeTerminal, int highlight, int underline, int bold, char *highlightbuf, char *highlightendbuf, + int modifiedhighlight, char *StartUnderline, char *StopUnderline, int modifiedunderline, + char *BoldOn, char *BoldOff, int modifiedbold) { if (OverStrike) return; @@ -879,21 +858,17 @@ static void FinalizeTerminal(void) { FPUTS((unsigned char *)KE, stdout); } -static void outputstr(s) -char *s; +static void outputstr(char *s) { while (*s) OUTC(*s++); } -static void FPUTS(s,fp) -unsigned char *s; -FILE *fp; +static void FPUTS(unsigned char *s, FILE *fp) { while(*s) (*RichtextPutc)((int)(*s++),fp); } -static int lc2strcmp(s1, s2) -char *s1, *s2; +static int lc2strcmp(char *s1, char *s2) { if (!s1 || !s2) return (-1); while (*s1 && *s2) { --- src/src/richmail/richtoatk.c +++ src/src/richmail/richtoatk.c @@ -18,8 +18,7 @@ WITHOUT ANY EXPRESS OR IMPLIED WARRANTIE static int ignoretoken(char *t); -static char *translate(t) -char *t; +static char *translate(char *t) { if (!strcmp(t, "fixed")) return("typewriter"); if (!strcmp(t, "excerpt")) return("quotation"); @@ -79,8 +78,7 @@ int main(int argc, char **argv) { exit(0); } -static int ignoretoken(t) -char *t; +static int ignoretoken(char *t) { if (*t == '/') ++t; if (!strcmp(t, "us-ascii")) return(1); @@ -89,13 +87,10 @@ char *t; return(0); } -void controlputc(c) -int c; +void controlputc(int c) { } -void controloutput(s, immediate) -char *s; -int immediate; +void controloutput(char *s, int immediate) { } --- src/src/richmail/usascii.c +++ src/src/richmail/usascii.c @@ -42,8 +42,7 @@ /* * Initialise the US-ASCII character set processor. */ -static void usascii_init (name) -char *name; +static void usascii_init (char *name) { if (name) richtextencoding (RICH_ENC_US_ASCII); @@ -52,9 +51,7 @@ char *name; /* * Process a command for the US-ASCII processor. */ -static int usascii_command (token,negated) -char *token; -int negated; +static int usascii_command (char *token, int negated) { if (!strcmp(token,"us-ascii")) { if (negated) { @@ -72,8 +69,7 @@ int negated; /* * Check for singleton US-ASCII tokens. */ -static int usascii_single (token) -char *token; +static int usascii_single (char *token) { return (0); } @@ -81,8 +77,7 @@ char *token; /* * Determine the width of a US-ASCII character. */ -static int usascii_width (ch) -RCHAR ch; +static int usascii_width (RCHAR ch) { return (1); } @@ -90,8 +85,7 @@ RCHAR ch; /* * Determine if the current character can be used as a folding point. */ -static int usascii_fold (ch) -RCHAR ch; +static int usascii_fold (RCHAR ch) { return (ch < 0x7F && isspace (ch)); } @@ -99,9 +93,7 @@ RCHAR ch; /* * Render the given US-ASCII character. */ -static void usascii_render (ch, param) -RCHAR ch; -void *param; +static void usascii_render (RCHAR ch, void *param) { (*RichtextPutc) ((int)ch,param); } @@ -109,8 +101,7 @@ void *param; /* * Enter or leave the US-ASCII encoding. */ -static void usascii_encoding (newenc) -int newenc; +static void usascii_encoding (int newenc) { /* Nothing to be done in this version */ }