PostGIS  2.1.10dev-r@@SVN_REVISION@@
static int DBFLoadRecord ( DBFHandle  psDBF,
int  iRecord 
)
static

Definition at line 292 of file dbfopen.c.

References DBFFlushRecord(), FALSE, and TRUE.

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

294 {
295  if( psDBF->nCurrentRecord != iRecord )
296  {
297  SAOffset nRecordOffset;
298 
299  if( !DBFFlushRecord( psDBF ) )
300  return FALSE;
301 
302  nRecordOffset =
303  psDBF->nRecordLength * (SAOffset) iRecord + psDBF->nHeaderLength;
304 
305  if( psDBF->sHooks.FSeek( psDBF->fp, nRecordOffset, SEEK_SET ) != 0 )
306  {
307  char szMessage[128];
308  sprintf( szMessage, "fseek(%ld) failed on DBF file.\n",
309  (long) nRecordOffset );
310  psDBF->sHooks.Error( szMessage );
311  return FALSE;
312  }
313 
314  if( psDBF->sHooks.FRead( psDBF->pszCurrentRecord,
315  psDBF->nRecordLength, 1, psDBF->fp ) != 1 )
316  {
317  char szMessage[128];
318  sprintf( szMessage, "fread(%d) failed on DBF file.\n",
319  psDBF->nRecordLength );
320  psDBF->sHooks.Error( szMessage );
321  return FALSE;
322  }
323 
324  psDBF->nCurrentRecord = iRecord;
325  }
326 
327  return TRUE;
328 }
unsigned long SAOffset
Definition: shapefil.h:251
static int DBFFlushRecord(DBFHandle psDBF)
Definition: dbfopen.c:259
#define FALSE
Definition: dbfopen.c:169
#define TRUE
Definition: dbfopen.c:170

Here is the call graph for this function:

Here is the caller graph for this function: