00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #define LIBTEKLTI_EXPORT (0)
00023
00024
00025
00026
00027 #ifndef _cplusplus
00028 #define _cplusplus
00029 #endif
00030 #include "teklti.h"
00031
00032 #ifdef NULL
00033 #undef NULL
00034 #endif
00035
00036 #define NULL 0
00037
00038
00039 TEKERR TekFileCreate(TekFileType FileType, TekFile ** RetVal, uchar_t * FileName)
00040 {
00041 TekFileBinary * NewValBin;
00042 #ifdef TEKLTI_USE_BZIP2
00043 TekFileBZ2 * NewValBZ2;
00044 #endif
00045 TekFile * NewVal;
00046 void * tmpvar;
00047
00048 #ifndef NO_SIZE_T_CHECKS
00049 if ( RetVal == NULL )
00050 return TEKERR_POINTER;
00051 #endif
00052
00053 switch ( FileType )
00054 {
00055 case TekFileType_Binary:
00056
00057 NewVal = new TekFileBinary;
00058
00059 if ( FileName != NULL )
00060 NewVal->put_Filename(FileName);
00061
00062
00063 *RetVal = (TekFile *)NewVal;
00064
00065 return TEKERR_OK;
00066 case TekFileType_BinaryPipe:
00067
00068 NewValBin = new TekFileBinary;
00069
00070 NewValBin->ConvertToPipe();
00071
00072
00073 *RetVal = (TekFile *)NewValBin;
00074
00075 return TEKERR_OK;
00076 case TekFileType_ASCII:
00077
00078 NewVal = new TekFileASCIIBare;
00079
00080 if ( FileName != NULL )
00081 NewVal->put_Filename(FileName);
00082
00083
00084 *RetVal = (TekFile *)NewVal;
00085
00086 return TEKERR_OK;
00087 case TekFileType_BZIP2:
00088 #ifdef TEKLTI_USE_BZIP2
00089
00090 NewVal = new TekFileBZ2Binary;
00091
00092 if ( FileName != NULL )
00093 NewVal->put_Filename(FileName);
00094
00095
00096 *RetVal = NewVal;
00097
00098 return TEKERR_OK;
00099 #endif
00100 case TekFileType_BZIP2_ASCII:
00101 #ifdef TEKLTI_USE_BZIP2
00102
00103 NewValBZ2 = new TekFileBZ2ASCII;
00104
00105
00106 if ( FileName != NULL )
00107 NewValBZ2->put_Filename(FileName);
00108
00109
00110 tmpvar = (void *)NewValBZ2;
00111 *RetVal = (TekFile *)tmpvar;
00112
00113
00114 return TEKERR_OK;
00115 #else
00116 return TEKERR_NOTIMPL;
00117 #endif
00118 case TekFileType_ConfigASCII:
00119 case TekFileType_UNICODE:
00120 case TekFileType_ConfigUNICODE:
00121 case TekFileType_ASCIIPipe:
00122 case TekFileType_UnicodePipe:
00123 default:
00124 return TEKERR_UNAVAILABLE;
00125 }
00126 }
00127
00128
00129 MKTEKUUID(UTekFile, "af7d74d2-db02-11d9-9782-000bdbc434d9")
00130 MKTEKDEBUGSTRING(DBTekFile, "TekFile")
00131
00132
00133
00137 TekFile::TekFile()
00138 {
00139 ;
00140 }
00141
00145 TekFile::~TekFile()
00146 {
00147 ;
00148 }
00149
00150
00151
00152 #if NULL != 0
00153
00154
00155
00156
00162 TEKERR TekFile::get_FILE(FILE ** FileDescriptor)
00163 {
00164 return TEKERR_NOTIMPL;
00165 }
00166
00167
00173 TEKERR TekFile::get_Filename(uchar_t ** Name)
00174 {
00175 return TEKERR_NOTIMPL;
00176 }
00177
00178
00189 TEKERR TekFile::put_FILE(FILE * FileDescriptor)
00190 {
00191 return TEKERR_NOTIMPL;
00192 }
00193
00194
00200 TEKERR TekFile::put_Filename(uchar_t * Name)
00201 {
00202 return TEKERR_NOTIMPL;
00203 }
00204
00205
00211 TEKERR TekFile::get_Type(TekFileType * FileTypePointer)
00212 {
00213 return TEKERR_NOTIMPL;
00214 }
00215
00216
00222 TEKERR TekFile::Close()
00223 {
00224 return TEKERR_NOTIMPL;
00225 }
00226
00227
00233 TEKERR TekFile::get_Mode(TekFileMode * ModeID)
00234 {
00235 return TEKERR_NOTIMPL;
00236 }
00237
00238
00244 TEKERR TekFile::Flush()
00245 {
00246 return TEKERR_NOTIMPL;
00247 }
00248
00249
00255 TEKERR TekFile::Open()
00256 {
00257 return TEKERR_NOTIMPL;
00258 }
00259
00260
00266 TEKERR TekFile::Open64()
00267 {
00268 return TEKERR_NOTIMPL;
00269 }
00270
00271
00277 TEKERR TekFile::put_Mode(TekFileMode ModeID)
00278 {
00279 return TEKERR_NOTIMPL;
00280 }
00281
00282
00288 TEKERR TekFile::Read64(void * Buffer, uint64_t BytesToRead, uint64_t * BytesRead)
00289 {
00290 return TEKERR_NOTIMPL;
00291 }
00292
00293
00299 TEKERR TekFile::Read(void * Buffer, unsigned long BytesToRead, unsigned long * BytesRead)
00300 {
00301 return TEKERR_NOTIMPL;
00302 }
00303
00304
00310 TEKERR TekFile::Seek64(TekFileSeek SeekWhere, int64_t NewLocation)
00311 {
00312 return TEKERR_NOTIMPL;
00313 }
00314
00315
00321 TEKERR TekFile::Seek(TekFileSeek SeekWhere, signed long NewLocation)
00322 {
00323 return TEKERR_NOTIMPL;
00324 }
00325
00326
00332 TEKERR TekFile::Write64(void * Buffer, uint64_t BytesToWrite, uint64_t * BytesWrote)
00333 {
00334 return TEKERR_NOTIMPL;
00335 }
00336
00337
00343 TEKERR TekFile::Write(void * Buffer, unsigned long BytesToWrite, unsigned long * BytesWrote)
00344 {
00345 return TEKERR_NOTIMPL;
00346 }
00347
00348
00355 TEKERR TekFile::get_Location(unsigned long * Location)
00356 {
00357 return TEKERR_NOTIMPL;
00358 }
00359
00360
00367 TEKERR TekFile::get_Location64(uint64_t * Location)
00368 {
00369 return TEKERR_NOTIMPL;
00370 }
00371
00372 #endif
00373