diff options
author | Zack Weinberg <zack@rabi.columbia.edu> | 1999-05-10 11:24:36 -0400 |
---|---|---|
committer | Dave Brolley <brolley@gcc.gnu.org> | 1999-05-10 11:24:36 -0400 |
commit | 2c826217f4703c5d4f7b5739607743f693e92842 (patch) | |
tree | 82da63a000e57cc2f3aa9bf724d12d755a4e166f /gcc/cpplib.h | |
parent | 4338f578a7e549d521d9f8b80a8f0eaca39d1fee (diff) | |
download | gcc-2c826217f4703c5d4f7b5739607743f693e92842.zip gcc-2c826217f4703c5d4f7b5739607743f693e92842.tar.gz gcc-2c826217f4703c5d4f7b5739607743f693e92842.tar.bz2 |
cppfiles.c (initialize_input_buffer): New function.
1999-05-10 18:21 -0400 Zack Weinberg <zack@rabi.columbia.edu>
* cppfiles.c (initialize_input_buffer): New function.
(finclude): Call it, if pfile->input_buffer is NULL. Accept
any character device as an input file.
(read_and_prescan): Use pfile->input_buffer and
pfile->input_speccase.
* cppinit.c (cpp_cleanup): Free pfile->input_buffer and
pfile->input_speccase.
* cpplib.h (cpp_reader): Add input_buffer, input_speccase, and
input_buffer_len members. Use memcpy in CPP_PUTS_Q.
* cppmain.c: Buffer output in the token_buffer; throttle
number of calls to fwrite; check for errors from fwrite.
From-SVN: r26869
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r-- | gcc/cpplib.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h index 45f025e..aadec44 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -241,6 +241,13 @@ struct cpp_reader /* Number of bytes since the last newline. */ int deps_column; + + /* A buffer and a table, used only by read_and_prescan (in cppfiles.c) + which are allocated once per cpp_reader object to keep them off the + stack and avoid setup costs. */ + U_CHAR *input_buffer; + U_CHAR *input_speccase; + size_t input_buffer_len; }; #define CPP_FATAL_LIMIT 1000 @@ -269,7 +276,7 @@ struct cpp_reader /* Append string STR (of length N) to PFILE's output buffer. Assume there is enough space. */ #define CPP_PUTS_Q(PFILE, STR, N) \ - (bcopy (STR, (PFILE)->limit, (N)), (PFILE)->limit += (N)) + (memcpy ((PFILE)->limit, STR, (N)), (PFILE)->limit += (N)) /* Append string STR (of length N) to PFILE's output buffer. Make space. */ #define CPP_PUTS(PFILE, STR, N) CPP_RESERVE(PFILE, N), CPP_PUTS_Q(PFILE, STR,N) /* Append character CH to PFILE's output buffer. Assume sufficient space. */ |