annotate liboctave/system/lo-sysdep.cc @ 23696:08036a7f3660

remove octave:: namespace tag from symbols used inside octave namespace * octave-gui.cc, dynamic-ld.h, ft-text-renderer.cc, gl-render.cc, gl-render.h, gl2ps-print.cc, input.cc, input.h, interpreter.cc, load-path.cc, load-path.h, oct-stream.cc, sighandlers.cc, symtab.cc, symtab.h, __ode15__.cc, gzip.cc, octave.cc, lex.ll, oct-parse.in.yy, parse.h, pt-arg-list.cc, pt-arg-list.h, pt-array-list.h, pt-classdef.h, pt-decl.h, pt-eval.cc, pt-eval.h, pt-exp.h, pt-fcn-handle.cc, pt-idx.cc, pt-misc.h, pt-select.h, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt.cc, aepbalance.cc, chol.cc, gepbalance.cc, gsvd.cc, hess.cc, lo-mappers.h, lo-specfun.cc, lu.cc, qr.cc, qrp.cc, schur.cc, sparse-chol.cc, sparse-lu.cc, sparse-qr.cc, svd.cc, child-list.cc, dir-ops.cc, file-ops.cc, file-stat.cc, file-stat.h, lo-sysdep.cc, oct-env.cc, oct-syscalls.cc, cmd-edit.cc, cmd-hist.cc, oct-glob.cc, oct-locbuf.cc, oct-mutex.cc, oct-mutex.h, oct-shlib.cc, oct-shlib.h, pathsearch.cc, url-transfer.cc, url-transfer.h: Remove octave:: namespace tag from symbols used inside octave namespace. * oct-conf-post.in.h (OCTAVE_USE_DEPRECATED_FUNCTIONS): Don't define.
author John W. Eaton <jwe@octave.org>
date Mon, 26 Jun 2017 09:05:37 -0400
parents 092078913d54
children 980f39c3ab90
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
1 /*
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
2
23219
3ac9f9ecfae5 maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents: 23083
diff changeset
3 Copyright (C) 1996-2017 John W. Eaton
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
4
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
6
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
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: 22402
diff changeset
8 under the terms of the GNU General Public License as published by
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
9 the Free Software Foundation; either version 3 of the License, or
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
10 (at your option) any later version.
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
11
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
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: 22402
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22402
diff changeset
15 GNU General Public License for more details.
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
16
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6321
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6321
diff changeset
19 <http://www.gnu.org/licenses/>.
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
20
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
21 */
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
22
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21642
diff changeset
23 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21213
diff changeset
24 # include "config.h"
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
25 #endif
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
26
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
27 #include <string>
7695
eacf87a24f55 lo-sysdep.cc: include windows.h if windows and not cygwin
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
28
5872
44f24cf66b95 [project @ 2006-06-30 18:19:20 by jwe]
jwe
parents: 5307
diff changeset
29 #include "file-ops.h"
3069
db6d57d718f7 [project @ 1997-07-10 23:34:03 by jwe]
jwe
parents: 2926
diff changeset
30 #include "lo-error.h"
21910
4d723ba06b4a provide wrappers for some unistd.h functions
John W. Eaton <jwe@octave.org>
parents: 21828
diff changeset
31 #include "lo-sysdep.h"
4d723ba06b4a provide wrappers for some unistd.h functions
John W. Eaton <jwe@octave.org>
parents: 21828
diff changeset
32 #include "unistd-wrappers.h"
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
33
21738
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
34 namespace octave
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
35 {
21738
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
36 namespace sys
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
37 {
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
38 std::string
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
39 getcwd (void)
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
40 {
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
41 std::string retval;
3069
db6d57d718f7 [project @ 1997-07-10 23:34:03 by jwe]
jwe
parents: 2926
diff changeset
42
21910
4d723ba06b4a provide wrappers for some unistd.h functions
John W. Eaton <jwe@octave.org>
parents: 21828
diff changeset
43 // Using octave_getcwd_wrapper ensures that we have a getcwd that
21738
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
44 // will allocate a buffer as large as necessary if buf and size are
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
45 // both 0.
3069
db6d57d718f7 [project @ 1997-07-10 23:34:03 by jwe]
jwe
parents: 2926
diff changeset
46
21910
4d723ba06b4a provide wrappers for some unistd.h functions
John W. Eaton <jwe@octave.org>
parents: 21828
diff changeset
47 char *tmp = octave_getcwd_wrapper (0, 0);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
48
21738
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
49 if (! tmp)
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
50 (*current_liboctave_error_handler) ("unable to find current directory");
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
51
10250
2d47356a7a1a use gnulib getcwd module
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
52 retval = tmp;
2d47356a7a1a use gnulib getcwd module
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
53 free (tmp);
21136
7cac4e7458f2 maint: clean up code around calls to current_liboctave_error_handler.
Rik <rik@octave.org>
parents: 19864
diff changeset
54
21738
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
55 return retval;
10250
2d47356a7a1a use gnulib getcwd module
John W. Eaton <jwe@octave.org>
parents: 10182
diff changeset
56 }
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents:
diff changeset
57
21738
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
58 int
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
59 chdir (const std::string& path_arg)
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
60 {
23696
08036a7f3660 remove octave:: namespace tag from symbols used inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 23220
diff changeset
61 std::string path = sys::file_ops::tilde_expand (path_arg);
5872
44f24cf66b95 [project @ 2006-06-30 18:19:20 by jwe]
jwe
parents: 5307
diff changeset
62
21979
d04da18a407a use OCTAVE_USE_WINDOWS_API more consistently
John W. Eaton <jwe@octave.org>
parents: 21949
diff changeset
63 #if defined (OCTAVE_USE_WINDOWS_API)
21738
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
64 if (path.length () == 2 && path[1] == ':')
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
65 path += "\\";
6244
8cab253171b6 [project @ 2007-01-17 21:55:49 by jwe]
jwe
parents: 6208
diff changeset
66 #endif
8cab253171b6 [project @ 2007-01-17 21:55:49 by jwe]
jwe
parents: 6208
diff changeset
67
21910
4d723ba06b4a provide wrappers for some unistd.h functions
John W. Eaton <jwe@octave.org>
parents: 21828
diff changeset
68 return octave_chdir_wrapper (path.c_str ());
21738
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
69 }
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
70 }
a99c2407f930 use namespace for lo-sysdep.h functions
John W. Eaton <jwe@octave.org>
parents: 21733
diff changeset
71 }