|
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
|
| Rev | Line | |
|---|
| [12011] | 1 | /*!\file CheckNumMatlabArguments.cpp:
|
|---|
| 2 | * \brief: check number of arguments and report an usage error message.
|
|---|
| 3 | */
|
|---|
| 4 |
|
|---|
| [13749] | 5 | #include "./matlabio.h"
|
|---|
| [12011] | 6 |
|
|---|
| [13749] | 7 | int CheckNumMatlabArguments(int nlhs,int NLHS, int nrhs,int NRHS, const char* THISFUNCTION, void (*function)( void )){
|
|---|
| [12011] | 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();
|
|---|
| [13056] | 15 | _error_("usage: see above");
|
|---|
| [12011] | 16 | }
|
|---|
| 17 | else if (nlhs!=NLHS || nrhs!=NRHS ) {
|
|---|
| 18 | function();
|
|---|
| [13056] | 19 | _error_("usage error.");
|
|---|
| [12011] | 20 | }
|
|---|
| 21 | return 1;
|
|---|
| 22 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.