Mercurial > octave
annotate libinterp/corefcn/defaults.cc @ 17787:175b392e91fe
Use GNU style coding conventions for code in libinterp/
* libinterp/corefcn/Cell.h, libinterp/corefcn/__contourc__.cc,
libinterp/corefcn/__dispatch__.cc, libinterp/corefcn/__lin_interpn__.cc,
libinterp/corefcn/__pchip_deriv__.cc, libinterp/corefcn/__qp__.cc,
libinterp/corefcn/balance.cc, libinterp/corefcn/besselj.cc,
libinterp/corefcn/betainc.cc, libinterp/corefcn/bitfcns.cc,
libinterp/corefcn/bsxfun.cc, libinterp/corefcn/c-file-ptr-stream.cc,
libinterp/corefcn/c-file-ptr-stream.h, libinterp/corefcn/cellfun.cc,
libinterp/corefcn/colloc.cc, libinterp/corefcn/comment-list.h,
libinterp/corefcn/conv2.cc, libinterp/corefcn/daspk.cc,
libinterp/corefcn/dasrt.cc, libinterp/corefcn/dassl.cc,
libinterp/corefcn/data.cc, libinterp/corefcn/debug.cc,
libinterp/corefcn/defaults.cc, libinterp/corefcn/defaults.in.h,
libinterp/corefcn/defun-int.h, libinterp/corefcn/defun.cc,
libinterp/corefcn/det.cc, libinterp/corefcn/dirfns.cc,
libinterp/corefcn/display.cc, libinterp/corefcn/dlmread.cc,
libinterp/corefcn/dot.cc, libinterp/corefcn/dynamic-ld.cc,
libinterp/corefcn/dynamic-ld.h, libinterp/corefcn/eig.cc,
libinterp/corefcn/ellipj.cc, libinterp/corefcn/error.cc,
libinterp/corefcn/error.h, libinterp/corefcn/event-queue.h,
libinterp/corefcn/fft.cc, libinterp/corefcn/fft2.cc, libinterp/corefcn/fftn.cc,
libinterp/corefcn/file-io.cc, libinterp/corefcn/filter.cc,
libinterp/corefcn/find.cc, libinterp/corefcn/gammainc.cc,
libinterp/corefcn/gcd.cc, libinterp/corefcn/getgrent.cc,
libinterp/corefcn/getpwent.cc, libinterp/corefcn/getrusage.cc,
libinterp/corefcn/givens.cc, libinterp/corefcn/gl-render.cc,
libinterp/corefcn/gl2ps-renderer.cc, libinterp/corefcn/gl2ps-renderer.h,
libinterp/corefcn/graphics.cc, libinterp/corefcn/graphics.in.h,
libinterp/corefcn/gripes.cc, libinterp/corefcn/gripes.h,
libinterp/corefcn/help.cc, libinterp/corefcn/hess.cc,
libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc,
libinterp/corefcn/input.h, libinterp/corefcn/inv.cc,
libinterp/corefcn/jit-ir.h, libinterp/corefcn/jit-typeinfo.cc,
libinterp/corefcn/jit-typeinfo.h, libinterp/corefcn/jit-util.h,
libinterp/corefcn/kron.cc, libinterp/corefcn/load-path.cc,
libinterp/corefcn/load-path.h, libinterp/corefcn/load-save.cc,
libinterp/corefcn/load-save.h, libinterp/corefcn/lookup.cc,
libinterp/corefcn/ls-ascii-helper.cc, libinterp/corefcn/ls-hdf5.cc,
libinterp/corefcn/ls-hdf5.h, libinterp/corefcn/ls-mat-ascii.cc,
libinterp/corefcn/ls-mat-ascii.h, libinterp/corefcn/ls-mat4.cc,
libinterp/corefcn/ls-mat5.cc, libinterp/corefcn/ls-mat5.h,
libinterp/corefcn/ls-oct-ascii.cc, libinterp/corefcn/lsode.cc,
libinterp/corefcn/lu.cc, libinterp/corefcn/luinc.cc,
libinterp/corefcn/mappers.cc, libinterp/corefcn/matrix_type.cc,
libinterp/corefcn/max.cc, libinterp/corefcn/md5sum.cc,
libinterp/corefcn/mex.cc, libinterp/corefcn/mexproto.h,
libinterp/corefcn/mgorth.cc, libinterp/corefcn/mxarray.in.h,
libinterp/corefcn/nproc.cc, libinterp/corefcn/oct-hist.cc,
libinterp/corefcn/oct-lvalue.h, libinterp/corefcn/oct-map.cc,
libinterp/corefcn/oct-map.h, libinterp/corefcn/oct-obj.h,
libinterp/corefcn/oct-prcstrm.h, libinterp/corefcn/oct-stdstrm.h,
libinterp/corefcn/oct-stream.cc, libinterp/corefcn/oct-stream.h,
libinterp/corefcn/octave-link.cc, libinterp/corefcn/octave-link.h,
libinterp/corefcn/pager.cc, libinterp/corefcn/pinv.cc,
libinterp/corefcn/pr-output.cc, libinterp/corefcn/procstream.h,
libinterp/corefcn/profiler.cc, libinterp/corefcn/pt-jit.cc,
libinterp/corefcn/pt-jit.h, libinterp/corefcn/quad.cc,
libinterp/corefcn/quadcc.cc, libinterp/corefcn/qz.cc,
libinterp/corefcn/rand.cc, libinterp/corefcn/rcond.cc,
libinterp/corefcn/regexp.cc, libinterp/corefcn/schur.cc,
libinterp/corefcn/sighandlers.cc, libinterp/corefcn/sighandlers.h,
libinterp/corefcn/sparse-xdiv.cc, libinterp/corefcn/sparse-xdiv.h,
libinterp/corefcn/sparse-xpow.cc, libinterp/corefcn/sparse.cc,
libinterp/corefcn/spparms.cc, libinterp/corefcn/sqrtm.cc,
libinterp/corefcn/str2double.cc, libinterp/corefcn/strfind.cc,
libinterp/corefcn/strfns.cc, libinterp/corefcn/sub2ind.cc,
libinterp/corefcn/svd.cc, libinterp/corefcn/syl.cc,
libinterp/corefcn/symtab.cc, libinterp/corefcn/symtab.h,
libinterp/corefcn/syscalls.cc, libinterp/corefcn/sysdep.cc,
libinterp/corefcn/sysdep.h, libinterp/corefcn/time.cc,
libinterp/corefcn/toplev.cc, libinterp/corefcn/toplev.h,
libinterp/corefcn/tril.cc, libinterp/corefcn/txt-eng-ft.cc,
libinterp/corefcn/txt-eng-ft.h, libinterp/corefcn/txt-eng.h,
libinterp/corefcn/typecast.cc, libinterp/corefcn/urlwrite.cc,
libinterp/corefcn/utils.cc, libinterp/corefcn/variables.cc,
libinterp/corefcn/variables.h, libinterp/corefcn/xdiv.cc,
libinterp/corefcn/xdiv.h, libinterp/corefcn/xnorm.h, libinterp/corefcn/xpow.cc,
libinterp/corefcn/xpow.h, libinterp/corefcn/zfstream.cc,
libinterp/corefcn/zfstream.h, libinterp/dldfcn/__delaunayn__.cc,
libinterp/dldfcn/__dsearchn__.cc, libinterp/dldfcn/__eigs__.cc,
libinterp/dldfcn/__fltk_uigetfile__.cc, libinterp/dldfcn/__glpk__.cc,
libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/__init_gnuplot__.cc,
libinterp/dldfcn/__magick_read__.cc, libinterp/dldfcn/__voronoi__.cc,
libinterp/dldfcn/amd.cc, libinterp/dldfcn/ccolamd.cc, libinterp/dldfcn/chol.cc,
libinterp/dldfcn/colamd.cc, libinterp/dldfcn/convhulln.cc,
libinterp/dldfcn/dmperm.cc, libinterp/dldfcn/fftw.cc, libinterp/dldfcn/qr.cc,
libinterp/dldfcn/symbfact.cc, libinterp/dldfcn/symrcm.cc,
libinterp/dldfcn/tsearch.cc, libinterp/octave-value/ov-base-diag.cc,
libinterp/octave-value/ov-base-diag.h, libinterp/octave-value/ov-base-int.cc,
libinterp/octave-value/ov-base-int.h, libinterp/octave-value/ov-base-mat.h,
libinterp/octave-value/ov-base-scalar.cc,
libinterp/octave-value/ov-base-scalar.h,
libinterp/octave-value/ov-base-sparse.cc,
libinterp/octave-value/ov-base-sparse.h, libinterp/octave-value/ov-base.cc,
libinterp/octave-value/ov-base.h, libinterp/octave-value/ov-bool-mat.cc,
libinterp/octave-value/ov-bool-mat.h, libinterp/octave-value/ov-bool-sparse.cc,
libinterp/octave-value/ov-bool-sparse.h, libinterp/octave-value/ov-bool.cc,
libinterp/octave-value/ov-bool.h, libinterp/octave-value/ov-builtin.cc,
libinterp/octave-value/ov-builtin.h, libinterp/octave-value/ov-cell.cc,
libinterp/octave-value/ov-cell.h, libinterp/octave-value/ov-ch-mat.cc,
libinterp/octave-value/ov-ch-mat.h, libinterp/octave-value/ov-class.cc,
libinterp/octave-value/ov-class.h, libinterp/octave-value/ov-colon.h,
libinterp/octave-value/ov-complex.cc, libinterp/octave-value/ov-complex.h,
libinterp/octave-value/ov-cx-diag.cc, libinterp/octave-value/ov-cx-diag.h,
libinterp/octave-value/ov-cx-mat.cc, libinterp/octave-value/ov-cx-mat.h,
libinterp/octave-value/ov-cx-sparse.cc, libinterp/octave-value/ov-cx-sparse.h,
libinterp/octave-value/ov-dld-fcn.h, libinterp/octave-value/ov-fcn-handle.cc,
libinterp/octave-value/ov-fcn-handle.h,
libinterp/octave-value/ov-fcn-inline.cc,
libinterp/octave-value/ov-fcn-inline.h, libinterp/octave-value/ov-fcn.h,
libinterp/octave-value/ov-float.cc, libinterp/octave-value/ov-float.h,
libinterp/octave-value/ov-flt-complex.cc,
libinterp/octave-value/ov-flt-complex.h,
libinterp/octave-value/ov-flt-cx-diag.cc,
libinterp/octave-value/ov-flt-cx-diag.h,
libinterp/octave-value/ov-flt-cx-mat.cc,
libinterp/octave-value/ov-flt-cx-mat.h,
libinterp/octave-value/ov-flt-re-diag.cc,
libinterp/octave-value/ov-flt-re-diag.h,
libinterp/octave-value/ov-flt-re-mat.cc,
libinterp/octave-value/ov-flt-re-mat.h, libinterp/octave-value/ov-int16.cc,
libinterp/octave-value/ov-int32.cc, libinterp/octave-value/ov-int64.cc,
libinterp/octave-value/ov-int8.cc, libinterp/octave-value/ov-intx.h,
libinterp/octave-value/ov-java.cc, libinterp/octave-value/ov-lazy-idx.h,
libinterp/octave-value/ov-mex-fcn.cc, libinterp/octave-value/ov-mex-fcn.h,
libinterp/octave-value/ov-null-mat.cc, libinterp/octave-value/ov-null-mat.h,
libinterp/octave-value/ov-oncleanup.cc, libinterp/octave-value/ov-perm.cc,
libinterp/octave-value/ov-perm.h, libinterp/octave-value/ov-range.cc,
libinterp/octave-value/ov-range.h, libinterp/octave-value/ov-re-diag.cc,
libinterp/octave-value/ov-re-diag.h, libinterp/octave-value/ov-re-mat.cc,
libinterp/octave-value/ov-re-mat.h, libinterp/octave-value/ov-re-sparse.cc,
libinterp/octave-value/ov-re-sparse.h, libinterp/octave-value/ov-scalar.cc,
libinterp/octave-value/ov-scalar.h, libinterp/octave-value/ov-str-mat.cc,
libinterp/octave-value/ov-str-mat.h, libinterp/octave-value/ov-struct.cc,
libinterp/octave-value/ov-struct.h, libinterp/octave-value/ov-type-conv.h,
libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov-typeinfo.h,
libinterp/octave-value/ov-uint16.cc, libinterp/octave-value/ov-uint32.cc,
libinterp/octave-value/ov-uint64.cc, libinterp/octave-value/ov-uint8.cc,
libinterp/octave-value/ov-usr-fcn.cc, libinterp/octave-value/ov-usr-fcn.h,
libinterp/octave-value/ov.cc, libinterp/octave-value/ov.h, libinterp/octave.cc,
libinterp/operators/op-b-bm.cc, libinterp/operators/op-b-sbm.cc,
libinterp/operators/op-bm-b.cc, libinterp/operators/op-bm-bm.cc,
libinterp/operators/op-cdm-cdm.cc, libinterp/operators/op-chm.cc,
libinterp/operators/op-class.cc, libinterp/operators/op-cm-cm.cc,
libinterp/operators/op-cm-cs.cc, libinterp/operators/op-cm-s.cc,
libinterp/operators/op-cm-scm.cc, libinterp/operators/op-cm-sm.cc,
libinterp/operators/op-cs-cm.cc, libinterp/operators/op-cs-cs.cc,
libinterp/operators/op-cs-scm.cc, libinterp/operators/op-cs-sm.cc,
libinterp/operators/op-dm-dm.cc, libinterp/operators/op-dm-scm.cc,
libinterp/operators/op-double-conv.cc, libinterp/operators/op-fcdm-fcdm.cc,
libinterp/operators/op-fcm-fcm.cc, libinterp/operators/op-fcm-fcs.cc,
libinterp/operators/op-fcm-fm.cc, libinterp/operators/op-fcm-fs.cc,
libinterp/operators/op-fcs-fcm.cc, libinterp/operators/op-fcs-fcs.cc,
libinterp/operators/op-fcs-fm.cc, libinterp/operators/op-fcs-fs.cc,
libinterp/operators/op-fdm-fdm.cc, libinterp/operators/op-float-conv.cc,
libinterp/operators/op-fm-fcm.cc, libinterp/operators/op-fm-fcs.cc,
libinterp/operators/op-fm-fm.cc, libinterp/operators/op-fm-fs.cc,
libinterp/operators/op-fs-fcm.cc, libinterp/operators/op-fs-fcs.cc,
libinterp/operators/op-fs-fm.cc, libinterp/operators/op-fs-fs.cc,
libinterp/operators/op-m-cm.cc, libinterp/operators/op-m-cs.cc,
libinterp/operators/op-m-m.cc, libinterp/operators/op-m-s.cc,
libinterp/operators/op-m-scm.cc, libinterp/operators/op-m-sm.cc,
libinterp/operators/op-pm-scm.cc, libinterp/operators/op-range.cc,
libinterp/operators/op-s-cm.cc, libinterp/operators/op-s-cs.cc,
libinterp/operators/op-s-scm.cc, libinterp/operators/op-sbm-b.cc,
libinterp/operators/op-sbm-bm.cc, libinterp/operators/op-sbm-sbm.cc,
libinterp/operators/op-scm-cm.cc, libinterp/operators/op-scm-cs.cc,
libinterp/operators/op-scm-m.cc, libinterp/operators/op-scm-s.cc,
libinterp/operators/op-scm-scm.cc, libinterp/operators/op-scm-sm.cc,
libinterp/operators/op-sm-cm.cc, libinterp/operators/op-sm-m.cc,
libinterp/operators/op-sm-s.cc, libinterp/operators/op-sm-scm.cc,
libinterp/operators/op-sm-sm.cc, libinterp/operators/op-str-m.cc,
libinterp/operators/op-str-s.cc, libinterp/operators/op-str-str.cc,
libinterp/operators/ops.h, libinterp/parse-tree/lex.h,
libinterp/parse-tree/parse.h, libinterp/parse-tree/pt-arg-list.cc,
libinterp/parse-tree/pt-arg-list.h, libinterp/parse-tree/pt-assign.cc,
libinterp/parse-tree/pt-assign.h, libinterp/parse-tree/pt-binop.cc,
libinterp/parse-tree/pt-binop.h, libinterp/parse-tree/pt-bp.h,
libinterp/parse-tree/pt-cbinop.cc, libinterp/parse-tree/pt-check.cc,
libinterp/parse-tree/pt-colon.cc, libinterp/parse-tree/pt-colon.h,
libinterp/parse-tree/pt-const.cc, libinterp/parse-tree/pt-decl.cc,
libinterp/parse-tree/pt-decl.h, libinterp/parse-tree/pt-eval.cc,
libinterp/parse-tree/pt-except.h, libinterp/parse-tree/pt-exp.h,
libinterp/parse-tree/pt-fcn-handle.cc, libinterp/parse-tree/pt-id.cc,
libinterp/parse-tree/pt-id.h, libinterp/parse-tree/pt-idx.cc,
libinterp/parse-tree/pt-idx.h, libinterp/parse-tree/pt-loop.h,
libinterp/parse-tree/pt-mat.cc, libinterp/parse-tree/pt-misc.cc,
libinterp/parse-tree/pt-misc.h, libinterp/parse-tree/pt-pr-code.cc,
libinterp/parse-tree/pt-select.h, libinterp/parse-tree/pt-stmt.h,
libinterp/parse-tree/token.h, libinterp/version.cc:
Use GNU style coding conventions for code in libinterp/
author | Rik <rik@octave.org> |
---|---|
date | Mon, 28 Oct 2013 19:51:46 -0700 |
parents | d63878346099 |
children | 22187db555cf |
rev | line source |
---|---|
2203 | 1 /* |
2 | |
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
17281
diff
changeset
|
3 Copyright (C) 1996-2013 John W. Eaton |
2203 | 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. | |
2203 | 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/>. | |
2203 | 20 |
21 */ | |
22 | |
23 #ifdef HAVE_CONFIG_H | |
24 #include <config.h> | |
25 #endif | |
26 | |
27 #include <cstdlib> | |
28 | |
6114 | 29 #include <algorithm> |
3503 | 30 #include <iostream> |
2203 | 31 #include <string> |
32 | |
33 #include <sys/types.h> | |
34 #include <unistd.h> | |
35 | |
5814 | 36 #include "dir-ops.h" |
2926 | 37 #include "oct-env.h" |
4217 | 38 #include "file-stat.h" |
3174 | 39 #include "pathsearch.h" |
4217 | 40 #include "str-vec.h" |
2926 | 41 |
2492 | 42 #include <defaults.h> |
2203 | 43 #include "defun.h" |
44 #include "error.h" | |
3040 | 45 #include "file-ops.h" |
2203 | 46 #include "gripes.h" |
47 #include "help.h" | |
5395 | 48 #include "input.h" |
5832 | 49 #include "load-path.h" |
3185 | 50 #include "oct-obj.h" |
2390 | 51 #include "ov.h" |
4217 | 52 #include "parse.h" |
2203 | 53 #include "toplev.h" |
4217 | 54 #include "unwind-prot.h" |
2203 | 55 #include "variables.h" |
2492 | 56 #include <version.h> |
2203 | 57 |
3523 | 58 std::string Voctave_home; |
2203 | 59 |
3523 | 60 std::string Vbin_dir; |
61 std::string Vinfo_dir; | |
62 std::string Vdata_dir; | |
63 std::string Vlibexec_dir; | |
64 std::string Varch_lib_dir; | |
65 std::string Vlocal_arch_lib_dir; | |
5909 | 66 std::string Vlocal_api_arch_lib_dir; |
3597 | 67 std::string Vlocal_ver_arch_lib_dir; |
5814 | 68 |
69 std::string Vlocal_ver_oct_file_dir; | |
70 std::string Vlocal_api_oct_file_dir; | |
71 std::string Vlocal_oct_file_dir; | |
2203 | 72 |
5814 | 73 std::string Vlocal_ver_fcn_file_dir; |
74 std::string Vlocal_api_fcn_file_dir; | |
75 std::string Vlocal_fcn_file_dir; | |
76 | |
15157
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
77 std::string Voct_etc_dir; |
15971
e27d9b9b71f4
gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents:
15478
diff
changeset
|
78 std::string Voct_locale_dir; |
15157
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
79 |
5814 | 80 std::string Voct_file_dir; |
81 std::string Vfcn_file_dir; | |
82 | |
83 std::string Vimage_dir; | |
4447 | 84 |
2203 | 85 // The path that will be searched for programs that we execute. |
86 // (--exec-path path) | |
5794 | 87 static std::string VEXEC_PATH; |
2203 | 88 |
89 // Name of the editor to be invoked by the edit_history command. | |
5794 | 90 std::string VEDITOR; |
2203 | 91 |
5814 | 92 static std::string VIMAGE_PATH; |
2203 | 93 |
3523 | 94 std::string Vlocal_site_defaults_file; |
95 std::string Vsite_defaults_file; | |
2203 | 96 |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
97 std::string Vbuilt_in_docstrings_file; |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
98 |
6274 | 99 std::string |
3523 | 100 subst_octave_home (const std::string& s) |
2203 | 101 { |
3523 | 102 std::string retval; |
2203 | 103 |
3523 | 104 std::string prefix = OCTAVE_PREFIX; |
2203 | 105 |
106 retval = s; | |
107 | |
108 if (Voctave_home != prefix) | |
109 { | |
5275 | 110 octave_idx_type len = prefix.length (); |
6276 | 111 |
112 if (s.substr (0, len) == prefix) | |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
113 retval.replace (0, len, Voctave_home); |
2203 | 114 } |
115 | |
8007
a2ab20ba78f7
make file_ops a proper singleton class
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
116 if (file_ops::dir_sep_char () != '/') |
a2ab20ba78f7
make file_ops a proper singleton class
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
117 std::replace (retval.begin (), retval.end (), '/', |
10315
57a59eae83cc
untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents:
10182
diff
changeset
|
118 file_ops::dir_sep_char ()); |
6114 | 119 |
2203 | 120 return retval; |
121 } | |
122 | |
123 static void | |
124 set_octave_home (void) | |
125 { | |
3523 | 126 std::string oh = octave_env::getenv ("OCTAVE_HOME"); |
2203 | 127 |
3523 | 128 Voctave_home = oh.empty () ? std::string (OCTAVE_PREFIX) : oh; |
2203 | 129 } |
130 | |
131 static void | |
132 set_default_info_dir (void) | |
133 { | |
134 Vinfo_dir = subst_octave_home (OCTAVE_INFODIR); | |
135 } | |
136 | |
137 static void | |
3141 | 138 set_default_data_dir (void) |
139 { | |
140 Vdata_dir = subst_octave_home (OCTAVE_DATADIR); | |
141 } | |
142 | |
143 static void | |
144 set_default_libexec_dir (void) | |
145 { | |
146 Vlibexec_dir = subst_octave_home (OCTAVE_LIBEXECDIR); | |
147 } | |
148 | |
149 static void | |
2203 | 150 set_default_arch_lib_dir (void) |
151 { | |
152 Varch_lib_dir = subst_octave_home (OCTAVE_ARCHLIBDIR); | |
153 } | |
154 | |
155 static void | |
2439 | 156 set_default_local_arch_lib_dir (void) |
157 { | |
158 Vlocal_arch_lib_dir = subst_octave_home (OCTAVE_LOCALARCHLIBDIR); | |
159 } | |
160 | |
161 static void | |
5909 | 162 set_default_local_api_arch_lib_dir (void) |
163 { | |
164 Vlocal_api_arch_lib_dir = subst_octave_home (OCTAVE_LOCALAPIARCHLIBDIR); | |
165 } | |
166 | |
167 static void | |
3597 | 168 set_default_local_ver_arch_lib_dir (void) |
169 { | |
170 Vlocal_ver_arch_lib_dir = subst_octave_home (OCTAVE_LOCALVERARCHLIBDIR); | |
171 } | |
172 | |
173 static void | |
5814 | 174 set_default_local_ver_oct_file_dir (void) |
175 { | |
176 Vlocal_ver_oct_file_dir = subst_octave_home (OCTAVE_LOCALVEROCTFILEDIR); | |
177 } | |
178 | |
179 static void | |
180 set_default_local_api_oct_file_dir (void) | |
181 { | |
182 Vlocal_api_oct_file_dir = subst_octave_home (OCTAVE_LOCALAPIOCTFILEDIR); | |
183 } | |
184 | |
185 static void | |
186 set_default_local_oct_file_dir (void) | |
187 { | |
188 Vlocal_oct_file_dir = subst_octave_home (OCTAVE_LOCALOCTFILEDIR); | |
189 } | |
190 | |
191 static void | |
192 set_default_local_ver_fcn_file_dir (void) | |
193 { | |
194 Vlocal_ver_fcn_file_dir = subst_octave_home (OCTAVE_LOCALVERFCNFILEDIR); | |
195 } | |
196 | |
197 static void | |
198 set_default_local_api_fcn_file_dir (void) | |
199 { | |
200 Vlocal_api_fcn_file_dir = subst_octave_home (OCTAVE_LOCALAPIFCNFILEDIR); | |
201 } | |
202 | |
203 static void | |
204 set_default_local_fcn_file_dir (void) | |
205 { | |
206 Vlocal_fcn_file_dir = subst_octave_home (OCTAVE_LOCALFCNFILEDIR); | |
207 } | |
208 | |
209 static void | |
2203 | 210 set_default_fcn_file_dir (void) |
211 { | |
212 Vfcn_file_dir = subst_octave_home (OCTAVE_FCNFILEDIR); | |
213 } | |
214 | |
215 static void | |
5814 | 216 set_default_image_dir (void) |
217 { | |
218 Vimage_dir = subst_octave_home (OCTAVE_IMAGEDIR); | |
219 } | |
220 | |
221 static void | |
15157
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
222 set_default_oct_etc_dir (void) |
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
223 { |
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
224 Voct_etc_dir = subst_octave_home (OCTAVE_OCTETCDIR); |
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
225 } |
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
226 |
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
227 static void |
15971
e27d9b9b71f4
gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents:
15478
diff
changeset
|
228 set_default_oct_locale_dir (void) |
e27d9b9b71f4
gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents:
15478
diff
changeset
|
229 { |
e27d9b9b71f4
gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents:
15478
diff
changeset
|
230 Voct_locale_dir = subst_octave_home (OCTAVE_OCTLOCALEDIR); |
e27d9b9b71f4
gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents:
15478
diff
changeset
|
231 } |
e27d9b9b71f4
gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents:
15478
diff
changeset
|
232 |
e27d9b9b71f4
gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents:
15478
diff
changeset
|
233 static void |
5397 | 234 set_default_oct_file_dir (void) |
235 { | |
236 Voct_file_dir = subst_octave_home (OCTAVE_OCTFILEDIR); | |
237 } | |
238 | |
239 static void | |
2203 | 240 set_default_bin_dir (void) |
241 { | |
242 Vbin_dir = subst_octave_home (OCTAVE_BINDIR); | |
243 } | |
244 | |
5814 | 245 void |
11294
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
246 set_exec_path (const std::string& path_arg) |
4447 | 247 { |
11294
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
248 std::string tpath = path_arg; |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
249 |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
250 if (tpath.empty ()) |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
251 tpath = octave_env::getenv ("OCTAVE_EXEC_PATH"); |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
252 |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
253 if (tpath.empty ()) |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
254 tpath = Vlocal_ver_arch_lib_dir + dir_path::path_sep_str () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
255 + Vlocal_api_arch_lib_dir + dir_path::path_sep_str () |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
256 + Vlocal_arch_lib_dir + dir_path::path_sep_str () |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
257 + Varch_lib_dir + dir_path::path_sep_str () |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
258 + Vbin_dir; |
11294
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
259 |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
260 VEXEC_PATH = tpath; |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
261 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
262 // FIXME: should we really be modifying PATH in the environment? |
11294
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
263 // The way things are now, Octave will ignore directories set in the |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
264 // PATH with calls like |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
265 // |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
266 // setenv ("PATH", "/my/path"); |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
267 // |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
268 // To fix this, I think Octave should be searching the combination of |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
269 // PATH and EXEC_PATH for programs that it executes instead of setting |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
270 // the PATH in the environment and relying on the shell to do the |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
271 // searching. |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
272 |
5814 | 273 // This is static so that even if set_exec_path is called more than |
274 // once, shell_path is the original PATH from the environment, | |
275 // before we start modifying it. | |
276 static std::string shell_path = octave_env::getenv ("PATH"); | |
277 | |
278 if (! shell_path.empty ()) | |
11294
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
279 tpath = shell_path + dir_path::path_sep_str () + tpath; |
5814 | 280 |
11294
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
281 octave_env::putenv ("PATH", tpath); |
5814 | 282 } |
283 | |
284 void | |
285 set_image_path (const std::string& path) | |
286 { | |
287 VIMAGE_PATH = "."; | |
288 | |
289 std::string tpath = path; | |
290 | |
291 if (tpath.empty ()) | |
292 tpath = octave_env::getenv ("OCTAVE_IMAGE_PATH"); | |
293 | |
294 if (! tpath.empty ()) | |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
8007
diff
changeset
|
295 VIMAGE_PATH += dir_path::path_sep_str () + tpath; |
5814 | 296 |
5832 | 297 tpath = genpath (Vimage_dir, ""); |
298 | |
299 if (! tpath.empty ()) | |
8008
4d13a7a2f6ab
dir_path: use singleton class for static data members
John W. Eaton <jwe@octave.org>
parents:
8007
diff
changeset
|
300 VIMAGE_PATH += dir_path::path_sep_str () + tpath; |
5814 | 301 } |
302 | |
2203 | 303 static void |
8865
eace5649a8b5
set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents:
8008
diff
changeset
|
304 set_default_doc_cache_file (void) |
eace5649a8b5
set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents:
8008
diff
changeset
|
305 { |
15478
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
306 if (Vdoc_cache_file.empty ()) |
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
307 { |
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
308 std::string def_file = subst_octave_home (OCTAVE_DOC_CACHE_FILE); |
8865
eace5649a8b5
set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents:
8008
diff
changeset
|
309 |
15478
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
310 std::string env_file = octave_env::getenv ("OCTAVE_DOC_CACHE_FILE"); |
8865
eace5649a8b5
set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents:
8008
diff
changeset
|
311 |
15478
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
312 Vdoc_cache_file = env_file.empty () ? def_file : env_file; |
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
313 } |
8865
eace5649a8b5
set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents:
8008
diff
changeset
|
314 } |
eace5649a8b5
set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents:
8008
diff
changeset
|
315 |
eace5649a8b5
set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents:
8008
diff
changeset
|
316 static void |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14429
diff
changeset
|
317 set_default_texi_macros_file (void) |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14429
diff
changeset
|
318 { |
15478
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
319 if (Vtexi_macros_file.empty ()) |
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
320 { |
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
321 std::string def_file = subst_octave_home (OCTAVE_TEXI_MACROS_FILE); |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14429
diff
changeset
|
322 |
15478
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
323 std::string env_file = octave_env::getenv ("OCTAVE_TEXI_MACROS_FILE"); |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14429
diff
changeset
|
324 |
15478
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
325 Vtexi_macros_file = env_file.empty () ? def_file : env_file; |
b1ff8c83e232
set Vdoc_cache_file and Vtexi_macros_file variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15473
diff
changeset
|
326 } |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14429
diff
changeset
|
327 } |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14429
diff
changeset
|
328 |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14429
diff
changeset
|
329 static void |
2203 | 330 set_default_info_file (void) |
331 { | |
15473
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
332 if (Vinfo_file.empty ()) |
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
333 { |
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
334 std::string std_info_file = subst_octave_home (OCTAVE_INFOFILE); |
2512 | 335 |
15473
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
336 std::string oct_info_file = octave_env::getenv ("OCTAVE_INFO_FILE"); |
2203 | 337 |
15473
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
338 Vinfo_file = oct_info_file.empty () ? std_info_file : oct_info_file; |
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
339 } |
2203 | 340 } |
341 | |
342 static void | |
343 set_default_info_prog (void) | |
344 { | |
15473
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
345 if (Vinfo_program.empty ()) |
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
346 { |
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
347 std::string oct_info_prog = octave_env::getenv ("OCTAVE_INFO_PROGRAM"); |
2203 | 348 |
15473
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
349 if (oct_info_prog.empty ()) |
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
350 Vinfo_program = "info"; |
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
351 else |
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
352 Vinfo_program = std::string (oct_info_prog); |
457a2ff2a71b
set Vinfo_file and Vinfo_program variables directly from command line options
John W. Eaton <jwe@octave.org>
parents:
15470
diff
changeset
|
353 } |
2203 | 354 } |
355 | |
4773 | 356 static void |
2203 | 357 set_default_editor (void) |
358 { | |
5794 | 359 VEDITOR = "emacs"; |
2203 | 360 |
3523 | 361 std::string env_editor = octave_env::getenv ("EDITOR"); |
2203 | 362 |
2926 | 363 if (! env_editor.empty ()) |
5794 | 364 VEDITOR = env_editor; |
2203 | 365 } |
366 | |
367 static void | |
368 set_local_site_defaults_file (void) | |
369 { | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
370 std::string lsf = octave_env::getenv ("OCTAVE_SITE_INITFILE"); |
5781 | 371 |
372 if (lsf.empty ()) | |
373 { | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
374 Vlocal_site_defaults_file |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
375 = subst_octave_home (OCTAVE_LOCALSTARTUPFILEDIR); |
5781 | 376 Vlocal_site_defaults_file.append ("/octaverc"); |
377 } | |
378 else | |
379 Vlocal_site_defaults_file = lsf; | |
2203 | 380 } |
381 | |
382 static void | |
383 set_site_defaults_file (void) | |
384 { | |
9132
eb1747dbd360
Update help strings for command line options
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
385 std::string sf = octave_env::getenv ("OCTAVE_VERSION_INITFILE"); |
5781 | 386 |
387 if (sf.empty ()) | |
388 { | |
389 Vsite_defaults_file = subst_octave_home (OCTAVE_STARTUPFILEDIR); | |
390 Vsite_defaults_file.append ("/octaverc"); | |
391 } | |
392 else | |
393 Vsite_defaults_file = sf; | |
2203 | 394 } |
395 | |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
396 static void |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
397 set_built_in_docstrings_file (void) |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
398 { |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
399 if (Vbuilt_in_docstrings_file.empty ()) |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
400 { |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
401 std::string df = octave_env::getenv ("OCTAVE_BUILT_IN_DOCSTRINGS_FILE"); |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
402 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
403 if (df.empty ()) |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
404 Vbuilt_in_docstrings_file |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
405 = Voct_etc_dir + file_ops::dir_sep_str () + "built-in-docstrings"; |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
406 else |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
407 Vbuilt_in_docstrings_file = df; |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
408 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
409 } |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
410 |
2203 | 411 void |
412 install_defaults (void) | |
413 { | |
414 // OCTAVE_HOME must be set first! | |
415 | |
416 set_octave_home (); | |
417 | |
418 set_default_info_dir (); | |
419 | |
3141 | 420 set_default_data_dir (); |
421 | |
422 set_default_libexec_dir (); | |
423 | |
2203 | 424 set_default_arch_lib_dir (); |
425 | |
5909 | 426 set_default_local_ver_arch_lib_dir (); |
427 set_default_local_api_arch_lib_dir (); | |
2439 | 428 set_default_local_arch_lib_dir (); |
429 | |
5814 | 430 set_default_local_ver_oct_file_dir (); |
431 set_default_local_api_oct_file_dir (); | |
432 set_default_local_oct_file_dir (); | |
2203 | 433 |
5814 | 434 set_default_local_ver_fcn_file_dir (); |
435 set_default_local_api_fcn_file_dir (); | |
436 set_default_local_fcn_file_dir (); | |
437 | |
15157
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
438 set_default_oct_etc_dir (); |
15971
e27d9b9b71f4
gui: install translation files into $(datadir)/octave/$(version)/locale
Torsten <ttl@justmail.de>
parents:
15478
diff
changeset
|
439 set_default_oct_locale_dir (); |
15157
a87fa9132b72
provide Voct_etc_dir variable
John W. Eaton <jwe@octave.org>
parents:
15088
diff
changeset
|
440 |
5814 | 441 set_default_fcn_file_dir (); |
5397 | 442 set_default_oct_file_dir (); |
443 | |
5814 | 444 set_default_image_dir (); |
445 | |
2203 | 446 set_default_bin_dir (); |
447 | |
5814 | 448 set_exec_path (); |
4447 | 449 |
5814 | 450 set_image_path (); |
2203 | 451 |
8865
eace5649a8b5
set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents:
8008
diff
changeset
|
452 set_default_doc_cache_file (); |
eace5649a8b5
set default value for doc_cache_file variable
John W. Eaton <jwe@octave.org>
parents:
8008
diff
changeset
|
453 |
14614
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14429
diff
changeset
|
454 set_default_texi_macros_file (); |
4e9dc46d4125
handle texinfo macros consistently in help system and manual
John W. Eaton <jwe@octave.org>
parents:
14429
diff
changeset
|
455 |
2203 | 456 set_default_info_file (); |
457 | |
458 set_default_info_prog (); | |
459 | |
460 set_default_editor (); | |
461 | |
462 set_local_site_defaults_file (); | |
463 | |
464 set_site_defaults_file (); | |
15470
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
465 |
bf0857c789f4
initialize docstrings for built-in functions from file
John W. Eaton <jwe@octave.org>
parents:
15195
diff
changeset
|
466 set_built_in_docstrings_file (); |
2203 | 467 } |
468 | |
5794 | 469 DEFUN (EDITOR, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
470 "-*- texinfo -*-\n\ |
10840 | 471 @deftypefn {Built-in Function} {@var{val} =} EDITOR ()\n\ |
5794 | 472 @deftypefnx {Built-in Function} {@var{old_val} =} EDITOR (@var{new_val})\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
12855
diff
changeset
|
473 @deftypefnx {Built-in Function} {} EDITOR (@var{new_val}, \"local\")\n\ |
5794 | 474 Query or set the internal variable that specifies the editor to\n\ |
9134
a3739e27b017
Update section 2.4 of basics.txi
Rik <rdrider0-list@yahoo.com>
parents:
9132
diff
changeset
|
475 use with the @code{edit_history} command. The default value is taken from\n\ |
10840 | 476 the environment variable @w{@env{EDITOR}} when Octave starts. If the\n\ |
477 environment variable is not initialized, @w{@env{EDITOR}} will be set to\n\ | |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
478 @qcode{\"emacs\"}.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
12855
diff
changeset
|
479 \n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
480 When called from inside a function with the @qcode{\"local\"} option, the\n\ |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
481 variable is changed locally for the function and any subroutines it calls. \n\ |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
482 The original variable value is restored when exiting the function.\n\ |
16926
23f6852052bb
defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
483 \n\ |
5794 | 484 @seealso{edit_history}\n\ |
485 @end deftypefn") | |
2203 | 486 { |
5794 | 487 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (EDITOR); |
2203 | 488 } |
489 | |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
490 /* |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
491 %!test |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
492 %! orig_val = EDITOR (); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
493 %! old_val = EDITOR ("X"); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
494 %! assert (orig_val, old_val); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
495 %! assert (EDITOR (), "X"); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
496 %! EDITOR (orig_val); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
497 %! assert (EDITOR (), orig_val); |
14429
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
498 |
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
499 %!error (EDITOR (1, 2)) |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
500 */ |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
501 |
5794 | 502 DEFUN (EXEC_PATH, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
503 "-*- texinfo -*-\n\ |
10840 | 504 @deftypefn {Built-in Function} {@var{val} =} EXEC_PATH ()\n\ |
5794 | 505 @deftypefnx {Built-in Function} {@var{old_val} =} EXEC_PATH (@var{new_val})\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
12855
diff
changeset
|
506 @deftypefnx {Built-in Function} {} EXEC_PATH (@var{new_val}, \"local\")\n\ |
5794 | 507 Query or set the internal variable that specifies a colon separated\n\ |
11294
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
508 list of directories to append to the shell PATH when executing external\n\ |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
509 programs. The initial value of is taken from the environment variable\n\ |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
510 @w{@env{OCTAVE_EXEC_PATH}}, but that value can be overridden by\n\ |
e2a4f3478b7c
datetick.m: add missing semicolon
John W. Eaton <jwe@octave.org>
parents:
10840
diff
changeset
|
511 the command line argument @option{--exec-path PATH}.\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
12855
diff
changeset
|
512 \n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
513 When called from inside a function with the @qcode{\"local\"} option, the\n\ |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
514 variable is changed locally for the function and any subroutines it calls. \n\ |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
515 The original variable value is restored when exiting the function.\n\ |
16926
23f6852052bb
defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
516 \n\ |
23f6852052bb
defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
517 @seealso{IMAGE_PATH, OCTAVE_HOME}\n\ |
5794 | 518 @end deftypefn") |
4217 | 519 { |
5794 | 520 octave_value retval = SET_NONEMPTY_INTERNAL_STRING_VARIABLE (EXEC_PATH); |
4217 | 521 |
11298
cb94bdc74670
defaults.cc (FEXEC_PATH): only call set_exec_path if nargin is greater than zero
John W. Eaton <jwe@octave.org>
parents:
11294
diff
changeset
|
522 if (args.length () > 0) |
cb94bdc74670
defaults.cc (FEXEC_PATH): only call set_exec_path if nargin is greater than zero
John W. Eaton <jwe@octave.org>
parents:
11294
diff
changeset
|
523 set_exec_path (VEXEC_PATH); |
2203 | 524 |
5794 | 525 return retval; |
2203 | 526 } |
527 | |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
528 /* |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
529 %!test |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
530 %! orig_val = EXEC_PATH (); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
531 %! old_val = EXEC_PATH ("X"); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
532 %! assert (orig_val, old_val); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
533 %! assert (EXEC_PATH (), "X"); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
534 %! EXEC_PATH (orig_val); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
535 %! assert (EXEC_PATH (), orig_val); |
14429
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
536 |
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
537 %!error (EXEC_PATH (1, 2)) |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
538 */ |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
539 |
5814 | 540 DEFUN (IMAGE_PATH, args, nargout, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
541 "-*- texinfo -*-\n\ |
10840 | 542 @deftypefn {Built-in Function} {@var{val} =} IMAGE_PATH ()\n\ |
5814 | 543 @deftypefnx {Built-in Function} {@var{old_val} =} IMAGE_PATH (@var{new_val})\n\ |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
12855
diff
changeset
|
544 @deftypefnx {Built-in Function} {} IMAGE_PATH (@var{new_val}, \"local\")\n\ |
5794 | 545 Query or set the internal variable that specifies a colon separated\n\ |
546 list of directories in which to search for image files.\n\ | |
13951
79aa00a94e9e
doc: Document "local" option for configuration variables.
Rik <octave@nomad.inbox5.com>
parents:
12855
diff
changeset
|
547 \n\ |
17281
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
548 When called from inside a function with the @qcode{\"local\"} option, the\n\ |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
549 variable is changed locally for the function and any subroutines it calls. \n\ |
bc924baa2c4e
doc: Add new @qcode macro for code samples which are quoted.
Rik <rik@octave.org>
parents:
16926
diff
changeset
|
550 The original variable value is restored when exiting the function.\n\ |
16926
23f6852052bb
defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
551 \n\ |
23f6852052bb
defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
552 @seealso{EXEC_PATH, OCTAVE_HOME}\n\ |
5794 | 553 @end deftypefn") |
554 { | |
5814 | 555 return SET_NONEMPTY_INTERNAL_STRING_VARIABLE (IMAGE_PATH); |
5794 | 556 } |
557 | |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
558 /* |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
559 %!test |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
560 %! orig_val = IMAGE_PATH (); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
561 %! old_val = IMAGE_PATH ("X"); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
562 %! assert (orig_val, old_val); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
563 %! assert (IMAGE_PATH (), "X"); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
564 %! IMAGE_PATH (orig_val); |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
565 %! assert (IMAGE_PATH (), orig_val); |
14429
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
566 |
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
567 %!error (IMAGE_PATH (1, 2)) |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
568 */ |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
569 |
5780 | 570 DEFUN (OCTAVE_HOME, args, , |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
571 "-*- texinfo -*-\n\ |
5780 | 572 @deftypefn {Built-in Function} {} OCTAVE_HOME ()\n\ |
573 Return the name of the top-level Octave installation directory.\n\ | |
16926
23f6852052bb
defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
574 \n\ |
23f6852052bb
defaults.cc: refer to more functions in the seealso section of help text.
Carnë Draug <carandraug@octave.org>
parents:
16892
diff
changeset
|
575 @seealso{EXEC_PATH, IMAGE_PATH}\n\ |
5780 | 576 @end deftypefn") |
577 { | |
578 octave_value retval; | |
2831 | 579 |
5780 | 580 if (args.length () == 0) |
581 retval = Voctave_home; | |
582 else | |
5823 | 583 print_usage (); |
5780 | 584 |
585 return retval; | |
5749 | 586 } |
3446 | 587 |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
588 /* |
14429
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
589 %!assert (ischar (OCTAVE_HOME ())) |
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
590 %!error OCTAVE_HOME (1) |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
591 */ |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
592 |
5749 | 593 DEFUNX ("OCTAVE_VERSION", FOCTAVE_VERSION, args, , |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
594 "-*- texinfo -*-\n\ |
5749 | 595 @deftypefn {Built-in Function} {} OCTAVE_VERSION ()\n\ |
596 Return the version number of Octave, as a string.\n\ | |
597 @end deftypefn") | |
598 { | |
599 octave_value retval; | |
600 | |
601 int nargin = args.length (); | |
602 | |
603 if (nargin == 0) | |
604 retval = OCTAVE_VERSION; | |
605 else | |
5823 | 606 print_usage (); |
5749 | 607 |
608 return retval; | |
2203 | 609 } |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
610 |
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
611 /* |
14429
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
612 %!assert (ischar (OCTAVE_VERSION ())) |
eff4a5933e28
Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
613 %!error OCTAVE_VERSION (1) |
12851
7fce673b934a
codesprint: new tests for defaults.cc
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
614 */ |