1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
1
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_utils_h) |
|
25 #define octave_utils_h 1 |
1
|
26 |
3620
|
27 #include <cstdarg> |
|
28 |
3503
|
29 #include <iostream> |
1755
|
30 #include <string> |
|
31 |
4478
|
32 #include "dMatrix.h" |
1966
|
33 #include "lo-utils.h" |
|
34 |
3354
|
35 class octave_value; |
2086
|
36 class octave_value_list; |
1755
|
37 class string_vector; |
1
|
38 |
4143
|
39 extern bool valid_identifier (const char *s); |
|
40 extern bool valid_identifier (const std::string& s); |
607
|
41 |
3523
|
42 extern int almost_match (const std::string& std, const std::string& s, |
287
|
43 int min_match_len = 1, int case_sens = 1); |
607
|
44 |
1755
|
45 extern int |
3072
|
46 keyword_almost_match (const char * const *std, int *min_len, |
3523
|
47 const std::string& s, int min_toks_to_match, |
1755
|
48 int max_toks); |
|
49 |
5275
|
50 extern int empty_arg (const char *name, octave_idx_type nr, octave_idx_type nc); |
628
|
51 |
4216
|
52 extern std::string |
4243
|
53 search_path_for_file (const std::string&, const string_vector&); |
4216
|
54 |
|
55 extern string_vector |
4243
|
56 search_path_for_all_files (const std::string&, const string_vector&); |
4216
|
57 |
4143
|
58 extern std::string file_in_path (const std::string&, const std::string&); |
|
59 extern std::string fcn_file_in_path (const std::string&); |
|
60 extern std::string oct_file_in_path (const std::string&); |
5864
|
61 extern std::string mex_file_in_path (const std::string&); |
2042
|
62 |
3523
|
63 extern std::string do_string_escapes (const std::string& s); |
3103
|
64 |
4143
|
65 extern const char *undo_string_escape (char c); |
|
66 |
3523
|
67 extern std::string undo_string_escapes (const std::string& s); |
801
|
68 |
3354
|
69 extern void |
4513
|
70 check_dimensions (dim_vector& dim, const char *warnfor); |
4481
|
71 |
|
72 extern void |
|
73 get_dimensions (const octave_value& a, const char *warn_for, |
4513
|
74 dim_vector& dim); |
4481
|
75 |
|
76 extern void |
3354
|
77 get_dimensions (const octave_value& a, const octave_value& b, |
5275
|
78 const char *warn_for, octave_idx_type& nr, octave_idx_type& nc); |
3354
|
79 |
|
80 extern void |
|
81 get_dimensions (const octave_value& a, |
5275
|
82 const char *warn_for, octave_idx_type& nr, octave_idx_type& nc); |
3354
|
83 |
5275
|
84 extern Matrix identity_matrix (octave_idx_type nr, octave_idx_type nc); |
4478
|
85 |
3620
|
86 extern int |
3622
|
87 octave_format (std::ostream& os, const char *fmt, ...); |
3620
|
88 |
|
89 extern int |
3622
|
90 octave_vformat (std::ostream& os, const char *fmt, va_list args); |
3620
|
91 |
4302
|
92 extern char *octave_vsnprintf (const char *fmt, va_list args); |
|
93 |
|
94 extern char *octave_snprintf (const char *fmt, ...); |
|
95 |
4086
|
96 extern void octave_sleep (double seconds); |
3308
|
97 |
4067
|
98 extern "C" void octave_sleep (unsigned int seconds); |
|
99 |
4086
|
100 extern "C" void octave_usleep (unsigned int useconds); |
|
101 |
3350
|
102 extern "C" int octave_strcasecmp (const char *s1, const char *s2); |
|
103 |
|
104 extern "C" int octave_strncasecmp (const char *s1, const char *s2, size_t n); |
|
105 |
4302
|
106 extern "C" int octave_raw_vsnprintf (char *buf, size_t n, const char *fmt, |
|
107 va_list args); |
3620
|
108 |
1
|
109 #endif |
|
110 |
|
111 /* |
|
112 ;;; Local Variables: *** |
|
113 ;;; mode: C++ *** |
|
114 ;;; End: *** |
|
115 */ |