annotate src/utils.h @ 383:0b52c68ec81f

[project @ 1994-03-09 21:19:44 by jwe]
author jwe
date Wed, 09 Mar 1994 21:19:44 +0000
parents 94f0f219a946
children ba637cc5c5f3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 // utils.h -*- C++ -*-
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
3
296
3c23b8ea9099 [project @ 1994-01-17 02:49:15 by jwe]
jwe
parents: 287
diff changeset
4 Copyright (C) 1992, 1993, 1994 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11 later version.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
17
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
19 along with Octave; see the file COPYING. If not, write to the Free
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
23
383
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 339
diff changeset
24 #if !defined (octave_utils_h)
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 339
diff changeset
25 #define octave_utils_h 1
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
26
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
27 #include <time.h>
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
28
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
29 class istream;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
30 class ostrstream;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
31 class tree_constant;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
32
194
4f3364dcf450 [project @ 1993-11-03 21:37:59 by jwe]
jwe
parents: 189
diff changeset
33 // Tell g++ that jump_to_top_level doesn't return;
4f3364dcf450 [project @ 1993-11-03 21:37:59 by jwe]
jwe
parents: 189
diff changeset
34
4f3364dcf450 [project @ 1993-11-03 21:37:59 by jwe]
jwe
parents: 189
diff changeset
35 #ifdef __GNUG__
4f3364dcf450 [project @ 1993-11-03 21:37:59 by jwe]
jwe
parents: 189
diff changeset
36 typedef void v_fcn_v (void);
4f3364dcf450 [project @ 1993-11-03 21:37:59 by jwe]
jwe
parents: 189
diff changeset
37 volatile v_fcn_v jump_to_top_level;
4f3364dcf450 [project @ 1993-11-03 21:37:59 by jwe]
jwe
parents: 189
diff changeset
38 #endif
4f3364dcf450 [project @ 1993-11-03 21:37:59 by jwe]
jwe
parents: 189
diff changeset
39
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
40 extern char *strsave (const char *);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
41 extern char *strconcat (const char *, const char *);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
42 extern void discard_until (istream&, char);
164
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
43 extern void check_dimensions (int& nr, int& nc, const char *warnfor);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
44 extern void raw_mode (int);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
45 extern int kbhit (void);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
46 extern char **pathstring_to_vector (char *);
195
13c6086c325c [project @ 1993-11-06 10:12:29 by jwe]
jwe
parents: 194
diff changeset
47 extern char *octave_home (void);
13c6086c325c [project @ 1993-11-06 10:12:29 by jwe]
jwe
parents: 194
diff changeset
48 extern char *octave_lib_dir (void);
13c6086c325c [project @ 1993-11-06 10:12:29 by jwe]
jwe
parents: 194
diff changeset
49 extern char *octave_info_dir (void);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
50 extern char *default_path (void);
186
7a647cf4850c [project @ 1993-10-25 23:15:50 by jwe]
jwe
parents: 164
diff changeset
51 extern char *default_info_file (void);
195
13c6086c325c [project @ 1993-11-06 10:12:29 by jwe]
jwe
parents: 194
diff changeset
52 extern char *default_editor (void);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
53 extern char *get_site_defaults (void);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
54 extern char *default_pager (void);
164
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
55 extern char *file_in_path (const char *, const char *);
338
82d30a23c979 [project @ 1994-02-07 07:09:33 by jwe]
jwe
parents: 320
diff changeset
56 extern char *fcn_file_in_path (const char *);
164
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
57 extern char *polite_directory_format (const char *);
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
58 extern int absolute_pathname (const char *);
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
59 extern int absolute_program (const char *);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
60 extern char *base_pathname (char *);
164
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
61 extern int read_octal (const char *);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
62 extern char *sub_append_string (char *, char *, int *, int *);
164
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
63 extern char *decode_prompt_string (const char *);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
64 extern void pathname_backup (char *, int);
164
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
65 extern char *make_absolute (const char *, const char *);
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
66 extern char *get_working_directory (const char *);
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
67 extern int change_to_directory (const char *);
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
68 extern int is_newer (const char *, time_t);
189
de0e58f9b064 [project @ 1993-10-28 08:52:15 by jwe]
jwe
parents: 186
diff changeset
69 extern void jump_to_top_level (void);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
70 extern char *s_plural (int);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
71 extern char *es_plural (int);
164
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
72 extern char *save_in_tmp_file (tree_constant& t, int nd = 2, int para = 0);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
73 extern void mark_for_deletion (const char *);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
74 extern void cleanup_tmp_files (void);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
75 extern int send_to_plot_stream (const char *cmd);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
76 extern void close_plot_stream (void);
164
e2c950dd96d2 [project @ 1993-10-18 19:32:00 by jwe]
jwe
parents: 102
diff changeset
77 extern int almost_match (const char *std, const char *s,
287
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 241
diff changeset
78 int min_match_len = 1, int case_sens = 1);
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 241
diff changeset
79 extern int keyword_almost_match (const char **std, int *min_len,
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 241
diff changeset
80 const char *s, int min_toks_to_match,
6027a905fc06 [project @ 1994-01-13 01:41:00 by jwe]
jwe
parents: 241
diff changeset
81 int max_toks);
339
94f0f219a946 [project @ 1994-02-07 07:26:24 by jwe]
jwe
parents: 338
diff changeset
82 extern char **get_fcn_file_names (int& ffl_len, const char *dir, int no_suffix);
94f0f219a946 [project @ 1994-02-07 07:26:24 by jwe]
jwe
parents: 338
diff changeset
83 extern char **get_fcn_file_names (int& ffl_len, int no_suffix);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
84 extern int NINT (double x);
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
85 extern double D_NINT (double x);
241
62fec093c19e [project @ 1993-11-30 20:35:59 by jwe]
jwe
parents: 240
diff changeset
86 extern void delete_ppchar (char **);
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
87
320
781f2e240975 [project @ 1994-01-28 20:00:20 by jwe]
jwe
parents: 296
diff changeset
88 extern "C"
781f2e240975 [project @ 1994-01-28 20:00:20 by jwe]
jwe
parents: 296
diff changeset
89 {
781f2e240975 [project @ 1994-01-28 20:00:20 by jwe]
jwe
parents: 296
diff changeset
90 extern int gethostname ();
781f2e240975 [project @ 1994-01-28 20:00:20 by jwe]
jwe
parents: 296
diff changeset
91 }
781f2e240975 [project @ 1994-01-28 20:00:20 by jwe]
jwe
parents: 296
diff changeset
92
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
93 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
94
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
95 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
96 ;;; Local Variables: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
97 ;;; mode: C++ ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
98 ;;; page-delimiter: "^/\\*" ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
99 ;;; End: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
100 */