Mercurial > hg > octave-terminal
changeset 3350:729ad2b6a052
[project @ 1999-11-12 16:18:16 by jwe]
author | jwe |
---|---|
date | Fri, 12 Nov 1999 16:18:17 +0000 |
parents | a007eb407ff5 |
children | 8623649c967c |
files | src/ChangeLog src/cutils.c src/utils.cc src/utils.h |
diffstat | 4 files changed, 29 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +1999-11-12 John W. Eaton <jwe@bevo.che.wisc.edu> + + * utils.cc (jump_to_top_level): No longer declared extern "C". + + * cutils.c (octave_strcasecmp, octave_strncasecmp): New functions. + * utils.cc (almost_match): Call octave_strncasecmp instead of + calling strncasecmp directly. + 1999-11-10 John W. Eaton <jwe@bevo.che.wisc.edu> * parse.y: Don't define warn_reload_forces_clear here.
--- a/src/cutils.c +++ b/src/cutils.c @@ -39,6 +39,8 @@ #include <sys/poll.h> #endif +#include <string.h> + static void do_octave_usleep (unsigned int useconds) { @@ -78,6 +80,18 @@ do_octave_usleep (usec); } +int +octave_strcasecmp (const char *s1, const char *s2) +{ + return strcasecmp (s1, s2); +} + +int +octave_strncasecmp (const char *s1, const char *s2, size_t n) +{ + return strncasecmp (s1, s2, n); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/src/utils.cc +++ b/src/utils.cc @@ -51,10 +51,6 @@ LOSE! LOSE! #endif -#ifndef HAVE_STRNCASECMP -extern "C" int strncasecmp (const char*, const char*, size_t); -#endif - #include "SLStack.h" #include "dir-ops.h" @@ -85,7 +81,7 @@ // Return to the main command loop in octave.cc. -extern "C" void +void jump_to_top_level (void) { unwind_protect::run_all (); @@ -104,7 +100,7 @@ && slen >= min_match_len && (case_sens ? (strncmp (std.c_str (), s.c_str (), slen) == 0) - : (strncasecmp (std.c_str (), s.c_str (), slen) == 0))); + : (octave_strncasecmp (std.c_str (), s.c_str (), slen) == 0))); } // Ugh.
--- a/src/utils.h +++ b/src/utils.h @@ -38,7 +38,7 @@ extern string fcn_file_in_path (const string&); extern string oct_file_in_path (const string&); -extern "C" void jump_to_top_level (void) GCC_ATTR_NORETURN; +extern void jump_to_top_level (void) GCC_ATTR_NORETURN; extern int almost_match (const string& std, const string& s, int min_match_len = 1, int case_sens = 1); @@ -60,6 +60,10 @@ extern "C" void octave_usleep (unsigned int useconds); +extern "C" int octave_strcasecmp (const char *s1, const char *s2); + +extern "C" int octave_strncasecmp (const char *s1, const char *s2, size_t n); + #endif /*