PostGIS  3.4.0dev-r@@SVN_REVISION@@
dbfopen.c File Reference
#include "shapefil.h"
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <strings.h>
Include dependency graph for dbfopen.c:

Go to the source code of this file.

Macros

#define STRCASECMP(a, b)   (strcasecmp(a,b))
 
#define CPLsprintf   sprintf
 
#define CPLsnprintf   snprintf
 
#define FALSE   0
 
#define TRUE   1
 
#define XBASE_FILEHDR_SZ   32
 
#define HEADER_RECORD_TERMINATOR   0x0D
 
#define END_OF_FILE_CHARACTER   0x1A
 
#define CPL_IGNORE_RET_VAL_INT(x)   x
 
#define STATIC_CAST(type, x)   ((type)(x))
 
#define REINTERPRET_CAST(type, x)   ((type)(x))
 
#define CONST_CAST(type, x)   ((type)(x))
 
#define SHPLIB_NULLPTR   NULL
 

Functions

static void * SfRealloc (void *pMem, int nNewSize)
 
static void DBFWriteHeader (DBFHandle psDBF)
 
static int DBFFlushRecord (DBFHandle psDBF)
 
static int DBFLoadRecord (DBFHandle psDBF, int iRecord)
 
void SHPAPI_CALL DBFUpdateHeader (DBFHandle psDBF)
 
void SHPAPI_CALL DBFSetLastModifiedDate (DBFHandle psDBF, int nYYSince1900, int nMM, int nDD)
 
DBFHandle SHPAPI_CALL DBFOpen (const char *pszFilename, const char *pszAccess)
 
static int DBFGetLenWithoutExtension (const char *pszBasename)
 
DBFHandle SHPAPI_CALL DBFOpenLL (const char *pszFilename, const char *pszAccess, SAHooks *psHooks)
 
void SHPAPI_CALL DBFClose (DBFHandle psDBF)
 
DBFHandle SHPAPI_CALL DBFCreate (const char *pszFilename)
 
DBFHandle SHPAPI_CALL DBFCreateEx (const char *pszFilename, const char *pszCodePage)
 
DBFHandle SHPAPI_CALL DBFCreateLL (const char *pszFilename, const char *pszCodePage, SAHooks *psHooks)
 
int SHPAPI_CALL DBFAddField (DBFHandle psDBF, const char *pszFieldName, DBFFieldType eType, int nWidth, int nDecimals)
 
static char DBFGetNullCharacter (char chType)
 
int SHPAPI_CALL DBFAddNativeFieldType (DBFHandle psDBF, const char *pszFieldName, char chType, int nWidth, int nDecimals)
 
static void * DBFReadAttribute (DBFHandle psDBF, int hEntity, int iField, char chReqType)
 
int SHPAPI_CALL DBFReadIntegerAttribute (DBFHandle psDBF, int iRecord, int iField)
 
double SHPAPI_CALL DBFReadDoubleAttribute (DBFHandle psDBF, int iRecord, int iField)
 
const char SHPAPI_CALL1DBFReadStringAttribute (DBFHandle psDBF, int iRecord, int iField){ return STATIC_CAST(const char *, DBFReadAttribute(psDBF, iRecord, iField, 'C')
 
const char SHPAPI_CALL1DBFReadLogicalAttribute (DBFHandle psDBF, int iRecord, int iField){ return STATIC_CAST(const char *, DBFReadAttribute(psDBF, iRecord, iField, 'L')
 
static int DBFIsValueNULL (char chType, const char *pszValue)
 
int SHPAPI_CALL DBFIsAttributeNULL (DBFHandle psDBF, int iRecord, int iField)
 
int SHPAPI_CALL DBFGetFieldCount (DBFHandle psDBF)
 
int SHPAPI_CALL DBFGetRecordCount (DBFHandle psDBF)
 
DBFFieldType SHPAPI_CALL DBFGetFieldInfo (DBFHandle psDBF, int iField, char *pszFieldName, int *pnWidth, int *pnDecimals)
 
static int DBFWriteAttribute (DBFHandle psDBF, int hEntity, int iField, void *pValue)
 
int SHPAPI_CALL DBFWriteAttributeDirectly (DBFHandle psDBF, int hEntity, int iField, void *pValue)
 
int SHPAPI_CALL DBFWriteDoubleAttribute (DBFHandle psDBF, int iRecord, int iField, double dValue)
 
int SHPAPI_CALL DBFWriteIntegerAttribute (DBFHandle psDBF, int iRecord, int iField, int nValue)
 
int SHPAPI_CALL DBFWriteStringAttribute (DBFHandle psDBF, int iRecord, int iField, const char *pszValue)
 
int SHPAPI_CALL DBFWriteNULLAttribute (DBFHandle psDBF, int iRecord, int iField)
 
int SHPAPI_CALL DBFWriteLogicalAttribute (DBFHandle psDBF, int iRecord, int iField, const char lValue)
 
int SHPAPI_CALL DBFWriteTuple (DBFHandle psDBF, int hEntity, void *pRawTuple)
 
const char SHPAPI_CALL1DBFReadTuple (DBFHandle psDBF, int hEntity){ if(hEntity< 0||hEntity >=psDBF->nRecords) return SHPLIB_NULLPTR;if(!DBFLoadRecord(psDBF, hEntity)) return SHPLIB_NULLPTR;return STATIC_CAST(const char *, psDBF->pszCurrentRecord
 
DBFHandle SHPAPI_CALL DBFCloneEmpty (DBFHandle psDBF, const char *pszFilename)
 
char SHPAPI_CALL DBFGetNativeFieldType (DBFHandle psDBF, int iField)
 
int SHPAPI_CALL DBFGetFieldIndex (DBFHandle psDBF, const char *pszFieldName)
 
int SHPAPI_CALL DBFIsRecordDeleted (DBFHandle psDBF, int iShape)
 
int SHPAPI_CALL DBFMarkRecordDeleted (DBFHandle psDBF, int iShape, int bIsDeleted)
 
const char SHPAPI_CALL1DBFGetCodePage (DBFHandle psDBF){ if(psDBF==SHPLIB_NULLPTR) return SHPLIB_NULLPTR;return psDBF->pszCodePage;}int SHPAPI_CALLDBFDeleteField(DBFHandle psDBF, int iField
 
int SHPAPI_CALL DBFReorderFields (DBFHandle psDBF, int *panMap)
 
int SHPAPI_CALL DBFAlterFieldDefn (DBFHandle psDBF, int iField, const char *pszFieldName, char chType, int nWidth, int nDecimals)
 
void SHPAPI_CALL DBFSetWriteEndOfFileChar (DBFHandle psDBF, int bWriteFlag)