]> OCCT Git - occt-wok.git/commitdiff
No comments
authorcas <cas@opencascade.com>
Tue, 31 Jul 2001 17:44:49 +0000 (17:44 +0000)
committercas <cas@opencascade.com>
Tue, 31 Jul 2001 17:44:49 +0000 (17:44 +0000)
src/WOKUnix/WOKUnix_FDescr.cxx
src/WOKUnix/WOKUnix_FileBuffer.cxx
src/WOKUnix/WOKUnix_Path.cxx
src/WOKUnix/WOKUnix_Process.cxx
src/WOKUnix/WOKUnix_RemoteShell.cxx
src/WOKUnix/WOKUnix_Shell.cxx
src/WOKUnix/WOKUnix_Signal.cxx
src/WOKUnix/WOKUnix_regexp_1.c

index 665fa205cc11d81cf0b59bfe56eb1455cadc3147..5d974df63cc83a82a55fb58b99079d1094cd218a 100755 (executable)
@@ -1,16 +1,30 @@
 #ifndef WNT
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
 #include <sys/stat.h>
 
+#ifdef HAVE_SYS_FILIO_H
+# include <sys/filio.h>
+#endif
+
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif
 
-#ifdef SOLARIS
-#include <sys/filio.h>
-#else 
-#include <sys/ioctl.h>
+#if defined(HAVE_SYS_VNODE_H) && defined(__FreeBSD__) 
+# include <sys/vnode.h>
 #endif
+
 #include <fcntl.h>
 
 #include <WOKUnix_FDescr.ixx>
@@ -27,9 +41,9 @@ extern int errno;
 
 const OSD_WhoAmI Iam = OSD_WFile;
 
-#ifdef LIN
+#ifdef __GNUC__
 static FILE* _wokunix_fdopen ( int );
-#endif  // LIN
+#endif  // __GNUC__
 
 //=======================================================================
 //function : WOKUnix_FDescr
@@ -46,11 +60,11 @@ WOKUnix_FDescr::WOKUnix_FDescr()
 //=======================================================================
 WOKUnix_FDescr::WOKUnix_FDescr(const Standard_Integer afd) {
  myFileChannel = afd;
-#ifndef LIN
+#ifndef __GNUC__
  myFILE = fdopen(afd, "r");
 #else
  myFILE = _wokunix_fdopen ( afd );
-#endif  // LIN
+#endif  // __GNUC__
 }
 
 //=======================================================================
