Mercurial > hg > octave-thorsten
diff src/utils.cc @ 581:bc813f5eb025
[project @ 1994-08-07 01:02:15 by jwe]
author | jwe |
---|---|
date | Sun, 07 Aug 1994 01:02:15 +0000 (1994-08-07) |
parents | d169be9237fb |
children | ae3b8b2924a0 |
line wrap: on
line diff
--- a/src/utils.cc +++ b/src/utils.cc @@ -47,8 +47,6 @@ #include <sys/param.h> #include <setjmp.h> #include <string.h> -#include <stdlib.h> -#include <stdio.h> #include <limits.h> #include <iostream.h> #include <strstream.h> @@ -75,7 +73,7 @@ LOSE! LOSE! #endif -char *tilde_expand (char *s); /* From readline's tilde.c */ +#include <readline/tilde.h> } // This mess suggested by the autoconf manual. @@ -118,9 +116,8 @@ // Top level context (?) extern jmp_buf toplevel; -/* - * Save a string. - */ +// Save a string. + char * strsave (const char *s) { @@ -133,9 +130,8 @@ return tmp; } -/* - * Concatenate two strings. - */ +// Concatenate two strings. + char * strconcat (const char *s, const char *t) { @@ -145,9 +141,8 @@ return strcat (tmp, t); } -/* - * Throw away input until a given character is read. - */ +// Throw away input until a given character is read. + void discard_until (istream& stream, char character) { @@ -211,9 +206,8 @@ return path; } -/* - * Return to the main command loop in octave.cc. - */ +// Return to the main command loop in octave.cc. + void jump_to_top_level (void) { @@ -236,9 +230,8 @@ : (strncasecmp (std, s, slen) == 0))); } -/* - * Ugh. - */ +// Ugh. + int keyword_almost_match (const char **std, int *min_len, const char *s, int min_toks_to_match, int max_toks) @@ -473,10 +466,9 @@ return argv; } -/* - * Format a list in neat columns. Mostly stolen from GNU ls. This - * should maybe be in utils.cc. - */ +// Format a list in neat columns. Mostly stolen from GNU ls. This +// should maybe be in utils.cc. + ostrstream& list_in_columns (ostrstream& os, char **list) { @@ -541,9 +533,8 @@ return os; } -/* - * See if the given file is in the path. - */ +// See if the given file is in the path. + char * file_in_path (const char *name, const char *suffix) { @@ -587,20 +578,18 @@ return retval; } -/* - * See if there is an function file in the path. If so, return the - * full path to the file. - */ +// See if there is an function file in the path. If so, return the +// full path to the file. + char * fcn_file_in_path (const char *name) { return file_in_path (name, ".m"); } -/* - * See if there is an octave file in the path. If so, return the - * full path to the file. - */ +// See if there is an octave file in the path. If so, return the +// full path to the file. + char * oct_file_in_path (const char *name) {