メインページ | アルファベット順一覧 | 構成 | ファイル一覧 | 構成メンバ | ファイルメンバ | 関連ページ

# dkcGenericFileSystem.h

説明を見る。

    00001
    00010 #ifndef DKUTIL_C_GENERIC_FILE_SYSTEM_H
    00011 #define DKUTIL_C_GENERIC_FILE_SYSTEM_H
    00012
    00013
    00014 #include "dkcOSIndependent.h"
    00015 #include "dkcDLL.h"
    00016
    00017 enum edkc_FileMode{
    00019     edkcReadMode = 1,
    00021     edkcWriteMode = 2,
    00023     edkcPostScriptMode = 4,
    00024
    00026     edkcBinaryMode = 64,
    00028     edkcTextMode = 128,
    00029
    00030 };
    00031
    00032
    00033
    00034 typedef struct dkc_GenericFileSystemSeekArg{
    00036     DKC_UINT64_STRUCT Point;
    00038     int origin;
    00039 }DKC_GFS_SEEK_ARG;
    00040
    00041 //Genericなファイル操作関数の型を定義する
    00042 typedef void *(*DKC_FILE_OPEN_F_TYPE)(void *,uint32,const void *);
    00043 typedef int (*DKC_FILE_READ_F_TYPE)(void *,void *,size_t,size_t *);
    00044 typedef int (*DKC_FILE_WRITE_F_TYPE)(void *,const void *,size_t,size_t *);
    00045 typedef int (*DKC_FILE_CLOSE_F_TYPE)(void *);
    00046 typedef int (*DKC_FILE_SEEK_F_TYPE)(void *,const DKC_GFS_SEEK_ARG *);
    00047 typedef int (*DKC_FILE_TELL_F_TYPE)(void *,DKC_UINT64_STRUCT *);
    00048 typedef int (*DKC_GFS_FREE_F_TYPE)(void *);
    00049
    00050 typedef int (*DKC_FILE_DELETE_F_TYPE)(void *,const void *);
    00051 #ifdef WIN32
    00052
    00053 typedef struct dkc_open_arg_data{
    00054     DWORD DesiredAccess; // access (read-write) mode
    00055
    00056     DWORD ShareMode; // share mode
    00057
    00058     LPSECURITY_ATTRIBUTES lpSecurityAttributes;// pointer to security attributes
    00059
    00060     DWORD CreationDisposition; // how to create
    00061
    00062     DWORD FlagsAndAttributes; // file attributes
    00063
    00064     HANDLE TemplateFile; // handle to file with
    00065 }DKC_OPEN_ARG_DATA;
    00066
    00067 DKC_EXTERN void dkc_to_CreateFile_arg_data(DKC_OPEN_ARG_DATA *data,uint32 flag);
    00068
    00069 typedef struct dkc_win32_fs{
    00070     HANDLE mHandle;
    00071     void* CreateFile;
    00072     void* SetFileAttributes;
    00073     void* GetFileAttributes;
    00074     void* DeleteFile;
    00075     DKC_OPEN_ARG_DATA mArg;
    00076     DKC_DLL *mdllobj;
    00077
    00078     DWORD mLastError;
    00080     int mFlag;
    00081
    00082 }DKC_WIN32_FS;
    00083
    00084 #endif
    00085
    00086
    00087
    00088 typedef struct dkc_GenericFileSystem{
    00089     //DKC_UINT64_STRUCT now_point;
    00090
    00092 #ifdef WIN32
    00093     DKC_WIN32_FS *mfp;
    00094 #else
    00095     void *mfp;
    00096 #endif
    00097     size_t char_size;
    00098
    00099     //関数
    00100     DKC_FILE_OPEN_F_TYPE mfOpen;
    00101     DKC_FILE_CLOSE_F_TYPE mfClose;
    00102     DKC_FILE_READ_F_TYPE mfRead;
    00103     DKC_FILE_WRITE_F_TYPE mfWrite;
    00104     DKC_FILE_SEEK_F_TYPE mfSeek;
    00105     DKC_FILE_TELL_F_TYPE mfTell;
    00106
    00107     DKC_GFS_FREE_F_TYPE mfObjFree;
    00108
    00109     //ファイル操作系関数
    00110     DKC_FILE_DELETE_F_TYPE mfDeleteFile;
    00111
    00112 }DKC_GENERIC_FILESYSTEM;
    00113
    00114
    00115 /*
    00116
    00117 typedef struct dkc_GFS_Win32
    00118 {
    00119
    00120     //pPathに使うパスはGetTempPath()とかで得てください。
    00121     //GetTempFileName
    00122 }DKC_GFS_WIN32;
    00123 */
    00124
    00125
    00126 //その時に応じた差異的なファイルシステムを構築する。
    00127 //DKC_GENERIC_FILESYSTEM *WINAPI dkcAllocGenericFileSystem();
    00128
    00129 DKC_GENERIC_FILESYSTEM *WINAPI dkcAlloc_SJIS_FileSystem();
    00130
    00131 DKC_GENERIC_FILESYSTEM *WINAPI dkcAlloc_UNICODE_FileSystem();
    00132
    00133 DKC_EXTERN int WINAPI dkcFreeGenericFileSystem(DKC_GENERIC_FILESYSTEM **);
    00134
    00135 DKC_EXTERN int WINAPI dkcGenericFileSystemOpen(DKC_GENERIC_FILESYSTEM *,uint32 flags,const void *filename);
    00136
    00137 DKC_EXTERN int WINAPI dkcGenericFileSystemClose(DKC_GENERIC_FILESYSTEM *);
    00138
    00139 DKC_EXTERN int WINAPI dkcGenericFileSystemRead(DKC_GENERIC_FILESYSTEM *,void *pbuff,size_t size,size_t *read_size);
    00140
    00141 DKC_EXTERN int WINAPI dkcGenericFileSystemWrite(DKC_GENERIC_FILESYSTEM *,const void *pbuff,size_t size,size_t *write_size);
    00142
    00143 DKC_EXTERN int WINAPI dkcGenericFileSystemSeek(DKC_GENERIC_FILESYSTEM *,const DKC_GFS_SEEK_ARG *);
    00144
    00145 DKC_EXTERN int WINAPI dkcGenericFileSystemTell(DKC_GENERIC_FILESYSTEM *,DKC_UINT64_STRUCT *);
    00146
    00147 DKC_EXTERN int WINAPI dkcGenericFileSystemDeleteFile(DKC_GENERIC_FILESYSTEM *,const void *filename);
    00148
    00149
    00150
    00151
    00152 typedef struct dkc_File64{
    00153 #ifdef WIN32
    00154     int handle;
    00155 #else
    00156
    00157 #endif
    00158 }DKC_FILE64;
    00159
    00160
    00166 DKC_FILE64 *WINAPI dkcAllocFile64(uint32 flags,const void *filename);
    00167
    00168 DKC_EXTERN int WINAPI dkcFreeFile64(DKC_FILE64 **);
    00169
    00170 DKC_EXTERN int WINAPI dkcFile64Open(DKC_FILE64 *p,uint32 flags,const void *filename);
    00171
    00172 DKC_EXTERN int WINAPI dkcFile64Close(DKC_FILE64 *p);
    00173
    00174 DKC_EXTERN int WINAPI dkcFile64Read(DKC_FILE64 *p,void *pbuff,size_t size,size_t *read_size);
    00175
    00176 DKC_EXTERN int WINAPI dkcFile64Write(DKC_FILE64 *p,const void *pbuff,size_t size,size_t *write_size);
    00180 DKC_EXTERN int WINAPI dkcFile64Seek(DKC_FILE64 *p,int64 offset,int origin);
    00181
    00182 DKC_EXTERN int WINAPI dkcFile64Tell(DKC_FILE64 *p,uint64 *);
    00184 DKC_EXTERN BOOL WINAPI dkcFile64EOF(DKC_FILE64 *p);
    00185
    00186 #endif //end of include once
    00187
    00188