PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ DBFClose()

void SHPAPI_CALL DBFClose ( DBFHandle  psDBF)

Definition at line 606 of file dbfopen.c.

607 {
608  if( psDBF == SHPLIB_NULLPTR )
609  return;
610 
611 /* -------------------------------------------------------------------- */
612 /* Write out header if not already written. */
613 /* -------------------------------------------------------------------- */
614  if( psDBF->bNoHeader )
615  DBFWriteHeader( psDBF );
616 
618 
619 /* -------------------------------------------------------------------- */
620 /* Update last access date, and number of records if we have */
621 /* write access. */
622 /* -------------------------------------------------------------------- */
623  if( psDBF->bUpdated )
624  DBFUpdateHeader( psDBF );
625 
626 /* -------------------------------------------------------------------- */
627 /* Close, and free resources. */
628 /* -------------------------------------------------------------------- */
629  psDBF->sHooks.FClose( psDBF->fp );
630 
631  if( psDBF->panFieldOffset != SHPLIB_NULLPTR )
632  {
633  free( psDBF->panFieldOffset );
634  free( psDBF->panFieldSize );
635  free( psDBF->panFieldDecimals );
636  free( psDBF->pachFieldType );
637  }
638 
639  if( psDBF->pszWorkField != SHPLIB_NULLPTR )
640  free( psDBF->pszWorkField );
641 
642  free( psDBF->pszHeader );
643  free( psDBF->pszCurrentRecord );
644  free( psDBF->pszCodePage );
645 
646  free( psDBF );
647 }
static void DBFWriteHeader(DBFHandle psDBF)
Definition: dbfopen.c:127
#define SHPLIB_NULLPTR
Definition: dbfopen.c:99
static int DBFFlushRecord(DBFHandle psDBF)
Definition: dbfopen.c:195
#define CPL_IGNORE_RET_VAL_INT(x)
Definition: dbfopen.c:87
void SHPAPI_CALL DBFUpdateHeader(DBFHandle psDBF)
Definition: dbfopen.c:304
void free(void *)
int * panFieldOffset
Definition: shapefil.h:601
int * panFieldDecimals
Definition: shapefil.h:603
char * pszCodePage
Definition: shapefil.h:625
int bUpdated
Definition: shapefil.h:616
int * panFieldSize
Definition: shapefil.h:602
char * pszCurrentRecord
Definition: shapefil.h:610
char * pszHeader
Definition: shapefil.h:606
SAFile fp
Definition: shapefil.h:592
char * pachFieldType
Definition: shapefil.h:604
SAHooks sHooks
Definition: shapefil.h:590
int bNoHeader
Definition: shapefil.h:615
char * pszWorkField
Definition: shapefil.h:613
int(* FClose)(SAFile file)
Definition: shapefil.h:296

References DBFInfo::bNoHeader, DBFInfo::bUpdated, CPL_IGNORE_RET_VAL_INT, DBFFlushRecord(), DBFUpdateHeader(), DBFWriteHeader(), SAHooks::FClose, DBFInfo::fp, free(), DBFInfo::pachFieldType, DBFInfo::panFieldDecimals, DBFInfo::panFieldOffset, DBFInfo::panFieldSize, DBFInfo::pszCodePage, DBFInfo::pszCurrentRecord, DBFInfo::pszHeader, DBFInfo::pszWorkField, DBFInfo::sHooks, and SHPLIB_NULLPTR.

Referenced by DBFCloneEmpty(), DBFOpenLL(), ShpDumperCloseTable(), and ShpLoaderDestroy().

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