?? avc.h
字號:
typedef struct AVCE00ReadInfoE00_t{ char *pszCoverPath; char *pszCoverName; AVCE00ParseInfo *hParseInfo; AVCFileType eCurFileType; /* pasSections is built when the coverage is opened and describes * the sections in the E00 file. */ AVCE00Section *pasSections; int numSections; /* If bReadAllSections=TRUE then reading automatically continues to * the next section when a section finishes. (This is the default) * Otherwise, you can use AVCE00ReadGotoSectionE00() to read one * section at a time. */ GBool bReadAllSections; /* File handle of the E00 file currently being processed */ FILE *hFile;} *AVCE00ReadE00Ptr;/* E00 generation steps... tells the AVCE00Read*() functions which * parts of the given E00 file are currently being processed. */#define AVC_GEN_NOTSTARTED 0#define AVC_GEN_DATA 1#define AVC_GEN_ENDSECTION 2#define AVC_GEN_TABLEHEADER 3#define AVC_GEN_TABLEDATA 4/*--------------------------------------------------------------------- * Stuff related to the transparent E00 -> binary conversion *--------------------------------------------------------------------*/typedef struct AVCE00WriteInfo_t{ char *pszCoverPath; char *pszInfoPath; char *pszCoverName; AVCCoverType eCoverType; /* Info about the file (or E00 section) currently being processed */ AVCFileType eCurFileType; AVCBinFile *hFile; /* Requested precision for the new coverage... may differ from the * precision of the E00 input lines. (AVC_SINGLE_PREC or AVC_DOUBLE_PREC) */ int nPrecision; AVCE00ParseInfo *hParseInfo; /* Info related to multibyte character encoding */ AVCDBCSInfo *psDBCSInfo;} *AVCE00WritePtr;/* Coverage generation steps... used to store the current state of the * AVCE00WriteNextLine() function. */#define AVC_WR_TOPLEVEL 0#define AVC_WR_READING_SECTION/*===================================================================== Function prototypes (lower-level lib. functions) =====================================================================*//*--------------------------------------------------------------------- * Functions related to buffered reading of raw binary files (and writing) *--------------------------------------------------------------------*/AVCRawBinFile *AVCRawBinOpen(const char *pszFname, const char *pszAccess, AVCByteOrder eFileByteOrder, AVCDBCSInfo *psDBCSInfo);void AVCRawBinClose(AVCRawBinFile *psInfo);void AVCRawBinFSeek(AVCRawBinFile *psInfo, int nOffset, int nFrom);GBool AVCRawBinEOF(AVCRawBinFile *psInfo);void AVCRawBinSetFileDataSize(AVCRawBinFile *psInfo, int nDataSize);void AVCRawBinReadBytes(AVCRawBinFile *psInfo, int nBytesToRead, GByte *pBuf);GInt16 AVCRawBinReadInt16(AVCRawBinFile *psInfo);GInt32 AVCRawBinReadInt32(AVCRawBinFile *psInfo);float AVCRawBinReadFloat(AVCRawBinFile *psInfo);double AVCRawBinReadDouble(AVCRawBinFile *psInfo);void AVCRawBinReadString(AVCRawBinFile *psFile, int nBytesToRead, GByte *pBuf);void AVCRawBinWriteBytes(AVCRawBinFile *psFile, int nBytesToWrite, GByte *pBuf);void AVCRawBinWriteInt16(AVCRawBinFile *psFile, GInt16 n16Value);void AVCRawBinWriteInt32(AVCRawBinFile *psFile, GInt32 n32Value);void AVCRawBinWriteFloat(AVCRawBinFile *psFile, float fValue);void AVCRawBinWriteDouble(AVCRawBinFile *psFile, double dValue);void AVCRawBinWriteZeros(AVCRawBinFile *psFile, int nBytesToWrite);void AVCRawBinWritePaddedString(AVCRawBinFile *psFile, int nFieldSize, const char *pszString);/*--------------------------------------------------------------------- * Functions related to reading the binary coverage files *--------------------------------------------------------------------*/AVCBinFile *AVCBinReadOpen(const char *pszPath, const char *pszName, AVCCoverType eCoverType, AVCFileType eType, AVCDBCSInfo *psDBCSInfo);void AVCBinReadClose(AVCBinFile *psFile);int AVCBinReadRewind(AVCBinFile *psFile);void *AVCBinReadObject(AVCBinFile *psFile, int iObjIndex );void *AVCBinReadNextObject(AVCBinFile *psFile);AVCArc *AVCBinReadNextArc(AVCBinFile *psFile);AVCPal *AVCBinReadNextPal(AVCBinFile *psFile);AVCCnt *AVCBinReadNextCnt(AVCBinFile *psFile);AVCLab *AVCBinReadNextLab(AVCBinFile *psFile);AVCTol *AVCBinReadNextTol(AVCBinFile *psFile);AVCTxt *AVCBinReadNextTxt(AVCBinFile *psFile);AVCRxp *AVCBinReadNextRxp(AVCBinFile *psFile);AVCField *AVCBinReadNextTableRec(AVCBinFile *psFile);char **AVCBinReadNextPrj(AVCBinFile *psFile);char **AVCBinReadListTables(const char *pszInfoPath, const char *pszCoverName, char ***ppapszArcDatFiles, AVCCoverType eCoverType, AVCDBCSInfo *psDBCSInfo);/*--------------------------------------------------------------------- * Functions related to writing the binary coverage files *--------------------------------------------------------------------*/AVCBinFile *AVCBinWriteCreate(const char *pszPath, const char *pszName, AVCCoverType eCoverType, AVCFileType eType, int nPrecision, AVCDBCSInfo *psDBCSInfo);AVCBinFile *AVCBinWriteCreateTable(const char *pszInfoPath, const char *pszCoverName, AVCTableDef *psSrcTableDef, AVCCoverType eCoverType, int nPrecision, AVCDBCSInfo *psDBCSInfo);void AVCBinWriteClose(AVCBinFile *psFile);int AVCBinWriteHeader(AVCBinFile *psFile);int AVCBinWriteObject(AVCBinFile *psFile, void *psObj);int AVCBinWriteArc(AVCBinFile *psFile, AVCArc *psArc);int AVCBinWritePal(AVCBinFile *psFile, AVCPal *psPal);int AVCBinWriteCnt(AVCBinFile *psFile, AVCCnt *psCnt);int AVCBinWriteLab(AVCBinFile *psFile, AVCLab *psLab);int AVCBinWriteTol(AVCBinFile *psFile, AVCTol *psTol);int AVCBinWritePrj(AVCBinFile *psFile, char **papszPrj);int AVCBinWriteTxt(AVCBinFile *psFile, AVCTxt *psTxt);int AVCBinWriteRxp(AVCBinFile *psFile, AVCRxp *psRxp);int AVCBinWriteTableRec(AVCBinFile *psFile, AVCField *pasFields);/*--------------------------------------------------------------------- * Functions related to the generation of E00 *--------------------------------------------------------------------*/AVCE00GenInfo *AVCE00GenInfoAlloc(int nCoverPrecision);void AVCE00GenInfoFree(AVCE00GenInfo *psInfo);void AVCE00GenReset(AVCE00GenInfo *psInfo);const char *AVCE00GenStartSection(AVCE00GenInfo *psInfo, AVCFileType eType, const char *pszFilename);const char *AVCE00GenEndSection(AVCE00GenInfo *psInfo, AVCFileType eType, GBool bCont);const char *AVCE00GenObject(AVCE00GenInfo *psInfo, AVCFileType eType, void *psObj, GBool bCont);const char *AVCE00GenArc(AVCE00GenInfo *psInfo, AVCArc *psArc, GBool bCont);const char *AVCE00GenPal(AVCE00GenInfo *psInfo, AVCPal *psPal, GBool bCont);const char *AVCE00GenCnt(AVCE00GenInfo *psInfo, AVCCnt *psCnt, GBool bCont);const char *AVCE00GenLab(AVCE00GenInfo *psInfo, AVCLab *psLab, GBool bCont);const char *AVCE00GenTol(AVCE00GenInfo *psInfo, AVCTol *psTol, GBool bCont);const char *AVCE00GenTxt(AVCE00GenInfo *psInfo, AVCTxt *psTxt, GBool bCont);const char *AVCE00GenTx6(AVCE00GenInfo *psInfo, AVCTxt *psTxt, GBool bCont);const char *AVCE00GenPrj(AVCE00GenInfo *psInfo, char **papszPrj, GBool bCont);const char *AVCE00GenRxp(AVCE00GenInfo *psInfo, AVCRxp *psRxp, GBool bCont);const char *AVCE00GenTableHdr(AVCE00GenInfo *psInfo, AVCTableDef *psDef, GBool bCont);const char *AVCE00GenTableRec(AVCE00GenInfo *psInfo, int numFields, AVCFieldInfo *pasDef, AVCField *pasFields, GBool bCont);/*--------------------------------------------------------------------- * Functions related to parsing E00 lines *--------------------------------------------------------------------*/AVCE00ParseInfo *AVCE00ParseInfoAlloc();void AVCE00ParseInfoFree(AVCE00ParseInfo *psInfo);void AVCE00ParseReset(AVCE00ParseInfo *psInfo);AVCFileType AVCE00ParseSectionHeader(AVCE00ParseInfo *psInfo, const char *pszLine);GBool AVCE00ParseSectionEnd(AVCE00ParseInfo *psInfo, const char *pszLine, GBool bResetParseInfo);AVCFileType AVCE00ParseSuperSectionHeader(AVCE00ParseInfo *psInfo, const char *pszLine);GBool AVCE00ParseSuperSectionEnd(AVCE00ParseInfo *psInfo, const char *pszLine );void *AVCE00ParseNextLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCArc *AVCE00ParseNextArcLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCPal *AVCE00ParseNextPalLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCCnt *AVCE00ParseNextCntLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCLab *AVCE00ParseNextLabLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCTol *AVCE00ParseNextTolLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCTxt *AVCE00ParseNextTxtLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCTxt *AVCE00ParseNextTx6Line(AVCE00ParseInfo *psInfo, const char *pszLine);char **AVCE00ParseNextPrjLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCRxp *AVCE00ParseNextRxpLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCTableDef *AVCE00ParseNextTableDefLine(AVCE00ParseInfo *psInfo, const char *pszLine);AVCField *AVCE00ParseNextTableRecLine(AVCE00ParseInfo *psInfo, const char *pszLine);/*--------------------------------------------------------------------- * Misc. functions shared by several parts of the lib. *--------------------------------------------------------------------*/int _AVCE00ComputeRecSize(int numFields, AVCFieldInfo *pasDef, GBool bMapType40ToDouble);void _AVCDestroyTableFields(AVCTableDef *psTableDef, AVCField *pasFields);void _AVCDestroyTableDef(AVCTableDef *psTableDef);AVCTableDef *_AVCDupTableDef(AVCTableDef *psSrcDef);GBool AVCFileExists(const char *pszPath, const char *pszName);char *AVCAdjustCaseSensitiveFilename(char *pszFname);int AVCPrintRealValue(char *pszBuf, int nPrecision, AVCFileType eType, double dValue);/*===================================================================== Function prototypes (THE PUBLIC ONES) =====================================================================*//*--------------------------------------------------------------------- * Functions to read E00 *--------------------------------------------------------------------*/AVCE00ReadE00Ptr AVCE00ReadOpenE00(const char *pszE00FileName);void AVCE00ReadCloseE00(AVCE00ReadE00Ptr psRead);int AVCE00ReadRewindE00(AVCE00ReadE00Ptr psRead);void *AVCE00ReadNextObjectE00(AVCE00ReadE00Ptr psRead);AVCE00Section *AVCE00ReadSectionsListE00(AVCE00ReadE00Ptr psRead, int *numSect);int AVCE00ReadGotoSectionE00(AVCE00ReadE00Ptr psRead, AVCE00Section *psSect, GBool bContinue);/*--------------------------------------------------------------------- * Functions to make a binary coverage appear as E00 *--------------------------------------------------------------------*/AVCE00ReadPtr AVCE00ReadOpen(const char *pszCoverPath);void AVCE00ReadClose(AVCE00ReadPtr psInfo);const char *AVCE00ReadNextLine(AVCE00ReadPtr psInfo);int AVCE00ReadRewind(AVCE00ReadPtr psInfo);AVCE00Section *AVCE00ReadSectionsList(AVCE00ReadPtr psInfo, int *numSect);int AVCE00ReadGotoSection(AVCE00ReadPtr psInfo, AVCE00Section *psSect, GBool bContinue);/*--------------------------------------------------------------------- * Functions to write E00 lines to a binary coverage *--------------------------------------------------------------------*/AVCE00WritePtr AVCE00WriteOpen(const char *pszCoverPath, AVCCoverType eNewCoverType, int nPrecision);void AVCE00WriteClose(AVCE00WritePtr psInfo);int AVCE00WriteNextLine(AVCE00WritePtr psInfo, const char *pszLine);int AVCE00DeleteCoverage(const char *pszCoverPath);CPL_C_END#endif /* _AVC_H_INCLUDED_ */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -