Definition at line 686 of file dbfopen.c.
688{
691 char *pszFullname;
692 int ldid = -1;
693 char chZero = '\0';
694 int nLenWithoutExtension;
695
696
697
698
699
704 memcpy(pszFullname, pszFilename, nLenWithoutExtension);
705 memcpy(pszFullname + nLenWithoutExtension, ".dbf", 5);
706
707
708
709
710 fp = psHooks->
FOpen( pszFullname,
"wb" );
712 {
715 }
716
717 psHooks->
FWrite( &chZero, 1, 1, fp );
719
720 fp = psHooks->
FOpen( pszFullname,
"rb+" );
722 {
725 }
726
727 memcpy(pszFullname + nLenWithoutExtension, ".cpg", 5);
729 {
730 if( strncmp( pszCodePage, "LDID/", 5 ) == 0 )
731 {
732 ldid = atoi( pszCodePage + 5 );
733 if( ldid > 255 )
734 ldid = -1;
735 }
736 if( ldid < 0 )
737 {
741 }
742 }
744 {
745 psHooks->
Remove( pszFullname );
746 }
747
749
750
751
752
754
761
767
771
773
776 if( pszCodePage )
777 {
780 }
782
784
786
787 return( psDBF );
788}
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().