diff --git a/CMakeLists.txt b/CMakeLists.txt
index e5e3945d..9d2fc5c1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,5 @@
project(pip)
cmake_minimum_required(VERSION 2.6)
-#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
include(CheckFunctionExists)
@@ -178,7 +177,7 @@ if (DEFINED LIB)
#list(APPEND HDRS "pip.h.gch")
install(FILES "FindPIP.cmake" DESTINATION ${CMAKE_ROOT}/Modules)
else ()
- install(TARGETS pip DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+ install(TARGETS pip DESTINATION bin)
message(STATUS "Install to local \"bin\"")
endif ()
@@ -186,4 +185,3 @@ endif ()
add_subdirectory("utils/system_test")
add_subdirectory("utils/remote_console")
add_subdirectory("utils/code_model_generator")
-add_subdirectory("utils/system_daemon")
diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user
deleted file mode 100644
index 9b254f4d..00000000
--- a/CMakeLists.txt.user
+++ /dev/null
@@ -1,222 +0,0 @@
-
-
-
-
-
- EnvironmentId
- {948faa78-0b50-402e-a285-1bca3b08de64}
-
-
- ProjectExplorer.Project.ActiveTarget
- 0
-
-
- ProjectExplorer.Project.EditorSettings
-
- true
- false
- false
-
- Cpp
-
- CppGlobal
-
-
-
- QmlJS
-
- QmlJSGlobal
-
-
- 2
- UTF-8
- false
- 4
- false
- 80
- true
- true
- 1
- true
- false
- 0
- true
- 0
- 8
- true
- 1
- true
- true
- true
- false
-
-
-
- ProjectExplorer.Project.PluginSettings
-
-
-
- ProjectExplorer.Project.Target.0
-
- DesktopBuild
- DesktopBuild
- {3c749452-9483-442d-b011-933a1b5dac10}
- 0
- 0
- 0
-
- false
- C:/libs/pip
-
-
- -j8
-
- false
- true
- Сборка
-
- CMakeProjectManager.MakeStep
-
- 1
- Сборка
-
- ProjectExplorer.BuildSteps.Build
-
-
-
- clean
-
- true
- true
- Сборка
-
- CMakeProjectManager.MakeStep
-
- 1
- Очистка
-
- ProjectExplorer.BuildSteps.Clean
-
- 2
- false
-
- all
-
- CMakeProjectManager.CMakeBuildConfiguration
-
- 1
-
-
- 0
- Установка
-
- ProjectExplorer.BuildSteps.Deploy
-
- 1
- Локальная установка
-
- ProjectExplorer.DefaultDeployConfiguration
-
- 1
-
-
- pip_test
-
- false
-
- 2
-
- pip_test
-
- CMakeProjectManager.CMakeRunConfiguration.pip_test
- 3768
- false
- true
- false
- false
- true
-
-
- pip_system_test
-
- false
-
- 2
-
- pip_system_test
-
- CMakeProjectManager.CMakeRunConfiguration.pip_system_test
- 3768
- false
- true
- false
- false
- true
-
-
- pip_remote_console
-
- false
-
- 2
-
- pip_remote_console
-
- CMakeProjectManager.CMakeRunConfiguration.pip_remote_console
- 3768
- false
- true
- false
- false
- true
-
-
- pip_cmg
-
- false
-
- 2
-
- pip_cmg
-
- CMakeProjectManager.CMakeRunConfiguration.pip_cmg
- 3768
- false
- true
- false
- false
- true
-
-
- pisd
-
- true
-
- 2
-
- pisd
-
- CMakeProjectManager.CMakeRunConfiguration.pisd
- 3768
- false
- true
- false
- false
- true
-
- 5
-
-
-
- ProjectExplorer.Project.TargetCount
- 1
-
-
- ProjectExplorer.Project.Updater.FileVersion
- 16
-
-
- Version
- 16
-
-
diff --git a/FindPIP.cmake b/FindPIP.cmake
index 0347577f..78a1831d 100644
--- a/FindPIP.cmake
+++ b/FindPIP.cmake
@@ -47,7 +47,7 @@ macro (pip_code_model SRC RESULT)
endif ()
if (NEED_PARSE)
message(STATUS "Creating code model based on \"${SRC}\", please wait ... ")
- execute_process(COMMAND ${PIP_CMG} -qPEs -o ${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${SRC} OUTPUT_VARIABLE CMG_OUT)
+ execute_process(COMMAND ${PIP_CMG} -qP -o ${PROJECT_NAME}_ccm -I${PIP_INCLUDES} ${SRC} OUTPUT_VARIABLE CMG_OUT)
message(STATUS "Creating code model done, to use it include \"${PROJECT_NAME}_ccm.h\"")
string(REPLACE "\n" ";" CMG_LIST ${CMG_OUT})
string(REPLACE "\n" " " CMG_LIST_S ${CMG_OUT})
diff --git a/main.cpp b/main.cpp
index 67f01f74..2d242303 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1,17 +1,19 @@
#include "pip.h"
+#include "pifiletransfer.h"
+#include "pidatatransfer.h"
class Ob: public PIObject {
PIOBJECT(Ob)
public:
Ob() {
sft.setName("sft");
- sft.setDirectory(sft.directory().cd("..\\"));
- piCout << "Send File Transfer DIrectory" << sft.directory().absolutePath();
+ //sft.setDirectory(sft.directory().cd("..\\"));
+ //piCout << "Send File Transfer DIrectory" << sft.directory().absolutePath();
CONNECTU(&sft, sendRequest, this, ssend);
rft.setName("rft");
- rft.setDirectory(rft.directory().cd("..\\1"));
- piCout << "Receive File Transfer DIrectory" << rft.directory().absolutePath();
+ //rft.setDirectory(rft.directory().cd("..\\1"));
+ //piCout << "Receive File Transfer DIrectory" << rft.directory().absolutePath();
CONNECTU(&rft, sendRequest, this, rsend);
}
@@ -19,12 +21,12 @@ public:
PIDir dir = PIDir::current();
dir.cd("..\\");
piCout << dir.absolutePath();
- PIVector des = dir.allEntries();
+ PIVector des = dir.allEntries();
piCout << "all entries" << des.size();
- PIDir::DirEntry sde;
- piForeachC(PIDir::DirEntry de, des) {
+ PIFile::FileInfo sde;
+ piForeachC(PIFile::FileInfo de, des) {
//piCout << (de.isDir() ? "dir:" : "file") << de.name << de.size;
- if (de.name == "0") sde = de;
+ if (de.name() == "0") sde = de;
}
//sft.setPacketSize(64096);
sft.send(sde);
@@ -32,21 +34,21 @@ public:
private:
EVENT_HANDLER1(void, ssend, PIByteArray &, data) {
-// piCout << "[sender]" << sft.stateString() << ". datasize =" << data.size()
-// << "(" << PIString::readableSize(sft.bytesFileCur()) << "/" << PIString::readableSize(sft.bytesFileAll()) << ", "
-// << PIString::readableSize(sft.bytesTotalCur()) << "/" << PIString::readableSize(sft.bytesTotalAll()) << ")";
+ piCout << "[sender]" << sft.stateString() << ". datasize =" << data.size()
+ << "(" << PIString::readableSize(sft.bytesFileCur()) << "/" << PIString::readableSize(sft.bytesFileAll()) << ", "
+ << PIString::readableSize(sft.bytesTotalCur()) << "/" << PIString::readableSize(sft.bytesTotalAll()) << ")";
if(rand()%100 != 90) rft.received(data);
}
EVENT_HANDLER1(void, rsend, PIByteArray &, data) {
-// piCout << "[receiver]" << rft.stateString() << ". datasize =" << data.size()
-// << "(" << PIString::readableSize(rft.bytesFileCur()) << "/" << PIString::readableSize(rft.bytesFileAll()) << ", "
-// << PIString::readableSize(rft.bytesTotalCur()) << "/" << PIString::readableSize(rft.bytesTotalAll()) << ")";
+ piCout << "[receiver]" << rft.stateString() << ". datasize =" << data.size()
+ << "(" << PIString::readableSize(rft.bytesFileCur()) << "/" << PIString::readableSize(rft.bytesFileAll()) << ", "
+ << PIString::readableSize(rft.bytesTotalCur()) << "/" << PIString::readableSize(rft.bytesTotalAll()) << ")";
if(rand()%100 != 90) sft.received(data);
}
- PIFileTransfer sft;
- PIFileTransfer rft;
+ PIBaseTransfer sft;
+ PIBaseTransfer rft;
};
@@ -98,6 +100,11 @@ private:
};
int main (int argc, char * argv[]) {
+ Ob o;
+ PITimeMeasurer tm;
+ o.startsend();
+ piCout << tm.elapsed_s();
+ return 0;
if (!(argc == 3 || argc == 4)) {
piCout << "UDPFileTransfer";
piCout << "USE: piptest [src_ip_port] [dst_ip_port] {filename}";
@@ -119,11 +126,6 @@ int main (int argc, char * argv[]) {
}
WAIT_FOR_EXIT
return 0;
-// Ob o;
-// ft.setPacketSize(65536);
-// PITimeMeasurer tm;
-// o.startsend();
-// piCout << tm.elapsed_s();
-// return 0;
+
}
diff --git a/pip.cbp b/pip.cbp
index ef30a2e9..8c31f43b 100644
--- a/pip.cbp
+++ b/pip.cbp
@@ -5,7 +5,7 @@
-
+
@@ -387,68 +387,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -490,8 +428,6 @@
-
-
@@ -542,12 +478,6 @@
-
-
-
-
-
-
@@ -590,8 +520,6 @@
-
-
@@ -638,12 +566,6 @@
-
-
-
-
-
-
@@ -656,8 +578,5 @@
-
-
-
diff --git a/src/pip.h b/src/pip.h
new file mode 100755
index 00000000..855f6910
--- /dev/null
+++ b/src/pip.h
@@ -0,0 +1,39 @@
+/*
+ PIP - Platform Independent Primitives
+ All includes
+ Copyright (C) 2014 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+*/
+
+#include "pitimer.h"
+#include "pivariant.h"
+#include "piconsole.h"
+#include "picli.h"
+#include "pievaluator.h"
+#include "pimultiprotocol.h"
+#include "picodec.h"
+#include "pisignals.h"
+#include "piobject.h"
+#include "pisystemmonitor.h"
+#include "pisysteminfo.h"
+#include "pipeer.h"
+#include "picrc.h"
+#include "pistatemachine.h"
+#include "picollection.h"
+#include "piserial.h"
+#include "pibinarylog.h"
+#include "piusb.h"
+#include "piiostring.h"
+#include "piconnection.h"
diff --git a/src/pip_export.h b/src/pip_export.h
new file mode 100755
index 00000000..4c1e544d
--- /dev/null
+++ b/src/pip_export.h
@@ -0,0 +1,35 @@
+
+#ifndef PIP_EXPORT_H
+#define PIP_EXPORT_H
+
+#ifdef PIP_STATIC_DEFINE
+# define PIP_EXPORT
+# define PIP_NO_EXPORT
+#else
+# ifndef PIP_EXPORT
+# ifdef pip_EXPORTS
+ /* We are building this library */
+# define PIP_EXPORT __attribute__((visibility("default")))
+# else
+ /* We are using this library */
+# define PIP_EXPORT __attribute__((visibility("default")))
+# endif
+# endif
+
+# ifndef PIP_NO_EXPORT
+# define PIP_NO_EXPORT __attribute__((visibility("hidden")))
+# endif
+#endif
+
+#ifndef PIP_DEPRECATED
+# define PIP_DEPRECATED __attribute__ ((__deprecated__))
+# define PIP_DEPRECATED_EXPORT PIP_EXPORT __attribute__ ((__deprecated__))
+# define PIP_DEPRECATED_NO_EXPORT PIP_NO_EXPORT __attribute__ ((__deprecated__))
+#endif
+
+#define DEFINE_NO_DEPRECATED 0
+#if DEFINE_NO_DEPRECATED
+# define PIP_NO_DEPRECATED
+#endif
+
+#endif
diff --git a/src/pip_version_str.h b/src/pip_version_str.h
new file mode 100644
index 00000000..20d8ee7e
--- /dev/null
+++ b/src/pip_version_str.h
@@ -0,0 +1 @@
+#define __PIP_VERSION_STR__ "0.4.2_alpha"
diff --git a/src/piplatform.h b/src/piplatform.h
new file mode 100644
index 00000000..36020305
--- /dev/null
+++ b/src/piplatform.h
@@ -0,0 +1,101 @@
+#ifndef PIPLATFORM_H
+#define PIPLATFORM_H
+
+#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+# define WINDOWS
+# define ARCH_BITS_32
+#endif
+#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
+# define WINDOWS
+# define ARCH_BITS_64
+#endif
+#if defined(__QNX__) || defined(__QNXNTO__)
+# define QNX
+#endif
+#ifdef __FreeBSD__
+# define FREE_BSD
+#endif
+#if defined(__APPLE__) || defined(__MACH__)
+# define MAC_OS
+#endif
+#if defined(__ANDROID__) || defined(_ANDROID_) || defined(ANDROID)
+# ifndef ANDROID
+# define ANDROID
+# endif
+#endif
+#ifndef WINDOWS
+# ifndef QNX
+# ifndef FREE_BSD
+# ifndef MAC_OS
+# ifndef ANDROID
+# define LINUX
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifndef WINDOWS
+# if defined(__LP64__) || defined(_LP64_) || defined(LP64)
+# define ARCH_BITS_64
+# else
+# define ARCH_BITS_32
+# endif
+#endif
+
+#ifdef __GNUC__
+# define CC_GCC
+# define CC_GCC_VERSION ((__GNUC__ << 8) | __GNUC_MINOR__)
+# if CC_GCC_VERSION > 0x025F // > 2.95
+# ifdef LINUX
+# define HAS_LOCALE
+# endif
+# pragma GCC diagnostic ignored "-Wpragmas"
+# pragma GCC diagnostic ignored "-Wformat"
+# pragma GCC diagnostic ignored "-Wformat-extra-args"
+# pragma GCC diagnostic ignored "-Wstrict-aliasing"
+# pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
+# endif
+# ifdef ANDROID
+# pragma GCC diagnostic ignored "-Wunused-parameter"
+# pragma GCC diagnostic ignored "-Wextra"
+# pragma GCC diagnostic ignored "-Wliteral-suffix"
+# endif
+# define DEPRECATED __attribute__((deprecated))
+#elif defined(_MSC_VER)
+# define CC_VC
+# pragma warning(disable: 4018)
+# pragma warning(disable: 4061)
+# pragma warning(disable: 4100)
+# pragma warning(disable: 4239)
+# pragma warning(disable: 4242)
+# pragma warning(disable: 4244)
+# pragma warning(disable: 4251)
+# pragma warning(disable: 4365)
+# pragma warning(disable: 4512)
+# pragma warning(disable: 4668)
+# pragma warning(disable: 4710)
+# pragma warning(disable: 4800)
+# pragma warning(disable: 4820)
+# pragma warning(disable: 4986)
+# pragma warning(disable: 4996)
+# define DEPRECATED
+# ifdef ARCH_BITS_32
+ typedef long ssize_t;
+# else
+ typedef long long ssize_t;
+# endif
+#else
+# define CC_OTHER
+# define DEPRECATED
+#endif
+
+#ifdef WINDOWS
+# ifdef CC_GCC
+# define typeof __typeof
+# endif
+#else
+# define typeof __typeof__
+#endif
+
+#endif // PIPLATFORM_H
diff --git a/src/piversion.h b/src/piversion.h
new file mode 100644
index 00000000..f39ad777
--- /dev/null
+++ b/src/piversion.h
@@ -0,0 +1,10 @@
+// 108 141 174 cmake version offset
+#ifndef PIVERSION_H
+#define PIVERSION_H
+
+#define PIP_VERSION_MAJOR 0
+#define PIP_VERSION_MINOR 4
+#define PIP_VERSION_REVISION 2
+#define PIP_VERSION_SUFFIX "_alpha"
+
+#endif // PIVERSION_H
diff --git a/test.txt b/test.txt
deleted file mode 100644
index 5e9606d8..00000000
--- a/test.txt
+++ /dev/null
@@ -1 +0,0 @@
-1234566789