Mercurial > octave
annotate scripts/deprecated/octave_config_info.m @ 23084:ef4d915df748
maint: Merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 23 Jan 2017 14:27:48 -0500 |
parents | 3a2b891d0b33 e9a0469dedd9 |
children | 092078913d54 |
rev | line source |
---|---|
21434 | 1 ## Copyright (C) 2016 John W. Eaton |
2 ## | |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22299
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22299
diff
changeset
|
8 ## (at your option) any later version. |
21434 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22299
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22299
diff
changeset
|
13 ## GNU General Public License for more details. |
21434 | 14 ## |
15 ## You should have received a copy of the GNU General Public License | |
16 ## along with Octave; see the file COPYING. If not, see | |
17 ## <http://www.gnu.org/licenses/>. | |
18 | |
19 ## -*- texinfo -*- | |
22299
9fc91bb2aec3
doc: grammarcheck documentation for 4.2 release.
Rik <rik@octave.org>
parents:
21549
diff
changeset
|
20 ## @deftypefn {} {} octave_config_info () |
9fc91bb2aec3
doc: grammarcheck documentation for 4.2 release.
Rik <rik@octave.org>
parents:
21549
diff
changeset
|
21 ## @deftypefnx {} {} octave_config_info (@var{option}) |
21434 | 22 ## |
21437
5292a483275e
octave_config_info.m: Add possible replacement functions to docstring.
Rik <rik@octave.org>
parents:
21434
diff
changeset
|
23 ## @code{octave_config_info} is deprecated and will be removed in |
5292a483275e
octave_config_info.m: Add possible replacement functions to docstring.
Rik <rik@octave.org>
parents:
21434
diff
changeset
|
24 ## Octave version 4.6. Use @code{__have_feature__ (@var{option})} or |
5292a483275e
octave_config_info.m: Add possible replacement functions to docstring.
Rik <rik@octave.org>
parents:
21434
diff
changeset
|
25 ## @code{__octave_config_info__} as a replacement. |
21434 | 26 ## |
27 ## Return a structure containing configuration and installation | |
21549
17845d0e359f
doc: Remove unecessary whitespace and end of docstrings.
Rik <rik@octave.org>
parents:
21437
diff
changeset
|
28 ## information for Octave. |
21434 | 29 ## |
30 ## If @var{option} is a string, return the configuration information for | |
31 ## the specified option. | |
32 ## | |
33 ## @seealso{computer} | |
34 ## @end deftypefn | |
35 | |
36 ## Deprecated in version 4.2 | |
37 | |
38 function [retval, build_env_cell] = octave_config_info (option) | |
39 | |
40 persistent warned = false; | |
41 if (! warned) | |
42 warned = true; | |
43 warning ("Octave:deprecated-function", | |
21437
5292a483275e
octave_config_info.m: Add possible replacement functions to docstring.
Rik <rik@octave.org>
parents:
21434
diff
changeset
|
44 "octave_config_info is obsolete and will be removed from a future version of Octave, please use __have_feature__ or __octave_config_info__ instead."); |
21434 | 45 endif |
46 | |
47 if (nargin > 1) | |
48 print_usage (); | |
49 endif | |
50 | |
51 if (nargin == 0) | |
52 info = __octave_config_info__ (); | |
53 ## Structure layout has changed. | |
54 | |
55 dld = info.dld; | |
56 float_format = info.float_format; | |
57 words_big_endian = info.words_big_endian; | |
58 words_little_endian = info.words_little_endian; | |
59 | |
60 features = info.build_features; | |
61 | |
62 env = info.build_environment; | |
63 env_fields = fieldnames (env); | |
64 env_vals = struct2cell (env); | |
65 env_cell = [env_fields, env_vals]'; | |
66 | |
67 info = rmfield (info, {"dld", "float_format", "words_big_endian", ... | |
68 "words_little_endian", "build_features", ... | |
69 "build_environment"}); | |
70 | |
71 other_fields = fieldnames (info); | |
72 other_vals = struct2cell (info); | |
73 other_cell = [other_fields, other_vals]'; | |
74 | |
75 retval = struct ("dld", dld, | |
76 "float_format", float_format, | |
77 "words_big_endian", words_big_endian, | |
78 "words_little_endian", words_little_endian, | |
79 "features", features, | |
80 env_cell{:}, other_cell{:}); | |
81 else | |
82 if (strcmp (option, "features")) | |
83 option = "build_features"; | |
84 endif | |
85 retval = __octave_config_info__ (option); | |
86 endif | |
87 | |
88 endfunction |