# HG changeset patch # User John W. Eaton # Date 1312468777 14400 # Node ID f3a8d1efe2c1e48800cbb8d83063cf12b24c8c0d # Parent e116dd862879393078bf002ac6fb14a8f399f175 use gnulib:: qualifiers for more stdio functions * oct-parse.yy (text_getc): Use gnulib::getc instead of getc. (looking_at_classdef_keyword, looking_at_funciton_keyword): Use gnulib::ftell, gnulib::fseek, and gnulib::fgets instead of ftell, fseek, and fgets. * file-io.cc (Fmkstemp): Use gnulib::mkstemp instead of mkstemp. * lo-utils.cc (octave_fgets): Use gnulib::fgets instead of fgets. * c-file-ptr-stream.h (c_file_ptr_buf::seek): Use gnulib::fseek instead of fseek. (c_file_ptr_buf::tell): Use gnulib::ftell instead of ftell. diff --git a/liboctave/lo-utils.cc b/liboctave/lo-utils.cc --- a/liboctave/lo-utils.cc +++ b/liboctave/lo-utils.cc @@ -124,7 +124,7 @@ do { - if (fgets (bufptr, grow_size, f)) + if (gnulib::fgets (bufptr, grow_size, f)) { len = strlen (bufptr); diff --git a/src/c-file-ptr-stream.h b/src/c-file-ptr-stream.h --- a/src/c-file-ptr-stream.h +++ b/src/c-file-ptr-stream.h @@ -75,9 +75,9 @@ int file_number () const { return f ? fileno (f) : -1; } int seek (long offset, int origin) - { return f ? fseek (f, offset, origin) : -1; } + { return f ? gnulib::fseek (f, offset, origin) : -1; } - long tell (void) { return f ? ftell (f) : -1; } + long tell (void) { return f ? gnulib::ftell (f) : -1; } void clear (void) { if (f) clearerr (f); } diff --git a/src/file-io.cc b/src/file-io.cc --- a/src/file-io.cc +++ b/src/file-io.cc @@ -1989,7 +1989,7 @@ OCTAVE_LOCAL_BUFFER (char, tmp, tmpl8.size () + 1); strcpy (tmp, tmpl8.c_str ()); - int fd = mkstemp (tmp); + int fd = gnulib::mkstemp (tmp); if (fd < 0) { diff --git a/src/oct-parse.yy b/src/oct-parse.yy --- a/src/oct-parse.yy +++ b/src/oct-parse.yy @@ -3287,13 +3287,13 @@ static int text_getc (FILE *f) { - int c = getc (f); + int c = gnulib::getc (f); // Convert CRLF into just LF and single CR into LF. if (c == '\r') { - c = getc (f); + c = gnulib::getc (f); if (c != '\n') { @@ -3368,16 +3368,16 @@ { bool status = false; - long pos = ftell (ffile); + long pos = gnulib::ftell (ffile); char buf [10]; - fgets (buf, 10, ffile); + gnulib::fgets (buf, 10, ffile); size_t len = strlen (buf); if (len > 8 && strncmp (buf, "classdef", 8) == 0 && ! (isalnum (buf[8]) || buf[8] == '_')) status = true; - fseek (ffile, pos, SEEK_SET); + gnulib::fseek (ffile, pos, SEEK_SET); return status; } @@ -3428,16 +3428,16 @@ { bool status = false; - long pos = ftell (ffile); + long pos = gnulib::ftell (ffile); char buf [10]; - fgets (buf, 10, ffile); + gnulib::fgets (buf, 10, ffile); size_t len = strlen (buf); if (len > 8 && strncmp (buf, "function", 8) == 0 && ! (isalnum (buf[8]) || buf[8] == '_')) status = true; - fseek (ffile, pos, SEEK_SET); + gnulib::fseek (ffile, pos, SEEK_SET); return status; }