1
|
1 // Builtin function support. -*- C++ -*- |
|
2 /* |
|
3 |
296
|
4 Copyright (C) 1992, 1993, 1994 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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_builtins_h) |
|
25 #define octave_builtins_h 1 |
1
|
26 |
181
|
27 class ostrstream; |
164
|
28 class Complex; |
|
29 struct help_list; |
1
|
30 |
|
31 #ifndef MAPPER_FCN_TYPEDEFS |
|
32 #define MAPPER_FCN_TYPEDEFS 1 |
|
33 |
|
34 typedef double (*d_d_Mapper)(double); |
|
35 typedef double (*d_c_Mapper)(const Complex&); |
|
36 typedef Complex (*c_c_Mapper)(const Complex&); |
|
37 |
|
38 #endif |
|
39 |
330
|
40 // If can_return_complex_for_real_arg is 1, lower_limit and |
|
41 // upper_limit specify the range of values for which a real arg |
|
42 // returns a real value. Outside that range, we have to convert args |
|
43 // to complex, and call the complex valued function. |
|
44 // |
|
45 // If can_return_complex_for_real_arg is 0, lower_limit and |
|
46 // upper_limit are ignored. |
|
47 |
1
|
48 struct Mapper_fcn |
|
49 { |
330
|
50 int can_return_complex_for_real_arg; |
|
51 double lower_limit; |
|
52 double upper_limit; |
1
|
53 d_d_Mapper d_d_mapper; |
|
54 d_c_Mapper d_c_mapper; |
|
55 c_c_Mapper c_c_mapper; |
|
56 }; |
|
57 |
|
58 struct builtin_mapper_functions |
|
59 { |
|
60 char *name; |
330
|
61 int can_return_complex_for_real_arg; |
|
62 double lower_limit; |
|
63 double upper_limit; |
1
|
64 d_d_Mapper d_d_mapper; |
|
65 d_c_Mapper d_c_mapper; |
|
66 c_c_Mapper c_c_mapper; |
|
67 char *help_string; |
|
68 }; |
|
69 |
|
70 #ifndef SV_FUNCTION_TYPEDEFS |
|
71 #define SV_FUNCTION_TYPEDEFS 1 |
|
72 |
|
73 typedef int (*sv_Function)(void); |
|
74 |
|
75 #endif |
|
76 |
|
77 struct builtin_string_variables |
|
78 { |
|
79 char *name; |
|
80 char *value; |
|
81 sv_Function sv_function; |
|
82 char *help_string; |
|
83 }; |
|
84 |
|
85 extern void install_builtins (void); |
164
|
86 extern int is_text_function_name (const char *s); |
1
|
87 |
|
88 extern help_list *builtin_mapper_functions_help (void); |
|
89 extern help_list *builtin_general_functions_help (void); |
|
90 extern help_list *builtin_text_functions_help (void); |
|
91 extern help_list *builtin_variables_help (void); |
|
92 |
181
|
93 extern int help_from_list (ostrstream& output_buf, |
|
94 const help_list *list, const char *string, |
|
95 int usage); |
|
96 |
|
97 extern void additional_help_message (ostrstream& output_buf); |
|
98 |
287
|
99 extern void print_usage (const char *s, int just_usage = 0); |
181
|
100 |
1
|
101 #endif |
|
102 |
|
103 /* |
|
104 ;;; Local Variables: *** |
|
105 ;;; mode: C++ *** |
|
106 ;;; page-delimiter: "^/\\*" *** |
|
107 ;;; End: *** |
|
108 */ |