aboutsummaryrefslogtreecommitdiff
path: root/src/fifo.cpp
diff options
context:
space:
mode:
authorDavid <david@xagasoft.com>2010-02-04 21:37:00 +0000
committerDavid <david@xagasoft.com>2010-02-04 21:37:00 +0000
commit1f29dc180b5a86ddf2115f97ad410e0e9b1beb4b (patch)
treebd4236dd6ffb7e7ca19eb3611e3c57e8f1ef924e /src/fifo.cpp
parent81b7d806028bd484e2765cbc57b9677544bf52b2 (diff)
downloadlibbu++-1f29dc180b5a86ddf2115f97ad410e0e9b1beb4b.tar.gz
libbu++-1f29dc180b5a86ddf2115f97ad410e0e9b1beb4b.tar.bz2
libbu++-1f29dc180b5a86ddf2115f97ad410e0e9b1beb4b.tar.xz
libbu++-1f29dc180b5a86ddf2115f97ad410e0e9b1beb4b.zip
david - Made a build-M3 file for building to windows (mingw). This one actually builds *.cpp, yay!... Although i took out Process, Plugger, and Regex... to be re-added later... also had to stubify a few more functions when compiling on WIN32.
Diffstat (limited to 'src/fifo.cpp')
-rw-r--r--src/fifo.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/fifo.cpp b/src/fifo.cpp
index 1bbab37..eaf1705 100644
--- a/src/fifo.cpp
+++ b/src/fifo.cpp
@@ -12,6 +12,8 @@
12#include <fcntl.h> 12#include <fcntl.h>
13#include <unistd.h> 13#include <unistd.h>
14 14
15#include "win32_compatibility.h"
16
15namespace Bu { subExceptionDef( FifoException ) } 17namespace Bu { subExceptionDef( FifoException ) }
16 18
17Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) : 19Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) :
@@ -19,6 +21,7 @@ Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) :
19 iIn( -1 ), 21 iIn( -1 ),
20 iOut( -1 ) 22 iOut( -1 )
21{ 23{
24#ifndef WIN32
22 if( iFlags&Create ) 25 if( iFlags&Create )
23 { 26 {
24 if( mkfifo( sName.getStr(), mAcc ) ) 27 if( mkfifo( sName.getStr(), mAcc ) )
@@ -40,6 +43,9 @@ Bu::Fifo::Fifo( const Bu::FString &sName, int iFlags, mode_t mAcc ) :
40 O_WRONLY 43 O_WRONLY
41 ); 44 );
42 } 45 }
46#else
47 #warning Bu::Fifo::Fifo IS A STUB for WIN32!!!!
48#endif
43} 49}
44 50
45Bu::Fifo::~Fifo() 51Bu::Fifo::~Fifo()
@@ -126,15 +132,23 @@ bool Bu::Fifo::isSeekable()
126 132
127bool Bu::Fifo::isBlocking() 133bool Bu::Fifo::isBlocking()
128{ 134{
135#ifndef WIN32
129 return ((fcntl( iIn, F_GETFL, 0 )&O_NONBLOCK) == O_NONBLOCK); 136 return ((fcntl( iIn, F_GETFL, 0 )&O_NONBLOCK) == O_NONBLOCK);
137#else
138 #warning Bu::Fifo::isBlocking IS A STUB for WIN32!!!!
139#endif
130} 140}
131 141
132void Bu::Fifo::setBlocking( bool bBlocking ) 142void Bu::Fifo::setBlocking( bool bBlocking )
133{ 143{
144#ifndef WIN32
134 if( bBlocking ) 145 if( bBlocking )
135 fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )&(~O_NONBLOCK) ); 146 fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )&(~O_NONBLOCK) );
136 else 147 else
137 fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )|O_NONBLOCK ); 148 fcntl( iIn, F_SETFL, fcntl( iIn, F_GETFL, 0 )|O_NONBLOCK );
149#else
150 #warning Bu::Fifo::setBlocking IS A STUB for WIN32!!!!
151#endif
138} 152}
139 153
140void Bu::Fifo::flush() 154void Bu::Fifo::flush()