00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef LC_RFS_H
00015 #define LC_RFS_H
00016
00017 #include <gwenhywfar/inherit.h>
00018 #include <gwenhywfar/misc.h>
00019 #include <gwenhywfar/types.h>
00020 #include <gwenhywfar/db.h>
00021
00022 #include <chipcard2-client/fs/fsnode.h>
00023 #include <stdio.h>
00024
00025
00026 typedef struct LC_RFS LC_RFS;
00027
00028 GWEN_INHERIT_FUNCTION_LIB_DEFS(LC_RFS, CHIPCARD_API)
00029
00030
00031 typedef int (*LC_RFS_EXCHANGE_FN)(LC_RFS *fs,
00032 GWEN_DB_NODE *dbRequest,
00033 GWEN_DB_NODE *dbResponse);
00034
00035
00036 LC_RFS *LC_RFS_new();
00037 void LC_RFS_free(LC_RFS *fs);
00038
00039
00040 void LC_RFS_SetExchangeFn(LC_RFS *fs, LC_RFS_EXCHANGE_FN fn);
00041
00042
00043 GWEN_TYPE_UINT32 LC_RFS_CreateClient(LC_RFS *fs);
00044 void LC_RFS_DestroyClient(LC_RFS *fs, GWEN_TYPE_UINT32 clid);
00045
00046
00047 int LC_RFS_ChangeWorkingDir(LC_RFS *fs,
00048 GWEN_TYPE_UINT32 clid,
00049 const char *path);
00050
00051 int LC_RFS_OpenDir(LC_RFS *fs,
00052 GWEN_TYPE_UINT32 clid,
00053 const char *path,
00054 GWEN_TYPE_UINT32 *pHid);
00055
00056 int LC_RFS_MkDir(LC_RFS *fs,
00057 GWEN_TYPE_UINT32 clid,
00058 const char *path,
00059 GWEN_TYPE_UINT32 mode,
00060 GWEN_TYPE_UINT32 *pHid);
00061
00062 int LC_RFS_ReadDir(LC_RFS *fs,
00063 GWEN_TYPE_UINT32 clid,
00064 GWEN_TYPE_UINT32 hid,
00065 GWEN_STRINGLIST2 *sl);
00066
00067 int LC_RFS_CloseDir(LC_RFS *fs,
00068 GWEN_TYPE_UINT32 clid,
00069 GWEN_TYPE_UINT32 hid);
00070
00071 int LC_RFS_OpenFile(LC_RFS *fs,
00072 GWEN_TYPE_UINT32 clid,
00073 const char *path,
00074 GWEN_TYPE_UINT32 mode,
00075 GWEN_TYPE_UINT32 *pHid);
00076
00077 int LC_RFS_CreateFile(LC_RFS *fs,
00078 GWEN_TYPE_UINT32 clid,
00079 const char *path,
00080 GWEN_TYPE_UINT32 mode,
00081 GWEN_TYPE_UINT32 *pHid);
00082
00083 int LC_RFS_CloseFile(LC_RFS *fs,
00084 GWEN_TYPE_UINT32 clid,
00085 GWEN_TYPE_UINT32 hid);
00086
00087 int LC_RFS_ReadFile(LC_RFS *fs,
00088 GWEN_TYPE_UINT32 clid,
00089 GWEN_TYPE_UINT32 hid,
00090 GWEN_TYPE_UINT32 offset,
00091 GWEN_TYPE_UINT32 len,
00092 GWEN_BUFFER *buf);
00093
00094 int LC_RFS_Unlink(LC_RFS *fs,
00095 GWEN_TYPE_UINT32 clid,
00096 const char *path);
00097
00098
00099 int LC_RFS_Stat(LC_RFS *fs,
00100 GWEN_TYPE_UINT32 clid,
00101 const char *path,
00102 LC_FS_STAT **pStat);
00103
00104
00105
00106 #endif
00107
00108
00109
00110