GRASS GIS 7 Programmer's Manual  7.2.2(2017)-exported
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 FALSE   0
 
#define TRUE   1
 

Functions

void SHPAPI_CALL DBFUpdateHeader (DBFHandle psDBF)
 
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 DBFCreateLL (const char *pszFilename, 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)
 

Macro Definition Documentation

◆ FALSE

◆ TRUE

Function Documentation

◆ DBFAddField()

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

Definition at line 630 of file dbfopen.c.

References DBFAddNativeFieldType(), and SHPAPI_CALL.

◆ DBFAddNativeFieldType()

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

Definition at line 655 of file dbfopen.c.

Referenced by DBFAddField().

◆ DBFClose()

void SHPAPI_CALL DBFClose ( DBFHandle  psDBF)

Definition at line 489 of file dbfopen.c.

◆ DBFCreate()

DBFHandle SHPAPI_CALL DBFCreate ( const char *  pszFilename)

Definition at line 535 of file dbfopen.c.

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

Referenced by return().

◆ DBFCreateLL()

DBFHandle SHPAPI_CALL DBFCreateLL ( const char *  pszFilename,
SAHooks psHooks 
)

Definition at line 552 of file dbfopen.c.

References FALSE, SAHooks::FClose, SAHooks::FOpen, SAHooks::FWrite, NULL, SHPAPI_CALL, and TRUE.

Referenced by DBFCreate().

◆ DBFGetFieldCount()

int SHPAPI_CALL DBFGetFieldCount ( DBFHandle  psDBF)

Definition at line 957 of file dbfopen.c.

References SHPAPI_CALL.

◆ DBFGetFieldIndex()

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

Definition at line 1486 of file dbfopen.c.

References name.

◆ DBFGetFieldInfo()

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

Definition at line 983 of file dbfopen.c.

References NULL.

◆ DBFGetNativeFieldType()

char SHPAPI_CALL DBFGetNativeFieldType ( DBFHandle  psDBF,
int  iField 
)

Definition at line 1452 of file dbfopen.c.

◆ DBFGetRecordCount()

int SHPAPI_CALL DBFGetRecordCount ( DBFHandle  psDBF)

Definition at line 970 of file dbfopen.c.

References SHPAPI_CALL.

◆ DBFIsAttributeNULL()

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

Definition at line 906 of file dbfopen.c.

References DBFReadStringAttribute(), FALSE, NULL, SHPAPI_CALL, and TRUE.

◆ DBFIsRecordDeleted()

int SHPAPI_CALL DBFIsRecordDeleted ( DBFHandle  psDBF,
int  iShape 
)

Definition at line 1515 of file dbfopen.c.

References TRUE.

◆ DBFMarkRecordDeleted()

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

Definition at line 1540 of file dbfopen.c.

References FALSE.

◆ DBFOpen()

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

Definition at line 324 of file dbfopen.c.

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

◆ DBFOpenLL()

DBFHandle SHPAPI_CALL DBFOpenLL ( const char *  pszFilename,
const char *  pszAccess,
SAHooks psHooks 
)

Definition at line 341 of file dbfopen.c.

References FALSE, SAHooks::FOpen, and NULL.

Referenced by DBFOpen().

◆ DBFReadDoubleAttribute()

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

Definition at line 858 of file dbfopen.c.

◆ DBFReadIntegerAttribute()

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

Definition at line 838 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

◆ DBFUpdateHeader()

void SHPAPI_CALL DBFUpdateHeader ( DBFHandle  psDBF)

Definition at line 293 of file dbfopen.c.

◆ DBFWriteAttributeDirectly()

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

Definition at line 1193 of file dbfopen.c.

References FALSE.

◆ DBFWriteDoubleAttribute()

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

Definition at line 1261 of file dbfopen.c.

◆ DBFWriteIntegerAttribute()

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

Definition at line 1275 of file dbfopen.c.

◆ DBFWriteLogicalAttribute()

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

Definition at line 1318 of file dbfopen.c.

◆ DBFWriteNULLAttribute()

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

Definition at line 1305 of file dbfopen.c.

◆ DBFWriteStringAttribute()

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

Definition at line 1291 of file dbfopen.c.

◆ DBFWriteTuple()

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

Definition at line 1332 of file dbfopen.c.

References FALSE.

◆ if()

◆ return()

return ( const char *  )

Definition at line 1396 of file dbfopen.c.

References DBFCreate(), NULL, and TRUE.

Referenced by gvl_file_set_slices_param().