2 ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
3 ** See ../LICENSE for license information.
13 /*@constant int FTBASESIZE; @*/
14 # define FTBASESIZE 64
17 ** typedef int fileId;
20 typedef enum { FILE_NORMAL, FILE_LSLTEMP, FILE_NODELETE,
21 FILE_HEADER, FILE_XH, FILE_MACROS, FILE_METASTATE } fileType;
23 /*@private@*/ typedef struct
26 bool fsystem BOOLBITS;
27 bool fspecial BOOLBITS;
34 typedef /*@only@*/ ftentry o_ftentry;
36 abst_typedef /*@null@*/ struct
41 /*@reldef@*/ /*@only@*/ o_ftentry *elements;
44 /*@constant null fileTable fileTable_undefined; @*/
45 # define fileTable_undefined ((fileTable) NULL)
47 extern /*@unused@*/ /*@truenull@*/ bool
48 fileTable_isUndefined (/*@null@*/ fileTable p_f) /*@*/ ;
49 extern /*@unused@*/ /*@falsenull@*/ bool
50 fileTable_isDefined (/*@null@*/ fileTable p_f) /*@*/ ;
52 # define fileTable_isUndefined(ft) ((ft) == fileTable_undefined)
53 # define fileTable_isDefined(ft) ((ft) != fileTable_undefined)
54 extern /*@observer@*/ cstring fileTable_getName (fileTable p_ft, fileId p_fid) /*@*/ ;
55 extern /*@observer@*/ cstring fileTable_getNameBase (fileTable p_ft, fileId p_fid) ;
56 extern fileId fileTable_addFile (fileTable p_ft, cstring p_name)
58 extern fileId fileTable_addHeaderFile (fileTable p_ft, cstring p_name)
60 extern fileId fileTable_addXHFile (fileTable p_ft, cstring p_name)
62 extern fileId fileTable_addLibraryFile (fileTable p_ft, cstring p_name)
66 extern fileId fileTable_addLCLFile (fileTable p_ft, cstring p_name)
69 extern fileId fileTable_addltemp (fileTable p_ft);
73 extern /*@notnull@*/ /*@only@*/ fileTable fileTable_create (void) /*@*/ ;
74 extern fileId fileTable_lookup (fileTable p_ft, cstring p_s) /*@*/ ;
75 extern fileId fileTable_addCTempFile (fileTable p_ft, fileId p_fid)
77 extern fileId fileTable_addFileOnly (fileTable p_ft, /*@only@*/ cstring p_name)
81 extern fileId fileTable_addImportFile (fileTable p_ft, cstring p_name)
85 extern fileId fileTable_addMacrosFile (fileTable p_ft)
88 extern fileId fileTable_addMetastateFile (fileTable p_ft, cstring p_name)
91 extern void fileTable_setFilePath (fileTable p_ft, fileId p_fid, cstring p_path)
94 extern /*@observer@*/ cstring fileTable_getRootName (fileTable p_ft, fileId p_fid) /*@*/ ;
95 extern bool fileTable_isHeader (fileTable p_ft, fileId p_fid) /*@*/ ;
96 extern bool fileId_isHeader (fileId p_f) /*@*/ ;
97 # define fileId_isHeader(f) (fileTable_isHeader (context_fileTable(), f))
99 extern bool fileTable_sameBase (fileTable p_ft, fileId p_f1, fileId p_f2);
100 extern void fileTable_cleanup (fileTable p_ft) /*@modifies fileSystem@*/;
101 extern fileId fileTable_lookupBase (fileTable p_ft, cstring p_base) /*@modifies p_ft@*/ ;
102 extern void fileTable_printTemps (fileTable p_ft) /*@modifies g_msgstream@*/ ;
103 extern /*@unused@*/ /*@only@*/ cstring fileTable_unparse (fileTable p_ft) /*@*/ ;
104 extern bool fileTable_exists (fileTable p_ft, cstring p_s) /*@*/ ;
105 extern void fileTable_free (/*@only@*/ fileTable p_f);
106 extern bool fileTable_isSpecialFile (fileTable p_ft, fileId p_fid) /*@*/ ;
107 extern bool fileTable_isSystemFile (fileTable p_ft, fileId p_fid) /*@*/ ;
108 extern bool fileTable_isXHFile (fileTable p_ft, fileId p_fid) /*@*/ ;
111 extern /*@observer@*/ cstring fileName (fileId p_fid) /*@*/ ;
112 extern /*@observer@*/ cstring fileNameBase (fileId p_fid) /*@*/ ;
113 extern /*@observer@*/ cstring rootFileName (fileId p_fid) /*@*/ ;
116 # define fileName(fid) (fileTable_getName(context_fileTable(), fid))
117 # define fileNameBase(fid) (fileTable_getNameBase(context_fileTable(), fid))
118 # define rootFileName(fid) (fileTable_getRootName(context_fileTable(), fid))
120 extern void fileTable_noDelete (fileTable, cstring);
121 extern bool fileId_baseEqual (/*@sef@*/ fileId p_t1, /*@sef@*/ fileId p_t2) /*@*/ ;
122 # define fileId_baseEqual(t1,t2) \
123 (fileId_equal (t1, t2) || fileTable_sameBase (context_fileTable (), t1, t2))
126 # error "Multiple include"