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&); |
2042
|
61 |
3523
|
62 extern std::string do_string_escapes (const std::string& s); |
3103
|
63 |
4143
|
64 extern const char *undo_string_escape (char c); |
|
65 |
3523
|
66 extern std::string undo_string_escapes (const std::string& s); |
801
|
67 |
3523
|
68 extern int check_preference (const std::string& var); |
2204
|
69 |
3354
|
70 extern void |
4513
|
71 check_dimensions (dim_vector& dim, const char *warnfor); |
4481
|
72 |
|
73 extern void |
|
74 get_dimensions (const octave_value& a, const char *warn_for, |
4513
|
75 dim_vector& dim); |
4481
|
76 |
|
77 extern void |
3354
|
78 get_dimensions (const octave_value& a, const octave_value& b, |
5275
|
79 const char *warn_for, octave_idx_type& nr, octave_idx_type& nc); |
3354
|
80 |
|
81 extern void |
|
82 get_dimensions (const octave_value& a, |
5275
|
83 const char *warn_for, octave_idx_type& nr, octave_idx_type& nc); |
3354
|
84 |
5275
|
85 extern Matrix identity_matrix (octave_idx_type nr, octave_idx_type nc); |
4478
|
86 |
3620
|
87 extern int |
3622
|
88 octave_format (std::ostream& os, const char *fmt, ...); |
3620
|
89 |
|
90 extern int |
3622
|
91 octave_vformat (std::ostream& os, const char *fmt, va_list args); |
3620
|
92 |
4302
|
93 extern char *octave_vsnprintf (const char *fmt, va_list args); |
|
94 |
|
95 extern char *octave_snprintf (const char *fmt, ...); |
|
96 |
4086
|
97 extern void octave_sleep (double seconds); |
3308
|
98 |
4067
|
99 extern "C" void octave_sleep (unsigned int seconds); |
|
100 |
4086
|
101 extern "C" void octave_usleep (unsigned int useconds); |
|
102 |
3350
|
103 extern "C" int octave_strcasecmp (const char *s1, const char *s2); |
|
104 |
|
105 extern "C" int octave_strncasecmp (const char *s1, const char *s2, size_t n); |
|
106 |
4302
|
107 extern "C" int octave_raw_vsnprintf (char *buf, size_t n, const char *fmt, |
|
108 va_list args); |
3620
|
109 |
1
|
110 #endif |
|
111 |
|
112 /* |
|
113 ;;; Local Variables: *** |
|
114 ;;; mode: C++ *** |
|
115 ;;; End: *** |
|
116 */ |