Last change
on this file since 15396 was 15396, checked in by Mathieu Morlighem, 12 years ago |
merged trunk-jpl and trunk for revision 15394
|
File size:
606 bytes
|
Line | |
---|
1 | /*!\file CheckNumMatlabArguments.cpp:
|
---|
2 | * \brief: check number of arguments and report an usage error message.
|
---|
3 | */
|
---|
4 |
|
---|
5 | #include "./matlabio.h"
|
---|
6 |
|
---|
7 | int CheckNumMatlabArguments(int nlhs,int NLHS, int nrhs,int NRHS, const char* THISFUNCTION, void (*function)( void )){
|
---|
8 |
|
---|
9 | /*checks on arguments on the matlab side: */
|
---|
10 | if (nrhs==0 && nlhs==0) {
|
---|
11 | /*unless NLHS=0 and NRHS=0, we are just asking for documentation: */
|
---|
12 | if (NRHS==0 && NLHS==0)return 1;
|
---|
13 | /* special case: */
|
---|
14 | function();
|
---|
15 | _error_("usage: see above");
|
---|
16 | }
|
---|
17 | else if (nlhs!=NLHS || nrhs!=NRHS ) {
|
---|
18 | function();
|
---|
19 | _error_("usage error.");
|
---|
20 | }
|
---|
21 | return 1;
|
---|
22 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.