view scripts/deprecated/octave_config_info.m @ 22299:9fc91bb2aec3

doc: grammarcheck documentation for 4.2 release. * container.txi, contrib.txi, diagperm.txi, errors.txi, external.txi, func.txi, image.txi, nonlin.txi, numbers.txi, plot.txi, quad.txi, sparse.txi, strings.txi, tips.txi, var.txi, vectorize.txi, __dispatch__.cc, cellfun.cc, file-io.cc, gsvd.cc, load-path.cc, regexp.cc, __init_gnuplot__.cc, __osmesa_print__.cc, qr.cc, xzip.cc, ov-classdef.cc, octave_config_info.m, grabcode.m, publish.m, dialog.m, condest.m, normest1.m, mkdir.m, ode23.m, ode45.m, odeplot.m, AbsRel_Norm.m, integrate_adaptive.m, integrate_const.m, integrate_n_steps.m, axis.m, isocaps.m, isocolors.m, isosurface.m, light.m, __calc_isovalue_from_data__.m, __marching_cube__.m, cov.m, median.m: doc: grammarcheck documentation for 4.2 release.
author Rik <rik@octave.org>
date Mon, 15 Aug 2016 10:05:50 -0700
parents 17845d0e359f
children 3a2b891d0b33 e9a0469dedd9
line wrap: on
line source

## Copyright (C) 2016 John W. Eaton
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or (at
## your option) any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING.  If not, see
## <http://www.gnu.org/licenses/>.

## -*- texinfo -*-
## @deftypefn  {} {} octave_config_info ()
## @deftypefnx {} {} octave_config_info (@var{option})
##
## @code{octave_config_info} is deprecated and will be removed in
## Octave version 4.6.  Use @code{__have_feature__ (@var{option})} or
## @code{__octave_config_info__} as a replacement.
##
## Return a structure containing configuration and installation
## information for Octave.
##
## If @var{option} is a string, return the configuration information for
## the specified option.
##
## @seealso{computer}
## @end deftypefn

## Deprecated in version 4.2

function [retval, build_env_cell] = octave_config_info (option)

  persistent warned = false;
  if (! warned)
    warned = true;
    warning ("Octave:deprecated-function",
             "octave_config_info is obsolete and will be removed from a future version of Octave, please use __have_feature__ or __octave_config_info__ instead.");
  endif

  if (nargin > 1)
    print_usage ();
  endif

  if (nargin == 0)
    info = __octave_config_info__ ();
    ## Structure layout has changed.

    dld = info.dld;
    float_format = info.float_format;
    words_big_endian = info.words_big_endian;
    words_little_endian = info.words_little_endian;

    features = info.build_features;

    env = info.build_environment;
    env_fields = fieldnames (env);
    env_vals = struct2cell (env);
    env_cell = [env_fields, env_vals]';

    info = rmfield (info, {"dld", "float_format", "words_big_endian", ...
                           "words_little_endian", "build_features", ...
                           "build_environment"});

    other_fields = fieldnames (info);
    other_vals = struct2cell (info);
    other_cell = [other_fields, other_vals]';

    retval = struct ("dld", dld,
                     "float_format", float_format,
                     "words_big_endian", words_big_endian,
                     "words_little_endian", words_little_endian,
                     "features", features,
                     env_cell{:}, other_cell{:});
  else
    if (strcmp (option, "features"))
      option = "build_features";
    endif
    retval = __octave_config_info__ (option);
  endif

endfunction