Ice Sheet System Model  4.18
Code documentation
CheckNumPythonArguments.cpp
Go to the documentation of this file.
1 
5 #define PY_ARRAY_UNIQUE_SYMBOL PythonIOSymbol
6 #define NO_IMPORT
7 
8 #include "./pythonio.h"
9 #include "../../c/shared/Exceptions/exceptions.h"
10 
11 int CheckNumPythonArguments(PyObject* inputs,int NRHS, void (*function)( void )){
12 
13  Py_ssize_t size=0;
14 
15  /*figure out size of tuple in input: */
16  size=PyTuple_Size(inputs);
17 
18  /*check on requested size: */
19  if (size==0){
20  function();
21  _error_("usage: see above");
22  }
23  else if (size!=NRHS ) {
24  function();
25  _error_("usage error.");
26  }
27  return 1;
28 }
NRHS
#define NRHS
Definition: BamgConvertMesh.h:52
CheckNumPythonArguments
int CheckNumPythonArguments(PyObject *inputs, int NRHS, void(*function)(void))
Definition: CheckNumPythonArguments.cpp:11
pythonio.h
_error_
#define _error_(StreamArgs)
Definition: exceptions.h:49