]> OCCT Git - occt-wok.git/commitdiff
No comments
authorcas <cas@opencascade.com>
Fri, 5 Nov 1999 18:28:10 +0000 (18:28 +0000)
committercas <cas@opencascade.com>
Fri, 5 Nov 1999 18:28:10 +0000 (18:28 +0000)
12 files changed:
src/WOKUnix/FILES
src/WOKUnix/WOKUnix_FDescr.cxx
src/WOKUnix/WOKUnix_FileBuffer.cxx
src/WOKUnix/WOKUnix_Path.cxx
src/WOKUnix/WOKUnix_PathIterator.cxx
src/WOKUnix/WOKUnix_Process.cxx
src/WOKUnix/WOKUnix_RegExp.cxx
src/WOKUnix/WOKUnix_RemoteShell.cxx
src/WOKUnix/WOKUnix_Shell.cxx
src/WOKUnix/WOKUnix_ShellStatus.cxx
src/WOKUnix/WOKUnix_Signal.cxx
src/WOKUnix/WOKUnix_regexp_1.c

index 5bcfc1d3b0853c61c8e4d545044dd76882dcd867..325ffd61b89ea8a88bab9759a80df1a9e807d016 100755 (executable)
@@ -5,7 +5,6 @@ WOKUnix_SigHandler.hxx
 WOKUnix_MaxPipeSize.hxx
 WOKUnix_regexp.h
 WOKUnix_regexp_1.c
-WOKUnix_WOKSteps.edl
 WOKUnix_CMPLRS.edl
 WOKUnix_StatBuf.hxx
 WOKUnix_Dir.hxx
