Mercurial > hg > octave-nkf
annotate liboctave/system/oct-env.h @ 20195:4840fc43f0b5
octave-config: add EXEEXT and SHLEXT variables to -p
* build-aux/common.mk
(do_subst_default_vals) Add OCTAVE_EXEEXT and OCTAVE_SHLEXT
* src/octave-config.in.cc
(help_msg): add string EXEEXT, SHLEXT to help string
(initialize): initialize variables for EXEEXT, SHLEXT
author | John Donoghue |
---|---|
date | Wed, 25 Mar 2015 12:25:23 -0400 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
2926 | 1 /* |
2 | |
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19655
diff
changeset
|
3 Copyright (C) 1996-2015 John W. Eaton |
2926 | 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 | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
2926 | 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 | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2926 | 20 |
21 */ | |
22 | |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
23 #if !defined (octave_oct_env_h) |
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
24 #define octave_oct_env_h 1 |
2926 | 25 |
26 #include <string> | |
27 | |
28 class | |
6108 | 29 OCTAVE_API |
2926 | 30 octave_env |
31 { | |
32 protected: | |
33 | |
34 octave_env (void); | |
35 | |
36 public: | |
37 | |
3504 | 38 static std::string polite_directory_format (const std::string& name); |
2926 | 39 |
3504 | 40 static bool absolute_pathname (const std::string& s); |
2926 | 41 |
6838 | 42 static bool rooted_relative_pathname (const std::string& s); |
43 | |
3504 | 44 static std::string base_pathname (const std::string& s); |
2926 | 45 |
10250 | 46 static std::string |
47 make_absolute (const std::string& s, | |
48 const std::string& dot_path = get_current_directory ()); | |
2926 | 49 |
10250 | 50 static std::string get_current_directory (void); |
2926 | 51 |
3504 | 52 static std::string get_home_directory (void); |
2926 | 53 |
19655
d8fd3842a507
Use gnulib gen_tempname to create temporary names (Bug #43872).
John Donoghue <john.donoghue@ieee.org>
parents:
17822
diff
changeset
|
54 static std::string get_temp_directory (void); |
d8fd3842a507
Use gnulib gen_tempname to create temporary names (Bug #43872).
John Donoghue <john.donoghue@ieee.org>
parents:
17822
diff
changeset
|
55 |
3504 | 56 static std::string get_program_name (void); |
2926 | 57 |
3504 | 58 static std::string get_program_invocation_name (void); |
2926 | 59 |
3504 | 60 static std::string get_user_name (void); |
2926 | 61 |
3504 | 62 static std::string get_host_name (void); |
2926 | 63 |
3504 | 64 static std::string getenv (const std::string& name); |
2926 | 65 |
3504 | 66 static void putenv (const std::string& name, const std::string& value); |
2926 | 67 |
5489 | 68 static bool have_x11_display (void); |
69 | |
3504 | 70 static bool chdir (const std::string& newdir); |
2926 | 71 |
3504 | 72 static void set_program_name (const std::string& s); |
2926 | 73 |
74 private: | |
75 | |
76 static bool instance_ok (void); | |
77 | |
3504 | 78 std::string do_polite_directory_format (const std::string& name) const; |
2926 | 79 |
3504 | 80 bool do_absolute_pathname (const std::string& s) const; |
2926 | 81 |
6838 | 82 bool do_rooted_relative_pathname (const std::string& s) const; |
83 | |
3504 | 84 std::string do_base_pathname (const std::string& s) const; |
2926 | 85 |
4097 | 86 std::string do_make_absolute (const std::string& s, |
10312
cbc402e64d83
untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents:
10278
diff
changeset
|
87 const std::string& dot_path) const; |
2926 | 88 |
4097 | 89 std::string do_getcwd (void) const; |
2926 | 90 |
3504 | 91 std::string do_get_home_directory (void) const; |
2926 | 92 |
19655
d8fd3842a507
Use gnulib gen_tempname to create temporary names (Bug #43872).
John Donoghue <john.donoghue@ieee.org>
parents:
17822
diff
changeset
|
93 std::string do_get_temp_directory (void) const; |
d8fd3842a507
Use gnulib gen_tempname to create temporary names (Bug #43872).
John Donoghue <john.donoghue@ieee.org>
parents:
17822
diff
changeset
|
94 |
3504 | 95 std::string do_get_user_name (void) const; |
2926 | 96 |
3504 | 97 std::string do_get_host_name (void) const; |
2926 | 98 |
3504 | 99 std::string do_getenv (const std::string& name) const; |
2926 | 100 |
3504 | 101 void do_putenv (const std::string& name, const std::string& value) const; |
2926 | 102 |
3504 | 103 bool do_chdir (const std::string& newdir); |
2926 | 104 |
3504 | 105 void do_set_program_name (const std::string& s) const; |
2926 | 106 |
3504 | 107 void pathname_backup (std::string& path, int n) const; |
2926 | 108 |
109 void error (int) const; | |
110 | |
3504 | 111 void error (const std::string&) const; |
2926 | 112 |
113 // No copying! | |
114 | |
115 octave_env (const octave_env&); | |
116 | |
117 octave_env& operator = (const octave_env&); | |
118 | |
119 // The real thing. | |
120 static octave_env *instance; | |
121 | |
13983
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
122 |
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
123 static void cleanup_instance (void) { delete instance; instance = 0; } |
7dd7cccf0757
clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
124 |
2926 | 125 // TRUE means follow symbolic links that point to directories just |
126 // as if they are real directories. | |
127 bool follow_symbolic_links; | |
128 | |
129 // TRUE means that pwd always give verbatim directory, regardless | |
130 // of symbolic link following. | |
131 bool verbatim_pwd; | |
132 | |
133 // Where are we? | |
4097 | 134 mutable std::string current_directory; |
2926 | 135 |
136 // Etc. | |
10278
4a278982c0fe
use gnulib progname module
John W. Eaton <jwe@octave.org>
parents:
10250
diff
changeset
|
137 mutable std::string prog_name; |
2926 | 138 |
10278
4a278982c0fe
use gnulib progname module
John W. Eaton <jwe@octave.org>
parents:
10250
diff
changeset
|
139 mutable std::string prog_invocation_name; |
2926 | 140 |
3504 | 141 mutable std::string user_name; |
2926 | 142 |
3504 | 143 mutable std::string host_name; |
2926 | 144 }; |
145 | |
146 #endif |