@@ -60,11 +74,11 @@ WOKUnix_FDescr::WOKUnix_FDescr(const Standard_Integer afd) {
 WOKUnix_FDescr::WOKUnix_FDescr(const Standard_Integer afd, const Handle(TCollection_HAsciiString)& apath)
 {
   myFileChannel = afd;
-#ifndef LIN
+#ifndef __GNUC__
   myFILE = fdopen(afd, "r");
 #else
   myFILE = _wokunix_fdopen ( afd );
-#endif  // LIN
+#endif  // __GNUC__
  SetPath(apath->String());
 }
 
@@ -114,7 +128,11 @@ Standard_Integer WOKUnix_FDescr::GetNbToRead()
 //=======================================================================
 void WOKUnix_FDescr::SetUnBuffered()  
 {
+#ifdef __FreeBSD__
+  if(fcntl(myFileChannel, F_SETFL, O_ASYNC) < 0)
+#else
   if(fcntl(myFileChannel, F_SETFL, O_SYNC) < 0)
+#endif
     {
       Perror();
       return;
@@ -405,7 +423,7 @@ WOKUnix_FDescr WOKUnix_FDescr::Stderr()
   return StderrFD;
 }
 
-#ifdef LIN
+#ifdef __GNUC__
 static FILE* _wokunix_fdopen ( int fd ) {
 
  char* fdMode = "r";
@@ -434,6 +452,6 @@ static FILE* _wokunix_fdopen ( int fd ) {
  return retVal;
 
 }  // end _wokunix_fdopen
-#endif  // LIN
+#endif  // __GNUC__
 
-#endif
+#endif // WNT
index e52fa7ff51b028223761f038b8722bbd1d4d4b18..761f371ddaf1ad3df6957e80c8c4cfa0970ffc93 100755 (executable)
@@ -1,6 +1,5 @@
 #ifndef WNT
 
-
 #include <OSD_Environment.hxx>
 #include <OSD_Path.hxx>
 
@@ -87,16 +86,16 @@ Handle(TColStd_HSequenceOfHAsciiString)  WOKUnix_FileBuffer::Echo()
 //=======================================================================
 void WOKUnix_FileBuffer::Acquit(const Standard_Integer astatus, const WOKUnix_FDSet& aset)  
 {
-#ifndef LIN
+#ifndef __GNUC__
   Standard_Integer nbtoread = GetFDescr().GetNbToRead();
-#endif  // LIN
-#if defined( WOK_VERBOSE ) && !defined( LIN )
+#endif  // __GNUC__
+#if defined( WOK_VERBOSE ) && !defined( __GNUC__ )
   VerboseMsg("WOK_PROCESS") << "WOKUnix_FileBuffer::Acquit"
                             << "There is " << nbtoread << " bytes to read on process output" << endm;
 #endif
-#ifndef LIN
+#ifndef __GNUC__
   if(nbtoread >= MAX_PIPE_SIZE)
-#endif  // LIN
+#endif  // __GNUC__
     {    
       Dump();
     }
@@ -156,4 +155,4 @@ void WOKUnix_FileBuffer::Close()
   if( apath.Name().IsEmpty() != Standard_True && mybuffer.FileNo() >= 0) mybuffer.Close();
   WOKUnix_Buffer::Close();
 }
-#endif
+#endif // WNT
index d2b3e9129121406db46b5eba9a6b7f460fcbfa2d..ccbd581e23b5bf50cd5e438c1f457920cfff28c1 100755 (executable)
@@ -3,14 +3,20 @@
 // Created:    Tue May 30 09:17:00 1995
 // Author:     Jean GAUTIER
 //             <jga@cobrax>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
 
 #include <sys/types.h>
-#include <unistd.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
-#include <unistd.h>
 
 #include <WOKUnix_Path.ixx>
 
@@ -406,7 +412,7 @@ Handle(WOKUnix_Path) WOKUnix_Path::ReducedPath() const
 
   if(Exists())
     {
-#if !defined(DECOSF1) && !defined(HPUX)
+#if !defined(__osf__) && !defined(DECOSF1) && !defined(__hpux) && !defined(HPUX)
 
       char abuffer[PATH_MAX];
 
index 7419a77e52d857f9de0a4b32f7a5acb529eb57dd..dd6caf68221d02c98797614df9b17860c0f9e36a 100755 (executable)
@@ -1,25 +1,41 @@
 #ifndef WNT
 
-#ifdef IRIX
-#include <unistd.h>
-#include <sys/types.h>
-#include <bstring.h>
-#include <sys/time.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
 #endif
 
-#ifdef HPUX
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
 #endif
 
-#ifdef AIX
-#include <strings.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_BSTRING_H
+# include <bstring.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
 #endif
 
-#include <unistd.h>
-#include <sys/wait.h>
-#include <signal.h>
 #include <errno.h>
 #include <stdio.h>
 
index 7636ecb95ce02f580a38a4423c82cefa080a8f88..65da04d8aa4a732b1f3e7d0a557354c5878bced6 100755 (executable)
@@ -4,21 +4,32 @@
 // Author:     Jean GAUTIER
 //             <jga@cobrax>
 
-#ifdef IRIX
-#include <unistd.h>
-#include <sys/types.h>
-#include <bstring.h>
-#include <sys/time.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
 #endif
 
-#ifdef HPUX
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
 #endif
 
-#ifdef AIX
-#include <strings.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_BSTRING_H
+# include <bstring.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
 #endif
 
 #include <stdio.h>
@@ -156,13 +167,4 @@ Handle(TCollection_HAsciiString) WOKUnix_RemoteShell::Password() const
   return mypassword;
 }
 
-
-
-
-
-
-
-
-
-
 #endif
index feb06d79385780637547641926c13daf3f1e1e62..0896d0f79fb08342b6bf5811b424bcd19f2ae1e1 100755 (executable)
@@ -1,20 +1,31 @@
 #ifndef WNT
 
-#ifdef IRIX
-#include <unistd.h>
-#include <sys/types.h>
-#include <bstring.h>
-#include <sys/time.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
 #endif
 
-#ifdef HPUX
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/time.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
 #endif
 
-#ifdef AIX
-#include <strings.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#ifdef HAVE_BSTRING_H
+# include <bstring.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
 #endif
 
 #include <fstream.h>
@@ -444,5 +455,4 @@ Handle(TCollection_HAsciiString) WOKUnix_Shell::Host() const
   return myhost;
 }
 
-
 #endif
index d9c70e021b8e0068e54e196069639ba061f0b3ee..a539189e044edffef23bfc1152b6d77f23a3124b 100755 (executable)
@@ -1,4 +1,7 @@
 #ifndef WNT
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
 
 #include <WOKUnix_Signal.ixx>
 
 #include <signal.h>
 #include <stdio.h>
 
-#ifdef LIN
+#ifdef HAVE_BITS_SIGSET_H
 #include <bits/sigset.h>
-#include <signal.h>
-#elif !defined(HPUX)  && !defined(AIX)
+#endif
+
+#ifdef HAVE_SIGINFO_H
 #include <siginfo.h>
 #endif
 
@@ -62,13 +66,12 @@ void WOKUnix_Signal::Arm(const WOKUnix_SigHandler& ahandler)
     {
       act.sa_handler =  (WOKUnix_SigHandler) ahandler;
     }
-#ifdef SOLARIS
+#if defined(__sun) || defined(__sgi)
   act.sa_mask.__sigbits[0]    = 0;
   act.sa_mask.__sigbits[1]    = 0;
   act.sa_mask.__sigbits[2]    = 0;
   act.sa_mask.__sigbits[3]    = 0;
-  act.sa_flags                = SA_RESTART;
-#elif HPUX
+#elif defined(__hpux)
   act.sa_mask.sigset[0]    = 0;
   act.sa_mask.sigset[1]    = 0;
   act.sa_mask.sigset[2]    = 0;
@@ -77,24 +80,20 @@ void WOKUnix_Signal::Arm(const WOKUnix_SigHandler& ahandler)
   act.sa_mask.sigset[5]    = 0;
   act.sa_mask.sigset[6]    = 0;
   act.sa_mask.sigset[7]    = 0;
-  act.sa_flags   = 0;
-#elif IRIX
-  act.sa_mask.__sigbits[0]      = 0;
-  act.sa_mask.__sigbits[1]      = 0;
-  act.sa_mask.__sigbits[2]      = 0;
-  act.sa_mask.__sigbits[3]      = 0;
-  act.sa_flags             = 0;
-#elif defined(LIN)
+#elif defined(__FreeBSD__)
+  act.sa_mask.__bits[0]    = 0;
+  act.sa_mask.__bits[1]    = 0;
+  act.sa_mask.__bits[2]    = 0;
+  act.sa_mask.__bits[3]    = 0;
+#elif defined(linux)
   sigemptyset(&act.sa_mask) ;
-  act.sa_flags   = 0;
-#elif defined(AIX)
+#elif defined(_AIX)
   act.sa_mask.losigs   = 0;
   act.sa_mask.hisigs   = 0;
-  act.sa_flags                = 0;
- #else
+#else
   act.sa_mask    = 0;
-  act.sa_flags   = 0;
 #endif
+  act.sa_flags   = 0;
 
   //==== Always detected the signal "SIGFPE" =================================
   stat = sigaction(WOKUnix_Signal::GetSig(mysig),&act,&oact);   // ...... floating point exception 
@@ -127,7 +126,11 @@ int WOKUnix_Signal::GetSig(const WOKUnix_Signals asig)
     case WOKUnix_SIGKILL  : return SIGKILL;
     case WOKUnix_SIGBUS   : return SIGBUS;
     case WOKUnix_SIGSEGV  : return SIGSEGV;
+#if defined(SIGCLD)
     case WOKUnix_SIGCHILD : return SIGCLD;
+#elif defined(SIGCHLD)
+    case WOKUnix_SIGCHILD : return SIGCHLD;
+#endif
     }
  return 0;
 }
index 3aabdd20444d4767049522fef299258efce2256a..ed89a41c05253e3520ded9025e4276be6ac29ebc 100755 (executable)
@@ -1,3 +1,6 @@
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
 /******************************************************************************/
 /* Extended regular expression matching and search.                           */
 /* Copyright (C) 1985 Free Software Foundation, Inc.                          */
@@ -27,7 +30,7 @@
 
 /* JGA : to compile on Solaris */
 
-#if !defined(HPUX) && !defined (WNT) && !defined (AIX)
+#ifdef HAVE_ALLOCA_H
 #include <alloca.h>
 
 #else