diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2012-03-04 04:05:16 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2012-03-04 04:05:16 +0000 |
commit | ea5319421a589ebd8583734a461346e1f0d91bec (patch) | |
tree | f5bd7462d5be00f2b6c3ea91c579bd03d2ef6dce /usr.bin | |
parent | c90e6f8af6e01b6bd2b8ec8057571ae41b0ddb00 (diff) |
In preparation for getline and getdelim additions to libc, rename getline()
occurrences to get_line().
Based on a diff from Jan Klemkow <j-dot-klemkow-at-wemelug-dot-de> to tech.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/csplit/csplit.c | 18 | ||||
-rw-r--r-- | usr.bin/ctags/C.c | 10 | ||||
-rw-r--r-- | usr.bin/ctags/ctags.h | 4 | ||||
-rw-r--r-- | usr.bin/ctags/fortran.c | 4 | ||||
-rw-r--r-- | usr.bin/ctags/lisp.c | 4 | ||||
-rw-r--r-- | usr.bin/ctags/print.c | 6 | ||||
-rw-r--r-- | usr.bin/ctags/yacc.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/diff3.c | 10 | ||||
-rw-r--r-- | usr.bin/diff3/diff3prog.c | 10 | ||||
-rw-r--r-- | usr.bin/fsplit/fsplit.c | 8 | ||||
-rw-r--r-- | usr.bin/gencat/gencat.c | 10 | ||||
-rw-r--r-- | usr.bin/rcs/diff3.c | 10 | ||||
-rw-r--r-- | usr.bin/rs/rs.c | 12 | ||||
-rw-r--r-- | usr.bin/unifdef/unifdef.c | 8 | ||||
-rw-r--r-- | usr.bin/uudecode/uudecode.c | 10 |
15 files changed, 64 insertions, 64 deletions
diff --git a/usr.bin/csplit/csplit.c b/usr.bin/csplit/csplit.c index e1b3ebcf774..d90c488eb08 100644 --- a/usr.bin/csplit/csplit.c +++ b/usr.bin/csplit/csplit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: csplit.c,v 1.3 2006/07/17 22:28:11 deraadt Exp $ */ +/* $OpenBSD: csplit.c,v 1.4 2012/03/04 04:05:15 fgsch Exp $ */ /* $FreeBSD: src/usr.bin/csplit/csplit.c,v 1.9 2004/03/22 11:15:03 tjr Exp $ */ /*- @@ -63,7 +63,7 @@ void cleanup(void); void do_lineno(const char *); void do_rexp(const char *); -char *getline(void); +char *get_line(void); void handlesig(int); FILE *newfile(void); void toomuch(FILE *, long); @@ -195,7 +195,7 @@ main(int argc, char *argv[]) /* Copy the rest into a new file. */ if (!feof(infile)) { ofp = newfile(); - while ((p = getline()) != NULL && fputs(p, ofp) == 0) + while ((p = get_line()) != NULL && fputs(p, ofp) == 0) ; if (!sflag) printf("%jd\n", (intmax_t)ftello(ofp)); @@ -270,7 +270,7 @@ cleanup(void) /* Read a line from the input into a static buffer. */ char * -getline(void) +get_line(void) { static char lbuf[LINE_MAX]; FILE *src; @@ -291,7 +291,7 @@ again: if (fgets(lbuf, sizeof(lbuf), src) == NULL) { return (lbuf); } -/* Conceptually rewind the input (as obtained by getline()) back `n' lines. */ +/* Conceptually rewind the input (as obtained by get_line()) back `n' lines. */ void toomuch(FILE *ofp, long n) { @@ -343,7 +343,7 @@ toomuch(FILE *ofp, long n) err(1, "%s", currfile); /* - * getline() will read from here. Next call will truncate to + * get_line() will read from here. Next call will truncate to * truncofs in this file. */ overfile = ofp; @@ -391,7 +391,7 @@ do_rexp(const char *expr) /* Read and output lines until we get a match. */ first = 1; - while ((p = getline()) != NULL) { + while ((p = get_line()) != NULL) { if (fputs(p, ofp) != 0) break; if (!first && regexec(&cre, p, 0, NULL, 0) == 0) @@ -417,7 +417,7 @@ do_rexp(const char *expr) * Positive offset: copy the requested number of lines * after the match. */ - while (--ofs > 0 && (p = getline()) != NULL) + while (--ofs > 0 && (p = get_line()) != NULL) fputs(p, ofp); toomuch(NULL, 0); nwritten = (intmax_t)ftello(ofp); @@ -451,7 +451,7 @@ do_lineno(const char *expr) while (nfiles < maxfiles - 1) { ofp = newfile(); while (lineno + 1 != lastline) { - if ((p = getline()) == NULL) + if ((p = get_line()) == NULL) errx(1, "%ld: out of range", lastline); if (fputs(p, ofp) != 0) break; diff --git a/usr.bin/ctags/C.c b/usr.bin/ctags/C.c index 10a87e76b1b..3dfbf9b6f86 100644 --- a/usr.bin/ctags/C.c +++ b/usr.bin/ctags/C.c @@ -1,4 +1,4 @@ -/* $OpenBSD: C.c,v 1.13 2010/11/03 19:39:38 millert Exp $ */ +/* $OpenBSD: C.c,v 1.14 2012/03/04 04:05:15 fgsch Exp $ */ /* $NetBSD: C.c,v 1.3 1995/03/26 20:14:02 glass Exp $ */ /* @@ -155,7 +155,7 @@ endtok: if (sp > tok) { * foo\n * (arg1, */ - getline(); + get_line(); curline = lineno; if (func_entry()) { ++level; @@ -184,7 +184,7 @@ endtok: if (sp > tok) { case ';': if (t_def && level == t_level) { t_def = NO; - getline(); + get_line(); if (sp != tok) *sp = EOS; pfnote(tok, lineno); @@ -233,7 +233,7 @@ endtok: if (sp > tok) { * get line immediately; * may change before '{' */ - getline(); + get_line(); if (str_entry(c)) ++level; break; @@ -413,7 +413,7 @@ hash_entry(void) } *sp = EOS; if (dflag || c == '(') { /* only want macros */ - getline(); + get_line(); pfnote(tok, curline); } skip: if (c == '\n') { /* get rid of rest of define */ diff --git a/usr.bin/ctags/ctags.h b/usr.bin/ctags/ctags.h index 0c52d0bf38e..09dd1a292d1 100644 --- a/usr.bin/ctags/ctags.h +++ b/usr.bin/ctags/ctags.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ctags.h,v 1.6 2010/11/03 19:39:38 millert Exp $ */ +/* $OpenBSD: ctags.h,v 1.7 2012/03/04 04:05:15 fgsch Exp $ */ /* $NetBSD: ctags.h,v 1.3 1995/03/26 20:14:07 glass Exp $ */ /* @@ -76,7 +76,7 @@ extern char *lbp; extern char searchar; /* ex search character */ extern int cicmp(char *); -extern void getline(void); +extern void get_line(void); extern void pfnote(char *, int); extern int skip_key(int); extern void put_entries(NODE *); diff --git a/usr.bin/ctags/fortran.c b/usr.bin/ctags/fortran.c index 91bebacd468..61ed7c515e9 100644 --- a/usr.bin/ctags/fortran.c +++ b/usr.bin/ctags/fortran.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fortran.c,v 1.7 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: fortran.c,v 1.8 2012/03/04 04:05:15 fgsch Exp $ */ /* $NetBSD: fortran.c,v 1.3 1995/03/26 20:14:08 glass Exp $ */ /* @@ -118,7 +118,7 @@ PF_funcs(void) continue; *cp = EOS; (void)strlcpy(tok, lbp, sizeof tok); /* possible trunc */ - getline(); /* process line for ex(1) */ + get_line(); /* process line for ex(1) */ pfnote(tok, lineno); pfcnt = YES; } diff --git a/usr.bin/ctags/lisp.c b/usr.bin/ctags/lisp.c index 7dafeb9ec9b..e3d91f389c7 100644 --- a/usr.bin/ctags/lisp.c +++ b/usr.bin/ctags/lisp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lisp.c,v 1.6 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: lisp.c,v 1.7 2012/03/04 04:05:15 fgsch Exp $ */ /* $NetBSD: lisp.c,v 1.3 1995/03/26 20:14:09 glass Exp $ */ /* @@ -93,7 +93,7 @@ l_entries(void) *cp = EOS; (void)strlcpy(tok, lbp, sizeof tok); *cp = savedc; - getline(); + get_line(); pfnote(tok, lineno); } /*NOTREACHED*/ diff --git a/usr.bin/ctags/print.c b/usr.bin/ctags/print.c index a7746657f84..ca5d17f5a2e 100644 --- a/usr.bin/ctags/print.c +++ b/usr.bin/ctags/print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print.c,v 1.6 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: print.c,v 1.7 2012/03/04 04:05:15 fgsch Exp $ */ /* $NetBSD: print.c,v 1.4 1995/09/27 01:06:58 jtc Exp $ */ /* @@ -39,12 +39,12 @@ #include "ctags.h" /* - * getline -- + * get_line -- * get the line the token of interest occurred on, * prepare it for printing. */ void -getline(void) +get_line(void) { long saveftell; int c; diff --git a/usr.bin/ctags/yacc.c b/usr.bin/ctags/yacc.c index ef302faadb6..e289847a40a 100644 --- a/usr.bin/ctags/yacc.c +++ b/usr.bin/ctags/yacc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yacc.c,v 1.8 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: yacc.c,v 1.9 2012/03/04 04:05:15 fgsch Exp $ */ /* $NetBSD: yacc.c,v 1.3 1995/03/26 20:14:12 glass Exp $ */ /* @@ -93,7 +93,7 @@ y_entries(void) while (GETC(!=, EOF) && (intoken(c) || c == '.')) *sp++ = c; *sp = EOS; - getline(); /* may change before ':' */ + get_line(); /* may change before ':' */ while (iswhite(c)) { if (c == '\n') SETLINE; diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c index 4b8563a31ed..df5eae89d8b 100644 --- a/usr.bin/cvs/diff3.c +++ b/usr.bin/cvs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.54 2010/10/29 17:49:37 nicm Exp $ */ +/* $OpenBSD: diff3.c,v 1.55 2012/03/04 04:05:15 fgsch Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -133,7 +133,7 @@ static char f1mark[MAXPATHLEN], f3mark[MAXPATHLEN]; /* markers for -E and -X */ static int duplicate(struct range *, struct range *); static int edit(struct diff *, int, int); static char *getchange(FILE *); -static char *getline(FILE *, size_t *); +static char *get_line(FILE *, size_t *); static int number(char **); static size_t readin(int, struct diff **); static int skip(int, int, char *); @@ -503,7 +503,7 @@ getchange(FILE *b) { char *line; - while ((line = getline(b, NULL))) { + while ((line = get_line(b, NULL))) { if (isdigit((unsigned char)line[0])) return (line); } @@ -512,7 +512,7 @@ getchange(FILE *b) } static char * -getline(FILE *b, size_t *n) +get_line(FILE *b, size_t *n) { char *cp; size_t len; @@ -714,7 +714,7 @@ skip(int i, int from, char *pr) char *line; for (n = 0; cline[i] < from - 1; n += j) { - if ((line = getline(fp[i], &j)) == NULL) + if ((line = get_line(fp[i], &j)) == NULL) return (-1); if (pr != NULL) diff_output("%s%s", pr, line); diff --git a/usr.bin/diff3/diff3prog.c b/usr.bin/diff3/diff3prog.c index 1d0aa17d70f..c6677ce2b61 100644 --- a/usr.bin/diff3/diff3prog.c +++ b/usr.bin/diff3/diff3prog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3prog.c,v 1.11 2009/10/27 23:59:37 deraadt Exp $ */ +/* $OpenBSD: diff3prog.c,v 1.12 2012/03/04 04:05:15 fgsch Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -124,7 +124,7 @@ char f1mark[40], f3mark[40]; /* markers for -E and -X */ int duplicate(struct range *, struct range *); int edit(struct diff *, int, int); char *getchange(FILE *); -char *getline(FILE *, size_t *); +char *get_line(FILE *, size_t *); int number(char **); int readin(char *, struct diff **); int skip(int, int, char *); @@ -253,7 +253,7 @@ getchange(FILE *b) { char *line; - while ((line = getline(b, NULL))) { + while ((line = get_line(b, NULL))) { if (isdigit((unsigned char)line[0])) return (line); } @@ -261,7 +261,7 @@ getchange(FILE *b) } char * -getline(FILE *b, size_t *n) +get_line(FILE *b, size_t *n) { char *cp; size_t len; @@ -456,7 +456,7 @@ skip(int i, int from, char *pr) char *line; for (n = 0; cline[i] < from - 1; n += j) { - if ((line = getline(fp[i], &j)) == NULL) + if ((line = get_line(fp[i], &j)) == NULL) trouble(); if (pr != NULL) printf("%s%s", pr, line); diff --git a/usr.bin/fsplit/fsplit.c b/usr.bin/fsplit/fsplit.c index 8a41fda22d7..c9fb6ca38c6 100644 --- a/usr.bin/fsplit/fsplit.c +++ b/usr.bin/fsplit/fsplit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fsplit.c,v 1.18 2009/10/27 23:59:38 deraadt Exp $ */ +/* $OpenBSD: fsplit.c,v 1.19 2012/03/04 04:05:15 fgsch Exp $ */ /* * Copyright (c) 1983, 1993 @@ -45,7 +45,7 @@ void badparms(void); void get_name(char *, int); int lname(char *, size_t); -int getline(void); +int get_line(void); int lend(void); int scan_name(char *, char *); int saveit(char *); @@ -161,7 +161,7 @@ main(int argc, char *argv[]) } nflag = 0; rv = 0; - while (getline() > 0) { + while (get_line() > 0) { rv = 1; fprintf(ofp, "%s", buf); if (lend()) /* look for an 'end' statement */ @@ -252,7 +252,7 @@ get_name(char *name, int letters) } int -getline(void) +get_line(void) { int c; char *ptr; diff --git a/usr.bin/gencat/gencat.c b/usr.bin/gencat/gencat.c index dc9fa0597c6..da43b71bf1a 100644 --- a/usr.bin/gencat/gencat.c +++ b/usr.bin/gencat/gencat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gencat.c,v 1.14 2011/01/01 11:25:54 lum Exp $ */ +/* $OpenBSD: gencat.c,v 1.15 2012/03/04 04:05:15 fgsch Exp $ */ /* $NetBSD: gencat.c,v 1.9 1998/10/09 17:00:56 itohy Exp $ */ /*- @@ -106,7 +106,7 @@ extern char *__progname; /* from crt0.o */ static char *cskip(char *); static void error(char *, char *); static void nomem(void); -static char *getline(int); +static char *get_line(int); static char *getmsg(int, char *, char); static void warning(char *, char *); static char *wskip(char *); @@ -222,7 +222,7 @@ xstrdup(const char *str) } static char * -getline(int fd) +get_line(int fd) { static long curlen = BUFSIZ; static char buf[BUFSIZ], *bptr = buf, *bend = buf; @@ -325,7 +325,7 @@ getmsg(int fd, char *cptr, char quote) ++cptr; switch (*cptr) { case '\0': - cptr = getline(fd); + cptr = get_line(fd); if (!cptr) error(NULL, "premature end of file"); msglen += strlen(cptr); @@ -411,7 +411,7 @@ MCParse(int fd) /* XXX: init sethead? */ - while ((cptr = getline(fd))) { + while ((cptr = get_line(fd))) { if (*cptr == '$') { ++cptr; if (strncmp(cptr, "set", 3) == 0) { diff --git a/usr.bin/rcs/diff3.c b/usr.bin/rcs/diff3.c index bd4a4bd6fcd..d234ba7db81 100644 --- a/usr.bin/rcs/diff3.c +++ b/usr.bin/rcs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.32 2011/04/20 19:34:16 nicm Exp $ */ +/* $OpenBSD: diff3.c,v 1.33 2012/03/04 04:05:15 fgsch Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -131,7 +131,7 @@ static char f1mark[MAXPATHLEN], f3mark[MAXPATHLEN]; /* markers for -E and -X */ static int duplicate(struct range *, struct range *); static int edit(struct diff *, int, int); static char *getchange(FILE *); -static char *getline(FILE *, size_t *); +static char *get_line(FILE *, size_t *); static int number(char **); static ssize_t readin(char *, struct diff **); static int skip(int, int, char *); @@ -612,7 +612,7 @@ getchange(FILE *b) { char *line; - while ((line = getline(b, NULL))) { + while ((line = get_line(b, NULL))) { if (isdigit((unsigned char)line[0])) return (line); } @@ -621,7 +621,7 @@ getchange(FILE *b) } static char * -getline(FILE *b, size_t *n) +get_line(FILE *b, size_t *n) { char *cp; size_t len; @@ -823,7 +823,7 @@ skip(int i, int from, char *pr) char *line; for (n = 0; cline[i] < from - 1; n += j) { - if ((line = getline(fp[i], &j)) == NULL) + if ((line = get_line(fp[i], &j)) == NULL) return (-1); if (pr != NULL) diff_output("%s%s", pr, line); diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c index a496da41328..e0d4054ca51 100644 --- a/usr.bin/rs/rs.c +++ b/usr.bin/rs/rs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rs.c,v 1.20 2009/10/27 23:59:42 deraadt Exp $ */ +/* $OpenBSD: rs.c,v 1.21 2012/03/04 04:05:15 fgsch Exp $ */ /*- * Copyright (c) 1993 @@ -78,7 +78,7 @@ int owidth = 80, gutter = 2; void usage(void); void getargs(int, char *[]); void getfile(void); -int getline(void); +int get_line(void); char **getptrs(char **); void prepfile(void); void prints(char *, int); @@ -114,11 +114,11 @@ getfile(void) char **padto; while (skip--) { - getline(); + get_line(); if (flags & SKIPPRINT) puts(curline); } - getline(); + get_line(); if (flags & NOARGS && curlen < owidth) flags |= ONEPERLINE; if (flags & ONEPERLINE) @@ -164,7 +164,7 @@ getfile(void) INCR(ep); } } - } while (getline() != EOF); + } while (get_line() != EOF); *ep = NULL; /* mark end of pointers */ nelem = ep - elem; } @@ -303,7 +303,7 @@ prepfile(void) char ibuf[BSIZE]; /* two screenfuls should do */ int -getline(void) /* get line; maintain curline, curlen; manage storage */ +get_line(void) /* get line; maintain curline, curlen; manage storage */ { static int putlength; static char *endblock = ibuf + BSIZE; diff --git a/usr.bin/unifdef/unifdef.c b/usr.bin/unifdef/unifdef.c index 1e48be01954..c96f11f7eea 100644 --- a/usr.bin/unifdef/unifdef.c +++ b/usr.bin/unifdef/unifdef.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unifdef.c,v 1.14 2009/10/27 23:59:46 deraadt Exp $ */ +/* $OpenBSD: unifdef.c,v 1.15 2012/03/04 04:05:15 fgsch Exp $ */ /* * Copyright (c) 2002, 2003 Tony Finch <dot@dotat.at> * Copyright (c) 1985, 1993 @@ -183,7 +183,7 @@ static void debug(const char *, ...); static void error(const char *); static int findsym(const char *); static void flushline(bool); -static Linetype getline(void); +static Linetype get_line(void); static Linetype ifeval(const char **); static void ignoreoff(void); static void ignoreon(void); @@ -663,7 +663,7 @@ process(void) for (;;) { linenum++; - lineval = getline(); + lineval = get_line(); trans = trans_table[ifstate[depth]][lineval]; if (trans == NULL) break; @@ -681,7 +681,7 @@ process(void) * parser state between calls in a global variable. */ static Linetype -getline(void) +get_line(void) { const char *cp; int cursym; diff --git a/usr.bin/uudecode/uudecode.c b/usr.bin/uudecode/uudecode.c index c5f1b73a398..f59f5787b06 100644 --- a/usr.bin/uudecode/uudecode.c +++ b/usr.bin/uudecode/uudecode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uudecode.c,v 1.17 2009/10/27 23:59:46 deraadt Exp $ */ +/* $OpenBSD: uudecode.c,v 1.18 2012/03/04 04:05:15 fgsch Exp $ */ /* $FreeBSD: uudecode.c,v 1.49 2003/05/03 19:44:46 obrien Exp $ */ /*- @@ -304,7 +304,7 @@ decode2(void) } static int -getline(char *buf, size_t size) +get_line(char *buf, size_t size) { if (fgets(buf, size, infp) != NULL) return (2); @@ -341,7 +341,7 @@ uu_decode(void) /* for each input line */ for (;;) { - switch (getline(buf, sizeof(buf))) { + switch (get_line(buf, sizeof(buf))) { case 0: return (0); case 1: @@ -401,7 +401,7 @@ uu_decode(void) } } } - switch (getline(buf, sizeof(buf))) { + switch (get_line(buf, sizeof(buf))) { case 0: return (0); case 1: @@ -419,7 +419,7 @@ base64_decode(void) unsigned char outbuf[MAXPATHLEN * 4]; for (;;) { - switch (getline(inbuf, sizeof(inbuf))) { + switch (get_line(inbuf, sizeof(inbuf))) { case 0: return (0); case 1: |