int get_pointer_info(void* _pvCtx, int _iRhs, int* _piParent, int *_piAddr, int _iItemPos) { SciErr sciErr; void* pvPtr = NULL; if (_iItemPos == 0) { sciErr = getPointer(_pvCtx, _piAddr, &pvPtr); } else { sciErr = getPointerInList(_pvCtx, _piParent, _iItemPos, &pvPtr); } if (sciErr.iErr) { printError(&sciErr, 0); return 0; } insert_indent(); sciprint("Pointer : 0x%08X\n", pvPtr); return 0; }
//-------------------------------------------------------------------------------------------------------- FILE * createFILEFromScilabFannErrorStruct(unsigned int StackPos, int * res) { int m_param, n_param, * pi_param_addr; int type, * pi_len = NULL, i; char ** LabelList = NULL; FILE * log_file = NULL; SciErr _sciErr; *res = -1; _sciErr = getVarAddressFromPosition(pvApiCtx, StackPos, &pi_param_addr); if (_sciErr.iErr) { printError(&_sciErr, 0); return NULL; } _sciErr = getVarType(pvApiCtx, pi_param_addr, &type); if (_sciErr.iErr) { printError(&_sciErr, 0); return NULL; } if (type!=sci_mlist) { Scierror(999,"Argument %d is not a mlist\n",StackPos); return NULL; } _sciErr = getMatrixOfStringInList(pvApiCtx, pi_param_addr, 1, &m_param, &n_param, NULL, NULL); if (_sciErr.iErr) { printError(&_sciErr, 0); return NULL; } pi_len = (int*)MALLOC(sizeof(int) * m_param * n_param); _sciErr = getMatrixOfStringInList(pvApiCtx, pi_param_addr, 1, &m_param, &n_param, pi_len, NULL); if (_sciErr.iErr) { printError(&_sciErr, 0); return NULL; } LabelList = (char**)MALLOC(sizeof(char*) * m_param * n_param); for(i=0; i<m_param*n_param; i++) { LabelList[i] = (char*)MALLOC(sizeof(char) * (pi_len[i] + 1)); // + 1 for null termination } _sciErr = getMatrixOfStringInList(pvApiCtx, pi_param_addr, 1, &m_param, &n_param, pi_len, LabelList); if (_sciErr.iErr) { printError(&_sciErr, 0); return NULL; } if (strcmp(LabelList[0],"fannerrorlist") != 0) { Scierror(999,"Argument 1 is not a fannerrorlist\r\n"); return NULL; } _sciErr = getPointerInList(pvApiCtx, pi_param_addr, 2, (void **)&log_file); if (_sciErr.iErr) { printError(&_sciErr, 0); return NULL; } *res = 0; return log_file; }