MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / OPS_GetIntInput

Function OPS_GetIntInput

SRC/interpreter/OpenSeesCommandsPython.cpp:846–878  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

844
845extern "C"
846int OPS_GetIntInput(int *numData, int*data)
847{
848 if ((numberArgs - currentArg) >= *numData) {
849 for (int i=0; i<*numData; i++) {
850 PyObject *o = PyTuple_GetItem(currentArgs,currentArg);
851
852#if PY_MAJOR_VERSION==2
853 if (!PyInt_Check(o)) {
854 //PyErr_SetString(PyExc_ValueError,"invalid integer");
855 return -1;
856 }
857#elif PY_MAJOR_VERSION==3
858 if (!PyLong_Check(o)) {
859 //PyErr_SetString(PyExc_ValueError,"invalid integer");
860 return -1;
861 }
862#endif
863
864
865#if PY_MAJOR_VERSION==2
866 long value = PyInt_AS_LONG(o);
867#elif PY_MAJOR_VERSION==3
868 long value = PyLong_AsLong(o);
869#endif
870
871 data[i] = value;
872 currentArg++;
873 }
874
875 return 0;
876 }
877 return -1;
878}
879
880
881extern "C"

Callers 1

ops_testUniaxialMaterialFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected