From dd9470cb58f9c668279aa8dab8164440b73daaad Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 29 Jun 1998 02:11:07 +0000 Subject: Change all uses of unlocked-wrapped functions to their upper case wrapper names. --- src/paste.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'src/paste.c') diff --git a/src/paste.c b/src/paste.c index 9f9850972..abb856c6d 100644 --- a/src/paste.c +++ b/src/paste.c @@ -230,10 +230,10 @@ paste_parallel (int nfiles, char **fnamptr) line_length = 0; /* Clear so we can easily detect EOF. */ if (fileptr[i] != CLOSED) { - chr = getc (fileptr[i]); + chr = GETC (fileptr[i]); if (chr != EOF && delims_saved) { - fwrite (delbuf, sizeof (char), delims_saved, stdout); + FWRITE (delbuf, sizeof (char), delims_saved, stdout); delims_saved = 0; } @@ -242,8 +242,8 @@ paste_parallel (int nfiles, char **fnamptr) line_length++; if (chr == '\n') break; - putc (chr, stdout); - chr = getc (fileptr[i]); + PUTC (chr, stdout); + chr = GETC (fileptr[i]); } } @@ -253,14 +253,14 @@ paste_parallel (int nfiles, char **fnamptr) If an EOF or error, close the file and mark it in the list. */ if (fileptr[i] != CLOSED) { - if (ferror (fileptr[i])) + if (FERROR (fileptr[i])) { error (0, errno, "%s", fnamptr[i]); errors = 1; } if (fileptr[i] == stdin) - clearerr (fileptr[i]); /* Also clear EOF. */ - else if (fclose (fileptr[i]) == EOF) + CLEARERR (fileptr[i]); /* Also clear EOF. */ + else if (FCLOSE (fileptr[i]) == EOF) { error (0, errno, "%s", fnamptr[i]); errors = 1; @@ -279,10 +279,10 @@ paste_parallel (int nfiles, char **fnamptr) /* No. Some files were not closed for this line. */ if (delims_saved) { - fwrite (delbuf, sizeof (char), delims_saved, stdout); + FWRITE (delbuf, sizeof (char), delims_saved, stdout); delims_saved = 0; } - putc ('\n', stdout); + PUTC ('\n', stdout); } continue; /* Next read of files, or exit. */ } @@ -304,14 +304,14 @@ paste_parallel (int nfiles, char **fnamptr) if (fileptr[i + 1] != ENDLIST) { if (chr != '\n') - putc (chr, stdout); + PUTC (chr, stdout); if (*delimptr != EMPTY_DELIM) - putc (*delimptr, stdout); + PUTC (*delimptr, stdout); if (++delimptr == delim_end) delimptr = delims; } else - putc (chr, stdout); + PUTC (chr, stdout); } } } @@ -350,7 +350,7 @@ paste_serial (int nfiles, char **fnamptr) delimptr = delims; /* Set up for delimiter string. */ - charold = getc (fileptr); + charold = GETC (fileptr); if (charold != EOF) { /* `charold' is set up. Hit it! @@ -359,38 +359,38 @@ paste_serial (int nfiles, char **fnamptr) character if needed. After the EOF, output `charold' if it's a newline; otherwise, output it and then a newline. */ - while ((charnew = getc (fileptr)) != EOF) + while ((charnew = GETC (fileptr)) != EOF) { /* Process the old character. */ if (charold == '\n') { if (*delimptr != EMPTY_DELIM) - putc (*delimptr, stdout); + PUTC (*delimptr, stdout); if (++delimptr == delim_end) delimptr = delims; } else - putc (charold, stdout); + PUTC (charold, stdout); charold = charnew; } /* Hit EOF. Process that last character. */ - putc (charold, stdout); + PUTC (charold, stdout); } if (charold != '\n') - putc ('\n', stdout); + PUTC ('\n', stdout); - if (ferror (fileptr)) + if (FERROR (fileptr)) { error (0, errno, "%s", *fnamptr); errors = 1; } if (fileptr == stdin) - clearerr (fileptr); /* Also clear EOF. */ - else if (fclose (fileptr) == EOF) + CLEARERR (fileptr); /* Also clear EOF. */ + else if (FCLOSE (fileptr) == EOF) { error (0, errno, "%s", *fnamptr); errors = 1; @@ -485,9 +485,9 @@ main (int argc, char **argv) exit_status = paste_parallel (argc - optind, &argv[optind]); else exit_status = paste_serial (argc - optind, &argv[optind]); - if (have_read_stdin && fclose (stdin) == EOF) + if (have_read_stdin && FCLOSE (stdin) == EOF) error (EXIT_FAILURE, errno, "-"); - if (ferror (stdout) || fclose (stdout) == EOF) + if (FERROR (stdout) || fclose (stdout) == EOF) error (EXIT_FAILURE, errno, _("write error")); exit (exit_status == 0 ? EXIT_SUCCESS : EXIT_FAILURE); } -- cgit v1.2.3-54-g00ecf