index 20b913c9acf0191449e4f529cdb532f677682a87..c360f5af35e1d1b89535a51d7a94c5b1c4896add 100755 (executable)
@@ -291,9 +291,9 @@ Handle(TCollection_HAsciiString) WOKUnix_FDescr::ReadLine()
 {
   Handle(TCollection_HAsciiString) astr;
 
-  if(myFILE == NULL)
+  if(myFILE != NULL)
     {
-      TCollection_AsciiString abuf;
+      TCollection_AsciiString abuf ( 1024 );
       Standard_Integer nbread = 0;
 
       while(IsAtEnd() == Standard_False)
@@ -321,7 +321,7 @@ Handle(TCollection_HAsciiString) WOKUnix_FDescr::ReadLine()
     }
   else
     {
-      TCollection_AsciiString abuf;
+      TCollection_AsciiString abuf ( 1024 );
       Standard_Integer nbread = 0;
 
       while(GetNbToRead() != 0)
@@ -407,17 +407,11 @@ WOKUnix_FDescr WOKUnix_FDescr::Stderr()
 #ifdef LIN
 static FILE* _wokunix_fdopen ( int fd ) {
 
- char* fdMode;
- int   mode = fcntl ( fd, F_GETFL );
+ char* fdMode = "r";
+ int   mode   = fcntl ( fd, F_GETFL );
 
  switch ( mode & O_ACCMODE ) {
 
-  case O_RDONLY:
-
-   fdMode = "r";
-
-  break;
-
   case O_WRONLY:
 
    fdMode = "w";
index e32b45859be7eaaf2b151507edb3e4f819087f2b..01f0ddd8e9df3593363f237199be6e78a6a771f3 100755 (executable)
@@ -55,7 +55,6 @@ Handle(TColStd_HSequenceOfHAsciiString)  WOKUnix_FileBuffer::Echo()
   if(mybuffer.FileNo() != -1)
     {
       Handle(TColStd_HSequenceOfHAsciiString) aseq = new TColStd_HSequenceOfHAsciiString;
-      Standard_Integer nbread;
 
       mybuffer.Reset();
 
@@ -65,7 +64,11 @@ Handle(TColStd_HSequenceOfHAsciiString)  WOKUnix_FileBuffer::Echo()
 
       while(mybuffer.IsAtEnd() == Standard_False)
        {
-         aseq->Append(mybuffer.ReadLine());
+          Handle( TCollection_HAsciiString ) str = mybuffer.ReadLine ();
+
+          if (  !str.IsNull () && !str -> IsEmpty ()  )
+
+          aseq -> Append ( str );
        }
       aseq->Append(WOKUnix_Buffer::Echo());
 
@@ -83,14 +86,16 @@ Handle(TColStd_HSequenceOfHAsciiString)  WOKUnix_FileBuffer::Echo()
 //=======================================================================
 void WOKUnix_FileBuffer::Acquit(const Standard_Integer astatus, const WOKUnix_FDSet& aset)  
 {
+#ifndef LIN
   Standard_Integer nbtoread = GetFDescr().GetNbToRead();
-  
-#ifdef WOK_VERBOSE
+#endif  // LIN
+#if defined( WOK_VERBOSE ) && !defined( LIN )
   VerboseMsg("WOK_PROCESS") << "WOKUnix_FileBuffer::Acquit"
                             << "There is " << nbtoread << " bytes to read on process output" << endm;
 #endif
-
+#ifndef LIN
   if(nbtoread >= MAX_PIPE_SIZE)
+#endif  // LIN
     {    
       Dump();
     }
index 13765da93ba59305bf5132071568c5b1d9b4f4ee..c5de9e8e0c66774ecc48d717b0d07d0629176ee8 100755 (executable)
 #include <stdio.h>
 #include <unistd.h>
 
-#ifndef PATH_MAX
-#define PATH_MAX 1024
-#endif
-
 #include <WOKUnix_Path.ixx>
 
 #include <WOKTools_Messages.hxx>
 
 #include <WOKUnix_PathIterator.hxx>
 
+#ifndef PATH_MAX
+# define PATH_MAX 1024
+#endif  // end PATH_MAX
+
 //=======================================================================
 //function : WOKUnix_Path
 //purpose  : Empty Contructor
index 3614f258f347418f1a42e21013b1f41e3782d2b9..0c7fd286d799acbbc98af51f8f033732a7ba9ff4 100755 (executable)
@@ -17,7 +17,7 @@
 
 
 WOKUnix_PathIterator::WOKUnix_PathIterator(const Handle(WOKUnix_Path)& apath, const Standard_Boolean abool, const Standard_CString amask) 
-: mypath(apath), myrecflag(abool), mymask(amask)
+: mymask(amask), mypath(apath), myrecflag(abool)
 {
   TCollection_HAsciiString mask;
   mask.AssignCat(apath->Name()->ToCString());
index 0308f80d87e6190bcbb54b95944147d42b368ed2..a9cab0634f0836efd26e438279bd62dfccf4266e 100755 (executable)
@@ -16,6 +16,7 @@
 #include <sys/wait.h>
 #include <signal.h>
 #include <errno.h>
+#include <stdio.h>
 
 #include <Standard_ProgramError.hxx>
 
index 6573d66eceae9311273e53b8a72abbcf119b902d..643a096a238571b4cd29038a98c2437525424bdb 100755 (executable)
@@ -56,7 +56,7 @@ void WOKUnix_RegExp :: SetPattern (
                          const Standard_Integer aTblLen
                         ) {
 
- int     syntax;
+ int     syntax = RE_SYNTAX_AWK;
  _TCHAR* errMsg;
 
  Destroy ();
@@ -85,7 +85,7 @@ void WOKUnix_RegExp :: SetPattern (
  switch ( aSyntax ) {
  
   case WOKUnix_RESyntaxAWK:
-   syntax = RE_SYNTAX_AWK;
+  
   break;
 
   case WOKUnix_RESyntaxEGREP:
index ddd5c0c500529cafc9531322ca3c5ef21e3a9657..c5f668f01eba8c4242d7765d03e0a549133803f6 100755 (executable)
@@ -15,6 +15,8 @@
 #include <sys/param.h>
 #include <sys/time.h>
 #endif
+
+#include <stdio.h>
  
 #include <Standard_ProgramError.hxx>
 #include <WOKTools_Messages.hxx>
index 6e762c06c7ef594b6c0f2d823ca434cdaf8a940f..087e0f866a47fdbc53ffe800853b05fbbd2ab951 100755 (executable)
@@ -13,6 +13,7 @@
 #endif
 
 #include <fstream.h>
+#include <stdio.h>
 
 #include <WOKTools_Messages.hxx>
 
@@ -41,7 +42,8 @@ static  char *ShellArgv[] = {"/bin/csh", "-f", NULL};
 WOKUnix_Shell::WOKUnix_Shell(const WOKUnix_ShellMode amode,
                               const WOKUnix_PopenOutputMode outmode, 
                               const WOKUnix_PopenBufferMode bufmode) 
-:  WOKUnix_Process(3, ShellArgv, outmode, bufmode, -1),  mymode(amode), myecho(Standard_False), mylocked(Standard_False)
+:  WOKUnix_Process(3, ShellArgv, outmode, bufmode, -1), 
+    mymode(amode), mylocked(Standard_False), myecho(Standard_False)
 {
   switch(amode)
     {
@@ -66,7 +68,7 @@ WOKUnix_Shell::WOKUnix_Shell(const TCollection_AsciiString& apath,
                               const WOKUnix_ShellMode       amode,
                               const WOKUnix_PopenOutputMode outmode, 
                               const WOKUnix_PopenBufferMode bufmode) 
-:  WOKUnix_Process(3, ShellArgv, outmode, bufmode, -1),  mymode(amode), myecho(Standard_False), mylocked(Standard_False)
+:  WOKUnix_Process(3, ShellArgv, outmode, bufmode, -1),  mymode(amode), mylocked(Standard_False), myecho(Standard_False)
 {
   switch(amode)
     {
index 48fb86432fb1fc88ac18b62aed53810248af76e4..c4aaa2c15156515fd5128bf865c7fdd52abb4f8b 100755 (executable)
@@ -1,3 +1,4 @@
+#include <stdio.h>
 
 #include <WOKUnix_ShellStatus.ixx>
 
index 1be1356261e55094d647702a0e2221e33c8a5973..2aa34191d632e0416daef85543e7ad27da2dfa57 100755 (executable)
@@ -4,6 +4,7 @@
 
 #include <stdlib.h>
 #include <signal.h>
+#include <stdio.h>
 
 #ifdef LIN
 #include <bits/sigset.h>
@@ -123,4 +124,5 @@ int WOKUnix_Signal::GetSig(const WOKUnix_Signals asig)
     case WOKUnix_SIGSEGV  : return SIGSEGV;
     case WOKUnix_SIGCHILD : return SIGCLD;
     }
+ return 0;
 }
index 178fe4fa0b5a798d40c2ce8f5833c79914cf18eb..1a5b4cbdaf620f46660aa03ac31d885bfbfaa572 100755 (executable)
@@ -44,6 +44,7 @@ void *alloca(unsigned int size){return (void *)0L;}
 
 
 #include <WOKUnix_regexp.h>
+#include <stdlib.h>
 
 /***/
 /******************************************************************************/
@@ -956,6 +957,8 @@ void re_compile_fastmap ( PRE_PATTERN_BUFFER bufp ) {
      }  /* end if */
          
    break;
+
+   default: break;
        
   }  /* end switch */
 
@@ -1357,7 +1360,7 @@ int re_match_2 (
 
       d2 = string2, dend2 = regend[ regno ];  /* end of string1 => advance to string2. */
                  
-     }  /* end while
+     }  /* end while */
        
      /* At end of register contents => success */
      if ( d2 == dend2 ) break;
@@ -1679,6 +1682,8 @@ nofinalize:
 
    break;
 
+   default: break;
+
   }  /* end switch */
 
   continue; /* Successfully matched one pattern command; keep matching */