Last change
on this file since 13975 was 13749, checked in by Mathieu Morlighem, 12 years ago |
CHG: moved all matlab and python code from src/c/ to src/wrappers
|
File size:
656 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 | #include "../../c/shared/Exceptions/exceptions.h"
|
---|
7 |
|
---|
8 | int CheckNumMatlabArguments(int nlhs,int NLHS, int nrhs,int NRHS, const char* THISFUNCTION, void (*function)( void )){
|
---|
9 |
|
---|
10 | /*checks on arguments on the matlab side: */
|
---|
11 | if (nrhs==0 && nlhs==0) {
|
---|
12 | /*unless NLHS=0 and NRHS=0, we are just asking for documentation: */
|
---|
13 | if (NRHS==0 && NLHS==0)return 1;
|
---|
14 | /* special case: */
|
---|
15 | function();
|
---|
16 | _error_("usage: see above");
|
---|
17 | }
|
---|
18 | else if (nlhs!=NLHS || nrhs!=NRHS ) {
|
---|
19 | function();
|
---|
20 | _error_("usage error.");
|
---|
21 | }
|
---|
22 | return 1;
|
---|
23 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.