Mercurial > hg > octave-nkf
annotate src/utils.h @ 10825:cace99cb01ab
rewrite logm (M. Caliari, R.T. Guy)
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 28 Jul 2010 09:22:41 +0200 |
parents | f3b65e1ae355 |
children | e4e82740e9cd |
rev | line source |
---|---|
1 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, |
8920 | 4 2003, 2005, 2006, 2007, 2008 John W. Eaton |
1 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
1 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
1 | 21 |
22 */ | |
23 | |
383 | 24 #if !defined (octave_utils_h) |
25 #define octave_utils_h 1 | |
1 | 26 |
3620 | 27 #include <cstdarg> |
28 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
29 #include <iosfwd> |
1755 | 30 #include <string> |
10033
f349847c4541
optimize cellfun (@subsref, args, {subs}, uniformoutput, true) case
Jaroslav Hajek <highegg@gmail.com>
parents:
9705
diff
changeset
|
31 #include <list> |
1755 | 32 |
4478 | 33 #include "dMatrix.h" |
1966 | 34 #include "lo-utils.h" |
35 | |
3354 | 36 class octave_value; |
2086 | 37 class octave_value_list; |
1755 | 38 class string_vector; |
1 | 39 |
6109 | 40 extern OCTINTERP_API bool valid_identifier (const char *s); |
41 extern OCTINTERP_API bool valid_identifier (const std::string& s); | |
607 | 42 |
6323 | 43 extern OCTINTERP_API bool |
44 same_file (const std::string& f, const std::string& g); | |
45 | |
46 extern OCTINTERP_API int almost_match (const std::string& std, | |
10313 | 47 const std::string& s, |
48 int min_match_len = 1, | |
49 int case_sens = 1); | |
607 | 50 |
6109 | 51 extern OCTINTERP_API int |
3072 | 52 keyword_almost_match (const char * const *std, int *min_len, |
10313 | 53 const std::string& s, int min_toks_to_match, |
54 int max_toks); | |
1755 | 55 |
6323 | 56 extern OCTINTERP_API int empty_arg (const char *name, octave_idx_type nr, |
10313 | 57 octave_idx_type nc); |
628 | 58 |
6109 | 59 extern OCTINTERP_API std::string |
4243 | 60 search_path_for_file (const std::string&, const string_vector&); |
4216 | 61 |
6109 | 62 extern OCTINTERP_API string_vector |
4243 | 63 search_path_for_all_files (const std::string&, const string_vector&); |
4216 | 64 |
6323 | 65 extern OCTINTERP_API std::string |
66 file_in_path (const std::string&, const std::string&); | |
67 | |
8041
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
7789
diff
changeset
|
68 extern OCTINTERP_API std::string contents_file_in_path (const std::string&); |
a14bdf90be55
Add a search for Contents.m files to the help function
David Bateman <dbateman@free.fr>
parents:
7789
diff
changeset
|
69 |
6109 | 70 extern OCTINTERP_API std::string fcn_file_in_path (const std::string&); |
71 extern OCTINTERP_API std::string oct_file_in_path (const std::string&); | |
72 extern OCTINTERP_API std::string mex_file_in_path (const std::string&); | |
2042 | 73 |
6109 | 74 extern OCTINTERP_API std::string do_string_escapes (const std::string& s); |
3103 | 75 |
6109 | 76 extern OCTINTERP_API const char *undo_string_escape (char c); |
4143 | 77 |
6109 | 78 extern OCTINTERP_API std::string undo_string_escapes (const std::string& s); |
801 | 79 |
6109 | 80 extern OCTINTERP_API void |
4513 | 81 check_dimensions (dim_vector& dim, const char *warnfor); |
4481 | 82 |
6109 | 83 extern OCTINTERP_API void |
4481 | 84 get_dimensions (const octave_value& a, const char *warn_for, |
4513 | 85 dim_vector& dim); |
4481 | 86 |
6109 | 87 extern OCTINTERP_API void |
3354 | 88 get_dimensions (const octave_value& a, const octave_value& b, |
10313 | 89 const char *warn_for, octave_idx_type& nr, |
90 octave_idx_type& nc); | |
3354 | 91 |
6109 | 92 extern OCTINTERP_API void |
6323 | 93 get_dimensions (const octave_value& a,const char *warn_for, |
10313 | 94 octave_idx_type& nr, octave_idx_type& nc); |
3354 | 95 |
9705
5acd99c3e794
avoid recursive overloaded calls in builtin numel
Jaroslav Hajek <highegg@gmail.com>
parents:
8950
diff
changeset
|
96 extern OCTINTERP_API octave_idx_type |
5acd99c3e794
avoid recursive overloaded calls in builtin numel
Jaroslav Hajek <highegg@gmail.com>
parents:
8950
diff
changeset
|
97 dims_to_numel (const dim_vector& dims, const octave_value_list& idx); |
5acd99c3e794
avoid recursive overloaded calls in builtin numel
Jaroslav Hajek <highegg@gmail.com>
parents:
8950
diff
changeset
|
98 |
10033
f349847c4541
optimize cellfun (@subsref, args, {subs}, uniformoutput, true) case
Jaroslav Hajek <highegg@gmail.com>
parents:
9705
diff
changeset
|
99 extern OCTINTERP_API void |
f349847c4541
optimize cellfun (@subsref, args, {subs}, uniformoutput, true) case
Jaroslav Hajek <highegg@gmail.com>
parents:
9705
diff
changeset
|
100 decode_subscripts (const char* name, const octave_value& arg, |
10313 | 101 std::string& type_string, |
102 std::list<octave_value_list>& idx); | |
9705
5acd99c3e794
avoid recursive overloaded calls in builtin numel
Jaroslav Hajek <highegg@gmail.com>
parents:
8950
diff
changeset
|
103 |
6323 | 104 extern OCTINTERP_API Matrix |
105 identity_matrix (octave_idx_type nr, octave_idx_type nc); | |
4478 | 106 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
107 extern OCTINTERP_API FloatMatrix |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
108 float_identity_matrix (octave_idx_type nr, octave_idx_type nc); |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
109 |
6109 | 110 extern OCTINTERP_API int |
3622 | 111 octave_format (std::ostream& os, const char *fmt, ...); |
3620 | 112 |
6109 | 113 extern OCTINTERP_API int |
3622 | 114 octave_vformat (std::ostream& os, const char *fmt, va_list args); |
3620 | 115 |
6109 | 116 extern OCTINTERP_API char *octave_vsnprintf (const char *fmt, va_list args); |
4302 | 117 |
6109 | 118 extern OCTINTERP_API char *octave_snprintf (const char *fmt, ...); |
4302 | 119 |
6109 | 120 extern OCTINTERP_API void octave_sleep (double seconds); |
3308 | 121 |
6109 | 122 extern "C" OCTINTERP_API void octave_sleep (unsigned int seconds); |
4067 | 123 |
6109 | 124 extern "C" OCTINTERP_API void octave_usleep (unsigned int useconds); |
4086 | 125 |
6323 | 126 extern "C" OCTINTERP_API int |
127 octave_raw_vsnprintf (char *buf, size_t n, const char *fmt, va_list args); | |
3620 | 128 |
10086
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
129 extern OCTINTERP_API |
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
130 octave_value_list |
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
131 do_simple_cellfun (octave_value_list (*fun) (const octave_value_list&, int), |
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
132 const char *fun_name, const octave_value_list& args, |
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
133 int nargout); |
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
134 |
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
135 extern OCTINTERP_API |
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
136 octave_value |
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
137 do_simple_cellfun (octave_value_list (*fun) (const octave_value_list&, int), |
76df75b10c80
allow more cells in strfind/strrep + supply a general mechanism
Jaroslav Hajek <highegg@gmail.com>
parents:
10033
diff
changeset
|
138 const char *fun_name, const octave_value_list& args); |
1 | 139 #endif |