-ABYSS Web Server is working correctly on your system. You should now change this
-page with yours.
-
-Please include in your web pages (at least the first), the 'Powered by ABYSS'
-banner to promote the use of ABYSS.
-
-
diff --git a/libs/xmlrpc-c/config.mk.in b/libs/xmlrpc-c/config.mk.in
index b583e6e..bebfa54 100644
--- a/libs/xmlrpc-c/config.mk.in
+++ b/libs/xmlrpc-c/config.mk.in
@@ -27,16 +27,15 @@ ENABLE_LIBXML2_BACKEND = @ENABLE_LIBXML2_BACKEND@
MUST_BUILD_WININET_CLIENT = @MUST_BUILD_WININET_CLIENT@
MUST_BUILD_CURL_CLIENT = @MUST_BUILD_CURL_CLIENT@
MUST_BUILD_LIBWWW_CLIENT = @MUST_BUILD_LIBWWW_CLIENT@
+BUILD_TOOLS = @BUILD_TOOLS@
+BUILD_XMLRPC_PSTREAM = @BUILD_XMLRPC_PSTREAM@
LSOCKET = @LSOCKET@
WININET_LDADD = @WININET_LDADD@
-WININET_RPATH = @WININET_RPATH@
-WININET_WL_RPATH = @WININET_WL_RPATH@
+WININET_LIBDIR = @WININET_LIBDIR@
CURL_LDADD = @CURL_LDADD@
-CURL_RPATH = @CURL_RPATH@
-CURL_WL_RPATH = @CURL_WL_RPATH@
+CURL_LIBDIR = @CURL_LIBDIR@
LIBWWW_LDADD = @LIBWWW_LDADD@
-LIBWWW_RPATH = @LIBWWW_RPATH@
-LIBWWW_WL_RPATH = @LIBWWW_WL_RPATH@
+LIBWWW_LIBDIR = @LIBWWW_LIBDIR@
FEATURE_LIST = @FEATURE_LIST@
ABS_SRCDIR = @abs_srcdir@
PREFIX = @prefix@
@@ -164,7 +163,10 @@ MUST_BUILD_SHLIBLE = N
shlibfn = $(1:%=%.shlibdummy)
shliblefn = $(1:%=%.shlibledummy)
-ifeq ($(HOST_OS),linux-gnu)
+# HOST_OS is usually has a version number suffix, e.g. "aix5.3.0.0", so
+# we compare based on prefix.
+
+ifeq ($(patsubst linux-gnu%,linux-gnu,$(HOST_OS)),linux-gnu)
# Assume linker is GNU Compiler (gcc)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
@@ -177,20 +179,28 @@ ifeq ($(HOST_OS),linux-gnu)
CFLAGS_SHLIB=-fPIC
endif
-ifeq ($(findstring solaris,$(HOST_OS)),solaris)
+ifeq ($(patsubst solaris%,solaris,$(HOST_OS)),solaris)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = so
shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
+ # We assume Sun compiler and linker here. It isn't clear what to do
+ # about a user who uses GNU compiler and Ld instead. For that, the
+ # options should be the same as "linux-gnu" platform, above, except
+ # with NEED_WL_RPATH. If the user uses the GNU compiler but the Sun
+ # linker, it's even more complicated: we need an rpath option of the
+ # form -Wl,-R .
+
# Solaris compiler (Sun C 5.5) can't take multiple ld options as
# -Wl,-a,-b . Ld sees -a,-b in that case.
LDFLAGS_SHLIB = -Wl,-Bdynamic -Wl,-G -Wl,-h -Wl,$(SONAME)
CFLAGS_SHLIB = -Kpic
+ NEED_RPATH=yes
endif
-ifeq ($(HOST_OS),aix)
+ifeq ($(patsubst aix%,aix,$(HOST_OS)),aix)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
@@ -200,7 +210,7 @@ ifeq ($(HOST_OS),aix)
LDFLAGS_SHLIB = -qmkshrobj
endif
-ifeq ($(HOST_OS),hpux)
+ifeq ($(patsubst hpux%,hpux,$(HOST_OS)),hpux)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
@@ -210,7 +220,7 @@ ifeq ($(HOST_OS),hpux)
LDFLAGS_SHLIB: -shared -fPIC
endif
-ifeq ($(HOST_OS),osf)
+ifeq ($(patsubst osf%,osf,$(HOST_OS)),osf)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
@@ -220,7 +230,7 @@ ifeq ($(HOST_OS),osf)
LDFLAGS_SHLIB = -shared -expect_unresolved
endif
-ifeq ($(findstring netbsd,$(HOST_OS)),netbsd)
+ifeq ($(patsubst netbsd%,netbsd,$(HOST_OS)),netbsd)
SHARED_LIB_TYPE = unix
SHLIB_SUFFIX = so
MUST_BUILD_SHLIB = Y
@@ -232,7 +242,31 @@ ifeq ($(findstring netbsd,$(HOST_OS)),netbsd)
NEED_WL_RPATH=yes
endif
-ifeq ($(HOST_OS),dragonfly)
+ifeq ($(patsubst freebsd%,freebsd,$(HOST_OS)),freebsd)
+ SHARED_LIB_TYPE = unix
+ SHLIB_SUFFIX = so
+ MUST_BUILD_SHLIB = Y
+ MUST_BUILD_SHLIBLE = Y
+ shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
+ shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
+ CFLAGS_SHLIB = -fpic
+ LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
+ NEED_WL_RPATH=yes
+endif
+
+ifeq ($(findstring interix,$(HOST_OS)),interix)
+ SHARED_LIB_TYPE = unix
+ SHLIB_SUFFIX = so
+ MUST_BUILD_SHLIB = Y
+ MUST_BUILD_SHLIBLE = Y
+ shlibfn = $(1:%=%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
+ shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
+ CFLAGS_SHLIB =
+ LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
+ NEED_WL_RPATH=yes
+endif
+
+ifeq ($(patsubst dragonfly%,dragonfly,$(HOST_OS)),dragonfly)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
@@ -243,7 +277,7 @@ ifeq ($(HOST_OS),dragonfly)
LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
endif
-ifeq ($(HOST_OS),beos)
+ifeq ($(patsubst beos%,beos,$(HOST_OS)),beos)
SHARED_LIB_TYPE = unix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
@@ -253,18 +287,18 @@ ifeq ($(HOST_OS),beos)
LDFLAGS_SHLIB = -nostart
endif
-ifeq ($(patsubst darwin%, darwin, $(HOST_OS)), darwin)
- # (I once saw a system that generated 'darwin8.10.1').
+ifeq ($(patsubst darwin%,darwin,$(HOST_OS)),darwin)
SHARED_LIB_TYPE = dylib
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
SHLIB_SUFFIX = dylib
shlibfn = $(1:%=%.$(MAJ).$(MIN).$(SHLIB_SUFFIX))
shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
- LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
+ LDFLAGS_SHLIB = -dynamiclib -undefined suppress -single_module \
+ -flat_namespace $(SHLIB_CLIB)
endif
-ifeq ($(HOST_OS),irix)
+ifeq ($(patsubst irix%,irix,$(HOST_OS)),irix)
SHARED_LIB_TYPE = irix
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = Y
@@ -278,13 +312,13 @@ ifeq ($(HOST_OS),irix)
-set_version $(shell perl -e '$(VERSIONPERLPROG)') -lc
endif
-ifeq ($(HOST_OS),cygwin)
+ifeq ($(patsubst cygwin%,cygwin,$(HOST_OS)),cygwin)
SHARED_LIB_TYPE = dll
MUST_BUILD_SHLIB = Y
MUST_BUILD_SHLIBLE = N
SHLIB_SUFFIX = dll
- shlibfn = $(1:lib%=$(SHLIB_PREFIX)%.$(SHLIB_SUFFIX).$(MAJ).$(MIN))
- shliblefn = $(1:%=%.shlibledummy)
+ shlibfn = $(1:%=%.$(SHLIB_SUFFIX))
+ shliblefn = $(1:%=%.$(SHLIB_SUFFIX))
LDFLAGS_SHLIB = -shared -Wl,-soname,$(SONAME) $(SHLIB_CLIB)
endif
@@ -293,12 +327,12 @@ endif
##############################################################################
# BUILDTOOL_CC is the compiler to use to generate build tools, which we
-# will then run to build product. The typical reason this would be
+# will then run to build the product. The typical reason this would be
# different from CC is that you're cross-compiling: the product will run
# in Environment A, but you're building in Environment B, so you must
-# build the build toos for Environment B.
+# build the build tools for Environment B.
-# The cross compiling user can update Makefile.config or override
+# The cross compiling user can update config.mk or override
# BUILDTOOL_CC on a make command.
BUILDTOOL_CC = $(CC)
@@ -316,9 +350,18 @@ INSTALL_SCRIPT = $(INSTALL) -c -m 755
# PREFIX is designed to be overridden at make time if the user decides
# he doesn't like the default specified at 'configure' time.
-LIBINST_DIR = $(PREFIX)/lib
-HEADERINST_DIR = $(PREFIX)/include
-PROGRAMINST_DIR = $(PREFIX)/bin
+prefix = $(PREFIX)
+
+#datarootdir is the new Autoconf(2.60) name for datadir, which is still
+#accepted, but a warning is issued if datarootdir is not also used.
+
+exec_prefix = @exec_prefix@
+DATAROOT_DIR = @datarootdir@
+DATAINST_DIR = @datadir@
+LIBINST_DIR = @libdir@
+HEADERINST_DIR = @includedir@
+PROGRAMINST_DIR = @bindir@
+MANINST_DIR = @mandir@/man1
# DESTDIR is designed to be overridden at make time in order to relocate
# the entire install into a subdirectory.
diff --git a/libs/xmlrpc-c/configure.gnu b/libs/xmlrpc-c/configure.gnu
deleted file mode 100644
index dda9b7d..0000000
--- a/libs/xmlrpc-c/configure.gnu
+++ /dev/null
@@ -1,4 +0,0 @@
-#! /bin/sh
-srcpath=$(dirname $0 2>/dev/null ) || srcpath="."
-$srcpath/configure "$@" --disable-cplusplus --disable-wininet-client --disable-libwww-client --disable-shared --with-pic --disable-curl-client
-
diff --git a/libs/xmlrpc-c/configure.in b/libs/xmlrpc-c/configure.in
index 231a1d3..8fbe80a 100644
--- a/libs/xmlrpc-c/configure.in
+++ b/libs/xmlrpc-c/configure.in
@@ -86,10 +86,45 @@ AC_MSG_RESULT($MUST_BUILD_LIBWWW_CLIENT)
AC_SUBST(MUST_BUILD_LIBWWW_CLIENT)
+AC_ARG_ENABLE(tools,
+ [ --enable-tools Build the tools], ,
+[enable_tools=no])
+
+# The first AC_CHECK_LIB has to be in unconditional code because as a
+# side effect, it determines what the object file suffix is on this system,
+# and if it is statically present even though not actually executed, Autoconf
+# later thinks it has already computed the object file suffix and uses it
+# without computing it. This was with Autoconf 2.59
+AC_CHECK_LIB(ncurses, main, [have_libncurses=yes], [have_libncurses=no])
+AC_CHECK_LIB(readline, main, [have_libreadline=yes], [have_libreadline=no])
+
+AC_MSG_CHECKING(whether to build tools)
+
+BUILD_XMLRPC_PSTREAM=no
+
+if test $enable_tools = yes; then
+ if ! test "$MUST_BUILD_WININET_CLIENT $MUST_BUILD_CURL_CLIENT $MUST_BUILD_LIBWWW_CLIENT" = "no no no"; then
+ if test $have_libreadline = yes && test $have_libncurses = yes; then
+ BUILD_XMLRPC_PSTREAM=yes
+ fi
+ BUILD_TOOLS=yes
+ fi
+else
+ BUILD_TOOLS=$enable_tools
+fi
+
+AC_MSG_RESULT($BUILD_TOOLS)
+AC_SUBST(BUILD_TOOLS)
+
+if test $BUILD_TOOLS = yes; then
+ AC_MSG_CHECKING(whether to build the xmlrpc_pstream tool)
+ AC_MSG_RESULT($BUILD_XMLRPC_PSTREAM)
+ AC_SUBST(BUILD_XMLRPC_PSTREAM)
+fi
+
+
dnl Set up the appropriate Makefile substitutions.
-LIBXMLRPC_CLIENT_LA=libxmlrpc_client.la
-AC_SUBST(LIBXMLRPC_CLIENT_LA)
CLIENTTEST=clienttest
AC_SUBST(CLIENTTEST)
XMLRPC_CLIENT_H=xmlrpc_client.h
@@ -126,7 +161,6 @@ AC_SUBST(ENABLE_ABYSS_SERVER)
dnl Set up the appropriate Makefile substitutions.
ABYSS_SUBDIR=
-LIBXMLRPC_ABYSS_SERVER_LA=
SERVERTEST=
VALIDATEE=
XMLRPC_ABYSS_H=
@@ -134,14 +168,12 @@ SERVER=
if test x"$enable_abyss_server" != xno; then
FEATURE_LIST="abyss-server $FEATURE_LIST"
ABYSS_SUBDIR=abyss
- LIBXMLRPC_ABYSS_SERVER_LA=libxmlrpc_abyss_server.la
SERVERTEST=servertest
VALIDATEE=validatee
XMLRPC_ABYSS_H=xmlrpc_abyss.h
SERVER=server
fi
AC_SUBST(ABYSS_SUBDIR)
-AC_SUBST(LIBXMLRPC_ABYSS_SERVER_LA)
AC_SUBST(SERVERTEST)
AC_SUBST(VALIDATEE)
AC_SUBST(XMLRPC_ABYSS_H)
@@ -198,7 +230,9 @@ dnl Checks for programs.
dnl =======================================================================
AC_PROG_CC
-AC_PROG_CXX
+if test x"$enable_cplusplus" != xno; then
+ AC_PROG_CXX
+fi
dnl =======================================================================
@@ -272,6 +306,14 @@ else
fi
AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE)
+AC_CHECK_HEADERS(sys/select.h)
+if test x"$ac_cv_header_sys_select_h" = xyes; then
+ HAVE_SYS_SELECT_H_DEFINE=1
+else
+ HAVE_SYS_SELECT_H_DEFINE=0
+fi
+AC_SUBST(HAVE_SYS_SELECT_H_DEFINE)
+
AC_CHECK_HEADERS(stdarg.h, , [
AC_MSG_ERROR(stdarg.h is required to build this library)
@@ -329,7 +371,7 @@ AC_CHECK_FUNCS(setgroups)
AC_CHECK_FUNCS(asprintf)
-AC_CHECK_FUNCS(setenv)
+AC_CHECK_FUNCS(setenv strtoll strtoull strtoq strtouq __strtoll __strtoull)
dnl uclib doesn't have pselect
AC_CHECK_FUNCS(pselect)
@@ -380,22 +422,22 @@ dnl you will need to configure this way..
if test $MUST_BUILD_WININET_CLIENT = yes; then
- dnl You can control which of these gets chosen by fooling around with PATH.
+ dnl You can control which of these gets chosen by controlling PATH.
AC_PATH_PROGS(WININET_CONFIG, wininet-xmlrpc-config wininet-config, no)
if test "x$WININET_CONFIG" = "xno"; then
- AC_MSG_ERROR(wininet lib not found; see './configure --help')
+ AC_MSG_ERROR(Configure INTERNAL ERROR - first wininet-config found, then not found)
fi
dnl Get our wininet version.
dnl Adapted from a macro which called gtk-config.
AC_MSG_CHECKING(for wininet version >= 1.0.0)
- W3VER=`$WININET_CONFIG --version`
+ W3VER=$($WININET_CONFIG --version)
WININET_MAJOR=\
-`echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+$(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/')
WININET_MINOR=\
-`echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+$(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/')
WININET_MICRO=\
-`echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+$(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/')
AC_MSG_RESULT($WININET_MAJOR.$WININET_MINOR.$WININET_MICRO)
dnl Check to make sure our version is OK.
@@ -417,61 +459,44 @@ if test $MUST_BUILD_WININET_CLIENT = yes; then
fi
dnl Get the necessary CFLAGS, and merge them into our master list.
- WININET_CFLAGS="`$WININET_CONFIG --cflags`"
+ WININET_CFLAGS=$($WININET_CONFIG --cflags)
AC_SUBST(WININET_CFLAGS)
CFLAGS="$CFLAGS $WININET_CFLAGS"
dnl Get the huge list of libraries we need to link against.
- WININET_LDADD="`$WININET_CONFIG --libs`"
+ WININET_LDADD=$($WININET_CONFIG --libs)
AC_SUBST(WININET_LDADD)
- dnl Oh, such massive brain damage! Because there may be another copy
- dnl of libwww in the default dynamic loader search path, we need to
- dnl adjust the search patch manually. Just gag me with a backquote, OK?
AC_MSG_CHECKING(for wininet library directory)
- if $WININET_CONFIG --rpath-dir > /dev/null 2>&1; then
- dnl Yay! We're using our smart version of wininet.
- WININET_LIBDIR="`$WININET_CONFIG --rpath-dir`"
- else
- dnl Yawn. We're using the regular boring version.
- WININET_LIBDIR="`$WININET_CONFIG --prefix`/lib"
- fi
+ WININET_LIBDIR="$($WININET_CONFIG --prefix)/lib"
AC_MSG_RESULT($WININET_LIBDIR)
AC_SUBST(WININET_LIBDIR)
- WININET_RPATH="-rpath $WININET_LIBDIR"
- AC_SUBST(WININET_RPATH)
- WININET_WL_RPATH="-Wl,--rpath -Wl,$WININET_LIBDIR"
- AC_SUBST(WININET_WL_RPATH)
fi # MUST_BUILD_WININET_CLIENT
dnl =======================================================================
dnl Finding w3c-libwww
dnl =======================================================================
-dnl Once upon a time, we used a patched copy of libwww that needed to
-dnl co-exist with the system copy of libwww. We have some vestigal function
-dnl for keeping track of libwww's rpath, although this is no longer really
-dnl necessary.
if test $MUST_BUILD_LIBWWW_CLIENT = yes; then
- dnl First of all, locate the semi-broken libwww config program.
- dnl You can control which of these gets chosen by fooling around with PATH.
+ dnl First of all, locate the libwww config program.
+ dnl You can control which of these gets chosen by controlling PATH.
AC_PATH_PROGS(LIBWWW_CONFIG, libwww-xmlrpc-config libwww-config, no)
if test "x$LIBWWW_CONFIG" = "xno"; then
- AC_MSG_ERROR(w3c-libwww not found; see './configure --help')
+ AC_MSG_ERROR(Configure INTERNAL ERROR - first libwww-config found, then not found)
fi
dnl Get our libwww version.
dnl Adapted from a macro which called gtk-config.
AC_MSG_CHECKING(for w3c-libwww version >= 5.2.8)
- W3VER=`$LIBWWW_CONFIG --version`
+ W3VER=$($LIBWWW_CONFIG --version)
LIBWWW_MAJOR=\
-`echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+$(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/')
LIBWWW_MINOR=\
-`echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+$(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/')
LIBWWW_MICRO=\
-`echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+$(echo $W3VER|sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/')
AC_MSG_RESULT($LIBWWW_MAJOR.$LIBWWW_MINOR.$LIBWWW_MICRO)
dnl Check to make sure our version is OK.
@@ -493,78 +518,46 @@ if test $MUST_BUILD_LIBWWW_CLIENT = yes; then
fi
dnl Get the huge list of libraries we need to link against.
- LIBWWW_LDADD="`$LIBWWW_CONFIG --libs`"
+ LIBWWW_LDADD=$(LIBWWW_CONFIG --libs)
AC_SUBST(LIBWWW_LDADD)
- dnl Oh, such massive brain damage! Because there may be another copy
- dnl of libwww in the default dynamic loader search path, we need to
- dnl adjust the search patch manually. Just gag me with a backquote, OK?
AC_MSG_CHECKING(for libwww library directory)
- if $LIBWWW_CONFIG --rpath-dir > /dev/null 2>&1; then
- dnl Yay! We're using our smart version of libwww.
- LIBWWW_LIBDIR="`$LIBWWW_CONFIG --rpath-dir`"
- else
- dnl Yawn. We're using the regular boring version.
- LIBWWW_LIBDIR="`$LIBWWW_CONFIG --prefix`/lib"
- fi
+ LIBWWW_LIBDIR="$(LIBWWW_CONFIG --prefix)/lib"
AC_MSG_RESULT($LIBWWW_LIBDIR)
AC_SUBST(LIBWWW_LIBDIR)
- # Some ancient rpath stuff, now disabled. I turned this off because it
- # breaks Debian (and Mandrake?) policy, and we don't use it anymore.
- # If you have multiple copies of w3c-libwww lying around, you can turn
- # it back on.
- #LIBWWW_RPATH="-rpath $LIBWWW_LIBDIR"
- LIBWWW_RPATH=""
- AC_SUBST(LIBWWW_RPATH)
- #LIBWWW_WL_RPATH="-Wl,--rpath -Wl,$LIBWWW_LIBDIR"
- LIBWWW_WL_RPATH=""
- AC_SUBST(LIBWWW_WL_RPATH)
-
fi # MUST_BUILD_LIBWWW_CLIENT
dnl =======================================================================
-dnl Finding cURL
+dnl Finding Curl
dnl =======================================================================
if test $MUST_BUILD_CURL_CLIENT = yes; then
- dnl First of all, locate the curl config program.
- dnl You can control which of these gets chosen by fooling around with PATH.
+ dnl First of all, locate the Curl config program.
+ dnl You can control which of these gets chosen by controlling PATH.
AC_PATH_PROGS(CURL_CONFIG, curl-xmlrpc-config curl-config, no)
if test "x$CURL_CONFIG" = "xno"; then
- AC_MSG_ERROR(cURL not found; see './configure --help')
+ AC_MSG_ERROR(Configure INTERNAL ERROR - first curl-config found, then not found)
fi
dnl There used to be code here to check the Curl version and make sure
dnl it is at least 7.8. But there were bugs both in the code and in
- dnl curl (curl-config --vernum, at least in older versios of Curl,
+ dnl curl (curl-config --vernum, at least in older versions of Curl,
dnl omits the leading zero). So it didn't work. Plus, checking version
dnl numbers isn't a good idea. Better to check for feature presence.
dnl So we don't do any check now. If we find out there's a problem with
dnl older Curls, we will revisit that.
- dnl Get the huge list of libraries we need to link against.
- dnl MRB-20010516-For some reason, curl-config
- dnl does not list itself '-lcurl'. 2004.12.12. It seems to do so
- dnl now.
- CURL_LDADD=`$CURL_CONFIG --libs`
+ CURL_LDADD=$($CURL_CONFIG --libs)
AC_SUBST(CURL_LDADD)
- dnl Oh, such massive brain damage! Because there may be another copy
- dnl of curl in the default dynamic loader search path, we need to
- dnl adjust the search path manually. Just gag me with a backquote, OK?
- AC_MSG_CHECKING(for curl library directory)
- dnl Yawn. We're using the regular boring version.
- CURL_LIBDIR="`$CURL_CONFIG --prefix`/lib"
+ AC_MSG_CHECKING(for Curl library directory)
+ CURL_LIBDIR="$($CURL_CONFIG --prefix)/lib"
AC_MSG_RESULT($CURL_LIBDIR)
AC_SUBST(CURL_LIBDIR)
- CURL_RPATH="-rpath $CURL_LIBDIR"
- AC_SUBST(CURL_RPATH)
- CURL_WL_RPATH="-Wl,--rpath -Wl,$CURL_LIBDIR"
- AC_SUBST(CURL_WL_RPATH)
fi # MUST_BUILD_CURL_CLIENT
@@ -620,7 +613,7 @@ CPP_WARN_FLAGS=
AC_SUBST(CPP_WARN_FLAGS)
-BUILDDIR=`pwd`
+BUILDDIR=$(pwd)
AC_SUBST(BUILDDIR)
@@ -632,7 +625,7 @@ dnl Note that AM_CONFIG_HEADER at the top of this file outputs another
dnl result: xmlrpc_amconfig.h .
AC_OUTPUT( \
- Makefile.srcdir \
+ srcdir.mk \
config.mk \
xmlrpc_config.h \
)
@@ -647,7 +640,9 @@ fi
if test "$MUST_BUILD_WININET_CLIENT $MUST_BUILD_CURL_CLIENT $MUST_BUILD_LIBWWW_CLIENT" = "no no no"; then
- AC_MSG_NOTICE([\n\n==>We are not building any client XML transport (see earlier messages explaining why), therefore WE WILL NOT BUILD THE CLIENT LIBRARY.])
+ AC_MSG_NOTICE([==>])
+ AC_MSG_NOTICE([==>We are not building any client XML transport (see earlier messages explaining why), therefore WE WILL NOT BUILD THE CLIENT LIBRARY.])
+ AC_MSG_NOTICE([==>])
fi
diff --git a/libs/xmlrpc-c/debian/README.Debian b/libs/xmlrpc-c/debian/README.Debian
deleted file mode 100644
index 830df77..0000000
--- a/libs/xmlrpc-c/debian/README.Debian
+++ /dev/null
@@ -1,7 +0,0 @@
-xmlrpc-c for Debian
--------------------
-
-This is my first attempt at porting my RPM packages to Debian. User
-beware!
-
- -- Eric Kidd , Tue, 26 Jun 2001 12:39:39 -0400
diff --git a/libs/xmlrpc-c/debian/changelog b/libs/xmlrpc-c/debian/changelog
deleted file mode 100644
index 848fac8..0000000
--- a/libs/xmlrpc-c/debian/changelog
+++ /dev/null
@@ -1,22 +0,0 @@
-xmlrpc-c (0.9.10-1) unstable; urgency=low
-
- * Updated from new upstream release.
-
- -- Eric Kidd Sun, 1 Jul 2001 10:45:51 -0400
-
-xmlrpc-c (0.9.9-2) unstable; urgency=low
-
- * Added man pages.
- * Improved depends for xmlrpc-c-dev.
-
- -- Eric Kidd Wed, 27 Jun 2001 12:25:52 -0400
-
-xmlrpc-c (0.9.9-1) unstable; urgency=low
-
- * Initial Release.
-
- -- Eric Kidd Tue, 26 Jun 2001 12:39:39 -0400
-
-Local variables:
-mode: debian-changelog
-End:
diff --git a/libs/xmlrpc-c/debian/control b/libs/xmlrpc-c/debian/control
deleted file mode 100644
index 45bd020..0000000
--- a/libs/xmlrpc-c/debian/control
+++ /dev/null
@@ -1,30 +0,0 @@
-Source: xmlrpc-c
-Section: devel
-Priority: optional
-Maintainer: Eric Kidd
-Build-Depends: debhelper (>> 3.0.0), libwww0 (>= 5.3.2), libwww-dev (>= 5.3.2)
-Standards-Version: 3.5.2
-
-Package: xmlrpc-c0
-Architecture: any
-Depends: ${shlibs:Depends}
-Description: A library implementing XML-based remote procedure calls
- XML-RPC is a lightweight RPC protocol based on XML and HTTP. This package
- is used by XML-RPC clients and servers written in C and C++.
-
-Package: xmlrpc-c-dev
-Architecture: any
-Depends: xmlrpc-c0 (= ${Source-Version}), libc6-dev, libstdc++-dev, libfrontier-rpc-perl
-Description: Libraries and header files for developing XML-RPC applications
- Static libraries and header files for writing XML-RPC applications in C and
- C++.
-
-Package: xmlrpc-c-apps
-Architecture: any
-Depends: xmlrpc-c0 (= ${Source-Version}), ${shlibs:Depends}
-Description: Sample XML-RPC applications
- Some handy XML-RPC demo applications based on the Meerkat Open Wire Service
- (found at http://www.oreillynet.com/meerkat/). You can use 'query-meerkat' to
- perform a regex search on recent news items, or 'meerkat-app-list' to get
- a list of recent Linux software releases.
-
diff --git a/libs/xmlrpc-c/debian/copyright b/libs/xmlrpc-c/debian/copyright
deleted file mode 100644
index 8873b9d..0000000
--- a/libs/xmlrpc-c/debian/copyright
+++ /dev/null
@@ -1,128 +0,0 @@
-This software package is covered by the XML-RPC C Library License.
-Additionally, certain parts of this library are derived from pre-existing
-code, which may carry its own license.
-
-In particular, the Expat Licence applies to the contents of the directory
-lib/expat, the ABYSS Web Server License applies to the contents of the
-directory lib/abyss and parts of the file src/xmlrpc_abyss.c, and the
-Python 1.5.2 license applies to parts of the file src/xmlrpc_base64.c.
-
-And as for the tools/ directory, you'll have to examine the licenses on
-your own.
-
-
- XML-RPC C Library License
- -------------------------
-
-Copyright (C) 2001 by First Peer, Inc. All rights reserved.
-Copyright (C) 2001 by Eric Kidd. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-
- Expat License
- -------------
-
-Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-
- ABYSS Web Server License
- ------------------------
-
-Copyright (C) 2000 by Moez Mahfoudh . All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-3. The name of the author may not be used to endorse or promote products
- derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-
-
- Python 1.5.2 License
- --------------------
-
-Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
-Amsterdam, The Netherlands.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Stichting Mathematisch
-Centrum or CWI or Corporation for National Research Initiatives or
-CNRI not be used in advertising or publicity pertaining to
-distribution of the software without specific, written prior
-permission.
-
-While CWI is the initial source for this software, a modified version
-is made available by the Corporation for National Research Initiatives
-(CNRI) at the Internet address ftp://ftp.python.org.
-
-STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
-CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
-DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
-PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
-TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
diff --git a/libs/xmlrpc-c/debian/postinst b/libs/xmlrpc-c/debian/postinst
deleted file mode 100644
index a7b0408..0000000
--- a/libs/xmlrpc-c/debian/postinst
+++ /dev/null
@@ -1,47 +0,0 @@
-#! /bin/sh
-# postinst script for xmlrpc-c
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * `configure'
-# * `abort-upgrade'
-# * `abort-remove' `in-favour'
-#
-# * `abort-deconfigure' `in-favour'
-# `removing'
-#
-# for details, see /usr/share/doc/packaging-manual/
-#
-# quoting from the policy:
-# Any necessary prompting should almost always be confined to the
-# post-installation script, and should be protected with a conditional
-# so that unnecessary prompting doesn't happen if a package's
-# installation fails and the `postinst' is called with `abort-upgrade',
-# `abort-remove' or `abort-deconfigure'.
-
-case "$1" in
- configure)
- ldconfig
- ;;
-
- abort-upgrade|abort-remove|abort-deconfigure)
-
- ;;
-
- *)
- echo "postinst called with unknown argument \`$1'" >&2
- exit 0
- ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
-
-
diff --git a/libs/xmlrpc-c/debian/postrm b/libs/xmlrpc-c/debian/postrm
deleted file mode 100644
index 3294e0a..0000000
--- a/libs/xmlrpc-c/debian/postrm
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh
-# postrm script for xmlrpc-c
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-# * `remove'
-# * `purge'
-# * `upgrade'
-# * `failed-upgrade'
-# * `abort-install'
-# * `abort-install'
-# * `abort-upgrade'
-# * `disappear' overwrit>r>
-# for details, see /usr/share/doc/packaging-manual/
-
-case "$1" in
- remove)
- ldconfig
- ;;
-
- purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
-
- ;;
-
- *)
- echo "postrm called with unknown argument \`$1'" >&2
- exit 0
-
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-
diff --git a/libs/xmlrpc-c/debian/rules b/libs/xmlrpc-c/debian/rules
deleted file mode 100644
index c7c728c..0000000
--- a/libs/xmlrpc-c/debian/rules
+++ /dev/null
@@ -1,97 +0,0 @@
-#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# This is the debhelper compatability version to use.
-export DH_COMPAT=3
-
-# shared library versions, option 1
-#version=2.0.5
-#major=2
-# option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so
-version=`ls src/.libs/lib*.so.* | \
- awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
-major=`ls src/.libs/lib*.so.* | \
- awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- # Add here commands to configure the package.
- ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
-
- touch configure-stamp
-
-build: configure-stamp build-stamp
-build-stamp:
- dh_testdir
-
- # Add here commands to compile the package.
- $(MAKE)
- $(MAKE) check
-
- touch build-stamp
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
-
- # Add here commands to clean up after the build process.
- -$(MAKE) distclean
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Add here commands to install the package into debian/tmp
- $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_movefiles
-
-# dh_installdebconf
- dh_installdocs
- dh_installexamples
- dh_installmenu
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_installinit
- dh_installcron
-# dh_installman debian/xmlrpc-c.7
-# dh_installman -p xmlrpc-c-dev debian/xml-rpc-api2cpp.1 debian/xml-rpc-api2txt.1 debian/xmlrpc-c-config.1
-# dh_installman -p xmlrpc-c-apps debian/meerkat-app-list.1 debian/query-meerkat.1
- dh_installinfo
-# dh_undocumented
- dh_installchangelogs
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
-# dh_perl
- dh_shlibdeps -l"$(CURDIR)/debian/xmlrpc-c0/usr/lib/:$$LD_LIBRARY_PATH"
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/libs/xmlrpc-c/debian/xmlrpc-c-apps.files b/libs/xmlrpc-c/debian/xmlrpc-c-apps.files
deleted file mode 100644
index 3f005c6..0000000
--- a/libs/xmlrpc-c/debian/xmlrpc-c-apps.files
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/bin/query-meerkat
-usr/bin/meerkat-app-list
-usr/share/man/man1/query-meerkat.1
-usr/share/man/man1/meerkat-app-list.1
diff --git a/libs/xmlrpc-c/debian/xmlrpc-c-dev.files b/libs/xmlrpc-c/debian/xmlrpc-c-dev.files
deleted file mode 100644
index f1cc55d..0000000
--- a/libs/xmlrpc-c/debian/xmlrpc-c-dev.files
+++ /dev/null
@@ -1,10 +0,0 @@
-usr/bin/xmlrpc-c-config
-usr/bin/xml-rpc-api2txt
-usr/bin/xml-rpc-api2cpp
-usr/include/*
-usr/lib/lib*.a
-usr/lib/lib*.la
-usr/lib/lib*.so
-usr/share/man/man1/xmlrpc-c-config.1
-usr/share/man/man1/xml-rpc-api2txt.1
-usr/share/man/man1/xml-rpc-api2cpp.1
diff --git a/libs/xmlrpc-c/debian/xmlrpc-c0.docs b/libs/xmlrpc-c/debian/xmlrpc-c0.docs
deleted file mode 100644
index 6df52b9..0000000
--- a/libs/xmlrpc-c/debian/xmlrpc-c0.docs
+++ /dev/null
@@ -1,6 +0,0 @@
-BUGS
-NEWS
-README
-CREDITS
-SECURITY
-doc/*.txt
diff --git a/libs/xmlrpc-c/debian/xmlrpc-c0.examples b/libs/xmlrpc-c/debian/xmlrpc-c0.examples
deleted file mode 100644
index d510cc5..0000000
--- a/libs/xmlrpc-c/debian/xmlrpc-c0.examples
+++ /dev/null
@@ -1,3 +0,0 @@
-examples/*.c
-examples/*.cc
-conf
diff --git a/libs/xmlrpc-c/debian/xmlrpc-c0.files b/libs/xmlrpc-c/debian/xmlrpc-c0.files
deleted file mode 100644
index 6f82592..0000000
--- a/libs/xmlrpc-c/debian/xmlrpc-c0.files
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/lib*.so.*
-usr/share/man/man7/xmlrpc-c.7
diff --git a/libs/xmlrpc-c/dll-common.make b/libs/xmlrpc-c/dll-common.make
deleted file mode 100644
index 0d53c17..0000000
--- a/libs/xmlrpc-c/dll-common.make
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*-makefile-*- <-- an Emacs control
-
-# See unix-common.make for an explanation of this file. This file is
-# analogous to unix-common.make, but is for a Windows system
-
-SONAME = $@
-IMPLIB = $(@:%:%.dll.a)
-
-SHLIB_CMD = $(CCLD) $(LDFLAGS_SHLIB) -o $@ $^ $(LADD)
-
-.PHONY: $(SHLIB_INSTALL_TARGETS)
-.PHONY: install-shared-libraries
-
-SHLIB_INSTALL_TARGETS = $(SHARED_LIBS_TO_INSTALL:%=%/install)
-
-#SHLIB_INSTALL_TARGETS is like "libfoo/install libbar/install"
-
-install-shared-libraries: $(SHLIB_INSTALL_TARGETS)
-
-$(SHLIB_INSTALL_TARGETS):lib%/install:$(SHLIB_PREFIX)%.$(SHLIB_SUFFIX).$(MAJ).$(MIN)
-# $< is a library file name, e.g. cygfoo.so.3.1 .
- $(INSTALL_SHLIB) $< $(DESTDIR)$(LIBINST_DIR)/$<
diff --git a/libs/xmlrpc-c/dll-common.mk b/libs/xmlrpc-c/dll-common.mk
new file mode 100644
index 0000000..9840709
--- /dev/null
+++ b/libs/xmlrpc-c/dll-common.mk
@@ -0,0 +1,22 @@
+# -*-makefile-*- <-- an Emacs control
+
+# See unix-common.mk for an explanation of this file. This file is
+# analogous to unix-common.mk, but is for a Windows system
+
+SONAME = $@
+IMPLIB = $(@:%:%.dll.a)
+
+SHLIB_CMD = $(CCLD) $(LDFLAGS_SHLIB) -o $@ $^ $(LADD)
+
+.PHONY: $(SHLIB_INSTALL_TARGETS)
+.PHONY: install-shared-libraries
+
+SHLIB_INSTALL_TARGETS = $(SHARED_LIBS_TO_INSTALL:%=%/install)
+
+#SHLIB_INSTALL_TARGETS is like "libfoo/install libbar/install"
+
+install-shared-libraries: $(SHLIB_INSTALL_TARGETS)
+
+$(SHLIB_INSTALL_TARGETS):%/install:%.$(SHLIB_SUFFIX)
+# $< is a library file name, e.g. libfoo.dll .
+ $(INSTALL_SHLIB) $< $(DESTDIR)$(LIBINST_DIR)/$<
diff --git a/libs/xmlrpc-c/doc/INSTALL b/libs/xmlrpc-c/doc/INSTALL
index 76881fa..2790010 100644
--- a/libs/xmlrpc-c/doc/INSTALL
+++ b/libs/xmlrpc-c/doc/INSTALL
@@ -82,6 +82,48 @@ you have to have a -f option and set SRCDIR and BLDDIR on your 'make'
command.
+CROSS-COMPILING
+---------------
+
+Cross compiling is building code on one machine to be run on another,
+particularly when the two machines are different enough that it matters,
+e.g. one executes x86 instructions and the other executes PowerPC
+instructions.
+
+The machine that will run the code is called the target machine. The one
+that will build the code is the build machine.
+
+To cross-compile, you set up nearly all of the build environment for the
+target machine (that includes such things as the default include file search
+path for the compiler and library search path for the linker). On your
+'configure' command, you use a --host option to identify the kind of target
+machine (rather than let it default to the kind of machine on which
+'configure' is running). It's a nontrivial task, and beyond the scope of
+this document as it is not specific to Xmlrpc-c.
+
+There is one area that requires special attention and is specific to Xmlrpc-c:
+The Xmlrpc-c build does part of its job by compiling a program from C source
+code and running that program as part of the build. That compile, unlike all
+the regular ones, must be done for the build machine, not the target
+machine.
+
+To facilitate that, there are the BUILDTOOL_CC and BUILDTOOL_CCLD make
+variables. BUILDTOOL_CC is the command name for the appropriate compiler
+which which to build a build tool, i.e. a compiler that generates code to run
+on the build system. BUILDTOOL_CCLD is similarly for the linker, and should
+be the kind of linker command that invokes a combined compiler/linker,
+e.g. "gcc" instead of "ld".
+
+You can set these make variables on the Make command line, or if you prefer,
+by modifying the file 'config.mk' after 'configure' creates it. The default
+value of these variables (as set in 'config.mk') is the same compile and link
+commands as for building target code.
+
+(There is probably a way to do this with GNU Autoconf facilities and avoid the
+BUILDTOOL_CC complication. If you know how (without using Automake), tell the
+Xmlrpc-c maintainer and he will change the build system to use it).
+
+
COMMON PROBLEMS
---------------
@@ -135,7 +177,7 @@ to have it. The make file obviously specifies the path to the current
libraries that the user just built in the link library search order,
but the link is picking up the old system version instead. Why?
Because the link options say to search /usr/lib _before_ the local
-build directory. And it does that because curl-config erroneously
+build directory. And they do that because curl-config erroneously
says that you need a -L /usr/lib link option to find the Curl library.
diff --git a/libs/xmlrpc-c/dylib-common.make b/libs/xmlrpc-c/dylib-common.make
deleted file mode 100644
index a72d416..0000000
--- a/libs/xmlrpc-c/dylib-common.make
+++ /dev/null
@@ -1,37 +0,0 @@
-# -*-makefile-*- <-- an Emacs control
-
-# See unix-common.make for an explanation of this file. This file is
-# analogous to unix-common.make, but is for an Irix system.
-
-SONAME = $(@:%.$(MIN)=%)
-
-SHLIB_CMD = $(CCLD) $(LDFLAGS_SHLIB) -o $@ $^ $(LADD)
-
-SHLIBPP_CMD = $(CXXLD) $(LDFLAGS_SHLIB) -o $@ $^ $(LADD)
-
-SHLIB_LE_TARGETS = $(call shliblefn, $(SHARED_LIBS_TO_BUILD))
-
-$(SHLIB_LE_TARGETS):%.$(SHLIB_SUFFIX):%.$(MAJ).$(MIN).$(SHLIB_SUFFIX)
- rm -f $@
- $(LN_S) $< $@
-
-
-.PHONY: $(SHLIB_INSTALL_TARGETS)
-.PHONY: install-shared-libraries
-
-SHLIB_INSTALL_TARGETS = $(SHARED_LIBS_TO_INSTALL:%=%/install)
-
-#SHLIB_INSTALL_TARGETS is like "libfoo/install libbar/install"
-
-install-shared-libraries: $(SHLIB_INSTALL_TARGETS)
-
-$(SHLIB_INSTALL_TARGETS):%/install:%.$(MAJ).$(MIN).$(SHLIB_SUFFIX)
-# $< is a library file name, e.g. libfoo.so.3.1 .
- $(INSTALL_SHLIB) $< $(DESTDIR)$(LIBINST_DIR)/$<
- cd $(DESTDIR)$(LIBINST_DIR); \
- rm -f $(<:%.$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX)); \
- $(LN_S) $< $(<:%.$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX))
- cd $(DESTDIR)$(LIBINST_DIR); \
- rm -f $(<:%.$(MAJ).$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX)); \
- $(LN_S) $(<:%.$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX)) \
- $(<:%.$(MAJ).$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX))
diff --git a/libs/xmlrpc-c/dylib-common.mk b/libs/xmlrpc-c/dylib-common.mk
new file mode 100644
index 0000000..c9ac6c5
--- /dev/null
+++ b/libs/xmlrpc-c/dylib-common.mk
@@ -0,0 +1,37 @@
+# -*-makefile-*- <-- an Emacs control
+
+# See unix-common.mk for an explanation of this file. This file is
+# analogous to unix-common.mk, but is for an Irix system.
+
+SONAME = $(@:%.$(MIN)=%)
+
+SHLIB_CMD = $(CCLD) $(LADD) $(LDFLAGS_SHLIB) -o $@ $^
+
+SHLIBPP_CMD = $(CXXLD) $(LADD) $(LDFLAGS_SHLIB) -o $@ $^
+
+SHLIB_LE_TARGETS = $(call shliblefn, $(SHARED_LIBS_TO_BUILD))
+
+$(SHLIB_LE_TARGETS):%.$(SHLIB_SUFFIX):%.$(MAJ).$(MIN).$(SHLIB_SUFFIX)
+ rm -f $@
+ $(LN_S) $< $@
+
+
+.PHONY: $(SHLIB_INSTALL_TARGETS)
+.PHONY: install-shared-libraries
+
+SHLIB_INSTALL_TARGETS = $(SHARED_LIBS_TO_INSTALL:%=%/install)
+
+#SHLIB_INSTALL_TARGETS is like "libfoo/install libbar/install"
+
+install-shared-libraries: $(SHLIB_INSTALL_TARGETS)
+
+$(SHLIB_INSTALL_TARGETS):%/install:%.$(MAJ).$(MIN).$(SHLIB_SUFFIX)
+# $< is a library file name, e.g. libfoo.so.3.1 .
+ $(INSTALL_SHLIB) $< $(DESTDIR)$(LIBINST_DIR)/$<
+ cd $(DESTDIR)$(LIBINST_DIR); \
+ rm -f $(<:%.$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX)); \
+ $(LN_S) $< $(<:%.$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX))
+ cd $(DESTDIR)$(LIBINST_DIR); \
+ rm -f $(<:%.$(MAJ).$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX)); \
+ $(LN_S) $(<:%.$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX)) \
+ $(<:%.$(MAJ).$(MIN).$(SHLIB_SUFFIX)=%.$(SHLIB_SUFFIX))
diff --git a/libs/xmlrpc-c/examples/.cvsignore b/libs/xmlrpc-c/examples/.cvsignore
deleted file mode 100644
index 792265c..0000000
--- a/libs/xmlrpc-c/examples/.cvsignore
+++ /dev/null
@@ -1,11 +0,0 @@
-gen_sample_add_xml
-meerkat-app-list
-query-meerkat
-synch_client
-xmlrpc_asynch_client
-auth_client
-xmlrpc_loop_server
-xmlrpc_sample_add_client
-xmlrpc_sample_add_server
-xmlrpc_server_validatee
-*.cgi
diff --git a/libs/xmlrpc-c/examples/Makefile b/libs/xmlrpc-c/examples/Makefile
index 5a9fd19..c441c9f 100644
--- a/libs/xmlrpc-c/examples/Makefile
+++ b/libs/xmlrpc-c/examples/Makefile
@@ -1,8 +1,8 @@
-# Since the programs in this directories are examples for the user, this
-# make file should be as ordinary as possible. It should not rely heavily
-# on included make files or configuration parameters. It should not use
-# libtool. Also, we don't try to build or rebuild the libraries on which
-# these programs depend.
+# Since the programs in this directory are examples for the user, this make
+# file should be as ordinary as possible. It should not rely heavily on
+# included make files or configuration parameters. Also, we don't try to
+# build or rebuild the libraries on which these programs depend or even
+# recognize that they've changed on their own.
ifeq ($(SRCDIR),)
@@ -15,8 +15,8 @@ include $(BLDDIR)/config.mk
default: all
-CFLAGS = $(CFLAGS_COMMON) $(CFLAGS_PERSONAL) $(CADD)
-LDFLAGS = $(LADD)
+CFLAGS = $(CFLAGS_PERSONAL) $(CADD)
+LDFLAGS += $(LADD)
# If this were a real application, working from an installed copy of
# Xmlrpc-c, XMLRPC_C_CONFIG would just be 'xmlrpc-c-config'. It would be
@@ -25,6 +25,7 @@ XMLRPC_C_CONFIG = $(BLDDIR)/xmlrpc-c-config.test
CLIENTPROGS = \
auth_client \
+ compound_value_client \
synch_client \
xmlrpc_sample_add_client \
xmlrpc_asynch_client \
@@ -37,6 +38,7 @@ SERVERPROGS_CGI = \
xmlrpc_sample_add_server.cgi
SERVERPROGS_ABYSS = \
+ compound_value_server \
interrupted_server \
xmlrpc_inetd_server \
xmlrpc_socket_server \
@@ -44,15 +46,19 @@ SERVERPROGS_ABYSS = \
xmlrpc_sample_add_server \
xmlrpc_server_validatee \
+BASIC_PROGS = \
+ json \
+ gen_sample_add_xml \
+
# Build up PROGS:
PROGS =
+PROGS += $(BASIC_PROGS)
+
ifeq ($(ENABLE_ABYSS_SERVER),yes)
PROGS += $(SERVERPROGS_ABYSS)
endif
-PROGS += gen_sample_add_xml
-
ifeq ($(MUST_BUILD_CLIENT),yes)
PROGS += $(CLIENTPROGS)
endif
@@ -63,17 +69,17 @@ endif
INCLUDES = -I. $(shell $(XMLRPC_C_CONFIG) client abyss-server --cflags)
-LDADD_CLIENT = \
- $(shell $(XMLRPC_C_CONFIG) client --ldadd)
+LIBS_CLIENT = \
+ $(shell $(XMLRPC_C_CONFIG) client --libs)
-LDADD_SERVER_ABYSS = \
- $(shell $(XMLRPC_C_CONFIG) abyss-server --ldadd)
+LIBS_SERVER_ABYSS = \
+ $(shell $(XMLRPC_C_CONFIG) abyss-server --libs)
-LDADD_SERVER_CGI = \
- $(shell $(XMLRPC_C_CONFIG) cgi-server --ldadd)
+LIBS_SERVER_CGI = \
+ $(shell $(XMLRPC_C_CONFIG) cgi-server --libs)
-LDADD_BASE = \
- $(shell $(XMLRPC_C_CONFIG) --ldadd)
+LIBS_BASE = \
+ $(shell $(XMLRPC_C_CONFIG) --libs)
all: $(PROGS)
@@ -90,16 +96,17 @@ $(BLDDIR)/examples/cpp:
mkdir $@
$(CLIENTPROGS):%:%.o
- $(CCLD) -o $@ $(LDFLAGS) $^ $(LDADD_CLIENT)
+ $(CCLD) -o $@ $^ $(LIBS_CLIENT) $(LDFLAGS)
$(SERVERPROGS_CGI):%.cgi:%_cgi.o
- $(CCLD) -o $@ $(LDFLAGS) $^ $(LDADD_SERVER_CGI)
+ $(CCLD) -o $@ $^ $(LIBS_SERVER_CGI) $(LDFLAGS)
$(SERVERPROGS_ABYSS):%:%.o
- $(CCLD) -o $@ $(LDFLAGS) $^ $(LDADD_SERVER_ABYSS)
+ $(CCLD) -o $@ $^ $(LIBS_SERVER_ABYSS) $(LDFLAGS)
+
+$(BASIC_PROGS):%:%.o
+ $(CCLD) -o $@ $^ $(LIBS_BASE) $(LDFLAGS)
-gen_sample_add_xml:%:%.o
- $(CCLD) -o $@ $(LDFLAGS) $^ $(LDADD_BASE)
OBJECTS = $(patsubst %,%.o,$(patsubst %.cgi,%_cgi,$(PROGS)))
@@ -119,11 +126,9 @@ config.h:
xmlrpc_amconfig.h:
$(LN_S) $(BLDDIR)/$@ .
-include $(SRCDIR)/common.mk
-
.PHONY: clean
-clean: clean-common
- rm -f $(PROGS) config.h xmlrpc_amconfig.h
+clean:
+ rm -f $(PROGS) *.o config.h xmlrpc_amconfig.h
$(MAKE) -C cpp clean
.PHONY: distclean
diff --git a/libs/xmlrpc-c/examples/README b/libs/xmlrpc-c/examples/README
index 46b02b4..6691f8a 100644
--- a/libs/xmlrpc-c/examples/README
+++ b/libs/xmlrpc-c/examples/README
@@ -1,15 +1,12 @@
This directory contains working examples of uses of XML-RPC-c. There
are XML-RPC servers and XML-RPC clients that use the Xmlrpc-c libraries.
-The simplest example is the 'query-meerkat' program, which contacts an
-XML-RPC server that O'Reilly operates on the Internet called Meerkat.
-Meerkat provides an RPC that returns a list of new articles that match
-a specified search pattern. Run 'query-meerkat' like this example:
-
- $ ./query-meerkat Linux
-
-This responds with a list of new articles that contain the work "Linux",
-according to O'reilly's Meerkat service.
+The make file is a combination of an example of how to build programs
+that use Xmlrpc-c libraries and something that actually does build the
+programs in this directory. As such, it isn't perfect for either of
+those purposes. To build the examples, you must first build the
+libraries (make dependencies will not take care of that for you). Then
+you can issue a simple 'make' in this directory.
The simplest server program is 'xmlrpc_sample_add_server'. This
diff --git a/libs/xmlrpc-c/examples/auth_client.c b/libs/xmlrpc-c/examples/auth_client.c
index 50047f4..fbbd0a9 100644
--- a/libs/xmlrpc-c/examples/auth_client.c
+++ b/libs/xmlrpc-c/examples/auth_client.c
@@ -35,7 +35,7 @@ die_if_fault_occurred(xmlrpc_env * const envP) {
int
main(int const argc,
- const char ** const argv ATTR_UNUSED) {
+ const char ** const argv) {
xmlrpc_env env;
xmlrpc_server_info * serverP;
diff --git a/libs/xmlrpc-c/examples/compound_value_client.c b/libs/xmlrpc-c/examples/compound_value_client.c
new file mode 100644
index 0000000..92baad1
--- /dev/null
+++ b/libs/xmlrpc-c/examples/compound_value_client.c
@@ -0,0 +1,161 @@
+/* An XML-RPC client program written in C, as an example of using
+ compound XML-RPC values.
+
+ For a simple client program that just deals with integer values,
+ see xmlrpc_sample_add_client.c. This example focuses just on the
+ compound XML-RPC values and not the client functions.
+
+ This client invokes the example.divide XML-RPC method that the example
+ server program compound_value_server.c provides. That method takes a
+ list of pairs of numbers and returns the list of their quotients.
+
+ Compound XML-RPC values are arrays and structures. We call them compound
+ because they are made up of other XML-RPC values (e.g. an array of XML-RPC
+ integers).
+
+ The arguments to the example.divide method are specified as follows:
+
+ There are two arguments:
+
+ Argument 0: Integer. Version number of this argument protocol. Must
+ be 1.
+
+
+ Argument 1: Array. One element for each pair of numbers you want the
+ server to divide. Each element is structure, with these
+ members:
+
+ KEY: "dividend"
+ VALUE: floating point number. The dividend.
+
+ KEY: "divisor"
+ VALUE: floating point number. The divisor.
+
+ The result of the method is an array. It has one member for each pair of
+ numbers in the arguments (So it is the same size as Argument 1). That
+ member is a floating point number. It is the quotient of the numbers
+ in the corresponding element of Argument 1.
+
+ The client sends the RPC to the server running on the local system
+ ("localhost"), HTTP Port 8080.
+*/
+
+#include
+#include
+
+#include
+#include
+
+#include "config.h" /* information about this build environment */
+
+#define NAME "Xmlrpc-c Test Client"
+#define VERSION "1.0"
+
+static void
+dieIfFaultOccurred (xmlrpc_env * const envP) {
+ if (envP->fault_occurred) {
+ fprintf(stderr, "ERROR: %s (%d)\n",
+ envP->fault_string, envP->fault_code);
+ exit(1);
+ }
+}
+
+
+
+struct ratio {
+ double dividend;
+ double divisor;
+};
+
+
+
+int
+main(int const argc,
+ const char ** const argv) {
+
+ const char * const serverUrl = "http://localhost:8080/RPC2";
+ const char * const methodName = "example.divide";
+ unsigned int const argVersion = 1;
+ struct ratio const data[] = {{1,2},{12,3},{10,3},{89,3000}};
+ xmlrpc_env env;
+ xmlrpc_value * resultP;
+ unsigned int i;
+ xmlrpc_value * ratioArrayP;
+ unsigned int quotientCt;
+
+ if (argc-1 > 0) {
+ fprintf(stderr, "This program has no arguments\n");
+ exit(1);
+ }
+
+ xmlrpc_env_init(&env);
+
+ xmlrpc_client_init2(&env, XMLRPC_CLIENT_NO_FLAGS, NAME, VERSION, NULL, 0);
+ dieIfFaultOccurred(&env);
+
+ /* Build the 2nd method argument: the array of ratios */
+
+ ratioArrayP = xmlrpc_array_new(&env);
+ dieIfFaultOccurred(&env);
+
+ for (i = 0; i < 4; ++i) {
+ xmlrpc_value * dividendP;
+ xmlrpc_value * divisorP;
+ xmlrpc_value * ratioP;
+
+ dividendP = xmlrpc_double_new(&env, data[i].dividend);
+ dieIfFaultOccurred(&env);
+ divisorP = xmlrpc_double_new(&env, data[i].divisor);
+ dieIfFaultOccurred(&env);
+
+ ratioP = xmlrpc_struct_new(&env);
+ dieIfFaultOccurred(&env);
+
+ xmlrpc_struct_set_value(&env, ratioP, "DIVIDEND", dividendP);
+ dieIfFaultOccurred(&env);
+ xmlrpc_struct_set_value(&env, ratioP, "DIVISOR", divisorP);
+ dieIfFaultOccurred(&env);
+
+ xmlrpc_array_append_item(&env, ratioArrayP, ratioP);
+ dieIfFaultOccurred(&env);
+
+ xmlrpc_DECREF(ratioP);
+ xmlrpc_DECREF(divisorP);
+ xmlrpc_DECREF(dividendP);
+ }
+
+ /* Make the call */
+
+ resultP = xmlrpc_client_call(&env, serverUrl, methodName, "(iA)",
+ (xmlrpc_int32) argVersion, ratioArrayP);
+ dieIfFaultOccurred(&env);
+
+ /* Print out the quotients returned */
+
+ quotientCt = xmlrpc_array_size(&env, resultP);
+ dieIfFaultOccurred(&env);
+
+ for (i = 0; i < quotientCt; ++i) {
+ xmlrpc_value * quotientP;
+ xmlrpc_double quotient;
+
+ xmlrpc_array_read_item(&env, resultP, i, "ientP);
+ dieIfFaultOccurred(&env);
+
+ xmlrpc_read_double(&env, quotientP, "ient);
+ dieIfFaultOccurred(&env);
+
+ printf("Server says quotient %u is %f\n", i, quotient);
+
+ xmlrpc_DECREF(quotientP);
+ }
+
+ xmlrpc_DECREF(resultP);
+
+ xmlrpc_env_clean(&env);
+
+ xmlrpc_client_cleanup();
+
+ return 0;
+}
+
diff --git a/libs/xmlrpc-c/examples/compound_value_server.c b/libs/xmlrpc-c/examples/compound_value_server.c
new file mode 100644
index 0000000..99d1127
--- /dev/null
+++ b/libs/xmlrpc-c/examples/compound_value_server.c
@@ -0,0 +1,199 @@
+/* An XML-RPC server program written in C, as an example of using
+ compound XML-RPC values.
+
+ For a simple server program that just deals with integer values,
+ see xmlrpc_sample_add_server.c. This example focuses just on the
+ compound XML-RPC values and not the server functions.
+
+ This server provides the example.divide XML-RPC method that the example
+ client program compound_value_client.c invokes. See that program for
+ details on what the method does.
+
+ The program takes one argument: the HTTP port number on which the server
+ is to accept connections, in decimal.
+
+ Example:
+
+ $ ./compound_value_server 8080&
+ $ ./compound_value_client
+*/
+
+#include
+#include
+
+#include
+#include
+#include
+
+#include "config.h" /* information about this build environment */
+
+
+
+static void
+computeQuotient(xmlrpc_env * const envP,
+ xmlrpc_value * const ratioP,
+ xmlrpc_double * const quotientP) {
+
+ xmlrpc_value * dividendP;
+
+ xmlrpc_struct_find_value(envP, ratioP, "DIVIDEND", ÷ndP);
+
+ if (!envP->fault_occurred) {
+ if (!dividendP)
+ xmlrpc_env_set_fault(
+ envP, 0, "Structure is missing 'DIVIDEND' member");
+ else {
+ xmlrpc_value * divisorP;
+
+ xmlrpc_struct_find_value(envP, ratioP, "DIVISOR", &divisorP);
+
+ if (!envP->fault_occurred) {
+ if (!divisorP)
+ xmlrpc_env_set_fault(
+ envP, 0, "Structure is missing 'DIVISOR' member");
+ else {
+ xmlrpc_double dividend;
+
+ xmlrpc_read_double(envP, dividendP, ÷nd);
+
+ if (!envP->fault_occurred) {
+ xmlrpc_double divisor;
+
+ xmlrpc_read_double(envP, divisorP, &divisor);
+
+ if (!envP->fault_occurred)
+ *quotientP = dividend / divisor;
+ }
+ xmlrpc_DECREF(divisorP);
+ }
+ }
+ xmlrpc_DECREF(dividendP);
+ }
+ }
+}
+
+
+
+static void
+computeQuotients(xmlrpc_env * const envP,
+ xmlrpc_value * const ratioArrayP,
+ xmlrpc_value ** const quotientArrayPP) {
+
+ xmlrpc_value * quotientArrayP;
+
+ quotientArrayP = xmlrpc_array_new(envP);
+ if (!envP->fault_occurred) {
+
+ unsigned int const ratioCt = xmlrpc_array_size(envP, ratioArrayP);
+
+ unsigned int i;
+
+ for (i = 0; i < ratioCt && !envP->fault_occurred; ++i) {
+ xmlrpc_value * ratioP;
+
+ xmlrpc_array_read_item(envP, ratioArrayP, i, &ratioP);
+
+ if (!envP->fault_occurred) {
+ xmlrpc_double quotient;
+
+ computeQuotient(envP, ratioP, "ient);
+
+ if (!envP->fault_occurred) {
+ xmlrpc_value * quotientP;
+
+ quotientP = xmlrpc_double_new(envP, quotient);
+
+ if (!envP->fault_occurred) {
+ xmlrpc_array_append_item(envP, quotientArrayP,
+ quotientP);
+
+ xmlrpc_DECREF(quotientP);
+ }
+ }
+ xmlrpc_DECREF(ratioP);
+ }
+ }
+ if (envP->fault_occurred)
+ xmlrpc_DECREF(quotientArrayP);
+ else
+ *quotientArrayPP = quotientArrayP;
+ }
+}
+
+
+
+static xmlrpc_value *
+example_divide(xmlrpc_env * const envP,
+ xmlrpc_value * const paramArrayP,
+ void * const serverInfo,
+ void * const channelInfo) {
+
+ xmlrpc_value * retvalP;
+ xmlrpc_int32 argVersion;
+ xmlrpc_value * ratioArrayP;
+
+ xmlrpc_decompose_value(envP, paramArrayP, "(iA)",
+ &argVersion, &ratioArrayP);
+ if (envP->fault_occurred)
+ return NULL;
+
+ if (argVersion != 1) {
+ xmlrpc_env_set_fault(envP, 0, "Parameter list version must be 1");
+ return NULL;
+ }
+
+ computeQuotients(envP, ratioArrayP, &retvalP);
+
+ xmlrpc_DECREF(ratioArrayP);
+
+ if (envP->fault_occurred)
+ return NULL;
+
+ return retvalP;
+}
+
+
+
+int
+main(int const argc,
+ const char ** const argv) {
+
+ struct xmlrpc_method_info3 const methodInfo = {
+ /* .methodName = */ "example.divide",
+ /* .methodFunction = */ &example_divide,
+ };
+ xmlrpc_server_abyss_parms serverparm;
+ xmlrpc_registry * registryP;
+ xmlrpc_env env;
+
+ if (argc-1 != 1) {
+ fprintf(stderr, "You must specify 1 argument: The TCP port "
+ "number on which the server will accept connections "
+ "for RPCs (8080 is a common choice). "
+ "You specified %d arguments.\n", argc-1);
+ exit(1);
+ }
+
+ xmlrpc_env_init(&env);
+
+ registryP = xmlrpc_registry_new(&env);
+
+ xmlrpc_registry_add_method3(&env, registryP, &methodInfo);
+
+ /* In the modern form of the Abyss API, we supply parameters in memory
+ like a normal API. We select the modern form by setting
+ config_file_name to NULL:
+ */
+ serverparm.config_file_name = NULL;
+ serverparm.registryP = registryP;
+ serverparm.port_number = atoi(argv[1]);
+ serverparm.log_file_name = "/tmp/xmlrpc_log";
+
+ printf("Running XML-RPC server...\n");
+
+ xmlrpc_server_abyss(&env, &serverparm, XMLRPC_APSIZE(log_file_name));
+
+ /* xmlrpc_server_abyss() never returns */
+
+ return 0;
+}
diff --git a/libs/xmlrpc-c/examples/cpp/.cvsignore b/libs/xmlrpc-c/examples/cpp/.cvsignore
deleted file mode 100644
index fedad6b..0000000
--- a/libs/xmlrpc-c/examples/cpp/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-meerkat-app-list
-xmlrpc_sample_add_server
-xmlrpc_sample_add_client
-sample_add_client_complex
diff --git a/libs/xmlrpc-c/examples/cpp/Makefile b/libs/xmlrpc-c/examples/cpp/Makefile
index 1c8b930..18798cb 100644
--- a/libs/xmlrpc-c/examples/cpp/Makefile
+++ b/libs/xmlrpc-c/examples/cpp/Makefile
@@ -15,8 +15,8 @@ include $(BLDDIR)/config.mk
default: all
-CXXFLAGS = $(CXXFLAGS_COMMON) $(CFLAGS_PERSONAL) $(CADD)
-LDFLAGS = $(LADD)
+CXXFLAGS = $(CFLAGS_PERSONAL) $(CADD)
+LDFLAGS += $(LADD)
# If this were a real application, working from an installed copy of
# Xmlrpc-c, XMLRPC_C_CONFIG would just be 'xmlrpc-c-config'. It would be
@@ -24,10 +24,14 @@ LDFLAGS = $(LADD)
XMLRPC_C_CONFIG = $(BLDDIR)/xmlrpc-c-config.test
+SERVERPROGS_CGI = \
+ xmlrpc_sample_add_server.cgi
+
SERVERPROGS_ABYSS = \
xmlrpc_inetd_server \
xmlrpc_loop_server \
xmlrpc_sample_add_server \
+ callinfo_abyss_server \
CLIENTPROGS = \
xmlrpc_sample_add_client \
@@ -45,7 +49,11 @@ ifeq ($(MUST_BUILD_CLIENT),yes)
PROGS += $(CLIENTPROGS)
endif
-PROGS += pstream_inetd_server
+ifeq ($(ENABLE_CGI_SERVER),yes)
+ PROGS += $(SERVERPROGS_CGI)
+endif
+
+PROGS += pstream_inetd_server pstream_serial_server
ifeq ($(MUST_BUILD_CLIENT),yes)
PROGS += pstream_client
@@ -53,37 +61,43 @@ endif
INCLUDES = -I. $(shell $(XMLRPC_C_CONFIG) c++2 client abyss-server --cflags)
-LDADD_SERVER_ABYSS = \
- $(shell $(XMLRPC_C_CONFIG) c++2 abyss-server --ldadd)
+LIBS_SERVER_ABYSS = \
+ $(shell $(XMLRPC_C_CONFIG) c++2 abyss-server --libs)
-LDADD_CLIENT = \
- $(shell $(XMLRPC_C_CONFIG) c++2 client --ldadd)
+LIBS_SERVER_CGI = \
+ $(shell $(XMLRPC_C_CONFIG) c++2 cgi-server --libs)
-LDADD_BASE = \
- $(shell $(XMLRPC_C_CONFIG) c++2 --ldadd)
+LIBS_CLIENT = \
+ $(shell $(XMLRPC_C_CONFIG) c++2 client --libs)
+
+LIBS_BASE = \
+ $(shell $(XMLRPC_C_CONFIG) c++2 --libs)
all: $(PROGS)
+$(SERVERPROGS_CGI):%.cgi:%_cgi.o
+ $(CXXLD) -o $@ $^ $(LIBS_SERVER_CGI) $(LDFLAGS)
+
$(SERVERPROGS_ABYSS):%:%.o
- $(CXXLD) -o $@ $(LDFLAGS) $^ $(LDADD_SERVER_ABYSS)
+ $(CXXLD) -o $@ $^ $(LIBS_SERVER_ABYSS) $(LDFLAGS)
$(CLIENTPROGS):%:%.o
- $(CXXLD) -o $@ $(LDFLAGS) $^ $(LDADD_CLIENT)
+ $(CXXLD) -o $@ $^ $(LIBS_CLIENT) $(LDFLAGS)
-LDADD_PSTREAM_CLIENT = \
- $(shell $(XMLRPC_C_CONFIG) c++2 client --ldadd)
+LIBS_PSTREAM_CLIENT = \
+ $(shell $(XMLRPC_C_CONFIG) c++2 client --libs)
pstream_client:%:%.o
- $(CXXLD) -o $@ $(LDFLAGS) $^ $(LDADD_PSTREAM_CLIENT)
+ $(CXXLD) -o $@ $^ $(LIBS_PSTREAM_CLIENT) $(LDFLAGS)
-LDADD_PSTREAM_SERVER = \
- $(shell $(XMLRPC_C_CONFIG) c++2 pstream-server --ldadd)
+LIBS_PSTREAM_SERVER = \
+ $(shell $(XMLRPC_C_CONFIG) c++2 pstream-server --libs)
-pstream_inetd_server:%:%.o
- $(CXXLD) -o $@ $(LDFLAGS) $^ $(LDADD_PSTREAM_SERVER)
+pstream_inetd_server pstream_serial_server:%:%.o
+ $(CXXLD) -o $@ $^ $(LIBS_PSTREAM_SERVER) $(LDFLAGS)
-OBJECTS = $(PROGS:%=%.o)
+OBJECTS = $(patsubst %,%.o,$(patsubst %.cgi,%_cgi,$(PROGS)))
$(OBJECTS):%.o:%.cpp
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $<
@@ -97,11 +111,9 @@ config.h:
xmlrpc_amconfig.h:
$(LN_S) $(BLDDIR)/$@ .
-include $(SRCDIR)/common.mk
-
.PHONY: clean
-clean: clean-common
- rm -f $(PROGS) config.h xmlrpc_amconfig.h
+clean:
+ rm -f $(PROGS) *.o config.h xmlrpc_amconfig.h
.PHONY: distclean
distclean: clean
diff --git a/libs/xmlrpc-c/examples/cpp/callinfo_abyss_server.cpp b/libs/xmlrpc-c/examples/cpp/callinfo_abyss_server.cpp
new file mode 100644
index 0000000..a297b8e
--- /dev/null
+++ b/libs/xmlrpc-c/examples/cpp/callinfo_abyss_server.cpp
@@ -0,0 +1,133 @@
+// A simple standalone XML-RPC server written in C++.
+//
+// This server returns to the caller his IP address and port number,
+// as a demonstration of how to access such information.
+//
+// This works only on Unix (to wit, something that uses Abyss's
+// ChanSwitchUnix channel switch to accept TCP connections from clients).
+//
+// See xmlrpc_sample_add_server.cpp for a more basic example.
+//
+// To run this:
+//
+// $ ./callinfo_abyss_server &
+// $ xmlrpc localhost:8080 getCallInfo
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+using namespace std;
+
+
+struct tcpPortAddr {
+ unsigned char ipAddr[4];
+ unsigned short portNumber;
+};
+
+
+static struct tcpPortAddr
+tcpAddrFromSockAddr(struct sockaddr const sockAddr) {
+
+ const struct sockaddr_in * const sockAddrInP(
+ static_cast((void *)&sockAddr));
+
+ const unsigned char * const ipAddr(
+ static_cast(
+ (const void *)&sockAddrInP->sin_addr.s_addr)
+ ); // 4 byte array
+
+ assert(sockAddrInP->sin_family == AF_INET);
+
+ struct tcpPortAddr retval;
+
+ retval.ipAddr[0] = ipAddr[0];
+ retval.ipAddr[1] = ipAddr[1];
+ retval.ipAddr[2] = ipAddr[2];
+ retval.ipAddr[3] = ipAddr[3];
+ retval.portNumber = ntohs(sockAddrInP->sin_port);
+
+ return retval;
+}
+
+
+
+static std::string
+rpcIpAddrMsg(xmlrpc_c::callInfo_serverAbyss const& callInfo) {
+
+ void * chanInfoPtr;
+ SessionGetChannelInfo(callInfo.abyssSessionP, &chanInfoPtr);
+
+ struct abyss_unix_chaninfo * const chanInfoP(
+ static_cast(chanInfoPtr));
+
+ struct tcpPortAddr const tcpAddr(tcpAddrFromSockAddr(chanInfoP->peerAddr));
+
+ char msg[128];
+
+ sprintf(msg, "RPC is from IP address %u.%u.%u.%u, Port %hu",
+ tcpAddr.ipAddr[0],
+ tcpAddr.ipAddr[1],
+ tcpAddr.ipAddr[2],
+ tcpAddr.ipAddr[3],
+ tcpAddr.portNumber);
+
+ return std::string(msg);
+}
+
+
+
+class getCallInfoMethod : public xmlrpc_c::method2 {
+public:
+ void
+ execute(xmlrpc_c::paramList const& paramList,
+ const xmlrpc_c::callInfo * const callInfoPtr,
+ xmlrpc_c::value * const retvalP) {
+
+ const xmlrpc_c::callInfo_serverAbyss * const callInfoP(
+ dynamic_cast(callInfoPtr));
+
+ paramList.verifyEnd(0);
+
+ // Because this gets called via a xmlrpc_c::serverAbyss:
+ assert(callInfoP != NULL);
+
+ *retvalP = xmlrpc_c::value_string(rpcIpAddrMsg(*callInfoP));
+ }
+};
+
+
+
+int
+main(int const,
+ const char ** const) {
+
+ try {
+ xmlrpc_c::registry myRegistry;
+
+ xmlrpc_c::methodPtr const getCallInfoMethodP(new getCallInfoMethod);
+
+ myRegistry.addMethod("getCallInfo", getCallInfoMethodP);
+
+ xmlrpc_c::serverAbyss myAbyssServer(xmlrpc_c::serverAbyss::constrOpt()
+ .registryP(&myRegistry)
+ .portNumber(8080)
+ );
+
+ myAbyssServer.run();
+ // xmlrpc_c::serverAbyss.run() never returns
+ assert(false);
+ } catch (exception const& e) {
+ cerr << "Something failed. " << e.what() << endl;
+ }
+ return 0;
+}
diff --git a/libs/xmlrpc-c/examples/cpp/meerkat-app-list.cpp b/libs/xmlrpc-c/examples/cpp/meerkat-app-list.cpp
deleted file mode 100644
index c2bd1e3..0000000
--- a/libs/xmlrpc-c/examples/cpp/meerkat-app-list.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-// List recently-released Linux applications. (Written in C++.)
-// For more details about O'Reilly's excellent Meerkat news service, see:
-// http://www.oreillynet.com/pub/a/rss/2000/11/14/meerkat_xmlrpc.html */
-
-#include
-#include
-#include
-
-using namespace std;
-
-#include
-
-#define NAME "XML-RPC C++ Meerkat Query Demo"
-#define VERSION "0.1"
-#define MEERKAT_URL "http://www.oreillynet.com/meerkat/xml-rpc/server.php"
-#define SOFTWARE_LINUX (6)
-
-static void list_apps (int hours) {
-
- // Build our time_period parameter.
- ostringstream time_period_stream;
- time_period_stream << hours << "HOUR";
- string time_period = time_period_stream.str();
-
- // Assemble our meerkat query recipe.
- XmlRpcValue recipe = XmlRpcValue::makeStruct();
- recipe.structSetValue("category", XmlRpcValue::makeInt(SOFTWARE_LINUX));
- recipe.structSetValue("time_period", XmlRpcValue::makeString(time_period));
- recipe.structSetValue("descriptions", XmlRpcValue::makeInt(76));
-
- // Build our parameter array.
- XmlRpcValue param_array = XmlRpcValue::makeArray();
- param_array.arrayAppendItem(recipe);
-
- // Create a client pointing to Meerkat.
- XmlRpcClient meerkat (MEERKAT_URL);
-
- // Perform the query.
- XmlRpcValue apps = meerkat.call("meerkat.getItems", param_array);
-
- // Print our results.
- int first = 1;
- size_t app_count = apps.arraySize();
- for (size_t i = 0; i < app_count; i++) {
- XmlRpcValue app = apps.arrayGetItem(i);
-
- // Get some information about our application.
- string title = app.structGetValue("title").getString();
- string link = app.structGetValue("link").getString();
- string description = app.structGetValue("description").getString();
-
- // Print a separator line if necessary.
- if (first)
- first = 0;
- else
- cout << endl;
-
- // Print this application entry.
- if (description.size() > 0) {
- cout << title << endl << description << endl << link << endl;
- } else {
- cout << title << endl << description << endl << link << endl;
- }
- }
-}
-
-// Print out a usage message.
-static void usage (void)
-{
- cerr << "Usage: meekat-app-list [hours]" << endl;
- cerr << "Data from ." << endl;
- exit(1);
-}
-
-int main (int argc, char **argv) {
- int status = 0;
- int hours = 25;
-
- // Parse our command-line arguments.
- if (argc == 1) {
- // Use default value for hours.
- } else if (argc == 2) {
- hours = atoi(argv[1]);
- }
- if (hours == 0)
- usage();
- if (hours > 49) {
- cerr << "It's not nice to ask for > 49 hours at once." << endl;
- exit(1);
- }
-
- // Start up our client library.
- XmlRpcClient::Initialize(NAME, VERSION);
-
- // Call our implementation, and watch out for faults.
- try {
- list_apps(hours);
- } catch (XmlRpcFault& fault) {
- cerr << argv[0] << ": XML-RPC fault #" << fault.getFaultCode()
- << ": " << fault.getFaultString() << endl;
- status = 1;
- }
-
- // Shut down our client library.
- XmlRpcClient::Terminate();
-
- return status;
-}
diff --git a/libs/xmlrpc-c/examples/cpp/pstream_client.cpp b/libs/xmlrpc-c/examples/cpp/pstream_client.cpp
index 7a8f322..738e8ba 100644
--- a/libs/xmlrpc-c/examples/cpp/pstream_client.cpp
+++ b/libs/xmlrpc-c/examples/cpp/pstream_client.cpp
@@ -25,7 +25,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
diff --git a/libs/xmlrpc-c/examples/cpp/pstream_inetd_server.cpp b/libs/xmlrpc-c/examples/cpp/pstream_inetd_server.cpp
index 65f1aa5..00d930c 100644
--- a/libs/xmlrpc-c/examples/cpp/pstream_inetd_server.cpp
+++ b/libs/xmlrpc-c/examples/cpp/pstream_inetd_server.cpp
@@ -22,7 +22,7 @@
#endif
#include
#include
-#include
+#include
#include
#include
@@ -76,12 +76,7 @@ main(int const,
.socketFd(STDIN_FILENO)
.registryP(&myRegistry));
- for (bool clientHasDisconnected = false; !clientHasDisconnected;)
- server.runOnce(&clientHasDisconnected);
- // This reads one packet (containing an XML-RPC call message)
- // from Standard Input, executes the indicated RPC, and writes
- // one packet containing the XML-RPC response message to
- // Standard Input.
+ server.run();
} catch (exception const& e) {
cerr << "Something threw an error: " << e.what() << endl;
diff --git a/libs/xmlrpc-c/examples/cpp/pstream_serial_server.cpp b/libs/xmlrpc-c/examples/cpp/pstream_serial_server.cpp
new file mode 100644
index 0000000..aba2fbe
--- /dev/null
+++ b/libs/xmlrpc-c/examples/cpp/pstream_serial_server.cpp
@@ -0,0 +1,84 @@
+/* A simple standalone RPC server based on an Xmlrpc-c packet socket.
+
+ This program expects the invoker to provide a socket in listen mode
+ as Standard Input.
+
+ This is not an XML-RPC server, because it uses a simple packet socket
+ instead of HTTP. See xmlrpc_sample_add_server.cpp for an example of
+ an XML-RPC server.
+
+ The advantage of this example over XML-RPC is that it has a connection
+ concept. The client can be connected indefinitely and the server gets
+ notified when the client terminates, even if it gets aborted by its OS.
+
+ Here's an example of running this:
+
+ $ socketexec -listen -local_port=8080 ./pstream_serial_server
+*/
+
+#ifndef WIN32
+#include
+#endif
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+using namespace std;
+
+
+class sampleAddMethod : public xmlrpc_c::method {
+public:
+ sampleAddMethod() {
+ // signature and help strings are documentation -- the client
+ // can query this information with a system.methodSignature and
+ // system.methodHelp RPC.
+ this->_signature = "i:ii"; // method's arguments are two integers
+ this->_help = "This method adds two integers together";
+ }
+ void
+ execute(xmlrpc_c::paramList const& paramList,
+ xmlrpc_c::value * const retvalP) {
+
+ int const addend(paramList.getInt(0));
+ int const adder(paramList.getInt(1));
+
+ paramList.verifyEnd(2);
+
+ *retvalP = xmlrpc_c::value_int(addend + adder);
+ }
+};
+
+
+
+int
+main(int const,
+ const char ** const) {
+
+ // It's a good idea to disable SIGPIPE signals; if client closes his end
+ // of the pipe/socket, we'd rather see a failure to send a response than
+ // get killed by the OS.
+ signal(SIGPIPE, SIG_IGN);
+
+ try {
+ xmlrpc_c::registry myRegistry;
+
+ xmlrpc_c::methodPtr const sampleAddMethodP(new sampleAddMethod);
+
+ myRegistry.addMethod("sample.add", sampleAddMethodP);
+
+ xmlrpc_c::serverPstream server(
+ xmlrpc_c::serverPstream::constrOpt()
+ .socketFd(STDIN_FILENO)
+ .registryP(&myRegistry));
+
+ server.runSerial();
+
+ } catch (exception const& e) {
+ cerr << "Something threw an error: " << e.what() << endl;
+ }
+ return 0;
+}
diff --git a/libs/xmlrpc-c/examples/cpp/xmlrpc_inetd_server.cpp b/libs/xmlrpc-c/examples/cpp/xmlrpc_inetd_server.cpp
index 0dd902a..3bfe186 100644
--- a/libs/xmlrpc-c/examples/cpp/xmlrpc_inetd_server.cpp
+++ b/libs/xmlrpc-c/examples/cpp/xmlrpc_inetd_server.cpp
@@ -1,6 +1,25 @@
/* A simple XML-RPC server that runs under Inetd. I.e. it lets the invoking
program handle all the connection switching and simply processes one
RPC on the provided connection (Standard Input) and exits.
+
+ A typical example of where this would be useful is with an Inetd
+ "super server."
+
+ xmlrpc_sample_add_server.cpp is a server that does the same thing,
+ but you give it a TCP port number and it listens for TCP connections
+ and processes RPCs ad infinitum. xmlrpc_socket_server.c is halfway
+ in between those -- you give it an already bound and listening
+ socket, and it listens for TCP connections and processes RPCs ad
+ infinitum.
+
+ Here is an easy way to test this program:
+
+ socketexec --accept --local_port=8080 --stdin -- ./xmlrpc_inetd_server
+
+ Now run the client program 'xmlrpc_sample_add_client'. Socketexec
+ will accept the connection that the client program requests and pass it
+ to this program on Standard Input. This program will perform the RPC,
+ respond to the client, then exit.
*/
#ifndef WIN32
@@ -49,10 +68,8 @@ main(int const,
myRegistry.addMethod("sample.add", sampleAddMethodP);
xmlrpc_c::serverAbyss myAbyssServer(
- myRegistry,
- 8080, // TCP port on which to listen
- "/tmp/xmlrpc_log" // Log file
- );
+ xmlrpc_c::serverAbyss::constrOpt()
+ .registryP(&myRegistry));
myAbyssServer.runConn(STDIN_FILENO);
/* This reads the HTTP POST request from Standard Input and
diff --git a/libs/xmlrpc-c/examples/cpp/xmlrpc_sample_add_server.cpp b/libs/xmlrpc-c/examples/cpp/xmlrpc_sample_add_server.cpp
index ff96ae2..f499e5a 100644
--- a/libs/xmlrpc-c/examples/cpp/xmlrpc_sample_add_server.cpp
+++ b/libs/xmlrpc-c/examples/cpp/xmlrpc_sample_add_server.cpp
@@ -62,10 +62,9 @@ main(int const,
myRegistry.addMethod("sample.add", sampleAddMethodP);
xmlrpc_c::serverAbyss myAbyssServer(
- myRegistry,
- 8080, // TCP port on which to listen
- "/tmp/xmlrpc_log" // Log file
- );
+ xmlrpc_c::serverAbyss::constrOpt()
+ .registryP(&myRegistry)
+ .portNumber(8080));
myAbyssServer.run();
// xmlrpc_c::serverAbyss.run() never returns
diff --git a/libs/xmlrpc-c/examples/cpp/xmlrpc_sample_add_server_cgi.cpp b/libs/xmlrpc-c/examples/cpp/xmlrpc_sample_add_server_cgi.cpp
new file mode 100644
index 0000000..9b80603
--- /dev/null
+++ b/libs/xmlrpc-c/examples/cpp/xmlrpc_sample_add_server_cgi.cpp
@@ -0,0 +1,62 @@
+/* A CGI script that effects a simple XML-RPC server, written in C++.
+
+ See the identically named C program source code for hints on running
+ this example.
+
+*/
+
+#include
+#include
+
+#include
+#include
+#include
+
+using namespace std;
+
+class sampleAddMethod : public xmlrpc_c::method {
+public:
+ sampleAddMethod() {
+ // signature and help strings are documentation -- the client
+ // can query this information with a system.methodSignature and
+ // system.methodHelp RPC.
+ this->_signature = "i:ii"; // method's arguments, result are integers
+ this->_help = "This method adds two integers together";
+ }
+ void
+ execute(xmlrpc_c::paramList const& paramList,
+ xmlrpc_c::value * const retvalP) {
+
+ int const addend(paramList.getInt(0));
+ int const adder(paramList.getInt(1));
+
+ paramList.verifyEnd(2);
+
+ *retvalP = xmlrpc_c::value_int(addend + adder);
+ }
+};
+
+
+
+int
+main(int const,
+ const char ** const) {
+
+ try {
+ xmlrpc_c::registry myRegistry;
+
+ xmlrpc_c::methodPtr const sampleAddMethodP(new sampleAddMethod);
+
+ myRegistry.addMethod("sample.add", sampleAddMethodP);
+
+ xmlrpc_c::serverCgi myServer(
+ xmlrpc_c::serverCgi::constrOpt()
+ .registryP(&myRegistry));
+
+ myServer.processCall();
+
+ } catch (exception const& e) {
+ cerr << "Something failed. " << e.what() << endl;
+ }
+ return 0;
+}
diff --git a/libs/xmlrpc-c/examples/gen_sample_add_xml.c b/libs/xmlrpc-c/examples/gen_sample_add_xml.c
index 736d822..dd65699 100644
--- a/libs/xmlrpc-c/examples/gen_sample_add_xml.c
+++ b/libs/xmlrpc-c/examples/gen_sample_add_xml.c
@@ -28,7 +28,7 @@ die_if_fault_occurred(xmlrpc_env * const envP) {
int
main(int const argc,
- const char ** const argv ATTR_UNUSED) {
+ const char ** const argv) {
char * const methodName = "sample.add";
diff --git a/libs/xmlrpc-c/examples/interrupted_client.c b/libs/xmlrpc-c/examples/interrupted_client.c
index 89cd4e8..1652be2 100644
--- a/libs/xmlrpc-c/examples/interrupted_client.c
+++ b/libs/xmlrpc-c/examples/interrupted_client.c
@@ -2,6 +2,7 @@
both by timeout and by control-C.
*/
+#define _XOPEN_SOURCE 600
#include
#include
#include
@@ -110,7 +111,7 @@ addInterruptibly(xmlrpc_client * const clientP,
int
main(int const argc,
- const char ** const argv ATTR_UNUSED) {
+ const char ** const argv) {
const char * const serverUrl = "http://localhost:8080/RPC2";
diff --git a/libs/xmlrpc-c/examples/interrupted_server.c b/libs/xmlrpc-c/examples/interrupted_server.c
index 9d5c593..56bac81 100644
--- a/libs/xmlrpc-c/examples/interrupted_server.c
+++ b/libs/xmlrpc-c/examples/interrupted_server.c
@@ -1,4 +1,4 @@
-/* A simple standalone XML-RPC server based on Abyss.
+/* A simple standalone XML-RPC server program based on Abyss.
You can terminate this server in controlled fashion with a SIGTERM
signal.
@@ -7,6 +7,7 @@
simpler code, but it is not interruptible with SIGTERM.
*/
+#define _XOPEN_SOURCE 600
#include
#include
#include
@@ -36,7 +37,7 @@ dieIfFailed(const char * const description,
static xmlrpc_server_abyss_t * serverToTerminateP;
static void
-sigtermHandler(int const signalClass ATTR_UNUSED) {
+sigtermHandler(int const signalClass) {
xmlrpc_env env;
@@ -82,8 +83,8 @@ restoreSigtermHandler(void){
static xmlrpc_value *
sample_add(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const serverInfo ATTR_UNUSED,
- void * const channelInfo ATTR_UNUSED) {
+ void * const serverInfo,
+ void * const channelInfo) {
xmlrpc_int x, y, z;
@@ -105,6 +106,11 @@ int
main(int const argc,
const char ** const argv) {
+ struct xmlrpc_method_info3 const methodInfo = {
+ .methodName = "sample.add",
+ .methodFunction = &sample_add,
+ .serverInfo = NULL
+ };
xmlrpc_server_abyss_parms serverparm;
xmlrpc_server_abyss_t * serverP;
xmlrpc_registry * registryP;
@@ -126,8 +132,7 @@ main(int const argc,
registryP = xmlrpc_registry_new(&env);
dieIfFailed("xmlrpc_registry_new", env);
- xmlrpc_registry_add_method2(
- &env, registryP, "sample.add", &sample_add, NULL, NULL, NULL);
+ xmlrpc_registry_add_method3(&env, registryP, &methodInfo);
dieIfFailed("xmlrpc_registry_add_method2", env);
serverparm.config_file_name = NULL;
diff --git a/libs/xmlrpc-c/examples/json.c b/libs/xmlrpc-c/examples/json.c
new file mode 100644
index 0000000..89fe82b
--- /dev/null
+++ b/libs/xmlrpc-c/examples/json.c
@@ -0,0 +1,115 @@
+/*
+ This example program demonstrates the JSON parsing and generating
+ capabilities of Xmlrpc-c.
+
+ The program reads JSON text from Standard Input and displays its value as
+ XML-RPC XML text. It then re-generates JSON from the intermediate
+ parsed information and displays that.
+*/
+#include
+#include
+
+#include
+
+
+
+static void
+dieIfFaultOccurred(xmlrpc_env * const envP) {
+ if (envP->fault_occurred) {
+ fprintf(stderr, "ERROR: %s (%d)\n",
+ envP->fault_string, envP->fault_code);
+ exit(1);
+ }
+}
+
+
+
+void
+printAsXml(xmlrpc_value * const valP) {
+
+ xmlrpc_env env;
+ xmlrpc_mem_block out;
+
+ xmlrpc_env_init(&env);
+
+ XMLRPC_MEMBLOCK_INIT(char, &env, &out, 0);
+
+ dieIfFaultOccurred(&env);
+
+ xmlrpc_serialize_value(&env, &out, valP);
+
+ printf("XML-RPC XML:\n");
+
+ printf("%.*s\n",
+ XMLRPC_MEMBLOCK_SIZE(char, &out),
+ XMLRPC_MEMBLOCK_CONTENTS(char, &out));
+
+ XMLRPC_MEMBLOCK_CLEAN(char, &out);
+ xmlrpc_env_clean(&env);
+}
+
+
+
+void
+printAsJson(xmlrpc_value * const valP) {
+
+ xmlrpc_env env;
+ xmlrpc_mem_block out;
+ xmlrpc_value * val2P;
+
+ xmlrpc_env_init(&env);
+
+ XMLRPC_MEMBLOCK_INIT(char, &env, &out, 0);
+
+ dieIfFaultOccurred(&env);
+
+ xmlrpc_serialize_json(&env, valP, &out);
+
+ dieIfFaultOccurred(&env);
+
+ printf("JSON:\n");
+
+ printf("%.*s\n",
+ XMLRPC_MEMBLOCK_SIZE(char, &out),
+ XMLRPC_MEMBLOCK_CONTENTS(char, &out));
+
+ XMLRPC_MEMBLOCK_CLEAN(char, &out);
+ xmlrpc_env_clean(&env);
+}
+
+
+
+int
+main(int argc, const char *argv[]) {
+
+ xmlrpc_env env;
+ char buf[1024];
+ xmlrpc_value * valP;
+ size_t bytesRead;
+
+ xmlrpc_env_init(&env);
+
+ if (argc-1 > 0) {
+ fprintf(stderr, "This program has no arguments. "
+ "JSON input is from Standard Input\n");
+ exit(1);
+ }
+
+ bytesRead = fread(buf, 1, sizeof(buf), stdin);
+ buf[bytesRead] = '\0';
+
+ valP = xmlrpc_parse_json(&env, buf);
+
+ dieIfFaultOccurred(&env);
+
+ printAsXml(valP);
+
+ printAsJson(valP);
+
+ xmlrpc_DECREF(valP);
+ xmlrpc_env_clean(&env);
+
+ return 0;
+}
+
+
diff --git a/libs/xmlrpc-c/examples/query-meerkat.c b/libs/xmlrpc-c/examples/query-meerkat.c
deleted file mode 100644
index e566654..0000000
--- a/libs/xmlrpc-c/examples/query-meerkat.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/* A simple news-searcher, written in C to demonstrate how to use the
- xmplrpc-c client library.
-
- This program connects to an XMLRPC server that O'Reilly runs on the
- Internet, gets some information, and displays it on Standard Output.
-
- Note that that server is not in any way designed specifically for xmlrpc-c.
- It simply implements the XMLRPC protocol, and works with any client that
- implements XMLRPC.
-
- The service that the aforementioned server provides is that it gives you
- a list of news articles that match a certain regular expression. You give
- that regular expression an argument to this client program.
-
- For more details about O'Reilly's excellent Meerkat news service, see:
- http://www.oreillynet.com/pub/a/rss/2000/11/14/meerkat_xmlrpc.html
-*/
-
-#include
-#include
-#include
-
-#include
-#include
-
-#include "config.h" /* information about this build environment */
-
-#define NAME "XML-RPC C Meerkat Query Demo"
-#define VERSION "1.0"
-#define MEERKAT_URL "http://www.oreillynet.com/meerkat/xml-rpc/server.php"
-
-struct cmdline {
- const char * searchArg;
- int hours;
-};
-
-
-static void
-parseCommandLine(int const argc,
- const char ** const argv,
- struct cmdline * const cmdlineP) {
-
- if (argc-1 < 1) {
- fprintf(stderr, "Need at least one argument: "
- "A mysql regular expression "
- "search pattern. Try 'query-meerkat Linux'\n");
- exit(1);
- } else {
- cmdlineP->searchArg = argv[1];
-
- if (argc-1 < 2) {
- cmdlineP->hours = 24;
- } else {
- cmdlineP->hours = atoi(argv[2]);
- if (cmdlineP->hours > 49) {
- fprintf(stderr, "It's not nice to ask for > 49 hours "
- "at once.\n");
- exit(1);
- }
- if (argc-1 > 2) {
- fprintf(stderr, "There are at most 2 arguments: "
- "search pattern "
- "and number of hours.");
- exit(1);
- }
- }
- }
-}
-
-
-
-static void
-die_if_fault_occurred(xmlrpc_env * const env) {
- /* We're a command-line utility, so we abort if an error occurs. */
- if (env->fault_occurred) {
- fprintf(stderr, "XML-RPC Fault #%d: %s\n",
- env->fault_code, env->fault_string);
- exit(1);
- }
-}
-
-
-
-/* Hey! We fit in one function. */
-int
-main(int const argc,
- const char** const argv) {
-
- struct cmdline cmdline;
- char time_period[16];
- xmlrpc_env env;
- xmlrpc_value *stories, *story;
- size_t size, i;
- int first;
-
- parseCommandLine(argc, argv, &cmdline);
-
- snprintf(time_period, sizeof(time_period), "%dHOUR", cmdline.hours);
-
- xmlrpc_env_init(&env);
-
- /* Set up our client. */
- xmlrpc_client_init2(&env, XMLRPC_CLIENT_NO_FLAGS, NAME, VERSION, NULL, 0);
-
- die_if_fault_occurred(&env);
-
- /* Ask Meerkat to look for matching stories. */
- stories = xmlrpc_client_call(&env, MEERKAT_URL,
- "meerkat.getItems", "({s:s,s:i,s:s})",
- "search", cmdline.searchArg,
- "descriptions", (xmlrpc_int32) 76,
- "time_period", time_period);
- die_if_fault_occurred(&env);
-
- /* Loop over the stories. */
- size = xmlrpc_array_size(&env, stories);
- die_if_fault_occurred(&env);
- first = 1;
- for (i = 0; i < size; i++) {
- const char * title;
- const char * link;
- const char * description;
-
- /* Extract the useful information from our story. */
- story = xmlrpc_array_get_item(&env, stories, i);
- die_if_fault_occurred(&env);
- xmlrpc_decompose_value(&env, story, "{s:s,s:s,s:s,*}",
- "title", &title,
- "link", &link,
- "description", &description);
- die_if_fault_occurred(&env);
-
- /* Print a separator line if necessary. */
- if (first)
- first = 0;
- else
- printf("\n");
-
- /* Print the story. */
- if (strlen(description) > 0) {
- printf("%s\n%s\n%s\n", title, description, link);
- } else {
- printf("%s\n%s\n", title, link);
- }
- free((char*)title);
- free((char*)link);
- free((char*)description);
- }
-
- /* Shut down our client. */
- xmlrpc_DECREF(stories);
- xmlrpc_env_clean(&env);
- xmlrpc_client_cleanup();
-
- return 0;
-}
diff --git a/libs/xmlrpc-c/examples/synch_client.c b/libs/xmlrpc-c/examples/synch_client.c
index 589aa7b..b9b62a2 100644
--- a/libs/xmlrpc-c/examples/synch_client.c
+++ b/libs/xmlrpc-c/examples/synch_client.c
@@ -1,4 +1,4 @@
-/* A simple synchronous XML-RPC client written in C. */
+/* A simple synchronous XML-RPC client program written in C. */
#include
#include
@@ -24,7 +24,7 @@ die_if_fault_occurred(xmlrpc_env * const envP) {
int
main(int const argc,
- const char ** const argv ATTR_UNUSED) {
+ const char ** const argv) {
xmlrpc_env env;
xmlrpc_value * resultP;
diff --git a/libs/xmlrpc-c/examples/xmlrpc_asynch_client.c b/libs/xmlrpc-c/examples/xmlrpc_asynch_client.c
index ec3bd31..ff56dfd 100644
--- a/libs/xmlrpc-c/examples/xmlrpc_asynch_client.c
+++ b/libs/xmlrpc-c/examples/xmlrpc_asynch_client.c
@@ -1,4 +1,4 @@
-/* A simple asynchronous XML-RPC client written in C, as an example of
+/* A simple asynchronous XML-RPC client program written in C, as an example of
Xmlrpc-c asynchronous RPC facilities. This is the same as the
simpler synchronous client xmlprc_sample_add_client.c, except that
it adds 3 different pairs of numbers with the summation RPCs going on
@@ -35,7 +35,7 @@ static void
handle_sample_add_response(const char * const serverUrl,
const char * const methodName,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED,
+ void * const user_data,
xmlrpc_env * const faultP,
xmlrpc_value * const resultP) {
@@ -70,7 +70,7 @@ handle_sample_add_response(const char * const serverUrl,
int
main(int const argc,
- const char ** const argv ATTR_UNUSED) {
+ const char ** const argv) {
const char * const serverUrl = "http://localhost:8080/RPC2";
const char * const methodName = "sample.add";
diff --git a/libs/xmlrpc-c/examples/xmlrpc_inetd_server.c b/libs/xmlrpc-c/examples/xmlrpc_inetd_server.c
index 196b42a..8b1bb48 100644
--- a/libs/xmlrpc-c/examples/xmlrpc_inetd_server.c
+++ b/libs/xmlrpc-c/examples/xmlrpc_inetd_server.c
@@ -1,4 +1,4 @@
-/* A simple standalone XML-RPC server based on Abyss that processes a
+/* A simple standalone XML-RPC server program based on Abyss that processes a
single RPC from an existing TCP connection on Standard Input.
A typical example of where this would be useful is with an Inetd
@@ -21,6 +21,7 @@
respond to the client, then exit.
*/
+#define _XOPEN_SOURCE 600
#include
#include
#include
@@ -63,8 +64,8 @@ setupSignalHandlers(void) {
static xmlrpc_value *
sample_add(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const serverInfo ATTR_UNUSED,
- void * const channelInfo ATTR_UNUSED) {
+ void * const serverInfo,
+ void * const channelInfo) {
xmlrpc_int x, y, z;
@@ -86,6 +87,11 @@ int
main(int const argc,
const char ** const argv) {
+ struct xmlrpc_method_info3 const methodInfo = {
+ .methodName = "sample.add",
+ .methodFunction = &sample_add,
+ .serverInfo = NULL
+ };
TServer abyssServer;
xmlrpc_registry * registryP;
xmlrpc_env env;
@@ -101,8 +107,7 @@ main(int const argc,
registryP = xmlrpc_registry_new(&env);
- xmlrpc_registry_add_method2(
- &env, registryP, "sample.add", &sample_add, NULL, NULL, NULL);
+ xmlrpc_registry_add_method3(&env, registryP, &methodInfo);
ServerCreateNoAccept(&abyssServer, "XmlRpcServer", NULL, NULL);
diff --git a/libs/xmlrpc-c/examples/xmlrpc_loop_server.c b/libs/xmlrpc-c/examples/xmlrpc_loop_server.c
index 2553ea6..af0c750 100644
--- a/libs/xmlrpc-c/examples/xmlrpc_loop_server.c
+++ b/libs/xmlrpc-c/examples/xmlrpc_loop_server.c
@@ -1,11 +1,14 @@
-/* A simple standalone XML-RPC server based on Abyss that contains a
+/* A simple standalone XML-RPC server program based on Abyss that contains a
simple one-thread request processing loop.
+ This uses the "provide your own Abyss server" mode of operation.
+
xmlrpc_sample_add_server.c is a server that does the same thing, but
does it by running a full Abyss daemon in the background, so it has
less control over how the requests are served.
*/
+#define _XOPEN_SOURCE 600
#include
#include
#include
@@ -66,7 +69,7 @@ printPeerIpAddr(TSession * const abyssSessionP) {
static xmlrpc_value *
sample_add(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const serverInfo ATTR_UNUSED,
+ void * const serverInfo,
void * const channelInfo) {
xmlrpc_int x, y, z;
@@ -117,6 +120,11 @@ int
main(int const argc,
const char ** const argv) {
+ struct xmlrpc_method_info3 const methodInfo = {
+ .methodName = "sample.add",
+ .methodFunction = &sample_add,
+ .serverInfo = NULL
+ };
TServer abyssServer;
xmlrpc_registry * registryP;
xmlrpc_env env;
@@ -136,8 +144,7 @@ main(int const argc,
registryP = xmlrpc_registry_new(&env);
- xmlrpc_registry_add_method2(
- &env, registryP, "sample.add", &sample_add, NULL, NULL, NULL);
+ xmlrpc_registry_add_method3(&env, registryP, &methodInfo);
xmlrpc_registry_set_shutdown(registryP,
&requestShutdown, &terminationRequested);
diff --git a/libs/xmlrpc-c/examples/xmlrpc_sample_add_client.c b/libs/xmlrpc-c/examples/xmlrpc_sample_add_client.c
index f675a92..3a219dd 100644
--- a/libs/xmlrpc-c/examples/xmlrpc_sample_add_client.c
+++ b/libs/xmlrpc-c/examples/xmlrpc_sample_add_client.c
@@ -1,7 +1,10 @@
-/* A simple synchronous XML-RPC client written in C, as an example of
+/* A simple synchronous XML-RPC client program written in C, as an example of
an Xmlrpc-c client. This invokes the sample.add procedure that the
- Xmlrpc-c example server.c server provides. I.e. it adds to numbers
- together, the hard way.
+ Xmlrpc-c example xmlrpc_sample_add_server.c server provides. I.e. it adds
+ two numbers together, the hard way.
+
+ This sends the RPC to the server running on the local system ("localhost"),
+ HTTP Port 8080.
*/
#include
@@ -16,9 +19,9 @@
#define VERSION "1.0"
static void
-die_if_fault_occurred (xmlrpc_env * const envP) {
+dieIfFaultOccurred (xmlrpc_env * const envP) {
if (envP->fault_occurred) {
- fprintf(stderr, "XML-RPC Fault: %s (%d)\n",
+ fprintf(stderr, "ERROR: %s (%d)\n",
envP->fault_string, envP->fault_code);
exit(1);
}
@@ -28,7 +31,7 @@ die_if_fault_occurred (xmlrpc_env * const envP) {
int
main(int const argc,
- const char ** const argv ATTR_UNUSED) {
+ const char ** const argv) {
xmlrpc_env env;
xmlrpc_value * resultP;
@@ -46,7 +49,7 @@ main(int const argc,
/* Start up our XML-RPC client library. */
xmlrpc_client_init2(&env, XMLRPC_CLIENT_NO_FLAGS, NAME, VERSION, NULL, 0);
- die_if_fault_occurred(&env);
+ dieIfFaultOccurred(&env);
printf("Making XMLRPC call to server url '%s' method '%s' "
"to request the sum "
@@ -55,11 +58,11 @@ main(int const argc,
/* Make the remote procedure call */
resultP = xmlrpc_client_call(&env, serverUrl, methodName,
"(ii)", (xmlrpc_int32) 5, (xmlrpc_int32) 7);
- die_if_fault_occurred(&env);
+ dieIfFaultOccurred(&env);
/* Get our sum and print it out. */
xmlrpc_read_int(&env, resultP, &sum);
- die_if_fault_occurred(&env);
+ dieIfFaultOccurred(&env);
printf("The sum is %d\n", sum);
/* Dispose of our result value. */
diff --git a/libs/xmlrpc-c/examples/xmlrpc_sample_add_server.c b/libs/xmlrpc-c/examples/xmlrpc_sample_add_server.c
index dbd2861..a4a4370 100644
--- a/libs/xmlrpc-c/examples/xmlrpc_sample_add_server.c
+++ b/libs/xmlrpc-c/examples/xmlrpc_sample_add_server.c
@@ -1,4 +1,24 @@
-/* A simple standalone XML-RPC server written in C. */
+/* A simple standalone XML-RPC server program written in C. */
+
+/* This server knows one RPC class (besides the system classes):
+ "sample.add".
+
+ The program takes one argument: the HTTP port number on which the server
+ is to accept connections, in decimal.
+
+ You can use the example program 'xmlrpc_sample_add_client' to send an RPC
+ to this server.
+
+ Example:
+
+ $ ./xmlrpc_sample_add_server 8080&
+ $ ./xmlrpc_sample_add_client
+
+ For more fun, run client and server in separate terminals and turn on
+ tracing for each:
+
+ $ export XMLRPC_TRACE_XML=1
+*/
#include
#include
@@ -25,8 +45,8 @@
static xmlrpc_value *
sample_add(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const serverInfo ATTR_UNUSED,
- void * const channelInfo ATTR_UNUSED) {
+ void * const serverInfo,
+ void * const channelInfo) {
xmlrpc_int32 x, y, z;
@@ -54,6 +74,10 @@ int
main(int const argc,
const char ** const argv) {
+ struct xmlrpc_method_info3 const methodInfo = {
+ /* .methodName = */ "sample.add",
+ /* .methodFunction = */ &sample_add,
+ };
xmlrpc_server_abyss_parms serverparm;
xmlrpc_registry * registryP;
xmlrpc_env env;
@@ -70,8 +94,7 @@ main(int const argc,
registryP = xmlrpc_registry_new(&env);
- xmlrpc_registry_add_method2(
- &env, registryP, "sample.add", &sample_add, NULL, NULL, NULL);
+ xmlrpc_registry_add_method3(&env, registryP, &methodInfo);
/* In the modern form of the Abyss API, we supply parameters in memory
like a normal API. We select the modern form by setting
diff --git a/libs/xmlrpc-c/examples/xmlrpc_sample_add_server_cgi.c b/libs/xmlrpc-c/examples/xmlrpc_sample_add_server_cgi.c
index fa476a7..e34c4d7 100644
--- a/libs/xmlrpc-c/examples/xmlrpc_sample_add_server_cgi.c
+++ b/libs/xmlrpc-c/examples/xmlrpc_sample_add_server_cgi.c
@@ -1,4 +1,22 @@
-/* A simple standalone XML-RPC server written in C. */
+/* A CGI script written in C to effect a simple XML-RPC server.
+
+ Example of use:
+
+ - Compile this as the executable 'xmlrpc_sample_add_server.cgi'
+
+ - Place the .cgi file in web server www.example.com's /cgi-bin
+ directory.
+
+ - Configure the web server to permit CGI scripts in /cgi-bin
+ (Apache ExecCgi directory option).
+
+ - Configure the web server to recognize this .cgi file as a CGI
+ script (Apache "AddHandler cgi-script ..." or ScriptAlias).
+
+ - $ xmlrpc http://www.example.com/cgi-bin/xmlrpc_sample_add_server.cgi \
+ sample.add i/5 i/7
+*/
+
#include
#include
@@ -12,7 +30,7 @@
static xmlrpc_value *
sample_add(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED) {
+ void * const user_data) {
xmlrpc_int32 x, y, z;
diff --git a/libs/xmlrpc-c/examples/xmlrpc_server_validatee.c b/libs/xmlrpc-c/examples/xmlrpc_server_validatee.c
index 927da8a..ad613a8 100644
--- a/libs/xmlrpc-c/examples/xmlrpc_server_validatee.c
+++ b/libs/xmlrpc-c/examples/xmlrpc_server_validatee.c
@@ -66,7 +66,7 @@
static xmlrpc_value *
array_of_structs(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED) {
+ void * const user_data) {
xmlrpc_value * arrayP;
xmlrpc_value * retval;
@@ -114,7 +114,7 @@ array_of_structs(xmlrpc_env * const envP,
static xmlrpc_value *
count_entities(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED) {
+ void * const user_data) {
const char * str;
size_t len, i;
@@ -154,7 +154,7 @@ count_entities(xmlrpc_env * const envP,
static xmlrpc_value *
easy_struct(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED) {
+ void * const user_data) {
xmlrpc_int32 larry, moe, curly;
@@ -179,7 +179,7 @@ easy_struct(xmlrpc_env * const envP,
static xmlrpc_value *
echo_struct(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED) {
+ void * const user_data) {
xmlrpc_value * sP;
@@ -198,9 +198,9 @@ echo_struct(xmlrpc_env * const envP,
*/
static xmlrpc_value *
-many_types(xmlrpc_env * const env ATTR_UNUSED,
+many_types(xmlrpc_env * const env,
xmlrpc_value * const param_array,
- void * const user_data ATTR_UNUSED) {
+ void * const user_data) {
/* Create another reference to our argument array and return it as is. */
xmlrpc_INCREF(param_array);
@@ -244,7 +244,7 @@ concatenate(xmlrpc_env * const envP,
static xmlrpc_value *
moderate_array(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED) {
+ void * const user_data) {
xmlrpc_value * retval;
xmlrpc_value * arrayP;
@@ -295,7 +295,7 @@ moderate_array(xmlrpc_env * const envP,
static xmlrpc_value *
nested_struct(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED) {
+ void * const user_data) {
xmlrpc_value * yearsP;
xmlrpc_value * retval;
@@ -333,7 +333,7 @@ nested_struct(xmlrpc_env * const envP,
static xmlrpc_value *
struct_return(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED) {
+ void * const user_data) {
xmlrpc_int32 i;
diff --git a/libs/xmlrpc-c/examples/xmlrpc_socket_server.c b/libs/xmlrpc-c/examples/xmlrpc_socket_server.c
index 2e2cd8b..9cbc5aa 100644
--- a/libs/xmlrpc-c/examples/xmlrpc_socket_server.c
+++ b/libs/xmlrpc-c/examples/xmlrpc_socket_server.c
@@ -1,5 +1,5 @@
-/* A simple standalone XML-RPC server written in C as an example of use of
- the Xmlrpc-c libraries.
+/* A simple standalone XML-RPC server program written in C as an example of
+ use of the Xmlrpc-c libraries.
This example expects an already bound socket on Standard Input, ready to
be listened on for client connections. Also see xmlrpc_sample_add_server,
@@ -7,7 +7,11 @@
creates the socket itself. Also see xmlrpc_inetd_server.c, which is
the same thing except you give it a socket which is already connected
to a client.
- */
+
+ Example:
+
+ $ socketexec -local_port=8080 ./xmlrpc_socket_server
+*/
#include
#include
@@ -33,7 +37,8 @@
static xmlrpc_value *
sample_add(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
- void * const user_data ATTR_UNUSED) {
+ void * const serverInfo,
+ void * const channelInfo) {
xmlrpc_int32 x, y, z;
@@ -61,6 +66,11 @@ int
main(int const argc,
const char ** const argv) {
+ struct xmlrpc_method_info3 const methodInfo = {
+ .methodName = "sample.add",
+ .methodFunction = &sample_add,
+ .serverInfo = NULL
+ };
xmlrpc_server_abyss_parms serverparm;
xmlrpc_registry * registryP;
xmlrpc_env env;
@@ -77,8 +87,7 @@ main(int const argc,
registryP = xmlrpc_registry_new(&env);
- xmlrpc_registry_add_method(
- &env, registryP, NULL, "sample.add", &sample_add, NULL);
+ xmlrpc_registry_add_method3(&env, registryP, &methodInfo);
/* In the modern form of the Abyss API, we supply parameters in memory
like a normal API. We select the modern form by setting
diff --git a/libs/xmlrpc-c/include/Makefile b/libs/xmlrpc-c/include/Makefile
index d396ca7..28fd00b 100644
--- a/libs/xmlrpc-c/include/Makefile
+++ b/libs/xmlrpc-c/include/Makefile
@@ -36,18 +36,22 @@ xmlrpc-c/config.h: $(BLDDIR)/$(SUBDIR)/xmlrpc-c
@echo ' #define XMLRPC_SOCKET SOCKET' >>$@
@echo ' #define XMLRPC_HAVE_TIMEVAL 0' >>$@
@echo ' #define XMLRPC_HAVE_TIMESPEC 0' >>$@
+ @echo ' #define XMLRPC_HAVE_PTHREAD 0' >>$@
@echo '#else' >>$@
@echo ' #define XMLRPC_SOCKET int' >>$@
@echo ' #define XMLRPC_HAVE_TIMEVAL 1' >>$@
@echo ' #define XMLRPC_HAVE_TIMESPEC 1' >>$@
+ @echo ' #define XMLRPC_HAVE_PTHREAD 1' >>$@
@echo '#endif' >>$@
@echo '' >>$@
@echo '#if defined(_MSC_VER)' >>$@
@echo ' /* Newer MSVC has long long, but MSVC 6 does not */' >>$@
@echo ' #define XMLRPC_INT64 __int64' >>$@
+ @echo ' #define XMLRPC_PRId64 "I64"' >>$@
@echo ' #define XMLRPC_INT32 __int32' >>$@
@echo '#else' >>$@
@echo ' #define XMLRPC_INT64 long long' >>$@
+ @echo ' #define XMLRPC_PRId64 "lld"' >>$@
@echo ' #define XMLRPC_INT32 int' >>$@
@echo '#endif' >>$@
@echo '#endif' >>$@
@@ -58,7 +62,7 @@ $(BLDDIR)/$(SUBDIR)/xmlrpc-c:
COMPAT_LINK_CMDS = \
$(LN_S) xmlrpc-c/oldxmlrpc.h xmlrpc.h; \
$(LN_S) xmlrpc-c/server.h xmlrpc_server.h; \
- $(LN_S) xmlrpc-c/server_abyss.h xmlrpc_server_abyss.h; \
+ $(LN_S) xmlrpc-c/server_abyss.h xmlrpc_abyss.h; \
$(LN_S) xmlrpc-c/server_w32httpsys.h xmlrpc_server_w32httpsys.h; \
HEADERS_TO_INSTALL = \
@@ -67,6 +71,7 @@ HEADERS_TO_INSTALL = \
xmlrpc-c/c_util.h \
xmlrpc-c/util.h \
xmlrpc-c/base.h \
+ xmlrpc-c/json.h \
xmlrpc-c/abyss.h \
xmlrpc-c/abyss_unixsock.h \
xmlrpc-c/abyss_winsock.h \
@@ -119,22 +124,25 @@ default: all
all:
.PHONY: install-compat-hdr
-install-compat-hdr:
+install-compat-hdr: install-headers
# Install old names of header files for backward compatibility
cd $(DESTDIR)$(HEADERINST_DIR); \
rm -f xmlrpc.h xmlrpc_client.h xmlrpc_server.h xmlrpc_cgi.h \
- xmlrpc_server_abyss.h xmlrpc_server_w32httpsys.h \
+ xmlrpc_server_abyss.h xmlrpc_abyss.h \
+ xmlrpc_server_w32httpsys.h \
XmlRpcCpp.h; \
$(COMPAT_LINK_CMDS)
.PHONY: install
install: install-common install-compat-hdr
-.PHONY: clean distclean dep
+.PHONY: clean
clean:
-distclean:
rm -f xmlrpc-c/config.h
+.PHONY: distclean
+distclean: clean
+
.PHONY: check
check:
diff --git a/libs/xmlrpc-c/include/xmlrpc-c/abyss.h b/libs/xmlrpc-c/include/xmlrpc-c/abyss.h
index e044008..627e872 100644
--- a/libs/xmlrpc-c/include/xmlrpc-c/abyss.h
+++ b/libs/xmlrpc-c/include/xmlrpc-c/abyss.h
@@ -21,6 +21,7 @@ extern "C" {
#include
+#include
#include
/****************************************************************************
@@ -33,9 +34,11 @@ typedef int abyss_bool;
GLOBAL (STATIC) PROGRAM STUFF
****************************************************************************/
+XMLRPC_DLLEXPORT
void
AbyssInit(const char ** const errorP);
+XMLRPC_DLLEXPORT
void
AbyssTerm(void);
@@ -45,23 +48,29 @@ AbyssTerm(void);
typedef struct MIMEType MIMEType;
+XMLRPC_DLLEXPORT
MIMEType *
MIMETypeCreate(void);
+XMLRPC_DLLEXPORT
void
MIMETypeDestroy(MIMEType * const MIMETypeP);
+XMLRPC_DLLEXPORT
void
MIMETypeInit(void);
+XMLRPC_DLLEXPORT
void
MIMETypeTerm(void);
+XMLRPC_DLLEXPORT
abyss_bool
MIMETypeAdd2(MIMEType * const MIMETypeP,
const char * const type,
const char * const ext);
+XMLRPC_DLLEXPORT
abyss_bool
MIMETypeAdd(const char * const type,
const char * const ext);
@@ -81,9 +90,11 @@ typedef struct _TSocket TSocket;
#include
#endif
+XMLRPC_DLLEXPORT
void
ChanSwitchInit(const char ** const errorP);
+XMLRPC_DLLEXPORT
void
ChanSwitchTerm(void);
@@ -92,18 +103,23 @@ ChanSwitchTerm(void);
in abyss_unixsock.h, etc.
*/
+XMLRPC_DLLEXPORT
void
ChanSwitchDestroy(TChanSwitch * const chanSwitchP);
+XMLRPC_DLLEXPORT
void
ChannelInit(const char ** const errorP);
+XMLRPC_DLLEXPORT
void
ChannelTerm(void);
+XMLRPC_DLLEXPORT
void
ChannelDestroy(TChannel * const channelP);
+XMLRPC_DLLEXPORT
void
SocketDestroy(TSocket * const socketP);
@@ -120,6 +136,7 @@ typedef struct {
typedef struct _TSession TSession;
+XMLRPC_DLLEXPORT
abyss_bool
ServerCreate(TServer * const serverP,
const char * const name,
@@ -127,11 +144,13 @@ ServerCreate(TServer * const serverP,
const char * const filespath,
const char * const logfilename);
+XMLRPC_DLLEXPORT
void
ServerCreateSwitch(TServer * const serverP,
TChanSwitch * const chanSwitchP,
const char ** const errorP);
+XMLRPC_DLLEXPORT
abyss_bool
ServerCreateSocket(TServer * const serverP,
const char * const name,
@@ -140,71 +159,87 @@ ServerCreateSocket(TServer * const serverP,
const char * const logfilename);
#define HAVE_SERVER_CREATE_SOCKET_2
+XMLRPC_DLLEXPORT
void
ServerCreateSocket2(TServer * const serverP,
TSocket * const socketP,
const char ** const errorP);
+XMLRPC_DLLEXPORT
abyss_bool
ServerCreateNoAccept(TServer * const serverP,
const char * const name,
const char * const filespath,
const char * const logfilename);
+XMLRPC_DLLEXPORT
void
ServerFree(TServer * const serverP);
+XMLRPC_DLLEXPORT
void
ServerSetName(TServer * const serverP,
const char * const name);
+XMLRPC_DLLEXPORT
void
ServerSetFilesPath(TServer * const serverP,
const char * const filesPath);
+XMLRPC_DLLEXPORT
void
ServerSetLogFileName(TServer * const serverP,
const char * const logFileName);
#define HAVE_SERVER_SET_KEEPALIVE_TIMEOUT 1
+XMLRPC_DLLEXPORT
void
ServerSetKeepaliveTimeout(TServer * const serverP,
xmlrpc_uint32_t const keepaliveTimeout);
#define HAVE_SERVER_SET_KEEPALIVE_MAX_CONN 1
+XMLRPC_DLLEXPORT
void
ServerSetKeepaliveMaxConn(TServer * const serverP,
xmlrpc_uint32_t const keepaliveMaxConn);
#define HAVE_SERVER_SET_TIMEOUT 1
+XMLRPC_DLLEXPORT
void
ServerSetTimeout(TServer * const serverP,
xmlrpc_uint32_t const timeout);
#define HAVE_SERVER_SET_ADVERTISE 1
+XMLRPC_DLLEXPORT
void
ServerSetAdvertise(TServer * const serverP,
abyss_bool const advertise);
#define HAVE_SERVER_SET_MIME_TYPE 1
+XMLRPC_DLLEXPORT
void
ServerSetMimeType(TServer * const serverP,
MIMEType * const MIMETypeP);
+XMLRPC_DLLEXPORT
int
ServerInit(TServer * const serverP);
+XMLRPC_DLLEXPORT
void
ServerRun(TServer * const serverP);
+XMLRPC_DLLEXPORT
void
ServerRunOnce(TServer * const serverP);
/* ServerRunOnce2() is obsolete. See user's guide. */
+XMLRPC_DLLEXPORT
void
ServerRunOnce2(TServer * const serverP,
enum abyss_foreback const foregroundBackground);
+XMLRPC_DLLEXPORT
void
ServerRunChannel(TServer * const serverP,
TChannel * const channelP,
@@ -212,24 +247,30 @@ ServerRunChannel(TServer * const serverP,
const char ** const errorP);
#define HAVE_SERVER_RUN_CONN_2
+XMLRPC_DLLEXPORT
void
ServerRunConn2(TServer * const serverP,
TSocket * const connectedSocketP,
const char ** const errorP);
+XMLRPC_DLLEXPORT
void
ServerRunConn(TServer * const serverP,
TOsSocket const connectedSocket);
+XMLRPC_DLLEXPORT
void
ServerDaemonize(TServer * const serverP);
+XMLRPC_DLLEXPORT
void
ServerTerminate(TServer * const serverP);
+XMLRPC_DLLEXPORT
void
ServerResetTerminate(TServer * const serverP);
+XMLRPC_DLLEXPORT
void
ServerUseSigchld(TServer * const serverP);
@@ -242,15 +283,31 @@ typedef abyss_bool (*URIHandler) (TSession *); /* deprecated */
struct URIHandler2;
-typedef void (*initHandlerFn)(struct URIHandler2 *,
- abyss_bool *);
+typedef void (*initHandlerFn)(struct URIHandler2 *, abyss_bool *);
typedef void (*termHandlerFn)(void *);
+typedef void (*handleReq3Fn)(void *,
+ TSession *,
+ abyss_bool *);
+
typedef void (*handleReq2Fn)(struct URIHandler2 *,
TSession *,
abyss_bool *);
+struct ServerReqHandler3 {
+ termHandlerFn term;
+ handleReq3Fn handleReq;
+ void * userdata;
+ size_t handleReqStackSize; /* zero = default */
+};
+
+XMLRPC_DLLEXPORT
+void
+ServerAddHandler3(TServer * const serverP,
+ const struct ServerReqHandler3 * const handlerP,
+ abyss_bool * const successP);
+
typedef struct URIHandler2 {
initHandlerFn init;
termHandlerFn term;
@@ -259,11 +316,13 @@ typedef struct URIHandler2 {
void * userdata;
} URIHandler2;
+XMLRPC_DLLEXPORT
void
ServerAddHandler2(TServer * const srvP,
URIHandler2 * const handlerP,
abyss_bool * const successP);
+XMLRPC_DLLEXPORT
abyss_bool
ServerAddHandler(TServer * const srvP,
URIHandler const handler);
@@ -274,6 +333,7 @@ typedef abyss_bool (*THandlerDflt) (TSession *);
for the same type
*/
+XMLRPC_DLLEXPORT
void
ServerDefaultHandler(TServer * const srvP,
THandlerDflt const handler);
@@ -283,10 +343,12 @@ ServerDefaultHandler(TServer * const srvP,
inappropriate for an API.
*/
+XMLRPC_DLLEXPORT
abyss_bool
ConfReadServerFile(const char * const filename,
TServer * const srvP);
+XMLRPC_DLLEXPORT
void
LogWrite(TServer * const srvP,
const char * const c);
@@ -309,7 +371,7 @@ typedef struct {
const char * query;
/* The query part of the URI (stuff after '?'). NULL if none. */
const char * host;
- /* NOT the value of the host: header. Rather, the name of the
+ /* NOT the value of the host: header field. Rather, the name of the
target host (could be part of the host: value; could be from the
URI). No port number. NULL if request does not specify a host
name.
@@ -319,7 +381,7 @@ typedef struct {
const char * referer;
const char * requestline;
const char * user;
- /* Requesting user (from authorization: header). NULL if
+ /* Requesting user (from authorization: header field). NULL if
request doesn't specify or handler has not authenticated it.
*/
xmlrpc_uint16_t port;
@@ -329,98 +391,157 @@ typedef struct {
abyss_bool keepalive;
} TRequestInfo;
+XMLRPC_DLLEXPORT
abyss_bool
SessionRefillBuffer(TSession * const sessionP);
+XMLRPC_DLLEXPORT
size_t
SessionReadDataAvail(TSession * const sessionP);
+XMLRPC_DLLEXPORT
void
SessionGetReadData(TSession * const sessionP,
size_t const max,
const char ** const outStartP,
size_t * const outLenP);
+XMLRPC_DLLEXPORT
void
SessionGetRequestInfo(TSession * const sessionP,
const TRequestInfo ** const requestInfoPP);
+XMLRPC_DLLEXPORT
void
SessionGetChannelInfo(TSession * const sessionP,
void ** const channelInfoPP);
+XMLRPC_DLLEXPORT
void *
SessionGetDefaultHandlerCtx(TSession * const sessionP);
+XMLRPC_DLLEXPORT
char *
RequestHeaderValue(TSession * const sessionP,
const char * const name);
+XMLRPC_DLLEXPORT
abyss_bool
ResponseAddField(TSession * const sessionP,
const char * const name,
const char * const value);
-void
+XMLRPC_DLLEXPORT
+abyss_bool
ResponseWriteStart(TSession * const sessionP);
/* For backward compatibility: */
#define ResponseWrite ResponseWriteStart
+XMLRPC_DLLEXPORT
abyss_bool
ResponseWriteBody(TSession * const sessionP,
const char * const data,
xmlrpc_uint32_t const len);
+XMLRPC_DLLEXPORT
abyss_bool
ResponseWriteEnd(TSession * const sessionP);
+XMLRPC_DLLEXPORT
abyss_bool
ResponseChunked(TSession * const sessionP);
+XMLRPC_DLLEXPORT
xmlrpc_uint16_t
ResponseStatusFromErrno(int const errnoArg);
+XMLRPC_DLLEXPORT
void
ResponseStatus(TSession * const sessionP,
xmlrpc_uint16_t const code);
+XMLRPC_DLLEXPORT
void
ResponseStatusErrno(TSession * const sessionP);
+XMLRPC_DLLEXPORT
abyss_bool
ResponseContentType(TSession * const serverP,
const char * const type);
+XMLRPC_DLLEXPORT
abyss_bool
ResponseContentLength(TSession * const sessionP,
xmlrpc_uint64_t const len);
+typedef struct {
+/*----------------------------------------------------------------------------
+ These are parameters to control the HTTP "Access Control functions. That's
+ where the client asks whether it is OK to send a request that some other
+ server asked the client to send (e.g. a person web browses a page at
+ a.example.com, and it sends a script that executes on the user's computer
+ and tries to perform an XML-RPC RPC on b.example.com. The user's browser
+ first asks b.example.com if it is OK to do an RPC that is really initiated
+ by a.example.com.
+-----------------------------------------------------------------------------*/
+ const char * allowOrigin;
+ /* This tells what original servers (a.example.com in the example
+ above) are allowed to submit RPCs indirectly to us. The value is a
+ verbatim value for an HTTP Access-Control-Allow-Origin header field
+ (just the value part of the field, not the whole field). "*"
+ therefore means everyone is allowed. "" means no one.
+
+ NULL means not to say anything about access control to the client.
+ */
+ abyss_bool expires;
+ /* The permissions herein expire after a certain period from now.
+ 'maxAge' is that period.
+ */
+ unsigned int maxAge;
+ /* Meaningful only when 'expires' is true. The expiration period
+ in seconds. Zero is valid.
+ */
+} ResponseAccessCtl;
+
+XMLRPC_DLLEXPORT
+void
+ResponseAccessControl(TSession * const abyssSessionP,
+ ResponseAccessCtl const accessControl);
+
+XMLRPC_DLLEXPORT
void
ResponseError2(TSession * const sessionP,
const char * const explanation);
+XMLRPC_DLLEXPORT
void
ResponseError(TSession * const sessionP);
+XMLRPC_DLLEXPORT
const char *
MIMETypeFromExt(const char * const ext);
+XMLRPC_DLLEXPORT
const char *
MIMETypeFromExt2(MIMEType * const MIMETypeP,
const char * const ext);
+XMLRPC_DLLEXPORT
const char *
MIMETypeFromFileName2(MIMEType * const MIMETypeP,
const char * const fileName);
+XMLRPC_DLLEXPORT
const char *
MIMETypeFromFileName(const char * const fileName);
+XMLRPC_DLLEXPORT
const char *
MIMETypeGuessFromFile2(MIMEType * const MIMETypeP,
const char * const fileName);
+XMLRPC_DLLEXPORT
const char *
MIMETypeGuessFromFile(const char * const filename);
@@ -460,7 +581,7 @@ MIMETypeGuessFromFile(const char * const filename);
** Maximum number of simultaneous connections
*********************************************************************/
-#define MAX_CONN 100000
+#define MAX_CONN 16
/*********************************************************************
** General purpose definitions
@@ -482,26 +603,21 @@ MIMETypeGuessFromFile(const char * const filename);
** Range
*********************************************************************/
+XMLRPC_DLLEXPORT
abyss_bool
RangeDecode(char * const str,
xmlrpc_uint64_t const filesize,
xmlrpc_uint64_t * const start,
xmlrpc_uint64_t * const end);
+XMLRPC_DLLEXPORT
abyss_bool DateInit(void);
/*********************************************************************
-** Base64
-*********************************************************************/
-
-void
-Base64Encode(const char * const chars,
- char * const base64);
-
-/*********************************************************************
** Session
*********************************************************************/
+XMLRPC_DLLEXPORT
abyss_bool SessionLog(TSession * const s);
diff --git a/libs/xmlrpc-c/include/xmlrpc-c/abyss_winsock.h b/libs/xmlrpc-c/include/xmlrpc-c/abyss_winsock.h
index f376446..8aeb782 100644
--- a/libs/xmlrpc-c/include/xmlrpc-c/abyss_winsock.h
+++ b/libs/xmlrpc-c/include/xmlrpc-c/abyss_winsock.h
@@ -7,17 +7,19 @@ struct abyss_win_chaninfo {
struct sockaddr peerAddr;
};
-
+XMLRPC_DLLEXPORT
void
ChanSwitchWinCreate(unsigned short const portNumber,
TChanSwitch ** const chanSwitchPP,
const char ** const errorP);
+XMLRPC_DLLEXPORT
void
ChanSwitchWinCreateWinsock(SOCKET const winsock,
TChanSwitch ** const chanSwitchPP,
const char ** const errorP);
+XMLRPC_DLLEXPORT
void
ChannelWinCreateWinsock(SOCKET const fd,
TChannel ** const channelPP,
diff --git a/libs/xmlrpc-c/include/xmlrpc-c/base.h b/libs/xmlrpc-c/include/xmlrpc-c/base.h
index a68a4f1..cdc9161 100644
--- a/libs/xmlrpc-c/include/xmlrpc-c/base.h
+++ b/libs/xmlrpc-c/include/xmlrpc-c/base.h
@@ -6,26 +6,40 @@
#include
#include
#include
+#include
#include
#include
- /* Defines XMLRPC_HAVE_WCHAR, XMLRPC_INT64 */
+ /* Defines XMLRPC_HAVE_WCHAR, XMLRPC_INT64, XMLRPC_HAVE_TIMEVAL */
#if XMLRPC_HAVE_WCHAR
#include
#endif
+#if XMLRPC_HAVE_TIMEVAL
+#include
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
-
/*=========================================================================
** Version of libxmlrpc
**=======================================================================*/
+
+/* These are for backward compatibility -- they can't be exported from a
+ Windows DLL. xmlrpc_server_version() is preferred.
+*/
extern unsigned int const xmlrpc_version_major;
extern unsigned int const xmlrpc_version_minor;
extern unsigned int const xmlrpc_version_point;
+XMLRPC_DLLEXPORT
+void
+xmlrpc_version(unsigned int * const majorP,
+ unsigned int * const minorP,
+ unsigned int * const pointP);
+
/*=========================================================================
** C types equivalent to XML-RPC types
**=======================================================================*/
@@ -50,6 +64,19 @@ typedef double xmlrpc_double;
so it's probably clearer just to use that. This typedef is here
for mathematical completeness.
*/
+typedef struct {
+ /* A datetime of the type defined by XML-RPC with
+ a few extensions. I.e. in the range 1-9999 AD with microsecond
+ resolution.
+ */
+ unsigned int Y; /* 1-? */
+ unsigned int M; /* 1-12 */
+ unsigned int D; /* 1-31 */
+ unsigned int h; /* 0-23 */
+ unsigned int m; /* 0-59 */
+ unsigned int s; /* 0-59 */
+ unsigned int u; /* 0-999999 */
+} xmlrpc_datetime;
/* xmlrpc_socket is just for backward compatibility, in case someone decided
to use this in user code. New code should use the native type for a
@@ -89,12 +116,13 @@ typedef enum {
#define XMLRPC_HAVE_I8 1
-/* These are *always* allocated on the heap. No exceptions. */
typedef struct _xmlrpc_value xmlrpc_value;
+XMLRPC_DLLEXPORT
const char *
xmlrpc_type_name(xmlrpc_type const type);
+XMLRPC_DLLEXPORT
void
xmlrpc_abort_if_array_bad(xmlrpc_value * const arrayP);
@@ -102,109 +130,193 @@ xmlrpc_abort_if_array_bad(xmlrpc_value * const arrayP);
xmlrpc_abort_if_array_bad(val)
/* Increment the reference count of an xmlrpc_value. */
-extern void xmlrpc_INCREF (xmlrpc_value* const value);
+XMLRPC_DLLEXPORT
+extern void xmlrpc_INCREF(xmlrpc_value* const value);
/* Decrement the reference count of an xmlrpc_value. If there
** are no more references, free it. */
-extern void xmlrpc_DECREF (xmlrpc_value* const value);
+XMLRPC_DLLEXPORT
+extern void xmlrpc_DECREF(xmlrpc_value* const value);
/* Get the type of an XML-RPC value. */
+XMLRPC_DLLEXPORT
extern xmlrpc_type xmlrpc_value_type (xmlrpc_value* const value);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_int_new(xmlrpc_env * const envP,
int const intValue);
+XMLRPC_DLLEXPORT
+void
+xmlrpc_read_int(xmlrpc_env * const envP,
+ const xmlrpc_value * const valueP,
+ int * const intValueP);
+
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_i8_new(xmlrpc_env * const envP,
xmlrpc_int64 const value);
+XMLRPC_DLLEXPORT
void
-xmlrpc_read_int(xmlrpc_env * const envP,
- const xmlrpc_value * const valueP,
- int * const intValueP);
+xmlrpc_read_i8(xmlrpc_env * const envP,
+ const xmlrpc_value * const valueP,
+ xmlrpc_int64 * const intValueP);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_bool_new(xmlrpc_env * const envP,
xmlrpc_bool const boolValue);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_bool(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
xmlrpc_bool * const boolValueP);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_double_new(xmlrpc_env * const envP,
double const doubleValue);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_double(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
xmlrpc_double * const doubleValueP);
+XMLRPC_DLLEXPORT
+xmlrpc_value *
+xmlrpc_datetime_new(xmlrpc_env * const envP,
+ xmlrpc_datetime const dt);
+
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_datetime_new_str(xmlrpc_env * const envP,
const char * const value);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_datetime_new_sec(xmlrpc_env * const envP,
time_t const value);
+XMLRPC_DLLEXPORT
+xmlrpc_value*
+xmlrpc_datetime_new_usec(xmlrpc_env * const envP,
+ time_t const secs,
+ unsigned int const usecs);
+
+#if XMLRPC_HAVE_TIMEVAL
+XMLRPC_DLLEXPORT
+xmlrpc_value *
+xmlrpc_datetime_new_timeval(xmlrpc_env * const envP,
+ struct timeval const value);
+#endif
+
+#if XMLRPC_HAVE_TIMESPEC
+XMLRPC_DLLEXPORT
+xmlrpc_value *
+xmlrpc_datetime_new_timespec(xmlrpc_env * const envP,
+ struct timespec const value);
+#endif
+
+void
+XMLRPC_DLLEXPORT
+xmlrpc_read_datetime(xmlrpc_env * const envP,
+ const xmlrpc_value * const valueP,
+ xmlrpc_datetime * const dtP);
+
+XMLRPC_DLLEXPORT
void
xmlrpc_read_datetime_str(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
const char ** const stringValueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_datetime_sec(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
time_t * const timeValueP);
+XMLRPC_DLLEXPORT
+void
+xmlrpc_read_datetime_usec(xmlrpc_env * const envP,
+ const xmlrpc_value * const valueP,
+ time_t * const secsP,
+ unsigned int * const usecsP);
+
+#if XMLRPC_HAVE_TIMEVAL
+XMLRPC_DLLEXPORT
+void
+xmlrpc_read_datetime_timeval(xmlrpc_env * const envP,
+ const xmlrpc_value * const valueP,
+ struct timeval * const timeValueP);
+#endif
+
+#if XMLRPC_HAVE_TIMESPEC
+XMLRPC_DLLEXPORT
+void
+xmlrpc_read_datetime_timespec(xmlrpc_env * const envP,
+ const xmlrpc_value * const valueP,
+ struct timespec * const timeValueP);
+#endif
+
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_new(xmlrpc_env * const envP,
const char * const stringValue);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_new_lp(xmlrpc_env * const envP,
size_t const length,
const char * const stringValue);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_new_va(xmlrpc_env * const envP,
const char * const format,
va_list args);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_new_f(xmlrpc_env * const envP,
const char * const format,
...);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_new_lp_cr(xmlrpc_env * const envP,
size_t const length,
const char * const value);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_new_cr(xmlrpc_env * const envP,
const char * const value);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_string(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
const char ** const stringValueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_string_crlf(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
const char ** const stringValueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_string_lp_crlf(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
size_t * const lengthP,
const char ** const stringValueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_string_lp(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
@@ -212,80 +324,93 @@ xmlrpc_read_string_lp(xmlrpc_env * const envP,
const char ** const stringValueP);
#if XMLRPC_HAVE_WCHAR
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_w_new(xmlrpc_env * const envP,
const wchar_t * const stringValue);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_w_new_lp(xmlrpc_env * const envP,
size_t const length,
const wchar_t * const stringValue);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_string_w(xmlrpc_env * const envP,
xmlrpc_value * const valueP,
const wchar_t ** const stringValueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_string_w_crlf(xmlrpc_env * const envP,
xmlrpc_value * const valueP,
const wchar_t ** const stringValueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_string_w_lp(xmlrpc_env * const envP,
xmlrpc_value * const valueP,
size_t * const lengthP,
const wchar_t ** const stringValueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_string_w_lp_crlf(xmlrpc_env * const envP,
xmlrpc_value * const valueP,
size_t * const lengthP,
const wchar_t ** const stringValueP);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_w_new_lp_cr(xmlrpc_env * const envP,
size_t const length,
const wchar_t * const value);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_string_w_new_cr(xmlrpc_env * const envP,
const wchar_t * const value);
#endif /* XMLRPC_HAVE_WCHAR */
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_base64_new(xmlrpc_env * const envP,
size_t const length,
const unsigned char * const value);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_base64(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
size_t * const lengthP,
const unsigned char ** const bytestringValueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_base64_size(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
size_t * const lengthP);
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_array_new(xmlrpc_env * const envP);
/* Return the number of elements in an XML-RPC array.
** Sets XMLRPC_TYPE_ERROR if 'array' is not an array. */
+XMLRPC_DLLEXPORT
int
xmlrpc_array_size(xmlrpc_env * const env,
const xmlrpc_value * const array);
-/* Append an item to an XML-RPC array.
-** Sets XMLRPC_TYPE_ERROR if 'array' is not an array. */
-extern void
-xmlrpc_array_append_item (xmlrpc_env * const envP,
- xmlrpc_value * const arrayP,
- xmlrpc_value * const valueP);
+XMLRPC_DLLEXPORT
+void
+xmlrpc_array_append_item(xmlrpc_env * const envP,
+ xmlrpc_value * const arrayP,
+ xmlrpc_value * const valueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_array_read_item(xmlrpc_env * const envP,
const xmlrpc_value * const arrayP,
@@ -299,30 +424,35 @@ xmlrpc_array_read_item(xmlrpc_env * const envP,
Sets XMLRPC_TYPE_ERROR if 'array' is not an array.
Sets XMLRPC_INDEX_ERROR if 'index' is out of bounds.
*/
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_array_get_item(xmlrpc_env * const envP,
const xmlrpc_value * const arrayP,
int const index);
/* Not implemented--we don't need it yet.
-extern
-int xmlrpc_array_set_item (xmlrpc_env* env,
-xmlrpc_value* array,
-int index,
- xmlrpc_value* value);
+XMLRPC_DLLEXPORT
+int
+xmlrpc_array_set_item(xmlrpc_env * const envP,
+ xmlrpc_value * const arrayP,
+ unsigned int const index,
+ xmlrpc_value * const valueP);
*/
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_struct_new(xmlrpc_env * const env);
/* Return the number of key/value pairs in a struct.
** Sets XMLRPC_TYPE_ERROR if 'strct' is not a struct. */
+XMLRPC_DLLEXPORT
int
-xmlrpc_struct_size (xmlrpc_env * env,
- xmlrpc_value * strct);
+xmlrpc_struct_size (xmlrpc_env * const env,
+ xmlrpc_value * const strct);
/* Returns true iff 'strct' contains 'key'.
** Sets XMLRPC_TYPE_ERROR if 'strct' is not a struct. */
+XMLRPC_DLLEXPORT
int
xmlrpc_struct_has_key(xmlrpc_env * const envP,
xmlrpc_value * const strctP,
@@ -332,6 +462,7 @@ xmlrpc_struct_has_key(xmlrpc_env * const envP,
Deprecated. xmlrpc_struct_get_value_v() is more general, and this
case is not common enough to warrant a shortcut.
*/
+XMLRPC_DLLEXPORT
int
xmlrpc_struct_has_key_n(xmlrpc_env * const envP,
xmlrpc_value * const strctP,
@@ -340,6 +471,7 @@ xmlrpc_struct_has_key_n(xmlrpc_env * const envP,
#if 0
/* Not implemented yet, but needed for completeness. */
+XMLRPC_DLLEXPORT
int
xmlrpc_struct_has_key_v(xmlrpc_env * env,
xmlrpc_value * strct,
@@ -347,6 +479,7 @@ xmlrpc_struct_has_key_v(xmlrpc_env * env,
#endif
+XMLRPC_DLLEXPORT
void
xmlrpc_struct_find_value(xmlrpc_env * const envP,
xmlrpc_value * const structP,
@@ -354,18 +487,21 @@ xmlrpc_struct_find_value(xmlrpc_env * const envP,
xmlrpc_value ** const valuePP);
+XMLRPC_DLLEXPORT
void
xmlrpc_struct_find_value_v(xmlrpc_env * const envP,
xmlrpc_value * const structP,
xmlrpc_value * const keyP,
xmlrpc_value ** const valuePP);
+XMLRPC_DLLEXPORT
void
xmlrpc_struct_read_value(xmlrpc_env * const envP,
xmlrpc_value * const structP,
const char * const key,
xmlrpc_value ** const valuePP);
+XMLRPC_DLLEXPORT
void
xmlrpc_struct_read_value_v(xmlrpc_env * const envP,
xmlrpc_value * const structP,
@@ -375,6 +511,7 @@ xmlrpc_struct_read_value_v(xmlrpc_env * const envP,
/* The "get_value" functions are deprecated. Use the "find_value"
and "read_value" functions instead.
*/
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_struct_get_value(xmlrpc_env * const envP,
xmlrpc_value * const strctP,
@@ -384,6 +521,7 @@ xmlrpc_struct_get_value(xmlrpc_env * const envP,
Deprecated. xmlrpc_struct_get_value_v() is more general, and this
case is not common enough to warrant a shortcut.
*/
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_struct_get_value_n(xmlrpc_env * const envP,
xmlrpc_value * const strctP,
@@ -393,6 +531,7 @@ xmlrpc_struct_get_value_n(xmlrpc_env * const envP,
/* Set the value associated with 'key' in 'strct' to 'value'.
Sets XMLRPC_TYPE_ERROR if 'strct' is not a struct.
*/
+XMLRPC_DLLEXPORT
void
xmlrpc_struct_set_value(xmlrpc_env * const env,
xmlrpc_value * const strct,
@@ -403,6 +542,7 @@ xmlrpc_struct_set_value(xmlrpc_env * const env,
The general way to set a structure value is xmlrpc_struct_set_value_v(),
and this case is not common enough to deserve a shortcut.
*/
+XMLRPC_DLLEXPORT
void
xmlrpc_struct_set_value_n(xmlrpc_env * const env,
xmlrpc_value * const strct,
@@ -412,6 +552,7 @@ xmlrpc_struct_set_value_n(xmlrpc_env * const env,
/* The same as above, but the key must be an XML-RPC string.
** Fails with XMLRPC_TYPE_ERROR if 'keyval' is not a string. */
+XMLRPC_DLLEXPORT
void
xmlrpc_struct_set_value_v(xmlrpc_env * const env,
xmlrpc_value * const strct,
@@ -423,6 +564,7 @@ xmlrpc_struct_set_value_v(xmlrpc_env * const env,
** Fails with XMLRPC_TYPE_ERROR if 'struct' is not a struct.
** Fails with XMLRPC_INDEX_ERROR if 'index' is out of bounds. */
+XMLRPC_DLLEXPORT
void
xmlrpc_struct_read_member(xmlrpc_env * const envP,
xmlrpc_value * const structP,
@@ -436,6 +578,7 @@ xmlrpc_struct_read_member(xmlrpc_env * const envP,
Deprecated. Use xmlrpc_struct_read_member() instead.
*/
+XMLRPC_DLLEXPORT
void
xmlrpc_struct_get_key_and_value(xmlrpc_env * const env,
xmlrpc_value * const strct,
@@ -443,38 +586,55 @@ xmlrpc_struct_get_key_and_value(xmlrpc_env * const env,
xmlrpc_value ** const out_keyval,
xmlrpc_value ** const out_value);
+/* The "C pointer" type has no relation to XML-RPC. It is here for the
+ convenience of programs that use xmlrpc_value for XML-RPC purposes
+ and can benefit from using it for non-XML-RPC purposes as well.
+
+ Also, some people use libxmlrpc for xmlrpc_value alone, because sometimes
+ you need to work with basic data types in richer ways than the C types
+ (int, time_t, etc) allow.
+*/
+
+XMLRPC_DLLEXPORT
+xmlrpc_value *
+xmlrpc_cptr_new(xmlrpc_env * const envP,
+ void * const value);
+
+typedef void (*xmlrpc_cptr_dtor_fn)(void *, void *);
+
+XMLRPC_DLLEXPORT
+xmlrpc_value *
+xmlrpc_cptr_new_dtor(xmlrpc_env * const envP,
+ void * const value,
+ xmlrpc_cptr_dtor_fn const dtor,
+ void * const dtorContext);
+
+XMLRPC_DLLEXPORT
void
xmlrpc_read_cptr(xmlrpc_env * const envP,
const xmlrpc_value * const valueP,
void ** const ptrValueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_read_nil(xmlrpc_env * const envP,
xmlrpc_value * const valueP);
-
-void
-xmlrpc_read_i8(xmlrpc_env * const envP,
- const xmlrpc_value * const valueP,
- xmlrpc_int64 * const intValueP);
-
-
-xmlrpc_value *
-xmlrpc_cptr_new(xmlrpc_env * const envP,
- void * const value);
-
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_nil_new(xmlrpc_env * const envP);
/* Build an xmlrpc_value from a format string. */
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_build_value(xmlrpc_env * const env,
const char * const format,
...);
/* The same as the above, but using a va_list and more general */
+XMLRPC_DLLEXPORT
void
xmlrpc_build_value_va(xmlrpc_env * const env,
const char * const format,
@@ -482,12 +642,14 @@ xmlrpc_build_value_va(xmlrpc_env * const env,
xmlrpc_value ** const valPP,
const char ** const tailP);
+XMLRPC_DLLEXPORT
void
xmlrpc_decompose_value(xmlrpc_env * const envP,
xmlrpc_value * const value,
const char * const format,
...);
+XMLRPC_DLLEXPORT
void
xmlrpc_decompose_value_va(xmlrpc_env * const envP,
xmlrpc_value * const value,
@@ -501,6 +663,7 @@ xmlrpc_decompose_value_va(xmlrpc_env * const envP,
These are deprecated. Use xmlrpc_decompose_value... instead.
*/
+XMLRPC_DLLEXPORT
void
xmlrpc_parse_value(xmlrpc_env * const envP,
xmlrpc_value * const value,
@@ -508,6 +671,7 @@ xmlrpc_parse_value(xmlrpc_env * const envP,
...);
/* The same as the above, but using a va_list. */
+XMLRPC_DLLEXPORT
void
xmlrpc_parse_value_va(xmlrpc_env * const envP,
xmlrpc_value * const value,
@@ -523,28 +687,33 @@ typedef enum xmlrpc_dialect {
xmlrpc_dialect_apache
} xmlrpc_dialect;
+XMLRPC_DLLEXPORT
void
xmlrpc_serialize_value2(xmlrpc_env * const envP,
xmlrpc_mem_block * const outputP,
xmlrpc_value * const valueP,
xmlrpc_dialect const dialect);
+XMLRPC_DLLEXPORT
void
xmlrpc_serialize_value(xmlrpc_env * const envP,
xmlrpc_mem_block * const outputP,
xmlrpc_value * const valueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_serialize_params2(xmlrpc_env * const envP,
xmlrpc_mem_block * const outputP,
xmlrpc_value * const paramArrayP,
xmlrpc_dialect const dialect);
+XMLRPC_DLLEXPORT
void
xmlrpc_serialize_params(xmlrpc_env * const envP,
xmlrpc_mem_block * const outputP,
xmlrpc_value * const paramArrayP);
+XMLRPC_DLLEXPORT
void
xmlrpc_serialize_call2(xmlrpc_env * const envP,
xmlrpc_mem_block * const outputP,
@@ -552,23 +721,27 @@ xmlrpc_serialize_call2(xmlrpc_env * const envP,
xmlrpc_value * const paramArrayP,
xmlrpc_dialect const dialect);
+XMLRPC_DLLEXPORT
void
xmlrpc_serialize_call(xmlrpc_env * const envP,
xmlrpc_mem_block * const outputP,
const char * const methodName,
xmlrpc_value * const paramArrayP);
+XMLRPC_DLLEXPORT
void
xmlrpc_serialize_response2(xmlrpc_env * const envP,
xmlrpc_mem_block * const outputP,
xmlrpc_value * const valueP,
xmlrpc_dialect const dialect);
+XMLRPC_DLLEXPORT
void
xmlrpc_serialize_response(xmlrpc_env * const envP,
xmlrpc_mem_block * const outputP,
xmlrpc_value * const valueP);
+XMLRPC_DLLEXPORT
void
xmlrpc_serialize_fault(xmlrpc_env * const envP,
xmlrpc_mem_block * const outputP,
@@ -579,17 +752,22 @@ xmlrpc_serialize_fault(xmlrpc_env * const envP,
** Decoding XML
**=======================================================================*/
-/* Parse an XML-RPC call. If an error occurs, set a fault and set
-** the output variables to NULL.
-** The caller is responsible for calling free(*out_method_name) and
-** xmlrpc_DECREF(*out_param_array). */
+XMLRPC_DLLEXPORT
+void
+xmlrpc_parse_value_xml(xmlrpc_env * const envP,
+ const char * const xmlData,
+ size_t const xmlDataLen,
+ xmlrpc_value ** const valuePP);
+
+XMLRPC_DLLEXPORT
void
xmlrpc_parse_call(xmlrpc_env * const envP,
- const char * const xml_data,
- size_t const xml_len,
- const char ** const out_method_name,
- xmlrpc_value ** const out_param_array);
+ const char * const xmlData,
+ size_t const xmlDataLen,
+ const char ** const methodNameP,
+ xmlrpc_value ** const paramArrayP);
+XMLRPC_DLLEXPORT
void
xmlrpc_parse_response2(xmlrpc_env * const envP,
const char * const xmlData,
@@ -601,6 +779,7 @@ xmlrpc_parse_response2(xmlrpc_env * const envP,
/* xmlrpc_parse_response() is for backward compatibility */
+XMLRPC_DLLEXPORT
xmlrpc_value *
xmlrpc_parse_response(xmlrpc_env * const envP,
const char * const xmlData,
@@ -616,23 +795,26 @@ xmlrpc_parse_response(xmlrpc_env * const envP,
/* This routine inserts newlines every 76 characters, as required by the
** Base64 specification. */
+XMLRPC_DLLEXPORT
xmlrpc_mem_block *
-xmlrpc_base64_encode(xmlrpc_env * env,
- unsigned char * bin_data,
- size_t bin_len);
+xmlrpc_base64_encode(xmlrpc_env * const envP,
+ const unsigned char * const binData,
+ size_t const binLen);
/* This routine encodes everything in one line. This is needed for HTTP
** authentication and similar tasks. */
+XMLRPC_DLLEXPORT
xmlrpc_mem_block *
-xmlrpc_base64_encode_without_newlines(xmlrpc_env * env,
- unsigned char * bin_data,
- size_t bin_len);
+xmlrpc_base64_encode_without_newlines(xmlrpc_env * const envP,
+ const unsigned char * const binData,
+ size_t const binLen);
/* This decodes Base64 data with or without newlines. */
+XMLRPC_DLLEXPORT
extern xmlrpc_mem_block *
xmlrpc_base64_decode(xmlrpc_env * const envP,
- const char * const ascii_data,
- size_t const ascii_len);
+ const char * const asciiData,
+ size_t const asciiLen);
/*=========================================================================
@@ -645,10 +827,12 @@ xmlrpc_base64_decode(xmlrpc_env * const envP,
** a cookie replacement of basic authentication.)
**/
+XMLRPC_DLLEXPORT
extern void xmlrpc_authcookie_set(xmlrpc_env * const env,
const char * const username,
const char * const password);
+XMLRPC_DLLEXPORT
char *xmlrpc_authcookie(void);
/*=========================================================================
@@ -677,9 +861,11 @@ char *xmlrpc_authcookie(void);
#define XMLRPC_XML_SIZE_LIMIT_DEFAULT (512*1024)
/* Set a specific limit to the specified value. */
+XMLRPC_DLLEXPORT
extern void xmlrpc_limit_set (int const limit_id, size_t const value);
/* Get the value of a specified limit. */
+XMLRPC_DLLEXPORT
extern size_t xmlrpc_limit_get (int const limit_id);
diff --git a/libs/xmlrpc-c/include/xmlrpc-c/base.hpp b/libs/xmlrpc-c/include/xmlrpc-c/base.hpp
index ab6fe3e..6f93e38 100644
--- a/libs/xmlrpc-c/include/xmlrpc-c/base.hpp
+++ b/libs/xmlrpc-c/include/xmlrpc-c/base.hpp
@@ -1,19 +1,24 @@
#ifndef XMLRPC_BASE_HPP_INCLUDED
#define XMLRPC_BASE_HPP_INCLUDED
+#include
+
#include
#include
#include
#include
#include