Definition at line 679 of file dbfopen.c.
681{
684 char *pszFullname;
685 int ldid = -1;
686 char chZero = '\0';
687 int nLenWithoutExtension;
688
689
690
691
692
695 memcpy(pszFullname, pszFilename, nLenWithoutExtension);
696 memcpy(pszFullname + nLenWithoutExtension, ".dbf", 5);
697
698
699
700
701 fp = psHooks->
FOpen( pszFullname,
"wb" );
703 {
706 }
707
708 psHooks->
FWrite( &chZero, 1, 1, fp );
710
711 fp = psHooks->
FOpen( pszFullname,
"rb+" );
713 {
716 }
717
718 memcpy(pszFullname + nLenWithoutExtension, ".cpg", 5);
720 {
721 if( strncmp( pszCodePage, "LDID/", 5 ) == 0 )
722 {
723 ldid = atoi( pszCodePage + 5 );
724 if( ldid > 255 )
725 ldid = -1;
726 }
727 if( ldid < 0 )
728 {
732 }
733 }
735 {
736 psHooks->
Remove( pszFullname );
737 }
738
740
741
742
743
745
752
758
762
764
767 if( pszCodePage )
768 {
771 }
773
775
777
778 return( psDBF );
779}
static int DBFGetLenWithoutExtension(const char *pszBasename)
#define STATIC_CAST(type, x)
void SHPAPI_CALL DBFSetLastModifiedDate(DBFHandle psDBF, int nYYSince1900, int nMM, int nDD)
void SHPAPI_CALL DBFSetWriteEndOfFileChar(DBFHandle psDBF, int bWriteFlag)
#define CONST_CAST(type, x)
int bCurrentRecordModified
int bRequireNextWriteSeek
SAFile(* FOpen)(const char *filename, const char *access)
SAOffset(* FWrite)(void *p, SAOffset size, SAOffset nmemb, SAFile file)
int(* Remove)(const char *filename)
int(* FClose)(SAFile file)
References DBFInfo::bCurrentRecordModified, DBFInfo::bNoHeader, DBFInfo::bRequireNextWriteSeek, CONST_CAST, DBFGetLenWithoutExtension(), DBFSetLastModifiedDate(), DBFSetWriteEndOfFileChar(), FALSE, SAHooks::FClose, SAHooks::FOpen, DBFInfo::fp, free(), SAHooks::FWrite, DBFInfo::iLanguageDriver, malloc(), DBFInfo::nCurrentRecord, DBFInfo::nFields, DBFInfo::nHeaderLength, DBFInfo::nRecordLength, DBFInfo::nRecords, DBFInfo::pachFieldType, DBFInfo::panFieldDecimals, DBFInfo::panFieldOffset, DBFInfo::panFieldSize, DBFInfo::pszCodePage, DBFInfo::pszCurrentRecord, DBFInfo::pszHeader, SAHooks::Remove, DBFInfo::sHooks, SHPLIB_NULLPTR, STATIC_CAST, TRUE, and XBASE_FILEHDR_SZ.
Referenced by DBFCreateEx().