Remove #ifndef'd __STDC__ code. ANSIfy.
This commit is contained in:
parent
774f88b197
commit
eaf8f8a4e5
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: error.h,v 1.6 2001/02/05 01:44:07 christos Exp $ */
|
||||
/* $NetBSD: error.h,v 1.7 2002/05/26 22:41:20 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -117,7 +117,7 @@ extern char *scriptname;
|
||||
|
||||
extern boolean query;
|
||||
extern boolean terse;
|
||||
int inquire __P((char *, ...)); /* inquire for yes/no */
|
||||
int inquire(char *, ...); /* inquire for yes/no */
|
||||
/*
|
||||
* codes for inquire() to return
|
||||
*/
|
||||
@ -126,7 +126,7 @@ int inquire __P((char *, ...)); /* inquire for yes/no */
|
||||
#define Q_YES 3 /* 'Y' */
|
||||
#define Q_yes 4 /* 'y' */
|
||||
|
||||
int probethisfile __P((char *));
|
||||
int probethisfile(char *);
|
||||
/*
|
||||
* codes for probethisfile to return
|
||||
*/
|
||||
@ -210,44 +210,44 @@ extern char *currentfilename;
|
||||
/*
|
||||
* Functional forwards
|
||||
*/
|
||||
void arrayify __P((int *, Eptr **, Eptr));
|
||||
char *Calloc __P((int, int));
|
||||
void clob_last __P((char *, char));
|
||||
int countfiles __P((Eptr *));
|
||||
Errorclass discardit __P((Eptr));
|
||||
void diverterrors __P((char *, int, Eptr **, int, boolean, int));
|
||||
void eaterrors __P((int *, Eptr **));
|
||||
boolean edit __P((char *));
|
||||
void erroradd __P((int, char **, Errorclass, Errorclass));
|
||||
void errorprint __P((FILE *, Eptr, boolean));
|
||||
void execvarg __P((int, int *, char ***));
|
||||
void filenames __P((int, Eptr **));
|
||||
void findfiles __P((int, Eptr *, int *, Eptr ***));
|
||||
char firstchar __P((char *));
|
||||
void getignored __P((char *));
|
||||
void hackfile __P((char *, Eptr **, int, int));
|
||||
void insert __P((int));
|
||||
char lastchar __P((char *));
|
||||
int mustoverwrite __P((FILE *, FILE *));
|
||||
int mustwrite __P((char *, int, FILE *));
|
||||
char next_lastchar __P((char *));
|
||||
int nopertain __P((Eptr **));
|
||||
int oktotouch __P((char *));
|
||||
void onintr __P((int));
|
||||
boolean persperdexplode __P((char *, char **, char **));
|
||||
int position __P((char *, char));
|
||||
boolean preview __P((char *, int, Eptr **, int));
|
||||
void printerrors __P((boolean, int, Eptr []));
|
||||
char *plural __P((int));
|
||||
boolean qpersperdexplode __P((char *, char **, char **));
|
||||
int settotouch __P((char *));
|
||||
char *strsave __P((char *));
|
||||
char *substitute __P((char *, char, char));
|
||||
void text __P((Eptr, boolean));
|
||||
boolean touchfiles __P((int, Eptr **, int *, char ***));
|
||||
char *verbform __P((int));
|
||||
void wordvbuild __P((char *, int*, char ***));
|
||||
int wordvcmp __P((char **, int, char **));
|
||||
void wordvprint __P((FILE *, int, char **));
|
||||
char **wordvsplice __P((int, int, char **));
|
||||
boolean writetouched __P((int));
|
||||
void arrayify(int *, Eptr **, Eptr);
|
||||
char *Calloc(int, int);
|
||||
void clob_last(char *, char);
|
||||
int countfiles(Eptr *);
|
||||
Errorclass discardit(Eptr);
|
||||
void diverterrors(char *, int, Eptr **, int, boolean, int);
|
||||
void eaterrors(int *, Eptr **);
|
||||
boolean edit(char *);
|
||||
void erroradd(int, char **, Errorclass, Errorclass);
|
||||
void errorprint(FILE *, Eptr, boolean);
|
||||
void execvarg(int, int *, char ***);
|
||||
void filenames(int, Eptr **);
|
||||
void findfiles(int, Eptr *, int *, Eptr ***);
|
||||
char firstchar(char *);
|
||||
void getignored(char *);
|
||||
void hackfile(char *, Eptr **, int, int);
|
||||
void insert(int);
|
||||
char lastchar(char *);
|
||||
int mustoverwrite(FILE *, FILE *);
|
||||
int mustwrite(char *, int, FILE *);
|
||||
char next_lastchar(char *);
|
||||
int nopertain(Eptr **);
|
||||
int oktotouch(char *);
|
||||
void onintr(int);
|
||||
boolean persperdexplode(char *, char **, char **);
|
||||
int position(char *, char);
|
||||
boolean preview(char *, int, Eptr **, int);
|
||||
void printerrors(boolean, int, Eptr []);
|
||||
char *plural(int);
|
||||
boolean qpersperdexplode(char *, char **, char **);
|
||||
int settotouch(char *);
|
||||
char *strsave(char *);
|
||||
char *substitute(char *, char, char);
|
||||
void text(Eptr, boolean);
|
||||
boolean touchfiles(int, Eptr **, int *, char ***);
|
||||
char *verbform(int);
|
||||
void wordvbuild(char *, int*, char ***);
|
||||
int wordvcmp(char **, int, char **);
|
||||
void wordvprint(FILE *, int, char **);
|
||||
char **wordvsplice(int, int, char **);
|
||||
boolean writetouched(int);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: filter.c,v 1.7 2001/02/05 01:44:07 christos Exp $ */
|
||||
/* $NetBSD: filter.c,v 1.8 2002/05/26 22:41:20 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)filter.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: filter.c,v 1.7 2001/02/05 01:44:07 christos Exp $");
|
||||
__RCSID("$NetBSD: filter.c,v 1.8 2002/05/26 22:41:20 wiz Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -58,16 +58,15 @@ char *lint_libs[] = {
|
||||
IG_FILE4,
|
||||
0
|
||||
};
|
||||
int lexsort __P((const void *, const void *));
|
||||
int search_ignore __P((char *));
|
||||
int lexsort(const void *, const void *);
|
||||
int search_ignore(char *);
|
||||
|
||||
/*
|
||||
* Read the file ERRORNAME of the names of functions in lint
|
||||
* to ignore complaints about.
|
||||
*/
|
||||
void
|
||||
getignored(auxname)
|
||||
char *auxname;
|
||||
getignored(char *auxname)
|
||||
{
|
||||
int i;
|
||||
FILE *fyle;
|
||||
@ -135,8 +134,7 @@ getignored(auxname)
|
||||
}
|
||||
|
||||
int
|
||||
lexsort(c1, c2)
|
||||
const void *c1, *c2;
|
||||
lexsort(const void *c1, const void *c2)
|
||||
{
|
||||
char **cpp1, **cpp2;
|
||||
|
||||
@ -146,8 +144,7 @@ lexsort(c1, c2)
|
||||
}
|
||||
|
||||
int
|
||||
search_ignore(key)
|
||||
char *key;
|
||||
search_ignore(char *key)
|
||||
{
|
||||
int ub, lb;
|
||||
int halfway;
|
||||
@ -175,8 +172,7 @@ search_ignore(key)
|
||||
* Return the new categorization of the error class.
|
||||
*/
|
||||
Errorclass
|
||||
discardit(errorp)
|
||||
Eptr errorp;
|
||||
discardit(Eptr errorp)
|
||||
{
|
||||
int language;
|
||||
int i;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: input.c,v 1.8 2000/11/15 19:54:43 christos Exp $ */
|
||||
/* $NetBSD: input.c,v 1.9 2002/05/26 22:41:21 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: input.c,v 1.8 2000/11/15 19:54:43 christos Exp $");
|
||||
__RCSID("$NetBSD: input.c,v 1.9 2002/05/26 22:41:21 wiz Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
@ -50,30 +50,28 @@ __RCSID("$NetBSD: input.c,v 1.8 2000/11/15 19:54:43 christos Exp $");
|
||||
int wordc; /* how long the current error message is */
|
||||
char **wordv; /* the actual error message */
|
||||
|
||||
Errorclass catchall __P((void));
|
||||
Errorclass cpp __P((void));
|
||||
Errorclass f77 __P((void));
|
||||
Errorclass lint0 __P((void));
|
||||
Errorclass lint1 __P((void));
|
||||
Errorclass lint2 __P((void));
|
||||
Errorclass lint3 __P((void));
|
||||
Errorclass make __P((void));
|
||||
Errorclass mod2 __P((void));
|
||||
Errorclass onelong __P((void));
|
||||
Errorclass pccccom __P((void)); /* Portable C Compiler C Compiler */
|
||||
Errorclass pi __P((void));
|
||||
Errorclass ri __P((void));
|
||||
Errorclass richieccom __P((void)); /* Richie Compiler for 11 */
|
||||
Errorclass troff __P((void));
|
||||
Errorclass catchall(void);
|
||||
Errorclass cpp(void);
|
||||
Errorclass f77(void);
|
||||
Errorclass lint0(void);
|
||||
Errorclass lint1(void);
|
||||
Errorclass lint2(void);
|
||||
Errorclass lint3(void);
|
||||
Errorclass make(void);
|
||||
Errorclass mod2(void);
|
||||
Errorclass onelong(void);
|
||||
Errorclass pccccom(void); /* Portable C Compiler C Compiler */
|
||||
Errorclass pi(void);
|
||||
Errorclass ri(void);
|
||||
Errorclass richieccom(void); /* Richie Compiler for 11 */
|
||||
Errorclass troff(void);
|
||||
|
||||
/*
|
||||
* Eat all of the lines in the input file, attempting to categorize
|
||||
* them by their various flavors
|
||||
*/
|
||||
void
|
||||
eaterrors(r_errorc, r_errorv)
|
||||
int *r_errorc;
|
||||
Eptr **r_errorv;
|
||||
eaterrors(int *r_errorc, Eptr **r_errorv)
|
||||
{
|
||||
Errorclass errorclass = C_SYNC;
|
||||
char *line;
|
||||
@ -123,11 +121,8 @@ eaterrors(r_errorc, r_errorv)
|
||||
* create a new error entry, given a zero based array and count
|
||||
*/
|
||||
void
|
||||
erroradd(errorlength, errorv, errorclass, errorsubclass)
|
||||
int errorlength;
|
||||
char **errorv;
|
||||
Errorclass errorclass;
|
||||
Errorclass errorsubclass;
|
||||
erroradd(int errorlength, char **errorv, Errorclass errorclass,
|
||||
Errorclass errorsubclass)
|
||||
{
|
||||
Eptr newerror;
|
||||
char *cp;
|
||||
@ -169,7 +164,7 @@ erroradd(errorlength, errorv, errorclass, errorsubclass)
|
||||
}
|
||||
|
||||
Errorclass
|
||||
onelong()
|
||||
onelong(void)
|
||||
{
|
||||
char **nwordv;
|
||||
if ( (wordc == 1) && (language != INLD) ){
|
||||
@ -216,7 +211,7 @@ onelong()
|
||||
} /* end of one long */
|
||||
|
||||
Errorclass
|
||||
cpp()
|
||||
cpp(void)
|
||||
{
|
||||
/*
|
||||
* Now attempt a cpp error message match
|
||||
@ -241,7 +236,7 @@ cpp()
|
||||
} /*end of cpp*/
|
||||
|
||||
Errorclass
|
||||
pccccom()
|
||||
pccccom(void)
|
||||
{
|
||||
/*
|
||||
* Now attempt a ccom error message match:
|
||||
@ -282,7 +277,7 @@ pccccom()
|
||||
*/
|
||||
|
||||
Errorclass
|
||||
richieccom()
|
||||
richieccom(void)
|
||||
{
|
||||
char *cp;
|
||||
char **nwordv;
|
||||
@ -313,7 +308,7 @@ richieccom()
|
||||
}
|
||||
|
||||
Errorclass
|
||||
lint0()
|
||||
lint0(void)
|
||||
{
|
||||
char **nwordv;
|
||||
char *line, *file;
|
||||
@ -344,7 +339,7 @@ lint0()
|
||||
}
|
||||
|
||||
Errorclass
|
||||
lint1()
|
||||
lint1(void)
|
||||
{
|
||||
char *line1, *line2;
|
||||
char *file1, *file2;
|
||||
@ -382,7 +377,7 @@ lint1()
|
||||
} /* end of lint 1*/
|
||||
|
||||
Errorclass
|
||||
lint2()
|
||||
lint2(void)
|
||||
{
|
||||
char *file;
|
||||
char *line;
|
||||
@ -417,7 +412,7 @@ char *Lint31[4] = {"returns", "value", "which", "is"};
|
||||
char *Lint32[6] = {"value", "is", "used,", "but", "none", "returned"};
|
||||
|
||||
Errorclass
|
||||
lint3()
|
||||
lint3(void)
|
||||
{
|
||||
if (wordc < 3)
|
||||
return(C_UNKNOWN);
|
||||
@ -438,7 +433,7 @@ char *F77_warning[3] = {"Warning", "on", "line"};
|
||||
char *F77_no_ass[3] = {"Error.","No","assembly."};
|
||||
|
||||
Errorclass
|
||||
f77()
|
||||
f77(void)
|
||||
{
|
||||
char **nwordv;
|
||||
/*
|
||||
@ -479,7 +474,7 @@ char *Make_Croak[3] = {"***", "Error", "code"};
|
||||
char *Make_NotRemade[5] = {"not", "remade", "because", "of", "errors"};
|
||||
|
||||
Errorclass
|
||||
make()
|
||||
make(void)
|
||||
{
|
||||
if (wordvcmp(wordv+1, 3, Make_Croak) == 0){
|
||||
language = INMAKE;
|
||||
@ -493,7 +488,7 @@ make()
|
||||
}
|
||||
|
||||
Errorclass
|
||||
ri()
|
||||
ri(void)
|
||||
{
|
||||
/*
|
||||
* Match an error message produced by ri; here is the
|
||||
@ -531,7 +526,7 @@ ri()
|
||||
}
|
||||
|
||||
Errorclass
|
||||
catchall()
|
||||
catchall(void)
|
||||
{
|
||||
/*
|
||||
* Catches random things.
|
||||
@ -541,7 +536,7 @@ catchall()
|
||||
} /* end of catch all*/
|
||||
|
||||
Errorclass
|
||||
troff()
|
||||
troff(void)
|
||||
{
|
||||
/*
|
||||
* troff source error message, from eqn, bib, tbl...
|
||||
@ -570,7 +565,7 @@ troff()
|
||||
}
|
||||
|
||||
Errorclass
|
||||
mod2()
|
||||
mod2(void)
|
||||
{
|
||||
/*
|
||||
* for decwrl modula2 compiler (powell)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: main.c,v 1.6 2001/06/11 01:50:57 wiz Exp $ */
|
||||
/* $NetBSD: main.c,v 1.7 2002/05/26 22:41:21 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1993\n\
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: main.c,v 1.6 2001/06/11 01:50:57 wiz Exp $");
|
||||
__RCSID("$NetBSD: main.c,v 1.7 2002/05/26 22:41:21 wiz Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
@ -81,10 +81,10 @@ boolean terse = FALSE; /* Terse output */
|
||||
|
||||
char *suffixlist = ".*"; /* initially, can touch any file */
|
||||
|
||||
int errorsort __P((const void *, const void *));
|
||||
void forkvi __P((int, char **));
|
||||
int main __P((int, char **));
|
||||
void try __P((char *, int, char **));
|
||||
int errorsort(const void *, const void *);
|
||||
void forkvi(int, char **);
|
||||
int main(int, char **);
|
||||
void try(char *, int, char **);
|
||||
|
||||
/*
|
||||
* error [-I ignorename] [-n] [-q] [-t suffixlist] [-s] [-v] [infile]
|
||||
@ -130,9 +130,7 @@ void try __P((char *, int, char **));
|
||||
* Default: stdin
|
||||
*/
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
char *cp;
|
||||
char *ignorename = 0;
|
||||
@ -233,9 +231,7 @@ main(argc, argv)
|
||||
}
|
||||
|
||||
void
|
||||
forkvi(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
forkvi(int argc, char **argv)
|
||||
{
|
||||
if (query){
|
||||
switch(inquire(terse
|
||||
@ -260,10 +256,7 @@ forkvi(argc, argv)
|
||||
}
|
||||
|
||||
void
|
||||
try(name, argc, argv)
|
||||
char *name;
|
||||
int argc;
|
||||
char **argv;
|
||||
try(char *name, int argc, char **argv)
|
||||
{
|
||||
argv[0] = name;
|
||||
wordvprint(stdout, argc, argv);
|
||||
@ -278,8 +271,7 @@ try(name, argc, argv)
|
||||
execvp(name, argv);
|
||||
}
|
||||
|
||||
int errorsort(x1, x2)
|
||||
const void *x1, *x2;
|
||||
int errorsort(const void *x1, const void *x2)
|
||||
{
|
||||
Eptr *epp1 = (Eptr *)x1, *epp2 = (Eptr *)x2;
|
||||
Eptr ep1, ep2;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pi.c,v 1.8 2001/02/05 01:44:07 christos Exp $ */
|
||||
/* $NetBSD: pi.c,v 1.9 2002/05/26 22:41:21 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)pi.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: pi.c,v 1.8 2001/02/05 01:44:07 christos Exp $");
|
||||
__RCSID("$NetBSD: pi.c,v 1.9 2002/05/26 22:41:21 wiz Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
@ -50,11 +50,11 @@ static char *c_linenumber;
|
||||
static char *unk_hdr[] = {"In", "program", "???"};
|
||||
static char **c_header = &unk_hdr[0];
|
||||
|
||||
boolean alldigits __P((char *));
|
||||
boolean isdateformat __P((int, char **));
|
||||
boolean instringset __P((char *, char **));
|
||||
Errorclass pi __P((void));
|
||||
boolean piptr __P((char *));
|
||||
boolean alldigits(char *);
|
||||
boolean isdateformat(int, char **);
|
||||
boolean instringset(char *, char **);
|
||||
Errorclass pi(void);
|
||||
boolean piptr(char *);
|
||||
|
||||
|
||||
/*
|
||||
@ -167,8 +167,7 @@ char *pi_imp1[] = {"improperly", "used", "on", "line"};
|
||||
char *pi_imp2[] = {"improperly", "used", "on", "lines"};
|
||||
|
||||
boolean
|
||||
alldigits(string)
|
||||
char *string;
|
||||
alldigits(char *string)
|
||||
{
|
||||
for (; *string && isdigit((unsigned char)*string); string++)
|
||||
continue;
|
||||
@ -176,9 +175,7 @@ alldigits(string)
|
||||
}
|
||||
|
||||
boolean
|
||||
instringset(member, set)
|
||||
char *member;
|
||||
char **set;
|
||||
instringset(char *member, char **set)
|
||||
{
|
||||
for(; *set; set++){
|
||||
if (strcmp(*set, member) == 0)
|
||||
@ -188,9 +185,7 @@ instringset(member, set)
|
||||
}
|
||||
|
||||
boolean
|
||||
isdateformat(wordc, wordv)
|
||||
int wordc;
|
||||
char **wordv;
|
||||
isdateformat(int wordc, char **wordv)
|
||||
{
|
||||
return(
|
||||
(wordc == 5)
|
||||
@ -201,8 +196,7 @@ isdateformat(wordc, wordv)
|
||||
}
|
||||
|
||||
boolean
|
||||
piptr(string)
|
||||
char *string;
|
||||
piptr(char *string)
|
||||
{
|
||||
if (*string != '-')
|
||||
return(FALSE);
|
||||
@ -220,7 +214,7 @@ extern int wordc;
|
||||
extern char **wordv;
|
||||
|
||||
Errorclass
|
||||
pi()
|
||||
pi(void)
|
||||
{
|
||||
char **nwordv;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: subr.c,v 1.10 2000/11/15 19:54:12 christos Exp $ */
|
||||
/* $NetBSD: subr.c,v 1.11 2002/05/26 22:41:21 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)subr.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: subr.c,v 1.10 2000/11/15 19:54:12 christos Exp $");
|
||||
__RCSID("$NetBSD: subr.c,v 1.11 2002/05/26 22:41:21 wiz Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <ctype.h>
|
||||
@ -51,10 +51,7 @@ __RCSID("$NetBSD: subr.c,v 1.10 2000/11/15 19:54:12 christos Exp $");
|
||||
* Arrayify a list of rules
|
||||
*/
|
||||
void
|
||||
arrayify(e_length, e_array, header)
|
||||
int *e_length;
|
||||
Eptr **e_array;
|
||||
Eptr header;
|
||||
arrayify(int *e_length, Eptr **e_array, Eptr header)
|
||||
{
|
||||
Eptr errorp;
|
||||
Eptr *array;
|
||||
@ -77,9 +74,7 @@ arrayify(e_length, e_array, header)
|
||||
}
|
||||
|
||||
char *
|
||||
Calloc(nelements, size)
|
||||
int nelements;
|
||||
int size;
|
||||
Calloc(int nelements, int size)
|
||||
{
|
||||
char *back;
|
||||
if ( (back = (char *)calloc(nelements, size)) == NULL)
|
||||
@ -88,8 +83,7 @@ Calloc(nelements, size)
|
||||
}
|
||||
|
||||
char *
|
||||
strsave(instring)
|
||||
char *instring;
|
||||
strsave(char *instring)
|
||||
{
|
||||
char *outstring;
|
||||
(void)strcpy(outstring = (char *)Calloc(1, strlen(instring) + 1),
|
||||
@ -102,9 +96,7 @@ strsave(instring)
|
||||
* (one based)
|
||||
*/
|
||||
int
|
||||
position(string, ch)
|
||||
char *string;
|
||||
char ch;
|
||||
position(char *string, char ch)
|
||||
{
|
||||
int i;
|
||||
if (string)
|
||||
@ -119,9 +111,7 @@ position(string, ch)
|
||||
* clobber the first occurance of ch in string by the new character
|
||||
*/
|
||||
char *
|
||||
substitute(string, chold, chnew)
|
||||
char *string;
|
||||
char chold, chnew;
|
||||
substitute(char *string, char chold, char chnew)
|
||||
{
|
||||
char *cp = string;
|
||||
|
||||
@ -137,8 +127,7 @@ substitute(string, chold, chnew)
|
||||
}
|
||||
|
||||
char
|
||||
lastchar(string)
|
||||
char *string;
|
||||
lastchar(char *string)
|
||||
{
|
||||
int length;
|
||||
if (string == NULL) return('\0');
|
||||
@ -150,8 +139,7 @@ lastchar(string)
|
||||
}
|
||||
|
||||
char
|
||||
firstchar(string)
|
||||
char *string;
|
||||
firstchar(char *string)
|
||||
{
|
||||
if (string)
|
||||
return(string[0]);
|
||||
@ -160,8 +148,7 @@ firstchar(string)
|
||||
}
|
||||
|
||||
char
|
||||
next_lastchar(string)
|
||||
char *string;
|
||||
next_lastchar(char *string)
|
||||
{
|
||||
int length;
|
||||
if (string == NULL) return('\0');
|
||||
@ -173,8 +160,7 @@ next_lastchar(string)
|
||||
}
|
||||
|
||||
void
|
||||
clob_last(string, newstuff)
|
||||
char *string, newstuff;
|
||||
clob_last(char *string, char newstuff)
|
||||
{
|
||||
int length = 0;
|
||||
if (string)
|
||||
@ -188,9 +174,7 @@ clob_last(string, newstuff)
|
||||
* return TRUE if this is of the proper format
|
||||
*/
|
||||
boolean
|
||||
persperdexplode(string, r_perd, r_pers)
|
||||
char *string;
|
||||
char **r_perd, **r_pers;
|
||||
persperdexplode(char *string, char **r_perd, char **r_pers)
|
||||
{
|
||||
char *cp;
|
||||
int length = 0;
|
||||
@ -221,9 +205,7 @@ persperdexplode(string, r_perd, r_pers)
|
||||
* return TRUE if this is of the proper format
|
||||
*/
|
||||
boolean
|
||||
qpersperdexplode(string, r_perd, r_pers)
|
||||
char *string;
|
||||
char **r_perd, **r_pers;
|
||||
qpersperdexplode(char *string, char **r_perd, char **r_pers)
|
||||
{
|
||||
char *cp;
|
||||
int length = 0;
|
||||
@ -289,10 +271,7 @@ struct lang_desc lang_table[] = {
|
||||
};
|
||||
|
||||
void
|
||||
printerrors(look_at_subclass, errorc, errorv)
|
||||
boolean look_at_subclass;
|
||||
int errorc;
|
||||
Eptr errorv[];
|
||||
printerrors(boolean look_at_subclass, int errorc, Eptr errorv[])
|
||||
{
|
||||
int i;
|
||||
Eptr errorp;
|
||||
@ -312,10 +291,7 @@ printerrors(look_at_subclass, errorc, errorv)
|
||||
}
|
||||
|
||||
void
|
||||
wordvprint(fyle, wordc, wordv)
|
||||
FILE *fyle;
|
||||
int wordc;
|
||||
char *wordv[];
|
||||
wordvprint(FILE *fyle, int wordc, char **wordv)
|
||||
{
|
||||
int i;
|
||||
char *sep = "";
|
||||
@ -332,10 +308,7 @@ wordvprint(fyle, wordc, wordv)
|
||||
* a wordc wordv combination pointing into it.
|
||||
*/
|
||||
void
|
||||
wordvbuild(string, r_wordc, r_wordv)
|
||||
char *string;
|
||||
int *r_wordc;
|
||||
char ***r_wordv;
|
||||
wordvbuild(char *string, int *r_wordc, char ***r_wordv)
|
||||
{
|
||||
char *cp;
|
||||
char **wordv;
|
||||
@ -377,10 +350,7 @@ wordvbuild(string, r_wordc, r_wordv)
|
||||
* Compare two 0 based wordvectors
|
||||
*/
|
||||
int
|
||||
wordvcmp(wordv1, wordc, wordv2)
|
||||
char **wordv1;
|
||||
int wordc;
|
||||
char **wordv2;
|
||||
wordvcmp(char **wordv1, int wordc, char **wordv2)
|
||||
{
|
||||
int i;
|
||||
int back;
|
||||
@ -399,10 +369,7 @@ wordvcmp(wordv1, wordc, wordv2)
|
||||
* new wordv, allowing the first emptyhead slots to be empty
|
||||
*/
|
||||
char **
|
||||
wordvsplice(emptyhead, wordc, wordv)
|
||||
int emptyhead;
|
||||
int wordc;
|
||||
char **wordv;
|
||||
wordvsplice(int emptyhead, int wordc, char **wordv)
|
||||
{
|
||||
char **nwordv;
|
||||
int nwordc = emptyhead + wordc;
|
||||
@ -424,15 +391,13 @@ static char *S = "s";
|
||||
static char *N = "";
|
||||
|
||||
char *
|
||||
plural(n)
|
||||
int n;
|
||||
plural(int n)
|
||||
{
|
||||
return( n > 1 ? S : N);
|
||||
}
|
||||
|
||||
char *
|
||||
verbform(n)
|
||||
int n;
|
||||
verbform(int n)
|
||||
{
|
||||
return( n > 1 ? N : S);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: touch.c,v 1.12 2001/09/24 13:22:35 wiz Exp $ */
|
||||
/* $NetBSD: touch.c,v 1.13 2002/05/26 22:41:21 wiz Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
@ -38,7 +38,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)touch.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
__RCSID("$NetBSD: touch.c,v 1.12 2001/09/24 13:22:35 wiz Exp $");
|
||||
__RCSID("$NetBSD: touch.c,v 1.13 2002/05/26 22:41:21 wiz Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -49,11 +49,7 @@ __RCSID("$NetBSD: touch.c,v 1.12 2001/09/24 13:22:35 wiz Exp $");
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
#include "error.h"
|
||||
#include "pathnames.h"
|
||||
|
||||
@ -69,11 +65,7 @@ int touchstatus = Q_YES;
|
||||
extern char *suffixlist;
|
||||
|
||||
void
|
||||
findfiles(nerrors, errors, r_nfiles, r_files)
|
||||
int nerrors;
|
||||
Eptr *errors;
|
||||
int *r_nfiles;
|
||||
Eptr ***r_files;
|
||||
findfiles(int nerrors, Eptr *errors, int *r_nfiles, Eptr ***r_files)
|
||||
{
|
||||
int nfiles;
|
||||
Eptr **files;
|
||||
@ -123,8 +115,7 @@ findfiles(nerrors, errors, r_nfiles, r_files)
|
||||
}
|
||||
|
||||
int
|
||||
countfiles(errors)
|
||||
Eptr *errors;
|
||||
countfiles(Eptr *errors)
|
||||
{
|
||||
char *name;
|
||||
int ei;
|
||||
@ -159,9 +150,7 @@ char *class_table[] = {
|
||||
int class_count[C_LAST - C_FIRST] = {0};
|
||||
|
||||
void
|
||||
filenames(nfiles, files)
|
||||
int nfiles;
|
||||
Eptr **files;
|
||||
filenames(int nfiles, Eptr **files)
|
||||
{
|
||||
int fi;
|
||||
char *sep = " ";
|
||||
@ -198,8 +187,7 @@ filenames(nfiles, files)
|
||||
* Dump out errors that don't pertain to any file
|
||||
*/
|
||||
int
|
||||
nopertain(files)
|
||||
Eptr **files;
|
||||
nopertain(Eptr **files)
|
||||
{
|
||||
int type;
|
||||
int someerrors = 0;
|
||||
@ -233,11 +221,7 @@ nopertain(files)
|
||||
extern boolean notouch;
|
||||
|
||||
boolean
|
||||
touchfiles(nfiles, files, r_edargc, r_edargv)
|
||||
int nfiles;
|
||||
Eptr **files;
|
||||
int *r_edargc;
|
||||
char ***r_edargv;
|
||||
touchfiles(int nfiles, Eptr **files, int *r_edargc, char ***r_edargv)
|
||||
{
|
||||
char *name;
|
||||
Eptr errorp;
|
||||
@ -293,11 +277,7 @@ touchfiles(nfiles, files, r_edargc, r_edargv)
|
||||
}
|
||||
|
||||
void
|
||||
hackfile(name, files, ix, nerrors)
|
||||
char *name;
|
||||
Eptr **files;
|
||||
int ix;
|
||||
int nerrors;
|
||||
hackfile(char *name, Eptr **files, int ix, int nerrors)
|
||||
{
|
||||
boolean previewed;
|
||||
int errordest; /* where errors go*/
|
||||
@ -327,11 +307,7 @@ hackfile(name, files, ix, nerrors)
|
||||
}
|
||||
|
||||
boolean
|
||||
preview(name, nerrors, files, ix)
|
||||
char *name;
|
||||
int nerrors;
|
||||
Eptr **files;
|
||||
int ix;
|
||||
preview(char *name, int nerrors, Eptr **files, int ix)
|
||||
{
|
||||
int back;
|
||||
Eptr *erpp;
|
||||
@ -359,8 +335,7 @@ preview(name, nerrors, files, ix)
|
||||
}
|
||||
|
||||
int
|
||||
settotouch(name)
|
||||
char *name;
|
||||
settotouch(char *name)
|
||||
{
|
||||
int dest = TOSTDOUT;
|
||||
|
||||
@ -407,13 +382,8 @@ settotouch(name)
|
||||
}
|
||||
|
||||
void
|
||||
diverterrors(name, dest, files, ix, previewed, nterrors)
|
||||
char *name;
|
||||
int dest;
|
||||
Eptr **files;
|
||||
int ix;
|
||||
boolean previewed;
|
||||
int nterrors;
|
||||
diverterrors(char *name, int dest, Eptr **files, int ix, boolean previewed,
|
||||
int nterrors)
|
||||
{
|
||||
int nerrors;
|
||||
Eptr *erpp;
|
||||
@ -452,8 +422,7 @@ diverterrors(name, dest, files, ix, previewed, nterrors)
|
||||
}
|
||||
|
||||
int
|
||||
oktotouch(filename)
|
||||
char *filename;
|
||||
oktotouch(char *filename)
|
||||
{
|
||||
char *src;
|
||||
char *pat;
|
||||
@ -505,10 +474,7 @@ oktotouch(filename)
|
||||
* We fill in the arguments, and the null.
|
||||
*/
|
||||
void
|
||||
execvarg(n_pissed_on, r_argc, r_argv)
|
||||
int n_pissed_on;
|
||||
int *r_argc;
|
||||
char ***r_argv;
|
||||
execvarg(int n_pissed_on, int *r_argc, char ***r_argv)
|
||||
{
|
||||
Eptr p;
|
||||
char *sep;
|
||||
@ -550,8 +516,7 @@ boolean tempfileopen = FALSE;
|
||||
* Well, if it isn't, then return TRUE if something failed
|
||||
*/
|
||||
boolean
|
||||
edit(name)
|
||||
char *name;
|
||||
edit(char *name)
|
||||
{
|
||||
int fd;
|
||||
const char *tmpdir;
|
||||
@ -586,8 +551,7 @@ edit(name)
|
||||
char edbuf[BUFSIZ];
|
||||
|
||||
void
|
||||
insert(place)
|
||||
int place;
|
||||
insert(int place)
|
||||
{
|
||||
--place; /* always insert messages before the offending line*/
|
||||
for(; o_lineno < place; o_lineno++, n_lineno++){
|
||||
@ -598,9 +562,7 @@ insert(place)
|
||||
}
|
||||
|
||||
void
|
||||
text(p, use_all)
|
||||
Eptr p;
|
||||
boolean use_all;
|
||||
text(Eptr p, boolean use_all)
|
||||
{
|
||||
int offset = use_all ? 0 : 2;
|
||||
|
||||
@ -618,8 +580,7 @@ text(p, use_all)
|
||||
* then bring the temporary in over the local file
|
||||
*/
|
||||
boolean
|
||||
writetouched(overwrite)
|
||||
int overwrite;
|
||||
writetouched(int overwrite)
|
||||
{
|
||||
int nread;
|
||||
FILE *localfile;
|
||||
@ -685,9 +646,7 @@ writetouched(overwrite)
|
||||
* return 1 if the tmpfile can be removed after writing it out
|
||||
*/
|
||||
int
|
||||
mustoverwrite(preciousfile, tmpfile)
|
||||
FILE *preciousfile;
|
||||
FILE *tmpfile;
|
||||
mustoverwrite(FILE *preciousfile, FILE *tmpfile)
|
||||
{
|
||||
int nread;
|
||||
|
||||
@ -701,10 +660,7 @@ mustoverwrite(preciousfile, tmpfile)
|
||||
* return 0 on catastrophe
|
||||
*/
|
||||
int
|
||||
mustwrite(base, n, preciousfile)
|
||||
char *base;
|
||||
int n;
|
||||
FILE *preciousfile;
|
||||
mustwrite(char *base, int n, FILE *preciousfile)
|
||||
{
|
||||
int nwrote;
|
||||
|
||||
@ -738,8 +694,7 @@ mustwrite(base, n, preciousfile)
|
||||
}
|
||||
|
||||
void
|
||||
onintr(dummy)
|
||||
int dummy;
|
||||
onintr(int dummy)
|
||||
{
|
||||
switch(inquire(terse
|
||||
? "\nContinue? "
|
||||
@ -761,10 +716,7 @@ onintr(dummy)
|
||||
}
|
||||
|
||||
void
|
||||
errorprint(place, errorp, print_all)
|
||||
FILE *place;
|
||||
Eptr errorp;
|
||||
boolean print_all;
|
||||
errorprint(FILE *place, Eptr errorp, boolean print_all)
|
||||
{
|
||||
int offset = print_all ? 0 : 2;
|
||||
|
||||
@ -776,13 +728,7 @@ errorprint(place, errorp, print_all)
|
||||
}
|
||||
|
||||
int
|
||||
#if __STDC__
|
||||
inquire(char *fmt, ...)
|
||||
#else
|
||||
inquire(fmt, va_alist)
|
||||
char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list ap;
|
||||
char buffer[128];
|
||||
@ -792,11 +738,7 @@ inquire(fmt, va_alist)
|
||||
for(;;){
|
||||
do{
|
||||
fflush(stdout);
|
||||
#if __STDC__
|
||||
va_start(ap, fmt);
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
fflush(stderr);
|
||||
@ -812,8 +754,7 @@ inquire(fmt, va_alist)
|
||||
}
|
||||
|
||||
int
|
||||
probethisfile(name)
|
||||
char *name;
|
||||
probethisfile(char *name)
|
||||
{
|
||||
struct stat statbuf;
|
||||
if (stat(name, &statbuf) < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user