GRASS GIS 8 Programmer's Manual
8.5.0dev(2025)-324285da0f
|
#include "shapefil_private.h"
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <strings.h>
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 |
Functions | |
void | DBFUpdateHeader (DBFHandle psDBF) |
void | DBFSetLastModifiedDate (DBFHandle psDBF, int nYYSince1900, int nMM, int nDD) |
DBFHandle | DBFOpen (const char *pszFilename, const char *pszAccess) |
DBFHandle | DBFOpenLL (const char *pszFilename, const char *pszAccess, const SAHooks *psHooks) |
void | DBFClose (DBFHandle psDBF) |
DBFHandle | DBFCreate (const char *pszFilename) |
DBFHandle | DBFCreateEx (const char *pszFilename, const char *pszCodePage) |
DBFHandle | DBFCreateLL (const char *pszFilename, const char *pszCodePage, const SAHooks *psHooks) |
int | DBFAddField (DBFHandle psDBF, const char *pszFieldName, DBFFieldType eType, int nWidth, int nDecimals) |
int | DBFAddNativeFieldType (DBFHandle psDBF, const char *pszFieldName, char chType, int nWidth, int nDecimals) |
int | DBFReadIntegerAttribute (DBFHandle psDBF, int iRecord, int iField) |
double | DBFReadDoubleAttribute (DBFHandle psDBF, int iRecord, int iField) |
const char * | DBFReadStringAttribute (DBFHandle psDBF, int iRecord, int iField) |
const char * | DBFReadLogicalAttribute (DBFHandle psDBF, int iRecord, int iField) |
SHPDate | DBFReadDateAttribute (DBFHandle psDBF, int iRecord, int iField) |
int | DBFIsAttributeNULL (const DBFHandle psDBF, int iRecord, int iField) |
int | DBFGetFieldCount (const DBFHandle psDBF) |
int | DBFGetRecordCount (const DBFHandle psDBF) |
DBFFieldType | DBFGetFieldInfo (const DBFHandle psDBF, int iField, char *pszFieldName, int *pnWidth, int *pnDecimals) |
int | DBFWriteAttributeDirectly (DBFHandle psDBF, int hEntity, int iField, const void *pValue) |
int | DBFWriteDoubleAttribute (DBFHandle psDBF, int iRecord, int iField, double dValue) |
int | DBFWriteIntegerAttribute (DBFHandle psDBF, int iRecord, int iField, int nValue) |
int | DBFWriteStringAttribute (DBFHandle psDBF, int iRecord, int iField, const char *pszValue) |
int | DBFWriteNULLAttribute (DBFHandle psDBF, int iRecord, int iField) |
int | DBFWriteLogicalAttribute (DBFHandle psDBF, int iRecord, int iField, const char lValue) |
int | DBFWriteDateAttribute (DBFHandle psDBF, int iRecord, int iField, const SHPDate *lValue) |
int | DBFWriteTuple (DBFHandle psDBF, int hEntity, const void *pRawTuple) |
const char * | DBFReadTuple (DBFHandle psDBF, int hEntity) |
DBFHandle | DBFCloneEmpty (const DBFHandle psDBF, const char *pszFilename) |
char | DBFGetNativeFieldType (const DBFHandle psDBF, int iField) |
int | DBFGetFieldIndex (const DBFHandle psDBF, const char *pszFieldName) |
int | DBFIsRecordDeleted (const DBFHandle psDBF, int iShape) |
int | DBFMarkRecordDeleted (DBFHandle psDBF, int iShape, int bIsDeleted) |
const char * | DBFGetCodePage (const DBFHandle psDBF) |
int | DBFDeleteField (DBFHandle psDBF, int iField) |
int | DBFReorderFields (DBFHandle psDBF, const int *panMap) |
int | DBFAlterFieldDefn (DBFHandle psDBF, int iField, const char *pszFieldName, char chType, int nWidth, int nDecimals) |
void | DBFSetWriteEndOfFileChar (DBFHandle psDBF, int bWriteFlag) |
#define STRCASECMP | ( | a, | |
b | |||
) | (strcasecmp(a, b)) |
int DBFAddField | ( | DBFHandle | psDBF, |
const char * | pszFieldName, | ||
DBFFieldType | eType, | ||
int | nWidth, | ||
int | nDecimals | ||
) |
int DBFAddNativeFieldType | ( | DBFHandle | psDBF, |
const char * | pszFieldName, | ||
char | chType, | ||
int | nWidth, | ||
int | nDecimals | ||
) |
Definition at line 734 of file dbfopen.c.
Referenced by DBFAddField().
int DBFAlterFieldDefn | ( | DBFHandle | psDBF, |
int | iField, | ||
const char * | pszFieldName, | ||
char | chType, | ||
int | nWidth, | ||
int | nDecimals | ||
) |
Definition at line 1995 of file dbfopen.c.
References FALSE, and DBFInfo::nFields.
Definition at line 1579 of file dbfopen.c.
References DBFInfo::bNoHeader, DBFInfo::bUpdated, DBFInfo::bWriteEndOfFileChar, DBFCreateLL(), malloc(), DBFInfo::nFields, DBFInfo::nHeaderLength, DBFInfo::nRecordLength, DBFInfo::pachFieldType, DBFInfo::panFieldDecimals, DBFInfo::panFieldOffset, DBFInfo::panFieldSize, DBFInfo::pszCodePage, DBFInfo::pszHeader, DBFInfo::sHooks, SHPLIB_NULLPTR, STATIC_CAST, TRUE, and XBASE_FLDHDR_SZ.
void DBFClose | ( | DBFHandle | psDBF | ) |
Definition at line 522 of file dbfopen.c.
References DBFInfo::bNoHeader, and SHPLIB_NULLPTR.
DBFHandle DBFCreate | ( | const char * | pszFilename | ) |
Definition at line 570 of file dbfopen.c.
References DBFCreateEx().
DBFHandle DBFCreateEx | ( | const char * | pszFilename, |
const char * | pszCodePage | ||
) |
Definition at line 581 of file dbfopen.c.
References DBFCreateLL(), and SASetupDefaultHooks().
Referenced by DBFCreate().
DBFHandle DBFCreateLL | ( | const char * | pszFilename, |
const char * | pszCodePage, | ||
const SAHooks * | psHooks | ||
) |
Definition at line 597 of file dbfopen.c.
Referenced by DBFCloneEmpty(), and DBFCreateEx().
int DBFDeleteField | ( | DBFHandle | psDBF, |
int | iField | ||
) |
Definition at line 1750 of file dbfopen.c.
References FALSE, and DBFInfo::nFields.
const char* DBFGetCodePage | ( | const DBFHandle | psDBF | ) |
Definition at line 1737 of file dbfopen.c.
References SHPLIB_NULLPTR.
int DBFGetFieldCount | ( | const DBFHandle | psDBF | ) |
Definition at line 1152 of file dbfopen.c.
References DBFInfo::nFields.
Referenced by DBFGetFieldIndex().
int DBFGetFieldIndex | ( | const DBFHandle | psDBF, |
const char * | pszFieldName | ||
) |
Definition at line 1655 of file dbfopen.c.
References DBFGetFieldCount(), DBFGetFieldInfo(), name, SHPLIB_NULLPTR, STRCASECMP, and XBASE_FLDNAME_LEN_READ.
DBFFieldType DBFGetFieldInfo | ( | const DBFHandle | psDBF, |
int | iField, | ||
char * | pszFieldName, | ||
int * | pnWidth, | ||
int * | pnDecimals | ||
) |
Definition at line 1176 of file dbfopen.c.
References FTDate, FTDouble, FTInteger, FTInvalid, FTLogical, FTString, DBFInfo::nFields, DBFInfo::pachFieldType, DBFInfo::panFieldDecimals, DBFInfo::panFieldSize, DBFInfo::pszHeader, SHPLIB_NULLPTR, STATIC_CAST, XBASE_FLDHDR_SZ, and XBASE_FLDNAME_LEN_READ.
Referenced by DBFGetFieldIndex().
char DBFGetNativeFieldType | ( | const DBFHandle | psDBF, |
int | iField | ||
) |
Definition at line 1639 of file dbfopen.c.
References DBFInfo::pachFieldType.
int DBFGetRecordCount | ( | const DBFHandle | psDBF | ) |
Definition at line 1163 of file dbfopen.c.
References DBFInfo::nRecords.
int DBFIsAttributeNULL | ( | const DBFHandle | psDBF, |
int | iRecord, | ||
int | iField | ||
) |
Definition at line 1135 of file dbfopen.c.
References DBFReadStringAttribute(), SHPLIB_NULLPTR, and TRUE.
int DBFIsRecordDeleted | ( | const DBFHandle | psDBF, |
int | iShape | ||
) |
Definition at line 1675 of file dbfopen.c.
References DBFInfo::nRecords, and TRUE.
int DBFMarkRecordDeleted | ( | DBFHandle | psDBF, |
int | iShape, | ||
int | bIsDeleted | ||
) |
Definition at line 1699 of file dbfopen.c.
References FALSE, and DBFInfo::nRecords.
DBFHandle DBFOpen | ( | const char * | pszFilename, |
const char * | pszAccess | ||
) |
Definition at line 296 of file dbfopen.c.
References DBFOpenLL(), and SASetupDefaultHooks().
Definition at line 1053 of file dbfopen.c.
References STATIC_CAST.
double DBFReadDoubleAttribute | ( | DBFHandle | psDBF, |
int | iRecord, | ||
int | iField | ||
) |
Definition at line 1009 of file dbfopen.c.
References STATIC_CAST.
int DBFReadIntegerAttribute | ( | DBFHandle | psDBF, |
int | iRecord, | ||
int | iField | ||
) |
Definition at line 991 of file dbfopen.c.
References STATIC_CAST.
const char* DBFReadLogicalAttribute | ( | DBFHandle | psDBF, |
int | iRecord, | ||
int | iField | ||
) |
Definition at line 1041 of file dbfopen.c.
References STATIC_CAST.
const char* DBFReadStringAttribute | ( | DBFHandle | psDBF, |
int | iRecord, | ||
int | iField | ||
) |
Definition at line 1028 of file dbfopen.c.
References STATIC_CAST.
Referenced by DBFIsAttributeNULL().
const char* DBFReadTuple | ( | DBFHandle | psDBF, |
int | hEntity | ||
) |
Definition at line 1561 of file dbfopen.c.
References SHPLIB_NULLPTR.
int DBFReorderFields | ( | DBFHandle | psDBF, |
const int * | panMap | ||
) |
Definition at line 1875 of file dbfopen.c.
References DBFInfo::nFields, and TRUE.
void DBFSetLastModifiedDate | ( | DBFHandle | psDBF, |
int | nYYSince1900, | ||
int | nMM, | ||
int | nDD | ||
) |
Definition at line 282 of file dbfopen.c.
References DBFInfo::nUpdateDay, DBFInfo::nUpdateMonth, and DBFInfo::nUpdateYearSince1900.
void DBFSetWriteEndOfFileChar | ( | DBFHandle | psDBF, |
int | bWriteFlag | ||
) |
Definition at line 2232 of file dbfopen.c.
References DBFInfo::bWriteEndOfFileChar.
void DBFUpdateHeader | ( | DBFHandle | psDBF | ) |
Definition at line 248 of file dbfopen.c.
References DBFInfo::bNoHeader.
int DBFWriteAttributeDirectly | ( | DBFHandle | psDBF, |
int | hEntity, | ||
int | iField, | ||
const void * | pValue | ||
) |
Definition at line 1350 of file dbfopen.c.
References DBFInfo::bNoHeader, FALSE, and DBFInfo::nRecords.
Referenced by DBFWriteDateAttribute().
Definition at line 1486 of file dbfopen.c.
References SHPDate::day, DBFWriteAttributeDirectly(), SHPDate::month, SHPLIB_NULLPTR, and SHPDate::year.
int DBFWriteDoubleAttribute | ( | DBFHandle | psDBF, |
int | iRecord, | ||
int | iField, | ||
double | dValue | ||
) |
int DBFWriteIntegerAttribute | ( | DBFHandle | psDBF, |
int | iRecord, | ||
int | iField, | ||
int | nValue | ||
) |
int DBFWriteLogicalAttribute | ( | DBFHandle | psDBF, |
int | iRecord, | ||
int | iField, | ||
const char | lValue | ||
) |
int DBFWriteNULLAttribute | ( | DBFHandle | psDBF, |
int | iRecord, | ||
int | iField | ||
) |
int DBFWriteStringAttribute | ( | DBFHandle | psDBF, |
int | iRecord, | ||
int | iField, | ||
const char * | pszValue | ||
) |
int DBFWriteTuple | ( | DBFHandle | psDBF, |
int | hEntity, | ||
const void * | pRawTuple | ||
) |
Definition at line 1510 of file dbfopen.c.
References DBFInfo::bNoHeader, FALSE, and DBFInfo::nRecords.