git-svn-id: svn://db.shs.com.ru/pip@597 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2018-02-12 12:20:15 +00:00
parent da48575caa
commit 6c51e8edf3
43 changed files with 204 additions and 164 deletions

View File

@@ -26,7 +26,7 @@
#include "picrc.h"
#include "pidiagnostics.h"
class PIBaseTransfer: public PIObject
class PIP_EXPORT PIBaseTransfer: public PIObject
{
PIOBJECT_SUBCLASS(PIBaseTransfer, PIObject)
public:
@@ -34,7 +34,7 @@ public:
~PIBaseTransfer();
# pragma pack(push,1)
struct PacketHeader {
struct PIP_EXPORT PacketHeader {
uint sig;
int type; // PacketType
int session_id;
@@ -43,7 +43,7 @@ public:
bool check_sig() {return (sig == signature);}
};
struct Part {
struct PIP_EXPORT Part {
Part(uint id_ = 0, ullong size_ = 0, ullong start_ = 0) : id(id_), size(size_), start(start_) {}
uint id;
ullong size;
@@ -102,10 +102,10 @@ protected:
llong bytes_all, bytes_cur;
private:
enum PacketType {pt_Unknown, pt_Data, pt_ReplySuccess, pt_ReplyInvalid, pt_Break, pt_Start, pt_Pause};
enum PIP_EXPORT PacketType {pt_Unknown, pt_Data, pt_ReplySuccess, pt_ReplyInvalid, pt_Break, pt_Start, pt_Pause};
# pragma pack(push,1)
struct StartRequest {
struct PIP_EXPORT StartRequest {
uint packets;
ullong size;
};

View File

@@ -33,7 +33,7 @@ static const uchar binlog_sig[] = {'B','I','N','L','O','G'};
/// TODO: Create static functions to join binlog files
/// TODO: Create functions to insert and delete records
class PIBinaryLog: public PIIODevice
class PIP_EXPORT PIBinaryLog: public PIIODevice
{
PIIODEVICE(PIBinaryLog)
public:

View File

@@ -282,7 +282,7 @@ public:
//! Returns if Device pool works in fake mode
static bool isFakeMode();
class DevicePool: public PIThread {
class PIP_EXPORT DevicePool: public PIThread {
PIOBJECT_SUBCLASS(DevicePool, PIThread)
friend void __DevicePool_threadReadDP(void * ddp);
friend class PIConnection;
@@ -302,7 +302,7 @@ public:
PIVector<PIIODevice * > boundedDevices(const PIConnection * parent) const;
protected:
struct DeviceData {
struct PIP_EXPORT DeviceData {
DeviceData(): dev(0), rthread(0), started(false) {}
~DeviceData();
PIIODevice * dev;
@@ -372,14 +372,14 @@ private:
PIString devFPath(const PIIODevice * d) const;
PIIODevice * devByString(const PIString & s) const;
struct Extractor {
struct PIP_EXPORT Extractor {
Extractor(): extractor(0) {}
~Extractor();
PIPacketExtractor * extractor;
PIVector<PIIODevice * > devices;
};
class Sender: public PITimer {
class PIP_EXPORT Sender: public PITimer {
PIOBJECT_SUBCLASS(Sender, PIObject)
public:
Sender(PIConnection * parent_ = 0): parent(parent_), int_(0.f) {needLockRun(true);}
@@ -414,7 +414,7 @@ void __DevicePool_threadReadDP(void * ddp);
extern PIConnection::DevicePool * __device_pool__;
class __DevicePoolContainer__ {
class PIP_EXPORT __DevicePoolContainer__ {
public:
__DevicePoolContainer__();
static bool inited_;

View File

@@ -25,7 +25,7 @@
#include "pibasetransfer.h"
class PIDataTransfer: public PIBaseTransfer
class PIP_EXPORT PIDataTransfer: public PIBaseTransfer
{
PIOBJECT_SUBCLASS(PIDataTransfer, PIBaseTransfer)
public:

View File

@@ -212,7 +212,10 @@ private:
uint cnt_fail;
bool empty;
};
friend bool operator ==(const PIDiagnostics::Entry & f, const PIDiagnostics::Entry & s);
friend bool operator !=(const PIDiagnostics::Entry & f, const PIDiagnostics::Entry & s);
friend bool operator <(const PIDiagnostics::Entry & f, const PIDiagnostics::Entry & s);
void tick(void *, int);
Entry calcHistory(PIQueue<Entry> & hist, int & cnt);
void propertyChanged(const PIString &);
@@ -226,4 +229,14 @@ private:
};
inline bool operator ==(const PIDiagnostics::Entry & f, const PIDiagnostics::Entry & s) {
return f.bytes_ok == s.bytes_ok &&
f.bytes_fail == s.bytes_fail &&
f.cnt_ok == s.cnt_ok &&
f.cnt_fail == s.cnt_fail &&
f.empty == s.empty;
}
inline bool operator !=(const PIDiagnostics::Entry & f, const PIDiagnostics::Entry & s) {return !(f == s);}
inline bool operator <(const PIDiagnostics::Entry & f, const PIDiagnostics::Entry & s) {return f.bytes_ok < s.bytes_ok;}
#endif // PIDIAGNOSTICS_H

View File

@@ -53,9 +53,15 @@
# define _fseek_call_ fseek
# define _ftell_call_ ftell
# else
# define _fopen_call_ fopen64
# define _fseek_call_ fseeko64
# define _ftell_call_ ftello64
# ifdef CC_GCC
# define _fopen_call_ fopen64
# define _fseek_call_ fseeko64
# define _ftell_call_ ftello64
# else
# define _fopen_call_ fopen
# define _fseek_call_ fseek
# define _ftell_call_ ftell
# endif
# endif
# define _stat_struct_ struct stat64
# define _stat_call_ stat64

View File

@@ -34,10 +34,10 @@ public:
//! Constructs an empty file
explicit PIFile();
struct FileInfo {
struct PIP_EXPORT FileInfo {
FileInfo() {size = 0; id_group = id_user = 0;}
enum Flag {
enum PIP_EXPORT Flag {
File = 0x01,
Dir = 0x02,
Dot = 0x04,
@@ -46,7 +46,7 @@ public:
Hidden = 0x20
};
typedef PIFlags<FileInfo::Flag> Flags;
struct Permissions {
struct PIP_EXPORT Permissions {
Permissions(uchar r = 0): raw(r) {}
Permissions(bool r, bool w, bool e): raw(0) {read = r; write = w; exec = e;}
PIString toString() const {return PIString(read ? "r" : "-") + PIString(write ? "w" : "-") + PIString(exec ? "x" : "-");}

View File

@@ -28,22 +28,22 @@
#define __PIFILETRANSFER_VERSION 2
class PIFileTransfer: public PIBaseTransfer
class PIP_EXPORT PIFileTransfer: public PIBaseTransfer
{
PIOBJECT_SUBCLASS(PIFileTransfer, PIBaseTransfer)
public:
PIFileTransfer();
~PIFileTransfer();
enum StepType {pft_None, pft_Description, pft_Data};
enum PIP_EXPORT StepType {pft_None, pft_Description, pft_Data};
struct PFTFileInfo: public PIFile::FileInfo {
struct PIP_EXPORT PFTFileInfo: public PIFile::FileInfo {
PFTFileInfo(const PIFile::FileInfo &fi = PIFile::FileInfo()): PIFile::FileInfo(fi) {}
PIString dest_path;
};
#pragma pack(push,1)
struct PFTHeader {
struct PIP_EXPORT PFTHeader {
union {
struct {
char sig[3]; // PFT