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 |
6109
|
39 extern OCTINTERP_API bool valid_identifier (const char *s); |
|
40 extern OCTINTERP_API bool valid_identifier (const std::string& s); |
607
|
41 |
6109
|
42 extern OCTINTERP_API int almost_match (const std::string& std, const std::string& s, |
287
|
43 int min_match_len = 1, int case_sens = 1); |
607
|
44 |
6109
|
45 extern OCTINTERP_API 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 |
6109
|
50 extern OCTINTERP_API int empty_arg (const char *name, octave_idx_type nr, octave_idx_type nc); |
628
|
51 |
6109
|
52 extern OCTINTERP_API std::string |
4243
|
53 search_path_for_file (const std::string&, const string_vector&); |
4216
|
54 |
6109
|
55 extern OCTINTERP_API string_vector |
4243
|
56 search_path_for_all_files (const std::string&, const string_vector&); |
4216
|
57 |
6109
|
58 extern OCTINTERP_API std::string file_in_path (const std::string&, const std::string&); |
|
59 extern OCTINTERP_API std::string fcn_file_in_path (const std::string&); |
|
60 extern OCTINTERP_API std::string oct_file_in_path (const std::string&); |
|
61 extern OCTINTERP_API std::string mex_file_in_path (const std::string&); |
2042
|
62 |
6109
|
63 extern OCTINTERP_API std::string do_string_escapes (const std::string& s); |
3103
|
64 |
6109
|
65 extern OCTINTERP_API const char *undo_string_escape (char c); |
4143
|
66 |
6109
|
67 extern OCTINTERP_API std::string undo_string_escapes (const std::string& s); |
801
|
68 |
6109
|
69 extern OCTINTERP_API void |
4513
|
70 check_dimensions (dim_vector& dim, const char *warnfor); |
4481
|
71 |
6109
|
72 extern OCTINTERP_API void |
4481
|
73 get_dimensions (const octave_value& a, const char *warn_for, |
4513
|
74 dim_vector& dim); |
4481
|
75 |
6109
|
76 extern OCTINTERP_API 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 |
6109
|
80 extern OCTINTERP_API void |
3354
|
81 get_dimensions (const octave_value& a, |
5275
|
82 const char *warn_for, octave_idx_type& nr, octave_idx_type& nc); |
3354
|
83 |
6109
|
84 extern OCTINTERP_API Matrix identity_matrix (octave_idx_type nr, octave_idx_type nc); |
4478
|
85 |
6109
|
86 extern OCTINTERP_API int |
3622
|
87 octave_format (std::ostream& os, const char *fmt, ...); |
3620
|
88 |
6109
|
89 extern OCTINTERP_API int |
3622
|
90 octave_vformat (std::ostream& os, const char *fmt, va_list args); |
3620
|
91 |
6109
|
92 extern OCTINTERP_API char *octave_vsnprintf (const char *fmt, va_list args); |
4302
|
93 |
6109
|
94 extern OCTINTERP_API char *octave_snprintf (const char *fmt, ...); |
4302
|
95 |
6109
|
96 extern OCTINTERP_API void octave_sleep (double seconds); |
3308
|
97 |
6109
|
98 extern "C" OCTINTERP_API void octave_sleep (unsigned int seconds); |
4067
|
99 |
6109
|
100 extern "C" OCTINTERP_API void octave_usleep (unsigned int useconds); |
4086
|
101 |
6109
|
102 extern "C" OCTINTERP_API int octave_raw_vsnprintf (char *buf, size_t n, const char *fmt, |
4302
|
103 va_list args); |
3620
|
104 |
1
|
105 #endif |
|
106 |
|
107 /* |
|
108 ;;; Local Variables: *** |
|
109 ;;; mode: C++ *** |
|
110 ;;; End: *** |
|
111 */ |