Compare commits
4 Commits
ee137b2820
...
f6b9131f4a
| Author | SHA1 | Date | |
|---|---|---|---|
| f6b9131f4a | |||
| c67f7a2b64 | |||
| 047d38ea59 | |||
| 3d07795515 |
@@ -483,8 +483,10 @@ if (NOT CROSSTOOLS)
|
||||
|
||||
# libmicrohttpd
|
||||
find_library(microhttpd_LIBRARIES microhttpd HINTS "${MINGW_LIB}")
|
||||
set(microhttpd_FOUND FALSE)
|
||||
if (microhttpd_LIBRARIES)
|
||||
set(_microhttpd_add_libs)
|
||||
set(microhttpd_FOUND TRUE)
|
||||
set(_microhttpd_add_libs microhttpd)
|
||||
if(WIN32)
|
||||
if("${C_COMPILER}" STREQUAL "cl.exe")
|
||||
else()
|
||||
@@ -494,7 +496,9 @@ if (NOT CROSSTOOLS)
|
||||
list(APPEND _microhttpd_add_libs dl)
|
||||
find_library(tls_lib gnutls)
|
||||
if (tls_lib)
|
||||
list(APPEND _microhttpd_add_libs ${tls_lib})
|
||||
set(gnutls_FOUND TRUE)
|
||||
set(gnutls_LIBRARIES "${tls_lib}")
|
||||
list(APPEND _microhttpd_add_libs gnutls)
|
||||
endif()
|
||||
if(DEFINED ENV{QNX_HOST})
|
||||
list(APPEND _microhttpd_add_libs socket)
|
||||
@@ -504,8 +508,8 @@ if (NOT CROSSTOOLS)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
list(APPEND microhttpd_LIBRARIES "${_microhttpd_add_libs}")
|
||||
pip_module(http_server "${microhttpd_LIBRARIES}" "PIP HTTP server" "" "" "")
|
||||
#list(APPEND microhttpd_LIBRARIES "${_microhttpd_add_libs}")
|
||||
pip_module(http_server "${_microhttpd_add_libs}" "PIP HTTP server" "" "" "")
|
||||
endif()
|
||||
|
||||
# Test program
|
||||
@@ -514,11 +518,15 @@ if (NOT CROSSTOOLS)
|
||||
#add_library(pip_plugin SHARED "test_plugin.h" "test_plugin.cpp" "ccm.h" "ccm.cpp")
|
||||
#target_link_libraries(pip_plugin pip)
|
||||
|
||||
add_executable(pip_test "main.cpp")
|
||||
target_link_libraries(pip_test pip pip_io_utils pip_client_server pip_http_server)
|
||||
if(sodium_FOUND)
|
||||
add_executable(pip_cloud_test "main_picloud_test.cpp")
|
||||
target_link_libraries(pip_cloud_test pip_cloud)
|
||||
if (NOT DEFINED ANDROID_PLATFORM)
|
||||
if(microhttpd_FOUND)
|
||||
add_executable(pip_test "main.cpp")
|
||||
target_link_libraries(pip_test pip pip_io_utils pip_client_server pip_http_server)
|
||||
if(sodium_FOUND)
|
||||
add_executable(pip_cloud_test "main_picloud_test.cpp")
|
||||
target_link_libraries(pip_cloud_test pip_cloud)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -563,8 +571,9 @@ endif()
|
||||
# Translations
|
||||
set(PIP_LANG)
|
||||
if (NOT CROSSTOOLS)
|
||||
pip_translation(PIP_LANG lang/pip_ru.ts)
|
||||
add_custom_target(pip_lang SOURCES "${PIP_LANG}")
|
||||
# pip_translation(PIP_LANG lang/pip_ru.ts)
|
||||
# add_custom_target(pip_lang SOURCES "${PIP_LANG}")
|
||||
file(GLOB PIP_LANG "lang/*.btf")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
1
lang/compile.bat
Normal file
1
lang/compile.bat
Normal file
@@ -0,0 +1 @@
|
||||
pip_tr --Compile -o pip_ru.btf pip_ru.ts
|
||||
BIN
lang/pip_ru.btf
Normal file
BIN
lang/pip_ru.btf
Normal file
Binary file not shown.
@@ -4,6 +4,30 @@
|
||||
#include "piliterals_time.h"
|
||||
|
||||
#include <microhttpd.h>
|
||||
// clang-format off
|
||||
#ifdef QNX
|
||||
# include <arpa/inet.h>
|
||||
# include <sys/socket.h>
|
||||
# include <sys/types.h>
|
||||
# ifdef BLACKBERRY
|
||||
# include <netinet/in.h>
|
||||
# else
|
||||
# include <sys/dcmd_io-net.h>
|
||||
# endif
|
||||
#else
|
||||
# ifdef WINDOWS
|
||||
# include <io.h>
|
||||
# include <winsock2.h>
|
||||
# include <ws2tcpip.h>
|
||||
# else
|
||||
# include <netinet/in.h>
|
||||
# include <sys/socket.h>
|
||||
# ifdef LWIP
|
||||
# include <lwip/sockets.h>
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
|
||||
struct MicrohttpdServerConnection {
|
||||
@@ -71,11 +95,14 @@ int MicrohttpdServerConnection::send_error() {
|
||||
}
|
||||
|
||||
|
||||
void log_callback(void * cls, const char * fm, va_list ap) {
|
||||
void log_callback(void * cls, const char * fmt, va_list ap) {
|
||||
MicrohttpdServer * server = (MicrohttpdServer *)cls;
|
||||
piCout << "log" << server;
|
||||
if (!server) return;
|
||||
piCout << server << fm << ap;
|
||||
char buffer[1024];
|
||||
memset(buffer, 0, 1024);
|
||||
std::vsnprintf(buffer, 1024, fmt, ap);
|
||||
piCout << buffer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1716,6 +1716,14 @@ public:
|
||||
//! \~russian Заменяет все вхождения типа "%1", "%2", ... с наименьшим значением на "v" и возвращает эту строку.
|
||||
PIString & arg(uint v, int base = 10) { return arg(PIString::fromNumber(v, base)); }
|
||||
|
||||
//! \~english Replace all occurances like "%1", "%2", ... with lowest value to "v" and returns this string.
|
||||
//! \~russian Заменяет все вхождения типа "%1", "%2", ... с наименьшим значением на "v" и возвращает эту строку.
|
||||
PIString & arg(long v, int base = 10) { return arg(PIString::fromNumber(v, base)); }
|
||||
|
||||
//! \~english Replace all occurances like "%1", "%2", ... with lowest value to "v" and returns this string.
|
||||
//! \~russian Заменяет все вхождения типа "%1", "%2", ... с наименьшим значением на "v" и возвращает эту строку.
|
||||
PIString & arg(ulong v, int base = 10) { return arg(PIString::fromNumber(v, base)); }
|
||||
|
||||
//! \~english Replace all occurances like "%1", "%2", ... with lowest value to "v" and returns this string.
|
||||
//! \~russian Заменяет все вхождения типа "%1", "%2", ... с наименьшим значением на "v" и возвращает эту строку.
|
||||
PIString & arg(llong v, int base = 10) { return arg(PIString::fromNumber(v, base)); }
|
||||
|
||||
@@ -18,6 +18,3 @@ if (DEFINED LIB)
|
||||
else()
|
||||
install(TARGETS pip_tr DESTINATION bin)
|
||||
endif()
|
||||
if (NOT CROSSTOOLS)
|
||||
add_custom_command(TARGET pip_tr POST_BUILD COMMAND "${CMAKE_COMMAND}" --build "${PIP_DLL_DIR}" --target pip_lang)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user