File indexing completed on 2025-05-11 08:23:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #ifndef _tfs_h
0041 #define _tfs_h
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 #define TFSINFOSIZE 23
0052
0053 #ifndef TFSNAMESIZE
0054 #define TFSNAMESIZE 23
0055 #endif
0056
0057 #ifndef TFS_CHANGELOG_FILE
0058 #define TFS_CHANGELOG_SIZE 0
0059 #define TFS_CHANGELOG_FILE ".tfschlog"
0060 #endif
0061
0062 #ifndef SYMFILE
0063 #define SYMFILE "symtbl"
0064 #endif
0065
0066 #define MINUSRLEVEL 0
0067 #define MAXUSRLEVEL 3
0068
0069 #ifndef TFS_RESERVED
0070 #define TFS_RESERVED 4
0071 #endif
0072
0073
0074
0075 #define TFS_EXEC 0x00000001
0076 #define TFS_BRUN 0x00000002
0077 #define TFS_QRYBRUN 0x00000004
0078
0079 #define TFS_SYMLINK 0x00000008
0080 #define TFS_EBIN 0x00000010
0081 #define TFS_CPRS 0x00000040
0082 #define TFS_IPMOD 0x00000080
0083 #define TFS_UNREAD 0x00000100
0084
0085
0086 #define TFS_ULVLMSK 0x00000600
0087 #define TFS_ULVL0 0x00000000
0088 #define TFS_ULVL1 0x00000200
0089 #define TFS_ULVL2 0x00000400
0090 #define TFS_ULVL3 0x00000600
0091 #define TFS_NSTALE 0x00000800
0092
0093
0094
0095
0096 #define TFS_ACTIVE 0x00008000
0097
0098 #define TFS_ULVLMAX TFS_ULVL3
0099 #define TFS_USRLVL(f) ((f->flags & TFS_ULVLMSK) >> 9)
0100
0101
0102 #define TFS_RDONLY 0x00010000
0103 #define TFS_CREATE 0x00020000
0104
0105 #define TFS_APPEND 0x00040000
0106
0107
0108 #define TFS_ALLFFS 0x00080000
0109 #define TFS_CREATERM 0x00100000
0110
0111
0112
0113
0114
0115
0116 #define TFS_RCFILE "monrc"
0117
0118
0119 #define TFS_ERRMSG 1
0120 #define TFS_MEMUSE 2
0121 #define TFS_MEMDEAD 3
0122 #define TFS_DEFRAG 4
0123 #define TFS_TELL 5
0124 #define TFS_UNOPEN 7
0125 #define TFS_FATOB 8
0126 #define TFS_FBTOA 9
0127 #define TFS_MEMAVAIL 10
0128 #define TFS_TIMEFUNCS 11
0129 #define TFS_DOCOMMAND 12
0130 #define TFS_INITDEV 13
0131 #define TFS_CHECKDEV 14
0132 #define TFS_DEFRAGDEV 15
0133 #define TFS_DEFRAGOFF 16
0134 #define TFS_DEFRAGON 17
0135 #define TFS_HEADROOM 18
0136 #define TFS_FCOUNT 19
0137
0138
0139
0140
0141
0142 struct tfshdr {
0143 unsigned short hdrsize;
0144 unsigned short hdrvrsn;
0145 long filsize;
0146 long flags;
0147 unsigned long filcrc;
0148 unsigned long hdrcrc;
0149 unsigned long modtime;
0150 struct tfshdr *next;
0151 char name[TFSNAMESIZE+1];
0152 char info[TFSINFOSIZE+1];
0153 #if TFS_RESERVED
0154 unsigned long rsvd[TFS_RESERVED];
0155 #endif
0156 };
0157
0158 #define TFSHDRSIZ sizeof(struct tfshdr)
0159
0160
0161 #define TFS_OKAY 0
0162 #define TFSERR_NOFILE -1
0163 #define TFSERR_NOSLOT -2
0164 #define TFSERR_EOF -3
0165 #define TFSERR_BADARG -4
0166 #define TFSERR_NOTEXEC -5
0167 #define TFSERR_BADCRC -6
0168 #define TFSERR_FILEEXISTS -7
0169 #define TFSERR_FLASHFAILURE -8
0170 #define TFSERR_WRITEMAX -9
0171 #define TFSERR_RDONLY -10
0172 #define TFSERR_BADFD -11
0173 #define TFSERR_BADHDR -12
0174 #define TFSERR_CORRUPT -13
0175 #define TFSERR_MEMFAIL -14
0176 #define TFSERR_NOTIPMOD -16
0177 #define TFSERR_MUTEXFAILURE -17
0178 #define TFSERR_FLASHFULL -18
0179 #define TFSERR_USERDENIED -19
0180 #define TFSERR_NAMETOOBIG -20
0181 #define TFSERR_FILEINUSE -21
0182 #define TFSERR_NOTCPRS -22
0183 #define TFSERR_NOTAVAILABLE -23
0184 #define TFSERR_BADFLAG -24
0185 #define TFSERR_CLEANOFF -25
0186 #define TFSERR_FLAKEYSOURCE -26
0187 #define TFSERR_BADEXTENSION -27
0188 #define TFSERR_MIN -100
0189
0190
0191 #define TFS_BEGIN 1
0192 #define TFS_CURRENT 2
0193 #define TFS_END 3
0194
0195
0196 #define TFS_DELETED(fp) (!((fp)->flags & TFS_ACTIVE))
0197 #define TFS_FILEEXISTS(fp) ((fp)->flags & TFS_ACTIVE)
0198 #define TFS_ISCPRS(fp) ((fp)->flags & TFS_CPRS)
0199 #define TFS_ISEXEC(fp) ((fp)->flags & TFS_EXEC)
0200 #define TFS_ISBOOT(fp) ((fp)->flags & TFS_BRUN)
0201 #define TFS_ISLINK(fp) ((fp)->flags & TFS_SYMLINK)
0202 #define TFS_STALE(fp) (!((fp)->flags & TFS_NSTALE))
0203 #define TFS_FLAGS(fp) ((fp)->flags)
0204 #define TFS_NAME(fp) ((fp)->name)
0205 #define TFS_SIZE(fp) ((fp)->filsize)
0206 #define TFS_TIME(fp) ((fp)->modtime)
0207 #define TFS_INFO(fp) ((fp)->info)
0208 #define TFS_NEXT(fp) ((fp)->next)
0209 #define TFS_CRC(fp) ((fp)->filcrc)
0210 #define TFS_ENTRY(fp) ((fp)->entry)
0211 #define TFS_BASE(fp) ((char *)(fp)+(fp)->hdrsize)
0212
0213 typedef struct tfshdr TFILE;
0214 #endif