Mercurial > hg > octave-lyh
annotate examples/myprop.c @ 14855:1b48b209a8d6
maint: Use Octave coding conventions for coddling parentheses in examples directory
* display.m, subsref.m, display.m, mtimes.m, plot.m, polyval.m, myprop.c,
stringdemo.cc, unwinddemo.cc: Use Octave coding conventions for coddling
parentheses.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Mon, 09 Jul 2012 13:23:31 -0700 |
parents | 4295d634797d |
children | be41c30bcb44 |
rev | line source |
---|---|
6595 | 1 #include "mex.h" |
2 | |
3 void | |
4 mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]) | |
5 { | |
6 double handle; | |
7 char property[256]; | |
8 | |
9 if (nrhs < 2 || nrhs > 3) | |
10 mexErrMsgTxt ("incorrect number of arguments"); | |
14855
1b48b209a8d6
maint: Use Octave coding conventions for coddling parentheses in examples directory
Rik <octave@nomad.inbox5.com>
parents:
9053
diff
changeset
|
11 if (!mxIsDouble (prhs[0])) |
6595 | 12 mexErrMsgTxt ("handle expected to be a double scalar"); |
13 if (!mxIsChar (prhs[1])) | |
14 mexErrMsgTxt ("expected property to be a string"); | |
15 | |
16 handle = mxGetScalar (prhs[0]); | |
17 mxGetString (prhs[1], property, 256); | |
18 plhs[0] = mxDuplicateArray (mexGet (handle, property)); | |
19 | |
20 if (nrhs == 3) | |
21 if (mexSet (handle, property, mxDuplicateArray (prhs[2]))) | |
22 mexErrMsgTxt ("failed to set property"); | |
23 } | |
24 | |
25 |