Reorganized source tree. Moved client.cpp into cmd/synergy as

synergy.cpp and server.cpp into cmd/synergyd as synergyd.cpp.
Moved and renamed related files.  Moved remaining source files
into lib/....  Modified and added makefiles as appropriate.
Result is that library files are under lib with each library
in its own directory and program files are under cmd with each
command in its own directory.
This commit is contained in:
crs
2002-07-30 16:52:46 +00:00
parent 9792d35a6b
commit fee4095624
201 changed files with 367 additions and 375 deletions

View File

@@ -0,0 +1,58 @@
#include "COutputPacketStream.h"
//
// COuputPacketStream
//
COutputPacketStream::COutputPacketStream(IOutputStream* stream, bool adopt) :
COutputStreamFilter(stream, adopt)
{
// do nothing
}
COutputPacketStream::~COutputPacketStream()
{
// do nothing
}
void
COutputPacketStream::close()
{
getStream()->close();
}
UInt32
COutputPacketStream::write(const void* buffer, UInt32 count)
{
// write the length of the payload
UInt8 length[4];
length[0] = (UInt8)((count >> 24) & 0xff);
length[1] = (UInt8)((count >> 16) & 0xff);
length[2] = (UInt8)((count >> 8) & 0xff);
length[3] = (UInt8)( count & 0xff);
UInt32 count2 = sizeof(length);
const UInt8* cbuffer = length;
while (count2 > 0) {
UInt32 n = getStream()->write(cbuffer, count2);
cbuffer += n;
count2 -= n;
}
// write the payload
count2 = count;
cbuffer = reinterpret_cast<const UInt8*>(buffer);
while (count2 > 0) {
UInt32 n = getStream()->write(cbuffer, count2);
cbuffer += n;
count2 -= n;
}
return count;
}
void
COutputPacketStream::flush()
{
getStream()->flush();
}