]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
2 | ** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2000. | |
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. | |
41 | ** Is defined in <sys/param.h> in MIPS/Ultrix, but it not defined on the VAX. | |
42 | ** Define here so available on both systems. | |
43 | */ | |
44 | ||
45 | /*@constant int MAXPATHLEN; @*/ | |
46 | # define MAXPATHLEN 1024 | |
47 | ||
48 | typedef enum { | |
49 | OSD_FILEFOUND, | |
50 | OSD_FILENOTFOUND, | |
51 | OSD_PATHTOOLONG } filestatus; | |
52 | ||
53 | extern /*@only@*/ char *LSLRootName (char *p_filespec) /*@*/ ; | |
54 | ||
55 | extern filestatus | |
56 | osd_getPath (char *p_path, char *p_file, /*@out@*/ char **p_returnPath) | |
57 | /*@modifies *p_returnPath@*/ ; | |
58 | ||
59 | extern filestatus | |
60 | osd_getExePath (char *p_path, char *p_file, /*@out@*/ char **p_returnPath) | |
61 | /*@modifies *p_returnPath@*/ ; | |
62 | ||
63 | extern bool osd_fileExists (char *p_filespec) /*@*/ ; | |
64 | extern /*@observer@*/ char * | |
65 | osd_getEnvironment (char *p_env, /*@returned@*/ char *p_def) /*@*/ ; | |
66 | ||
67 | extern filestatus osd_findOnLarchPath (char *p_file, /*@out@*/ char **p_returnPath) | |
68 | /*@modifies *p_returnPath@*/ ; | |
69 | ||
70 | extern /*@observer@*/ /*@null@*/ char *osd_getHomeDir (void) /*@*/ ; | |
71 | ||
72 | extern /*@observer@*/ /*@null@*/ char *osd_getEnvironmentVariable (char *) ; | |
73 | ||
74 | # ifndef NOLCL | |
75 | /*@constant int CALL_SUCCESS@*/ | |
76 | # define CALL_SUCCESS 0 | |
77 | ||
78 | extern int osd_system (const char *p_cmd) /*@modifies fileSystem@*/ ; | |
79 | # endif | |
80 | ||
81 | extern int osd_unlink (const char *) /*@modifies fileSystem@*/ ; | |
82 | extern cstring osd_fixDefine (char *); | |
83 | extern bool osd_fileIsReadable (char *); | |
84 | ||
85 | extern bool osd_isConnectChar (char) /*@*/ ; | |
86 | ||
87 | # ifdef WIN32 | |
88 | extern int osd_getPid (void) ; | |
89 | # else | |
90 | extern int /*pid_t*/ osd_getPid (void) ; | |
91 | # endif | |
92 | ||
93 | # else | |
94 | # error "Multiple include" | |
95 | # endif | |
96 | ||
97 | ||
98 |