]> andersk Git - splint.git/blame - src/Headers/fileTable.h
OS/2 command line args fix provided by Herbert Martin Dietze.
[splint.git] / src / Headers / fileTable.h
CommitLineData
885824d3 1/*
28bf4b0b 2** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
885824d3 3** See ../LICENSE for license information.
4**
5*/
6/*
7** fileTable.h
8*/
9
10# ifndef FILETABLE_H
11# define FILETABLE_H
12
13/*@constant int FTBASESIZE; @*/
14# define FTBASESIZE 64
15
16/* moved to fileloc.h
17** typedef int fileId;
18*/
19
20typedef enum { FILE_NORMAL, FILE_LSLTEMP, FILE_NODELETE,
28bf4b0b 21 FILE_HEADER, FILE_XH, FILE_MACROS, FILE_METASTATE } fileType;
885824d3 22
28bf4b0b 23/*@private@*/ typedef struct
885824d3 24{
25 bool ftemp BOOLBITS;
26 bool fsystem BOOLBITS;
27 bool fspecial BOOLBITS;
28 cstring fname;
29 cstring basename;
30 fileType ftype;
31 fileId fder;
32} *ftentry;
33
34typedef /*@only@*/ ftentry o_ftentry;
35
28bf4b0b 36abst_typedef /*@null@*/ struct
885824d3 37{
38 int nentries;
39 int nspace;
28bf4b0b 40 cstringTable htable;
885824d3 41 /*@reldef@*/ /*@only@*/ o_ftentry *elements;
42} *fileTable ;
43
44/*@constant null fileTable fileTable_undefined; @*/
45# define fileTable_undefined ((fileTable) NULL)
46
47extern /*@unused@*/ /*@truenull@*/ bool
48 fileTable_isUndefined (/*@null@*/ fileTable p_f) /*@*/ ;
49extern /*@unused@*/ /*@falsenull@*/ bool
50 fileTable_isDefined (/*@null@*/ fileTable p_f) /*@*/ ;
51
52# define fileTable_isUndefined(ft) ((ft) == fileTable_undefined)
53# define fileTable_isDefined(ft) ((ft) != fileTable_undefined)
54extern /*@observer@*/ cstring fileTable_getName (fileTable p_ft, fileId p_fid) /*@*/ ;
55extern /*@observer@*/ cstring fileTable_getNameBase (fileTable p_ft, fileId p_fid) ;
56extern fileId fileTable_addFile (fileTable p_ft, cstring p_name)
57 /*@modifies p_ft@*/ ;
58extern fileId fileTable_addHeaderFile (fileTable p_ft, cstring p_name)
59 /*@modifies p_ft@*/ ;
28bf4b0b 60extern fileId fileTable_addXHFile (fileTable p_ft, cstring p_name)
61 /*@modifies p_ft@*/ ;
885824d3 62extern fileId fileTable_addLibraryFile (fileTable p_ft, cstring p_name)
63 /*@modifies p_ft@*/ ;
64
65# ifndef NOLCL
66extern fileId fileTable_addLCLFile (fileTable p_ft, cstring p_name)
67 /*@modifies p_ft@*/ ;
68
69extern fileId fileTable_addltemp (fileTable p_ft);
70
71# endif
72
73extern /*@notnull@*/ /*@only@*/ fileTable fileTable_create (void) /*@*/ ;
74extern fileId fileTable_lookup (fileTable p_ft, cstring p_s) /*@*/ ;
75extern fileId fileTable_addCTempFile (fileTable p_ft, fileId p_fid)
76 /*@modifies p_ft@*/ ;
77extern fileId fileTable_addFileOnly (fileTable p_ft, /*@only@*/ cstring p_name)
78 /*@modifies p_ft@*/ ;
79
80# ifndef NOLCL
81extern fileId fileTable_addImportFile (fileTable p_ft, cstring p_name)
82 /*@modifies p_ft@*/ ;
83# endif
84
85extern fileId fileTable_addMacrosFile (fileTable p_ft)
86 /*@modifies p_ft@*/ ;
28bf4b0b 87
88extern fileId fileTable_addMetastateFile (fileTable p_ft, cstring p_name)
89 /*@modifies p_ft@*/ ;
90
91extern void fileTable_setFilePath (fileTable p_ft, fileId p_fid, cstring p_path)
92 /*@modifies p_ft@*/ ;
93
885824d3 94extern /*@observer@*/ cstring fileTable_getRootName (fileTable p_ft, fileId p_fid) /*@*/ ;
95extern bool fileTable_isHeader (fileTable p_ft, fileId p_fid) /*@*/ ;
96extern bool fileId_isHeader (fileId p_f) /*@*/ ;
97# define fileId_isHeader(f) (fileTable_isHeader (context_fileTable(), f))
98
99extern bool fileTable_sameBase (fileTable p_ft, fileId p_f1, fileId p_f2);
100extern void fileTable_cleanup (fileTable p_ft) /*@modifies fileSystem@*/;
101extern fileId fileTable_lookupBase (fileTable p_ft, cstring p_base) /*@modifies p_ft@*/ ;
102extern void fileTable_printTemps (fileTable p_ft) /*@modifies g_msgstream@*/ ;
103extern /*@unused@*/ /*@only@*/ cstring fileTable_unparse (fileTable p_ft) /*@*/ ;
104extern bool fileTable_exists (fileTable p_ft, cstring p_s) /*@*/ ;
105extern void fileTable_free (/*@only@*/ fileTable p_f);
106extern bool fileTable_isSpecialFile (fileTable p_ft, fileId p_fid) /*@*/ ;
107extern bool fileTable_isSystemFile (fileTable p_ft, fileId p_fid) /*@*/ ;
28bf4b0b 108extern bool fileTable_isXHFile (fileTable p_ft, fileId p_fid) /*@*/ ;
885824d3 109
110/*@-czechfcns@*/
111extern /*@observer@*/ cstring fileName (fileId p_fid) /*@*/ ;
112extern /*@observer@*/ cstring fileNameBase (fileId p_fid) /*@*/ ;
113extern /*@observer@*/ cstring rootFileName (fileId p_fid) /*@*/ ;
114/*@=czechfcns@*/
115
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))
119
120extern void fileTable_noDelete (fileTable, cstring);
121extern 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))
124
125# else
126# error "Multiple include"
127#endif
128
This page took 0.0652160000000001 seconds and 5 git commands to generate.