PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ DBFLoadRecord()

static int DBFLoadRecord ( DBFHandle  psDBF,
int  iRecord 
)
static

Definition at line 286 of file dbfopen.c.

287{
288 if (psDBF->nCurrentRecord != iRecord)
289 {
290 SAOffset nRecordOffset;
291
292 if (!DBFFlushRecord(psDBF))
293 return FALSE;
294
295 nRecordOffset = psDBF->nRecordLength * (SAOffset)iRecord + psDBF->nHeaderLength;
296
297 if (psDBF->sHooks.FSeek(psDBF->fp, nRecordOffset, SEEK_SET) != 0)
298 {
299 char szMessage[128];
300 sprintf(szMessage, "fseek(%ld) failed on DBF file.\n", (long)nRecordOffset);
301 psDBF->sHooks.Error(szMessage);
302 return FALSE;
303 }
304
305 if (psDBF->sHooks.FRead(psDBF->pszCurrentRecord, psDBF->nRecordLength, 1, psDBF->fp) != 1)
306 {
307 char szMessage[128];
308 sprintf(szMessage, "fread(%d) failed on DBF file.\n", psDBF->nRecordLength);
309 psDBF->sHooks.Error(szMessage);
310 return FALSE;
311 }
312
313 psDBF->nCurrentRecord = iRecord;
314 }
315
316 return TRUE;
317}
#define TRUE
Definition dbfopen.c:169
#define FALSE
Definition dbfopen.c:168
static int DBFFlushRecord(DBFHandle psDBF)
Definition dbfopen.c:258
unsigned long SAOffset
Definition shapefil.h:250

References DBFFlushRecord(), FALSE, and TRUE.

Referenced by DBFIsRecordDeleted(), DBFMarkRecordDeleted(), DBFReadAttribute(), DBFWriteAttribute(), DBFWriteAttributeDirectly(), and DBFWriteTuple().

Here is the call graph for this function:
Here is the caller graph for this function: