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

◆ SHPClose()

void SHPAPI_CALL SHPClose ( SHPHandle  psSHP)

Definition at line 879 of file shpopen.c.

881{
882 if( psSHP == SHPLIB_NULLPTR )
883 return;
884
885/* -------------------------------------------------------------------- */
886/* Update the header if we have modified anything. */
887/* -------------------------------------------------------------------- */
888 if( psSHP->bUpdated )
889 SHPWriteHeader( psSHP );
890
891/* -------------------------------------------------------------------- */
892/* Free all resources, and close files. */
893/* -------------------------------------------------------------------- */
894 free( psSHP->panRecOffset );
895 free( psSHP->panRecSize );
896
897 if ( psSHP->fpSHX != SHPLIB_NULLPTR)
898 psSHP->sHooks.FClose( psSHP->fpSHX );
899 psSHP->sHooks.FClose( psSHP->fpSHP );
900
901 if( psSHP->pabyRec != SHPLIB_NULLPTR )
902 {
903 free( psSHP->pabyRec );
904 }
905
906 if( psSHP->pabyObjectBuf != SHPLIB_NULLPTR )
907 {
908 free( psSHP->pabyObjectBuf );
909 }
910 if( psSHP->psCachedObject != SHPLIB_NULLPTR )
911 {
912 free( psSHP->psCachedObject );
913 }
914
915 free( psSHP );
916}
void free(void *)
void SHPAPI_CALL SHPWriteHeader(SHPHandle psSHP)
Definition shpopen.c:147
#define SHPLIB_NULLPTR
Definition shpopen.c:101
int(* FClose)(SAFile file)
Definition shapefil.h:296
SAFile fpSHX
Definition shapefil.h:318
SAFile fpSHP
Definition shapefil.h:317
SHPObject * psCachedObject
Definition shapefil.h:340
unsigned int * panRecSize
Definition shapefil.h:327
SAHooks sHooks
Definition shapefil.h:315
unsigned char * pabyObjectBuf
Definition shapefil.h:338
int bUpdated
Definition shapefil.h:332
unsigned int * panRecOffset
Definition shapefil.h:326
unsigned char * pabyRec
Definition shapefil.h:334

References SHPInfo::bUpdated, SAHooks::FClose, SHPInfo::fpSHP, SHPInfo::fpSHX, free(), SHPInfo::pabyObjectBuf, SHPInfo::pabyRec, SHPInfo::panRecOffset, SHPInfo::panRecSize, SHPInfo::psCachedObject, SHPInfo::sHooks, SHPLIB_NULLPTR, and SHPWriteHeader().

Referenced by ShpDumperCloseTable(), ShpLoaderDestroy(), and SHPOpenLL().

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