936 unsigned char *pabyRec;
937 void *pReturnField = NULL;
942 if (hEntity < 0 || hEntity >= psDBF->nRecords)
945 if (iField < 0 || iField >= psDBF->nFields)
954 pabyRec = (
unsigned char *)psDBF->pszCurrentRecord;
959 if (psDBF->panFieldSize[iField] >= psDBF->nWorkFieldLength)
961 psDBF->nWorkFieldLength = psDBF->panFieldSize[iField] + 100;
962 if (psDBF->pszWorkField == NULL)
963 psDBF->pszWorkField = (
char *)
malloc(psDBF->nWorkFieldLength);
965 psDBF->pszWorkField = (
char *)realloc(psDBF->pszWorkField, psDBF->nWorkFieldLength);
972 psDBF->pszWorkField, ((
const char *)pabyRec) + psDBF->panFieldOffset[iField], psDBF->panFieldSize[iField]);
973 psDBF->pszWorkField[psDBF->panFieldSize[iField]] =
'\0';
975 pReturnField = psDBF->pszWorkField;
980 if (chReqType ==
'N')
982 psDBF->dfDoubleField = psDBF->sHooks.Atof(psDBF->pszWorkField);
984 pReturnField = &(psDBF->dfDoubleField);
990 #ifdef TRIM_DBF_WHITESPACE
993 char *pchSrc, *pchDst;
995 pchDst = pchSrc = psDBF->pszWorkField;
996 while (*pchSrc ==
' ')
999 while (*pchSrc !=
'\0')
1000 *(pchDst++) = *(pchSrc++);
1003 while (pchDst != psDBF->pszWorkField && *(--pchDst) ==
' ')
1008 return (pReturnField);
static int DBFLoadRecord(DBFHandle psDBF, int iRecord)
if(!DBFLoadRecord(psDBF, hEntity)) return NULL