Merge tag 'upstream/1.8.5'
Upstream version 1.8.5
Stephan Sürken
7 years ago
0 | 2016-08-06 Stephan Sürken <absurd@olurdix.de> | |
1 | ||
2 | [ui-auto-release run by absurd@weslok.olx.intra]: News for 1.8.5. | |
3 | ||
4 | configure.ac: Prepare 1.8.5. | |
5 | ||
6 | 2016-08-06 Stephan Sürken <absurd@olurdix.de> | |
7 | ||
8 | tools/GetOpt.cpp: Don't print build time in getopt example. | |
9 | With -Wdate-time, this warns about it might not be reproducible code. | |
10 | ||
11 | While that is not quite true anymore (gcc nowadays honors | |
12 | SOURCE_DATE_EPOCH for this), it might still be a problem for older gcc | |
13 | or other compilers. It also does not make so much sense anyway in the | |
14 | example for '--version'. | |
15 | ||
16 | 2016-08-06 Stephan Sürken <absurd@olurdix.de> | |
17 | ||
18 | Add 'ui-utilcpp/auto_ptr_compat.hpp': "Reimplementing" auto_ptr compat (fixes include of ui-utilcpp/Text.hpp). | |
19 | As this is partly needed in include files/API, local "config.h" will not | |
20 | work. Having an actual include will also make this (re-)usable in other | |
21 | projects. | |
22 | ||
23 | auto_ptr compat: To be on the safe side, use namespace UI::Util (not UI). | |
24 | ||
0 | 25 | 2016-08-05 Stephan Sürken <absurd@olurdix.de> |
26 | ||
27 | [ui-auto-release run by absurd@weslok.olx.intra]: ChangeLog updated from version control. | |
1 | 28 | |
2 | 29 | [ui-auto-release run by absurd@weslok.olx.intra]: News for 1.8.4. |
3 | 30 |
2 | 2 | |
3 | 3 | Downloads: |
4 | 4 | o Generic: http://sourceforge.net/projects/ui-utilcpp/files//ui-utilcpp |
5 | o Current: http://sourceforge.net/projects/ui-utilcpp/files//ui-utilcpp/stable/ui-utilcpp-1.8.4.tar.gz | |
5 | o Current: http://sourceforge.net/projects/ui-utilcpp/files//ui-utilcpp/stable/ui-utilcpp-1.8.5.tar.gz | |
6 | 6 | ================================================================ |
7 | ui-utilcpp-1.8.5 (stable) (Sat, 06 Aug 2016 17:12:38 +0000): | |
8 | ||
9 | Patched stable release. | |
10 | ||
11 | Changes since 1.8.4: | |
12 | ||
13 | Stephan Sürken (4): | |
14 | * [4d06b10] auto_ptr compat: To be on the safe side, use | |
15 | namespace UI::Util (not UI). | |
16 | * [634d630] Add 'ui-utilcpp/auto_ptr_compat.hpp': | |
17 | "Reimplementing" auto_ptr compat (fixes include of | |
18 | ui-utilcpp/Text.hpp). | |
19 | * [9e6e6c6] tools/GetOpt.cpp: Don't print build time in getopt | |
20 | example. | |
21 | * [3d51d36] configure.ac: Prepare 1.8.5. | |
22 | ---------------------------------------------------------------- | |
7 | 23 | ui-utilcpp-1.8.4 (stable) (Fri, 05 Aug 2016 13:59:37 +0000): |
8 | 24 | |
9 | 25 | Patched stable release. |
99 | 99 | /* Define to 1 if strerror_r returns char *. */ |
100 | 100 | #undef STRERROR_R_CHAR_P |
101 | 101 | |
102 | ||
103 | #include <memory> | |
104 | namespace UI { | |
105 | #if __cplusplus >= 201103L | |
106 | template <typename T> | |
107 | using auto_ptr = std::unique_ptr<T>; | |
108 | #else | |
109 | using std::auto_ptr; | |
110 | #endif | |
111 | } | |
112 | ||
113 | ||
114 | 102 | /* Version number of package */ |
115 | 103 | #undef VERSION |
116 | 104 |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for ui-utilcpp 1.8.4. | |
2 | # Generated by GNU Autoconf 2.69 for ui-utilcpp 1.8.5. | |
3 | 3 | # |
4 | 4 | # |
5 | 5 | # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. |
586 | 586 | # Identity of this package. |
587 | 587 | PACKAGE_NAME='ui-utilcpp' |
588 | 588 | PACKAGE_TARNAME='ui-utilcpp' |
589 | PACKAGE_VERSION='1.8.4' | |
590 | PACKAGE_STRING='ui-utilcpp 1.8.4' | |
589 | PACKAGE_VERSION='1.8.5' | |
590 | PACKAGE_STRING='ui-utilcpp 1.8.5' | |
591 | 591 | PACKAGE_BUGREPORT='' |
592 | 592 | PACKAGE_URL='' |
593 | 593 | |
1346 | 1346 | # Omit some internal or obsolete options to make the list less imposing. |
1347 | 1347 | # This message is too long to be a string in the A/UX 3.1 sh. |
1348 | 1348 | cat <<_ACEOF |
1349 | \`configure' configures ui-utilcpp 1.8.4 to adapt to many kinds of systems. | |
1349 | \`configure' configures ui-utilcpp 1.8.5 to adapt to many kinds of systems. | |
1350 | 1350 | |
1351 | 1351 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1352 | 1352 | |
1417 | 1417 | |
1418 | 1418 | if test -n "$ac_init_help"; then |
1419 | 1419 | case $ac_init_help in |
1420 | short | recursive ) echo "Configuration of ui-utilcpp 1.8.4:";; | |
1420 | short | recursive ) echo "Configuration of ui-utilcpp 1.8.5:";; | |
1421 | 1421 | esac |
1422 | 1422 | cat <<\_ACEOF |
1423 | 1423 | |
1535 | 1535 | test -n "$ac_init_help" && exit $ac_status |
1536 | 1536 | if $ac_init_version; then |
1537 | 1537 | cat <<\_ACEOF |
1538 | ui-utilcpp configure 1.8.4 | |
1538 | ui-utilcpp configure 1.8.5 | |
1539 | 1539 | generated by GNU Autoconf 2.69 |
1540 | 1540 | |
1541 | 1541 | Copyright (C) 2012 Free Software Foundation, Inc. |
2176 | 2176 | This file contains any messages produced by compilers while |
2177 | 2177 | running configure, to aid debugging if configure makes a mistake. |
2178 | 2178 | |
2179 | It was created by ui-utilcpp $as_me 1.8.4, which was | |
2179 | It was created by ui-utilcpp $as_me 1.8.5, which was | |
2180 | 2180 | generated by GNU Autoconf 2.69. Invocation command line was |
2181 | 2181 | |
2182 | 2182 | $ $0 $@ |
3043 | 3043 | |
3044 | 3044 | # Define the identity of the package. |
3045 | 3045 | PACKAGE='ui-utilcpp' |
3046 | VERSION='1.8.4' | |
3046 | VERSION='1.8.5' | |
3047 | 3047 | |
3048 | 3048 | |
3049 | 3049 | cat >>confdefs.h <<_ACEOF |
16627 | 16627 | ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
16628 | 16628 | ac_compiler_gnu=$ac_cv_cxx_compiler_gnu |
16629 | 16629 | |
16630 | ||
16631 | # auto_ptr compat | |
16632 | # - C++14 deprecates 'auto_ptr' in favor of 'unique_ptr' [and gcc6 does ugly warnings]. | |
16633 | # - std::unique_ptr is available since C++11, so we use it then. | |
16634 | # - While compat is still needed, use 'UI::auto_ptr' in-code. | |
16635 | # - When removing this compat, just bulk-replace 'UI::auto_ptr' with 'std::unique_ptr' in-code. */ | |
16636 | ||
16637 | ||
16638 | 16630 | # Check whether --enable-largefile was given. |
16639 | 16631 | if test "${enable_largefile+set}" = set; then : |
16640 | 16632 | enableval=$enable_largefile; |
18174 | 18166 | # report actual input values of CONFIG_FILES etc. instead of their |
18175 | 18167 | # values after options handling. |
18176 | 18168 | ac_log=" |
18177 | This file was extended by ui-utilcpp $as_me 1.8.4, which was | |
18169 | This file was extended by ui-utilcpp $as_me 1.8.5, which was | |
18178 | 18170 | generated by GNU Autoconf 2.69. Invocation command line was |
18179 | 18171 | |
18180 | 18172 | CONFIG_FILES = $CONFIG_FILES |
18240 | 18232 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
18241 | 18233 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
18242 | 18234 | ac_cs_version="\\ |
18243 | ui-utilcpp config.status 1.8.4 | |
18235 | ui-utilcpp config.status 1.8.5 | |
18244 | 18236 | configured by $0, generated by GNU Autoconf 2.69, |
18245 | 18237 | with options \\"\$ac_cs_config\\" |
18246 | 18238 |
0 | AC_INIT([ui-utilcpp], [1.8.4]) | |
0 | AC_INIT([ui-utilcpp], [1.8.5]) | |
1 | 1 | |
2 | 2 | dnl See DEVELOPERS file for shared library versioning instructions |
3 | 3 | dnl INTERFACE:REVISION:AGE |
45 | 45 | # check for dl lib |
46 | 46 | # All symbolic libs are linked with |
47 | 47 | AC_LANG_PUSH(C++) |
48 | ||
49 | # auto_ptr compat | |
50 | # - C++14 deprecates 'auto_ptr' in favor of 'unique_ptr' [and gcc6 does ugly warnings]. | |
51 | # - std::unique_ptr is available since C++11, so we use it then. | |
52 | # - While compat is still needed, use 'UI::auto_ptr' in-code. | |
53 | # - When removing this compat, just bulk-replace 'UI::auto_ptr' with 'std::unique_ptr' in-code. */ | |
54 | AH_VERBATIM( | |
55 | [TINCAS_ADDONS], | |
56 | [ | |
57 | #include <memory> | |
58 | namespace UI { | |
59 | #if __cplusplus >= 201103L | |
60 | template <typename T> | |
61 | using auto_ptr = std::unique_ptr<T>; | |
62 | #else | |
63 | using std::auto_ptr; | |
64 | #endif | |
65 | } | |
66 | ]) | |
67 | ||
68 | 48 | AC_SYS_LARGEFILE |
69 | 49 | AC_CHECK_HEADER(dlfcn.h,, [ AC_MSG_ERROR(error: libdl include file dlfcn.h not found.)]) |
70 | 50 | AC_CHECK_LIB(dl, dlopen,, [ AC_MSG_ERROR(Failed to detect libdl.)]) |
8 | 8 | #include <cassert> |
9 | 9 | |
10 | 10 | // C++ library |
11 | #include <ui-utilcpp/auto_ptr_compat.hpp> | |
11 | 12 | #include <ui-utilcpp/Socket.hpp> |
12 | 13 | #include <ui-utilcpp/Thread.hpp> |
13 | 14 | |
59 | 60 | { |
60 | 61 | if (argc < 3) { throw UI::Exception("Wrong usage"); }; |
61 | 62 | |
62 | UI::auto_ptr<UI::Util::Socket> socket((std::strcmp(argv[1], "unix") == 0) ? | |
63 | (UI::Util::Socket *) new UI::Util::UnixSocket(unSock, true) : | |
64 | (UI::Util::Socket *) new UI::Util::INetSocket(inHost, inPort, true, true)); | |
63 | UI::Util::auto_ptr<UI::Util::Socket> socket((std::strcmp(argv[1], "unix") == 0) ? | |
64 | (UI::Util::Socket *) new UI::Util::UnixSocket(unSock, true) : | |
65 | (UI::Util::Socket *) new UI::Util::INetSocket(inHost, inPort, true, true)); | |
65 | 66 | |
66 | 67 | std::strcmp(argv[2], "server") == 0 ? server(*socket.get()) : client(*socket.get()); |
67 | 68 | } |
30 | 30 | } |
31 | 31 | else if (getOpt.get("version")->isGiven()) |
32 | 32 | { |
33 | std::cout << "Release : " << PACKAGE << "-" << VERSION << "." << std::endl << std::endl; | |
34 | std::cout << "Build time: " << __DATE__ << " " << __TIME__ << "." << std::endl; | |
33 | std::cout << "Release: " << PACKAGE << "-" << VERSION << "." << std::endl << std::endl; | |
35 | 34 | } |
36 | 35 | else if (getOpt.get("help")->isGiven()) |
37 | 36 | { |
22 | 22 | Time.hpp \ |
23 | 23 | Cap.hpp \ |
24 | 24 | \ |
25 | Http.hpp Shortcuts.hpp | |
25 | Http.hpp Shortcuts.hpp \ | |
26 | \ | |
27 | auto_ptr_compat.hpp | |
26 | 28 | |
27 | 29 | lib_LTLIBRARIES = libui-utilcpp.la |
28 | 30 | libui_utilcpp_la_SOURCES = \ |
403 | 403 | Time.hpp \ |
404 | 404 | Cap.hpp \ |
405 | 405 | \ |
406 | Http.hpp Shortcuts.hpp | |
406 | Http.hpp Shortcuts.hpp \ | |
407 | \ | |
408 | auto_ptr_compat.hpp | |
407 | 409 | |
408 | 410 | lib_LTLIBRARIES = libui-utilcpp.la |
409 | 411 | libui_utilcpp_la_SOURCES = \ |
12 | 12 | #include <cc++/url.h> |
13 | 13 | |
14 | 14 | // Local |
15 | #include "auto_ptr_compat.hpp" | |
15 | 16 | #include "Exception.hpp" |
16 | 17 | #include "Text.hpp" |
17 | 18 | #include "Misc.hpp" |
594 | 595 | |
595 | 596 | std::string Recoder::run(char const * const buf, size_t const bufSize) const |
596 | 597 | { |
597 | UI::auto_ptr<Conversion const> conv(make(buf, bufSize)); | |
598 | UI::Util::auto_ptr<Conversion const> conv(make(buf, bufSize)); | |
598 | 599 | return conv->getString(); |
599 | 600 | } |
600 | 601 | |
601 | 602 | std::string Recoder::run(char const * const src) const |
602 | 603 | { |
603 | UI::auto_ptr<Conversion const> conv(make(src)); | |
604 | UI::Util::auto_ptr<Conversion const> conv(make(src)); | |
604 | 605 | return conv->getString(); |
605 | 606 | } |
606 | 607 | |
607 | 608 | std::string Recoder::run(std::string const & src) const |
608 | 609 | { |
609 | UI::auto_ptr<Conversion const> conv(make(src.c_str(), src.size())); | |
610 | UI::Util::auto_ptr<Conversion const> conv(make(src.c_str(), src.size())); | |
610 | 611 | return conv->getString(); |
611 | 612 | } |
612 | 613 |
281 | 281 | return ret; |
282 | 282 | } |
283 | 283 | |
284 | UI::auto_ptr<unsigned char> XConversion::xorEncrypt(std::string const& message, std::string const& key, int* length) | |
284 | UI::Util::auto_ptr<unsigned char> XConversion::xorEncrypt(std::string const& message, std::string const& key, int* length) | |
285 | 285 | { |
286 | 286 | unsigned char* result=0; |
287 | 287 | int keyLen = key.size(); |
296 | 296 | if (j>=keyLen) j=0; |
297 | 297 | } |
298 | 298 | *length=i; |
299 | return UI::auto_ptr<unsigned char>(result); | |
299 | return UI::Util::auto_ptr<unsigned char>(result); | |
300 | 300 | } |
301 | 301 | |
302 | 302 | std::string XConversion::xorDecrypt(const unsigned char* message, const int length, std::string const& key) { |
353 | 353 | return std::string(result.str()); |
354 | 354 | } |
355 | 355 | |
356 | UI::auto_ptr<unsigned char> XConversion::base64Decode(std::string const& message, int* length) { | |
356 | UI::Util::auto_ptr<unsigned char> XConversion::base64Decode(std::string const& message, int* length) { | |
357 | 357 | |
358 | 358 | int ix = 0; |
359 | 359 | |
387 | 387 | } |
388 | 388 | } |
389 | 389 | } |
390 | return UI::auto_ptr<unsigned char>(result); | |
390 | return UI::Util::auto_ptr<unsigned char>(result); | |
391 | 391 | } |
392 | 392 | |
393 | 393 | std::string md5sum(std::string const & data) |
16 | 16 | #include <cerrno> |
17 | 17 | |
18 | 18 | // C++ libraries |
19 | #include <ui-utilcpp/auto_ptr_compat.hpp> | |
19 | 20 | #include <ui-utilcpp/Exception.hpp> |
20 | 21 | #include <boost/random.hpp> |
21 | 22 | |
365 | 366 | * |
366 | 367 | * @returns the encrypted message (binary) |
367 | 368 | */ |
368 | static UI::auto_ptr<unsigned char> xorEncrypt(std::string const& message, std::string const& key, int* length); | |
369 | static UI::Util::auto_ptr<unsigned char> xorEncrypt(std::string const& message, std::string const& key, int* length); | |
369 | 370 | |
370 | 371 | /** |
371 | 372 | * decrypt a message using xor and the given key |
398 | 399 | * |
399 | 400 | * @returns number decoded chars |
400 | 401 | */ |
401 | static UI::auto_ptr<unsigned char> base64Decode(std::string const& message, int* length); | |
402 | static UI::Util::auto_ptr<unsigned char> base64Decode(std::string const& message, int* length); | |
402 | 403 | }; |
403 | 404 | |
404 | 405 | std::string md5sum(std::string const & data); |
0 | /** | |
1 | * @file | |
2 | * @brief auto_ptr compat | |
3 | * | |
4 | * - C++14 deprecates 'auto_ptr' in favor of 'unique_ptr' [and gcc6 does ugly warnings]. | |
5 | * - std::unique_ptr is available since C++11, so we use it then. | |
6 | * - While compat is still needed, use 'UI::Util::auto_ptr' in-code. | |
7 | * - When removing this compat, just bulk-replace 'UI::Util::auto_ptr' with 'std::unique_ptr' in-code. | |
8 | */ | |
9 | #ifndef UI_UTIL_AUTO_PTR_COMPAT_HPP | |
10 | #define UI_UTIL_AUTO_PTR_COMPAT_HPP | |
11 | ||
12 | // STDC++ | |
13 | #include <memory> | |
14 | ||
15 | namespace UI { | |
16 | namespace Util { | |
17 | ||
18 | #if __cplusplus >= 201103L | |
19 | template <typename T> | |
20 | using auto_ptr = std::unique_ptr<T>; | |
21 | #else | |
22 | using std::auto_ptr; | |
23 | #endif | |
24 | ||
25 | }} | |
26 | ||
27 | #endif |