Changeset 2005 for Whitix/trunk
- Timestamp:
- 04/02/09 21:11:33 (3 years ago)
- Files:
-
- 1 modified
-
Whitix/trunk/include/fs/icfs.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/trunk/include/fs/icfs.h
r1932 r2005 28 28 #define ICFS_TYPE_FUNC 3 29 29 30 typedef int (*IcReadFunc)(BYTE* data, unsigned long size, DWORD position); 31 typedef int (*IcWriteFunc)(BYTE* data, unsigned long size, DWORD position); 32 33 struct IcFuncEntry 34 { 35 IcReadFunc readFunc; 36 IcWriteFunc writeFunc; 37 }; 38 30 39 #define IC_READ 0 31 40 #define IC_RW 1 … … 35 44 struct IcAttribute 36 45 { 37 int type, offset, perms; 46 int type; 47 48 IcReadFunc readFunc; 49 IcWriteFunc writeFunc; 50 51 int offset; 52 int perms; 53 38 54 const char* name; 39 55 }; 40 41 typedef int (*IcReadFunc)(BYTE* data, unsigned long size, DWORD position);42 typedef int (*IcWriteFunc)(BYTE* data, unsigned long size, DWORD position);43 56 44 57 #define IC_INT(structure, member, permissions) \ … … 49 62 .perms = permissions \ 50 63 } 51 64 65 #define IC_INT_NAME(objName, structure, member, permissions) \ 66 { \ 67 .type = ICFS_TYPE_INT, \ 68 .offset = OffsetOf(structure, member), \ 69 .name = objName, \ 70 .perms = permissions \ 71 } 72 52 73 #define IC_STRING(structure, member, permissions) \ 53 74 { \ … … 61 82 { \ 62 83 .type = ICFS_TYPE_STR, \ 63 .offset = OffsetOf(structure, member) ,\84 .offset = OffsetOf(structure, member) \ 64 85 .name = objName, \ 65 86 .perms = permissions, \ 66 87 } 67 88 89 #define IC_FUNC(objName, funcRead, funcWrite) \ 90 { \ 91 .type = ICFS_TYPE_FUNC, \ 92 .readFunc = funcRead, \ 93 .writeFunc = funcWrite, \ 94 .name = objName, \ 95 } 96 68 97 #define IC_END() \ 69 { -1, -1, -1, NULL }98 { -1, NULL, NULL, -1, -1, NULL } 70 99 71 100 struct IcFsEntry … … 75 104 { 76 105 int* iVal; 77 char* sVal;106 char** sVal; 78 107 108 /* Array entries. */ 79 109 struct 80 110 { … … 83 113 }; 84 114 85 struct 86 { 87 IcReadFunc readFunc; 88 IcWriteFunc writeFunc; 89 }; 115 /* Function entries. */ 116 struct IcFuncEntry entry; 90 117 }; 91 118 }; … … 96 123 int IcFsAddIntEntry(struct KeFsEntry* dir, char* name, int* value, DWORD permissions); 97 124 98 struct IcFsEntry* IcFsAddStrEntry(struct KeFsEntry* dir, char* name, char* str, DWORD permissions);125 struct IcFsEntry* IcFsAddStrEntry(struct KeFsEntry* dir, char* name, char** str, DWORD permissions); 99 126 100 127 int IcFsAddArrayEntry(struct KeFsEntry* dir, char* name, char* array, unsigned int minLen, unsigned int maxLen, unsigned int size);
