Mercurial > octave
annotate libinterp/corefcn/sysdep.h @ 26376:00f796120a6d stable
maint: Update copyright dates in all source files.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 02 Jan 2019 16:32:43 -0500 |
parents | 85c3e315bd43 |
children | f07542e3a9b9 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
26376
00f796120a6d
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
25649
diff
changeset
|
3 Copyright (C) 1993-2019 John W. Eaton |
1 | 4 |
5 This file is part of Octave. | |
6 | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23446
diff
changeset
|
7 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23446
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
10 (at your option) any later version. |
1 | 11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
15 GNU General Public License for more details. |
1 | 16 |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23446
diff
changeset
|
19 <https://www.gnu.org/licenses/>. |
1 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
23 #if ! defined (octave_sysdep_h) |
383 | 24 #define octave_sysdep_h 1 |
1 | 25 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
27 |
6726 | 28 #include <cstdio> |
29 | |
1750 | 30 #include <string> |
1690 | 31 |
1966 | 32 #include "lo-ieee.h" |
2926 | 33 #include "lo-sysdep.h" |
1966 | 34 |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
35 namespace octave |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
36 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
37 extern OCTINTERP_API void sysdep_init (void); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
38 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
39 extern OCTINTERP_API void set_application_id (void); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
40 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
41 extern OCTINTERP_API void sysdep_cleanup (void); |
1 | 42 |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
43 extern OCTINTERP_API void raw_mode (bool, bool wait = true); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
44 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
45 extern OCTINTERP_API FILE * popen (const char *command, const char *mode); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
46 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
47 extern OCTINTERP_API int pclose (FILE *f); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
48 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
49 extern OCTINTERP_API int kbhit (bool wait = true); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
50 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
51 extern OCTINTERP_API std::string get_P_tmpdir (void); |
22165
20e684ec108e
move system dependent code to sysdep.cc
John W. Eaton <jwe@octave.org>
parents:
21989
diff
changeset
|
52 |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
53 extern OCTINTERP_API bool same_file_internal (const std::string&, |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
54 const std::string&); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
55 } |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
56 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
57 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) |
5451 | 58 |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
59 OCTAVE_DEPRECATED (5, "use 'octave::sysdep_init' instead") |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
60 inline void |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
61 sysdep_init (void) |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
62 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
63 octave::sysdep_init (); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
64 } |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
65 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
66 OCTAVE_DEPRECATED (5, "use 'octave::set_application_id' instead") |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
67 inline void |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
68 set_application_id (void) |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
69 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
70 octave::set_application_id (); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
71 } |
3657 | 72 |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
73 OCTAVE_DEPRECATED (5, "use 'octave::sysdep_cleanup' instead") |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
74 inline void |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
75 sysdep_cleanup (void) |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
76 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
77 octave::sysdep_cleanup (); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
78 } |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
79 |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
80 OCTAVE_DEPRECATED (5, "use 'octave::raw_mode' instead") |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
81 inline void |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
82 raw_mode (bool on, bool wait = true) |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
83 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
84 octave::raw_mode (on, wait); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
85 } |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
86 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
87 OCTAVE_DEPRECATED (5, "use 'octave::popen' instead") |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
88 inline FILE * |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
89 octave_popen (const char *command, const char *mode) |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
90 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
91 return octave::popen (command, mode); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
92 } |
6726 | 93 |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
94 OCTAVE_DEPRECATED (5, "use 'octave::pclose' instead") |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
95 inline int |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
96 octave_pclose (FILE *f) |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
97 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
98 return octave::pclose (f); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
99 } |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
100 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
101 OCTAVE_DEPRECATED (5, "use 'octave::kbhit' instead") |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
102 inline int |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
103 octave_kbhit (bool wait = true) |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
104 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
105 return octave::kbhit (wait); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
106 } |
529 | 107 |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
108 OCTAVE_DEPRECATED (5, "use 'octave::get_P_tmpdir' instead") |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
109 inline std::string |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
110 get_P_tmpdir (void) |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
111 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
112 return octave::get_P_tmpdir (); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
113 } |
12228
0f70c5db58c3
try to get better value than \ for P_tmpdir on Windows systems
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
114 |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
115 OCTAVE_DEPRECATED (5, "use 'octave::same_file_internal' instead") |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
116 inline bool |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
117 same_file_internal (const std::string& a, const std::string& b) |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
118 { |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
119 return octave::same_file_internal (a, b); |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
120 } |
6598 | 121 |
1 | 122 #endif |
25649
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
123 |
85c3e315bd43
move libinterp/corefcn/sysdep functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
124 #endif |