PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ return()

return ( const char *  )

Definition at line 1613 of file dbfopen.c.

1624 {
1625  DBFHandle newDBF;
1626 
1627  newDBF = DBFCreateEx ( pszFilename, psDBF->pszCodePage );
1628  if ( newDBF == NULL ) return ( NULL );
1629 
1630  newDBF->nFields = psDBF->nFields;
1631  newDBF->nRecordLength = psDBF->nRecordLength;
1632  newDBF->nHeaderLength = psDBF->nHeaderLength;
1633 
1634  newDBF->pszHeader = (char *) malloc ( newDBF->nHeaderLength );
1635  memcpy ( newDBF->pszHeader, psDBF->pszHeader, newDBF->nHeaderLength );
1636 
1637  newDBF->panFieldOffset = (int *) malloc ( sizeof(int) * psDBF->nFields );
1638  memcpy ( newDBF->panFieldOffset, psDBF->panFieldOffset, sizeof(int) * psDBF->nFields );
1639  newDBF->panFieldSize = (int *) malloc ( sizeof(int) * psDBF->nFields );
1640  memcpy ( newDBF->panFieldSize, psDBF->panFieldSize, sizeof(int) * psDBF->nFields );
1641  newDBF->panFieldDecimals = (int *) malloc ( sizeof(int) * psDBF->nFields );
1642  memcpy ( newDBF->panFieldDecimals, psDBF->panFieldDecimals, sizeof(int) * psDBF->nFields );
1643  newDBF->pachFieldType = (char *) malloc ( sizeof(char) * psDBF->nFields );
1644  memcpy ( newDBF->pachFieldType, psDBF->pachFieldType, sizeof(char)*psDBF->nFields );
1645 
1646  newDBF->bNoHeader = TRUE;
1647  newDBF->bUpdated = TRUE;
1648 
1649  DBFWriteHeader ( newDBF );
1650  DBFClose ( newDBF );
1651 
1652  newDBF = DBFOpen ( pszFilename, "rb+" );
1653 
1654  return ( newDBF );
1655 }
DBFHandle SHPAPI_CALL DBFOpen(const char *pszFilename, const char *pszAccess)
Definition: dbfopen.c:365
DBFHandle SHPAPI_CALL DBFCreateEx(const char *pszFilename, const char *pszCodePage)
Definition: dbfopen.c:641
void SHPAPI_CALL DBFClose(DBFHandle psDBF)
Definition: dbfopen.c:578
static void DBFWriteHeader(DBFHandle psDBF)
Definition: dbfopen.c:197
#define TRUE
Definition: dbfopen.c:169
void * malloc(YYSIZE_T)

Referenced by ptarray_calc_areas(), rt_raster_calc_phys_params(), rt_raster_get_phys_params(), and rt_raster_set_phys_params().

Here is the caller graph for this function: