16.01.2012 - version 0.1.1

This commit is contained in:
peri4
2012-01-16 01:01:49 +04:00
parent 92691981fb
commit 8bb8287dcb
56 changed files with 65 additions and 62 deletions

2
AUTHORS.txt Normal file
View File

@@ -0,0 +1,2 @@
Pelipenko Ivan (peri4) peri4ko@gmail.com
Bychkov Andrey (blizer) wapmobil@gmail.com

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Test program
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Bit array
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Byte array
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Byte array
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Unicode char
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Command-Line Parser
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Command-Line Parser
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Text codings coder, based on "iconv"
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@
PIStringList PICodec::availableCodecs() {
exec("iconv", "-l");
exec("/usr/bin/iconv", "-l");
waitForFinish();
PIString str(readOutput());
str.cutLeft(str.find("\n "));
@@ -35,7 +35,7 @@ PIByteArray PICodec::exec_iconv(const PIString & from, const PIString & to, cons
tf.clear();
tf << str;
tf.close();
exec("iconv", ("-f=" + from), ("-t=" + to), tf.path());
exec("/usr/bin/iconv", ("-f=" + from), ("-t=" + to), tf.path());
waitForFinish();
return readOutput();
}

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Text codings coder, based on "iconv"
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Config parser
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Config parser
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Console output/input
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Console output/input
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Generic containers, based on STL
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Directory
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Directory
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Ethernet, UDP
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Ethernet, UDP
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Evaluator designed for stream computing
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Evaluator designed for stream computing
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
File
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
File
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Geometry
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Global includes
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Keyboard grabber for console
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Keyboard grabber for console
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Math
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Math
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Counter of some PIP types
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Counter of some PIP types
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Multiprotocol
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Multiprotocol
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Mutex
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Object, base class of some PIP classes, provide EVENT -> EVENT_HANDLER mechanism
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Object, base class of some PIP classes, provide EVENT -> EVENT_HANDLER mechanism
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

2
pip.h
View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
All includes
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,3 +1,3 @@
[Project]
Manager=KDevCMakeManager
Manager=
Name=pip

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Process
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -143,7 +143,7 @@ void PIProcess::run() {
cout << "[PIProcess] \"CreateProcess\" error, " << errorString() << endl;
#else
if (execve(str.c_str(), a, e) < 0)
cout << "[PIProcess] \"execvpe\" error, " << errorString() << endl;
cout << "[PIProcess] \"execve\" error, " << errorString() << endl;
} else {
msleep(1);
//cout << "wait" << endl;

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Process
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Protocol, input/output channel (COM, UDP)
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com, Bychkov Andrey wapmobil@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Protocol, input/output channel (COM, UDP)
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com, Bychkov Andrey wapmobil@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -67,9 +67,10 @@ public:
EVENT_HANDLER0(PIProtocol, void, stopReceive);
void setExpectedFrequency(float frequency); // for connection quality diagnostic
void setReceiverDevice(const PIString & device, PISerial::Speed speed, bool force = false); // for Serial
void setReceiverData(void * dataPtr, int dataSize) {this->dataPtr = (uchar * )dataPtr; this->dataSize = dataSize;}
void setReceiverData(void * dataPtr, int dataSize) {this->dataPtr = (uchar * )dataPtr; this->dataSize = dataSize; if (type_rec == PIProtocol::Serial || type_send == PIProtocol::Serial) ser->setReadData(headerPtr, headerSize, dataSize);}
void setReceiverDataHeader(void * headerPtr, int headerSize) {this->headerPtr = (uchar * )dataPtr; this->headerSize = headerSize; if (type_rec == PIProtocol::Serial || type_send == PIProtocol::Serial) ser->setReadData(headerPtr, headerSize, dataSize);}
void setReceiverAddress(const PIString & ip, int port, bool force = false); // for Ethernet
void setReceiverParameters(PIFlags<PISerial::Parameters> parameters) {if (type_send == PIProtocol::Serial) ser->setParameters(parameters);} // for Serial
void setReceiverParameters(PIFlags<PISerial::Parameters> parameters) {if (type_rec == PIProtocol::Serial || type_send == PIProtocol::Serial) ser->setParameters(parameters);} // for Serial
void setReceiveSlot(ReceiveFunc slot) {ret_func = slot;}
float expectedFrequency() const {return exp_freq;}

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
COM
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com, Bychkov Andrey wapmobil@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
COM
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com, Bychkov Andrey wapmobil@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -83,13 +83,13 @@ public:
bool init();
bool initialized() const {return fd != -1;}
void terminate();
PIByteArray lastHeader() {return mheader;}
PIByteArray internalBuffer() {return PIByteArray(sbuffer, BUFFER_SIZE);}
private:
int convertSpeed(PISerial::Speed speed);
void begin();
void run();
void end();

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Signals
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Signals
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
String
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
String
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Process resource monitor
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Process resource monitor
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Thread
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Thread
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Timer
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Timer
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Variable, Struct (simple serialization)
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
PIP - Platform Independent Primitives
Variable, Struct (simple serialization)
Copyright (C) 2011 Ivan Pelipenko peri4@rambler.ru
Copyright (C) 2011 Ivan Pelipenko peri4ko@gmail.com
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by