view examples/myprop.c @ 17160:f2a8592b8fbd

doc: Shorten some long subsection names in Manual. Remove excess spaces from ends of @menu definitions. * doc/interpreter/arith.txi, doc/interpreter/basics.txi, doc/interpreter/bugs.txi, doc/interpreter/container.txi, doc/interpreter/data.txi, doc/interpreter/diagperm.txi, doc/interpreter/diffeq.txi, doc/interpreter/emacs.txi, doc/interpreter/expr.txi, doc/interpreter/external.txi, doc/interpreter/func.txi, doc/interpreter/grammar.txi, doc/interpreter/gui.txi, doc/interpreter/install.txi, doc/interpreter/intro.txi, doc/interpreter/io.txi, doc/interpreter/java.txi, doc/interpreter/linalg.txi, doc/interpreter/matrix.txi, doc/interpreter/nonlin.txi, doc/interpreter/numbers.txi, doc/interpreter/octave.texi, doc/interpreter/optim.txi, doc/interpreter/plot.txi, doc/interpreter/preface.txi, doc/interpreter/quad.txi, doc/interpreter/sparse.txi, doc/interpreter/stats.txi, doc/interpreter/stmt.txi, doc/interpreter/strings.txi, doc/interpreter/system.txi, doc/interpreter/var.txi: Shorten some long subsection names in Manual. Remove excess spaces from ends of @menu definitions.
author Rik <rik@octave.org>
date Fri, 02 Aug 2013 13:52:39 -0700
parents be41c30bcb44
children
line wrap: on
line source

#include "mex.h"

void
mexFunction (int nlhs, mxArray* plhs[],
             int nrhs, const mxArray* prhs[])
{
  double handle;
  char property[256];

  if (nrhs < 2 || nrhs > 3)
    mexErrMsgTxt ("incorrect number of arguments");
  if (!mxIsDouble (prhs[0]))
    mexErrMsgTxt ("handle expected to be a double scalar");
  if (!mxIsChar (prhs[1]))
    mexErrMsgTxt ("expected property to be a string");
  
  handle = mxGetScalar (prhs[0]);
  mxGetString (prhs[1], property, 256);
  plhs[0] = mxDuplicateArray (mexGet (handle, property));
  
  if (nrhs == 3)
    if (mexSet (handle, property, mxDuplicateArray (prhs[2])))
      mexErrMsgTxt ("failed to set property");
}