Merged common utility versions with those in recoll. Keep them identical in the future and make maintenance easier

Jean-Francois Dockes Jean-Francois Dockes 2016-03-22

added sc2src/smallut.h
added sc2src/pathut.cpp
added sc2src/pathut.h
added sc2src/smallut.cpp
changed sc2src/config.h.in
changed sc2src/conftree.cpp
changed sc2src/conftree.h
changed Makefile.am
copied README.asc -> sc2src/conf_post.h
sc2src/smallut.h Diff Switch to side-by-side view
Loading...
sc2src/pathut.cpp Diff Switch to side-by-side view
Loading...
sc2src/pathut.h Diff Switch to side-by-side view
Loading...
sc2src/smallut.cpp Diff Switch to side-by-side view
Loading...
sc2src/config.h.in Diff Switch to side-by-side view
Loading...
sc2src/conftree.cpp Diff Switch to side-by-side view
Loading...
sc2src/conftree.h Diff Switch to side-by-side view
Loading...
Makefile.am Diff Switch to side-by-side view
Loading...
README.asc to sc2src/conf_post.h
--- a/README.asc
+++ b/sc2src/conf_post.h
@@ -1,33 +1,67 @@
-== sc2mpd: Linn Songcast to Linux gateway
 
-The sc2mpd package implements two gateways between Linn Songcast and Linux
-systems, acting either as Receiver as Sender
+/* Copyright (C) 2016 J.F.Dockes
+ *   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 2 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, write to the
+ *   Free Software Foundation, Inc.,
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
 
-The 2 commands in the package are based on the Linn Open Source libraries,
-for which the package provides an extraction and build script.
+// conf_post: manual part included by auto-generated config.h. Avoid
+// being clobbered by autoheader, and undefine some problematic
+// symbols.
 
-link:http://www.lesbonscomptes.com/upmpdcli/sc2mpd.html[More information]
+// Get rid of macro names which could conflict with other package's
+#if defined(SC2SRC_NEED_PACKAGE_VERSION) && \
+    !defined(SC2SRC_PACKAGE_VERSION_DEFINED)
+#define SC2SRC_PACKAGE_VERSION_DEFINED
+static const char *SC2SRC_PACKAGE_VERSION = PACKAGE_VERSION;
+#endif
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_URL
+#undef PACKAGE_VERSION
 
-== sc2mpd
+#define HAVE_CXX0X_UNORDERED
+#define HAVE_SHARED_PTR_STD
+// upmpdcli: requires c++0x but we still need the defs for c++
+// versions below because of execmd et al.
 
-*sc2mpd* implements a gateway for playing a Linn Songcast audio stream on
-Linux.
+#ifdef  HAVE_CXX0X_UNORDERED
+#  define UNORDERED_MAP_INCLUDE <unordered_map>
+#  define UNORDERED_SET_INCLUDE <unordered_set>
+#  define STD_UNORDERED_MAP std::unordered_map
+#  define STD_UNORDERED_SET std::unordered_set
+#elif defined(HAVE_TR1_UNORDERED)
+#  define UNORDERED_MAP_INCLUDE <tr1/unordered_map>
+#  define UNORDERED_SET_INCLUDE <tr1/unordered_set>
+#  define STD_UNORDERED_MAP std::tr1::unordered_map
+#  define STD_UNORDERED_SET std::tr1::unordered_set
+#else
+#  define UNORDERED_MAP_INCLUDE <map>
+#  define UNORDERED_SET_INCLUDE <set>
+#  define STD_UNORDERED_MAP std::map
+#  define STD_UNORDERED_SET std::set
+#endif
 
-It can work in two modes, either by forwarding the stream to MPD (using
-HTTP), or using ALSA directly to play the stream. The latter method is
-preferred because it allows adjusting the sample rate to match the source.
-
-It is designed to work with
-link:http://www.lesbonscomptes.com/upmpdcli[upmpdcli], with with it
-provides a Songcast _Receiver_ interface (hopefully) usable from any
-Songcast _Sender_ such as the Windows or Mac OS X Linn Songcast
-applications.
-
-
-== mpd2sc
-
-*mpd2sc* implements a gateway for sending a Linux audio stream to Songcast.
-
-It can works in two slightly different modes, reading mpd output from a
-fido, or reading an ALSA input channel. In both cases, the interface is
-provided by *upmpdcli*.
+#ifdef HAVE_SHARED_PTR_STD
+#  define MEMORY_INCLUDE <memory>
+#  define STD_SHARED_PTR    std::shared_ptr
+#elif defined(HAVE_SHARED_PTR_TR1)
+#  define MEMORY_INCLUDE <tr1/memory>
+#  define STD_SHARED_PTR    std::tr1::shared_ptr
+#else
+#  define MEMORY_INCLUDE "refcntr.h"
+#  define STD_SHARED_PTR    RefCntr
+#endif