Ice Sheet System Model  4.18
Code documentation
Functions
CheckNumMatlabArguments.cpp File Reference

: check number of arguments and report an usage error message. More...

#include "./matlabio.h"

Go to the source code of this file.

Functions

int CheckNumMatlabArguments (int nlhs, int NLHS, int nrhs, int NRHS, const char *THISFUNCTION, void(*function)(void))
 

Detailed Description

: check number of arguments and report an usage error message.

:

Definition in file CheckNumMatlabArguments.cpp.

Function Documentation

◆ CheckNumMatlabArguments()

int CheckNumMatlabArguments ( int  nlhs,
int  NLHS,
int  nrhs,
int  NRHS,
const char *  THISFUNCTION,
void(*)(void)  function 
)

Definition at line 7 of file CheckNumMatlabArguments.cpp.

7  {
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 }
NRHS
#define NRHS
Definition: BamgConvertMesh.h:52
NLHS
#define NLHS
Definition: BamgConvertMesh.h:50
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49