GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
dbfopen.c File Reference
#include <grass/shapefil.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
Include dependency graph for dbfopen.c:

Go to the source code of this file.

Macros

#define CPLsprintf   sprintf
 
#define FALSE   0
 
#define TRUE   1
 

Functions

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)
 
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)
 
int SHPAPI_CALL DBFAddNativeFieldType (DBFHandle psDBF, const char *pszFieldName, char chType, int nWidth, int nDecimals)
 
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((const char *) DBFReadAttribute(psDBF, iRecord, iField, 'C')
 
const char SHPAPI_CALL1DBFReadLogicalAttribute (DBFHandle psDBF, int iRecord, int iField){ return((const char *) DBFReadAttribute(psDBF, iRecord, iField, 'L')
 
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)
 
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(NULL
 
 if (!DBFLoadRecord(psDBF, hEntity)) return NULL
 
 return (const char *)
 
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==NULL) return NULL;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)
 

Macro Definition Documentation

◆ CPLsprintf

#define CPLsprintf   sprintf

Definition at line 170 of file dbfopen.c.

◆ FALSE

◆ TRUE

#define TRUE   1

Function Documentation

◆ DBFAddField()

int SHPAPI_CALL DBFAddField ( DBFHandle  psDBF,
const char *  pszFieldName,
DBFFieldType  eType,
int  nWidth,
int  nDecimals 
)

Definition at line 809 of file dbfopen.c.

References DBFAddNativeFieldType(), FTLogical, and FTString.

◆ DBFAddNativeFieldType()

int SHPAPI_CALL DBFAddNativeFieldType ( DBFHandle  psDBF,
const char *  pszFieldName,
char  chType,
int  nWidth,
int  nDecimals 
)

Definition at line 854 of file dbfopen.c.

Referenced by DBFAddField().

◆ DBFAlterFieldDefn()

int SHPAPI_CALL DBFAlterFieldDefn ( DBFHandle  psDBF,
int  iField,
const char *  pszFieldName,
char  chType,
int  nWidth,
int  nDecimals 
)

Definition at line 2049 of file dbfopen.c.

References FALSE, and DBFInfo::nFields.

◆ DBFClose()

void SHPAPI_CALL DBFClose ( DBFHandle  psDBF)

Definition at line 612 of file dbfopen.c.

References DBFInfo::bNoHeader, and NULL.

◆ DBFCreate()

DBFHandle SHPAPI_CALL DBFCreate ( const char *  pszFilename)

Definition at line 662 of file dbfopen.c.

References DBFCreateEx(), and SHPAPI_CALL.

◆ DBFCreateEx()

DBFHandle SHPAPI_CALL DBFCreateEx ( const char *  pszFilename,
const char *  pszCodePage 
)

Definition at line 675 of file dbfopen.c.

References DBFCreateLL(), SASetupDefaultHooks(), and SHPAPI_CALL.

Referenced by DBFCreate(), and return().

◆ DBFCreateLL()

◆ DBFGetCodePage()

const char SHPAPI_CALL1* DBFGetCodePage ( DBFHandle  psDBF)

Definition at line 1810 of file dbfopen.c.

References DBFDeleteField(), FALSE, DBFInfo::nFields, NULL, and SHPAPI_CALL.

◆ DBFGetFieldCount()

int SHPAPI_CALL DBFGetFieldCount ( DBFHandle  psDBF)

Definition at line 1225 of file dbfopen.c.

References DBFInfo::nFields, and SHPAPI_CALL.

◆ DBFGetFieldIndex()

int SHPAPI_CALL DBFGetFieldIndex ( DBFHandle  psDBF,
const char *  pszFieldName 
)

Definition at line 1714 of file dbfopen.c.

References name.

◆ DBFGetFieldInfo()

DBFFieldType SHPAPI_CALL DBFGetFieldInfo ( DBFHandle  psDBF,
int  iField,
char *  pszFieldName,
int *  pnWidth,
int *  pnDecimals 
)

◆ DBFGetNativeFieldType()

char SHPAPI_CALL DBFGetNativeFieldType ( DBFHandle  psDBF,
int  iField 
)

Definition at line 1680 of file dbfopen.c.

References DBFInfo::pachFieldType.

◆ DBFGetRecordCount()

int SHPAPI_CALL DBFGetRecordCount ( DBFHandle  psDBF)

Definition at line 1238 of file dbfopen.c.

References DBFInfo::nRecords, and SHPAPI_CALL.

◆ DBFIsAttributeNULL()

int SHPAPI_CALL DBFIsAttributeNULL ( DBFHandle  psDBF,
int  iRecord,
int  iField 
)

Definition at line 1205 of file dbfopen.c.

References DBFReadStringAttribute(), NULL, and TRUE.

◆ DBFIsRecordDeleted()

int SHPAPI_CALL DBFIsRecordDeleted ( DBFHandle  psDBF,
int  iShape 
)

Definition at line 1743 of file dbfopen.c.

References DBFInfo::nRecords, and TRUE.

◆ DBFMarkRecordDeleted()

int SHPAPI_CALL DBFMarkRecordDeleted ( DBFHandle  psDBF,
int  iShape,
int  bIsDeleted 
)

Definition at line 1768 of file dbfopen.c.

References FALSE, and DBFInfo::nRecords.

◆ DBFOpen()

DBFHandle SHPAPI_CALL DBFOpen ( const char *  pszFilename,
const char *  pszAccess 
)

Definition at line 395 of file dbfopen.c.

References DBFOpenLL(), SASetupDefaultHooks(), and SHPAPI_CALL.

◆ DBFOpenLL()

◆ DBFReadDoubleAttribute()

double SHPAPI_CALL DBFReadDoubleAttribute ( DBFHandle  psDBF,
int  iRecord,
int  iField 
)

Definition at line 1110 of file dbfopen.c.

◆ DBFReadIntegerAttribute()

int SHPAPI_CALL DBFReadIntegerAttribute ( DBFHandle  psDBF,
int  iRecord,
int  iField 
)

Definition at line 1090 of file dbfopen.c.

◆ DBFReadLogicalAttribute()

const char SHPAPI_CALL1* DBFReadLogicalAttribute ( DBFHandle  psDBF,
int  iRecord,
int  iField 
) const

◆ DBFReadStringAttribute()

const char SHPAPI_CALL1* DBFReadStringAttribute ( DBFHandle  psDBF,
int  iRecord,
int  iField 
) const

Referenced by DBFIsAttributeNULL().

◆ DBFReadTuple()

const char SHPAPI_CALL1* DBFReadTuple ( DBFHandle  psDBF,
int  hEntity 
) -> nRecords) return(NULL

◆ DBFReorderFields()

int SHPAPI_CALL DBFReorderFields ( DBFHandle  psDBF,
int *  panMap 
)

Definition at line 1940 of file dbfopen.c.

References DBFInfo::nFields, and TRUE.

◆ DBFSetLastModifiedDate()

void SHPAPI_CALL DBFSetLastModifiedDate ( DBFHandle  psDBF,
int  nYYSince1900,
int  nMM,
int  nDD 
)

◆ DBFUpdateHeader()

void SHPAPI_CALL DBFUpdateHeader ( DBFHandle  psDBF)

Definition at line 348 of file dbfopen.c.

References DBFInfo::bNoHeader.

◆ DBFWriteAttributeDirectly()

int SHPAPI_CALL DBFWriteAttributeDirectly ( DBFHandle  psDBF,
int  hEntity,
int  iField,
void *  pValue 
)

Definition at line 1418 of file dbfopen.c.

References DBFInfo::bNoHeader, FALSE, and DBFInfo::nRecords.

◆ DBFWriteDoubleAttribute()

int SHPAPI_CALL DBFWriteDoubleAttribute ( DBFHandle  psDBF,
int  iRecord,
int  iField,
double  dValue 
)

Definition at line 1486 of file dbfopen.c.

◆ DBFWriteIntegerAttribute()

int SHPAPI_CALL DBFWriteIntegerAttribute ( DBFHandle  psDBF,
int  iRecord,
int  iField,
int  nValue 
)

Definition at line 1500 of file dbfopen.c.

◆ DBFWriteLogicalAttribute()

int SHPAPI_CALL DBFWriteLogicalAttribute ( DBFHandle  psDBF,
int  iRecord,
int  iField,
const char  lValue 
)

Definition at line 1543 of file dbfopen.c.

◆ DBFWriteNULLAttribute()

int SHPAPI_CALL DBFWriteNULLAttribute ( DBFHandle  psDBF,
int  iRecord,
int  iField 
)

Definition at line 1530 of file dbfopen.c.

◆ DBFWriteStringAttribute()

int SHPAPI_CALL DBFWriteStringAttribute ( DBFHandle  psDBF,
int  iRecord,
int  iField,
const char *  pszValue 
)

Definition at line 1516 of file dbfopen.c.

◆ DBFWriteTuple()

int SHPAPI_CALL DBFWriteTuple ( DBFHandle  psDBF,
int  hEntity,
void *  pRawTuple 
)

Definition at line 1557 of file dbfopen.c.

References DBFInfo::bNoHeader, FALSE, and DBFInfo::nRecords.

◆ if()

if ( DBFLoadRecordpsDBF, hEntity)

◆ return()