Checked-in updated implementation of these classes written by
Scott Mansfield. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2263 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a47165f500
commit
665b241c1a
@ -49,7 +49,7 @@
|
||||
*/
|
||||
#define CTOR_INIT_LIST \
|
||||
BArchivable( ), \
|
||||
fInitialized( B_NO_INIT ), \
|
||||
m_init( B_NO_INIT ), \
|
||||
fFamily( AF_INET ), \
|
||||
fPort( 0 ), \
|
||||
fAddress( INADDR_ANY )
|
||||
@ -70,32 +70,32 @@
|
||||
BNetAddress::BNetAddress( const char* hostname, unsigned short port )
|
||||
: CTOR_INIT_LIST
|
||||
{
|
||||
fInitialized = SetTo( hostname, port );
|
||||
m_init = SetTo( hostname, port );
|
||||
}
|
||||
|
||||
BNetAddress::BNetAddress( const struct sockaddr_in& sa )
|
||||
: CTOR_INIT_LIST
|
||||
{
|
||||
fInitialized = SetTo( sa );
|
||||
m_init = SetTo( sa );
|
||||
}
|
||||
|
||||
BNetAddress::BNetAddress( in_addr addr, int port )
|
||||
: CTOR_INIT_LIST
|
||||
{
|
||||
fInitialized = SetTo( addr, port );
|
||||
m_init = SetTo( addr, port );
|
||||
}
|
||||
|
||||
BNetAddress::BNetAddress( uint32 addr, int port )
|
||||
: CTOR_INIT_LIST
|
||||
{
|
||||
fInitialized = SetTo( addr, port );
|
||||
m_init = SetTo( addr, port );
|
||||
}
|
||||
|
||||
BNetAddress::BNetAddress( const char* hostname, const char* protocol,
|
||||
const char* service )
|
||||
: CTOR_INIT_LIST
|
||||
{
|
||||
fInitialized = SetTo( hostname, protocol, service );
|
||||
m_init = SetTo( hostname, protocol, service );
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ BNetAddress::BNetAddress( const char* hostname, const char* protocol,
|
||||
BNetAddress::BNetAddress( const BNetAddress& refparam )
|
||||
: CTOR_INIT_LIST
|
||||
{
|
||||
fInitialized = clone( refparam );
|
||||
m_init = clone( refparam );
|
||||
}
|
||||
|
||||
|
||||
@ -146,7 +146,7 @@ BNetAddress::BNetAddress( BMessage* archive )
|
||||
}
|
||||
fAddress = int32_val;
|
||||
|
||||
fInitialized = B_OK;
|
||||
m_init = B_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -175,7 +175,7 @@ BNetAddress& BNetAddress::operator=( const BNetAddress& refparam )
|
||||
BNetAddress::~BNetAddress( void )
|
||||
{
|
||||
fFamily = fPort = fAddress = 0;
|
||||
fInitialized = B_NO_INIT;
|
||||
m_init = B_NO_INIT;
|
||||
}
|
||||
|
||||
|
||||
@ -211,7 +211,7 @@ BNetAddress::~BNetAddress( void )
|
||||
*/
|
||||
status_t BNetAddress::GetAddr( char* hostname, unsigned short* port ) const
|
||||
{
|
||||
if ( fInitialized != B_OK )
|
||||
if ( m_init != B_OK )
|
||||
{
|
||||
return B_NO_INIT;
|
||||
}
|
||||
@ -258,7 +258,7 @@ status_t BNetAddress::GetAddr( char* hostname, unsigned short* port ) const
|
||||
*/
|
||||
status_t BNetAddress::GetAddr( struct sockaddr_in& sa ) const
|
||||
{
|
||||
if ( fInitialized != B_OK )
|
||||
if ( m_init != B_OK )
|
||||
{
|
||||
return B_NO_INIT;
|
||||
}
|
||||
@ -289,7 +289,7 @@ status_t BNetAddress::GetAddr( struct sockaddr_in& sa ) const
|
||||
*/
|
||||
status_t BNetAddress::GetAddr( in_addr& addr, unsigned short* port ) const
|
||||
{
|
||||
if ( fInitialized != B_OK )
|
||||
if ( m_init != B_OK )
|
||||
{
|
||||
return B_NO_INIT;
|
||||
}
|
||||
@ -315,7 +315,7 @@ status_t BNetAddress::GetAddr( in_addr& addr, unsigned short* port ) const
|
||||
*/
|
||||
status_t BNetAddress::InitCheck( void )
|
||||
{
|
||||
return ( fInitialized == B_OK ) ? B_OK : B_ERROR;
|
||||
return ( m_init == B_OK ) ? B_OK : B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@ -336,7 +336,7 @@ status_t BNetAddress::InitCheck( void )
|
||||
*/
|
||||
status_t BNetAddress::Archive( BMessage* into, bool deep ) const
|
||||
{
|
||||
if ( fInitialized != B_OK )
|
||||
if ( m_init != B_OK )
|
||||
{
|
||||
return B_NO_INIT;
|
||||
}
|
||||
@ -547,7 +547,7 @@ status_t BNetAddress::SetTo( const char* hostname, const char* protocol,
|
||||
{
|
||||
return B_ERROR;
|
||||
}
|
||||
// endservent( );
|
||||
// endservent( ); ???
|
||||
|
||||
return SetTo( hostname, ServiceEntry->s_port );
|
||||
}
|
||||
@ -566,7 +566,7 @@ status_t BNetAddress::SetTo( const char* hostname, const char* protocol,
|
||||
*/
|
||||
status_t BNetAddress::clone( const BNetAddress& RefParam )
|
||||
{
|
||||
if ( !RefParam.fInitialized )
|
||||
if ( !RefParam.m_init )
|
||||
{
|
||||
return B_NO_INIT;
|
||||
}
|
||||
@ -578,4 +578,30 @@ status_t BNetAddress::clone( const BNetAddress& RefParam )
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
/* Reserved methods, for future evolution */
|
||||
|
||||
void BNetAddress::_ReservedBNetAddressFBCCruft1()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetAddress::_ReservedBNetAddressFBCCruft2()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetAddress::_ReservedBNetAddressFBCCruft3()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetAddress::_ReservedBNetAddressFBCCruft4()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetAddress::_ReservedBNetAddressFBCCruft5()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetAddress::_ReservedBNetAddressFBCCruft6()
|
||||
{
|
||||
}
|
||||
|
||||
/*=------------------------------------------------------------------- End -=*/
|
||||
|
@ -47,7 +47,7 @@
|
||||
*/
|
||||
#define CTOR_INIT_LIST \
|
||||
BArchivable( ), \
|
||||
fInitialized( B_NO_INIT ), \
|
||||
m_init( B_NO_INIT ), \
|
||||
fData( NULL ), \
|
||||
fDataSize( 0 ), \
|
||||
fStackSize( 0 ), \
|
||||
@ -75,7 +75,7 @@
|
||||
BNetBuffer::BNetBuffer( size_t size )
|
||||
: CTOR_INIT_LIST
|
||||
{
|
||||
fInitialized = ( resize( size ) == B_OK ) ? B_OK : B_NO_INIT;
|
||||
m_init = ( resize( size ) == B_OK ) ? B_OK : B_NO_INIT;
|
||||
}
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ BNetBuffer::BNetBuffer( size_t size )
|
||||
BNetBuffer::BNetBuffer( const BNetBuffer& refparam )
|
||||
: CTOR_INIT_LIST
|
||||
{
|
||||
fInitialized = ( clone( refparam ) == B_OK ) ? B_OK : B_NO_INIT;
|
||||
m_init = ( clone( refparam ) == B_OK ) ? B_OK : B_NO_INIT;
|
||||
}
|
||||
|
||||
|
||||
@ -148,7 +148,7 @@ BNetBuffer::BNetBuffer( BMessage* archive )
|
||||
fStackSize = stackSize;
|
||||
fCapacity = capacity;
|
||||
|
||||
fInitialized = B_OK;
|
||||
m_init = B_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -167,7 +167,7 @@ BNetBuffer::~BNetBuffer( void )
|
||||
|
||||
fDataSize = fStackSize = fCapacity = 0;
|
||||
|
||||
fInitialized = B_NO_INIT;
|
||||
m_init = B_NO_INIT;
|
||||
}
|
||||
|
||||
|
||||
@ -181,7 +181,7 @@ BNetBuffer::~BNetBuffer( void )
|
||||
*/
|
||||
BNetBuffer& BNetBuffer::operator=( const BNetBuffer& refparam )
|
||||
{
|
||||
fInitialized = clone( refparam );
|
||||
m_init = clone( refparam );
|
||||
|
||||
return *this;
|
||||
}
|
||||
@ -197,7 +197,7 @@ BNetBuffer& BNetBuffer::operator=( const BNetBuffer& refparam )
|
||||
*/
|
||||
status_t BNetBuffer::InitCheck( void )
|
||||
{
|
||||
return ( fInitialized == B_OK ) ? B_OK : B_ERROR;
|
||||
return ( m_init == B_OK ) ? B_OK : B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@ -218,7 +218,7 @@ status_t BNetBuffer::InitCheck( void )
|
||||
*/
|
||||
status_t BNetBuffer::Archive( BMessage* into, bool deep ) const
|
||||
{
|
||||
if ( fInitialized != B_OK )
|
||||
if ( m_init != B_OK )
|
||||
{
|
||||
return B_NO_INIT;
|
||||
}
|
||||
@ -593,7 +593,7 @@ size_t BNetBuffer::BytesRemaining( void ) const
|
||||
*/
|
||||
status_t BNetBuffer::clone( const BNetBuffer& RefParam )
|
||||
{
|
||||
if ( !RefParam.fInitialized )
|
||||
if ( !RefParam.m_init )
|
||||
{
|
||||
return B_NO_INIT;
|
||||
}
|
||||
@ -635,7 +635,7 @@ status_t BNetBuffer::clone( const BNetBuffer& RefParam )
|
||||
*/
|
||||
status_t BNetBuffer::dpop( int32 Type, int32 Length, void* Data )
|
||||
{
|
||||
if ( fInitialized != B_OK )
|
||||
if ( m_init != B_OK )
|
||||
{
|
||||
return B_NO_INIT;
|
||||
}
|
||||
@ -751,7 +751,7 @@ status_t BNetBuffer::dpop( int32 Type, int32 Length, void* Data )
|
||||
*/
|
||||
status_t BNetBuffer::dpush( int32 Type, int32 Length, const void* Data )
|
||||
{
|
||||
if ( fInitialized != B_OK )
|
||||
if ( m_init != B_OK )
|
||||
{
|
||||
return B_NO_INIT;
|
||||
}
|
||||
@ -877,4 +877,31 @@ status_t BNetBuffer::resize( int32 NewSize, bool RegenStack )
|
||||
}
|
||||
|
||||
|
||||
/* Reserved methods, for future evolution */
|
||||
|
||||
void BNetBuffer::_ReservedBNetBufferFBCCruft1()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetBuffer::_ReservedBNetBufferFBCCruft2()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetBuffer::_ReservedBNetBufferFBCCruft3()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetBuffer::_ReservedBNetBufferFBCCruft4()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetBuffer::_ReservedBNetBufferFBCCruft5()
|
||||
{
|
||||
}
|
||||
|
||||
void BNetBuffer::_ReservedBNetBufferFBCCruft6()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/*=------------------------------------------------------------------- End -=*/
|
||||
|
Loading…
Reference in New Issue
Block a user