]>
Commit | Line | Data |
---|---|---|
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 | ** osd.h | |
8 | */ | |
9 | ||
10 | # ifndef OSD_H | |
11 | # define OSD_H | |
12 | ||
13 | /* Macro to substitute for ## because VAX C currently doesn't allow it. */ | |
14 | # ifdef __STDC__ | |
15 | /* Use an intermediate paste macro so PASTE macro arguments will get */ | |
16 | /* evaluated. Therefore, PASTE(PASTE(a,b),c) will work. */ | |
17 | /*@notfunction@*/ | |
18 | # define IPASTE(L,R) L ## R | |
19 | /*@notfunction@*/ | |
20 | # define PASTE(L,R) IPASTE(L,R) | |
21 | # else | |
22 | /*@notfunction@*/ | |
23 | # define PASTE(L,R ) L/**/R | |
24 | # endif | |
25 | ||
26 | /* Macro to substitute for # because VAX C currently doesn't allow it. */ | |
27 | # ifdef __STDC__ | |
28 | /*@notfunction@*/ | |
29 | # define ISTR(x) # x | |
30 | /*@notfunction@*/ | |
31 | # define STR(x) ISTR(x) | |
32 | # else | |
33 | /*@notfunction@*/ | |
34 | # define ISTR(x) "x" | |
35 | /*@notfunction@*/ | |
36 | # define STR(x) ISTR(x) | |
37 | # endif | |
38 | ||
39 | /* | |
40 | ** MAXPATHLEN defines the longest permissable path length. | |
53a89507 | 41 | ** |
42 | ** POSIX defines PATHMAX in limits.h | |
885824d3 | 43 | */ |
44 | ||
53a89507 | 45 | # ifdef PATH_MAX |
46 | /*@constant size_t MAXPATHLEN; @*/ | |
47 | # define MAXPATHLEN PATH_MAX | |
48 | # else | |
49 | /*@constant size_t MAXPATHLEN; @*/ | |
50 | # define MAXPATHLEN 1024 | |
51 | # endif | |
885824d3 | 52 | |
53 | typedef enum { | |
54 | OSD_FILEFOUND, | |
55 | OSD_FILENOTFOUND, | |
56 | OSD_PATHTOOLONG } filestatus; | |
57 | ||
28bf4b0b | 58 | extern /*@only@*/ cstring LSLRootName (cstring p_filespec) /*@*/ ; |
885824d3 | 59 | |
60 | extern filestatus | |
28bf4b0b | 61 | osd_getPath (cstring p_path, cstring p_file, /*@out@*/ cstring *p_returnPath) |
885824d3 | 62 | /*@modifies *p_returnPath@*/ ; |
63 | ||
64 | extern filestatus | |
28bf4b0b | 65 | osd_getExePath (cstring p_path, cstring p_file, /*@out@*/ cstring *p_returnPath) |
885824d3 | 66 | /*@modifies *p_returnPath@*/ ; |
67 | ||
28bf4b0b | 68 | extern bool osd_fileExists (cstring p_filespec) /*@*/ ; |
69 | extern /*@observer@*/ cstring | |
70 | osd_getEnvironment (cstring p_env, /*@returned@*/ cstring p_def) /*@*/ ; | |
885824d3 | 71 | |
28bf4b0b | 72 | extern filestatus osd_findOnLarchPath (cstring p_file, /*@out@*/ cstring *p_returnPath) |
885824d3 | 73 | /*@modifies *p_returnPath@*/ ; |
74 | ||
28bf4b0b | 75 | extern /*@observer@*/ cstring osd_getHomeDir (void) /*@*/ ; |
885824d3 | 76 | |
28bf4b0b | 77 | extern /*@observer@*/ cstring osd_getEnvironmentVariable (cstring) ; |
885824d3 | 78 | |
79 | # ifndef NOLCL | |
80 | /*@constant int CALL_SUCCESS@*/ | |
81 | # define CALL_SUCCESS 0 | |
28bf4b0b | 82 | extern int osd_system (cstring p_cmd) /*@modifies fileSystem@*/ ; |
885824d3 | 83 | # endif |
84 | ||
53a89507 | 85 | extern cstring osd_absolutePath (cstring p_cwd, cstring p_filename) /*@*/ ; |
86 | extern cstring osd_outputPath (cstring p_filename) /*@*/ ; | |
87 | extern void osd_initMod (void) /*@modifies internalState@*/ ; | |
88 | ||
68de3f33 | 89 | extern bool osd_equalCanonicalPrefix (cstring p_dirpath, cstring p_prefixpath) /*@*/ ; |
90 | ||
28bf4b0b | 91 | extern int osd_unlink (cstring) /*@modifies fileSystem@*/ ; |
92 | extern cstring osd_fixDefine (cstring); | |
93 | extern bool osd_fileIsReadable (cstring); | |
885824d3 | 94 | |
95 | extern bool osd_isConnectChar (char) /*@*/ ; | |
96 | ||
97 | # ifdef WIN32 | |
98 | extern int osd_getPid (void) ; | |
99 | # else | |
100 | extern int /*pid_t*/ osd_getPid (void) ; | |
101 | # endif | |
102 | ||
103 | # else | |
104 | # error "Multiple include" | |
105 | # endif | |
106 | ||
107 | ||
108 |