wind2unix.h

00001 /* File:      wind2unix.h -- some definitions for Unix/Windows compatibility
00002 ** Author(s): kifer
00003 ** Contact:   xsb-contact@cs.sunysb.edu
00004 ** 
00005 ** Copyright (C) The Research Foundation of SUNY, 1998
00006 ** 
00007 ** XSB is free software; you can redistribute it and/or modify it under the
00008 ** terms of the GNU Library General Public License as published by the Free
00009 ** Software Foundation; either version 2 of the License, or (at your option)
00010 ** any later version.
00011 ** 
00012 ** XSB is distributed in the hope that it will be useful, but WITHOUT ANY
00013 ** WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014 ** FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for
00015 ** more details.
00016 ** 
00017 ** You should have received a copy of the GNU Library General Public License
00018 ** along with XSB; if not, write to the Free Software Foundation,
00019 ** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 **
00021 ** $Id: wind2unix.h,v 1.4 2005/01/14 18:31:54 ruim Exp $
00022 ** 
00023 */
00024 
00025 
00026 /* This stuff isn't defined in NT */
00027 #ifndef S_ISDIR
00028 #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR)
00029 #endif
00030 #ifndef S_ISREG
00031 #define S_ISREG(mode) ((mode & S_IFMT) == S_IFREG)
00032 #endif
00033 
00034 #ifndef R_OK
00035 #define R_OK_XSB 4
00036 #else
00037 #define R_OK_XSB R_OK
00038 #endif
00039 #ifndef W_OK
00040 #define W_OK_XSB 2
00041 #else
00042 #define W_OK_XSB W_OK
00043 #endif
00044 /* On NT this just tests for existence rather than execution */
00045 #ifndef X_OK
00046 #define X_OK_XSB 0
00047 #else
00048 #define X_OK_XSB X_OK
00049 #endif
00050 
00051 #ifdef WIN_NT
00052 #define snprintf   _snprintf
00053 #define fdopen     _fdopen
00054 #define popen      _popen
00055 #define pclose     _pclose
00056 #define dup        _dup
00057 #define putenv     _putenv
00058 #define dup2       _dup2
00059 #define fileno     _fileno
00060 #define unlink     _unlink
00061 #define strcasecmp _stricmp
00062 #define access     _access
00063 #endif
00064 
00065 /* The separator used between pathnames in PATH environment */
00066 #ifdef WIN_NT
00067 #define PATH_SEPARATOR ';'
00068 #else
00069 #define PATH_SEPARATOR ':'
00070 #endif

Generated on Wed Jul 26 13:30:43 2006 for XSB by  doxygen 1.4.5