Mercurial > hg > octave-lyh
changeset 1809:4100e0cb00a1
[project @ 1996-01-29 07:16:15 by jwe]
author | jwe |
---|---|
date | Mon, 29 Jan 1996 07:16:38 +0000 |
parents | 72b1c55692a2 |
children | f988f753ab52 |
files | src/parse.h src/utils.cc src/utils.h |
diffstat | 3 files changed, 0 insertions(+), 82 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parse.h +++ b/src/parse.h @@ -28,7 +28,6 @@ #include "SLStack.h" -extern void discard_until (char c); extern void reset_parser (void); extern int yylex (void); extern int yyparse (void);
--- a/src/utils.cc +++ b/src/utils.cc @@ -95,77 +95,6 @@ return tmp; } -#if 0 - -// Concatenate two strings. - -char * -strconcat (const char *s, const char *t) -{ - int len = strlen (s) + strlen (t); - char *tmp = new char [len+1]; - strcpy (tmp, s); - strcat (tmp, t); - return tmp; -} -#endif - -// Throw away input until a given character is read. - -void -discard_until (istream& stream, char character) -{ - int c; - for (;;) - { - stream >> c; - if (c == EOF || c == character) - break; - } - if (c != EOF) - stream.putback ((char) c); -} - -#if 0 - -// XXX UNTESTED XXX - -// Read input until a given character is read. Returns characters -// read in a new string that must be freed by the caller. - -char * -read_until (istream& stream, char character) -{ - int grow_size = 8; - int limit = grow_size; - char *buf = new char [limit]; - char *bp = buf; - - get_more: - is.getline (bp, limit, character); - - if (is.gcount () == 0) - { - delete [] buf; - return 0; - } - - if (is.gcount () == limit && buf[limit-1] != '\0') - { - char *tmp = new char [limit + grow_size]; - strcpy (tmp, buf); - delete [] buf; - buf = tmp; - bp = tmp + limit - 1; - limit += grow_size; - grow_size *= 2; - goto get_more; - } - - return buf; -} -#endif - // Return to the main command loop in octave.cc. extern "C" void
--- a/src/utils.h +++ b/src/utils.h @@ -34,16 +34,6 @@ extern char *strsave (const char *); -#if 0 -extern char *strconcat (const char *, const char *); -#endif - -extern void discard_until (istream&, char); - -#if 0 -extern char *read_until (istream&, char); -#endif - extern string search_path_for_file (const string&, const string&); extern string file_in_path (const string&, const string&); extern string fcn_file_in_path (const string&);