]> andersk Git - splint.git/blobdiff - src/Headers/osd.h
Making fixes for Microsoft Visual C++ compiler.
[splint.git] / src / Headers / osd.h
index 4a6db393d22299155498863c8e364234a6da2c98..1f176b9a04274b2c7b8c9d8947c66dfabf90b7ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
-** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2001.
+** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
 ** See ../LICENSE for license information.
 **
 */
 
 /*
 ** MAXPATHLEN defines the longest permissable path length.
-** Is defined in <sys/param.h> in MIPS/Ultrix, but it not defined on the VAX.
-** Define here so available on both systems.
+**
+** POSIX defines PATHMAX in limits.h
 */
 
-/*@constant int MAXPATHLEN; @*/
-# define MAXPATHLEN      1024
+# ifdef PATH_MAX
+/*@constant size_t MAXPATHLEN; @*/
+# define MAXPATHLEN PATH_MAX
+# else
+/*@constant size_t MAXPATHLEN; @*/
+# define MAXPATHLEN 1024
+# endif
 
 typedef enum {
   OSD_FILEFOUND,
   OSD_FILENOTFOUND,
-  OSD_PATHTOOLONG } filestatus;
+  OSD_PATHTOOLONG 
+} filestatus;
 
 extern /*@only@*/ cstring LSLRootName (cstring p_filespec) /*@*/ ;
 
@@ -67,15 +73,20 @@ extern /*@observer@*/ cstring
 extern filestatus osd_findOnLarchPath (cstring p_file, /*@out@*/ cstring *p_returnPath) 
   /*@modifies *p_returnPath@*/ ;
 
+extern void osd_setTempError (void) /*@modifies internalState@*/ ;
+
 extern /*@observer@*/  cstring osd_getHomeDir (void) /*@*/ ;
 
 extern /*@observer@*/ cstring osd_getEnvironmentVariable (cstring) ;
 
-# ifndef NOLCL
 /*@constant int CALL_SUCCESS@*/
 # define CALL_SUCCESS 0
 extern int osd_system (cstring p_cmd) /*@modifies fileSystem@*/ ;
-# endif
+
+extern cstring osd_absolutePath (cstring p_cwd, cstring p_filename) /*@*/ ;
+extern /*@only@*/ cstring osd_outputPath (cstring p_filename) /*@*/ ;
+extern void osd_initMod (void) /*@modifies internalState@*/ ;
+extern void osd_destroyMod (void) /*@modifies internalState@*/ ;
 
 extern bool osd_equalCanonicalPrefix (cstring p_dirpath, cstring p_prefixpath) /*@*/ ;
 
@@ -84,6 +95,7 @@ extern cstring osd_fixDefine (cstring);
 extern bool osd_fileIsReadable (cstring);
 
 extern bool osd_isConnectChar (char) /*@*/ ;
+extern /*@observer@*/ cstring osd_getCurrentDirectory (void) /*@*/ ;
 
 # ifdef WIN32
 extern int osd_getPid (void) ;
@@ -91,6 +103,108 @@ extern int osd_getPid (void) ;
 extern int /*pid_t*/ osd_getPid (void) ;
 # endif
 
+# ifdef WIN32
+/* Win32 doesn't support ISO C99 correctly... */
+# define snprintf _snprintf
+# endif
+
+/*
+** Win32 convention?
+*/
+
+# if defined(__IBMC__) && defined(OS2)
+# define S_IFMT (unsigned short)0xFFFF
+# endif
+
+# if defined (OS2) || defined (MSDOS) || defined (WIN32)
+/*@constant observer cstring INCLUDEPATH_VAR@*/
+# define INCLUDEPATH_VAR    cstring_makeLiteralTemp ("INCLUDE")
+# else
+/*@constant observer cstring INCLUDEPATH_VAR@*/
+# define INCLUDEPATH_VAR    cstring_makeLiteralTemp ("CPATH")
+# endif
+
+#if defined (VMS)
+
+/*
+** VMS is here, but hasn't been tested for many releases.  Not sure if this works.
+*/
+
+/*
+** Connection string inserted between directory and filename to make a  
+** full path name.                                                     
+*/
+
+# define    CONNECTSTR ":"
+# define    CONNECTCHAR        ':'
+
+/* Directory separator character for search list. */
+/*@constant static char PATH_SEPARATOR; @*/
+# define PATH_SEPARATOR ':'
+
+# elif defined(MSDOS) || defined(OS2) || defined(WIN32)
+
+/* Connection string inserted between directory and filename to make a  */
+/* full path name.                                                     */
+
+/*@constant observer char *CONNECTSTR@*/
+# define CONNECTSTR    "\\"
+
+/*@constant char CONNECTCHAR@*/
+# define CONNECTCHAR   '\\'
+
+# define HASALTCONNECTCHAR
+
+/*@constant char ALTCONNECTCHAR@*/
+# define ALTCONNECTCHAR '/'
+
+/* Directory separator character for search list. */
+
+/*@constant char PATH_SEPARATOR; @*/
+# define PATH_SEPARATOR ';'
+
+#else
+/* Connection string inserted between directory and filename to make a  */
+/* full path name.                                                     */
+
+/*@constant observer char *CONNECTSTR@*/
+# define CONNECTSTR    "/"
+
+/*@constant char CONNECTCHAR; @*/
+# define CONNECTCHAR   '/'
+
+/* Directory separator character for search list. */
+/*@constant char PATH_SEPARATOR; @*/
+# define PATH_SEPARATOR ':'
+
+#endif
+
+
+# ifdef P_tmpdir
+
+# if defined(OS2) && defined(__IBMC__)
+/*@constant observer char *DEFAULT_TMPDIR; @*/
+# define DEFAULT_TMPDIR "."
+# else
+/*@constant observer char *DEFAULT_TMPDIR; @*/
+# define DEFAULT_TMPDIR P_tmpdir
+# endif
+# else
+# ifdef WIN32
+/*@constant observer char *DEFAULT_TMPDIR; @*/
+# define DEFAULT_TMPDIR "\\WINDOWS\\TEMP\\"
+# else
+/*@constant observer char *DEFAULT_TMPDIR; @*/
+# define DEFAULT_TMPDIR "/tmp/"
+# endif /* WIN32 */
+
+# endif /* P_tmpdir */
+
+# else
+# error "Multiple include"
+# endif
+
+
 # else
 # error "Multiple include"
 # endif
This page took 0.050214 seconds and 4 git commands to generate.