Codebase list ui-utilcpp / 9d9a722
Merge tag 'upstream/1.8.5' Upstream version 1.8.5 Stephan Sürken 7 years ago
13 changed file(s) with 105 addition(s) and 68 deletion(s). Raw diff Collapse all Expand all
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
025 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.
128
229 [ui-auto-release run by absurd@weslok.olx.intra]: News for 1.8.4.
330
22
33 Downloads:
44 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
66 ================================================================
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 ----------------------------------------------------------------
723 ui-utilcpp-1.8.4 (stable) (Fri, 05 Aug 2016 13:59:37 +0000):
824
925 Patched stable release.
9999 /* Define to 1 if strerror_r returns char *. */
100100 #undef STRERROR_R_CHAR_P
101101
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
114102 /* Version number of package */
115103 #undef VERSION
116104
00 #! /bin/sh
11 # 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.
33 #
44 #
55 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
586586 # Identity of this package.
587587 PACKAGE_NAME='ui-utilcpp'
588588 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'
591591 PACKAGE_BUGREPORT=''
592592 PACKAGE_URL=''
593593
13461346 # Omit some internal or obsolete options to make the list less imposing.
13471347 # This message is too long to be a string in the A/UX 3.1 sh.
13481348 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.
13501350
13511351 Usage: $0 [OPTION]... [VAR=VALUE]...
13521352
14171417
14181418 if test -n "$ac_init_help"; then
14191419 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:";;
14211421 esac
14221422 cat <<\_ACEOF
14231423
15351535 test -n "$ac_init_help" && exit $ac_status
15361536 if $ac_init_version; then
15371537 cat <<\_ACEOF
1538 ui-utilcpp configure 1.8.4
1538 ui-utilcpp configure 1.8.5
15391539 generated by GNU Autoconf 2.69
15401540
15411541 Copyright (C) 2012 Free Software Foundation, Inc.
21762176 This file contains any messages produced by compilers while
21772177 running configure, to aid debugging if configure makes a mistake.
21782178
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
21802180 generated by GNU Autoconf 2.69. Invocation command line was
21812181
21822182 $ $0 $@
30433043
30443044 # Define the identity of the package.
30453045 PACKAGE='ui-utilcpp'
3046 VERSION='1.8.4'
3046 VERSION='1.8.5'
30473047
30483048
30493049 cat >>confdefs.h <<_ACEOF
1662716627 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1662816628 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
1662916629
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
1663816630 # Check whether --enable-largefile was given.
1663916631 if test "${enable_largefile+set}" = set; then :
1664016632 enableval=$enable_largefile;
1817418166 # report actual input values of CONFIG_FILES etc. instead of their
1817518167 # values after options handling.
1817618168 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
1817818170 generated by GNU Autoconf 2.69. Invocation command line was
1817918171
1818018172 CONFIG_FILES = $CONFIG_FILES
1824018232 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1824118233 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1824218234 ac_cs_version="\\
18243 ui-utilcpp config.status 1.8.4
18235 ui-utilcpp config.status 1.8.5
1824418236 configured by $0, generated by GNU Autoconf 2.69,
1824518237 with options \\"\$ac_cs_config\\"
1824618238
0 AC_INIT([ui-utilcpp], [1.8.4])
0 AC_INIT([ui-utilcpp], [1.8.5])
11
22 dnl See DEVELOPERS file for shared library versioning instructions
33 dnl INTERFACE:REVISION:AGE
4545 # check for dl lib
4646 # All symbolic libs are linked with
4747 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
6848 AC_SYS_LARGEFILE
6949 AC_CHECK_HEADER(dlfcn.h,, [ AC_MSG_ERROR(error: libdl include file dlfcn.h not found.)])
7050 AC_CHECK_LIB(dl, dlopen,, [ AC_MSG_ERROR(Failed to detect libdl.)])
88 #include <cassert>
99
1010 // C++ library
11 #include <ui-utilcpp/auto_ptr_compat.hpp>
1112 #include <ui-utilcpp/Socket.hpp>
1213 #include <ui-utilcpp/Thread.hpp>
1314
5960 {
6061 if (argc < 3) { throw UI::Exception("Wrong usage"); };
6162
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));
6566
6667 std::strcmp(argv[2], "server") == 0 ? server(*socket.get()) : client(*socket.get());
6768 }
3030 }
3131 else if (getOpt.get("version")->isGiven())
3232 {
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;
3534 }
3635 else if (getOpt.get("help")->isGiven())
3736 {
2222 Time.hpp \
2323 Cap.hpp \
2424 \
25 Http.hpp Shortcuts.hpp
25 Http.hpp Shortcuts.hpp \
26 \
27 auto_ptr_compat.hpp
2628
2729 lib_LTLIBRARIES = libui-utilcpp.la
2830 libui_utilcpp_la_SOURCES = \
403403 Time.hpp \
404404 Cap.hpp \
405405 \
406 Http.hpp Shortcuts.hpp
406 Http.hpp Shortcuts.hpp \
407 \
408 auto_ptr_compat.hpp
407409
408410 lib_LTLIBRARIES = libui-utilcpp.la
409411 libui_utilcpp_la_SOURCES = \
1212 #include <cc++/url.h>
1313
1414 // Local
15 #include "auto_ptr_compat.hpp"
1516 #include "Exception.hpp"
1617 #include "Text.hpp"
1718 #include "Misc.hpp"
594595
595596 std::string Recoder::run(char const * const buf, size_t const bufSize) const
596597 {
597 UI::auto_ptr<Conversion const> conv(make(buf, bufSize));
598 UI::Util::auto_ptr<Conversion const> conv(make(buf, bufSize));
598599 return conv->getString();
599600 }
600601
601602 std::string Recoder::run(char const * const src) const
602603 {
603 UI::auto_ptr<Conversion const> conv(make(src));
604 UI::Util::auto_ptr<Conversion const> conv(make(src));
604605 return conv->getString();
605606 }
606607
607608 std::string Recoder::run(std::string const & src) const
608609 {
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()));
610611 return conv->getString();
611612 }
612613
281281 return ret;
282282 }
283283
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)
285285 {
286286 unsigned char* result=0;
287287 int keyLen = key.size();
296296 if (j>=keyLen) j=0;
297297 }
298298 *length=i;
299 return UI::auto_ptr<unsigned char>(result);
299 return UI::Util::auto_ptr<unsigned char>(result);
300300 }
301301
302302 std::string XConversion::xorDecrypt(const unsigned char* message, const int length, std::string const& key) {
353353 return std::string(result.str());
354354 }
355355
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) {
357357
358358 int ix = 0;
359359
387387 }
388388 }
389389 }
390 return UI::auto_ptr<unsigned char>(result);
390 return UI::Util::auto_ptr<unsigned char>(result);
391391 }
392392
393393 std::string md5sum(std::string const & data)
1616 #include <cerrno>
1717
1818 // C++ libraries
19 #include <ui-utilcpp/auto_ptr_compat.hpp>
1920 #include <ui-utilcpp/Exception.hpp>
2021 #include <boost/random.hpp>
2122
365366 *
366367 * @returns the encrypted message (binary)
367368 */
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);
369370
370371 /**
371372 * decrypt a message using xor and the given key
398399 *
399400 * @returns number decoded chars
400401 */
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);
402403 };
403404
404405 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