diff options
| author | Fritz Elfert <felfert@to.com> | 2001-02-01 22:23:42 +0000 | 
|---|---|---|
| committer | Fritz Elfert <felfert@to.com> | 2001-02-01 22:23:42 +0000 | 
| commit | 4da48658c8f1dfbf5960bb1768dc6d154c528734 (patch) | |
| tree | a8a68ce884fe90be6cfcb7c09ba9c40ec86639f6 /lib | |
| parent | 922027d66d65c570960234d9f5c32467b487715d (diff) | |
| download | plptools-4da48658c8f1dfbf5960bb1768dc6d154c528734.tar.gz plptools-4da48658c8f1dfbf5960bb1768dc6d154c528734.tar.bz2 plptools-4da48658c8f1dfbf5960bb1768dc6d154c528734.zip | |
Added in missing plpdirent.cc
Added a small description of the KDE stuff in README
Small fixes in rfsv16 and ppsocket.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/plpdirent.cc | 66 | ||||
| -rw-r--r-- | lib/ppsocket.cc | 6 | ||||
| -rw-r--r-- | lib/ppsocket.h | 15 | ||||
| -rw-r--r-- | lib/rfsv16.cc | 2 | 
4 files changed, 72 insertions, 17 deletions
| diff --git a/lib/plpdirent.cc b/lib/plpdirent.cc new file mode 100644 index 0000000..345eac6 --- /dev/null +++ b/lib/plpdirent.cc @@ -0,0 +1,66 @@ +#include <plpdirent.h> +#include <stream.h> +#include <iomanip> + +PlpDirent::PlpDirent(const PlpDirent &e) { +	size    = e.size; +	attr    = e.attr; +	time    = e.time; +	memcpy(uid, e.uid, sizeof(uid)); +	name    = e.name; +	attrstr = e.attrstr; +} + +long PlpDirent:: +getSize() { +	return size; +} + +long PlpDirent:: +getAttr() { +	return attr; +} + +long PlpDirent:: +getUID(int uididx) { +	if ((uididx >= 0) && (uididx < 4)) +		return uid[uididx]; +	return 0; +} + +const char *PlpDirent:: +getName() { +	return name.c_str(); +} + +PsiTime PlpDirent:: +getPsiTime() { +	return time; +} + +void PlpDirent:: +setName(const char *str) { +	name = str; +} + +PlpDirent &PlpDirent:: +operator=(const PlpDirent &e) { +	size    = e.size; +	attr    = e.attr; +	time    = e.time; +	memcpy(uid, e.uid, sizeof(uid)); +	name    = e.name; +	attrstr = e.attrstr; +	return *this; +} + +ostream & +operator<<(ostream &o, const PlpDirent &e) { +	ostream::fmtflags old = o.flags(); + +	o << e.attrstr << " " << dec << setw(10) +	  << setfill(' ') << e.size << " " << e.time +	  << " " << e.name; +	o.flags(old); +	return o; +} diff --git a/lib/ppsocket.cc b/lib/ppsocket.cc index cfaa429..86ff4f4 100644 --- a/lib/ppsocket.cc +++ b/lib/ppsocket.cc @@ -504,7 +504,7 @@ bool ppsocket::  bindSocket(char *Host, int Port)  { -	// If we are already bound return FALSE but with no last error +	// If we are already bound return false but with no last error  	m_LastError = 0; @@ -542,7 +542,7 @@ bindInRange(char *Host, int Low, int High, int Retries)  {  	int port, i; -	// If we are already bound return FALSE but with no last error +	// If we are already bound return false but with no last error  	m_LastError = 0;  	if (m_Bound) {  		return (false); @@ -627,7 +627,7 @@ createSocket(void)  		return (false);  	}  	// By default set no lingering -	linger(FALSE, 0); +	linger(false, 0);  	// Return indicating success  	return (true);  } diff --git a/lib/ppsocket.h b/lib/ppsocket.h index f36344c..696ca78 100644 --- a/lib/ppsocket.h +++ b/lib/ppsocket.h @@ -1,19 +1,11 @@ -#if !defined(AFX_ppsocket_H__5611BC0C_3E39_11D1_8E4B_00805F2AB205__INCLUDED_) -#define AFX_ppsocket_H__5611BC0C_3E39_11D1_8E4B_00805F2AB205__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 +#ifndef _PPSOCKET_H_ +#define _PPSOCKET_H_  #include <unistd.h>  #include <netdb.h>  #include <sys/socket.h>  #include <arpa/inet.h> -#ifndef TRUE -#define  TRUE		-1 -#define  FALSE		0 -#endif  #define  DWORD		unsigned int  #define  SOCKET		int @@ -89,9 +81,6 @@ private:    struct sockaddr m_HostAddr, m_PeerAddr;    int m_Port;    bool   m_Bound; -#ifdef WIN32 -  OVERLAPPED m_ReadOverlapped, m_WriteOverlapped; -#endif    DWORD m_Timeout;    DWORD m_LastError;  }; diff --git a/lib/rfsv16.cc b/lib/rfsv16.cc index 26a153b..d42b270 100644 --- a/lib/rfsv16.cc +++ b/lib/rfsv16.cc @@ -573,7 +573,7 @@ sendCommand(enum commands cc, bufferStore & data)  	if (status == E_PSI_FILE_DISC) {  		reconnect();  		if (status == E_PSI_FILE_DISC) -			return FALSE; +			return false;  	}  	bool result; | 
