From f19590212847a36e56dea72692e9eba49a4c97d6 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 28 May 2010 03:23:50 +0000 Subject: [PATCH 001/187] first pass at an xml/rpc carrier svn path=/trunk/yarp2/; revision=7920 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 22 + src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 131 ++++ src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 165 +++++ src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 130 ++++ src/carriers/xmlrpc_carrier/XmlRpcStream.h | 97 +++ src/carriers/xmlrpc_carrier/xmlrpc/COPYING | 504 +++++++++++++++ .../xmlrpc_carrier/xmlrpc/README.html | 109 ++++ src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h | 94 +++ .../xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 427 ++++++++++++ .../xmlrpc_carrier/xmlrpc/XmlRpcClient.h | 132 ++++ .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp | 209 ++++++ .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h | 88 +++ .../xmlrpc_carrier/xmlrpc/XmlRpcException.h | 42 ++ .../xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp | 284 ++++++++ .../xmlrpc_carrier/xmlrpc/XmlRpcServer.h | 104 +++ .../xmlrpc/XmlRpcServerConnection.cpp | 394 +++++++++++ .../xmlrpc/XmlRpcServerConnection.h | 109 ++++ .../xmlrpc/XmlRpcServerMethod.cpp | 21 + .../xmlrpc/XmlRpcServerMethod.h | 47 ++ .../xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp | 263 ++++++++ .../xmlrpc_carrier/xmlrpc/XmlRpcSocket.h | 69 ++ .../xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp | 35 + .../xmlrpc_carrier/xmlrpc/XmlRpcSource.h | 55 ++ .../xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp | 250 +++++++ .../xmlrpc_carrier/xmlrpc/XmlRpcUtil.h | 61 ++ .../xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp | 610 ++++++++++++++++++ .../xmlrpc_carrier/xmlrpc/XmlRpcValue.h | 190 ++++++ src/carriers/xmlrpc_carrier/xmlrpc/base64.h | 379 +++++++++++ 28 files changed, 5021 insertions(+) create mode 100644 src/carriers/xmlrpc_carrier/CMakeLists.txt create mode 100644 src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp create mode 100644 src/carriers/xmlrpc_carrier/XmlRpcCarrier.h create mode 100644 src/carriers/xmlrpc_carrier/XmlRpcStream.cpp create mode 100644 src/carriers/xmlrpc_carrier/XmlRpcStream.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/COPYING create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/README.html create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/base64.h diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt new file mode 100644 index 0000000..0c8f676 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -0,0 +1,22 @@ +if (COMPILE_PLUGIN_LIBRARY) + prepare_carrier(xmlrpc_carrier TYPE XmlRpcCarrier INCLUDE XmlRpcCarrier.h) +endif (COMPILE_PLUGIN_LIBRARY) + +if (NOT SKIP_xmlrpc_carrier) + find_package(YARP REQUIRED) + include_directories(${YARP_INCLUDE_DIRS}) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + add_library(xmlrpc_carrier XmlRpcCarrier.h XmlRpcCarrier.cpp + XmlRpcStream.h XmlRpcStream.cpp) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc) + add_library(xmlrpcpp xmlrpc/XmlRpcClient.cpp + xmlrpc/XmlRpcDispatch.cpp + xmlrpc/XmlRpcServer.cpp + xmlrpc/XmlRpcServerConnection.cpp + xmlrpc/XmlRpcServerMethod.cpp + xmlrpc/XmlRpcSocket.cpp + xmlrpc/XmlRpcSource.cpp + xmlrpc/XmlRpcUtil.cpp + xmlrpc/XmlRpcValue.cpp) + target_link_libraries(xmlrpc_carrier xmlrpcpp ${YARP_LIBRARIES}) +endif (NOT SKIP_xmlrpc_carrier) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp new file mode 100644 index 0000000..b874d1d --- /dev/null +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -0,0 +1,131 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +#include "XmlRpcCarrier.h" +#include +#include + +#include "XmlRpc.h" + +using namespace yarp::os::impl; +using namespace yarp::os; +using namespace XmlRpc; + +void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { + if (vin.isInt()) { + vout = vin.asInt(); + } else if (vin.isDouble()) { + vout = vin.asDouble(); + } else if (vin.isString()) { + vout = vin.asString(); + } else if (vin.isList()) { + Bottle *bot = vin.asList(); + bool struc = true; + for (int i=0; isize(); i++) { + Value& vi = bot->get(i); + if (!vi.isList()) { + struc = false; + break; + } + if (vi.asList()->size()!=2) { + struc = false; + break; + } + } + if (struc) { + vout = XmlRpcValue(); + for (int i=0; isize(); i++) { + Bottle *boti = bot->get(i).asList(); + XmlRpcValue& vouti=vout[boti->get(0).toString()]=XmlRpcValue(); + toXmlRpcValue(boti->get(1),vouti); + } + } else { + vout = XmlRpcValue(); + for (int i=0; isize(); i++) { + XmlRpcValue& vouti = vout[i] = XmlRpcValue(); + toXmlRpcValue(bot->get(i),vouti); + } + } + } +} + +bool XmlRpcCarrier::expectSenderSpecifier(Protocol& proto) { + proto.setRoute(proto.getRoute().addFromName("rpc")); + return true; +} + +bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { + //XmlRpc::setVerbosity(10); + StringOutputStream sos; + StringInputStream sis; + writer.write(sos); + sis.reset(sos.toString()); + String header; + if (sender) { + header = NetType::readLine(sis); + } + String body = NetType::readLine(sis); + //printf("Asked to write: hdr %s body %s\n", + // header.c_str(), body.c_str()); + Value v; + //printf("HEADER %s\n", header.c_str()); + if (header[0]=='q') { + body = "yarp.quit"; + // XMLRPC does not need a quit message, this should get stripped + } + Bottle *bot = v.asList(); + //Bottle aux; + bot->fromString(body.c_str()); + ConstString methodName; + if (sender) { + methodName = bot->get(0).toString(); + *bot = bot->tail(); + } + XmlRpcValue args; + if (bot->size()==1) { + toXmlRpcValue(bot->get(0),args); + } else { + toXmlRpcValue(v,args); + } + //printf("xmlrpc block to write is %s\n", args.toXml().c_str()); + std::string req; + if (sender) { + const Address& addr = proto.getStreams().getRemoteAddress(); + XmlRpcClient c(addr.getName().c_str(),addr.getPort()); + c.generateRequest(methodName.c_str(),args); + req = c.getRequest(); + } else { + XmlRpcServerConnection c(0,NULL); + c.generateResponse(args.toXml()); + req = c.getResponse(); + } + int start = 0; + //printf("converts to %s\n", req.c_str()); + if (sender) { + if (req.length()<8) { + fprintf(stderr, "XmlRpcCarrier fail, %s:%d\n", __FILE__, __LINE__); + return false; + } + if (firstRound) { + const char *target = "POST /RP"; + for (int i=0; i<8; i++) { + if (req[i] != target[i]) { + fprintf(stderr, "XmlRpcCarrier fail, %s:%d\n", __FILE__, __LINE__); + return false; + } + } + start = 8; + firstRound = false; + } + } + Bytes b((char*)req.c_str()+start,req.length()); + proto.os().write(b); + + return proto.os().isOk(); +} + + +bool XmlRpcCarrier::reply(Protocol& proto, SizedWriter& writer) { + return write(proto,writer); +} + + diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h new file mode 100644 index 0000000..a560b6b --- /dev/null +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -0,0 +1,165 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +#ifndef XMLRPCCARRIER_INC +#define XMLRPCCARRIER_INC + +#include +#include +#include "XmlRpcStream.h" + +namespace yarp { + namespace os { + namespace impl { + class XmlRpcCarrier; + } + } +} + +class yarp::os::impl::XmlRpcCarrier : public Carrier { +private: + bool firstRound; + bool sender; +public: + XmlRpcCarrier() { + firstRound = true; + sender = false; + } + + virtual Carrier *create() { + return new XmlRpcCarrier(); + } + + virtual String getName() { + return "xmlrpc"; + } + + virtual bool isConnectionless() { + return false; + } + + virtual bool canAccept() { + return true; + } + + virtual bool canOffer() { + return true; + } + + virtual bool isTextMode() { + return true; + } + + virtual bool canEscape() { + return true; + } + + virtual bool requireAck() { + return false; + } + + virtual bool supportReply() { + return true; + } + + virtual bool isLocal() { + return false; + } + + virtual String toString() { + return "xmlrpc_carrier"; + } + + virtual void getHeader(const Bytes& header) { + // for now, expect XMLRPC++, which posts with uri /RPC2 + const char *target = "POST /RP"; + for (int i=0; i<8 && i + +using namespace yarp::os::impl; +using namespace yarp::os; +using namespace XmlRpc; +using namespace std; + + +Value toValue(XmlRpcValue& v) { + int t = v.getType(); + switch (t) { + case XmlRpcValue::TypeInt: + return Value((int)v); + break; + case XmlRpcValue::TypeDouble: + return Value((double)v); + break; + case XmlRpcValue::TypeString: + return Value(((string)v).c_str()); + break; + case XmlRpcValue::TypeArray: + { + Value vbot; + Bottle *bot = vbot.asList(); + for (int i=0; iadd(toValue(v2)); + } + } + return vbot; + } + break; + case XmlRpcValue::TypeStruct: + { + Value vbot; + Bottle *bot = vbot.asList(); + XmlRpcValue::ValueStruct& vals = v; + for (XmlRpcValue::ValueStruct::iterator it = vals.begin(); + it!= vals.end(); + it++) { + XmlRpcValue& v2 = it->second; + Bottle& sub = bot->addList(); + sub.addString(it->first.c_str()); + if (v2.getType()!=XmlRpcValue::TypeInvalid) { + sub.add(toValue(v2)); + } + } + return vbot; + } + break; + case XmlRpcValue::TypeInvalid: + return Value::getNullValue(); + break; + } + //printf("Skipping %d\n", t); + return Value("(type not supported yet out of laziness)"); +} + +int XmlRpcStream::read(const Bytes& b) { + int result = sis.read(b); + if (result>0) { + //printf("RETURNING %d bytes\n", result); + return result; + } + if (result==0) { + //printf("Reading...\n"); + bool ok = false; + if (sender) { + client.reset(); + } else { + server.reset(); + } + if (firstRound) { + if (sender) { + client.read("POST /RP"); + } else { + server.read("POST /RP"); + } + firstRound = false; + } + char buf[1000]; + Bytes bytes(buf,sizeof(buf)); + while (!ok) { + int result2 = delegate->getInputStream().partialRead(bytes); + if (result2<=0) { + return result2; + } + string s(buf,result2); + //printf("Giving %s to parser\n", s.c_str()); + if (sender) { + ok = client.read(s); + } else { + ok = server.read(s); + } + if (ok) { + //printf("got a block!\n"); + XmlRpcValue xresult; + std::string prefix = ""; + if (sender) { + client.parseResponse(xresult); + } else { + prefix = "d\n"; + prefix += server.parseRequest(xresult); + prefix += " "; + } + //printf("xmlrpc block is %s\n", xresult.toXml().c_str()); + Value v = toValue(xresult); + if (!v.isNull()) { + sis.reset((prefix + v.toString().c_str() + "\n").c_str()); + } else { + sis.reset((prefix + "\n").c_str()); + } + //printf("String version is %s\n", sis.toString().c_str()); + result = sis.read(b); + break; + } + } + } + //printf("RETURNING %d bytes\n", result); + return (result>0)?result:-1; +} + + +void XmlRpcStream::write(const Bytes& b) { + delegate->getOutputStream().write(b); +} diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h new file mode 100644 index 0000000..81d4f59 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -0,0 +1,97 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +#ifndef XMLRPCSTREAM_INC +#define XMLRPCSTREAM_INC + +#include +#include +#include +#include +#include + +#include "XmlRpcClient.h" +#include "XmlRpcServerConnection.h" + +namespace yarp { + namespace os { + namespace impl { + class XmlRpcStream; + } + } +} + +class yarp::os::impl::XmlRpcStream : public TwoWayStream, + public InputStream, + public OutputStream +{ +private: + TwoWayStream *delegate; + XmlRpc::XmlRpcClient client; + XmlRpc::XmlRpcServerConnection server; + StringInputStream sis; + StringOutputStream sos; + bool sender; + bool firstRound; +public: + XmlRpcStream(TwoWayStream *delegate, bool sender) : client("notset",0), + server(0,0/*NULL*/), + sender(sender) { + this->delegate = delegate; + client.reset(); + server.reset(); + firstRound = true; + } + + virtual ~XmlRpcStream() { + if (delegate!=NULL) { + delete delegate; + delegate = NULL; + } + } + + virtual InputStream& getInputStream() { return *this; } + virtual OutputStream& getOutputStream() { return *this; } + + + virtual const Address& getLocalAddress() { + return delegate->getLocalAddress(); + } + + virtual const Address& getRemoteAddress() { + return delegate->getRemoteAddress(); + } + + virtual bool isOk() { + return delegate->isOk(); + } + + virtual void reset() { + delegate->reset(); + } + + virtual void close() { + delegate->close(); + } + + virtual void beginPacket() { + delegate->beginPacket(); + } + + virtual void endPacket() { + delegate->endPacket(); + } + + virtual void write(const Bytes& b); + + virtual int read(const Bytes& b); + //{ + // return delegate->getInputStream().read(b); + //} + + virtual void interrupt() { + delegate->getInputStream().interrupt(); + } + +}; + +#endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/COPYING b/src/carriers/xmlrpc_carrier/xmlrpc/COPYING new file mode 100644 index 0000000..b1e3f5a --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/README.html b/src/carriers/xmlrpc_carrier/xmlrpc/README.html new file mode 100644 index 0000000..fd8e7f8 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/README.html @@ -0,0 +1,109 @@ + + + + XmlRpc++ Library + + + + + + +

XmlRpc++ Library

+

This is version 0.7 of XmlRpc++, an implementation of the + XmlRpc protocol written in C++, based upon Shilad Sen's excellent + py-xmlrpc library. XmlRpc++ is designed to make it easy to incorporate + XmlRpc client and server support into C++ applications. Or use both client and + server objects in your app for easy peer-to-peer support. +

+

Features

+
    +
  • + Easy   This library is easy to incorporate into C++ + applications. No other libraries are required, other than your system's socket + libraries. Simple XML parsing and HTTP support are built in.
    +
  • + Fast   All IO is non-blocking, so a slow client or + network will not slow down the server.
    +
  • + Portable Written in standard C++ to the POSIX and Windows + sockets APIs. You do need a fairly recent compiler (g++ 3.1 or MSVC++ .Net or + MSVC++ 6 with the STL patches.) +
  • +
  • + Free   This library is released under the + GNU LGPL.
    +
    +
  • +
+

 

+

Changes

+
    +
  • + Better handling of fault responses: server methods can throw an + XmlRpcException to return a fault and XmlRpcClient has a new method to + test whether the last response was a fault.
  • +
  • + Support for system.listMethods and system.methodHelp from the introspection + API.
  • +
  • + Support for system.multicall to process multiple requests in a single transaction.
  • +
  • + Fixed a problem in the XmlRpcServer destructor (it should not have been deleting the methods).
  • +
  • + The server ensures a valid result value is returned even if the method does not + set the result. The default result is an empty string.
  • +
  • + Doxygen comments in header files and a doc target in the makefile.
  • +
+

+

 

+

Installation

+

+ There are VC++ 6 and VC++ .Net project files building on Windows. If you are + using VC++ 6, you should apply SP3 and the fixes at + http://www.dinkumware.com/vc_fixes.html. Be sure to set the appropriate + code generation switches. In particular, ensure that the runtime library + (single/multi-threaded, static library/DLL) used is the same for the XmlRpc++ + code and whatever application it will be linked to.

+

+ For Linux, Solaris, and other Unix-like platforms there is a GNU Makefile which + can be edited to suit your system. Specify your C++ compiler, compiler flags, + and your system's socket libraries. +

+

In the test directory there are various test programs that are built by default. + To verify that the library built correctly, you can start the HelloServer + example:
+

HelloServer 8000
+			
+ and the HelloClient example in another terminal window:
+
HelloClient localhost 8000
+			
+

+ You should see two Hello messages and a sum displayed (amongst a bunch of debug + output). You can also try the XML server validator program (eg, "Validator 80") + and then attempt to connect to it from http://validator.xmlrpc.com + (if you have access to the internet and are not behind a firewall etc). +

+

Author

+

Chris Morley +

+

Although no code was re-used, the design and structure of the library is based + upon the py-xmlrpc library implementation.
+ The base64 decoder/encoder is by Konstantin + Pilipchuk.

+

+

License

+

A full copy of the LGPL license is included in the file COPYING. The source code + is Copyright (c) 2002-2003 by Chris Morley. This library is free software; you + can redistribute it and/or modify it under the terms of the GNU Lesser General + Public License as published by the Free Software Foundation; either version 2.1 + of the License, or (at your option) any later version. This library is + distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public License along + with this library; if not, write to the Free Software Foundation, Inc., 59 + Temple Place, Suite 330, Boston, MA 02111-1307 USA +

+ + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h new file mode 100644 index 0000000..9611af7 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h @@ -0,0 +1,94 @@ +#ifndef _XMLRPC_H_ +#define _XMLRPC_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +// + +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +#ifndef MAKEDEPEND +# include +#endif + +#include "XmlRpcClient.h" +#include "XmlRpcException.h" +#include "XmlRpcServer.h" +#include "XmlRpcServerMethod.h" +#include "XmlRpcValue.h" +#include "XmlRpcUtil.h" + +namespace XmlRpc { + + + //! An interface allowing custom handling of error message reporting. + class XmlRpcErrorHandler { + public: + //! Returns a pointer to the currently installed error handling object. + static XmlRpcErrorHandler* getErrorHandler() + { return _errorHandler; } + + //! Specifies the error handler. + static void setErrorHandler(XmlRpcErrorHandler* eh) + { _errorHandler = eh; } + + //! Report an error. Custom error handlers should define this method. + virtual void error(const char* msg) = 0; + + protected: + static XmlRpcErrorHandler* _errorHandler; + }; + + //! An interface allowing custom handling of informational message reporting. + class XmlRpcLogHandler { + public: + //! Returns a pointer to the currently installed message reporting object. + static XmlRpcLogHandler* getLogHandler() + { return _logHandler; } + + //! Specifies the message handler. + static void setLogHandler(XmlRpcLogHandler* lh) + { _logHandler = lh; } + + //! Returns the level of verbosity of informational messages. 0 is no output, 5 is very verbose. + static int getVerbosity() + { return _verbosity; } + + //! Specify the level of verbosity of informational messages. 0 is no output, 5 is very verbose. + static void setVerbosity(int v) + { _verbosity = v; } + + //! Output a message. Custom error handlers should define this method. + virtual void log(int level, const char* msg) = 0; + + protected: + static XmlRpcLogHandler* _logHandler; + static int _verbosity; + }; + + //! Returns log message verbosity. This is short for XmlRpcLogHandler::getVerbosity() + int getVerbosity(); + //! Sets log message verbosity. This is short for XmlRpcLogHandler::setVerbosity(level) + void setVerbosity(int level); + + + //! Version identifier + extern const char XMLRPC_VERSION[]; + +} // namespace XmlRpc + +#endif // _XMLRPC_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp new file mode 100644 index 0000000..f37f417 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp @@ -0,0 +1,427 @@ + +#include "XmlRpcClient.h" + +#include "XmlRpcSocket.h" +#include "XmlRpc.h" + +#include +#include +#include + + +using namespace XmlRpc; + +// Static data +const char XmlRpcClient::REQUEST_BEGIN[] = + "\r\n" + ""; +const char XmlRpcClient::REQUEST_END_METHODNAME[] = "\r\n"; +const char XmlRpcClient::PARAMS_TAG[] = ""; +const char XmlRpcClient::PARAMS_ETAG[] = ""; +const char XmlRpcClient::PARAM_TAG[] = ""; +const char XmlRpcClient::PARAM_ETAG[] = ""; +const char XmlRpcClient::REQUEST_END[] = "\r\n"; +const char XmlRpcClient::METHODRESPONSE_TAG[] = ""; +const char XmlRpcClient::FAULT_TAG[] = ""; + + + +XmlRpcClient::XmlRpcClient(const char* host, int port, const char* uri/*=0*/) +{ + XmlRpcUtil::log(1, "XmlRpcClient new client: host %s, port %d.", host, port); + + _host = host; + _port = port; + if (uri) + _uri = uri; + else + _uri = "/RPC2"; + _connectionState = NO_CONNECTION; + _executing = false; + _eof = false; + + // Default to keeping the connection open until an explicit close is done + setKeepOpen(); +} + + +XmlRpcClient::~XmlRpcClient() +{ +} + +// Close the owned fd +void +XmlRpcClient::close() +{ + XmlRpcUtil::log(4, "XmlRpcClient::close: fd %d.", getfd()); + _connectionState = NO_CONNECTION; + _disp.exit(); + _disp.removeSource(this); + XmlRpcSource::close(); +} + + +// Clear the referenced flag even if exceptions or errors occur. +struct ClearFlagOnExit { + ClearFlagOnExit(bool& flag) : _flag(flag) {} + ~ClearFlagOnExit() { _flag = false; } + bool& _flag; +}; + +// Execute the named procedure on the remote server. +// Params should be an array of the arguments for the method. +// Returns true if the request was sent and a result received (although the result +// might be a fault). +bool +XmlRpcClient::execute(const char* method, XmlRpcValue const& params, XmlRpcValue& result) +{ + XmlRpcUtil::log(1, "XmlRpcClient::execute: method %s (_connectionState %d).", method, _connectionState); + + // This is not a thread-safe operation, if you want to do multithreading, use separate + // clients for each thread. If you want to protect yourself from multiple threads + // accessing the same client, replace this code with a real mutex. + if (_executing) + return false; + + _executing = true; + ClearFlagOnExit cf(_executing); + + _sendAttempts = 0; + _isFault = false; + + if ( ! setupConnection()) + return false; + + if ( ! generateRequest(method, params)) + return false; + + result.clear(); + double msTime = -1.0; // Process until exit is called + _disp.work(msTime); + + if (_connectionState != IDLE || ! parseResponse(result)) + return false; + + XmlRpcUtil::log(1, "XmlRpcClient::execute: method %s completed.", method); + _response = ""; + return true; +} + +// XmlRpcSource interface implementation +// Handle server responses. Called by the event dispatcher during execute. +unsigned +XmlRpcClient::handleEvent(unsigned eventType) +{ + if (eventType == XmlRpcDispatch::Exception) + { + if (_connectionState == WRITE_REQUEST && _bytesWritten == 0) + XmlRpcUtil::error("Error in XmlRpcClient::handleEvent: could not connect to server (%s).", + XmlRpcSocket::getErrorMsg().c_str()); + else + XmlRpcUtil::error("Error in XmlRpcClient::handleEvent (state %d): %s.", + _connectionState, XmlRpcSocket::getErrorMsg().c_str()); + return 0; + } + + if (_connectionState == WRITE_REQUEST) + if ( ! writeRequest()) return 0; + + if (_connectionState == READ_HEADER) + if ( ! readHeader()) return 0; + + if (_connectionState == READ_RESPONSE) + if ( ! readResponse()) return 0; + + // This should probably always ask for Exception events too + return (_connectionState == WRITE_REQUEST) + ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent; +} + + +// Create the socket connection to the server if necessary +bool +XmlRpcClient::setupConnection() +{ + // If an error occurred last time through, or if the server closed the connection, close our end + if ((_connectionState != NO_CONNECTION && _connectionState != IDLE) || _eof) + close(); + + _eof = false; + if (_connectionState == NO_CONNECTION) + if (! doConnect()) + return false; + + // Prepare to write the request + _connectionState = WRITE_REQUEST; + _bytesWritten = 0; + + // Notify the dispatcher to listen on this source (calls handleEvent when the socket is writable) + _disp.removeSource(this); // Make sure nothing is left over + _disp.addSource(this, XmlRpcDispatch::WritableEvent | XmlRpcDispatch::Exception); + + return true; +} + + +// Connect to the xmlrpc server +bool +XmlRpcClient::doConnect() +{ + int fd = XmlRpcSocket::socket(); + if (fd < 0) + { + XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not create socket (%s).", XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + + XmlRpcUtil::log(3, "XmlRpcClient::doConnect: fd %d.", fd); + this->setfd(fd); + + // Don't block on connect/reads/writes + if ( ! XmlRpcSocket::setNonBlocking(fd)) + { + this->close(); + XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not set socket to non-blocking IO mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + + if ( ! XmlRpcSocket::connect(fd, _host, _port)) + { + this->close(); + XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not connect to server (%s).", XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + + return true; +} + +// Encode the request to call the specified method with the specified parameters into xml +bool +XmlRpcClient::generateRequest(const char* methodName, XmlRpcValue const& params) +{ + std::string body = REQUEST_BEGIN; + body += methodName; + body += REQUEST_END_METHODNAME; + + // If params is an array, each element is a separate parameter + if (params.valid()) { + body += PARAMS_TAG; + if (params.getType() == XmlRpcValue::TypeArray) + { + for (int i=0; igetfd(), _request, &_bytesWritten)) { + XmlRpcUtil::error("Error in XmlRpcClient::writeRequest: write error (%s).",XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + + XmlRpcUtil::log(3, "XmlRpcClient::writeRequest: wrote %d of %d bytes.", _bytesWritten, _request.length()); + + // Wait for the result + if (_bytesWritten == int(_request.length())) { + _header = ""; + _response = ""; + _connectionState = READ_HEADER; + } + return true; +} + +void XmlRpcClient::reset() { + _header = ""; + _response = ""; + _eof = false; + _connectionState = READ_HEADER; +} + +bool XmlRpcClient::read(const std::string& txt) { + std::string got = txt; + if (_connectionState==READ_HEADER) { + readHeader(got); + got = ""; + } + if (_connectionState==READ_RESPONSE) { + readResponse(got); + } + return (_connectionState == IDLE); +} + +// Read the header from the response +bool +XmlRpcClient::readHeader() +{ + return false; +} + +// Read the header from the response +bool +XmlRpcClient::readHeader(const std::string& txt) { + _header += txt; + _eof = false; + + XmlRpcUtil::log(4, "XmlRpcClient::readHeader: client has read %d bytes", _header.length()); + + char *hp = (char*)_header.c_str(); // Start of header + char *ep = hp + _header.length(); // End of string + char *bp = 0; // Start of body + char *lp = 0; // Start of content-length value + + for (char *cp = hp; (bp == 0) && (cp < ep); ++cp) { + if ((ep - cp > 16) && (strncasecmp(cp, "Content-length: ", 16) == 0)) + lp = cp + 16; + else if ((ep - cp > 4) && (strncmp(cp, "\r\n\r\n", 4) == 0)) + bp = cp + 4; + else if ((ep - cp > 2) && (strncmp(cp, "\n\n", 2) == 0)) + bp = cp + 2; + } + + // If we haven't gotten the entire header yet, return (keep reading) + if (bp == 0) { + if (_eof) // EOF in the middle of a response is an error + { + XmlRpcUtil::error("Error in XmlRpcClient::readHeader: EOF while reading header"); + return false; // Close the connection + } + + return true; // Keep reading + } + + // Decode content length + if (lp == 0) { + XmlRpcUtil::error("Error XmlRpcClient::readHeader: No Content-length specified"); + return false; // We could try to figure it out by parsing as we read, but for now... + } + + _contentLength = atoi(lp); + if (_contentLength <= 0) { + XmlRpcUtil::error("Error in XmlRpcClient::readHeader: Invalid Content-length specified (%d).", _contentLength); + return false; + } + + XmlRpcUtil::log(4, "client read content length: %d", _contentLength); + + // Otherwise copy non-header data to response buffer and set state to read response. + _response = bp; + _header = ""; // should parse out any interesting bits from the header (connection, etc)... + _connectionState = READ_RESPONSE; + return true; // Continue monitoring this source +} + + + +bool +XmlRpcClient::readResponse() { + return false; +} + +bool +XmlRpcClient::readResponse(const std::string& txt) +{ + _eof = false; + + // If we dont have the entire response yet, read available data + if (int(_response.length()) < _contentLength) { + _response += txt; + + // If we haven't gotten the entire _response yet, return (keep reading) + if (int(_response.length()) < _contentLength) { + if (_eof) { + XmlRpcUtil::error("Error in XmlRpcClient::readResponse: EOF while reading response"); + return false; + } + return true; + } + } + + // Otherwise, parse and return the result + XmlRpcUtil::log(3, "XmlRpcClient::readResponse (read %d bytes)", _response.length()); + XmlRpcUtil::log(5, "response:\n%s", _response.c_str()); + + _connectionState = IDLE; + + return false; // Stop monitoring this source (causes return from work) +} + + +// Convert the response xml into a result value +bool +XmlRpcClient::parseResponse(XmlRpcValue& result) +{ + // Parse response xml into result + int offset = 0; + if ( ! XmlRpcUtil::findTag(METHODRESPONSE_TAG,_response,&offset)) { + XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response - no methodResponse. Response:\n%s", _response.c_str()); + return false; + } + + // Expect either ... or ... + if (((XmlRpcUtil::nextTagIs(PARAMS_TAG,_response,&offset) && + XmlRpcUtil::nextTagIs(PARAM_TAG,_response,&offset))) || + (XmlRpcUtil::nextTagIs(FAULT_TAG,_response,&offset) && (_isFault = true))) + { + if ( ! result.fromXml(_response, &offset)) { + XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response value. Response:\n%s", _response.c_str()); + _response = ""; + return false; + } + } else { + XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response - no param or fault tag. Response:\n%s", _response.c_str()); + _response = ""; + return false; + } + + _response = ""; + return result.valid(); +} + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h new file mode 100644 index 0000000..bcdcc32 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h @@ -0,0 +1,132 @@ + +#ifndef _XMLRPCCLIENT_H_ +#define _XMLRPCCLIENT_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + + +#ifndef MAKEDEPEND +# include +#endif + +#include "XmlRpcDispatch.h" +#include "XmlRpcSource.h" + +namespace XmlRpc { + + // Arguments and results are represented by XmlRpcValues + class XmlRpcValue; + + //! A class to send XML RPC requests to a server and return the results. + class XmlRpcClient : public XmlRpcSource { + public: + // Static data + static const char REQUEST_BEGIN[]; + static const char REQUEST_END_METHODNAME[]; + static const char PARAMS_TAG[]; + static const char PARAMS_ETAG[]; + static const char PARAM_TAG[]; + static const char PARAM_ETAG[]; + static const char REQUEST_END[]; + // Result tags + static const char METHODRESPONSE_TAG[]; + static const char FAULT_TAG[]; + + //! Construct a client to connect to the server at the specified host:port address + //! @param host The name of the remote machine hosting the server + //! @param port The port on the remote machine where the server is listening + //! @param uri An optional string to be sent as the URI in the HTTP GET header + XmlRpcClient(const char* host, int port, const char* uri=0); + + //! Destructor + virtual ~XmlRpcClient(); + + //! Execute the named procedure on the remote server. + //! @param method The name of the remote procedure to execute + //! @param params An array of the arguments for the method + //! @param result The result value to be returned to the client + //! @return true if the request was sent and a result received + //! (although the result might be a fault). + //! + //! Currently this is a synchronous (blocking) implementation (execute + //! does not return until it receives a response or an error). Use isFault() + //! to determine whether the result is a fault response. + bool execute(const char* method, XmlRpcValue const& params, XmlRpcValue& result); + + //! Returns true if the result of the last execute() was a fault response. + bool isFault() const { return _isFault; } + + + // XmlRpcSource interface implementation + //! Close the connection + virtual void close(); + + //! Handle server responses. Called by the event dispatcher during execute. + //! @param eventType The type of event that occurred. + //! @see XmlRpcDispatch::EventType + virtual unsigned handleEvent(unsigned eventType); + + virtual bool generateRequest(const char* method, XmlRpcValue const& params); + std::string getRequest() { return _request; } + + virtual void reset(); + virtual bool read(const std::string& txt); + virtual bool readHeader(const std::string& txt); + virtual bool readResponse(const std::string& txt); + virtual bool parseResponse(XmlRpcValue& result); + + protected: + // Execution processing helpers + virtual bool doConnect(); + virtual bool setupConnection(); + virtual bool readHeader(); + virtual bool readResponse(); + + virtual std::string generateHeader(std::string const& body); + virtual bool writeRequest(); + + // Possible IO states for the connection + enum ClientConnectionState { NO_CONNECTION, CONNECTING, WRITE_REQUEST, READ_HEADER, READ_RESPONSE, IDLE }; + ClientConnectionState _connectionState; + + // Server location + std::string _host; + std::string _uri; + int _port; + + // The xml-encoded request, http header of response, and response xml + std::string _request; + std::string _header; + std::string _response; + + // Number of times the client has attempted to send the request + int _sendAttempts; + + // Number of bytes of the request that have been written to the socket so far + int _bytesWritten; + + // True if we are currently executing a request. If you want to multithread, + // each thread should have its own client. + bool _executing; + + // True if the server closed the connection + bool _eof; + + // True if a fault response was returned by the server + bool _isFault; + + // Number of bytes expected in the response body (parsed from response header) + int _contentLength; + + // Event dispatcher + XmlRpcDispatch _disp; + + }; // class XmlRpcClient + +} // namespace XmlRpc + +#endif // _XMLRPCCLIENT_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp new file mode 100644 index 0000000..3bbca40 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp @@ -0,0 +1,209 @@ + +#include "XmlRpcDispatch.h" +#include "XmlRpcSource.h" +#include "XmlRpcUtil.h" + +#include +#include + +#if defined(_WINDOWS) +# include + +# define USE_FTIME +# if defined(_MSC_VER) +# define timeb _timeb +# define ftime _ftime +# endif +#else +# include +#endif // _WINDOWS + + +using namespace XmlRpc; + + +XmlRpcDispatch::XmlRpcDispatch() +{ + _endTime = -1.0; + _doClear = false; + _inWork = false; +} + + +XmlRpcDispatch::~XmlRpcDispatch() +{ +} + +// Monitor this source for the specified events and call its event handler +// when the event occurs +void +XmlRpcDispatch::addSource(XmlRpcSource* source, unsigned mask) +{ + _sources.push_back(MonitoredSource(source, mask)); +} + +// Stop monitoring this source. Does not close the source. +void +XmlRpcDispatch::removeSource(XmlRpcSource* source) +{ + for (SourceList::iterator it=_sources.begin(); it!=_sources.end(); ++it) + if (it->getSource() == source) + { + _sources.erase(it); + break; + } +} + + +// Modify the types of events to watch for on this source +void +XmlRpcDispatch::setSourceEvents(XmlRpcSource* source, unsigned eventMask) +{ + for (SourceList::iterator it=_sources.begin(); it!=_sources.end(); ++it) + if (it->getSource() == source) + { + it->getMask() = eventMask; + break; + } +} + + + +// Watch current set of sources and process events +void +XmlRpcDispatch::work(double timeout) +{ + // Compute end time + _endTime = (timeout < 0.0) ? -1.0 : (getTime() + timeout); + _doClear = false; + _inWork = true; + + // Only work while there is something to monitor + while (_sources.size() > 0) { + + // Construct the sets of descriptors we are interested in + fd_set inFd, outFd, excFd; + FD_ZERO(&inFd); + FD_ZERO(&outFd); + FD_ZERO(&excFd); + + int maxFd = -1; // Not used on windows + SourceList::iterator it; + for (it=_sources.begin(); it!=_sources.end(); ++it) { + int fd = it->getSource()->getfd(); + if (it->getMask() & ReadableEvent) FD_SET(fd, &inFd); + if (it->getMask() & WritableEvent) FD_SET(fd, &outFd); + if (it->getMask() & Exception) FD_SET(fd, &excFd); + if (it->getMask() && fd > maxFd) maxFd = fd; + } + + // Check for events + int nEvents; + if (timeout < 0.0) + nEvents = select(maxFd+1, &inFd, &outFd, &excFd, NULL); + else + { + struct timeval tv; + tv.tv_sec = (int)floor(timeout); + tv.tv_usec = ((int)floor(1000000.0 * (timeout-floor(timeout)))) % 1000000; + nEvents = select(maxFd+1, &inFd, &outFd, &excFd, &tv); + } + + if (nEvents < 0) + { + XmlRpcUtil::error("Error in XmlRpcDispatch::work: error in select (%d).", nEvents); + _inWork = false; + return; + } + + // Process events + for (it=_sources.begin(); it != _sources.end(); ) + { + SourceList::iterator thisIt = it++; + XmlRpcSource* src = thisIt->getSource(); + int fd = src->getfd(); + unsigned newMask = (unsigned) -1; + if (fd <= maxFd) { + // If you select on multiple event types this could be ambiguous + if (FD_ISSET(fd, &inFd)) + newMask &= src->handleEvent(ReadableEvent); + if (FD_ISSET(fd, &outFd)) + newMask &= src->handleEvent(WritableEvent); + if (FD_ISSET(fd, &excFd)) + newMask &= src->handleEvent(Exception); + + if ( ! newMask) { + _sources.erase(thisIt); // Stop monitoring this one + if ( ! src->getKeepOpen()) + src->close(); + } else if (newMask != (unsigned) -1) { + thisIt->getMask() = newMask; + } + } + } + + // Check whether to clear all sources + if (_doClear) + { + SourceList closeList = _sources; + _sources.clear(); + for (SourceList::iterator it=closeList.begin(); it!=closeList.end(); ++it) { + XmlRpcSource *src = it->getSource(); + src->close(); + } + + _doClear = false; + } + + // Check whether end time has passed + if (0 <= _endTime && getTime() > _endTime) + break; + } + + _inWork = false; +} + + +// Exit from work routine. Presumably this will be called from +// one of the source event handlers. +void +XmlRpcDispatch::exit() +{ + _endTime = 0.0; // Return from work asap +} + +// Clear all sources from the monitored sources list +void +XmlRpcDispatch::clear() +{ + if (_inWork) + _doClear = true; // Finish reporting current events before clearing + else + { + SourceList closeList = _sources; + _sources.clear(); + for (SourceList::iterator it=closeList.begin(); it!=closeList.end(); ++it) + it->getSource()->close(); + } +} + + +double +XmlRpcDispatch::getTime() +{ +#ifdef USE_FTIME + struct timeb tbuff; + + ftime(&tbuff); + return ((double) tbuff.time + ((double)tbuff.millitm / 1000.0) + + ((double) tbuff.timezone * 60)); +#else + struct timeval tv; + struct timezone tz; + + gettimeofday(&tv, &tz); + return (tv.tv_sec + tv.tv_usec / 1000000.0); +#endif /* USE_FTIME */ +} + + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h new file mode 100644 index 0000000..b3c4ec0 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h @@ -0,0 +1,88 @@ + +#ifndef _XMLRPCDISPATCH_H_ +#define _XMLRPCDISPATCH_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +#ifndef MAKEDEPEND +# include +#endif + +namespace XmlRpc { + + // An RPC source represents a file descriptor to monitor + class XmlRpcSource; + + //! An object which monitors file descriptors for events and performs + //! callbacks when interesting events happen. + class XmlRpcDispatch { + public: + //! Constructor + XmlRpcDispatch(); + ~XmlRpcDispatch(); + + //! Values indicating the type of events a source is interested in + enum EventType { + ReadableEvent = 1, //!< data available to read + WritableEvent = 2, //!< connected/data can be written without blocking + Exception = 4 //!< uh oh + }; + + //! Monitor this source for the event types specified by the event mask + //! and call its event handler when any of the events occur. + //! @param source The source to monitor + //! @param eventMask Which event types to watch for. \see EventType + void addSource(XmlRpcSource* source, unsigned eventMask); + + //! Stop monitoring this source. + //! @param source The source to stop monitoring + void removeSource(XmlRpcSource* source); + + //! Modify the types of events to watch for on this source + void setSourceEvents(XmlRpcSource* source, unsigned eventMask); + + + //! Watch current set of sources and process events for the specified + //! duration (in ms, -1 implies wait forever, or until exit is called) + void work(double msTime); + + //! Exit from work routine + void exit(); + + //! Clear all sources from the monitored sources list. Sources are closed. + void clear(); + + protected: + + // helper + double getTime(); + + // A source to monitor and what to monitor it for + struct MonitoredSource { + MonitoredSource(XmlRpcSource* src, unsigned mask) : _src(src), _mask(mask) {} + XmlRpcSource* getSource() const { return _src; } + unsigned& getMask() { return _mask; } + XmlRpcSource* _src; + unsigned _mask; + }; + + // A list of sources to monitor + typedef std::list< MonitoredSource > SourceList; + + // Sources being monitored + SourceList _sources; + + // When work should stop (-1 implies wait forever, or until exit is called) + double _endTime; + + bool _doClear; + bool _inWork; + + }; +} // namespace XmlRpc + +#endif // _XMLRPCDISPATCH_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h new file mode 100644 index 0000000..6090450 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h @@ -0,0 +1,42 @@ + +#ifndef _XMLRPCEXCEPTION_H_ +#define _XMLRPCEXCEPTION_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +#ifndef MAKEDEPEND +# include +#endif + + +namespace XmlRpc { + + //! A class representing an error. + //! If server methods throw this exception, a fault response is returned + //! to the client. + class XmlRpcException { + public: + //! Constructor + //! @param message A descriptive error message + //! @param code An integer error code + XmlRpcException(const std::string& message, int code=-1) : + _message(message), _code(code) {} + + //! Return the error message. + const std::string& getMessage() const { return _message; } + + //! Return the error code. + int getCode() const { return _code; } + + private: + std::string _message; + int _code; + }; + +} + +#endif // _XMLRPCEXCEPTION_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp new file mode 100644 index 0000000..f6b4aa5 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp @@ -0,0 +1,284 @@ + +#include "XmlRpcServer.h" +#include "XmlRpcServerConnection.h" +#include "XmlRpcServerMethod.h" +#include "XmlRpcSocket.h" +#include "XmlRpcUtil.h" +#include "XmlRpcException.h" + + +using namespace XmlRpc; + + +XmlRpcServer::XmlRpcServer() +{ + _introspectionEnabled = false; + _listMethods = 0; + _methodHelp = 0; +} + + +XmlRpcServer::~XmlRpcServer() +{ + this->shutdown(); + _methods.clear(); + delete _listMethods; + delete _methodHelp; +} + + +// Add a command to the RPC server +void +XmlRpcServer::addMethod(XmlRpcServerMethod* method) +{ + _methods[method->name()] = method; +} + +// Remove a command from the RPC server +void +XmlRpcServer::removeMethod(XmlRpcServerMethod* method) +{ + MethodMap::iterator i = _methods.find(method->name()); + if (i != _methods.end()) + _methods.erase(i); +} + +// Remove a command from the RPC server by name +void +XmlRpcServer::removeMethod(const std::string& methodName) +{ + MethodMap::iterator i = _methods.find(methodName); + if (i != _methods.end()) + _methods.erase(i); +} + + +// Look up a method by name +XmlRpcServerMethod* +XmlRpcServer::findMethod(const std::string& name) const +{ + MethodMap::const_iterator i = _methods.find(name); + if (i == _methods.end()) + return 0; + return i->second; +} + + +// Create a socket, bind to the specified port, and +// set it in listen mode to make it available for clients. +bool +XmlRpcServer::bindAndListen(int port, int backlog /*= 5*/) +{ + int fd = XmlRpcSocket::socket(); + if (fd < 0) + { + XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not create socket (%s).", XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + + this->setfd(fd); + + // Don't block on reads/writes + if ( ! XmlRpcSocket::setNonBlocking(fd)) + { + this->close(); + XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set socket to non-blocking input mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + + // Allow this port to be re-bound immediately so server re-starts are not delayed + if ( ! XmlRpcSocket::setReuseAddr(fd)) + { + this->close(); + XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set SO_REUSEADDR socket option (%s).", XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + + // Bind to the specified port on the default interface + if ( ! XmlRpcSocket::bind(fd, port)) + { + this->close(); + XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not bind to specified port (%s).", XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + + // Set in listening mode + if ( ! XmlRpcSocket::listen(fd, backlog)) + { + this->close(); + XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set socket in listening mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + + XmlRpcUtil::log(2, "XmlRpcServer::bindAndListen: server listening on port %d fd %d", port, fd); + + // Notify the dispatcher to listen on this source when we are in work() + _disp.addSource(this, XmlRpcDispatch::ReadableEvent); + + return true; +} + + +// Process client requests for the specified time +void +XmlRpcServer::work(double msTime) +{ + XmlRpcUtil::log(2, "XmlRpcServer::work: waiting for a connection"); + _disp.work(msTime); +} + + + +// Handle input on the server socket by accepting the connection +// and reading the rpc request. +unsigned +XmlRpcServer::handleEvent(unsigned mask) +{ + acceptConnection(); + return XmlRpcDispatch::ReadableEvent; // Continue to monitor this fd +} + + +// Accept a client connection request and create a connection to +// handle method calls from the client. +void +XmlRpcServer::acceptConnection() +{ + int s = XmlRpcSocket::accept(this->getfd()); + XmlRpcUtil::log(2, "XmlRpcServer::acceptConnection: socket %d", s); + if (s < 0) + { + //this->close(); + XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not accept connection (%s).", XmlRpcSocket::getErrorMsg().c_str()); + } + else if ( ! XmlRpcSocket::setNonBlocking(s)) + { + XmlRpcSocket::close(s); + XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not set socket to non-blocking input mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); + } + else // Notify the dispatcher to listen for input on this source when we are in work() + { + XmlRpcUtil::log(2, "XmlRpcServer::acceptConnection: creating a connection"); + _disp.addSource(this->createConnection(s), XmlRpcDispatch::ReadableEvent); + } +} + + +// Create a new connection object for processing requests from a specific client. +XmlRpcServerConnection* +XmlRpcServer::createConnection(int s) +{ + // Specify that the connection object be deleted when it is closed + return new XmlRpcServerConnection(s, this, true); +} + + +void +XmlRpcServer::removeConnection(XmlRpcServerConnection* sc) +{ + _disp.removeSource(sc); +} + + +// Stop processing client requests +void +XmlRpcServer::exit() +{ + _disp.exit(); +} + + +// Close the server socket file descriptor and stop monitoring connections +void +XmlRpcServer::shutdown() +{ + // This closes and destroys all connections as well as closing this socket + _disp.clear(); +} + + +// Introspection support +static const std::string LIST_METHODS("system.listMethods"); +static const std::string METHOD_HELP("system.methodHelp"); +static const std::string MULTICALL("system.multicall"); + + +// List all methods available on a server +class ListMethods : public XmlRpcServerMethod +{ +public: + ListMethods(XmlRpcServer* s) : XmlRpcServerMethod(LIST_METHODS, s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + _server->listMethods(result); + } + + std::string help() { return std::string("List all methods available on a server as an array of strings"); } +}; + + +// Retrieve the help string for a named method +class MethodHelp : public XmlRpcServerMethod +{ +public: + MethodHelp(XmlRpcServer* s) : XmlRpcServerMethod(METHOD_HELP, s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + if (params[0].getType() != XmlRpcValue::TypeString) + throw XmlRpcException(METHOD_HELP + ": Invalid argument type"); + + XmlRpcServerMethod* m = _server->findMethod(params[0]); + if ( ! m) + throw XmlRpcException(METHOD_HELP + ": Unknown method name"); + + result = m->help(); + } + + std::string help() { return std::string("Retrieve the help string for a named method"); } +}; + + +// Specify whether introspection is enabled or not. Default is enabled. +void +XmlRpcServer::enableIntrospection(bool enabled) +{ + if (_introspectionEnabled == enabled) + return; + + _introspectionEnabled = enabled; + + if (enabled) + { + if ( ! _listMethods) + { + _listMethods = new ListMethods(this); + _methodHelp = new MethodHelp(this); + } else { + addMethod(_listMethods); + addMethod(_methodHelp); + } + } + else + { + removeMethod(LIST_METHODS); + removeMethod(METHOD_HELP); + } +} + + +void +XmlRpcServer::listMethods(XmlRpcValue& result) +{ + int i = 0; + result.setSize(_methods.size()+1); + for (MethodMap::iterator it=_methods.begin(); it != _methods.end(); ++it) + result[i++] = it->first; + + // Multicall support is built into XmlRpcServerConnection + result[i] = MULTICALL; +} + + + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h new file mode 100644 index 0000000..8172733 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h @@ -0,0 +1,104 @@ + +#ifndef _XMLRPCSERVER_H_ +#define _XMLRPCSERVER_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +#ifndef MAKEDEPEND +# include +# include +#endif + +#include "XmlRpcDispatch.h" +#include "XmlRpcSource.h" + +namespace XmlRpc { + + + // An abstract class supporting XML RPC methods + class XmlRpcServerMethod; + + // Class representing connections to specific clients + class XmlRpcServerConnection; + + // Class representing argument and result values + class XmlRpcValue; + + + //! A class to handle XML RPC requests + class XmlRpcServer : public XmlRpcSource { + public: + //! Create a server object. + XmlRpcServer(); + //! Destructor. + virtual ~XmlRpcServer(); + + //! Specify whether introspection is enabled or not. Default is not enabled. + void enableIntrospection(bool enabled=true); + + //! Add a command to the RPC server + void addMethod(XmlRpcServerMethod* method); + + //! Remove a command from the RPC server + void removeMethod(XmlRpcServerMethod* method); + + //! Remove a command from the RPC server by name + void removeMethod(const std::string& methodName); + + //! Look up a method by name + XmlRpcServerMethod* findMethod(const std::string& name) const; + + //! Create a socket, bind to the specified port, and + //! set it in listen mode to make it available for clients. + bool bindAndListen(int port, int backlog = 5); + + //! Process client requests for the specified time + void work(double msTime); + + //! Temporarily stop processing client requests and exit the work() method. + void exit(); + + //! Close all connections with clients and the socket file descriptor + void shutdown(); + + //! Introspection support + void listMethods(XmlRpcValue& result); + + // XmlRpcSource interface implementation + + //! Handle client connection requests + virtual unsigned handleEvent(unsigned eventType); + + //! Remove a connection from the dispatcher + virtual void removeConnection(XmlRpcServerConnection*); + + protected: + + //! Accept a client connection request + virtual void acceptConnection(); + + //! Create a new connection object for processing requests from a specific client. + virtual XmlRpcServerConnection* createConnection(int socket); + + // Whether the introspection API is supported by this server + bool _introspectionEnabled; + + // Event dispatcher + XmlRpcDispatch _disp; + + // Collection of methods. This could be a set keyed on method name if we wanted... + typedef std::map< std::string, XmlRpcServerMethod* > MethodMap; + MethodMap _methods; + + // system methods + XmlRpcServerMethod* _listMethods; + XmlRpcServerMethod* _methodHelp; + + }; +} // namespace XmlRpc + +#endif //_XMLRPCSERVER_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp new file mode 100644 index 0000000..82d3bfd --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp @@ -0,0 +1,394 @@ + +#include "XmlRpcServerConnection.h" + +#include "XmlRpcSocket.h" +#include "XmlRpc.h" +#ifndef MAKEDEPEND +# include +# include +# include +#endif + +using namespace XmlRpc; + +// Static data +const char XmlRpcServerConnection::METHODNAME_TAG[] = ""; +const char XmlRpcServerConnection::PARAMS_TAG[] = ""; +const char XmlRpcServerConnection::PARAMS_ETAG[] = ""; +const char XmlRpcServerConnection::PARAM_TAG[] = ""; +const char XmlRpcServerConnection::PARAM_ETAG[] = ""; + +const std::string XmlRpcServerConnection::SYSTEM_MULTICALL = "system.multicall"; +const std::string XmlRpcServerConnection::METHODNAME = "methodName"; +const std::string XmlRpcServerConnection::PARAMS = "params"; + +const std::string XmlRpcServerConnection::FAULTCODE = "faultCode"; +const std::string XmlRpcServerConnection::FAULTSTRING = "faultString"; + + + +// The server delegates handling client requests to a serverConnection object. +XmlRpcServerConnection::XmlRpcServerConnection(int fd, XmlRpcServer* server, bool deleteOnClose /*= false*/) : + XmlRpcSource(fd, deleteOnClose) +{ + XmlRpcUtil::log(2,"XmlRpcServerConnection: new socket %d.", fd); + _server = server; + _connectionState = READ_HEADER; + _keepAlive = true; +} + + +XmlRpcServerConnection::~XmlRpcServerConnection() +{ + XmlRpcUtil::log(4,"XmlRpcServerConnection dtor."); + if (_server!=NULL) { + _server->removeConnection(this); + } +} + + +// Handle input on the server socket by accepting the connection +// and reading the rpc request. Return true to continue to monitor +// the socket for events, false to remove it from the dispatcher. +unsigned +XmlRpcServerConnection::handleEvent(unsigned /*eventType*/) +{ + if (_connectionState == READ_HEADER) + if ( ! readHeader()) return 0; + + if (_connectionState == READ_REQUEST) + if ( ! readRequest()) return 0; + + if (_connectionState == WRITE_RESPONSE) + if ( ! writeResponse()) return 0; + + return (_connectionState == WRITE_RESPONSE) + ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent; +} + +void XmlRpcServerConnection::reset() { + _header = ""; + _response = ""; + _connectionState = READ_HEADER; +} + +bool XmlRpcServerConnection::read(const std::string& txt) { + std::string got = txt; + if (_connectionState==READ_HEADER) { + readHeader(got); + got = ""; + } + if (_connectionState==READ_REQUEST) { + readRequest(got); + } + return (_connectionState == WRITE_RESPONSE); +} + + +bool +XmlRpcServerConnection::readHeader() { + return false; +} + + +bool +XmlRpcServerConnection::readHeader(const std::string& txt) { + // Read available data + bool eof = false; + _header += txt; + + XmlRpcUtil::log(4, "XmlRpcServerConnection::readHeader: read %d bytes.", _header.length()); + char *hp = (char*)_header.c_str(); // Start of header + char *ep = hp + _header.length(); // End of string + char *bp = 0; // Start of body + char *lp = 0; // Start of content-length value + char *kp = 0; // Start of connection value + + for (char *cp = hp; (bp == 0) && (cp < ep); ++cp) { + if ((ep - cp > 16) && (strncasecmp(cp, "Content-length: ", 16) == 0)) + lp = cp + 16; + else if ((ep - cp > 12) && (strncasecmp(cp, "Connection: ", 12) == 0)) + kp = cp + 12; + else if ((ep - cp > 4) && (strncmp(cp, "\r\n\r\n", 4) == 0)) + bp = cp + 4; + else if ((ep - cp > 2) && (strncmp(cp, "\n\n", 2) == 0)) + bp = cp + 2; + } + + // If we haven't gotten the entire header yet, return (keep reading) + if (bp == 0) { + // EOF in the middle of a request is an error, otherwise its ok + if (eof) { + XmlRpcUtil::log(4, "XmlRpcServerConnection::readHeader: EOF"); + if (_header.length() > 0) + XmlRpcUtil::error("XmlRpcServerConnection::readHeader: EOF while reading header"); + return false; // Either way we close the connection + } + + return true; // Keep reading + } + + // Decode content length + if (lp == 0) { + XmlRpcUtil::error("XmlRpcServerConnection::readHeader: No Content-length specified"); + return false; // We could try to figure it out by parsing as we read, but for now... + } + + _contentLength = atoi(lp); + if (_contentLength <= 0) { + XmlRpcUtil::error("XmlRpcServerConnection::readHeader: Invalid Content-length specified (%d).", _contentLength); + return false; + } + + XmlRpcUtil::log(3, "XmlRpcServerConnection::readHeader: specified content length is %d.", _contentLength); + + // Otherwise copy non-header data to request buffer and set state to read request. + _request = bp; + + // Parse out any interesting bits from the header (HTTP version, connection) + _keepAlive = true; + if (_header.find("HTTP/1.0") != std::string::npos) { + if (kp == 0 || strncasecmp(kp, "keep-alive", 10) != 0) + _keepAlive = false; // Default for HTTP 1.0 is to close the connection + } else { + if (kp != 0 && strncasecmp(kp, "close", 5) == 0) + _keepAlive = false; + } + XmlRpcUtil::log(3, "KeepAlive: %d", _keepAlive); + + + _header = ""; + _connectionState = READ_REQUEST; + return true; // Continue monitoring this source +} + +bool +XmlRpcServerConnection::readRequest() { + return false; +} + +bool +XmlRpcServerConnection::readRequest(const std::string& txt) +{ + // If we dont have the entire request yet, read available data + if (int(_request.length()) < _contentLength) { + bool eof = false; + _request += txt; + + // If we haven't gotten the entire request yet, return (keep reading) + if (int(_request.length()) < _contentLength) { + if (eof) { + XmlRpcUtil::error("XmlRpcServerConnection::readRequest: EOF while reading request"); + return false; // Either way we close the connection + } + return true; + } + } + + // Otherwise, parse and dispatch the request + XmlRpcUtil::log(3, "XmlRpcServerConnection::readRequest read %d bytes.", _request.length()); + //XmlRpcUtil::log(5, "XmlRpcServerConnection::readRequest:\n%s\n", _request.c_str()); + + _connectionState = WRITE_RESPONSE; + + return true; // Continue monitoring this source +} + + +bool +XmlRpcServerConnection::writeResponse() +{ + if (_response.length() == 0) { + executeRequest(); + _bytesWritten = 0; + if (_response.length() == 0) { + XmlRpcUtil::error("XmlRpcServerConnection::writeResponse: empty response."); + return false; + } + } + + // Try to write the response + if ( ! XmlRpcSocket::nbWrite(this->getfd(), _response, &_bytesWritten)) { + XmlRpcUtil::error("XmlRpcServerConnection::writeResponse: write error (%s).",XmlRpcSocket::getErrorMsg().c_str()); + return false; + } + XmlRpcUtil::log(3, "XmlRpcServerConnection::writeResponse: wrote %d of %d bytes.", _bytesWritten, _response.length()); + + // Prepare to read the next request + if (_bytesWritten == int(_response.length())) { + _header = ""; + _request = ""; + _response = ""; + _connectionState = READ_HEADER; + } + + return _keepAlive; // Continue monitoring this source if true +} + +// Run the method, generate _response string +void +XmlRpcServerConnection::executeRequest() +{ + XmlRpcValue params, resultValue; + std::string methodName = parseRequest(params); + XmlRpcUtil::log(2, "XmlRpcServerConnection::executeRequest: server calling method '%s'", + methodName.c_str()); + + try { + + if ( ! executeMethod(methodName, params, resultValue) && + ! executeMulticall(methodName, params, resultValue)) + generateFaultResponse(methodName + ": unknown method name"); + else + generateResponse(resultValue.toXml()); + + } catch (const XmlRpcException& fault) { + XmlRpcUtil::log(2, "XmlRpcServerConnection::executeRequest: fault %s.", + fault.getMessage().c_str()); + generateFaultResponse(fault.getMessage(), fault.getCode()); + } +} + +// Parse the method name and the argument values from the request. +std::string +XmlRpcServerConnection::parseRequest(XmlRpcValue& params) +{ + int offset = 0; // Number of chars parsed from the request + + std::string methodName = XmlRpcUtil::parseTag(METHODNAME_TAG, _request, &offset); + + if (methodName.size() > 0 && XmlRpcUtil::findTag(PARAMS_TAG, _request, &offset)) + { + int nArgs = 0; + while (XmlRpcUtil::nextTagIs(PARAM_TAG, _request, &offset)) { + params[nArgs++] = XmlRpcValue(_request, &offset); + (void) XmlRpcUtil::nextTagIs(PARAM_ETAG, _request, &offset); + } + + (void) XmlRpcUtil::nextTagIs(PARAMS_ETAG, _request, &offset); + } + + return methodName; +} + +// Execute a named method with the specified params. +bool +XmlRpcServerConnection::executeMethod(const std::string& methodName, + XmlRpcValue& params, XmlRpcValue& result) +{ + XmlRpcServerMethod* method = _server->findMethod(methodName); + + if ( ! method) return false; + + method->execute(params, result); + + // Ensure a valid result value + if ( ! result.valid()) + result = std::string(); + + return true; +} + +// Execute multiple calls and return the results in an array. +bool +XmlRpcServerConnection::executeMulticall(const std::string& methodName, + XmlRpcValue& params, XmlRpcValue& result) +{ + if (methodName != SYSTEM_MULTICALL) return false; + + // There ought to be 1 parameter, an array of structs + if (params.size() != 1 || params[0].getType() != XmlRpcValue::TypeArray) + throw XmlRpcException(SYSTEM_MULTICALL + ": Invalid argument (expected an array)"); + + int nc = params[0].size(); + result.setSize(nc); + + for (int i=0; i\r\n" + "\r\n\t"; + const char RESPONSE_2[] = + "\r\n\r\n"; + + std::string body = RESPONSE_1 + resultXml + RESPONSE_2; + std::string header = generateHeader(body); + + _response = header + body; + XmlRpcUtil::log(5, "XmlRpcServerConnection::generateResponse:\n%s\n", _response.c_str()); +} + +// Prepend http headers +std::string +XmlRpcServerConnection::generateHeader(std::string const& body) +{ + std::string header = + "HTTP/1.1 200 OK\r\n" + "Server: "; + header += XMLRPC_VERSION; + header += "\r\n" + "Content-Type: text/xml\r\n" + "Content-length: "; + + char buffLen[40]; + sprintf(buffLen,"%d\r\n\r\n", body.size()); + + return header + buffLen; +} + + +void +XmlRpcServerConnection::generateFaultResponse(std::string const& errorMsg, int errorCode) +{ + const char RESPONSE_1[] = + "\r\n" + "\r\n\t"; + const char RESPONSE_2[] = + "\r\n\r\n"; + + XmlRpcValue faultStruct; + faultStruct[FAULTCODE] = errorCode; + faultStruct[FAULTSTRING] = errorMsg; + std::string body = RESPONSE_1 + faultStruct.toXml() + RESPONSE_2; + std::string header = generateHeader(body); + + _response = header + body; +} + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h new file mode 100644 index 0000000..23d8f43 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h @@ -0,0 +1,109 @@ +#ifndef _XMLRPCSERVERCONNECTION_H_ +#define _XMLRPCSERVERCONNECTION_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +#ifndef MAKEDEPEND +# include +#endif + +#include "XmlRpcValue.h" +#include "XmlRpcSource.h" + +namespace XmlRpc { + + + // The server waits for client connections and provides methods + class XmlRpcServer; + class XmlRpcServerMethod; + + //! A class to handle XML RPC requests from a particular client + class XmlRpcServerConnection : public XmlRpcSource { + public: + // Static data + static const char METHODNAME_TAG[]; + static const char PARAMS_TAG[]; + static const char PARAMS_ETAG[]; + static const char PARAM_TAG[]; + static const char PARAM_ETAG[]; + + static const std::string SYSTEM_MULTICALL; + static const std::string METHODNAME; + static const std::string PARAMS; + + static const std::string FAULTCODE; + static const std::string FAULTSTRING; + + //! Constructor + XmlRpcServerConnection(int fd, XmlRpcServer* server, bool deleteOnClose = false); + //! Destructor + virtual ~XmlRpcServerConnection(); + + // XmlRpcSource interface implementation + //! Handle IO on the client connection socket. + //! @param eventType Type of IO event that occurred. @see XmlRpcDispatch::EventType. + virtual unsigned handleEvent(unsigned eventType); + + bool readHeader(); + bool readRequest(); + + void reset(); + bool read(const std::string& txt); + bool readHeader(const std::string& txt); + bool readRequest(const std::string& txt); + // Parse the methodName and parameters from the request. + std::string parseRequest(XmlRpcValue& params); + + // Construct a response from the result XML. + void generateResponse(std::string const& resultXml); + std::string getResponse() { return _response; } + + protected: + + bool writeResponse(); + + // Parses the request, runs the method, generates the response xml. + virtual void executeRequest(); + + // Execute a named method with the specified params. + bool executeMethod(const std::string& methodName, XmlRpcValue& params, XmlRpcValue& result); + + // Execute multiple calls and return the results in an array. + bool executeMulticall(const std::string& methodName, XmlRpcValue& params, XmlRpcValue& result); + + void generateFaultResponse(std::string const& msg, int errorCode = -1); + std::string generateHeader(std::string const& body); + + + // The XmlRpc server that accepted this connection + XmlRpcServer* _server; + + // Possible IO states for the connection + enum ServerConnectionState { READ_HEADER, READ_REQUEST, WRITE_RESPONSE }; + ServerConnectionState _connectionState; + + // Request headers + std::string _header; + + // Number of bytes expected in the request body (parsed from header) + int _contentLength; + + // Request body + std::string _request; + + // Response + std::string _response; + + // Number of bytes of the response written so far + int _bytesWritten; + + // Whether to keep the current client connection open for further requests + bool _keepAlive; + }; +} // namespace XmlRpc + +#endif // _XMLRPCSERVERCONNECTION_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp new file mode 100644 index 0000000..1616ff4 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp @@ -0,0 +1,21 @@ + +#include "XmlRpcServerMethod.h" +#include "XmlRpcServer.h" + +namespace XmlRpc { + + + XmlRpcServerMethod::XmlRpcServerMethod(std::string const& name, XmlRpcServer* server) + { + _name = name; + _server = server; + if (_server) _server->addMethod(this); + } + + XmlRpcServerMethod::~XmlRpcServerMethod() + { + if (_server) _server->removeMethod(this); + } + + +} // namespace XmlRpc diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h new file mode 100644 index 0000000..738a9c8 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h @@ -0,0 +1,47 @@ + +#ifndef _XMLRPCSERVERMETHOD_H_ +#define _XMLRPCSERVERMETHOD_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +#ifndef MAKEDEPEND +# include +#endif + +namespace XmlRpc { + + // Representation of a parameter or result value + class XmlRpcValue; + + // The XmlRpcServer processes client requests to call RPCs + class XmlRpcServer; + + //! Abstract class representing a single RPC method + class XmlRpcServerMethod { + public: + //! Constructor + XmlRpcServerMethod(std::string const& name, XmlRpcServer* server = 0); + //! Destructor + virtual ~XmlRpcServerMethod(); + + //! Returns the name of the method + std::string& name() { return _name; } + + //! Execute the method. Subclasses must provide a definition for this method. + virtual void execute(XmlRpcValue& params, XmlRpcValue& result) = 0; + + //! Returns a help string for the method. + //! Subclasses should define this method if introspection is being used. + virtual std::string help() { return std::string(); } + + protected: + std::string _name; + XmlRpcServer* _server; + }; +} // namespace XmlRpc + +#endif // _XMLRPCSERVERMETHOD_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp new file mode 100644 index 0000000..2aa21d4 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp @@ -0,0 +1,263 @@ + +#include "XmlRpcSocket.h" +#include "XmlRpcUtil.h" + +#ifndef MAKEDEPEND + +#if defined(_WINDOWS) +# include +# include +//# pragma lib(WS2_32.lib) + +# define EINPROGRESS WSAEINPROGRESS +# define EWOULDBLOCK WSAEWOULDBLOCK +# define ETIMEDOUT WSAETIMEDOUT +#else +extern "C" { +# include +# include +# include +# include +# include +# include +# include +# include +} +#endif // _WINDOWS + +#include +#include + +#endif // MAKEDEPEND + + +using namespace XmlRpc; + + + +#if defined(_WINDOWS) + +static void initWinSock() +{ + static bool wsInit = false; + if (! wsInit) + { + WORD wVersionRequested = MAKEWORD( 2, 0 ); + WSADATA wsaData; + WSAStartup(wVersionRequested, &wsaData); + wsInit = true; + } +} + +#else + +#define initWinSock() + +#endif // _WINDOWS + + +// These errors are not considered fatal for an IO operation; the operation will be re-tried. +static inline bool +nonFatalError() +{ + int err = XmlRpcSocket::getError(); + return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR); +} + + + +int +XmlRpcSocket::socket() +{ + initWinSock(); + return (int) ::socket(AF_INET, SOCK_STREAM, 0); +} + + +void +XmlRpcSocket::close(int fd) +{ + XmlRpcUtil::log(4, "XmlRpcSocket::close: fd %d.", fd); +#if defined(_WINDOWS) + closesocket(fd); +#else + ::close(fd); +#endif // _WINDOWS +} + + + + +bool +XmlRpcSocket::setNonBlocking(int fd) +{ +#if defined(_WINDOWS) + unsigned long flag = 1; + return (ioctlsocket((SOCKET)fd, FIONBIO, &flag) == 0); +#else + return (fcntl(fd, F_SETFL, O_NONBLOCK) == 0); +#endif // _WINDOWS +} + + +bool +XmlRpcSocket::setReuseAddr(int fd) +{ + // Allow this port to be re-bound immediately so server re-starts are not delayed + int sflag = 1; + return (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char *)&sflag, sizeof(sflag)) == 0); +} + + +// Bind to a specified port +bool +XmlRpcSocket::bind(int fd, int port) +{ + struct sockaddr_in saddr; + memset(&saddr, 0, sizeof(saddr)); + saddr.sin_family = AF_INET; + saddr.sin_addr.s_addr = htonl(INADDR_ANY); + saddr.sin_port = htons((u_short) port); + return (::bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) == 0); +} + + +// Set socket in listen mode +bool +XmlRpcSocket::listen(int fd, int backlog) +{ + return (::listen(fd, backlog) == 0); +} + + +int +XmlRpcSocket::accept(int fd) +{ + struct sockaddr_in addr; +#if defined(_WINDOWS) + int +#else + socklen_t +#endif + addrlen = sizeof(addr); + + return (int) ::accept(fd, (struct sockaddr*)&addr, &addrlen); +} + + + +// Connect a socket to a server (from a client) +bool +XmlRpcSocket::connect(int fd, std::string& host, int port) +{ + struct sockaddr_in saddr; + memset(&saddr, 0, sizeof(saddr)); + saddr.sin_family = AF_INET; + + struct hostent *hp = gethostbyname(host.c_str()); + if (hp == 0) return false; + + saddr.sin_family = hp->h_addrtype; + memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length); + saddr.sin_port = htons((u_short) port); + + // For asynch operation, this will return EWOULDBLOCK (windows) or + // EINPROGRESS (linux) and we just need to wait for the socket to be writable... + int result = ::connect(fd, (struct sockaddr *)&saddr, sizeof(saddr)); + return result == 0 || nonFatalError(); +} + + + +// Read available text from the specified socket. Returns false on error. +bool +XmlRpcSocket::nbRead(int fd, std::string& s, bool *eof) +{ + const int READ_SIZE = 4096; // Number of bytes to attempt to read at a time + char readBuf[READ_SIZE]; + + bool wouldBlock = false; + *eof = false; + + while ( ! wouldBlock && ! *eof) { +#if defined(_WINDOWS) + int n = recv(fd, readBuf, READ_SIZE-1, 0); +#else + int n = read(fd, readBuf, READ_SIZE-1); +#endif + XmlRpcUtil::log(5, "XmlRpcSocket::nbRead: read/recv returned %d.", n); + + if (n > 0) { + readBuf[n] = 0; + s.append(readBuf, n); + } else if (n == 0) { + *eof = true; + } else if (nonFatalError()) { + wouldBlock = true; + } else { + return false; // Error + } + } + return true; +} + + +// Write text to the specified socket. Returns false on error. +bool +XmlRpcSocket::nbWrite(int fd, std::string& s, int *bytesSoFar) +{ + int nToWrite = int(s.length()) - *bytesSoFar; + char *sp = const_cast(s.c_str()) + *bytesSoFar; + bool wouldBlock = false; + + while ( nToWrite > 0 && ! wouldBlock ) { +#if defined(_WINDOWS) + int n = send(fd, sp, nToWrite, 0); +#else + int n = write(fd, sp, nToWrite); +#endif + XmlRpcUtil::log(5, "XmlRpcSocket::nbWrite: send/write returned %d.", n); + + if (n > 0) { + sp += n; + *bytesSoFar += n; + nToWrite -= n; + } else if (nonFatalError()) { + wouldBlock = true; + } else { + return false; // Error + } + } + return true; +} + + +// Returns last errno +int +XmlRpcSocket::getError() +{ +#if defined(_WINDOWS) + return WSAGetLastError(); +#else + return errno; +#endif +} + + +// Returns message corresponding to last errno +std::string +XmlRpcSocket::getErrorMsg() +{ + return getErrorMsg(getError()); +} + +// Returns message corresponding to errno... well, it should anyway +std::string +XmlRpcSocket::getErrorMsg(int error) +{ + char err[60]; + snprintf(err,sizeof(err),"error %d", error); + return std::string(err); +} + + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h new file mode 100644 index 0000000..fa7f950 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h @@ -0,0 +1,69 @@ +#ifndef _XMLRPCSOCKET_H_ +#define _XMLRPCSOCKET_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +#ifndef MAKEDEPEND +# include +#endif + +namespace XmlRpc { + + //! A platform-independent socket API. + class XmlRpcSocket { + public: + + //! Creates a stream (TCP) socket. Returns -1 on failure. + static int socket(); + + //! Closes a socket. + static void close(int socket); + + + //! Sets a stream (TCP) socket to perform non-blocking IO. Returns false on failure. + static bool setNonBlocking(int socket); + + //! Read text from the specified socket. Returns false on error. + static bool nbRead(int socket, std::string& s, bool *eof); + + //! Write text to the specified socket. Returns false on error. + static bool nbWrite(int socket, std::string& s, int *bytesSoFar); + + + // The next four methods are appropriate for servers. + + //! Allow the port the specified socket is bound to to be re-bound immediately so + //! server re-starts are not delayed. Returns false on failure. + static bool setReuseAddr(int socket); + + //! Bind to a specified port + static bool bind(int socket, int port); + + //! Set socket in listen mode + static bool listen(int socket, int backlog); + + //! Accept a client connection request + static int accept(int socket); + + + //! Connect a socket to a server (from a client) + static bool connect(int socket, std::string& host, int port); + + + //! Returns last errno + static int getError(); + + //! Returns message corresponding to last error + static std::string getErrorMsg(); + + //! Returns message corresponding to error + static std::string getErrorMsg(int error); + }; + +} // namespace XmlRpc + +#endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp new file mode 100644 index 0000000..99203b0 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp @@ -0,0 +1,35 @@ + +#include "XmlRpcSource.h" +#include "XmlRpcSocket.h" +#include "XmlRpcUtil.h" + +namespace XmlRpc { + + + XmlRpcSource::XmlRpcSource(int fd /*= -1*/, bool deleteOnClose /*= false*/) + : _fd(fd), _deleteOnClose(deleteOnClose), _keepOpen(false) + { + } + + XmlRpcSource::~XmlRpcSource() + { + } + + + void + XmlRpcSource::close() + { + if (_fd != -1) { + XmlRpcUtil::log(2,"XmlRpcSource::close: closing socket %d.", _fd); + XmlRpcSocket::close(_fd); + XmlRpcUtil::log(2,"XmlRpcSource::close: done closing socket %d.", _fd); + _fd = -1; + } + if (_deleteOnClose) { + XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this"); + _deleteOnClose = false; + delete this; + } + } + +} // namespace XmlRpc diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h new file mode 100644 index 0000000..135dce4 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h @@ -0,0 +1,55 @@ + +#ifndef _XMLRPCSOURCE_H_ +#define _XMLRPCSOURCE_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +namespace XmlRpc { + + //! An RPC source represents a file descriptor to monitor + class XmlRpcSource { + public: + //! Constructor + //! @param fd The socket file descriptor to monitor. + //! @param deleteOnClose If true, the object deletes itself when close is called. + XmlRpcSource(int fd = -1, bool deleteOnClose = false); + + //! Destructor + virtual ~XmlRpcSource(); + + //! Return the file descriptor being monitored. + int getfd() const { return _fd; } + //! Specify the file descriptor to monitor. + void setfd(int fd) { _fd = fd; } + + //! Return whether the file descriptor should be kept open if it is no longer monitored. + bool getKeepOpen() const { return _keepOpen; } + //! Specify whether the file descriptor should be kept open if it is no longer monitored. + void setKeepOpen(bool b=true) { _keepOpen = b; } + + //! Close the owned fd. If deleteOnClose was specified at construction, the object is deleted. + virtual void close(); + + //! Return true to continue monitoring this source + virtual unsigned handleEvent(unsigned eventType) = 0; + + private: + + // Socket. This should really be a SOCKET (an alias for unsigned int*) on windows... + int _fd; + + // In the server, a new source (XmlRpcServerConnection) is created + // for each connected client. When each connection is closed, the + // corresponding source object is deleted. + bool _deleteOnClose; + + // In the client, keep connections open if you intend to make multiple calls. + bool _keepOpen; + }; +} // namespace XmlRpc + +#endif //_XMLRPCSOURCE_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp new file mode 100644 index 0000000..1bd583a --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp @@ -0,0 +1,250 @@ + +#include "XmlRpcUtil.h" + +#ifndef MAKEDEPEND +# include +# include +# include +# include +# include +#endif + +#include "XmlRpc.h" + +using namespace XmlRpc; + + +//#define USE_WINDOWS_DEBUG // To make the error and log messages go to VC++ debug output +#ifdef USE_WINDOWS_DEBUG +#define WIN32_LEAN_AND_MEAN +#include +#endif + +// Version id +const char XmlRpc::XMLRPC_VERSION[] = "XMLRPC++ 0.7"; + +// Default log verbosity: 0 for no messages through 5 (writes everything) +int XmlRpcLogHandler::_verbosity = 0; + +// Default log handler +static class DefaultLogHandler : public XmlRpcLogHandler { +public: + + void log(int level, const char* msg) { +#ifdef USE_WINDOWS_DEBUG + if (level <= _verbosity) { OutputDebugString(msg); OutputDebugString("\n"); } +#else + if (level <= _verbosity) std::cout << msg << std::endl; +#endif + } + +} defaultLogHandler; + +// Message log singleton +XmlRpcLogHandler* XmlRpcLogHandler::_logHandler = &defaultLogHandler; + + +// Default error handler +static class DefaultErrorHandler : public XmlRpcErrorHandler { +public: + + void error(const char* msg) { +#ifdef USE_WINDOWS_DEBUG + OutputDebugString(msg); OutputDebugString("\n"); +#else + std::cerr << msg << std::endl; +#endif + } +} defaultErrorHandler; + + +// Error handler singleton +XmlRpcErrorHandler* XmlRpcErrorHandler::_errorHandler = &defaultErrorHandler; + + +// Easy API for log verbosity +int XmlRpc::getVerbosity() { return XmlRpcLogHandler::getVerbosity(); } +void XmlRpc::setVerbosity(int level) { XmlRpcLogHandler::setVerbosity(level); } + + + +void XmlRpcUtil::log(int level, const char* fmt, ...) +{ + if (level <= XmlRpcLogHandler::getVerbosity()) + { + va_list va; + char buf[1024]; + va_start( va, fmt); + vsnprintf(buf,sizeof(buf)-1,fmt,va); + buf[sizeof(buf)-1] = 0; + XmlRpcLogHandler::getLogHandler()->log(level, buf); + } +} + + +void XmlRpcUtil::error(const char* fmt, ...) +{ + va_list va; + va_start(va, fmt); + char buf[1024]; + vsnprintf(buf,sizeof(buf)-1,fmt,va); + buf[sizeof(buf)-1] = 0; + XmlRpcErrorHandler::getErrorHandler()->error(buf); +} + + +// Returns contents between and , updates offset to char after +std::string +XmlRpcUtil::parseTag(const char* tag, std::string const& xml, int* offset) +{ + if (*offset >= int(xml.length())) return std::string(); + size_t istart = xml.find(tag, *offset); + if (istart == std::string::npos) return std::string(); + istart += strlen(tag); + std::string etag = "= int(xml.length())) return false; + size_t istart = xml.find(tag, *offset); + if (istart == std::string::npos) + return false; + + *offset = int(istart + strlen(tag)); + return true; +} + + +// Returns true if the tag is found at the specified offset (modulo any whitespace) +// and updates offset to the char after the tag +bool +XmlRpcUtil::nextTagIs(const char* tag, std::string const& xml, int* offset) +{ + if (*offset >= int(xml.length())) return false; + const char* cp = xml.c_str() + *offset; + int nc = 0; + while (*cp && isspace(*cp)) { + ++cp; + ++nc; + } + + int len = int(strlen(tag)); + if (*cp && (strncmp(cp, tag, len) == 0)) { + *offset += nc + len; + return true; + } + return false; +} + +// Returns the next tag and updates offset to the char after the tag, or empty string +// if the next non-whitespace character is not '<' +std::string +XmlRpcUtil::getNextTag(std::string const& xml, int* offset) +{ + if (*offset >= int(xml.length())) return std::string(); + + size_t pos = *offset; + const char* cp = xml.c_str() + pos; + while (*cp && isspace(*cp)) { + ++cp; + ++pos; + } + + if (*cp != '<') return std::string(); + + std::string s; + do { + s += *cp; + ++pos; + } while (*cp++ != '>' && *cp != 0); + + *offset = int(pos); + return s; +} + + + +// xml encodings (xml-encoded entities are preceded with '&') +static const char AMP = '&'; +static const char rawEntity[] = { '<', '>', '&', '\'', '\"', 0 }; +static const char* xmlEntity[] = { "lt;", "gt;", "amp;", "apos;", "quot;", 0 }; +static const int xmlEntLen[] = { 3, 3, 4, 5, 5 }; + + +// Replace xml-encoded entities with the raw text equivalents. + +std::string +XmlRpcUtil::xmlDecode(const std::string& encoded) +{ + std::string::size_type iAmp = encoded.find(AMP); + if (iAmp == std::string::npos) + return encoded; + + std::string decoded(encoded, 0, iAmp); + std::string::size_type iSize = encoded.size(); + decoded.reserve(iSize); + + const char* ens = encoded.c_str(); + while (iAmp != iSize) { + if (encoded[iAmp] == AMP && iAmp+1 < iSize) { + int iEntity; + for (iEntity=0; xmlEntity[iEntity] != 0; ++iEntity) + //if (encoded.compare(iAmp+1, xmlEntLen[iEntity], xmlEntity[iEntity]) == 0) + if (strncmp(ens+iAmp+1, xmlEntity[iEntity], xmlEntLen[iEntity]) == 0) + { + decoded += rawEntity[iEntity]; + iAmp += xmlEntLen[iEntity]+1; + break; + } + if (xmlEntity[iEntity] == 0) // unrecognized sequence + decoded += encoded[iAmp++]; + + } else { + decoded += encoded[iAmp++]; + } + } + + return decoded; +} + + +// Replace raw text with xml-encoded entities. + +std::string +XmlRpcUtil::xmlEncode(const std::string& raw) +{ + std::string::size_type iRep = raw.find_first_of(rawEntity); + if (iRep == std::string::npos) + return raw; + + std::string encoded(raw, 0, iRep); + std::string::size_type iSize = raw.size(); + + while (iRep != iSize) { + int iEntity; + for (iEntity=0; rawEntity[iEntity] != 0; ++iEntity) + if (raw[iRep] == rawEntity[iEntity]) + { + encoded += AMP; + encoded += xmlEntity[iEntity]; + break; + } + if (rawEntity[iEntity] == 0) + encoded += raw[iRep]; + ++iRep; + } + return encoded; +} + + + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h new file mode 100644 index 0000000..8128f72 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h @@ -0,0 +1,61 @@ +#ifndef _XMLRPCUTIL_H_ +#define _XMLRPCUTIL_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +#ifndef MAKEDEPEND +# include +#endif + +#if defined(_MSC_VER) +# define snprintf _snprintf +# define vsnprintf _vsnprintf +# define strcasecmp _stricmp +# define strncasecmp _strnicmp +#elif defined(__BORLANDC__) +# define strcasecmp stricmp +# define strncasecmp strnicmp +#endif + +namespace XmlRpc { + + //! Utilities for XML parsing, encoding, and decoding and message handlers. + class XmlRpcUtil { + public: + // hokey xml parsing + //! Returns contents between and , updates offset to char after + static std::string parseTag(const char* tag, std::string const& xml, int* offset); + + //! Returns true if the tag is found and updates offset to the char after the tag + static bool findTag(const char* tag, std::string const& xml, int* offset); + + //! Returns the next tag and updates offset to the char after the tag, or empty string + //! if the next non-whitespace character is not '<' + static std::string getNextTag(std::string const& xml, int* offset); + + //! Returns true if the tag is found at the specified offset (modulo any whitespace) + //! and updates offset to the char after the tag + static bool nextTagIs(const char* tag, std::string const& xml, int* offset); + + + //! Convert raw text to encoded xml. + static std::string xmlEncode(const std::string& raw); + + //! Convert encoded xml to raw text + static std::string xmlDecode(const std::string& encoded); + + + //! Dump messages somewhere + static void log(int level, const char* fmt, ...); + + //! Dump error messages somewhere + static void error(const char* fmt, ...); + + }; +} // namespace XmlRpc + +#endif // _XMLRPCUTIL_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp new file mode 100644 index 0000000..607b7a1 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp @@ -0,0 +1,610 @@ + +#include "XmlRpcValue.h" +#include "XmlRpcException.h" +#include "XmlRpcUtil.h" +#include "base64.h" + +#ifndef MAKEDEPEND +# include +# include +# include +# include +#endif + +namespace XmlRpc { + + + static const char VALUE_TAG[] = ""; + static const char VALUE_ETAG[] = ""; + + static const char BOOLEAN_TAG[] = ""; + static const char BOOLEAN_ETAG[] = ""; + static const char DOUBLE_TAG[] = ""; + static const char DOUBLE_ETAG[] = ""; + static const char INT_TAG[] = ""; + static const char I4_TAG[] = ""; + static const char I4_ETAG[] = ""; + static const char STRING_TAG[] = ""; + static const char DATETIME_TAG[] = ""; + static const char DATETIME_ETAG[] = ""; + static const char BASE64_TAG[] = ""; + static const char BASE64_ETAG[] = ""; + + static const char ARRAY_TAG[] = ""; + static const char DATA_TAG[] = ""; + static const char DATA_ETAG[] = ""; + static const char ARRAY_ETAG[] = ""; + + static const char STRUCT_TAG[] = ""; + static const char MEMBER_TAG[] = ""; + static const char NAME_TAG[] = ""; + static const char NAME_ETAG[] = ""; + static const char MEMBER_ETAG[] = ""; + static const char STRUCT_ETAG[] = ""; + + + + // Format strings + std::string XmlRpcValue::_doubleFormat("%f"); + + + + // Clean up + void XmlRpcValue::invalidate() + { + switch (_type) { + case TypeString: delete _value.asString; break; + case TypeDateTime: delete _value.asTime; break; + case TypeBase64: delete _value.asBinary; break; + case TypeArray: delete _value.asArray; break; + case TypeStruct: delete _value.asStruct; break; + default: break; + } + _type = TypeInvalid; + _value.asBinary = 0; + } + + + // Type checking + void XmlRpcValue::assertTypeOrInvalid(Type t) + { + if (_type == TypeInvalid) + { + _type = t; + switch (_type) { // Ensure there is a valid value for the type + case TypeString: _value.asString = new std::string(); break; + case TypeDateTime: _value.asTime = new struct tm(); break; + case TypeBase64: _value.asBinary = new BinaryData(); break; + case TypeArray: _value.asArray = new ValueArray(); break; + case TypeStruct: _value.asStruct = new ValueStruct(); break; + default: _value.asBinary = 0; break; + } + } + else if (_type != t) + throw XmlRpcException("type error"); + } + + void XmlRpcValue::assertArray(int size) const + { + if (_type != TypeArray) + throw XmlRpcException("type error: expected an array"); + else if (int(_value.asArray->size()) < size) + throw XmlRpcException("range error: array index too large"); + } + + + void XmlRpcValue::assertArray(int size) + { + if (_type == TypeInvalid) { + _type = TypeArray; + _value.asArray = new ValueArray(size); + } else if (_type == TypeArray) { + if (int(_value.asArray->size()) < size) + _value.asArray->resize(size); + } else + throw XmlRpcException("type error: expected an array"); + } + + void XmlRpcValue::assertStruct() + { + if (_type == TypeInvalid) { + _type = TypeStruct; + _value.asStruct = new ValueStruct(); + } else if (_type != TypeStruct) + throw XmlRpcException("type error: expected a struct"); + } + + + // Operators + XmlRpcValue& XmlRpcValue::operator=(XmlRpcValue const& rhs) + { + if (this != &rhs) + { + invalidate(); + _type = rhs._type; + switch (_type) { + case TypeBoolean: _value.asBool = rhs._value.asBool; break; + case TypeInt: _value.asInt = rhs._value.asInt; break; + case TypeDouble: _value.asDouble = rhs._value.asDouble; break; + case TypeDateTime: _value.asTime = new struct tm(*rhs._value.asTime); break; + case TypeString: _value.asString = new std::string(*rhs._value.asString); break; + case TypeBase64: _value.asBinary = new BinaryData(*rhs._value.asBinary); break; + case TypeArray: _value.asArray = new ValueArray(*rhs._value.asArray); break; + case TypeStruct: _value.asStruct = new ValueStruct(*rhs._value.asStruct); break; + default: _value.asBinary = 0; break; + } + } + return *this; + } + + + // Predicate for tm equality + static bool tmEq(struct tm const& t1, struct tm const& t2) { + return t1.tm_sec == t2.tm_sec && t1.tm_min == t2.tm_min && + t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday && + t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year; + } + + bool XmlRpcValue::operator==(XmlRpcValue const& other) const + { + if (_type != other._type) + return false; + + switch (_type) { + case TypeBoolean: return ( !_value.asBool && !other._value.asBool) || + ( _value.asBool && other._value.asBool); + case TypeInt: return _value.asInt == other._value.asInt; + case TypeDouble: return _value.asDouble == other._value.asDouble; + case TypeDateTime: return tmEq(*_value.asTime, *other._value.asTime); + case TypeString: return *_value.asString == *other._value.asString; + case TypeBase64: return *_value.asBinary == *other._value.asBinary; + case TypeArray: return *_value.asArray == *other._value.asArray; + + // The map<>::operator== requires the definition of value< for kcc + case TypeStruct: //return *_value.asStruct == *other._value.asStruct; + { + if (_value.asStruct->size() != other._value.asStruct->size()) + return false; + + ValueStruct::const_iterator it1=_value.asStruct->begin(); + ValueStruct::const_iterator it2=other._value.asStruct->begin(); + while (it1 != _value.asStruct->end()) { + const XmlRpcValue& v1 = it1->second; + const XmlRpcValue& v2 = it2->second; + if ( ! (v1 == v2)) + return false; + it1++; + it2++; + } + return true; + } + default: break; + } + return true; // Both invalid values ... + } + + bool XmlRpcValue::operator!=(XmlRpcValue const& other) const + { + return !(*this == other); + } + + + // Works for strings, binary data, arrays, and structs. + int XmlRpcValue::size() const + { + switch (_type) { + case TypeString: return int(_value.asString->size()); + case TypeBase64: return int(_value.asBinary->size()); + case TypeArray: return int(_value.asArray->size()); + case TypeStruct: return int(_value.asStruct->size()); + default: break; + } + + throw XmlRpcException("type error"); + } + + // Checks for existence of struct member + bool XmlRpcValue::hasMember(const std::string& name) const + { + return _type == TypeStruct && _value.asStruct->find(name) != _value.asStruct->end(); + } + + // Set the value from xml. The chars at *offset into valueXml + // should be the start of a tag. Destroys any existing value. + bool XmlRpcValue::fromXml(std::string const& valueXml, int* offset) + { + int savedOffset = *offset; + + invalidate(); + if ( ! XmlRpcUtil::nextTagIs(VALUE_TAG, valueXml, offset)) + return false; // Not a value, offset not updated + + int afterValueOffset = *offset; + std::string typeTag = XmlRpcUtil::getNextTag(valueXml, offset); + bool result = false; + if (typeTag == BOOLEAN_TAG) + result = boolFromXml(valueXml, offset); + else if (typeTag == I4_TAG || typeTag == INT_TAG) + result = intFromXml(valueXml, offset); + else if (typeTag == DOUBLE_TAG) + result = doubleFromXml(valueXml, offset); + else if (typeTag.empty() || typeTag == STRING_TAG) + result = stringFromXml(valueXml, offset); + else if (typeTag == DATETIME_TAG) + result = timeFromXml(valueXml, offset); + else if (typeTag == BASE64_TAG) + result = binaryFromXml(valueXml, offset); + else if (typeTag == ARRAY_TAG) + result = arrayFromXml(valueXml, offset); + else if (typeTag == STRUCT_TAG) + result = structFromXml(valueXml, offset); + // Watch for empty/blank strings with no tag + else if (typeTag == VALUE_ETAG) + { + *offset = afterValueOffset; // back up & try again + result = stringFromXml(valueXml, offset); + } + + if (result) // Skip over the tag + XmlRpcUtil::findTag(VALUE_ETAG, valueXml, offset); + else // Unrecognized tag after + *offset = savedOffset; + + return result; + } + + // Encode the Value in xml + std::string XmlRpcValue::toXml() const + { + switch (_type) { + case TypeBoolean: return boolToXml(); + case TypeInt: return intToXml(); + case TypeDouble: return doubleToXml(); + case TypeString: return stringToXml(); + case TypeDateTime: return timeToXml(); + case TypeBase64: return binaryToXml(); + case TypeArray: return arrayToXml(); + case TypeStruct: return structToXml(); + default: break; + } + return std::string(); // Invalid value + } + + + // Boolean + bool XmlRpcValue::boolFromXml(std::string const& valueXml, int* offset) + { + const char* valueStart = valueXml.c_str() + *offset; + char* valueEnd; + long ivalue = strtol(valueStart, &valueEnd, 10); + if (valueEnd == valueStart || (ivalue != 0 && ivalue != 1)) + return false; + + _type = TypeBoolean; + _value.asBool = (ivalue == 1); + *offset += int(valueEnd - valueStart); + return true; + } + + std::string XmlRpcValue::boolToXml() const + { + std::string xml = VALUE_TAG; + xml += BOOLEAN_TAG; + xml += (_value.asBool ? "1" : "0"); + xml += BOOLEAN_ETAG; + xml += VALUE_ETAG; + return xml; + } + + // Int + bool XmlRpcValue::intFromXml(std::string const& valueXml, int* offset) + { + const char* valueStart = valueXml.c_str() + *offset; + char* valueEnd; + long ivalue = strtol(valueStart, &valueEnd, 10); + if (valueEnd == valueStart) + return false; + + _type = TypeInt; + _value.asInt = int(ivalue); + *offset += int(valueEnd - valueStart); + return true; + } + + std::string XmlRpcValue::intToXml() const + { + char buf[256]; + snprintf(buf, sizeof(buf)-1, "%d", _value.asInt); + buf[sizeof(buf)-1] = 0; + std::string xml = VALUE_TAG; + xml += I4_TAG; + xml += buf; + xml += I4_ETAG; + xml += VALUE_ETAG; + return xml; + } + + // Double + bool XmlRpcValue::doubleFromXml(std::string const& valueXml, int* offset) + { + const char* valueStart = valueXml.c_str() + *offset; + char* valueEnd; + double dvalue = strtod(valueStart, &valueEnd); + if (valueEnd == valueStart) + return false; + + _type = TypeDouble; + _value.asDouble = dvalue; + *offset += int(valueEnd - valueStart); + return true; + } + + std::string XmlRpcValue::doubleToXml() const + { + char buf[256]; + snprintf(buf, sizeof(buf)-1, getDoubleFormat().c_str(), _value.asDouble); + buf[sizeof(buf)-1] = 0; + + std::string xml = VALUE_TAG; + xml += DOUBLE_TAG; + xml += buf; + xml += DOUBLE_ETAG; + xml += VALUE_ETAG; + return xml; + } + + // String + bool XmlRpcValue::stringFromXml(std::string const& valueXml, int* offset) + { + size_t valueEnd = valueXml.find('<', *offset); + if (valueEnd == std::string::npos) + return false; // No end tag; + + _type = TypeString; + _value.asString = new std::string(XmlRpcUtil::xmlDecode(valueXml.substr(*offset, valueEnd-*offset))); + *offset += int(_value.asString->length()); + return true; + } + + std::string XmlRpcValue::stringToXml() const + { + std::string xml = VALUE_TAG; + //xml += STRING_TAG; optional + xml += XmlRpcUtil::xmlEncode(*_value.asString); + //xml += STRING_ETAG; + xml += VALUE_ETAG; + return xml; + } + + // DateTime (stored as a struct tm) + bool XmlRpcValue::timeFromXml(std::string const& valueXml, int* offset) + { + size_t valueEnd = valueXml.find('<', *offset); + if (valueEnd == std::string::npos) + return false; // No end tag; + + std::string stime = valueXml.substr(*offset, valueEnd-*offset); + + struct tm t; + if (sscanf(stime.c_str(),"%4d%2d%2dT%2d:%2d:%2d",&t.tm_year,&t.tm_mon,&t.tm_mday,&t.tm_hour,&t.tm_min,&t.tm_sec) != 6) + return false; + + t.tm_isdst = -1; + _type = TypeDateTime; + _value.asTime = new struct tm(t); + *offset += int(stime.length()); + return true; + } + + std::string XmlRpcValue::timeToXml() const + { + struct tm* t = _value.asTime; + char buf[20]; + snprintf(buf, sizeof(buf)-1, "%4d%02d%02dT%02d:%02d:%02d", + t->tm_year,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec); + buf[sizeof(buf)-1] = 0; + + std::string xml = VALUE_TAG; + xml += DATETIME_TAG; + xml += buf; + xml += DATETIME_ETAG; + xml += VALUE_ETAG; + return xml; + } + + + // Base64 + bool XmlRpcValue::binaryFromXml(std::string const& valueXml, int* offset) + { + size_t valueEnd = valueXml.find('<', *offset); + if (valueEnd == std::string::npos) + return false; // No end tag; + + _type = TypeBase64; + std::string asString = valueXml.substr(*offset, valueEnd-*offset); + _value.asBinary = new BinaryData(); + // check whether base64 encodings can contain chars xml encodes... + + // convert from base64 to binary + int iostatus = 0; + base64 decoder; + std::back_insert_iterator ins = std::back_inserter(*(_value.asBinary)); + decoder.get(asString.begin(), asString.end(), ins, iostatus); + + *offset += int(asString.length()); + return true; + } + + + std::string XmlRpcValue::binaryToXml() const + { + // convert to base64 + std::vector base64data; + int iostatus = 0; + base64 encoder; + std::back_insert_iterator > ins = std::back_inserter(base64data); + encoder.put(_value.asBinary->begin(), _value.asBinary->end(), ins, iostatus, base64<>::crlf()); + + // Wrap with xml + std::string xml = VALUE_TAG; + xml += BASE64_TAG; + xml.append(base64data.begin(), base64data.end()); + xml += BASE64_ETAG; + xml += VALUE_ETAG; + return xml; + } + + + // Array + bool XmlRpcValue::arrayFromXml(std::string const& valueXml, int* offset) + { + if ( ! XmlRpcUtil::nextTagIs(DATA_TAG, valueXml, offset)) + return false; + + _type = TypeArray; + _value.asArray = new ValueArray; + XmlRpcValue v; + while (v.fromXml(valueXml, offset)) + _value.asArray->push_back(v); // copy... + + // Skip the trailing + (void) XmlRpcUtil::nextTagIs(DATA_ETAG, valueXml, offset); + return true; + } + + + // In general, its preferable to generate the xml of each element of the + // array as it is needed rather than glomming up one big string. + std::string XmlRpcValue::arrayToXml() const + { + std::string xml = VALUE_TAG; + xml += ARRAY_TAG; + xml += DATA_TAG; + + int s = int(_value.asArray->size()); + for (int i=0; iat(i).toXml(); + + xml += DATA_ETAG; + xml += ARRAY_ETAG; + xml += VALUE_ETAG; + return xml; + } + + + // Struct + bool XmlRpcValue::structFromXml(std::string const& valueXml, int* offset) + { + _type = TypeStruct; + _value.asStruct = new ValueStruct; + + while (XmlRpcUtil::nextTagIs(MEMBER_TAG, valueXml, offset)) { + // name + const std::string name = XmlRpcUtil::parseTag(NAME_TAG, valueXml, offset); + // value + XmlRpcValue val(valueXml, offset); + if ( ! val.valid()) { + invalidate(); + return false; + } + const std::pair p(name, val); + _value.asStruct->insert(p); + + (void) XmlRpcUtil::nextTagIs(MEMBER_ETAG, valueXml, offset); + } + return true; + } + + + // In general, its preferable to generate the xml of each element + // as it is needed rather than glomming up one big string. + std::string XmlRpcValue::structToXml() const + { + std::string xml = VALUE_TAG; + xml += STRUCT_TAG; + + ValueStruct::const_iterator it; + for (it=_value.asStruct->begin(); it!=_value.asStruct->end(); ++it) { + xml += MEMBER_TAG; + xml += NAME_TAG; + xml += XmlRpcUtil::xmlEncode(it->first); + xml += NAME_ETAG; + xml += it->second.toXml(); + xml += MEMBER_ETAG; + } + + xml += STRUCT_ETAG; + xml += VALUE_ETAG; + return xml; + } + + + + // Write the value without xml encoding it + std::ostream& XmlRpcValue::write(std::ostream& os) const { + switch (_type) { + default: break; + case TypeBoolean: os << _value.asBool; break; + case TypeInt: os << _value.asInt; break; + case TypeDouble: os << _value.asDouble; break; + case TypeString: os << *_value.asString; break; + case TypeDateTime: + { + struct tm* t = _value.asTime; + char buf[20]; + snprintf(buf, sizeof(buf)-1, "%4d%02d%02dT%02d:%02d:%02d", + t->tm_year,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec); + buf[sizeof(buf)-1] = 0; + os << buf; + break; + } + case TypeBase64: + { + int iostatus = 0; + std::ostreambuf_iterator out(os); + base64 encoder; + encoder.put(_value.asBinary->begin(), _value.asBinary->end(), out, iostatus, base64<>::crlf()); + break; + } + case TypeArray: + { + int s = int(_value.asArray->size()); + os << '{'; + for (int i=0; i 0) os << ','; + _value.asArray->at(i).write(os); + } + os << '}'; + break; + } + case TypeStruct: + { + os << '['; + ValueStruct::const_iterator it; + for (it=_value.asStruct->begin(); it!=_value.asStruct->end(); ++it) + { + if (it!=_value.asStruct->begin()) os << ','; + os << it->first << ':'; + it->second.write(os); + } + os << ']'; + break; + } + + } + + return os; + } + +} // namespace XmlRpc + + +// ostream +std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v) +{ + // If you want to output in xml format: + //return os << v.toXml(); + return v.write(os); +} + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h new file mode 100644 index 0000000..4726aa7 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h @@ -0,0 +1,190 @@ + +#ifndef _XMLRPCVALUE_H_ +#define _XMLRPCVALUE_H_ +// +// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + +#ifndef MAKEDEPEND +# include +# include +# include +# include +#endif + +namespace XmlRpc { + + //! RPC method arguments and results are represented by Values + // should probably refcount them... + class XmlRpcValue { + public: + + + enum Type { + TypeInvalid, + TypeBoolean, + TypeInt, + TypeDouble, + TypeString, + TypeDateTime, + TypeBase64, + TypeArray, + TypeStruct + }; + + // Non-primitive types + typedef std::vector BinaryData; + typedef std::vector ValueArray; + typedef std::map ValueStruct; + + + //! Constructors + XmlRpcValue() : _type(TypeInvalid) { _value.asBinary = 0; } + XmlRpcValue(bool value) : _type(TypeBoolean) { _value.asBool = value; } + XmlRpcValue(int value) : _type(TypeInt) { _value.asInt = value; } + XmlRpcValue(double value) : _type(TypeDouble) { _value.asDouble = value; } + + XmlRpcValue(std::string const& value) : _type(TypeString) + { _value.asString = new std::string(value); } + + XmlRpcValue(const char* value) : _type(TypeString) + { _value.asString = new std::string(value); } + + XmlRpcValue(struct tm* value) : _type(TypeDateTime) + { _value.asTime = new struct tm(*value); } + + + XmlRpcValue(void* value, int nBytes) : _type(TypeBase64) + { + _value.asBinary = new BinaryData((char*)value, ((char*)value)+nBytes); + } + + //! Construct from xml, beginning at *offset chars into the string, updates offset + XmlRpcValue(std::string const& xml, int* offset) : _type(TypeInvalid) + { if ( ! fromXml(xml,offset)) _type = TypeInvalid; } + + //! Copy + XmlRpcValue(XmlRpcValue const& rhs) : _type(TypeInvalid) { *this = rhs; } + + //! Destructor (make virtual if you want to subclass) + /*virtual*/ ~XmlRpcValue() { invalidate(); } + + //! Erase the current value + void clear() { invalidate(); } + + // Operators + XmlRpcValue& operator=(XmlRpcValue const& rhs); + XmlRpcValue& operator=(int const& rhs) { return operator=(XmlRpcValue(rhs)); } + XmlRpcValue& operator=(double const& rhs) { return operator=(XmlRpcValue(rhs)); } + XmlRpcValue& operator=(const char* rhs) { return operator=(XmlRpcValue(std::string(rhs))); } + + bool operator==(XmlRpcValue const& other) const; + bool operator!=(XmlRpcValue const& other) const; + + operator bool&() { assertTypeOrInvalid(TypeBoolean); return _value.asBool; } + operator int&() { assertTypeOrInvalid(TypeInt); return _value.asInt; } + operator double&() { assertTypeOrInvalid(TypeDouble); return _value.asDouble; } + operator std::string&() { assertTypeOrInvalid(TypeString); return *_value.asString; } + operator BinaryData&() { assertTypeOrInvalid(TypeBase64); return *_value.asBinary; } + operator struct tm&() { assertTypeOrInvalid(TypeDateTime); return *_value.asTime; } + operator ValueStruct&() { assertStruct(); return *_value.asStruct; } + + XmlRpcValue const& operator[](int i) const { assertArray(i+1); return _value.asArray->at(i); } + XmlRpcValue& operator[](int i) { assertArray(i+1); return _value.asArray->at(i); } + + XmlRpcValue& operator[](std::string const& k) { assertStruct(); return (*_value.asStruct)[k]; } + XmlRpcValue& operator[](const char* k) { assertStruct(); std::string s(k); return (*_value.asStruct)[s]; } + + // Accessors + //! Return true if the value has been set to something. + bool valid() const { return _type != TypeInvalid; } + + //! Return the type of the value stored. \see Type. + Type const &getType() const { return _type; } + + //! Return the size for string, base64, array, and struct values. + int size() const; + + //! Specify the size for array values. Array values will grow beyond this size if needed. + void setSize(int size) { assertArray(size); } + + //! Check for the existence of a struct member by name. + bool hasMember(const std::string& name) const; + + //! Decode xml. Destroys any existing value. + bool fromXml(std::string const& valueXml, int* offset); + + //! Encode the Value in xml + std::string toXml() const; + + //! Write the value (no xml encoding) + std::ostream& write(std::ostream& os) const; + + // Formatting + //! Return the format used to write double values. + static std::string const& getDoubleFormat() { return _doubleFormat; } + + //! Specify the format used to write double values. + static void setDoubleFormat(const char* f) { _doubleFormat = f; } + + + protected: + // Clean up + void invalidate(); + + // Type checking + void assertTypeOrInvalid(Type t); + void assertArray(int size) const; + void assertArray(int size); + void assertStruct(); + + // XML decoding + bool boolFromXml(std::string const& valueXml, int* offset); + bool intFromXml(std::string const& valueXml, int* offset); + bool doubleFromXml(std::string const& valueXml, int* offset); + bool stringFromXml(std::string const& valueXml, int* offset); + bool timeFromXml(std::string const& valueXml, int* offset); + bool binaryFromXml(std::string const& valueXml, int* offset); + bool arrayFromXml(std::string const& valueXml, int* offset); + bool structFromXml(std::string const& valueXml, int* offset); + + // XML encoding + std::string boolToXml() const; + std::string intToXml() const; + std::string doubleToXml() const; + std::string stringToXml() const; + std::string timeToXml() const; + std::string binaryToXml() const; + std::string arrayToXml() const; + std::string structToXml() const; + + // Format strings + static std::string _doubleFormat; + + // Type tag and values + Type _type; + + // At some point I will split off Arrays and Structs into + // separate ref-counted objects for more efficient copying. + union { + bool asBool; + int asInt; + double asDouble; + struct tm* asTime; + std::string* asString; + BinaryData* asBinary; + ValueArray* asArray; + ValueStruct* asStruct; + } _value; + + }; +} // namespace XmlRpc + + +std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v); + + +#endif // _XMLRPCVALUE_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/base64.h b/src/carriers/xmlrpc_carrier/xmlrpc/base64.h new file mode 100644 index 0000000..519ee0f --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc/base64.h @@ -0,0 +1,379 @@ + + +// base64.hpp +// Autor Konstantin Pilipchuk +// mailto:lostd@ukr.net +// +// + +#if !defined(__BASE64_H_INCLUDED__) +#define __BASE64_H_INCLUDED__ 1 + +#ifndef MAKEDEPEND +# include +#endif + +static +int _base64Chars[]= {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', + 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', + '0','1','2','3','4','5','6','7','8','9', + '+','/' }; + + +#define _0000_0011 0x03 +#define _1111_1100 0xFC +#define _1111_0000 0xF0 +#define _0011_0000 0x30 +#define _0011_1100 0x3C +#define _0000_1111 0x0F +#define _1100_0000 0xC0 +#define _0011_1111 0x3F + +#define _EQUAL_CHAR (-1) +#define _UNKNOWN_CHAR (-2) + +#define _IOS_FAILBIT std::ios_base::failbit +#define _IOS_EOFBIT std::ios_base::eofbit +#define _IOS_BADBIT std::ios_base::badbit +#define _IOS_GOODBIT std::ios_base::goodbit + +// TEMPLATE CLASS base64_put +template > +class base64 +{ +public: + + typedef unsigned char byte_t; + typedef _E char_type; + typedef _Tr traits_type; + + // base64 requires max line length <= 72 characters + // you can fill end of line + // it may be crlf, crlfsp, noline or other class like it + + + struct crlf + { + template + _OI operator()(_OI _To) const{ + *_To = _Tr::to_char_type('\r'); ++_To; + *_To = _Tr::to_char_type('\n'); ++_To; + + return (_To); + } + }; + + + struct crlfsp + { + template + _OI operator()(_OI _To) const{ + *_To = _Tr::to_char_type('\r'); ++_To; + *_To = _Tr::to_char_type('\n'); ++_To; + *_To = _Tr::to_char_type(' '); ++_To; + + return (_To); + } + }; + + struct noline + { + template + _OI operator()(_OI _To) const{ + return (_To); + } + }; + + struct three2four + { + void zero() + { + _data[0] = 0; + _data[1] = 0; + _data[2] = 0; + } + + byte_t get_0() const + { + return _data[0]; + } + byte_t get_1() const + { + return _data[1]; + } + byte_t get_2() const + { + return _data[2]; + } + + void set_0(byte_t _ch) + { + _data[0] = _ch; + } + + void set_1(byte_t _ch) + { + _data[1] = _ch; + } + + void set_2(byte_t _ch) + { + _data[2] = _ch; + } + + // 0000 0000 1111 1111 2222 2222 + // xxxx xxxx xxxx xxxx xxxx xxxx + // 0000 0011 1111 2222 2233 3333 + + int b64_0() const {return (_data[0] & _1111_1100) >> 2;} + int b64_1() const {return ((_data[0] & _0000_0011) << 4) + ((_data[1] & _1111_0000)>>4);} + int b64_2() const {return ((_data[1] & _0000_1111) << 2) + ((_data[2] & _1100_0000)>>6);} + int b64_3() const {return (_data[2] & _0011_1111);} + + void b64_0(int _ch) {_data[0] = ((_ch & _0011_1111) << 2) | (_0000_0011 & _data[0]);} + + void b64_1(int _ch) { + _data[0] = ((_ch & _0011_0000) >> 4) | (_1111_1100 & _data[0]); + _data[1] = ((_ch & _0000_1111) << 4) | (_0000_1111 & _data[1]); } + + void b64_2(int _ch) { + _data[1] = ((_ch & _0011_1100) >> 2) | (_1111_0000 & _data[1]); + _data[2] = ((_ch & _0000_0011) << 6) | (_0011_1111 & _data[2]); } + + void b64_3(int _ch){ + _data[2] = (_ch & _0011_1111) | (_1100_0000 & _data[2]);} + + private: + byte_t _data[3]; + + }; + + + + + template + _II put(_II _First, _II _Last, _OI _To, _State& _St, _Endline _Endl) const + { + three2four _3to4; + int line_octets = 0; + + while(_First != _Last) + { + _3to4.zero(); + + // áåð¸ì ïî 3 ñèìâîëà + _3to4.set_0(*_First); + _First++; + + if(_First == _Last) + { + *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To; + *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To; + *_To = _Tr::to_char_type('='); ++_To; + *_To = _Tr::to_char_type('='); ++_To; + goto __end; + } + + _3to4.set_1(*_First); + _First++; + + if(_First == _Last) + { + *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To; + *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To; + *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_2()]); ++_To; + *_To = _Tr::to_char_type('='); ++_To; + goto __end; + } + + _3to4.set_2(*_First); + _First++; + + *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To; + *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To; + *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_2()]); ++_To; + *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_3()]); ++_To; + + if(line_octets == 17) // base64 ïîçâîëÿåò äëèíó ñòðîêè íå áîëåå 72 ñèìâîëîâ + { + //_To = _Endl(_To); + *_To = '\n'; ++_To; + line_octets = 0; + } + else + ++line_octets; + } + + __end: ; + + return (_First); + + } + + + template + _II get(_II _First, _II _Last, _OI _To, _State& _St) const + { + three2four _3to4; + int _Char; + + while(_First != _Last) + { + + // Take octet + _3to4.zero(); + + // -- 0 -- + // Search next valid char... + while((_Char = _getCharType(*_First)) < 0 && _Char == _UNKNOWN_CHAR) + { + if(++_First == _Last) + { + _St |= _IOS_FAILBIT|_IOS_EOFBIT; return _First; // unexpected EOF + } + } + + if(_Char == _EQUAL_CHAR){ + // Error! First character in octet can't be '=' + _St |= _IOS_FAILBIT; + return _First; + } + else + _3to4.b64_0(_Char); + + + // -- 1 -- + // Search next valid char... + while(++_First != _Last) + if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR) + break; + + if(_First == _Last) { + _St |= _IOS_FAILBIT|_IOS_EOFBIT; // unexpected EOF + return _First; + } + + if(_Char == _EQUAL_CHAR){ + // Error! Second character in octet can't be '=' + _St |= _IOS_FAILBIT; + return _First; + } + else + _3to4.b64_1(_Char); + + + // -- 2 -- + // Search next valid char... + while(++_First != _Last) + if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR) + break; + + if(_First == _Last) { + // Error! Unexpected EOF. Must be '=' or base64 character + _St |= _IOS_FAILBIT|_IOS_EOFBIT; + return _First; + } + + if(_Char == _EQUAL_CHAR){ + // OK! + _3to4.b64_2(0); + _3to4.b64_3(0); + + // chek for EOF + if(++_First == _Last) + { + // Error! Unexpected EOF. Must be '='. Ignore it. + //_St |= _IOS_BADBIT|_IOS_EOFBIT; + _St |= _IOS_EOFBIT; + } + else + if(_getCharType(*_First) != _EQUAL_CHAR) + { + // Error! Must be '='. Ignore it. + //_St |= _IOS_BADBIT; + } + else + ++_First; // Skip '=' + + // write 1 byte to output + *_To = (byte_t) _3to4.get_0(); + return _First; + } + else + _3to4.b64_2(_Char); + + + // -- 3 -- + // Search next valid char... + while(++_First != _Last) + if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR) + break; + + if(_First == _Last) { + // Unexpected EOF. It's error. But ignore it. + //_St |= _IOS_FAILBIT|_IOS_EOFBIT; + _St |= _IOS_EOFBIT; + + return _First; + } + + if(_Char == _EQUAL_CHAR) + { + // OK! + _3to4.b64_3(0); + + // write to output 2 bytes + *_To = (byte_t) _3to4.get_0(); + *_To = (byte_t) _3to4.get_1(); + + ++_First; // set position to next character + + return _First; + } + else + _3to4.b64_3(_Char); + + + // write to output 3 bytes + *_To = (byte_t) _3to4.get_0(); + *_To = (byte_t) _3to4.get_1(); + *_To = (byte_t) _3to4.get_2(); + + ++_First; + + + } // while(_First != _Last) + + return (_First); + } + +protected: + + int _getCharType(int _Ch) const + { + if(_base64Chars[62] == _Ch) + return 62; + + if(_base64Chars[63] == _Ch) + return 63; + + if((_base64Chars[0] <= _Ch) && (_base64Chars[25] >= _Ch)) + return _Ch - _base64Chars[0]; + + if((_base64Chars[26] <= _Ch) && (_base64Chars[51] >= _Ch)) + return _Ch - _base64Chars[26] + 26; + + if((_base64Chars[52] <= _Ch) && (_base64Chars[61] >= _Ch)) + return _Ch - _base64Chars[52] + 52; + + if(_Ch == _Tr::to_int_type('=')) + return _EQUAL_CHAR; + + return _UNKNOWN_CHAR; + } + + +}; + + +#endif From 9b94352fc734b6f22a3b15cf8c32cb5912b3a25d Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 4 Jun 2010 03:57:27 +0000 Subject: [PATCH 002/187] rudimentary reading from ROS publishers svn path=/trunk/yarp2/; revision=7961 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index a560b6b..6d5d825 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -70,9 +70,8 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { } virtual void getHeader(const Bytes& header) { - // for now, expect XMLRPC++, which posts with uri /RPC2 - const char *target = "POST /RP"; - for (int i=0; i<8 && i Date: Fri, 4 Jun 2010 15:26:23 +0000 Subject: [PATCH 003/187] make xmlrpc<->bottle translation more controllable svn path=/trunk/yarp2/; revision=7965 --- src/carriers/xmlrpc_carrier/README.TXT | 27 +++++++++++++++ src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 33 ++++++++++++------- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 18 +++++++--- 3 files changed, 63 insertions(+), 15 deletions(-) create mode 100644 src/carriers/xmlrpc_carrier/README.TXT diff --git a/src/carriers/xmlrpc_carrier/README.TXT b/src/carriers/xmlrpc_carrier/README.TXT new file mode 100644 index 0000000..f8f53b8 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/README.TXT @@ -0,0 +1,27 @@ + + +XMLRPC to Bottle translation: + xmlrpc / bottle + int <-> int + string <-> string + double <-> double + array <-> list + struc <-> list + +Both arrays and strucs in XMLRPC are mapped to Bottle lists. +Strucs are mapped to a list with they tag "dict" prepended, +and then sublists with key->value mappings. + (dict (key1 val1) (key2 val2)) + +(The Bottle find/findGroup/check methods will work fine on +such lists, or you could populate a Property object if +you want fast look-up.) + +If you want to convert a Bottle list that may start with the +string "dict" or "list", prepend the keyword "list". + (list ...) +That keyword will be silently consumed, and will guarantee +that an XMLRPC array is produced. + + + diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index b874d1d..dd8413d 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -20,27 +20,38 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { } else if (vin.isList()) { Bottle *bot = vin.asList(); bool struc = true; - for (int i=0; isize(); i++) { - Value& vi = bot->get(i); - if (!vi.isList()) { - struc = false; - break; - } - if (vi.asList()->size()!=2) { - struc = false; - break; + int offset = 0; + ConstString tag = bot->get(0).asString(); + if (tag=="list") { + struc = false; + offset = 1; + } else if (tag=="dict") { + struc = true; + offset = 1; + } else { + // auto-detect + for (int i=0; isize(); i++) { + Value& vi = bot->get(i); + if (!vi.isList()) { + struc = false; + break; + } + if (vi.asList()->size()!=2) { + struc = false; + break; + } } } if (struc) { vout = XmlRpcValue(); - for (int i=0; isize(); i++) { + for (int i=offset; isize(); i++) { Bottle *boti = bot->get(i).asList(); XmlRpcValue& vouti=vout[boti->get(0).toString()]=XmlRpcValue(); toXmlRpcValue(boti->get(1),vouti); } } else { vout = XmlRpcValue(); - for (int i=0; isize(); i++) { + for (int i=offset; isize(); i++) { XmlRpcValue& vouti = vout[i] = XmlRpcValue(); toXmlRpcValue(bot->get(i),vouti); } diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 6de3bf4..14877f0 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -9,7 +9,7 @@ using namespace XmlRpc; using namespace std; -Value toValue(XmlRpcValue& v) { +Value toValue(XmlRpcValue& v, bool outer) { int t = v.getType(); switch (t) { case XmlRpcValue::TypeInt: @@ -28,7 +28,16 @@ Value toValue(XmlRpcValue& v) { for (int i=0; iadd(toValue(v2)); + Value v = toValue(v2,false); + if (i==0) { + ConstString tag = v.asString(); + if (tag=="list"||tag=="dict") { + if (!outer) { + bot->addString("list"); + } + } + } + bot->add(v); } } return vbot; @@ -39,6 +48,7 @@ Value toValue(XmlRpcValue& v) { Value vbot; Bottle *bot = vbot.asList(); XmlRpcValue::ValueStruct& vals = v; + bot->addString("dict"); for (XmlRpcValue::ValueStruct::iterator it = vals.begin(); it!= vals.end(); it++) { @@ -46,7 +56,7 @@ Value toValue(XmlRpcValue& v) { Bottle& sub = bot->addList(); sub.addString(it->first.c_str()); if (v2.getType()!=XmlRpcValue::TypeInvalid) { - sub.add(toValue(v2)); + sub.add(toValue(v2,false)); } } return vbot; @@ -108,7 +118,7 @@ int XmlRpcStream::read(const Bytes& b) { prefix += " "; } //printf("xmlrpc block is %s\n", xresult.toXml().c_str()); - Value v = toValue(xresult); + Value v = toValue(xresult,true); if (!v.isNull()) { sis.reset((prefix + v.toString().c_str() + "\n").c_str()); } else { From b9961e4a6aeb909adaa4811fcde6090725c3305e Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 14 Jun 2010 13:56:55 +0000 Subject: [PATCH 004/187] more LGPL tagging svn path=/trunk/yarp2/; revision=8006 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 6 + src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 6 + src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 242 +++++++++--------- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 6 + 4 files changed, 143 insertions(+), 117 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index dd8413d..5a9f87b 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -1,5 +1,11 @@ // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- +/* + * Copyright (C) 2010 Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * + */ + #include "XmlRpcCarrier.h" #include #include diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 6d5d825..fdbd70e 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -1,5 +1,11 @@ // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- +/* + * Copyright (C) 2010 Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * + */ + #ifndef XMLRPCCARRIER_INC #define XMLRPCCARRIER_INC diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 14877f0..5b7e2e9 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -1,3 +1,11 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +/* + * Copyright (C) 2010 Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * + */ + #include "XmlRpcStream.h" #include "XmlRpcValue.h" @@ -10,131 +18,131 @@ using namespace std; Value toValue(XmlRpcValue& v, bool outer) { - int t = v.getType(); - switch (t) { - case XmlRpcValue::TypeInt: - return Value((int)v); - break; - case XmlRpcValue::TypeDouble: - return Value((double)v); - break; - case XmlRpcValue::TypeString: - return Value(((string)v).c_str()); - break; - case XmlRpcValue::TypeArray: - { - Value vbot; - Bottle *bot = vbot.asList(); - for (int i=0; iaddString("list"); - } - } - } - bot->add(v); - } - } - return vbot; - } - break; - case XmlRpcValue::TypeStruct: - { - Value vbot; - Bottle *bot = vbot.asList(); - XmlRpcValue::ValueStruct& vals = v; - bot->addString("dict"); - for (XmlRpcValue::ValueStruct::iterator it = vals.begin(); - it!= vals.end(); - it++) { - XmlRpcValue& v2 = it->second; - Bottle& sub = bot->addList(); - sub.addString(it->first.c_str()); - if (v2.getType()!=XmlRpcValue::TypeInvalid) { - sub.add(toValue(v2,false)); - } - } - return vbot; + int t = v.getType(); + switch (t) { + case XmlRpcValue::TypeInt: + return Value((int)v); + break; + case XmlRpcValue::TypeDouble: + return Value((double)v); + break; + case XmlRpcValue::TypeString: + return Value(((string)v).c_str()); + break; + case XmlRpcValue::TypeArray: + { + Value vbot; + Bottle *bot = vbot.asList(); + for (int i=0; iaddString("list"); + } + } + } + bot->add(v); + } + } + return vbot; + } + break; + case XmlRpcValue::TypeStruct: + { + Value vbot; + Bottle *bot = vbot.asList(); + XmlRpcValue::ValueStruct& vals = v; + bot->addString("dict"); + for (XmlRpcValue::ValueStruct::iterator it = vals.begin(); + it!= vals.end(); + it++) { + XmlRpcValue& v2 = it->second; + Bottle& sub = bot->addList(); + sub.addString(it->first.c_str()); + if (v2.getType()!=XmlRpcValue::TypeInvalid) { + sub.add(toValue(v2,false)); + } + } + return vbot; + } + break; + case XmlRpcValue::TypeInvalid: + return Value::getNullValue(); + break; } - break; - case XmlRpcValue::TypeInvalid: - return Value::getNullValue(); - break; - } - //printf("Skipping %d\n", t); - return Value("(type not supported yet out of laziness)"); + //printf("Skipping %d\n", t); + return Value("(type not supported yet out of laziness)"); } int XmlRpcStream::read(const Bytes& b) { - int result = sis.read(b); - if (result>0) { - //printf("RETURNING %d bytes\n", result); - return result; - } - if (result==0) { - //printf("Reading...\n"); - bool ok = false; - if (sender) { - client.reset(); - } else { - server.reset(); - } - if (firstRound) { - if (sender) { - client.read("POST /RP"); - } else { - server.read("POST /RP"); - } - firstRound = false; + int result = sis.read(b); + if (result>0) { + //printf("RETURNING %d bytes\n", result); + return result; } - char buf[1000]; - Bytes bytes(buf,sizeof(buf)); - while (!ok) { - int result2 = delegate->getInputStream().partialRead(bytes); - if (result2<=0) { - return result2; - } - string s(buf,result2); - //printf("Giving %s to parser\n", s.c_str()); - if (sender) { - ok = client.read(s); - } else { - ok = server.read(s); - } - if (ok) { - //printf("got a block!\n"); - XmlRpcValue xresult; - std::string prefix = ""; - if (sender) { - client.parseResponse(xresult); - } else { - prefix = "d\n"; - prefix += server.parseRequest(xresult); - prefix += " "; - } - //printf("xmlrpc block is %s\n", xresult.toXml().c_str()); - Value v = toValue(xresult,true); - if (!v.isNull()) { - sis.reset((prefix + v.toString().c_str() + "\n").c_str()); - } else { - sis.reset((prefix + "\n").c_str()); - } - //printf("String version is %s\n", sis.toString().c_str()); - result = sis.read(b); - break; - } + if (result==0) { + //printf("Reading...\n"); + bool ok = false; + if (sender) { + client.reset(); + } else { + server.reset(); + } + if (firstRound) { + if (sender) { + client.read("POST /RP"); + } else { + server.read("POST /RP"); + } + firstRound = false; + } + char buf[1000]; + Bytes bytes(buf,sizeof(buf)); + while (!ok) { + int result2 = delegate->getInputStream().partialRead(bytes); + if (result2<=0) { + return result2; + } + string s(buf,result2); + //printf("Giving %s to parser\n", s.c_str()); + if (sender) { + ok = client.read(s); + } else { + ok = server.read(s); + } + if (ok) { + //printf("got a block!\n"); + XmlRpcValue xresult; + std::string prefix = ""; + if (sender) { + client.parseResponse(xresult); + } else { + prefix = "d\n"; + prefix += server.parseRequest(xresult); + prefix += " "; + } + //printf("xmlrpc block is %s\n", xresult.toXml().c_str()); + Value v = toValue(xresult,true); + if (!v.isNull()) { + sis.reset((prefix + v.toString().c_str() + "\n").c_str()); + } else { + sis.reset((prefix + "\n").c_str()); + } + //printf("String version is %s\n", sis.toString().c_str()); + result = sis.read(b); + break; + } + } } - } - //printf("RETURNING %d bytes\n", result); - return (result>0)?result:-1; + //printf("RETURNING %d bytes\n", result); + return (result>0)?result:-1; } void XmlRpcStream::write(const Bytes& b) { - delegate->getOutputStream().write(b); + delegate->getOutputStream().write(b); } diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 81d4f59..689ded3 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -1,5 +1,11 @@ // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- +/* + * Copyright (C) 2010 Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * + */ + #ifndef XMLRPCSTREAM_INC #define XMLRPCSTREAM_INC From e4dccfa0d5ed440407b327348614867261c3d224 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 14 Jun 2010 14:31:38 +0000 Subject: [PATCH 005/187] more LGPL tagging svn path=/trunk/yarp2/; revision=8007 --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 4 + .../xmlrpc_carrier/xmlrpc/XmlRpcClient.h | 2 + .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp | 4 + .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcException.h | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcServer.h | 3 + .../xmlrpc/XmlRpcServerConnection.cpp | 3 + .../xmlrpc/XmlRpcServerConnection.h | 3 + .../xmlrpc/XmlRpcServerMethod.cpp | 3 + .../xmlrpc/XmlRpcServerMethod.h | 4 + .../xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcSocket.h | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcSource.h | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcUtil.h | 3 + .../xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp | 23 +- .../xmlrpc_carrier/xmlrpc/XmlRpcValue.h | 3 + src/carriers/xmlrpc_carrier/xmlrpc/base64.h | 379 ------------------ 21 files changed, 81 insertions(+), 380 deletions(-) delete mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/base64.h diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h index 9611af7..a2e062d 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h @@ -17,6 +17,9 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 // +// Summary for YARP: +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp index f37f417..e968e7e 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp @@ -1,4 +1,8 @@ +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #include "XmlRpcClient.h" #include "XmlRpcSocket.h" diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h index bcdcc32..949c739 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h @@ -4,6 +4,8 @@ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // +// Summary for YARP: +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp index 3bbca40..9fc41cb 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp @@ -1,4 +1,8 @@ +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #include "XmlRpcDispatch.h" #include "XmlRpcSource.h" #include "XmlRpcUtil.h" diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h index b3c4ec0..0f6448a 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h @@ -4,6 +4,9 @@ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h index 6090450..31b6409 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h @@ -3,6 +3,9 @@ #define _XMLRPCEXCEPTION_H_ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT // #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp index f6b4aa5..b3351e5 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp @@ -1,3 +1,6 @@ +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #include "XmlRpcServer.h" #include "XmlRpcServerConnection.h" diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h index 8172733..566bf75 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h @@ -4,6 +4,9 @@ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp index 82d3bfd..7377fab 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp @@ -1,3 +1,6 @@ +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #include "XmlRpcServerConnection.h" diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h index 23d8f43..b388aa2 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h @@ -3,6 +3,9 @@ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp index 1616ff4..1dbed4d 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp @@ -1,3 +1,6 @@ +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #include "XmlRpcServerMethod.h" #include "XmlRpcServer.h" diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h index 738a9c8..9332ebd 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h @@ -4,6 +4,10 @@ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp index 2aa21d4..5a174a4 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp @@ -1,3 +1,6 @@ +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #include "XmlRpcSocket.h" #include "XmlRpcUtil.h" diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h index fa7f950..b549f3b 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h @@ -3,6 +3,9 @@ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp index 99203b0..67b69ba 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp @@ -1,3 +1,6 @@ +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #include "XmlRpcSource.h" #include "XmlRpcSocket.h" diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h index 135dce4..5ad5cbb 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h @@ -4,6 +4,9 @@ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp index 1bd583a..8a60e2c 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp @@ -1,3 +1,6 @@ +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #include "XmlRpcUtil.h" diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h index 8128f72..c44f553 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h @@ -3,6 +3,9 @@ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp index 607b7a1..9929e6d 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp @@ -1,8 +1,15 @@ +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #include "XmlRpcValue.h" #include "XmlRpcException.h" #include "XmlRpcUtil.h" -#include "base64.h" + +// base64.h removed - not clear that it is "really" under LGPL license. +// origin seems to be this: +// http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4095/ +//#include "base64.h" #ifndef MAKEDEPEND # include @@ -416,6 +423,10 @@ namespace XmlRpc { // Base64 bool XmlRpcValue::binaryFromXml(std::string const& valueXml, int* offset) { + printf("binaryFromXml disabled until license of base64.h determined\n"); + exit(1); + return false; + /* size_t valueEnd = valueXml.find('<', *offset); if (valueEnd == std::string::npos) return false; // No end tag; @@ -433,11 +444,16 @@ namespace XmlRpc { *offset += int(asString.length()); return true; + */ } std::string XmlRpcValue::binaryToXml() const { + printf("binaryToXml disabled until license of base64.h determined\n"); + exit(1); + return false; + /* // convert to base64 std::vector base64data; int iostatus = 0; @@ -452,6 +468,7 @@ namespace XmlRpc { xml += BASE64_ETAG; xml += VALUE_ETAG; return xml; + */ } @@ -562,8 +579,12 @@ namespace XmlRpc { { int iostatus = 0; std::ostreambuf_iterator out(os); + /* base64 encoder; encoder.put(_value.asBinary->begin(), _value.asBinary->end(), out, iostatus, base64<>::crlf()); + */ + printf("base64 disabled until license of base64.h determined\n"); + exit(1); break; } case TypeArray: diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h index 4726aa7..b68fbdb 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h @@ -4,6 +4,9 @@ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // +// Summary for YARP: +// Copyright: 2002, 2003 Chris Morley +// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/base64.h b/src/carriers/xmlrpc_carrier/xmlrpc/base64.h deleted file mode 100644 index 519ee0f..0000000 --- a/src/carriers/xmlrpc_carrier/xmlrpc/base64.h +++ /dev/null @@ -1,379 +0,0 @@ - - -// base64.hpp -// Autor Konstantin Pilipchuk -// mailto:lostd@ukr.net -// -// - -#if !defined(__BASE64_H_INCLUDED__) -#define __BASE64_H_INCLUDED__ 1 - -#ifndef MAKEDEPEND -# include -#endif - -static -int _base64Chars[]= {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', - 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', - '0','1','2','3','4','5','6','7','8','9', - '+','/' }; - - -#define _0000_0011 0x03 -#define _1111_1100 0xFC -#define _1111_0000 0xF0 -#define _0011_0000 0x30 -#define _0011_1100 0x3C -#define _0000_1111 0x0F -#define _1100_0000 0xC0 -#define _0011_1111 0x3F - -#define _EQUAL_CHAR (-1) -#define _UNKNOWN_CHAR (-2) - -#define _IOS_FAILBIT std::ios_base::failbit -#define _IOS_EOFBIT std::ios_base::eofbit -#define _IOS_BADBIT std::ios_base::badbit -#define _IOS_GOODBIT std::ios_base::goodbit - -// TEMPLATE CLASS base64_put -template > -class base64 -{ -public: - - typedef unsigned char byte_t; - typedef _E char_type; - typedef _Tr traits_type; - - // base64 requires max line length <= 72 characters - // you can fill end of line - // it may be crlf, crlfsp, noline or other class like it - - - struct crlf - { - template - _OI operator()(_OI _To) const{ - *_To = _Tr::to_char_type('\r'); ++_To; - *_To = _Tr::to_char_type('\n'); ++_To; - - return (_To); - } - }; - - - struct crlfsp - { - template - _OI operator()(_OI _To) const{ - *_To = _Tr::to_char_type('\r'); ++_To; - *_To = _Tr::to_char_type('\n'); ++_To; - *_To = _Tr::to_char_type(' '); ++_To; - - return (_To); - } - }; - - struct noline - { - template - _OI operator()(_OI _To) const{ - return (_To); - } - }; - - struct three2four - { - void zero() - { - _data[0] = 0; - _data[1] = 0; - _data[2] = 0; - } - - byte_t get_0() const - { - return _data[0]; - } - byte_t get_1() const - { - return _data[1]; - } - byte_t get_2() const - { - return _data[2]; - } - - void set_0(byte_t _ch) - { - _data[0] = _ch; - } - - void set_1(byte_t _ch) - { - _data[1] = _ch; - } - - void set_2(byte_t _ch) - { - _data[2] = _ch; - } - - // 0000 0000 1111 1111 2222 2222 - // xxxx xxxx xxxx xxxx xxxx xxxx - // 0000 0011 1111 2222 2233 3333 - - int b64_0() const {return (_data[0] & _1111_1100) >> 2;} - int b64_1() const {return ((_data[0] & _0000_0011) << 4) + ((_data[1] & _1111_0000)>>4);} - int b64_2() const {return ((_data[1] & _0000_1111) << 2) + ((_data[2] & _1100_0000)>>6);} - int b64_3() const {return (_data[2] & _0011_1111);} - - void b64_0(int _ch) {_data[0] = ((_ch & _0011_1111) << 2) | (_0000_0011 & _data[0]);} - - void b64_1(int _ch) { - _data[0] = ((_ch & _0011_0000) >> 4) | (_1111_1100 & _data[0]); - _data[1] = ((_ch & _0000_1111) << 4) | (_0000_1111 & _data[1]); } - - void b64_2(int _ch) { - _data[1] = ((_ch & _0011_1100) >> 2) | (_1111_0000 & _data[1]); - _data[2] = ((_ch & _0000_0011) << 6) | (_0011_1111 & _data[2]); } - - void b64_3(int _ch){ - _data[2] = (_ch & _0011_1111) | (_1100_0000 & _data[2]);} - - private: - byte_t _data[3]; - - }; - - - - - template - _II put(_II _First, _II _Last, _OI _To, _State& _St, _Endline _Endl) const - { - three2four _3to4; - int line_octets = 0; - - while(_First != _Last) - { - _3to4.zero(); - - // áåð¸ì ïî 3 ñèìâîëà - _3to4.set_0(*_First); - _First++; - - if(_First == _Last) - { - *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To; - *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To; - *_To = _Tr::to_char_type('='); ++_To; - *_To = _Tr::to_char_type('='); ++_To; - goto __end; - } - - _3to4.set_1(*_First); - _First++; - - if(_First == _Last) - { - *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To; - *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To; - *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_2()]); ++_To; - *_To = _Tr::to_char_type('='); ++_To; - goto __end; - } - - _3to4.set_2(*_First); - _First++; - - *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To; - *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To; - *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_2()]); ++_To; - *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_3()]); ++_To; - - if(line_octets == 17) // base64 ïîçâîëÿåò äëèíó ñòðîêè íå áîëåå 72 ñèìâîëîâ - { - //_To = _Endl(_To); - *_To = '\n'; ++_To; - line_octets = 0; - } - else - ++line_octets; - } - - __end: ; - - return (_First); - - } - - - template - _II get(_II _First, _II _Last, _OI _To, _State& _St) const - { - three2four _3to4; - int _Char; - - while(_First != _Last) - { - - // Take octet - _3to4.zero(); - - // -- 0 -- - // Search next valid char... - while((_Char = _getCharType(*_First)) < 0 && _Char == _UNKNOWN_CHAR) - { - if(++_First == _Last) - { - _St |= _IOS_FAILBIT|_IOS_EOFBIT; return _First; // unexpected EOF - } - } - - if(_Char == _EQUAL_CHAR){ - // Error! First character in octet can't be '=' - _St |= _IOS_FAILBIT; - return _First; - } - else - _3to4.b64_0(_Char); - - - // -- 1 -- - // Search next valid char... - while(++_First != _Last) - if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR) - break; - - if(_First == _Last) { - _St |= _IOS_FAILBIT|_IOS_EOFBIT; // unexpected EOF - return _First; - } - - if(_Char == _EQUAL_CHAR){ - // Error! Second character in octet can't be '=' - _St |= _IOS_FAILBIT; - return _First; - } - else - _3to4.b64_1(_Char); - - - // -- 2 -- - // Search next valid char... - while(++_First != _Last) - if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR) - break; - - if(_First == _Last) { - // Error! Unexpected EOF. Must be '=' or base64 character - _St |= _IOS_FAILBIT|_IOS_EOFBIT; - return _First; - } - - if(_Char == _EQUAL_CHAR){ - // OK! - _3to4.b64_2(0); - _3to4.b64_3(0); - - // chek for EOF - if(++_First == _Last) - { - // Error! Unexpected EOF. Must be '='. Ignore it. - //_St |= _IOS_BADBIT|_IOS_EOFBIT; - _St |= _IOS_EOFBIT; - } - else - if(_getCharType(*_First) != _EQUAL_CHAR) - { - // Error! Must be '='. Ignore it. - //_St |= _IOS_BADBIT; - } - else - ++_First; // Skip '=' - - // write 1 byte to output - *_To = (byte_t) _3to4.get_0(); - return _First; - } - else - _3to4.b64_2(_Char); - - - // -- 3 -- - // Search next valid char... - while(++_First != _Last) - if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR) - break; - - if(_First == _Last) { - // Unexpected EOF. It's error. But ignore it. - //_St |= _IOS_FAILBIT|_IOS_EOFBIT; - _St |= _IOS_EOFBIT; - - return _First; - } - - if(_Char == _EQUAL_CHAR) - { - // OK! - _3to4.b64_3(0); - - // write to output 2 bytes - *_To = (byte_t) _3to4.get_0(); - *_To = (byte_t) _3to4.get_1(); - - ++_First; // set position to next character - - return _First; - } - else - _3to4.b64_3(_Char); - - - // write to output 3 bytes - *_To = (byte_t) _3to4.get_0(); - *_To = (byte_t) _3to4.get_1(); - *_To = (byte_t) _3to4.get_2(); - - ++_First; - - - } // while(_First != _Last) - - return (_First); - } - -protected: - - int _getCharType(int _Ch) const - { - if(_base64Chars[62] == _Ch) - return 62; - - if(_base64Chars[63] == _Ch) - return 63; - - if((_base64Chars[0] <= _Ch) && (_base64Chars[25] >= _Ch)) - return _Ch - _base64Chars[0]; - - if((_base64Chars[26] <= _Ch) && (_base64Chars[51] >= _Ch)) - return _Ch - _base64Chars[26] + 26; - - if((_base64Chars[52] <= _Ch) && (_base64Chars[61] >= _Ch)) - return _Ch - _base64Chars[52] + 52; - - if(_Ch == _Tr::to_int_type('=')) - return _EQUAL_CHAR; - - return _UNKNOWN_CHAR; - } - - -}; - - -#endif From 102088d613bd7f8ab9be5ae52b89947a0671c6a5 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 6 Jul 2010 21:59:44 +0000 Subject: [PATCH 006/187] better url in xmlrpc client via path modifier svn path=/trunk/yarp2/; revision=8076 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 40 ++++++++++++++----- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 14 +++---- 2 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 5a9f87b..8beaab2 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -8,6 +8,8 @@ #include "XmlRpcCarrier.h" #include +#include +#include #include #include "XmlRpc.h" @@ -106,8 +108,8 @@ bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { //printf("xmlrpc block to write is %s\n", args.toXml().c_str()); std::string req; if (sender) { - const Address& addr = proto.getStreams().getRemoteAddress(); - XmlRpcClient c(addr.getName().c_str(),addr.getPort()); + const Address& addr = host.isValid()?host:proto.getStreams().getRemoteAddress(); + XmlRpcClient c(addr.getName().c_str(),(addr.getPort()>0)?addr.getPort():80); c.generateRequest(methodName.c_str(),args); req = c.getRequest(); } else { @@ -123,18 +125,18 @@ bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { return false; } if (firstRound) { - const char *target = "POST /RP"; - for (int i=0; i<8; i++) { - if (req[i] != target[i]) { - fprintf(stderr, "XmlRpcCarrier fail, %s:%d\n", __FILE__, __LINE__); - return false; + for (int i=0; i<(int)req.length(); i++) { + if (req[i] == '\n') { + start++; + break; } + start++; } - start = 8; firstRound = false; } } - Bytes b((char*)req.c_str()+start,req.length()); + Bytes b((char*)req.c_str()+start,req.length()-start); + printf("WRITING [%s]\n", req.c_str()+start); proto.os().write(b); return proto.os().isOk(); @@ -142,7 +144,27 @@ bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { bool XmlRpcCarrier::reply(Protocol& proto, SizedWriter& writer) { + printf("Preparing for write\n"); return write(proto,writer); } +bool XmlRpcCarrier::sendHeader(Protocol& proto) { + Name n(proto.getRoute().getCarrierName() + "://test"); + printf("ROUTE is %s\n", proto.getRoute().toString().c_str()); + String pathValue = n.getCarrierModifier("path"); + String target = "POST /RPC"; + if (pathValue!="") { + printf("FOUND PATH %s\n", pathValue.c_str()); + target = "POST /"; + target += pathValue; + // on the wider web, we should provide real host names + NameClient& nc = NameClient::getNameClient(); + host = nc.queryName(proto.getRoute().getToName()); + } + target += " HTTP/1.1\n"; + Bytes b((char*)target.c_str(),target.length()); + printf("SENDING HEADER [%s]\n", target.c_str()); + proto.os().write(b); + return true; +} diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index fdbd70e..82ccc96 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -11,6 +11,7 @@ #include #include +#include #include "XmlRpcStream.h" namespace yarp { @@ -25,6 +26,7 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { private: bool firstRound; bool sender; + Address host; public: XmlRpcCarrier() { firstRound = true; @@ -76,14 +78,13 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { } virtual void getHeader(const Bytes& header) { - const char *target = "POST /RC"; - for (int i=0; i<6 && i Date: Tue, 6 Jul 2010 22:29:53 +0000 Subject: [PATCH 007/187] clean up xml/rpc carrier svn path=/trunk/yarp2/; revision=8078 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 28 +++++++++++-------- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 23 +++++++++++++++ 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 8beaab2..76dd2d6 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -90,6 +90,7 @@ bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { if (header[0]=='q') { body = "yarp.quit"; // XMLRPC does not need a quit message, this should get stripped + return false; } Bottle *bot = v.asList(); //Bottle aux; @@ -124,19 +125,21 @@ bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { fprintf(stderr, "XmlRpcCarrier fail, %s:%d\n", __FILE__, __LINE__); return false; } - if (firstRound) { - for (int i=0; i<(int)req.length(); i++) { - if (req[i] == '\n') { - start++; - break; - } + for (int i=0; i<(int)req.length(); i++) { + if (req[i] == '\n') { start++; + break; } - firstRound = false; + start++; + } + if (!firstRound) { + Bytes b((char*)http.c_str(),http.length()); + proto.os().write(b); } + firstRound = false; } Bytes b((char*)req.c_str()+start,req.length()-start); - printf("WRITING [%s]\n", req.c_str()+start); + //printf("WRITING [%s]\n", req.c_str()+start); proto.os().write(b); return proto.os().isOk(); @@ -144,18 +147,18 @@ bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { bool XmlRpcCarrier::reply(Protocol& proto, SizedWriter& writer) { - printf("Preparing for write\n"); + //printf("Preparing for write\n"); return write(proto,writer); } bool XmlRpcCarrier::sendHeader(Protocol& proto) { Name n(proto.getRoute().getCarrierName() + "://test"); - printf("ROUTE is %s\n", proto.getRoute().toString().c_str()); + //printf("ROUTE is %s\n", proto.getRoute().toString().c_str()); String pathValue = n.getCarrierModifier("path"); String target = "POST /RPC"; if (pathValue!="") { - printf("FOUND PATH %s\n", pathValue.c_str()); + //printf("FOUND PATH %s\n", pathValue.c_str()); target = "POST /"; target += pathValue; // on the wider web, we should provide real host names @@ -163,8 +166,9 @@ bool XmlRpcCarrier::sendHeader(Protocol& proto) { host = nc.queryName(proto.getRoute().getToName()); } target += " HTTP/1.1\n"; + http = target; Bytes b((char*)target.c_str(),target.length()); - printf("SENDING HEADER [%s]\n", target.c_str()); + //printf("SENDING HEADER [%s]\n", target.c_str()); proto.os().write(b); return true; } diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 82ccc96..0c9908d 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -12,6 +12,7 @@ #include #include #include +#include #include "XmlRpcStream.h" namespace yarp { @@ -22,11 +23,33 @@ namespace yarp { } } +/** + * + * This carrier enables XML/RPC message transmission. + * + * Example: at the time of writing, there is a public XML/RPC server at + * http://phpxmlrpc.sourceforge.net/server.php + * which has several methods. One is called "examples.addtwo" and expects + * two integers and returns an integer. So we can do: + * + * yarp name register /webserve xmlrpc+path.server.php phpxmlrpc.sourceforge.net 80 + * + * The "80" corresponds to the usual http port number. + * The "xmlrpc+path.server.php" means "use xmlrpc carrier, and use a request + * path of server.php". Often this path can be omitted, but is important + * for this particular server. + * + * Then: + * echo "examples.addtwo 10 20" | yarp rpc /webserve + * will produce the output "30" if the server still exists. + * + */ class yarp::os::impl::XmlRpcCarrier : public Carrier { private: bool firstRound; bool sender; Address host; + String http; public: XmlRpcCarrier() { firstRound = true; From a067789e6d082b2d1b7760a182af767f20697909 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 7 Jul 2010 18:51:57 +0000 Subject: [PATCH 008/187] fix default page name to be ros-compatible svn path=/trunk/yarp2/; revision=8081 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 76dd2d6..2986a7f 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -156,7 +156,7 @@ bool XmlRpcCarrier::sendHeader(Protocol& proto) { Name n(proto.getRoute().getCarrierName() + "://test"); //printf("ROUTE is %s\n", proto.getRoute().toString().c_str()); String pathValue = n.getCarrierModifier("path"); - String target = "POST /RPC"; + String target = "POST /RPC2"; if (pathValue!="") { //printf("FOUND PATH %s\n", pathValue.c_str()); target = "POST /"; From 0b666cc021c3ccaf818136415500fc4b446b237b Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 7 Jul 2010 21:21:23 +0000 Subject: [PATCH 009/187] xmlrpc servers are not competent for bootstrapping svn path=/trunk/yarp2/; revision=8085 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 0c9908d..48657fb 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -184,6 +184,7 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { return true; } + virtual String getBootstrapCarrierName() { return ""; } }; #endif From fc8f142e3f99a1a3eabd11c8479a92a8f64a9d54 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 7 Jul 2010 21:55:23 +0000 Subject: [PATCH 010/187] first basic example svn path=/trunk/yarp2/; revision=8086 --- example/yarpros_examples/CMakeLists.txt | 30 +++++++++++ example/yarpros_examples/Makefile | 1 + example/yarpros_examples/README.TXT | 3 ++ example/yarpros_examples/mainpage.dox | 41 +++++++++++++++ example/yarpros_examples/manifest.xml | 16 ++++++ example/yarpros_examples/msg/VVLCommand.msg | 14 +++++ example/yarpros_examples/src/waggler.cpp | 58 +++++++++++++++++++++ 7 files changed, 163 insertions(+) create mode 100644 example/yarpros_examples/CMakeLists.txt create mode 100644 example/yarpros_examples/Makefile create mode 100644 example/yarpros_examples/README.TXT create mode 100644 example/yarpros_examples/mainpage.dox create mode 100644 example/yarpros_examples/manifest.xml create mode 100644 example/yarpros_examples/msg/VVLCommand.msg create mode 100644 example/yarpros_examples/src/waggler.cpp diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt new file mode 100644 index 0000000..eec7371 --- /dev/null +++ b/example/yarpros_examples/CMakeLists.txt @@ -0,0 +1,30 @@ +cmake_minimum_required(VERSION 2.4.6) +include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) + +# Set the build type. Options are: +# Coverage : w/ debug symbols, w/o optimization, w/ code-coverage +# Debug : w/ debug symbols, w/o optimization +# Release : w/o debug symbols, w/ optimization +# RelWithDebInfo : w/ debug symbols, w/ optimization +# MinSizeRel : w/o debug symbols, w/ optimization, stripped binaries +#set(ROS_BUILD_TYPE RelWithDebInfo) + +rosbuild_init() + +#set the default path for built executables to the "bin" directory +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) +#set the default path for built libraries to the "lib" directory +set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) + +#uncomment if you have defined messages +rosbuild_genmsg() +#uncomment if you have defined services +#rosbuild_gensrv() + +#common commands for building c++ executables and libraries +#rosbuild_add_library(${PROJECT_NAME} src/example.cpp) +#target_link_libraries(${PROJECT_NAME} another_library) +#rosbuild_add_boost_directories() +#rosbuild_link_boost(${PROJECT_NAME} thread) +rosbuild_add_executable(waggler src/waggler.cpp) +#target_link_libraries(example ${PROJECT_NAME}) diff --git a/example/yarpros_examples/Makefile b/example/yarpros_examples/Makefile new file mode 100644 index 0000000..b75b928 --- /dev/null +++ b/example/yarpros_examples/Makefile @@ -0,0 +1 @@ +include $(shell rospack find mk)/cmake.mk \ No newline at end of file diff --git a/example/yarpros_examples/README.TXT b/example/yarpros_examples/README.TXT new file mode 100644 index 0000000..9897822 --- /dev/null +++ b/example/yarpros_examples/README.TXT @@ -0,0 +1,3 @@ +Make sure the directory above this one is in your ROS_PACKAGE_PATH. + +Read the .dox file. diff --git a/example/yarpros_examples/mainpage.dox b/example/yarpros_examples/mainpage.dox new file mode 100644 index 0000000..cbdff27 --- /dev/null +++ b/example/yarpros_examples/mainpage.dox @@ -0,0 +1,41 @@ +/** +\mainpage +\htmlinclude manifest.html + +\b waggler is a test program for YARP/ROS interoperability. + +waggler is written in unmodified ROS, and does not use YARP. It publishes +a stream of position control commands that are suitable for hooking up +to YARP controlboard implementations (e.g. the iCub robot, or the +test_motor device). They can also be streamed to "yarp read". + +Make sure when compiling YARP you enable the TCPROS and XMLRPC carriers. +Then run waggler. Then do: +\verbatim + # tell yarp where roscore is + yarpros roscore localhost 11311 # replace localhost as appropriate + # register the topic pos_cmd on node waggler as a virtual port + # called /waggler + yarpros import /waggler /waggler /pos_cmd + # run this in a separate terminal if you don't have the simulator + yarp read /read + # now hook things up! + yarp connect /waggler /read +\endverbatim + + +\section codeapi Code API + + + + +*/ diff --git a/example/yarpros_examples/manifest.xml b/example/yarpros_examples/manifest.xml new file mode 100644 index 0000000..ff5b305 --- /dev/null +++ b/example/yarpros_examples/manifest.xml @@ -0,0 +1,16 @@ + + + + YARP/ROS interoperability + + + Paul Fitzpatrick + LGPLv2.1 + + + + + + + + diff --git a/example/yarpros_examples/msg/VVLCommand.msg b/example/yarpros_examples/msg/VVLCommand.msg new file mode 100644 index 0000000..0b4c933 --- /dev/null +++ b/example/yarpros_examples/msg/VVLCommand.msg @@ -0,0 +1,14 @@ +# The port we are communicating with can accept many kinds of commands. +# We set up a header here to make it clear we want to do the equivalent of: +# [set] [poss] (1.0 2.0 3.0 4.0) +# Read as "set-plural-positions to 1.0 2.0 3.0 4.0" + +int32 list_tag # set to 256 (BOTTLE_TAG_LIST) +int32 list_len # set to 3 (3 elements in list) +int32 vocab_set_tag # set to 9 (BOTTLE_TAG_VOCAB) +int32 vocab_set # set to (256^2)*'s' + 256*'e' + 't' +int32 vocab_poss_tag # set to 9 (BOTTLE_TAG_VOCAB) +int32 vocab_poss # set to (256^3)*'p' + (256^2)*'o' + 256*'s' + 's' +int32 setpoint_list_tag # set to 256+10 (BOTTLE_TAG_LIST+BOTTLE_TAG_DOUBLE) + +float64[] setpoint_list diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp new file mode 100644 index 0000000..128b7a7 --- /dev/null +++ b/example/yarpros_examples/src/waggler.cpp @@ -0,0 +1,58 @@ + +#include +#include +#include + +#include + +#define BOTTLE_TAG_INT 1 +#define BOTTLE_TAG_VOCAB (1+8) +#define BOTTLE_TAG_DOUBLE (2+8) +#define BOTTLE_TAG_STRING (4) +#define BOTTLE_TAG_BLOB (4+8) +#define BOTTLE_TAG_LIST 256 +#define VOCAB(a,b,c,d) ((((int)(d))<<24)+(((int)(c))<<16)+(((int)(b))<<8)+((int)(a))) + +int main(int argc, char** argv) { + printf("Will soon be modifying this to send arm commands to icub\n"); + int joint_count = 4; + if (argc>1) { + joint_count = atoi(argv[1]); + } + printf("Working with %d joints\n", joint_count); + + ros::init(argc, argv, "waggler"); + ros::NodeHandle n; + ros::Publisher chatter_pub = n.advertise("pos_cmd", 100); + ros::Rate loop_rate(1); + + int count = 0; + double *joints = new double[joint_count]; + if (joints==NULL) { printf("out of memory\n"); return 1; } + while (ros::ok()) { + for (int i=0; i Date: Wed, 7 Jul 2010 22:03:57 +0000 Subject: [PATCH 011/187] fix namespace svn path=/trunk/yarp2/; revision=8087 --- example/yarpros_examples/src/waggler.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp index 128b7a7..571eaac 100644 --- a/example/yarpros_examples/src/waggler.cpp +++ b/example/yarpros_examples/src/waggler.cpp @@ -1,8 +1,5 @@ - #include -#include -#include - +#include #include #define BOTTLE_TAG_INT 1 @@ -14,7 +11,6 @@ #define VOCAB(a,b,c,d) ((((int)(d))<<24)+(((int)(c))<<16)+(((int)(b))<<8)+((int)(a))) int main(int argc, char** argv) { - printf("Will soon be modifying this to send arm commands to icub\n"); int joint_count = 4; if (argc>1) { joint_count = atoi(argv[1]); @@ -23,7 +19,7 @@ int main(int argc, char** argv) { ros::init(argc, argv, "waggler"); ros::NodeHandle n; - ros::Publisher chatter_pub = n.advertise("pos_cmd", 100); + ros::Publisher waggler_pub = n.advertise("pos_cmd", 100); ros::Rate loop_rate(1); int count = 0; @@ -35,7 +31,7 @@ int main(int argc, char** argv) { } joints[0] = 5*(count%10); - waggler::VVLCommand msg; + yarpros_examples::VVLCommand msg; msg.list_tag = BOTTLE_TAG_LIST; msg.list_len = 3; msg.vocab_set_tag = BOTTLE_TAG_VOCAB; @@ -47,7 +43,7 @@ int main(int argc, char** argv) { for (int i=0; i Date: Wed, 7 Jul 2010 22:12:52 +0000 Subject: [PATCH 012/187] rename message type svn path=/trunk/yarp2/; revision=8088 --- .../{VVLCommand.msg => VocabVocabDoubles.msg} | 12 +++---- example/yarpros_examples/src/waggler.cpp | 35 ++++++++----------- 2 files changed, 21 insertions(+), 26 deletions(-) rename example/yarpros_examples/msg/{VVLCommand.msg => VocabVocabDoubles.msg} (53%) diff --git a/example/yarpros_examples/msg/VVLCommand.msg b/example/yarpros_examples/msg/VocabVocabDoubles.msg similarity index 53% rename from example/yarpros_examples/msg/VVLCommand.msg rename to example/yarpros_examples/msg/VocabVocabDoubles.msg index 0b4c933..71deae6 100644 --- a/example/yarpros_examples/msg/VVLCommand.msg +++ b/example/yarpros_examples/msg/VocabVocabDoubles.msg @@ -5,10 +5,10 @@ int32 list_tag # set to 256 (BOTTLE_TAG_LIST) int32 list_len # set to 3 (3 elements in list) -int32 vocab_set_tag # set to 9 (BOTTLE_TAG_VOCAB) -int32 vocab_set # set to (256^2)*'s' + 256*'e' + 't' -int32 vocab_poss_tag # set to 9 (BOTTLE_TAG_VOCAB) -int32 vocab_poss # set to (256^3)*'p' + (256^2)*'o' + 256*'s' + 's' -int32 setpoint_list_tag # set to 256+10 (BOTTLE_TAG_LIST+BOTTLE_TAG_DOUBLE) +int32 vocab1_tag # set to 9 (BOTTLE_TAG_VOCAB) +int32 vocab1_val # set to (256^2)*'s' + 256*'e' + 't' +int32 vocab2_tag # set to 9 (BOTTLE_TAG_VOCAB) +int32 vocab2_val # set to (256^3)*'p' + (256^2)*'o' + 256*'s' + 's' +int32 setpoints_tag # set to 256+10 (BOTTLE_TAG_LIST+BOTTLE_TAG_DOUBLE) -float64[] setpoint_list +float64[] setpoints diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp index 571eaac..28d73ff 100644 --- a/example/yarpros_examples/src/waggler.cpp +++ b/example/yarpros_examples/src/waggler.cpp @@ -1,17 +1,17 @@ #include -#include +#include #include +// A few YARP defines #define BOTTLE_TAG_INT 1 #define BOTTLE_TAG_VOCAB (1+8) #define BOTTLE_TAG_DOUBLE (2+8) -#define BOTTLE_TAG_STRING (4) -#define BOTTLE_TAG_BLOB (4+8) #define BOTTLE_TAG_LIST 256 #define VOCAB(a,b,c,d) ((((int)(d))<<24)+(((int)(c))<<16)+(((int)(b))<<8)+((int)(a))) +// YARP defines over int main(int argc, char** argv) { - int joint_count = 4; + int joint_count = 16; if (argc>1) { joint_count = atoi(argv[1]); } @@ -19,36 +19,31 @@ int main(int argc, char** argv) { ros::init(argc, argv, "waggler"); ros::NodeHandle n; - ros::Publisher waggler_pub = n.advertise("pos_cmd", 100); + ros::Publisher waggler_pub = n.advertise("pos_cmd", 100); ros::Rate loop_rate(1); int count = 0; - double *joints = new double[joint_count]; - if (joints==NULL) { printf("out of memory\n"); return 1; } while (ros::ok()) { - for (int i=0; i Date: Thu, 8 Jul 2010 20:49:31 +0000 Subject: [PATCH 013/187] small windows fixes svn path=/trunk/yarp2/; revision=8095 --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp index 5a174a4..c73de9e 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp @@ -63,8 +63,9 @@ static void initWinSock() static inline bool nonFatalError() { - int err = XmlRpcSocket::getError(); - return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR); + //int err = XmlRpcSocket::getError(); + //return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR); + return false; // do not need this for YARP, and causes problems on windows } From 6247ec834f1dd0e920a818f12efac07413ba0a85 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Sun, 11 Jul 2010 19:36:32 +0000 Subject: [PATCH 014/187] further ros interop cleanup - auto announce imported ports svn path=/trunk/yarp2/; revision=8110 --- example/yarpros_examples/src/waggler.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp index 28d73ff..dd315b7 100644 --- a/example/yarpros_examples/src/waggler.cpp +++ b/example/yarpros_examples/src/waggler.cpp @@ -19,8 +19,8 @@ int main(int argc, char** argv) { ros::init(argc, argv, "waggler"); ros::NodeHandle n; - ros::Publisher waggler_pub = n.advertise("pos_cmd", 100); - ros::Rate loop_rate(1); + ros::Publisher waggler_pub = n.advertise("pos", 100); + ros::Rate loop_rate(0.25); int count = 0; while (ros::ok()) { @@ -37,7 +37,9 @@ int main(int argc, char** argv) { for (int i=0; i Date: Tue, 13 Jul 2010 04:20:59 +0000 Subject: [PATCH 015/187] tweak example svn path=/trunk/yarp2/; revision=8119 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 48657fb..aae8148 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -40,7 +40,8 @@ namespace yarp { * for this particular server. * * Then: - * echo "examples.addtwo 10 20" | yarp rpc /webserve + * $ yarp rpc /webserve + * examples.addtwo 10 20 * will produce the output "30" if the server still exists. * */ From 4aca9d1866c2eb0d838a98ee8d1fb1ec50a54000 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 25 Aug 2010 01:32:51 +0000 Subject: [PATCH 016/187] another batch of copyright/license statements on examples svn path=/trunk/yarp2/; revision=8213 --- example/yarpros_examples/msg/VocabVocabDoubles.msg | 4 ++++ example/yarpros_examples/src/waggler.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/example/yarpros_examples/msg/VocabVocabDoubles.msg b/example/yarpros_examples/msg/VocabVocabDoubles.msg index 71deae6..ef64679 100644 --- a/example/yarpros_examples/msg/VocabVocabDoubles.msg +++ b/example/yarpros_examples/msg/VocabVocabDoubles.msg @@ -1,3 +1,7 @@ +# Copyright: (C) 2010 RobotCub Consortium +# Author: Paul Fitzpatrick +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + # The port we are communicating with can accept many kinds of commands. # We set up a header here to make it clear we want to do the equivalent of: # [set] [poss] (1.0 2.0 3.0 4.0) diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp index dd315b7..9e515a3 100644 --- a/example/yarpros_examples/src/waggler.cpp +++ b/example/yarpros_examples/src/waggler.cpp @@ -1,3 +1,9 @@ +/* + * Copyright: (C) 2010 RobotCub Consortium + * Author: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + #include #include #include From 45ae7f8e297557e650b28ebcb6990c1cf4e3107c Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 30 Aug 2010 14:30:11 +0000 Subject: [PATCH 017/187] fix a few trivial warnings svn path=/trunk/yarp2/; revision=8227 --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h index a2e062d..6810b0b 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h @@ -52,6 +52,8 @@ namespace XmlRpc { //! Report an error. Custom error handlers should define this method. virtual void error(const char* msg) = 0; + virtual ~XmlRpcErrorHandler() {} + protected: static XmlRpcErrorHandler* _errorHandler; }; @@ -78,6 +80,8 @@ namespace XmlRpc { //! Output a message. Custom error handlers should define this method. virtual void log(int level, const char* msg) = 0; + virtual ~XmlRpcLogHandler() {} + protected: static XmlRpcLogHandler* _logHandler; static int _verbosity; From db86c1034461a853e421d64a2efab068433b77e3 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 2 Sep 2010 15:47:18 +0000 Subject: [PATCH 018/187] another batch of copyright/license lines svn path=/trunk/yarp2/; revision=8260 --- example/yarpros_examples/CMakeLists.txt | 6 ++++++ example/yarpros_examples/Makefile | 7 ++++++- example/yarpros_examples/README.TXT | 4 ++++ example/yarpros_examples/mainpage.dox | 18 ++++++------------ example/yarpros_examples/manifest.xml | 5 ++++- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index eec7371..16ef3ff 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -1,3 +1,9 @@ + +# This is in large part a generated file. Modifications to it are: +# Copyright: (C) 2010 RobotCub Consortium +# Author: Paul Fitzpatrick +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + cmake_minimum_required(VERSION 2.4.6) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) diff --git a/example/yarpros_examples/Makefile b/example/yarpros_examples/Makefile index b75b928..e75a6b0 100644 --- a/example/yarpros_examples/Makefile +++ b/example/yarpros_examples/Makefile @@ -1 +1,6 @@ -include $(shell rospack find mk)/cmake.mk \ No newline at end of file +# This is a generated file. Any modifications to it are: +# Copyright: (C) 2010 RobotCub Consortium +# Author: Paul Fitzpatrick +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + +include $(shell rospack find mk)/cmake.mk diff --git a/example/yarpros_examples/README.TXT b/example/yarpros_examples/README.TXT index 9897822..78f25eb 100644 --- a/example/yarpros_examples/README.TXT +++ b/example/yarpros_examples/README.TXT @@ -1,3 +1,7 @@ +# Copyright: (C) 2010 RobotCub Consortium +# Authors: Paul Fitzpatrick +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + Make sure the directory above this one is in your ROS_PACKAGE_PATH. Read the .dox file. diff --git a/example/yarpros_examples/mainpage.dox b/example/yarpros_examples/mainpage.dox index cbdff27..65d4b79 100644 --- a/example/yarpros_examples/mainpage.dox +++ b/example/yarpros_examples/mainpage.dox @@ -4,6 +4,12 @@ \b waggler is a test program for YARP/ROS interoperability. +\verbatim + Copyright: (C) 2010 RobotCub Consortium + Author: Paul Fitzpatrick + CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +\endverbatim + waggler is written in unmodified ROS, and does not use YARP. It publishes a stream of position control commands that are suitable for hooking up to YARP controlboard implementations (e.g. the iCub robot, or the @@ -26,16 +32,4 @@ Then run waggler. Then do: \section codeapi Code API - - - */ diff --git a/example/yarpros_examples/manifest.xml b/example/yarpros_examples/manifest.xml index ff5b305..04f5cce 100644 --- a/example/yarpros_examples/manifest.xml +++ b/example/yarpros_examples/manifest.xml @@ -1,7 +1,10 @@ + + + - YARP/ROS interoperability + YARP/ROS interoperability examples Paul Fitzpatrick From 40c50244fff5933f0af8633d08f593e3780f70c9 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 13 Sep 2010 14:51:41 +0000 Subject: [PATCH 019/187] copyright/license refresh svn path=/trunk/yarp2/; revision=8282 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 3 +++ src/carriers/xmlrpc_carrier/README.TXT | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 0c8f676..435b4c7 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2010 Paul Fitzpatrick +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + if (COMPILE_PLUGIN_LIBRARY) prepare_carrier(xmlrpc_carrier TYPE XmlRpcCarrier INCLUDE XmlRpcCarrier.h) endif (COMPILE_PLUGIN_LIBRARY) diff --git a/src/carriers/xmlrpc_carrier/README.TXT b/src/carriers/xmlrpc_carrier/README.TXT index f8f53b8..8e434b7 100644 --- a/src/carriers/xmlrpc_carrier/README.TXT +++ b/src/carriers/xmlrpc_carrier/README.TXT @@ -1,3 +1,5 @@ +# Copyright (C) 2010 Paul Fitzpatrick +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT XMLRPC to Bottle translation: From bdd3b1ebcf3dda2de76a2e7d9096f0627ef5eeee Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 11 Apr 2011 19:46:11 +0000 Subject: [PATCH 020/187] prototype of bottle view of ros types svn path=/trunk/yarp2/; revision=8561 --- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 5b7e2e9..827e980 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -79,11 +79,13 @@ Value toValue(XmlRpcValue& v, bool outer) { } int XmlRpcStream::read(const Bytes& b) { + //printf("XMLRPC READ\n"); int result = sis.read(b); if (result>0) { //printf("RETURNING %d bytes\n", result); return result; } + //printf("No string\n"); if (result==0) { //printf("Reading...\n"); bool ok = false; From 97f5c5bd5312fbef212c527b4baf752964905c59 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 9 May 2011 21:21:38 +0000 Subject: [PATCH 021/187] support ROS's publisherUpdate callback svn path=/trunk/yarp2/; revision=8595 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 20 +++++++++++++++++++ src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 13 +++++------- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 12 +++++++++-- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 9 ++++++--- 4 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 2986a7f..cbae3fd 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -165,6 +165,10 @@ bool XmlRpcCarrier::sendHeader(Protocol& proto) { NameClient& nc = NameClient::getNameClient(); host = nc.queryName(proto.getRoute().getToName()); } + String rospass = n.getCarrierModifier("ros"); + if (rospass=="") { + interpretRos = true; + } target += " HTTP/1.1\n"; http = target; Bytes b((char*)target.c_str(),target.length()); @@ -172,3 +176,19 @@ bool XmlRpcCarrier::sendHeader(Protocol& proto) { proto.os().write(b); return true; } + + +bool XmlRpcCarrier::respondToHeader(Protocol& proto) { + Name n(proto.getRoute().getCarrierName() + "://test"); + String rospass = n.getCarrierModifier("ros"); + if (rospass=="") { + interpretRos = true; + } + sender = false; + XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(), + sender, + interpretRos); + if (stream==NULL) { return false; } + proto.takeStreams(stream); + return true; +} diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index aae8148..6e19b51 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -51,10 +51,12 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { bool sender; Address host; String http; + bool interpretRos; public: XmlRpcCarrier() { firstRound = true; sender = false; + interpretRos = false; } virtual Carrier *create() { @@ -142,17 +144,12 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { return true; } - bool respondToHeader(Protocol& proto) { - sender = false; - XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(),sender); - if (stream==NULL) { return false; } - proto.takeStreams(stream); - return true; - } + bool respondToHeader(Protocol& proto); virtual bool expectReplyToHeader(Protocol& proto) { sender = true; - XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(),sender); + XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(),sender, + interpretRos); if (stream==NULL) { return false; } proto.takeStreams(stream); return true; diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 827e980..ea7dc16 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -120,11 +120,19 @@ int XmlRpcStream::read(const Bytes& b) { //printf("got a block!\n"); XmlRpcValue xresult; std::string prefix = ""; + std::string cprefix = ""; if (sender) { client.parseResponse(xresult); } else { - prefix = "d\n"; - prefix += server.parseRequest(xresult); + cprefix = server.parseRequest(xresult); + bool isAdmin = false; + if (interpretRos) { + if (cprefix=="publisherUpdate") { + isAdmin = true; + } + } + prefix = isAdmin?"a\n":"d\n"; + prefix += cprefix; prefix += " "; } //printf("xmlrpc block is %s\n", xresult.toXml().c_str()); diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 689ded3..78bea7c 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -38,10 +38,13 @@ class yarp::os::impl::XmlRpcStream : public TwoWayStream, StringOutputStream sos; bool sender; bool firstRound; + bool interpretRos; public: - XmlRpcStream(TwoWayStream *delegate, bool sender) : client("notset",0), - server(0,0/*NULL*/), - sender(sender) { + XmlRpcStream(TwoWayStream *delegate, bool sender, bool interpretRos) : + client("notset",0), + server(0,0/*NULL*/), + sender(sender), + interpretRos(interpretRos) { this->delegate = delegate; client.reset(); server.reset(); From 3ea3ba85215ac8050075fd160c0bf84c59fc6b48 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 10 May 2011 19:45:59 +0000 Subject: [PATCH 022/187] move line from readme into dox svn path=/trunk/yarp2/; revision=8596 --- example/yarpros_examples/mainpage.dox | 2 ++ 1 file changed, 2 insertions(+) diff --git a/example/yarpros_examples/mainpage.dox b/example/yarpros_examples/mainpage.dox index 65d4b79..babe72d 100644 --- a/example/yarpros_examples/mainpage.dox +++ b/example/yarpros_examples/mainpage.dox @@ -15,6 +15,8 @@ a stream of position control commands that are suitable for hooking up to YARP controlboard implementations (e.g. the iCub robot, or the test_motor device). They can also be streamed to "yarp read". +Make sure the example directory is in your ROS_PACKAGE_PATH. + Make sure when compiling YARP you enable the TCPROS and XMLRPC carriers. Then run waggler. Then do: \verbatim From 15ceb9fbbb6b86850705b79fcde0d9ec93084cd7 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 11 Jul 2011 16:40:55 +0000 Subject: [PATCH 023/187] update ros example build files svn path=/trunk/yarp2/; revision=8681 --- example/yarpros_examples/CMakeLists.txt | 2 +- example/yarpros_examples/Makefile | 396 +++++++++++++++++++++++- example/yarpros_examples/manifest.xml | 2 + 3 files changed, 394 insertions(+), 6 deletions(-) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 16ef3ff..32926dc 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -33,4 +33,4 @@ rosbuild_genmsg() #rosbuild_add_boost_directories() #rosbuild_link_boost(${PROJECT_NAME} thread) rosbuild_add_executable(waggler src/waggler.cpp) -#target_link_libraries(example ${PROJECT_NAME}) +target_link_libraries(waggler rosconsole ros roslib XmlRpc) diff --git a/example/yarpros_examples/Makefile b/example/yarpros_examples/Makefile index e75a6b0..5e5ac54 100644 --- a/example/yarpros_examples/Makefile +++ b/example/yarpros_examples/Makefile @@ -1,6 +1,392 @@ -# This is a generated file. Any modifications to it are: -# Copyright: (C) 2010 RobotCub Consortium -# Author: Paul Fitzpatrick -# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canoncical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# The program to use to edit the cache. +CMAKE_EDIT_COMMAND = /usr/bin/ccmake + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /home/paulfitz/cvs/yarp2/example/yarpros_examples + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /home/paulfitz/cvs/yarp2/example/yarpros_examples + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /home/paulfitz/cvs/yarp2/example/yarpros_examples/CMakeFiles /home/paulfitz/cvs/yarp2/example/yarpros_examples/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /home/paulfitz/cvs/yarp2/example/yarpros_examples/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named ROSBUILD_genmsg_cpp + +# Build rule for target. +ROSBUILD_genmsg_cpp: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_genmsg_cpp +.PHONY : ROSBUILD_genmsg_cpp + +# fast build rule for target. +ROSBUILD_genmsg_cpp/fast: + $(MAKE) -f CMakeFiles/ROSBUILD_genmsg_cpp.dir/build.make CMakeFiles/ROSBUILD_genmsg_cpp.dir/build +.PHONY : ROSBUILD_genmsg_cpp/fast + +#============================================================================= +# Target rules for targets named ROSBUILD_genmsg_lisp + +# Build rule for target. +ROSBUILD_genmsg_lisp: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_genmsg_lisp +.PHONY : ROSBUILD_genmsg_lisp + +# fast build rule for target. +ROSBUILD_genmsg_lisp/fast: + $(MAKE) -f CMakeFiles/ROSBUILD_genmsg_lisp.dir/build.make CMakeFiles/ROSBUILD_genmsg_lisp.dir/build +.PHONY : ROSBUILD_genmsg_lisp/fast + +#============================================================================= +# Target rules for targets named ROSBUILD_genmsg_py + +# Build rule for target. +ROSBUILD_genmsg_py: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_genmsg_py +.PHONY : ROSBUILD_genmsg_py + +# fast build rule for target. +ROSBUILD_genmsg_py/fast: + $(MAKE) -f CMakeFiles/ROSBUILD_genmsg_py.dir/build.make CMakeFiles/ROSBUILD_genmsg_py.dir/build +.PHONY : ROSBUILD_genmsg_py/fast + +#============================================================================= +# Target rules for targets named ROSBUILD_gensrv_cpp + +# Build rule for target. +ROSBUILD_gensrv_cpp: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_gensrv_cpp +.PHONY : ROSBUILD_gensrv_cpp + +# fast build rule for target. +ROSBUILD_gensrv_cpp/fast: + $(MAKE) -f CMakeFiles/ROSBUILD_gensrv_cpp.dir/build.make CMakeFiles/ROSBUILD_gensrv_cpp.dir/build +.PHONY : ROSBUILD_gensrv_cpp/fast + +#============================================================================= +# Target rules for targets named ROSBUILD_gensrv_lisp + +# Build rule for target. +ROSBUILD_gensrv_lisp: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_gensrv_lisp +.PHONY : ROSBUILD_gensrv_lisp + +# fast build rule for target. +ROSBUILD_gensrv_lisp/fast: + $(MAKE) -f CMakeFiles/ROSBUILD_gensrv_lisp.dir/build.make CMakeFiles/ROSBUILD_gensrv_lisp.dir/build +.PHONY : ROSBUILD_gensrv_lisp/fast + +#============================================================================= +# Target rules for targets named clean-test-results + +# Build rule for target. +clean-test-results: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 clean-test-results +.PHONY : clean-test-results + +# fast build rule for target. +clean-test-results/fast: + $(MAKE) -f CMakeFiles/clean-test-results.dir/build.make CMakeFiles/clean-test-results.dir/build +.PHONY : clean-test-results/fast + +#============================================================================= +# Target rules for targets named rosbuild_precompile + +# Build rule for target. +rosbuild_precompile: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 rosbuild_precompile +.PHONY : rosbuild_precompile + +# fast build rule for target. +rosbuild_precompile/fast: + $(MAKE) -f CMakeFiles/rosbuild_precompile.dir/build.make CMakeFiles/rosbuild_precompile.dir/build +.PHONY : rosbuild_precompile/fast + +#============================================================================= +# Target rules for targets named rosbuild_premsgsrvgen + +# Build rule for target. +rosbuild_premsgsrvgen: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 rosbuild_premsgsrvgen +.PHONY : rosbuild_premsgsrvgen + +# fast build rule for target. +rosbuild_premsgsrvgen/fast: + $(MAKE) -f CMakeFiles/rosbuild_premsgsrvgen.dir/build.make CMakeFiles/rosbuild_premsgsrvgen.dir/build +.PHONY : rosbuild_premsgsrvgen/fast + +#============================================================================= +# Target rules for targets named rospack_genmsg + +# Build rule for target. +rospack_genmsg: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 rospack_genmsg +.PHONY : rospack_genmsg + +# fast build rule for target. +rospack_genmsg/fast: + $(MAKE) -f CMakeFiles/rospack_genmsg.dir/build.make CMakeFiles/rospack_genmsg.dir/build +.PHONY : rospack_genmsg/fast + +#============================================================================= +# Target rules for targets named rospack_genmsg_all + +# Build rule for target. +rospack_genmsg_all: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 rospack_genmsg_all +.PHONY : rospack_genmsg_all + +# fast build rule for target. +rospack_genmsg_all/fast: + $(MAKE) -f CMakeFiles/rospack_genmsg_all.dir/build.make CMakeFiles/rospack_genmsg_all.dir/build +.PHONY : rospack_genmsg_all/fast + +#============================================================================= +# Target rules for targets named rospack_genmsg_libexe + +# Build rule for target. +rospack_genmsg_libexe: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 rospack_genmsg_libexe +.PHONY : rospack_genmsg_libexe + +# fast build rule for target. +rospack_genmsg_libexe/fast: + $(MAKE) -f CMakeFiles/rospack_genmsg_libexe.dir/build.make CMakeFiles/rospack_genmsg_libexe.dir/build +.PHONY : rospack_genmsg_libexe/fast + +#============================================================================= +# Target rules for targets named rospack_gensrv + +# Build rule for target. +rospack_gensrv: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 rospack_gensrv +.PHONY : rospack_gensrv + +# fast build rule for target. +rospack_gensrv/fast: + $(MAKE) -f CMakeFiles/rospack_gensrv.dir/build.make CMakeFiles/rospack_gensrv.dir/build +.PHONY : rospack_gensrv/fast + +#============================================================================= +# Target rules for targets named test + +# Build rule for target. +test: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 test +.PHONY : test + +# fast build rule for target. +test/fast: + $(MAKE) -f CMakeFiles/test.dir/build.make CMakeFiles/test.dir/build +.PHONY : test/fast + +#============================================================================= +# Target rules for targets named test-future + +# Build rule for target. +test-future: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 test-future +.PHONY : test-future + +# fast build rule for target. +test-future/fast: + $(MAKE) -f CMakeFiles/test-future.dir/build.make CMakeFiles/test-future.dir/build +.PHONY : test-future/fast + +#============================================================================= +# Target rules for targets named test-results + +# Build rule for target. +test-results: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 test-results +.PHONY : test-results + +# fast build rule for target. +test-results/fast: + $(MAKE) -f CMakeFiles/test-results.dir/build.make CMakeFiles/test-results.dir/build +.PHONY : test-results/fast + +#============================================================================= +# Target rules for targets named test-results-run + +# Build rule for target. +test-results-run: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 test-results-run +.PHONY : test-results-run + +# fast build rule for target. +test-results-run/fast: + $(MAKE) -f CMakeFiles/test-results-run.dir/build.make CMakeFiles/test-results-run.dir/build +.PHONY : test-results-run/fast + +#============================================================================= +# Target rules for targets named tests + +# Build rule for target. +tests: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 tests +.PHONY : tests + +# fast build rule for target. +tests/fast: + $(MAKE) -f CMakeFiles/tests.dir/build.make CMakeFiles/tests.dir/build +.PHONY : tests/fast + +#============================================================================= +# Target rules for targets named waggler + +# Build rule for target. +waggler: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 waggler +.PHONY : waggler + +# fast build rule for target. +waggler/fast: + $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/build +.PHONY : waggler/fast + +# target to build an object file +src/waggler.o: + $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/src/waggler.o +.PHONY : src/waggler.o + +# target to preprocess a source file +src/waggler.i: + $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/src/waggler.i +.PHONY : src/waggler.i + +# target to generate assembly for a file +src/waggler.s: + $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/src/waggler.s +.PHONY : src/waggler.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... ROSBUILD_genmsg_cpp" + @echo "... ROSBUILD_genmsg_lisp" + @echo "... ROSBUILD_genmsg_py" + @echo "... ROSBUILD_gensrv_cpp" + @echo "... ROSBUILD_gensrv_lisp" + @echo "... clean-test-results" + @echo "... edit_cache" + @echo "... rebuild_cache" + @echo "... rosbuild_precompile" + @echo "... rosbuild_premsgsrvgen" + @echo "... rospack_genmsg" + @echo "... rospack_genmsg_all" + @echo "... rospack_genmsg_libexe" + @echo "... rospack_gensrv" + @echo "... test" + @echo "... test-future" + @echo "... test-results" + @echo "... test-results-run" + @echo "... tests" + @echo "... waggler" + @echo "... src/waggler.o" + @echo "... src/waggler.i" + @echo "... src/waggler.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system -include $(shell rospack find mk)/cmake.mk diff --git a/example/yarpros_examples/manifest.xml b/example/yarpros_examples/manifest.xml index 04f5cce..a1fffee 100644 --- a/example/yarpros_examples/manifest.xml +++ b/example/yarpros_examples/manifest.xml @@ -13,6 +13,8 @@ + + From 715499a93a6cc25751a3504517ba61e147c32cd0 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 11 Jul 2011 16:51:09 +0000 Subject: [PATCH 024/187] merge improved tcpros + .msg support from yarpros branch on launchpad svn path=/trunk/yarp2/; revision=8682 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 5 ++--- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 3 +++ .../xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp | 2 +- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index cbae3fd..ac69d5f 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -9,7 +9,6 @@ #include "XmlRpcCarrier.h" #include #include -#include #include #include "XmlRpc.h" @@ -162,8 +161,8 @@ bool XmlRpcCarrier::sendHeader(Protocol& proto) { target = "POST /"; target += pathValue; // on the wider web, we should provide real host names - NameClient& nc = NameClient::getNameClient(); - host = nc.queryName(proto.getRoute().getToName()); + Contact contact = NetworkBase::queryName(proto.getRoute().getToName().c_str()); + host = Address::fromContact(contact); } String rospass = n.getCarrierModifier("ros"); if (rospass=="") { diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index ea7dc16..4cca18e 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -130,6 +130,9 @@ int XmlRpcStream::read(const Bytes& b) { if (cprefix=="publisherUpdate") { isAdmin = true; } + if (cprefix=="requestTopic") { + isAdmin = true; + } } prefix = isAdmin?"a\n":"d\n"; prefix += cprefix; diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp index 7377fab..13cad73 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp @@ -371,7 +371,7 @@ XmlRpcServerConnection::generateHeader(std::string const& body) "Content-length: "; char buffLen[40]; - sprintf(buffLen,"%d\r\n\r\n", body.size()); + sprintf(buffLen,"%d\r\n\r\n", (int)body.size()); return header + buffLen; } diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp index 9929e6d..cf56423 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp @@ -452,7 +452,7 @@ namespace XmlRpc { { printf("binaryToXml disabled until license of base64.h determined\n"); exit(1); - return false; + return ""; /* // convert to base64 std::vector base64data; @@ -577,7 +577,7 @@ namespace XmlRpc { } case TypeBase64: { - int iostatus = 0; + //int iostatus = 0; std::ostreambuf_iterator out(os); /* base64 encoder; From 1467177fbb848e4a0460fdd11d1c3374dfa7d127 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 13 Jul 2011 17:23:02 +0000 Subject: [PATCH 025/187] copyright assignment, paulfitz -> RobotCub Consortium or IIT svn path=/trunk/yarp2/; revision=8694 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 3 ++- src/carriers/xmlrpc_carrier/README.TXT | 3 ++- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 3 ++- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 3 ++- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 3 ++- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 435b4c7..4ec6b21 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -1,4 +1,5 @@ -# Copyright (C) 2010 Paul Fitzpatrick +# Copyright (C) 2010 RobotCub Consortium +# Authors: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT if (COMPILE_PLUGIN_LIBRARY) diff --git a/src/carriers/xmlrpc_carrier/README.TXT b/src/carriers/xmlrpc_carrier/README.TXT index 8e434b7..a1b4fcf 100644 --- a/src/carriers/xmlrpc_carrier/README.TXT +++ b/src/carriers/xmlrpc_carrier/README.TXT @@ -1,4 +1,5 @@ -# Copyright (C) 2010 Paul Fitzpatrick +# Copyright (C) 2010 RobotCub Consortium +# Authors: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index ac69d5f..15d22d5 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -1,7 +1,8 @@ // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- /* - * Copyright (C) 2010 Paul Fitzpatrick + * Copyright (C) 2010 RobotCub Consortium + * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT * */ diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 6e19b51..a6095b6 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -1,7 +1,8 @@ // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- /* - * Copyright (C) 2010 Paul Fitzpatrick + * Copyright (C) 2010 RobotCub Consortium + * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT * */ diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 4cca18e..ccf8c0b 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -1,7 +1,8 @@ // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- /* - * Copyright (C) 2010 Paul Fitzpatrick + * Copyright (C) 2010 RobotCub Consortium + * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT * */ diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 78bea7c..858fc6b 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -1,7 +1,8 @@ // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- /* - * Copyright (C) 2010 Paul Fitzpatrick + * Copyright (C) 2010 RobotCub Consortium + * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT * */ From 21c706fdd1fc342aec637167cffe8e7544262768 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 29 Aug 2011 22:19:07 +0000 Subject: [PATCH 026/187] tidy up windows build of tcpros carrier svn path=/trunk/yarp2/; revision=8803 --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp index c73de9e..078c32f 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp @@ -12,9 +12,15 @@ # include //# pragma lib(WS2_32.lib) -# define EINPROGRESS WSAEINPROGRESS -# define EWOULDBLOCK WSAEWOULDBLOCK -# define ETIMEDOUT WSAETIMEDOUT +# ifndef EINPROGRESS +# define EINPROGRESS WSAEINPROGRESS +# endif +# ifndef EWOULDBLOCK +# define EWOULDBLOCK WSAEWOULDBLOCK +# endif +# ifndef ETIMEDOUT +# define ETIMEDOUT WSAETIMEDOUT +# endif #else extern "C" { # include From c24b804a61299aafa5fc6c434233824af8b36a7a Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 19 Oct 2011 20:04:53 +0000 Subject: [PATCH 027/187] fix integer type svn path=/trunk/yarp2/; revision=8884 --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp index e968e7e..f5dc84c 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp @@ -254,7 +254,7 @@ XmlRpcClient::generateHeader(std::string const& body) header += buff; header += "Content-Type: text/xml\r\nContent-length: "; - sprintf(buff,"%d\r\n\r\n", body.size()); + sprintf(buff,"%d\r\n\r\n", (int)body.size()); return header + buff; } From cc85c3722f4ebfb000e42818d9fc3bed744286dd Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 15 Nov 2011 20:21:03 +0000 Subject: [PATCH 028/187] continuing size_t infiltration svn path=/trunk/yarp2/; revision=8918 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index a6095b6..9dfff9b 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -106,7 +106,7 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { virtual void getHeader(const Bytes& header) { const char *target = "POST /RP"; - for (int i=0; i<8 && i Date: Tue, 15 Nov 2011 21:09:36 +0000 Subject: [PATCH 029/187] bounce size_t changes off linux svn path=/trunk/yarp2/; revision=8920 --- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 4 ++-- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index ccf8c0b..442d247 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -79,9 +79,9 @@ Value toValue(XmlRpcValue& v, bool outer) { return Value("(type not supported yet out of laziness)"); } -int XmlRpcStream::read(const Bytes& b) { +ssize_t XmlRpcStream::read(const Bytes& b) { //printf("XMLRPC READ\n"); - int result = sis.read(b); + ssize_t result = sis.read(b); if (result>0) { //printf("RETURNING %d bytes\n", result); return result; diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 858fc6b..8c95d25 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -93,7 +93,7 @@ class yarp::os::impl::XmlRpcStream : public TwoWayStream, virtual void write(const Bytes& b); - virtual int read(const Bytes& b); + virtual ssize_t read(const Bytes& b); //{ // return delegate->getInputStream().read(b); //} From 2414d219dfd5b6d1da00f230b5ef5cd473cc1255 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 2 Feb 2012 22:41:11 +0000 Subject: [PATCH 030/187] minimal support for ros getPid,getBusInfo svn path=/trunk/yarp2/; revision=9039 --- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 442d247..90dd166 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -134,6 +134,12 @@ ssize_t XmlRpcStream::read(const Bytes& b) { if (cprefix=="requestTopic") { isAdmin = true; } + if (cprefix=="getPid") { + isAdmin = true; + } + if (cprefix=="getBusInfo") { + isAdmin = true; + } } prefix = isAdmin?"a\n":"d\n"; prefix += cprefix; From 02694e0ee91c2e222d20f96f70c7a69ad6f3d7df Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 2 Feb 2012 23:12:07 +0000 Subject: [PATCH 031/187] using yarpros sniff out svn path=/trunk/yarp2/; revision=9042 --- example/yarpros_examples/CMakeLists.txt | 6 ++ example/yarpros_examples/Makefile | 64 +++++++++++++++++++ example/yarpros_examples/mainpage.dox | 24 ++++--- example/yarpros_examples/msg/Encoders.msg | 6 ++ example/yarpros_examples/msg/YarpImageRgb.msg | 15 +++++ .../yarpros_examples/src/grab_encoders.cpp | 18 ++++++ example/yarpros_examples/src/grab_image.cpp | 18 ++++++ 7 files changed, 138 insertions(+), 13 deletions(-) create mode 100644 example/yarpros_examples/msg/Encoders.msg create mode 100644 example/yarpros_examples/msg/YarpImageRgb.msg create mode 100644 example/yarpros_examples/src/grab_encoders.cpp create mode 100644 example/yarpros_examples/src/grab_image.cpp diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 32926dc..4e78a0e 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -34,3 +34,9 @@ rosbuild_genmsg() #rosbuild_link_boost(${PROJECT_NAME} thread) rosbuild_add_executable(waggler src/waggler.cpp) target_link_libraries(waggler rosconsole ros roslib XmlRpc) + +rosbuild_add_executable(grab_image src/grab_image.cpp) +target_link_libraries(grab_image rosconsole ros roslib XmlRpc) + +rosbuild_add_executable(grab_enc src/grab_encoders.cpp) +target_link_libraries(grab_enc rosconsole ros roslib XmlRpc) diff --git a/example/yarpros_examples/Makefile b/example/yarpros_examples/Makefile index 5e5ac54..c47785e 100644 --- a/example/yarpros_examples/Makefile +++ b/example/yarpros_examples/Makefile @@ -176,6 +176,32 @@ clean-test-results/fast: $(MAKE) -f CMakeFiles/clean-test-results.dir/build.make CMakeFiles/clean-test-results.dir/build .PHONY : clean-test-results/fast +#============================================================================= +# Target rules for targets named grab_enc + +# Build rule for target. +grab_enc: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 grab_enc +.PHONY : grab_enc + +# fast build rule for target. +grab_enc/fast: + $(MAKE) -f CMakeFiles/grab_enc.dir/build.make CMakeFiles/grab_enc.dir/build +.PHONY : grab_enc/fast + +#============================================================================= +# Target rules for targets named grab_image + +# Build rule for target. +grab_image: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 grab_image +.PHONY : grab_image + +# fast build rule for target. +grab_image/fast: + $(MAKE) -f CMakeFiles/grab_image.dir/build.make CMakeFiles/grab_image.dir/build +.PHONY : grab_image/fast + #============================================================================= # Target rules for targets named rosbuild_precompile @@ -332,6 +358,36 @@ waggler/fast: $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/build .PHONY : waggler/fast +# target to build an object file +src/grab_encoders.o: + $(MAKE) -f CMakeFiles/grab_enc.dir/build.make CMakeFiles/grab_enc.dir/src/grab_encoders.o +.PHONY : src/grab_encoders.o + +# target to preprocess a source file +src/grab_encoders.i: + $(MAKE) -f CMakeFiles/grab_enc.dir/build.make CMakeFiles/grab_enc.dir/src/grab_encoders.i +.PHONY : src/grab_encoders.i + +# target to generate assembly for a file +src/grab_encoders.s: + $(MAKE) -f CMakeFiles/grab_enc.dir/build.make CMakeFiles/grab_enc.dir/src/grab_encoders.s +.PHONY : src/grab_encoders.s + +# target to build an object file +src/grab_image.o: + $(MAKE) -f CMakeFiles/grab_image.dir/build.make CMakeFiles/grab_image.dir/src/grab_image.o +.PHONY : src/grab_image.o + +# target to preprocess a source file +src/grab_image.i: + $(MAKE) -f CMakeFiles/grab_image.dir/build.make CMakeFiles/grab_image.dir/src/grab_image.i +.PHONY : src/grab_image.i + +# target to generate assembly for a file +src/grab_image.s: + $(MAKE) -f CMakeFiles/grab_image.dir/build.make CMakeFiles/grab_image.dir/src/grab_image.s +.PHONY : src/grab_image.s + # target to build an object file src/waggler.o: $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/src/waggler.o @@ -360,6 +416,8 @@ help: @echo "... ROSBUILD_gensrv_lisp" @echo "... clean-test-results" @echo "... edit_cache" + @echo "... grab_enc" + @echo "... grab_image" @echo "... rebuild_cache" @echo "... rosbuild_precompile" @echo "... rosbuild_premsgsrvgen" @@ -373,6 +431,12 @@ help: @echo "... test-results-run" @echo "... tests" @echo "... waggler" + @echo "... src/grab_encoders.o" + @echo "... src/grab_encoders.i" + @echo "... src/grab_encoders.s" + @echo "... src/grab_image.o" + @echo "... src/grab_image.i" + @echo "... src/grab_image.s" @echo "... src/waggler.o" @echo "... src/waggler.i" @echo "... src/waggler.s" diff --git a/example/yarpros_examples/mainpage.dox b/example/yarpros_examples/mainpage.dox index babe72d..46acd16 100644 --- a/example/yarpros_examples/mainpage.dox +++ b/example/yarpros_examples/mainpage.dox @@ -12,23 +12,21 @@ waggler is written in unmodified ROS, and does not use YARP. It publishes a stream of position control commands that are suitable for hooking up -to YARP controlboard implementations (e.g. the iCub robot, or the -test_motor device). They can also be streamed to "yarp read". +to YARP controlboard implementations (e.g. the iCub robot, simulator, +or the test_motor device). They can also be streamed to "yarp read". -Make sure the example directory is in your ROS_PACKAGE_PATH. +YARP users: For compiling: + * Make sure the $YARP_ROOT/example directory is in your ROS_PACKAGE_PATH. + * Do "rosmake" in the current directory. -Make sure when compiling YARP you enable the TCPROS and XMLRPC carriers. +Follow the steps in $YARP_ROOT/src/doc/yarp_with_ros.dox. Then run waggler. Then do: \verbatim - # tell yarp where roscore is - yarpros roscore localhost 11311 # replace localhost as appropriate - # register the topic pos_cmd on node waggler as a virtual port - # called /waggler - yarpros import /waggler /waggler /pos_cmd - # run this in a separate terminal if you don't have the simulator - yarp read /read - # now hook things up! - yarp connect /waggler /read + yarp read /read-#/pos +\endverbatim +or run the iCub simulator and do: +\verbatim + yarp connect topic://pos /icubSim/left_arm/rpc:i \endverbatim diff --git a/example/yarpros_examples/msg/Encoders.msg b/example/yarpros_examples/msg/Encoders.msg new file mode 100644 index 0000000..cf59bac --- /dev/null +++ b/example/yarpros_examples/msg/Encoders.msg @@ -0,0 +1,6 @@ +# sniffed with: +# yarpros sniff out /icubSim/left_arm/state:o + +int32 v_tag # set to 266 (BOTTLE_TAG_LIST+code) +float64[] v # suggested length: 16 + # floats seen: -25.0004 20.0003 15 50.0008 2.4768e-10 1.97452e-11 9.43496e-11 0 0 0 0 0 0 0 0 0 diff --git a/example/yarpros_examples/msg/YarpImageRgb.msg b/example/yarpros_examples/msg/YarpImageRgb.msg new file mode 100644 index 0000000..4a33983 --- /dev/null +++ b/example/yarpros_examples/msg/YarpImageRgb.msg @@ -0,0 +1,15 @@ +# sniffed from the iCub simulator +# yarpros sniff out /icubSim/cam/left +# suggested values appropriate for 320x240 RGB + +int32 v_tag # set to 256 (BOTTLE_TAG_LIST+code) +int32 v_len # set to 4 (elements in list) +int32 v0_tag # set to 9 (BOTTLE_TAG_VOCAB) +int32 v0 # set to 7627117 (='m'*256^3+'a'*256^2+'t'*256=mat) +int32 v1_tag # set to 9 (BOTTLE_TAG_VOCAB) +int32 v1 # set to 6449010 (='r'*256^3+'g'*256^2+'b'*256=rgb) +int32 v2_tag # set to 257 (BOTTLE_TAG_LIST+code) +int32[] v2 # suggested length: 5 + # integers seen: 3 230400 8 320 240 +int32 v3_tag # set to 12 (BOTTLE_TAG_BLOB) +int8[] v3 # suggested length: 230400 diff --git a/example/yarpros_examples/src/grab_encoders.cpp b/example/yarpros_examples/src/grab_encoders.cpp new file mode 100644 index 0000000..6ba7c38 --- /dev/null +++ b/example/yarpros_examples/src/grab_encoders.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +void chatterCallback(const yarpros_examples::EncodersConstPtr& enc) +{ + printf("Encoder readings for first three joints: %g %g %g\n", + enc->v[0], enc->v[1], enc->v[2]); +} + +int main(int argc, char** argv) +{ + ros::init(argc, argv, "yarp_encoder_listener"); + ros::NodeHandle n; + ros::Subscriber chatter_sub = n.subscribe("yarp_enc", 1, chatterCallback); + ros::spin(); +} + diff --git a/example/yarpros_examples/src/grab_image.cpp b/example/yarpros_examples/src/grab_image.cpp new file mode 100644 index 0000000..6de1d05 --- /dev/null +++ b/example/yarpros_examples/src/grab_image.cpp @@ -0,0 +1,18 @@ +#include +#include +#include + +void chatterCallback(const yarpros_examples::YarpImageRgbConstPtr& img) +{ + printf("Got image of size %dx%d\n", + img->v2[3], img->v2[4]); +} + +int main(int argc, char** argv) +{ + ros::init(argc, argv, "yarp_image_listener"); + ros::NodeHandle n; + ros::Subscriber chatter_sub = n.subscribe("yarp_image", 100, chatterCallback); + ros::spin(); +} + From e45b915ed9410b9098d0a42f03a1e00b6b3d651f Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 3 Feb 2012 16:22:00 +0000 Subject: [PATCH 032/187] pick more sensible portnode names svn path=/trunk/yarp2/; revision=9049 --- example/yarpros_examples/src/grab_encoders.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/yarpros_examples/src/grab_encoders.cpp b/example/yarpros_examples/src/grab_encoders.cpp index 6ba7c38..2edc488 100644 --- a/example/yarpros_examples/src/grab_encoders.cpp +++ b/example/yarpros_examples/src/grab_encoders.cpp @@ -12,7 +12,7 @@ int main(int argc, char** argv) { ros::init(argc, argv, "yarp_encoder_listener"); ros::NodeHandle n; - ros::Subscriber chatter_sub = n.subscribe("yarp_enc", 1, chatterCallback); + ros::Subscriber chatter_sub = n.subscribe("pos", 1, chatterCallback); ros::spin(); } From 4fc538c4e172bc0df4dba65837d6b1b070f492cd Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 3 Feb 2012 16:36:49 +0000 Subject: [PATCH 033/187] deal better with vocabs svn path=/trunk/yarp2/; revision=9050 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 4 +++- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 15d22d5..7263236 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -24,7 +24,9 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { } else if (vin.isDouble()) { vout = vin.asDouble(); } else if (vin.isString()) { - vout = vin.asString(); + vout = vin.asString(); + } else if (vin.isVocab()) { + vout = ConstString("[") + vin.toString() + "]"; } else if (vin.isList()) { Bottle *bot = vin.asList(); bool struc = true; diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 90dd166..78d3f49 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -28,7 +28,16 @@ Value toValue(XmlRpcValue& v, bool outer) { return Value((double)v); break; case XmlRpcValue::TypeString: - return Value(((string)v).c_str()); + { + string s = (string)v; + if (s[0]!='[') { + return Value(s.c_str()); + } else { + Value v; + v.fromString(s.c_str()); + return v; + } + } break; case XmlRpcValue::TypeArray: { From d517566cda343defe02388fd3851c9e7bce869cc Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 3 Feb 2012 18:35:26 +0000 Subject: [PATCH 034/187] tweak gesture svn path=/trunk/yarp2/; revision=9051 --- example/yarpros_examples/src/waggler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp index 9e515a3..ed0a42c 100644 --- a/example/yarpros_examples/src/waggler.cpp +++ b/example/yarpros_examples/src/waggler.cpp @@ -25,8 +25,8 @@ int main(int argc, char** argv) { ros::init(argc, argv, "waggler"); ros::NodeHandle n; - ros::Publisher waggler_pub = n.advertise("pos", 100); - ros::Rate loop_rate(0.25); + ros::Publisher waggler_pub = n.advertise("motor", 100); + ros::Rate loop_rate(1.0); int count = 0; while (ros::ok()) { @@ -44,7 +44,7 @@ int main(int argc, char** argv) { msg.setpoints[i] = 0; } msg.setpoints[0] = -50*(count%2); - msg.setpoints[1] = 50*(count%2); + msg.setpoints[1] = 30+20*(count%2); msg.setpoints[3] = 25*(count%4); waggler_pub.publish(msg); From 1d003ec23a58e5b28887edb7d811266a4e55c6f8 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 15 May 2012 14:53:42 +0000 Subject: [PATCH 035/187] freshen COPYING svn path=/trunk/yarp2/; revision=9150 --- example/yarpros_examples/src/grab_encoders.cpp | 6 ++++++ example/yarpros_examples/src/grab_image.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/example/yarpros_examples/src/grab_encoders.cpp b/example/yarpros_examples/src/grab_encoders.cpp index 2edc488..08b0e65 100644 --- a/example/yarpros_examples/src/grab_encoders.cpp +++ b/example/yarpros_examples/src/grab_encoders.cpp @@ -1,3 +1,9 @@ +/* + * Copyright: (C) 2012 IITRBCS + * Author: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + #include #include #include diff --git a/example/yarpros_examples/src/grab_image.cpp b/example/yarpros_examples/src/grab_image.cpp index 6de1d05..ee0c2af 100644 --- a/example/yarpros_examples/src/grab_image.cpp +++ b/example/yarpros_examples/src/grab_image.cpp @@ -1,3 +1,9 @@ +/* + * Copyright: (C) 2012 IITRBCS + * Author: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + #include #include #include From 7e839b6deb9a5eea14dde1af37ed6bbb010942b3 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 16 May 2012 00:55:46 +0000 Subject: [PATCH 036/187] add library needed with msvc dll build svn path=/trunk/yarp2/; revision=9153 --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp index 078c32f..3b7b3c6 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp @@ -10,7 +10,9 @@ #if defined(_WINDOWS) # include # include -//# pragma lib(WS2_32.lib) +# ifdef _MSC_VER +# pragma lib(WS2_32.lib) +# endif # ifndef EINPROGRESS # define EINPROGRESS WSAEINPROGRESS From 7cd1cc18af601ad4efee903610e6670334a6b695 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 16 May 2012 21:12:05 +0000 Subject: [PATCH 037/187] drop unneeded xmlrpc code that is choking msvc dll build svn path=/trunk/yarp2/; revision=9157 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 13 +- .../xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 108 +------ .../xmlrpc_carrier/xmlrpc/XmlRpcClient.h | 4 - .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp | 213 -------------- .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h | 91 ------ .../xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp | 79 +---- .../xmlrpc_carrier/xmlrpc/XmlRpcServer.h | 4 +- .../xmlrpc/XmlRpcServerConnection.cpp | 30 +- .../xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp | 275 ------------------ .../xmlrpc_carrier/xmlrpc/XmlRpcSocket.h | 72 ----- .../xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp | 7 - 11 files changed, 23 insertions(+), 873 deletions(-) delete mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp delete mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h delete mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp delete mode 100644 src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 4ec6b21..a695a0b 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -13,12 +13,21 @@ if (NOT SKIP_xmlrpc_carrier) add_library(xmlrpc_carrier XmlRpcCarrier.h XmlRpcCarrier.cpp XmlRpcStream.h XmlRpcStream.cpp) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc) + if (FALSE) + add_library(xmlrpcpp xmlrpc/XmlRpcClient.cpp + xmlrpc/XmlRpcDispatch.cpp + xmlrpc/XmlRpcServer.cpp + xmlrpc/XmlRpcServerConnection.cpp + xmlrpc/XmlRpcServerMethod.cpp + xmlrpc/XmlRpcSocket.cpp + xmlrpc/XmlRpcSource.cpp + xmlrpc/XmlRpcUtil.cpp + xmlrpc/XmlRpcValue.cpp) + endif () add_library(xmlrpcpp xmlrpc/XmlRpcClient.cpp - xmlrpc/XmlRpcDispatch.cpp xmlrpc/XmlRpcServer.cpp xmlrpc/XmlRpcServerConnection.cpp xmlrpc/XmlRpcServerMethod.cpp - xmlrpc/XmlRpcSocket.cpp xmlrpc/XmlRpcSource.cpp xmlrpc/XmlRpcUtil.cpp xmlrpc/XmlRpcValue.cpp) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp index f5dc84c..d31ffb5 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp @@ -5,7 +5,6 @@ #include "XmlRpcClient.h" -#include "XmlRpcSocket.h" #include "XmlRpc.h" #include @@ -59,8 +58,6 @@ XmlRpcClient::close() { XmlRpcUtil::log(4, "XmlRpcClient::close: fd %d.", getfd()); _connectionState = NO_CONNECTION; - _disp.exit(); - _disp.removeSource(this); XmlRpcSource::close(); } @@ -79,36 +76,7 @@ struct ClearFlagOnExit { bool XmlRpcClient::execute(const char* method, XmlRpcValue const& params, XmlRpcValue& result) { - XmlRpcUtil::log(1, "XmlRpcClient::execute: method %s (_connectionState %d).", method, _connectionState); - - // This is not a thread-safe operation, if you want to do multithreading, use separate - // clients for each thread. If you want to protect yourself from multiple threads - // accessing the same client, replace this code with a real mutex. - if (_executing) - return false; - - _executing = true; - ClearFlagOnExit cf(_executing); - - _sendAttempts = 0; - _isFault = false; - - if ( ! setupConnection()) - return false; - - if ( ! generateRequest(method, params)) - return false; - - result.clear(); - double msTime = -1.0; // Process until exit is called - _disp.work(msTime); - - if (_connectionState != IDLE || ! parseResponse(result)) - return false; - - XmlRpcUtil::log(1, "XmlRpcClient::execute: method %s completed.", method); - _response = ""; - return true; + return false; } // XmlRpcSource interface implementation @@ -116,29 +84,7 @@ XmlRpcClient::execute(const char* method, XmlRpcValue const& params, XmlRpcValue unsigned XmlRpcClient::handleEvent(unsigned eventType) { - if (eventType == XmlRpcDispatch::Exception) - { - if (_connectionState == WRITE_REQUEST && _bytesWritten == 0) - XmlRpcUtil::error("Error in XmlRpcClient::handleEvent: could not connect to server (%s).", - XmlRpcSocket::getErrorMsg().c_str()); - else - XmlRpcUtil::error("Error in XmlRpcClient::handleEvent (state %d): %s.", - _connectionState, XmlRpcSocket::getErrorMsg().c_str()); - return 0; - } - - if (_connectionState == WRITE_REQUEST) - if ( ! writeRequest()) return 0; - - if (_connectionState == READ_HEADER) - if ( ! readHeader()) return 0; - - if (_connectionState == READ_RESPONSE) - if ( ! readResponse()) return 0; - - // This should probably always ask for Exception events too - return (_connectionState == WRITE_REQUEST) - ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent; + return 0; } @@ -159,10 +105,6 @@ XmlRpcClient::setupConnection() _connectionState = WRITE_REQUEST; _bytesWritten = 0; - // Notify the dispatcher to listen on this source (calls handleEvent when the socket is writable) - _disp.removeSource(this); // Make sure nothing is left over - _disp.addSource(this, XmlRpcDispatch::WritableEvent | XmlRpcDispatch::Exception); - return true; } @@ -171,32 +113,7 @@ XmlRpcClient::setupConnection() bool XmlRpcClient::doConnect() { - int fd = XmlRpcSocket::socket(); - if (fd < 0) - { - XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not create socket (%s).", XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - - XmlRpcUtil::log(3, "XmlRpcClient::doConnect: fd %d.", fd); - this->setfd(fd); - - // Don't block on connect/reads/writes - if ( ! XmlRpcSocket::setNonBlocking(fd)) - { - this->close(); - XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not set socket to non-blocking IO mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - - if ( ! XmlRpcSocket::connect(fd, _host, _port)) - { - this->close(); - XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not connect to server (%s).", XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - - return true; + return false; } // Encode the request to call the specified method with the specified parameters into xml @@ -262,24 +179,7 @@ XmlRpcClient::generateHeader(std::string const& body) bool XmlRpcClient::writeRequest() { - if (_bytesWritten == 0) - XmlRpcUtil::log(5, "XmlRpcClient::writeRequest (attempt %d):\n%s\n", _sendAttempts+1, _request.c_str()); - - // Try to write the request - if ( ! XmlRpcSocket::nbWrite(this->getfd(), _request, &_bytesWritten)) { - XmlRpcUtil::error("Error in XmlRpcClient::writeRequest: write error (%s).",XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - - XmlRpcUtil::log(3, "XmlRpcClient::writeRequest: wrote %d of %d bytes.", _bytesWritten, _request.length()); - - // Wait for the result - if (_bytesWritten == int(_request.length())) { - _header = ""; - _response = ""; - _connectionState = READ_HEADER; - } - return true; + return false; } void XmlRpcClient::reset() { diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h index 949c739..6596618 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h @@ -15,7 +15,6 @@ # include #endif -#include "XmlRpcDispatch.h" #include "XmlRpcSource.h" namespace XmlRpc { @@ -124,9 +123,6 @@ namespace XmlRpc { // Number of bytes expected in the response body (parsed from response header) int _contentLength; - // Event dispatcher - XmlRpcDispatch _disp; - }; // class XmlRpcClient } // namespace XmlRpc diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp deleted file mode 100644 index 9fc41cb..0000000 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp +++ /dev/null @@ -1,213 +0,0 @@ - -// Summary for YARP: -// Copyright: 2002, 2003 Chris Morley -// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT - -#include "XmlRpcDispatch.h" -#include "XmlRpcSource.h" -#include "XmlRpcUtil.h" - -#include -#include - -#if defined(_WINDOWS) -# include - -# define USE_FTIME -# if defined(_MSC_VER) -# define timeb _timeb -# define ftime _ftime -# endif -#else -# include -#endif // _WINDOWS - - -using namespace XmlRpc; - - -XmlRpcDispatch::XmlRpcDispatch() -{ - _endTime = -1.0; - _doClear = false; - _inWork = false; -} - - -XmlRpcDispatch::~XmlRpcDispatch() -{ -} - -// Monitor this source for the specified events and call its event handler -// when the event occurs -void -XmlRpcDispatch::addSource(XmlRpcSource* source, unsigned mask) -{ - _sources.push_back(MonitoredSource(source, mask)); -} - -// Stop monitoring this source. Does not close the source. -void -XmlRpcDispatch::removeSource(XmlRpcSource* source) -{ - for (SourceList::iterator it=_sources.begin(); it!=_sources.end(); ++it) - if (it->getSource() == source) - { - _sources.erase(it); - break; - } -} - - -// Modify the types of events to watch for on this source -void -XmlRpcDispatch::setSourceEvents(XmlRpcSource* source, unsigned eventMask) -{ - for (SourceList::iterator it=_sources.begin(); it!=_sources.end(); ++it) - if (it->getSource() == source) - { - it->getMask() = eventMask; - break; - } -} - - - -// Watch current set of sources and process events -void -XmlRpcDispatch::work(double timeout) -{ - // Compute end time - _endTime = (timeout < 0.0) ? -1.0 : (getTime() + timeout); - _doClear = false; - _inWork = true; - - // Only work while there is something to monitor - while (_sources.size() > 0) { - - // Construct the sets of descriptors we are interested in - fd_set inFd, outFd, excFd; - FD_ZERO(&inFd); - FD_ZERO(&outFd); - FD_ZERO(&excFd); - - int maxFd = -1; // Not used on windows - SourceList::iterator it; - for (it=_sources.begin(); it!=_sources.end(); ++it) { - int fd = it->getSource()->getfd(); - if (it->getMask() & ReadableEvent) FD_SET(fd, &inFd); - if (it->getMask() & WritableEvent) FD_SET(fd, &outFd); - if (it->getMask() & Exception) FD_SET(fd, &excFd); - if (it->getMask() && fd > maxFd) maxFd = fd; - } - - // Check for events - int nEvents; - if (timeout < 0.0) - nEvents = select(maxFd+1, &inFd, &outFd, &excFd, NULL); - else - { - struct timeval tv; - tv.tv_sec = (int)floor(timeout); - tv.tv_usec = ((int)floor(1000000.0 * (timeout-floor(timeout)))) % 1000000; - nEvents = select(maxFd+1, &inFd, &outFd, &excFd, &tv); - } - - if (nEvents < 0) - { - XmlRpcUtil::error("Error in XmlRpcDispatch::work: error in select (%d).", nEvents); - _inWork = false; - return; - } - - // Process events - for (it=_sources.begin(); it != _sources.end(); ) - { - SourceList::iterator thisIt = it++; - XmlRpcSource* src = thisIt->getSource(); - int fd = src->getfd(); - unsigned newMask = (unsigned) -1; - if (fd <= maxFd) { - // If you select on multiple event types this could be ambiguous - if (FD_ISSET(fd, &inFd)) - newMask &= src->handleEvent(ReadableEvent); - if (FD_ISSET(fd, &outFd)) - newMask &= src->handleEvent(WritableEvent); - if (FD_ISSET(fd, &excFd)) - newMask &= src->handleEvent(Exception); - - if ( ! newMask) { - _sources.erase(thisIt); // Stop monitoring this one - if ( ! src->getKeepOpen()) - src->close(); - } else if (newMask != (unsigned) -1) { - thisIt->getMask() = newMask; - } - } - } - - // Check whether to clear all sources - if (_doClear) - { - SourceList closeList = _sources; - _sources.clear(); - for (SourceList::iterator it=closeList.begin(); it!=closeList.end(); ++it) { - XmlRpcSource *src = it->getSource(); - src->close(); - } - - _doClear = false; - } - - // Check whether end time has passed - if (0 <= _endTime && getTime() > _endTime) - break; - } - - _inWork = false; -} - - -// Exit from work routine. Presumably this will be called from -// one of the source event handlers. -void -XmlRpcDispatch::exit() -{ - _endTime = 0.0; // Return from work asap -} - -// Clear all sources from the monitored sources list -void -XmlRpcDispatch::clear() -{ - if (_inWork) - _doClear = true; // Finish reporting current events before clearing - else - { - SourceList closeList = _sources; - _sources.clear(); - for (SourceList::iterator it=closeList.begin(); it!=closeList.end(); ++it) - it->getSource()->close(); - } -} - - -double -XmlRpcDispatch::getTime() -{ -#ifdef USE_FTIME - struct timeb tbuff; - - ftime(&tbuff); - return ((double) tbuff.time + ((double)tbuff.millitm / 1000.0) + - ((double) tbuff.timezone * 60)); -#else - struct timeval tv; - struct timezone tz; - - gettimeofday(&tv, &tz); - return (tv.tv_sec + tv.tv_usec / 1000000.0); -#endif /* USE_FTIME */ -} - - diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h deleted file mode 100644 index 0f6448a..0000000 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h +++ /dev/null @@ -1,91 +0,0 @@ - -#ifndef _XMLRPCDISPATCH_H_ -#define _XMLRPCDISPATCH_H_ -// -// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley -// -// Summary for YARP: -// Copyright: 2002, 2003 Chris Morley -// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -#if defined(_MSC_VER) -# pragma warning(disable:4786) // identifier was truncated in debug info -#endif - -#ifndef MAKEDEPEND -# include -#endif - -namespace XmlRpc { - - // An RPC source represents a file descriptor to monitor - class XmlRpcSource; - - //! An object which monitors file descriptors for events and performs - //! callbacks when interesting events happen. - class XmlRpcDispatch { - public: - //! Constructor - XmlRpcDispatch(); - ~XmlRpcDispatch(); - - //! Values indicating the type of events a source is interested in - enum EventType { - ReadableEvent = 1, //!< data available to read - WritableEvent = 2, //!< connected/data can be written without blocking - Exception = 4 //!< uh oh - }; - - //! Monitor this source for the event types specified by the event mask - //! and call its event handler when any of the events occur. - //! @param source The source to monitor - //! @param eventMask Which event types to watch for. \see EventType - void addSource(XmlRpcSource* source, unsigned eventMask); - - //! Stop monitoring this source. - //! @param source The source to stop monitoring - void removeSource(XmlRpcSource* source); - - //! Modify the types of events to watch for on this source - void setSourceEvents(XmlRpcSource* source, unsigned eventMask); - - - //! Watch current set of sources and process events for the specified - //! duration (in ms, -1 implies wait forever, or until exit is called) - void work(double msTime); - - //! Exit from work routine - void exit(); - - //! Clear all sources from the monitored sources list. Sources are closed. - void clear(); - - protected: - - // helper - double getTime(); - - // A source to monitor and what to monitor it for - struct MonitoredSource { - MonitoredSource(XmlRpcSource* src, unsigned mask) : _src(src), _mask(mask) {} - XmlRpcSource* getSource() const { return _src; } - unsigned& getMask() { return _mask; } - XmlRpcSource* _src; - unsigned _mask; - }; - - // A list of sources to monitor - typedef std::list< MonitoredSource > SourceList; - - // Sources being monitored - SourceList _sources; - - // When work should stop (-1 implies wait forever, or until exit is called) - double _endTime; - - bool _doClear; - bool _inWork; - - }; -} // namespace XmlRpc - -#endif // _XMLRPCDISPATCH_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp index b3351e5..bd4f582 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp @@ -5,7 +5,6 @@ #include "XmlRpcServer.h" #include "XmlRpcServerConnection.h" #include "XmlRpcServerMethod.h" -#include "XmlRpcSocket.h" #include "XmlRpcUtil.h" #include "XmlRpcException.h" @@ -72,53 +71,7 @@ XmlRpcServer::findMethod(const std::string& name) const bool XmlRpcServer::bindAndListen(int port, int backlog /*= 5*/) { - int fd = XmlRpcSocket::socket(); - if (fd < 0) - { - XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not create socket (%s).", XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - - this->setfd(fd); - - // Don't block on reads/writes - if ( ! XmlRpcSocket::setNonBlocking(fd)) - { - this->close(); - XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set socket to non-blocking input mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - - // Allow this port to be re-bound immediately so server re-starts are not delayed - if ( ! XmlRpcSocket::setReuseAddr(fd)) - { - this->close(); - XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set SO_REUSEADDR socket option (%s).", XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - - // Bind to the specified port on the default interface - if ( ! XmlRpcSocket::bind(fd, port)) - { - this->close(); - XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not bind to specified port (%s).", XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - - // Set in listening mode - if ( ! XmlRpcSocket::listen(fd, backlog)) - { - this->close(); - XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set socket in listening mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - - XmlRpcUtil::log(2, "XmlRpcServer::bindAndListen: server listening on port %d fd %d", port, fd); - - // Notify the dispatcher to listen on this source when we are in work() - _disp.addSource(this, XmlRpcDispatch::ReadableEvent); - - return true; + return false; } @@ -126,8 +79,7 @@ XmlRpcServer::bindAndListen(int port, int backlog /*= 5*/) void XmlRpcServer::work(double msTime) { - XmlRpcUtil::log(2, "XmlRpcServer::work: waiting for a connection"); - _disp.work(msTime); + return; } @@ -137,8 +89,7 @@ XmlRpcServer::work(double msTime) unsigned XmlRpcServer::handleEvent(unsigned mask) { - acceptConnection(); - return XmlRpcDispatch::ReadableEvent; // Continue to monitor this fd + return -1; } @@ -147,23 +98,6 @@ XmlRpcServer::handleEvent(unsigned mask) void XmlRpcServer::acceptConnection() { - int s = XmlRpcSocket::accept(this->getfd()); - XmlRpcUtil::log(2, "XmlRpcServer::acceptConnection: socket %d", s); - if (s < 0) - { - //this->close(); - XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not accept connection (%s).", XmlRpcSocket::getErrorMsg().c_str()); - } - else if ( ! XmlRpcSocket::setNonBlocking(s)) - { - XmlRpcSocket::close(s); - XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not set socket to non-blocking input mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); - } - else // Notify the dispatcher to listen for input on this source when we are in work() - { - XmlRpcUtil::log(2, "XmlRpcServer::acceptConnection: creating a connection"); - _disp.addSource(this->createConnection(s), XmlRpcDispatch::ReadableEvent); - } } @@ -171,15 +105,13 @@ XmlRpcServer::acceptConnection() XmlRpcServerConnection* XmlRpcServer::createConnection(int s) { - // Specify that the connection object be deleted when it is closed - return new XmlRpcServerConnection(s, this, true); + return NULL; } void XmlRpcServer::removeConnection(XmlRpcServerConnection* sc) { - _disp.removeSource(sc); } @@ -187,7 +119,6 @@ XmlRpcServer::removeConnection(XmlRpcServerConnection* sc) void XmlRpcServer::exit() { - _disp.exit(); } @@ -195,8 +126,6 @@ XmlRpcServer::exit() void XmlRpcServer::shutdown() { - // This closes and destroys all connections as well as closing this socket - _disp.clear(); } diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h index 566bf75..16bb4a4 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h @@ -16,7 +16,7 @@ # include #endif -#include "XmlRpcDispatch.h" +//#include "XmlRpcDispatch.h" #include "XmlRpcSource.h" namespace XmlRpc { @@ -91,7 +91,7 @@ namespace XmlRpc { bool _introspectionEnabled; // Event dispatcher - XmlRpcDispatch _disp; + //XmlRpcDispatch _disp; // Collection of methods. This could be a set keyed on method name if we wanted... typedef std::map< std::string, XmlRpcServerMethod* > MethodMap; diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp index 13cad73..73f3681 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp @@ -4,7 +4,6 @@ #include "XmlRpcServerConnection.h" -#include "XmlRpcSocket.h" #include "XmlRpc.h" #ifndef MAKEDEPEND # include @@ -65,8 +64,7 @@ XmlRpcServerConnection::handleEvent(unsigned /*eventType*/) if (_connectionState == WRITE_RESPONSE) if ( ! writeResponse()) return 0; - return (_connectionState == WRITE_RESPONSE) - ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent; + return 0; } void XmlRpcServerConnection::reset() { @@ -201,31 +199,7 @@ XmlRpcServerConnection::readRequest(const std::string& txt) bool XmlRpcServerConnection::writeResponse() { - if (_response.length() == 0) { - executeRequest(); - _bytesWritten = 0; - if (_response.length() == 0) { - XmlRpcUtil::error("XmlRpcServerConnection::writeResponse: empty response."); - return false; - } - } - - // Try to write the response - if ( ! XmlRpcSocket::nbWrite(this->getfd(), _response, &_bytesWritten)) { - XmlRpcUtil::error("XmlRpcServerConnection::writeResponse: write error (%s).",XmlRpcSocket::getErrorMsg().c_str()); - return false; - } - XmlRpcUtil::log(3, "XmlRpcServerConnection::writeResponse: wrote %d of %d bytes.", _bytesWritten, _response.length()); - - // Prepare to read the next request - if (_bytesWritten == int(_response.length())) { - _header = ""; - _request = ""; - _response = ""; - _connectionState = READ_HEADER; - } - - return _keepAlive; // Continue monitoring this source if true + return false; } // Run the method, generate _response string diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp deleted file mode 100644 index 3b7b3c6..0000000 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp +++ /dev/null @@ -1,275 +0,0 @@ -// Summary for YARP: -// Copyright: 2002, 2003 Chris Morley -// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT - -#include "XmlRpcSocket.h" -#include "XmlRpcUtil.h" - -#ifndef MAKEDEPEND - -#if defined(_WINDOWS) -# include -# include -# ifdef _MSC_VER -# pragma lib(WS2_32.lib) -# endif - -# ifndef EINPROGRESS -# define EINPROGRESS WSAEINPROGRESS -# endif -# ifndef EWOULDBLOCK -# define EWOULDBLOCK WSAEWOULDBLOCK -# endif -# ifndef ETIMEDOUT -# define ETIMEDOUT WSAETIMEDOUT -# endif -#else -extern "C" { -# include -# include -# include -# include -# include -# include -# include -# include -} -#endif // _WINDOWS - -#include -#include - -#endif // MAKEDEPEND - - -using namespace XmlRpc; - - - -#if defined(_WINDOWS) - -static void initWinSock() -{ - static bool wsInit = false; - if (! wsInit) - { - WORD wVersionRequested = MAKEWORD( 2, 0 ); - WSADATA wsaData; - WSAStartup(wVersionRequested, &wsaData); - wsInit = true; - } -} - -#else - -#define initWinSock() - -#endif // _WINDOWS - - -// These errors are not considered fatal for an IO operation; the operation will be re-tried. -static inline bool -nonFatalError() -{ - //int err = XmlRpcSocket::getError(); - //return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR); - return false; // do not need this for YARP, and causes problems on windows -} - - - -int -XmlRpcSocket::socket() -{ - initWinSock(); - return (int) ::socket(AF_INET, SOCK_STREAM, 0); -} - - -void -XmlRpcSocket::close(int fd) -{ - XmlRpcUtil::log(4, "XmlRpcSocket::close: fd %d.", fd); -#if defined(_WINDOWS) - closesocket(fd); -#else - ::close(fd); -#endif // _WINDOWS -} - - - - -bool -XmlRpcSocket::setNonBlocking(int fd) -{ -#if defined(_WINDOWS) - unsigned long flag = 1; - return (ioctlsocket((SOCKET)fd, FIONBIO, &flag) == 0); -#else - return (fcntl(fd, F_SETFL, O_NONBLOCK) == 0); -#endif // _WINDOWS -} - - -bool -XmlRpcSocket::setReuseAddr(int fd) -{ - // Allow this port to be re-bound immediately so server re-starts are not delayed - int sflag = 1; - return (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char *)&sflag, sizeof(sflag)) == 0); -} - - -// Bind to a specified port -bool -XmlRpcSocket::bind(int fd, int port) -{ - struct sockaddr_in saddr; - memset(&saddr, 0, sizeof(saddr)); - saddr.sin_family = AF_INET; - saddr.sin_addr.s_addr = htonl(INADDR_ANY); - saddr.sin_port = htons((u_short) port); - return (::bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) == 0); -} - - -// Set socket in listen mode -bool -XmlRpcSocket::listen(int fd, int backlog) -{ - return (::listen(fd, backlog) == 0); -} - - -int -XmlRpcSocket::accept(int fd) -{ - struct sockaddr_in addr; -#if defined(_WINDOWS) - int -#else - socklen_t -#endif - addrlen = sizeof(addr); - - return (int) ::accept(fd, (struct sockaddr*)&addr, &addrlen); -} - - - -// Connect a socket to a server (from a client) -bool -XmlRpcSocket::connect(int fd, std::string& host, int port) -{ - struct sockaddr_in saddr; - memset(&saddr, 0, sizeof(saddr)); - saddr.sin_family = AF_INET; - - struct hostent *hp = gethostbyname(host.c_str()); - if (hp == 0) return false; - - saddr.sin_family = hp->h_addrtype; - memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length); - saddr.sin_port = htons((u_short) port); - - // For asynch operation, this will return EWOULDBLOCK (windows) or - // EINPROGRESS (linux) and we just need to wait for the socket to be writable... - int result = ::connect(fd, (struct sockaddr *)&saddr, sizeof(saddr)); - return result == 0 || nonFatalError(); -} - - - -// Read available text from the specified socket. Returns false on error. -bool -XmlRpcSocket::nbRead(int fd, std::string& s, bool *eof) -{ - const int READ_SIZE = 4096; // Number of bytes to attempt to read at a time - char readBuf[READ_SIZE]; - - bool wouldBlock = false; - *eof = false; - - while ( ! wouldBlock && ! *eof) { -#if defined(_WINDOWS) - int n = recv(fd, readBuf, READ_SIZE-1, 0); -#else - int n = read(fd, readBuf, READ_SIZE-1); -#endif - XmlRpcUtil::log(5, "XmlRpcSocket::nbRead: read/recv returned %d.", n); - - if (n > 0) { - readBuf[n] = 0; - s.append(readBuf, n); - } else if (n == 0) { - *eof = true; - } else if (nonFatalError()) { - wouldBlock = true; - } else { - return false; // Error - } - } - return true; -} - - -// Write text to the specified socket. Returns false on error. -bool -XmlRpcSocket::nbWrite(int fd, std::string& s, int *bytesSoFar) -{ - int nToWrite = int(s.length()) - *bytesSoFar; - char *sp = const_cast(s.c_str()) + *bytesSoFar; - bool wouldBlock = false; - - while ( nToWrite > 0 && ! wouldBlock ) { -#if defined(_WINDOWS) - int n = send(fd, sp, nToWrite, 0); -#else - int n = write(fd, sp, nToWrite); -#endif - XmlRpcUtil::log(5, "XmlRpcSocket::nbWrite: send/write returned %d.", n); - - if (n > 0) { - sp += n; - *bytesSoFar += n; - nToWrite -= n; - } else if (nonFatalError()) { - wouldBlock = true; - } else { - return false; // Error - } - } - return true; -} - - -// Returns last errno -int -XmlRpcSocket::getError() -{ -#if defined(_WINDOWS) - return WSAGetLastError(); -#else - return errno; -#endif -} - - -// Returns message corresponding to last errno -std::string -XmlRpcSocket::getErrorMsg() -{ - return getErrorMsg(getError()); -} - -// Returns message corresponding to errno... well, it should anyway -std::string -XmlRpcSocket::getErrorMsg(int error) -{ - char err[60]; - snprintf(err,sizeof(err),"error %d", error); - return std::string(err); -} - - diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h deleted file mode 100644 index b549f3b..0000000 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSocket.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef _XMLRPCSOCKET_H_ -#define _XMLRPCSOCKET_H_ -// -// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley -// -// Summary for YARP: -// Copyright: 2002, 2003 Chris Morley -// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -#if defined(_MSC_VER) -# pragma warning(disable:4786) // identifier was truncated in debug info -#endif - -#ifndef MAKEDEPEND -# include -#endif - -namespace XmlRpc { - - //! A platform-independent socket API. - class XmlRpcSocket { - public: - - //! Creates a stream (TCP) socket. Returns -1 on failure. - static int socket(); - - //! Closes a socket. - static void close(int socket); - - - //! Sets a stream (TCP) socket to perform non-blocking IO. Returns false on failure. - static bool setNonBlocking(int socket); - - //! Read text from the specified socket. Returns false on error. - static bool nbRead(int socket, std::string& s, bool *eof); - - //! Write text to the specified socket. Returns false on error. - static bool nbWrite(int socket, std::string& s, int *bytesSoFar); - - - // The next four methods are appropriate for servers. - - //! Allow the port the specified socket is bound to to be re-bound immediately so - //! server re-starts are not delayed. Returns false on failure. - static bool setReuseAddr(int socket); - - //! Bind to a specified port - static bool bind(int socket, int port); - - //! Set socket in listen mode - static bool listen(int socket, int backlog); - - //! Accept a client connection request - static int accept(int socket); - - - //! Connect a socket to a server (from a client) - static bool connect(int socket, std::string& host, int port); - - - //! Returns last errno - static int getError(); - - //! Returns message corresponding to last error - static std::string getErrorMsg(); - - //! Returns message corresponding to error - static std::string getErrorMsg(int error); - }; - -} // namespace XmlRpc - -#endif diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp index 67b69ba..52da4f3 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp @@ -3,7 +3,6 @@ // CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT #include "XmlRpcSource.h" -#include "XmlRpcSocket.h" #include "XmlRpcUtil.h" namespace XmlRpc { @@ -22,12 +21,6 @@ namespace XmlRpc { void XmlRpcSource::close() { - if (_fd != -1) { - XmlRpcUtil::log(2,"XmlRpcSource::close: closing socket %d.", _fd); - XmlRpcSocket::close(_fd); - XmlRpcUtil::log(2,"XmlRpcSource::close: done closing socket %d.", _fd); - _fd = -1; - } if (_deleteOnClose) { XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this"); _deleteOnClose = false; From 3f4f7fda7dc9099298e3afbc3536f141c924f5f0 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 18 May 2012 20:42:19 +0000 Subject: [PATCH 038/187] add symbols for MSVC dll svn path=/trunk/yarp2/; revision=9159 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 32 ++++++++-------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index a695a0b..de6e055 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -10,26 +10,16 @@ if (NOT SKIP_xmlrpc_carrier) find_package(YARP REQUIRED) include_directories(${YARP_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - add_library(xmlrpc_carrier XmlRpcCarrier.h XmlRpcCarrier.cpp - XmlRpcStream.h XmlRpcStream.cpp) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc) - if (FALSE) - add_library(xmlrpcpp xmlrpc/XmlRpcClient.cpp - xmlrpc/XmlRpcDispatch.cpp - xmlrpc/XmlRpcServer.cpp - xmlrpc/XmlRpcServerConnection.cpp - xmlrpc/XmlRpcServerMethod.cpp - xmlrpc/XmlRpcSocket.cpp - xmlrpc/XmlRpcSource.cpp - xmlrpc/XmlRpcUtil.cpp - xmlrpc/XmlRpcValue.cpp) - endif () - add_library(xmlrpcpp xmlrpc/XmlRpcClient.cpp - xmlrpc/XmlRpcServer.cpp - xmlrpc/XmlRpcServerConnection.cpp - xmlrpc/XmlRpcServerMethod.cpp - xmlrpc/XmlRpcSource.cpp - xmlrpc/XmlRpcUtil.cpp - xmlrpc/XmlRpcValue.cpp) - target_link_libraries(xmlrpc_carrier xmlrpcpp ${YARP_LIBRARIES}) + add_library(xmlrpc_carrier + XmlRpcCarrier.h XmlRpcCarrier.cpp + XmlRpcStream.h XmlRpcStream.cpp + xmlrpc/XmlRpcClient.cpp + xmlrpc/XmlRpcServer.cpp + xmlrpc/XmlRpcServerConnection.cpp + xmlrpc/XmlRpcServerMethod.cpp + xmlrpc/XmlRpcSource.cpp + xmlrpc/XmlRpcUtil.cpp + xmlrpc/XmlRpcValue.cpp) + target_link_libraries(xmlrpc_carrier ${YARP_LIBRARIES}) endif (NOT SKIP_xmlrpc_carrier) From a574e8478e4537391b69f8ab125e8084f6897241 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 18 Dec 2012 21:15:47 +0000 Subject: [PATCH 039/187] beginnings of run-time carrier plugins svn path=/trunk/yarp2/; revision=9638 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index de6e055..a864de0 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -11,7 +11,7 @@ if (NOT SKIP_xmlrpc_carrier) include_directories(${YARP_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc) - add_library(xmlrpc_carrier + add_library(yarp_xmlrpc XmlRpcCarrier.h XmlRpcCarrier.cpp XmlRpcStream.h XmlRpcStream.cpp xmlrpc/XmlRpcClient.cpp @@ -21,5 +21,5 @@ if (NOT SKIP_xmlrpc_carrier) xmlrpc/XmlRpcSource.cpp xmlrpc/XmlRpcUtil.cpp xmlrpc/XmlRpcValue.cpp) - target_link_libraries(xmlrpc_carrier ${YARP_LIBRARIES}) + target_link_libraries(yarp_xmlrpc ${YARP_LIBRARIES}) endif (NOT SKIP_xmlrpc_carrier) From 111ad0ca1c7ac88bc14197d49b9c0da81fa55a90 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 19 Dec 2012 20:35:01 +0000 Subject: [PATCH 040/187] prototype of runtime loading of carrier plugins on receiver side svn path=/trunk/yarp2/; revision=9654 --- src/carriers/xmlrpc_carrier/xmlrpc.ini | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/carriers/xmlrpc_carrier/xmlrpc.ini diff --git a/src/carriers/xmlrpc_carrier/xmlrpc.ini b/src/carriers/xmlrpc_carrier/xmlrpc.ini new file mode 100644 index 0000000..2a0eea6 --- /dev/null +++ b/src/carriers/xmlrpc_carrier/xmlrpc.ini @@ -0,0 +1,5 @@ +[plugin xmlrpc] +name xmlrpc +library yarp_xmlrpc +part xmlrpc +code "POST /" From 052e52d670ed33cb3a7c9755848c9ad7ddecd374 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 20 Dec 2012 15:40:31 +0000 Subject: [PATCH 041/187] start enumerating fingerprint files svn path=/trunk/yarp2/; revision=9661 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index a864de0..4903027 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -4,6 +4,7 @@ if (COMPILE_PLUGIN_LIBRARY) prepare_carrier(xmlrpc_carrier TYPE XmlRpcCarrier INCLUDE XmlRpcCarrier.h) + add_carrier_fingerprint(xmlrpc.ini xmlrpc_carrier) endif (COMPILE_PLUGIN_LIBRARY) if (NOT SKIP_xmlrpc_carrier) From 5bcd758a0263895377390f900db8985792606405 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 14 Jan 2013 16:38:31 +0000 Subject: [PATCH 042/187] tag carrier plugins appropriately svn path=/trunk/yarp2/; revision=9738 --- src/carriers/xmlrpc_carrier/xmlrpc.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc.ini b/src/carriers/xmlrpc_carrier/xmlrpc.ini index 2a0eea6..db8da80 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc.ini +++ b/src/carriers/xmlrpc_carrier/xmlrpc.ini @@ -1,4 +1,5 @@ [plugin xmlrpc] +type carrier name xmlrpc library yarp_xmlrpc part xmlrpc From d0ac0acb09504c039d796db60290cce6fb313d7d Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 15 Jan 2013 16:58:24 +0000 Subject: [PATCH 043/187] Set svn:eol=native svn path=/trunk/yarp2/; revision=9757 From bebe7f4b6d1bed942f5a58d3fa1c0517cd57b0cc Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 16 Jan 2013 08:46:34 +0000 Subject: [PATCH 044/187] Yeah that was supposed to be svn:eol-style, not svn:eol svn path=/trunk/yarp2/; revision=9759 From b1b765fc1889b6a21a5292047c88330a940dc508 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 21 Jan 2013 14:05:18 +0000 Subject: [PATCH 045/187] Rename new CMake macros * ADD_CARRIER_FINGERPRINT -> YARP_ADD_CARRIER_FINGERPRINT * ADD_DEVICE_FINGERPRINT -> YARP_ADD_DEVICE_FINGERPRINT svn path=/trunk/yarp2/; revision=9785 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 4903027..0cc8d74 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -4,7 +4,7 @@ if (COMPILE_PLUGIN_LIBRARY) prepare_carrier(xmlrpc_carrier TYPE XmlRpcCarrier INCLUDE XmlRpcCarrier.h) - add_carrier_fingerprint(xmlrpc.ini xmlrpc_carrier) + yarp_add_carrier_fingerprint(xmlrpc.ini xmlrpc_carrier) endif (COMPILE_PLUGIN_LIBRARY) if (NOT SKIP_xmlrpc_carrier) From 72603c33cf9efc950a8542ff0479f53707bb84cf Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 21 Jan 2013 14:34:13 +0000 Subject: [PATCH 046/187] [CMake] Use the new commands everywhere in YARP svn path=/trunk/yarp2/; revision=9789 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 0cc8d74..4d8c455 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -3,7 +3,7 @@ # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT if (COMPILE_PLUGIN_LIBRARY) - prepare_carrier(xmlrpc_carrier TYPE XmlRpcCarrier INCLUDE XmlRpcCarrier.h) + yarp_prepare_carrier(xmlrpc_carrier TYPE XmlRpcCarrier INCLUDE XmlRpcCarrier.h) yarp_add_carrier_fingerprint(xmlrpc.ini xmlrpc_carrier) endif (COMPILE_PLUGIN_LIBRARY) From d03b8b95859bc83e040e0d55321a90854f385c8e Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 21 Jan 2013 16:24:45 +0000 Subject: [PATCH 047/187] [CMake] Use YARP_ADD_PLUGIN instead of ADD_LIBRARY svn path=/trunk/yarp2/; revision=9796 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 4d8c455..2fd7f0b 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -12,15 +12,15 @@ if (NOT SKIP_xmlrpc_carrier) include_directories(${YARP_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc) - add_library(yarp_xmlrpc - XmlRpcCarrier.h XmlRpcCarrier.cpp - XmlRpcStream.h XmlRpcStream.cpp - xmlrpc/XmlRpcClient.cpp - xmlrpc/XmlRpcServer.cpp - xmlrpc/XmlRpcServerConnection.cpp - xmlrpc/XmlRpcServerMethod.cpp - xmlrpc/XmlRpcSource.cpp - xmlrpc/XmlRpcUtil.cpp - xmlrpc/XmlRpcValue.cpp) + yarp_add_plugin(yarp_xmlrpc + XmlRpcCarrier.h XmlRpcCarrier.cpp + XmlRpcStream.h XmlRpcStream.cpp + xmlrpc/XmlRpcClient.cpp + xmlrpc/XmlRpcServer.cpp + xmlrpc/XmlRpcServerConnection.cpp + xmlrpc/XmlRpcServerMethod.cpp + xmlrpc/XmlRpcSource.cpp + xmlrpc/XmlRpcUtil.cpp + xmlrpc/XmlRpcValue.cpp) target_link_libraries(yarp_xmlrpc ${YARP_LIBRARIES}) endif (NOT SKIP_xmlrpc_carrier) From 62bfecbbbab33d58e79edf50e0829cef7ea5819b Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 22 Jan 2013 13:12:28 +0000 Subject: [PATCH 048/187] Link carriers only with the required libraries svn path=/trunk/yarp2/; revision=9799 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 2fd7f0b..f633202 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -22,5 +22,6 @@ if (NOT SKIP_xmlrpc_carrier) xmlrpc/XmlRpcSource.cpp xmlrpc/XmlRpcUtil.cpp xmlrpc/XmlRpcValue.cpp) - target_link_libraries(yarp_xmlrpc ${YARP_LIBRARIES}) + target_link_libraries(yarp_xmlrpc YARP_OS YARP_sig) + target_link_libraries(yarp_xmlrpc ${ACE_LIBRARIES}) endif (NOT SKIP_xmlrpc_carrier) From 5fa77f6c3dcce48215cc1e8cae59927e0e6f1452 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 28 Jan 2013 17:27:07 +0000 Subject: [PATCH 049/187] start backing away from need for RUNTIME_* flag; add more fingerprints svn path=/trunk/yarp2/; revision=9841 --- src/carriers/xmlrpc_carrier/xmlrpc.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc.ini b/src/carriers/xmlrpc_carrier/xmlrpc.ini index db8da80..0c7405f 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc.ini +++ b/src/carriers/xmlrpc_carrier/xmlrpc.ini @@ -2,5 +2,5 @@ type carrier name xmlrpc library yarp_xmlrpc -part xmlrpc +part xmlrpc_carrier code "POST /" From cfcae601fc9691144ef67881e7920c1c90157ec4 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 31 Jan 2013 08:47:34 +0000 Subject: [PATCH 050/187] [Cleanup] svn path=/trunk/yarp2/; revision=9851 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 2 +- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 4 ++-- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 7263236..7d4044d 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -24,7 +24,7 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { } else if (vin.isDouble()) { vout = vin.asDouble(); } else if (vin.isString()) { - vout = vin.asString(); + vout = vin.asString(); } else if (vin.isVocab()) { vout = ConstString("[") + vin.toString() + "]"; } else if (vin.isList()) { diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 9dfff9b..0808446 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -30,12 +30,12 @@ namespace yarp { * * Example: at the time of writing, there is a public XML/RPC server at * http://phpxmlrpc.sourceforge.net/server.php - * which has several methods. One is called "examples.addtwo" and expects + * which has several methods. One is called "examples.addtwo" and expects * two integers and returns an integer. So we can do: * * yarp name register /webserve xmlrpc+path.server.php phpxmlrpc.sourceforge.net 80 * - * The "80" corresponds to the usual http port number. + * The "80" corresponds to the usual http port number. * The "xmlrpc+path.server.php" means "use xmlrpc carrier, and use a request * path of server.php". Often this path can be omitted, but is important * for this particular server. diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 8c95d25..7d15a42 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -27,7 +27,7 @@ namespace yarp { } } -class yarp::os::impl::XmlRpcStream : public TwoWayStream, +class yarp::os::impl::XmlRpcStream : public TwoWayStream, public InputStream, public OutputStream { @@ -41,8 +41,8 @@ class yarp::os::impl::XmlRpcStream : public TwoWayStream, bool firstRound; bool interpretRos; public: - XmlRpcStream(TwoWayStream *delegate, bool sender, bool interpretRos) : - client("notset",0), + XmlRpcStream(TwoWayStream *delegate, bool sender, bool interpretRos) : + client("notset",0), server(0,0/*NULL*/), sender(sender), interpretRos(interpretRos) { @@ -98,7 +98,7 @@ class yarp::os::impl::XmlRpcStream : public TwoWayStream, // return delegate->getInputStream().read(b); //} - virtual void interrupt() { + virtual void interrupt() { delegate->getInputStream().interrupt(); } From f2b3fc39bd12cbc097f500fec40bd2cd7e570bd5 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Mar 2013 17:43:33 +0000 Subject: [PATCH 051/187] [Cleanup] svn path=/trunk/yarp2/; revision=9933 --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp index cf56423..26bc55e 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp @@ -50,7 +50,7 @@ namespace XmlRpc { static const char STRUCT_ETAG[] = ""; - + // Format strings std::string XmlRpcValue::_doubleFormat("%f"); @@ -71,7 +71,7 @@ namespace XmlRpc { _value.asBinary = 0; } - + // Type checking void XmlRpcValue::assertTypeOrInvalid(Type t) { @@ -172,7 +172,7 @@ namespace XmlRpc { { if (_value.asStruct->size() != other._value.asStruct->size()) return false; - + ValueStruct::const_iterator it1=_value.asStruct->begin(); ValueStruct::const_iterator it2=other._value.asStruct->begin(); while (it1 != _value.asStruct->end()) { @@ -612,9 +612,9 @@ namespace XmlRpc { os << ']'; break; } - + } - + return os; } @@ -628,4 +628,3 @@ std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v) //return os << v.toXml(); return v.write(os); } - From 8475adf78b1754505738fd63955d7e00bbaee587 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 13 May 2013 08:43:23 +0200 Subject: [PATCH 052/187] Require CMake 2.8.7 --- example/yarpros_examples/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 4e78a0e..839cdc1 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -4,7 +4,7 @@ # Author: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -cmake_minimum_required(VERSION 2.4.6) +cmake_minimum_required(VERSION 2.8.7) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) # Set the build type. Options are: From c6f2188e510b7827479b190cecd3ccdcc70d9d57 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 20 Jun 2013 17:45:08 +0200 Subject: [PATCH 053/187] yarp::os::impl::OutputStream -> yarp::os::OutputStream --- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 7d15a42..c2d974e 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -11,7 +11,7 @@ #define XMLRPCSTREAM_INC #include -#include +#include #include #include #include @@ -29,7 +29,7 @@ namespace yarp { class yarp::os::impl::XmlRpcStream : public TwoWayStream, public InputStream, - public OutputStream + public yarp::os::OutputStream { private: TwoWayStream *delegate; @@ -60,7 +60,7 @@ class yarp::os::impl::XmlRpcStream : public TwoWayStream, } virtual InputStream& getInputStream() { return *this; } - virtual OutputStream& getOutputStream() { return *this; } + virtual yarp::os::OutputStream& getOutputStream() { return *this; } virtual const Address& getLocalAddress() { From 86df5a372ba6f36c279b32dec294ec7c7f582341 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 20 Jun 2013 22:44:41 +0200 Subject: [PATCH 054/187] more pruning of yarp::os::impl::Protocol --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 0808446..5f82bcd 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -167,7 +167,7 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { virtual bool reply(Protocol& proto, SizedWriter& writer); - virtual bool sendIndex(Protocol& proto) { + virtual bool sendIndex(Protocol& proto, SizedWriter& writer) { return true; } From 8696fd97236ac410dd9a48e82e732b35ba3169a5 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 21 Jun 2013 16:44:11 +0200 Subject: [PATCH 055/187] yarp::os::impl::InputStream -> yarp::os::InputStream (required porting ssize_t) --- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index c2d974e..9420367 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -10,7 +10,7 @@ #ifndef XMLRPCSTREAM_INC #define XMLRPCSTREAM_INC -#include +#include #include #include #include @@ -28,7 +28,7 @@ namespace yarp { } class yarp::os::impl::XmlRpcStream : public TwoWayStream, - public InputStream, + public yarp::os::InputStream, public yarp::os::OutputStream { private: @@ -59,7 +59,7 @@ class yarp::os::impl::XmlRpcStream : public TwoWayStream, } } - virtual InputStream& getInputStream() { return *this; } + virtual yarp::os::InputStream& getInputStream() { return *this; } virtual yarp::os::OutputStream& getOutputStream() { return *this; } @@ -94,9 +94,6 @@ class yarp::os::impl::XmlRpcStream : public TwoWayStream, virtual void write(const Bytes& b); virtual ssize_t read(const Bytes& b); - //{ - // return delegate->getInputStream().read(b); - //} virtual void interrupt() { delegate->getInputStream().interrupt(); From b682abc4ceb84acac1497b731a5879fcad6792dc Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 9 Aug 2013 19:27:02 +0200 Subject: [PATCH 056/187] switch to std::string makes str[0] invalid on empty string rather than \0 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 2 +- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 7d4044d..965b8aa 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -89,7 +89,7 @@ bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { // header.c_str(), body.c_str()); Value v; //printf("HEADER %s\n", header.c_str()); - if (header[0]=='q') { + if (header.length()>0 && header[0]=='q') { body = "yarp.quit"; // XMLRPC does not need a quit message, this should get stripped return false; diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 78d3f49..50e07fa 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -30,7 +30,7 @@ Value toValue(XmlRpcValue& v, bool outer) { case XmlRpcValue::TypeString: { string s = (string)v; - if (s[0]!='[') { + if (s.length()==0 || s[0]!='[') { return Value(s.c_str()); } else { Value v; From e838721330b57c8b38f3e2f80c3b1abfa1425d25 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 12 Aug 2013 18:36:49 +0200 Subject: [PATCH 057/187] yarp::os::impl::Address removed in favor of yarp::os::Contact --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 7 +++---- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 3 +-- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 965b8aa..c2eb298 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -111,8 +111,8 @@ bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { //printf("xmlrpc block to write is %s\n", args.toXml().c_str()); std::string req; if (sender) { - const Address& addr = host.isValid()?host:proto.getStreams().getRemoteAddress(); - XmlRpcClient c(addr.getName().c_str(),(addr.getPort()>0)?addr.getPort():80); + const Contact& addr = host.isValid()?host:proto.getStreams().getRemoteAddress(); + XmlRpcClient c(addr.getHost().c_str(),(addr.getPort()>0)?addr.getPort():80); c.generateRequest(methodName.c_str(),args); req = c.getRequest(); } else { @@ -164,8 +164,7 @@ bool XmlRpcCarrier::sendHeader(Protocol& proto) { target = "POST /"; target += pathValue; // on the wider web, we should provide real host names - Contact contact = NetworkBase::queryName(proto.getRoute().getToName().c_str()); - host = Address::fromContact(contact); + host = NetworkBase::queryName(proto.getRoute().getToName()); } String rospass = n.getCarrierModifier("ros"); if (rospass=="") { diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 5f82bcd..bc3e303 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -12,7 +12,6 @@ #include #include -#include #include #include "XmlRpcStream.h" @@ -50,7 +49,7 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { private: bool firstRound; bool sender; - Address host; + yarp::os::Contact host; String http; bool interpretRos; public: diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 9420367..b734156 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -63,11 +63,11 @@ class yarp::os::impl::XmlRpcStream : public TwoWayStream, virtual yarp::os::OutputStream& getOutputStream() { return *this; } - virtual const Address& getLocalAddress() { + virtual const yarp::os::Contact& getLocalAddress() { return delegate->getLocalAddress(); } - virtual const Address& getRemoteAddress() { + virtual const yarp::os::Contact& getRemoteAddress() { return delegate->getRemoteAddress(); } From bd1714416a63f21af80cec637f6326f6afed4af8 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 12 Aug 2013 23:08:05 +0200 Subject: [PATCH 058/187] ssize_t -> YARP_SSIZE_T due to MSVC --- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 4 ++-- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 50e07fa..b1cbcfc 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -88,9 +88,9 @@ Value toValue(XmlRpcValue& v, bool outer) { return Value("(type not supported yet out of laziness)"); } -ssize_t XmlRpcStream::read(const Bytes& b) { +YARP_SSIZE_T XmlRpcStream::read(const Bytes& b) { //printf("XMLRPC READ\n"); - ssize_t result = sis.read(b); + YARP_SSIZE_T result = sis.read(b); if (result>0) { //printf("RETURNING %d bytes\n", result); return result; diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index b734156..488530c 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -93,7 +93,7 @@ class yarp::os::impl::XmlRpcStream : public TwoWayStream, virtual void write(const Bytes& b); - virtual ssize_t read(const Bytes& b); + virtual YARP_SSIZE_T read(const Bytes& b); virtual void interrupt() { delegate->getInputStream().interrupt(); From 2cbfe729f95af8a5a3582042353b5de312729f32 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 13 Aug 2013 16:47:34 +0200 Subject: [PATCH 059/187] yarp/os/impl/TwoWayStream.h -> yarp/os/TwoWayStream.h --- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 488530c..cc7db2c 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include From 1a9eb113c12530916951d1ef552aea65d4b062e3 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 13 Aug 2013 19:03:42 +0200 Subject: [PATCH 060/187] isolate yarp::os::impl::Protocol from carriers via yarp::os::ConnectionState --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 11 ++++---- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 25 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index c2eb298..c2eda3c 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -10,6 +10,7 @@ #include "XmlRpcCarrier.h" #include #include +#include #include #include "XmlRpc.h" @@ -69,12 +70,12 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { } } -bool XmlRpcCarrier::expectSenderSpecifier(Protocol& proto) { +bool XmlRpcCarrier::expectSenderSpecifier(ConnectionState& proto) { proto.setRoute(proto.getRoute().addFromName("rpc")); return true; } -bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { +bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) { //XmlRpc::setVerbosity(10); StringOutputStream sos; StringInputStream sis; @@ -148,13 +149,13 @@ bool XmlRpcCarrier::write(Protocol& proto, SizedWriter& writer) { } -bool XmlRpcCarrier::reply(Protocol& proto, SizedWriter& writer) { +bool XmlRpcCarrier::reply(ConnectionState& proto, SizedWriter& writer) { //printf("Preparing for write\n"); return write(proto,writer); } -bool XmlRpcCarrier::sendHeader(Protocol& proto) { +bool XmlRpcCarrier::sendHeader(ConnectionState& proto) { Name n(proto.getRoute().getCarrierName() + "://test"); //printf("ROUTE is %s\n", proto.getRoute().toString().c_str()); String pathValue = n.getCarrierModifier("path"); @@ -179,7 +180,7 @@ bool XmlRpcCarrier::sendHeader(Protocol& proto) { } -bool XmlRpcCarrier::respondToHeader(Protocol& proto) { +bool XmlRpcCarrier::respondToHeader(ConnectionState& proto) { Name n(proto.getRoute().getCarrierName() + "://test"); String rospass = n.getCarrierModifier("ros"); if (rospass=="") { diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index bc3e303..b2b133a 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -11,7 +11,6 @@ #define XMLRPCCARRIER_INC #include -#include #include #include "XmlRpcStream.h" @@ -130,23 +129,23 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { // Now, the initial hand-shaking - virtual bool prepareSend(Protocol& proto) { + virtual bool prepareSend(ConnectionState& proto) { // nothing special to do return true; } - virtual bool sendHeader(Protocol& proto); + virtual bool sendHeader(ConnectionState& proto); - virtual bool expectSenderSpecifier(Protocol& proto); + virtual bool expectSenderSpecifier(ConnectionState& proto); - virtual bool expectExtraHeader(Protocol& proto) { + virtual bool expectExtraHeader(ConnectionState& proto) { // interpret any extra header information sent - optional return true; } - bool respondToHeader(Protocol& proto); + bool respondToHeader(ConnectionState& proto); - virtual bool expectReplyToHeader(Protocol& proto) { + virtual bool expectReplyToHeader(ConnectionState& proto) { sender = true; XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(),sender, interpretRos); @@ -162,23 +161,23 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { // Payload time! - virtual bool write(Protocol& proto, SizedWriter& writer); + virtual bool write(ConnectionState& proto, SizedWriter& writer); - virtual bool reply(Protocol& proto, SizedWriter& writer); + virtual bool reply(ConnectionState& proto, SizedWriter& writer); - virtual bool sendIndex(Protocol& proto, SizedWriter& writer) { + virtual bool sendIndex(ConnectionState& proto, SizedWriter& writer) { return true; } - virtual bool expectIndex(Protocol& proto) { + virtual bool expectIndex(ConnectionState& proto) { return true; } - virtual bool sendAck(Protocol& proto) { + virtual bool sendAck(ConnectionState& proto) { return true; } - virtual bool expectAck(Protocol& proto) { + virtual bool expectAck(ConnectionState& proto) { return true; } From af9ad23f7461f73edc410852e7f27c41fceb48f0 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 13 Aug 2013 19:21:07 +0200 Subject: [PATCH 061/187] yarp::os::impl::Carrier -> yarp::os::Carrier --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index b2b133a..a2530d3 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -10,7 +10,7 @@ #ifndef XMLRPCCARRIER_INC #define XMLRPCCARRIER_INC -#include +#include #include #include "XmlRpcStream.h" From 6efc7ab3d56959eb533a5aa75114f50ed219d300 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 14 Aug 2013 16:33:37 +0200 Subject: [PATCH 062/187] yarp/os/impl/[Name,NetType,StringInputStream,StringOutputStream].h -> yarp/os/* --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 33 ++++++------------- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 17 ++++------ src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 1 - src/carriers/xmlrpc_carrier/XmlRpcStream.h | 14 ++++---- 4 files changed, 23 insertions(+), 42 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index c2eda3c..b5d4588 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -8,14 +8,13 @@ */ #include "XmlRpcCarrier.h" -#include -#include -#include +#include +#include +#include #include #include "XmlRpc.h" -using namespace yarp::os::impl; using namespace yarp::os; using namespace XmlRpc; @@ -76,27 +75,22 @@ bool XmlRpcCarrier::expectSenderSpecifier(ConnectionState& proto) { } bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) { - //XmlRpc::setVerbosity(10); StringOutputStream sos; StringInputStream sis; writer.write(sos); sis.reset(sos.toString()); - String header; + ConstString header; if (sender) { - header = NetType::readLine(sis); + header = sis.readLine(); } - String body = NetType::readLine(sis); - //printf("Asked to write: hdr %s body %s\n", - // header.c_str(), body.c_str()); + ConstString body = sis.readLine(); Value v; - //printf("HEADER %s\n", header.c_str()); if (header.length()>0 && header[0]=='q') { body = "yarp.quit"; // XMLRPC does not need a quit message, this should get stripped return false; } Bottle *bot = v.asList(); - //Bottle aux; bot->fromString(body.c_str()); ConstString methodName; if (sender) { @@ -109,7 +103,6 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) { } else { toXmlRpcValue(v,args); } - //printf("xmlrpc block to write is %s\n", args.toXml().c_str()); std::string req; if (sender) { const Contact& addr = host.isValid()?host:proto.getStreams().getRemoteAddress(); @@ -122,7 +115,6 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) { req = c.getResponse(); } int start = 0; - //printf("converts to %s\n", req.c_str()); if (sender) { if (req.length()<8) { fprintf(stderr, "XmlRpcCarrier fail, %s:%d\n", __FILE__, __LINE__); @@ -142,7 +134,6 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) { firstRound = false; } Bytes b((char*)req.c_str()+start,req.length()-start); - //printf("WRITING [%s]\n", req.c_str()+start); proto.os().write(b); return proto.os().isOk(); @@ -150,31 +141,27 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) { bool XmlRpcCarrier::reply(ConnectionState& proto, SizedWriter& writer) { - //printf("Preparing for write\n"); return write(proto,writer); } bool XmlRpcCarrier::sendHeader(ConnectionState& proto) { Name n(proto.getRoute().getCarrierName() + "://test"); - //printf("ROUTE is %s\n", proto.getRoute().toString().c_str()); - String pathValue = n.getCarrierModifier("path"); - String target = "POST /RPC2"; + ConstString pathValue = n.getCarrierModifier("path"); + ConstString target = "POST /RPC2"; if (pathValue!="") { - //printf("FOUND PATH %s\n", pathValue.c_str()); target = "POST /"; target += pathValue; // on the wider web, we should provide real host names host = NetworkBase::queryName(proto.getRoute().getToName()); } - String rospass = n.getCarrierModifier("ros"); + ConstString rospass = n.getCarrierModifier("ros"); if (rospass=="") { interpretRos = true; } target += " HTTP/1.1\n"; http = target; Bytes b((char*)target.c_str(),target.length()); - //printf("SENDING HEADER [%s]\n", target.c_str()); proto.os().write(b); return true; } @@ -182,7 +169,7 @@ bool XmlRpcCarrier::sendHeader(ConnectionState& proto) { bool XmlRpcCarrier::respondToHeader(ConnectionState& proto) { Name n(proto.getRoute().getCarrierName() + "://test"); - String rospass = n.getCarrierModifier("ros"); + ConstString rospass = n.getCarrierModifier("ros"); if (rospass=="") { interpretRos = true; } diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index a2530d3..8cca89c 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -11,14 +11,11 @@ #define XMLRPCCARRIER_INC #include -#include #include "XmlRpcStream.h" namespace yarp { namespace os { - namespace impl { - class XmlRpcCarrier; - } + class XmlRpcCarrier; } } @@ -44,12 +41,12 @@ namespace yarp { * will produce the output "30" if the server still exists. * */ -class yarp::os::impl::XmlRpcCarrier : public Carrier { +class yarp::os::XmlRpcCarrier : public Carrier { private: bool firstRound; bool sender; - yarp::os::Contact host; - String http; + Contact host; + ConstString http; bool interpretRos; public: XmlRpcCarrier() { @@ -62,7 +59,7 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { return new XmlRpcCarrier(); } - virtual String getName() { + virtual ConstString getName() { return "xmlrpc"; } @@ -98,7 +95,7 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { return false; } - virtual String toString() { + virtual ConstString toString() { return "xmlrpc_carrier"; } @@ -181,7 +178,7 @@ class yarp::os::impl::XmlRpcCarrier : public Carrier { return true; } - virtual String getBootstrapCarrierName() { return ""; } + virtual ConstString getBootstrapCarrierName() { return ""; } }; #endif diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index b1cbcfc..ae9eb55 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -12,7 +12,6 @@ #include -using namespace yarp::os::impl; using namespace yarp::os; using namespace XmlRpc; using namespace std; diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index cc7db2c..4916c05 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -13,23 +13,21 @@ #include #include #include -#include -#include +#include +#include #include "XmlRpcClient.h" #include "XmlRpcServerConnection.h" namespace yarp { namespace os { - namespace impl { - class XmlRpcStream; - } + class XmlRpcStream; } } -class yarp::os::impl::XmlRpcStream : public TwoWayStream, - public yarp::os::InputStream, - public yarp::os::OutputStream +class yarp::os::XmlRpcStream : public TwoWayStream, + public InputStream, + public OutputStream { private: TwoWayStream *delegate; From 83db5f1b0c121455d9b791df0fea231de5a380ef Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 26 Aug 2013 20:11:17 +0200 Subject: [PATCH 063/187] bring back a ConstString implementation wrapping std::string for MSVC DLL use --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index b5d4588..51971ab 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -24,9 +24,9 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { } else if (vin.isDouble()) { vout = vin.asDouble(); } else if (vin.isString()) { - vout = vin.asString(); + vout = std::string(vin.asString()); } else if (vin.isVocab()) { - vout = ConstString("[") + vin.toString() + "]"; + vout = std::string("[") + std::string(vin.toString()) + "]"; } else if (vin.isList()) { Bottle *bot = vin.asList(); bool struc = true; @@ -56,7 +56,7 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { vout = XmlRpcValue(); for (int i=offset; isize(); i++) { Bottle *boti = bot->get(i).asList(); - XmlRpcValue& vouti=vout[boti->get(0).toString()]=XmlRpcValue(); + XmlRpcValue& vouti=vout[std::string(boti->get(0).toString())]=XmlRpcValue(); toXmlRpcValue(boti->get(1),vouti); } } else { From 84e01a87cb4f6eaa840829aa74dad0b8ea88dbc1 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 17 Sep 2013 17:05:31 +0200 Subject: [PATCH 064/187] inhibit old xmlrpc ros message processing for node ports --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 47 +++++++++++++++---- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 3 ++ 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 51971ab..ffacee6 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -145,20 +145,51 @@ bool XmlRpcCarrier::reply(ConnectionState& proto, SizedWriter& writer) { } +bool XmlRpcCarrier::shouldInterpretRosMessages(ConnectionState& proto) { + // We need to set the interpretRos flag, which controls + // whether ROS-style admin messages are treated as + // admin messages or data messages in YARP. + // In the future, they should always be data messages. + // For now, they should be admin messages for all ports + // except ports tagged as corresponding to ros nodes. + + bool nodelike = false; + Contactable *port = proto.getContactable(); + Property opt; + if (port) { + Property *pport = port->acquireProperties(true); + if (pport) { + opt = *pport; + } + port->releaseProperties(pport); + } + if (opt.check("node_like")) { + nodelike = true; + } + + Name n(proto.getRoute().getCarrierName() + "://test"); + ConstString rospass = n.getCarrierModifier("ros"); + interpretRos = !nodelike; + if (rospass=="1"||rospass=="on") { + interpretRos = true; + } + if (rospass=="0"||rospass=="off") { + interpretRos = false; + } + return interpretRos; +} + bool XmlRpcCarrier::sendHeader(ConnectionState& proto) { + shouldInterpretRosMessages(proto); + ConstString target = "POST /RPC2"; Name n(proto.getRoute().getCarrierName() + "://test"); ConstString pathValue = n.getCarrierModifier("path"); - ConstString target = "POST /RPC2"; if (pathValue!="") { target = "POST /"; target += pathValue; // on the wider web, we should provide real host names host = NetworkBase::queryName(proto.getRoute().getToName()); } - ConstString rospass = n.getCarrierModifier("ros"); - if (rospass=="") { - interpretRos = true; - } target += " HTTP/1.1\n"; http = target; Bytes b((char*)target.c_str(),target.length()); @@ -168,11 +199,7 @@ bool XmlRpcCarrier::sendHeader(ConnectionState& proto) { bool XmlRpcCarrier::respondToHeader(ConnectionState& proto) { - Name n(proto.getRoute().getCarrierName() + "://test"); - ConstString rospass = n.getCarrierModifier("ros"); - if (rospass=="") { - interpretRos = true; - } + shouldInterpretRosMessages(proto); sender = false; XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(), sender, diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 8cca89c..b0de9aa 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -179,6 +179,9 @@ class yarp::os::XmlRpcCarrier : public Carrier { } virtual ConstString getBootstrapCarrierName() { return ""; } + +private: + bool shouldInterpretRosMessages(ConnectionState& proto); }; #endif From af2dd7e3626ec448151ec366ebd10dc22fd46b05 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 13 Nov 2013 11:51:20 +0100 Subject: [PATCH 065/187] Documentation tweaks --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h index c44f553..e48e6a0 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h @@ -30,7 +30,7 @@ namespace XmlRpc { class XmlRpcUtil { public: // hokey xml parsing - //! Returns contents between and , updates offset to char after + //! Returns contents between \ and \, updates offset to char after \ static std::string parseTag(const char* tag, std::string const& xml, int* offset); //! Returns true if the tag is found and updates offset to the char after the tag From 2363e08c82268ff2fa0683326bcfc96cebb4b862 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 12 Dec 2013 19:37:44 +0100 Subject: [PATCH 066/187] [ros] add some simple yarp/ros examples --- example/ros/CMakeLists.txt | 21 ++++++++++++++++++++ example/ros/README.txt | 5 +++++ example/ros/add_int_client_v1.cpp | 30 ++++++++++++++++++++++++++++ example/ros/add_int_client_v2.cpp | 33 +++++++++++++++++++++++++++++++ example/ros/add_int_server_v1.cpp | 30 ++++++++++++++++++++++++++++ example/ros/listener.cpp | 25 +++++++++++++++++++++++ example/ros/talker.cpp | 25 +++++++++++++++++++++++ 7 files changed, 169 insertions(+) create mode 100644 example/ros/CMakeLists.txt create mode 100644 example/ros/README.txt create mode 100644 example/ros/add_int_client_v1.cpp create mode 100644 example/ros/add_int_client_v2.cpp create mode 100644 example/ros/add_int_server_v1.cpp create mode 100644 example/ros/listener.cpp create mode 100644 example/ros/talker.cpp diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt new file mode 100644 index 0000000..aab4260 --- /dev/null +++ b/example/ros/CMakeLists.txt @@ -0,0 +1,21 @@ +cmake_minimum_required(VERSION 2.8.7) + +find_package(YARP REQUIRED) + +include_directories(${YARP_INCLUDE_DIRS}) + +add_executable(add_int_client_v1 add_int_client_v1.cpp) +target_link_libraries(add_int_client_v1 ${YARP_LIBRARIES}) + +add_executable(add_int_client_v2 add_int_client_v2.cpp) +target_link_libraries(add_int_client_v2 ${YARP_LIBRARIES}) + +add_executable(add_int_server_v1 add_int_server_v1.cpp) +target_link_libraries(add_int_server_v1 ${YARP_LIBRARIES}) + +add_executable(talker talker.cpp) +target_link_libraries(talker ${YARP_LIBRARIES}) + +add_executable(listener listener.cpp) +target_link_libraries(listener ${YARP_LIBRARIES}) + diff --git a/example/ros/README.txt b/example/ros/README.txt new file mode 100644 index 0000000..3344ef9 --- /dev/null +++ b/example/ros/README.txt @@ -0,0 +1,5 @@ +Before trying these examples, make sure you read: + + http://wiki.icub.org/wiki/YARP_ROS_Interoperation + +There are prerequisites. diff --git a/example/ros/add_int_client_v1.cpp b/example/ros/add_int_client_v1.cpp new file mode 100644 index 0000000..45ddf7e --- /dev/null +++ b/example/ros/add_int_client_v1.cpp @@ -0,0 +1,30 @@ +#include +#include +#include + +using namespace yarp::os; + +int main(int argc, char *argv[]) { + if (argc!=3) { + fprintf(stderr,"Call as %s X Y\n", argv[0]); + return 1; + } + + Network yarp; + RpcClient client; + if (!client.open("/add_two_ints@/yarp_add_int_client")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } + + Bottle msg, reply; + msg.addInt(atoi(argv[1])); + msg.addInt(atoi(argv[2])); + if (!client.write(msg,reply)) { + fprintf(stderr,"Failed to call service\n"); + return 1; + } + printf("Got %d\n", reply.get(0).asInt()); + + return 0; +} diff --git a/example/ros/add_int_client_v2.cpp b/example/ros/add_int_client_v2.cpp new file mode 100644 index 0000000..b9d75e3 --- /dev/null +++ b/example/ros/add_int_client_v2.cpp @@ -0,0 +1,33 @@ +#include +#include +#include +#include + +using namespace yarp::os; + +int main(int argc, char *argv[]) { + if (argc!=3) { + fprintf(stderr,"Call as %s X Y\n", argv[0]); + return 1; + } + + Network yarp; + Node node("/yarp_add_int_client"); + + RpcClient client; + if (!client.open("add_two_ints")) { + fprintf(stderr,"Failed to open client\n"); + return 1; + } + + Bottle msg, reply; + msg.addInt(atoi(argv[1])); + msg.addInt(atoi(argv[2])); + if (!client.write(msg,reply)) { + fprintf(stderr,"Failed to call service\n"); + return 1; + } + printf("Got %d\n", reply.get(0).asInt()); + + return 0; +} diff --git a/example/ros/add_int_server_v1.cpp b/example/ros/add_int_server_v1.cpp new file mode 100644 index 0000000..4f1d366 --- /dev/null +++ b/example/ros/add_int_server_v1.cpp @@ -0,0 +1,30 @@ +#include +#include +#include + +using namespace yarp::os; + +int main(int argc, char *argv[]) { + Network yarp; + RpcServer server; + + server.promiseType(Type::byNameOnWire("rospy_tutorials/AddTwoInts")); + + if (!server.open("/add_two_ints@/yarp_add_int_server")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } + + while (true) { + Bottle msg, reply; + server.read(msg,true); + int x = msg.get(0).asInt(); + int y = msg.get(1).asInt(); + int sum = x + y; + reply.addInt(sum); + printf("Got %d + %d, answering %d\n", x, y, sum); + server.reply(reply); + } + + return 0; +} diff --git a/example/ros/listener.cpp b/example/ros/listener.cpp new file mode 100644 index 0000000..6fc0932 --- /dev/null +++ b/example/ros/listener.cpp @@ -0,0 +1,25 @@ +#include +#include + +using namespace yarp::os; + +int main(int argc, char *argv[]) { + Network yarp; + Port port; + port.setReadOnly(); + if (!port.open("/chatter@/yarp/listener")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } + + while (true) { + Bottle msg; + if (!port.read(msg)) { + fprintf(stderr,"Failed to read msg\n"); + continue; + } + printf("Got [%s]\n", msg.get(0).asString().c_str()); + } + + return 0; +} diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp new file mode 100644 index 0000000..2faf0f9 --- /dev/null +++ b/example/ros/talker.cpp @@ -0,0 +1,25 @@ +#include +#include + +using namespace yarp::os; + +int main(int argc, char *argv[]) { + Network yarp; + Port port; + port.setWriteOnly(); + if (!port.open("/chatter@/yarp/talker")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } + + for (int i=0; i<1000; i++) { + char buf[256]; + sprintf(buf,"hello ros %d", i); + Bottle msg; + msg.addString(buf); + port.write(msg); + Time::delay(1); + } + + return 0; +} From 74c9e6c3cee9affb586ddc2c6f66bba904ad00cd Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 13 Dec 2013 17:05:25 +0100 Subject: [PATCH 067/187] [ros] clean up ros examples, xref http://wiki.icub.org/wiki/YARP_ROS_Interoperation --- example/ros/CMakeLists.txt | 7 +++-- example/ros/add_int_client_v2.cpp | 1 - example/ros/{listener.cpp => listener_v1.cpp} | 0 example/ros/listener_v2.cpp | 26 +++++++++++++++++++ example/ros/talker.cpp | 1 + 5 files changed, 32 insertions(+), 3 deletions(-) rename example/ros/{listener.cpp => listener_v1.cpp} (100%) create mode 100644 example/ros/listener_v2.cpp diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index aab4260..05637fe 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -16,6 +16,9 @@ target_link_libraries(add_int_server_v1 ${YARP_LIBRARIES}) add_executable(talker talker.cpp) target_link_libraries(talker ${YARP_LIBRARIES}) -add_executable(listener listener.cpp) -target_link_libraries(listener ${YARP_LIBRARIES}) +add_executable(listener_v1 listener_v1.cpp) +target_link_libraries(listener_v1 ${YARP_LIBRARIES}) + +add_executable(listener_v2 listener_v2.cpp) +target_link_libraries(listener_v2 ${YARP_LIBRARIES}) diff --git a/example/ros/add_int_client_v2.cpp b/example/ros/add_int_client_v2.cpp index b9d75e3..cdf7562 100644 --- a/example/ros/add_int_client_v2.cpp +++ b/example/ros/add_int_client_v2.cpp @@ -1,7 +1,6 @@ #include #include #include -#include using namespace yarp::os; diff --git a/example/ros/listener.cpp b/example/ros/listener_v1.cpp similarity index 100% rename from example/ros/listener.cpp rename to example/ros/listener_v1.cpp diff --git a/example/ros/listener_v2.cpp b/example/ros/listener_v2.cpp new file mode 100644 index 0000000..d3c81b7 --- /dev/null +++ b/example/ros/listener_v2.cpp @@ -0,0 +1,26 @@ +#include +#include + +using namespace yarp::os; + +int main(int argc, char *argv[]) { + Network yarp; + Node node("/yarp/listener"); + Port port; + port.setReadOnly(); + if (!port.open("chatter")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } + + while (true) { + Bottle msg; + if (!port.read(msg)) { + fprintf(stderr,"Failed to read msg\n"); + continue; + } + printf("Got [%s]\n", msg.get(0).asString().c_str()); + } + + return 0; +} diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp index 2faf0f9..4ea1dfc 100644 --- a/example/ros/talker.cpp +++ b/example/ros/talker.cpp @@ -18,6 +18,7 @@ int main(int argc, char *argv[]) { Bottle msg; msg.addString(buf); port.write(msg); + printf("Wrote: [%s]\n", buf); Time::delay(1); } From d14e4ce04f8dc8dac17680dd0740cada25bd6630 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 30 Jan 2014 17:18:26 +0100 Subject: [PATCH 068/187] [ros] add license information to examples for #114 --- example/ros/CMakeLists.txt | 4 +++ example/ros/add_int_client_v1.cpp | 46 ++++++++++++++----------- example/ros/add_int_client_v2.cpp | 56 ++++++++++++++++++------------- example/ros/add_int_server_v1.cpp | 52 ++++++++++++++++------------ example/ros/listener_v1.cpp | 38 ++++++++++++--------- example/ros/listener_v2.cpp | 40 +++++++++++++--------- example/ros/talker.cpp | 42 +++++++++++++---------- 7 files changed, 165 insertions(+), 113 deletions(-) diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index 05637fe..6debfc5 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -1,3 +1,7 @@ +# Copyright: (C) 2013 iCub Facility +# Authors: Paul Fitzpatrick +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + cmake_minimum_required(VERSION 2.8.7) find_package(YARP REQUIRED) diff --git a/example/ros/add_int_client_v1.cpp b/example/ros/add_int_client_v1.cpp index 45ddf7e..a6aed83 100644 --- a/example/ros/add_int_client_v1.cpp +++ b/example/ros/add_int_client_v1.cpp @@ -1,3 +1,11 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +/* + * Copyright (C) 2013 iCub Facility + * Authors: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + #include #include #include @@ -5,26 +13,26 @@ using namespace yarp::os; int main(int argc, char *argv[]) { - if (argc!=3) { - fprintf(stderr,"Call as %s X Y\n", argv[0]); - return 1; - } + if (argc!=3) { + fprintf(stderr,"Call as %s X Y\n", argv[0]); + return 1; + } - Network yarp; - RpcClient client; - if (!client.open("/add_two_ints@/yarp_add_int_client")) { - fprintf(stderr,"Failed to open port\n"); - return 1; - } + Network yarp; + RpcClient client; + if (!client.open("/add_two_ints@/yarp_add_int_client")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } - Bottle msg, reply; - msg.addInt(atoi(argv[1])); - msg.addInt(atoi(argv[2])); - if (!client.write(msg,reply)) { - fprintf(stderr,"Failed to call service\n"); - return 1; - } - printf("Got %d\n", reply.get(0).asInt()); + Bottle msg, reply; + msg.addInt(atoi(argv[1])); + msg.addInt(atoi(argv[2])); + if (!client.write(msg,reply)) { + fprintf(stderr,"Failed to call service\n"); + return 1; + } + printf("Got %d\n", reply.get(0).asInt()); - return 0; + return 0; } diff --git a/example/ros/add_int_client_v2.cpp b/example/ros/add_int_client_v2.cpp index cdf7562..abe8c99 100644 --- a/example/ros/add_int_client_v2.cpp +++ b/example/ros/add_int_client_v2.cpp @@ -1,3 +1,11 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +/* + * Copyright (C) 2013 iCub Facility + * Authors: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + #include #include #include @@ -5,28 +13,28 @@ using namespace yarp::os; int main(int argc, char *argv[]) { - if (argc!=3) { - fprintf(stderr,"Call as %s X Y\n", argv[0]); - return 1; - } - - Network yarp; - Node node("/yarp_add_int_client"); - - RpcClient client; - if (!client.open("add_two_ints")) { - fprintf(stderr,"Failed to open client\n"); - return 1; - } - - Bottle msg, reply; - msg.addInt(atoi(argv[1])); - msg.addInt(atoi(argv[2])); - if (!client.write(msg,reply)) { - fprintf(stderr,"Failed to call service\n"); - return 1; - } - printf("Got %d\n", reply.get(0).asInt()); - - return 0; + if (argc!=3) { + fprintf(stderr,"Call as %s X Y\n", argv[0]); + return 1; + } + + Network yarp; + Node node("/yarp_add_int_client"); + + RpcClient client; + if (!client.open("add_two_ints")) { + fprintf(stderr,"Failed to open client\n"); + return 1; + } + + Bottle msg, reply; + msg.addInt(atoi(argv[1])); + msg.addInt(atoi(argv[2])); + if (!client.write(msg,reply)) { + fprintf(stderr,"Failed to call service\n"); + return 1; + } + printf("Got %d\n", reply.get(0).asInt()); + + return 0; } diff --git a/example/ros/add_int_server_v1.cpp b/example/ros/add_int_server_v1.cpp index 4f1d366..8987a18 100644 --- a/example/ros/add_int_server_v1.cpp +++ b/example/ros/add_int_server_v1.cpp @@ -1,3 +1,11 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +/* + * Copyright (C) 2013 iCub Facility + * Authors: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + #include #include #include @@ -5,26 +13,26 @@ using namespace yarp::os; int main(int argc, char *argv[]) { - Network yarp; - RpcServer server; - - server.promiseType(Type::byNameOnWire("rospy_tutorials/AddTwoInts")); - - if (!server.open("/add_two_ints@/yarp_add_int_server")) { - fprintf(stderr,"Failed to open port\n"); - return 1; - } - - while (true) { - Bottle msg, reply; - server.read(msg,true); - int x = msg.get(0).asInt(); - int y = msg.get(1).asInt(); - int sum = x + y; - reply.addInt(sum); - printf("Got %d + %d, answering %d\n", x, y, sum); - server.reply(reply); - } - - return 0; + Network yarp; + RpcServer server; + + server.promiseType(Type::byNameOnWire("rospy_tutorials/AddTwoInts")); + + if (!server.open("/add_two_ints@/yarp_add_int_server")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } + + while (true) { + Bottle msg, reply; + server.read(msg,true); + int x = msg.get(0).asInt(); + int y = msg.get(1).asInt(); + int sum = x + y; + reply.addInt(sum); + printf("Got %d + %d, answering %d\n", x, y, sum); + server.reply(reply); + } + + return 0; } diff --git a/example/ros/listener_v1.cpp b/example/ros/listener_v1.cpp index 6fc0932..2f17a8c 100644 --- a/example/ros/listener_v1.cpp +++ b/example/ros/listener_v1.cpp @@ -1,25 +1,33 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +/* + * Copyright (C) 2013 iCub Facility + * Authors: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + #include #include using namespace yarp::os; int main(int argc, char *argv[]) { - Network yarp; - Port port; - port.setReadOnly(); - if (!port.open("/chatter@/yarp/listener")) { - fprintf(stderr,"Failed to open port\n"); - return 1; - } + Network yarp; + Port port; + port.setReadOnly(); + if (!port.open("/chatter@/yarp/listener")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } - while (true) { - Bottle msg; - if (!port.read(msg)) { - fprintf(stderr,"Failed to read msg\n"); - continue; + while (true) { + Bottle msg; + if (!port.read(msg)) { + fprintf(stderr,"Failed to read msg\n"); + continue; + } + printf("Got [%s]\n", msg.get(0).asString().c_str()); } - printf("Got [%s]\n", msg.get(0).asString().c_str()); - } - return 0; + return 0; } diff --git a/example/ros/listener_v2.cpp b/example/ros/listener_v2.cpp index d3c81b7..d6bad89 100644 --- a/example/ros/listener_v2.cpp +++ b/example/ros/listener_v2.cpp @@ -1,26 +1,34 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +/* + * Copyright (C) 2013 iCub Facility + * Authors: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + #include #include using namespace yarp::os; int main(int argc, char *argv[]) { - Network yarp; - Node node("/yarp/listener"); - Port port; - port.setReadOnly(); - if (!port.open("chatter")) { - fprintf(stderr,"Failed to open port\n"); - return 1; - } + Network yarp; + Node node("/yarp/listener"); + Port port; + port.setReadOnly(); + if (!port.open("chatter")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } - while (true) { - Bottle msg; - if (!port.read(msg)) { - fprintf(stderr,"Failed to read msg\n"); - continue; + while (true) { + Bottle msg; + if (!port.read(msg)) { + fprintf(stderr,"Failed to read msg\n"); + continue; + } + printf("Got [%s]\n", msg.get(0).asString().c_str()); } - printf("Got [%s]\n", msg.get(0).asString().c_str()); - } - return 0; + return 0; } diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp index 4ea1dfc..b3a3321 100644 --- a/example/ros/talker.cpp +++ b/example/ros/talker.cpp @@ -1,26 +1,34 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +/* + * Copyright (C) 2013 iCub Facility + * Authors: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + #include #include using namespace yarp::os; int main(int argc, char *argv[]) { - Network yarp; - Port port; - port.setWriteOnly(); - if (!port.open("/chatter@/yarp/talker")) { - fprintf(stderr,"Failed to open port\n"); - return 1; - } + Network yarp; + Port port; + port.setWriteOnly(); + if (!port.open("/chatter@/yarp/talker")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } - for (int i=0; i<1000; i++) { - char buf[256]; - sprintf(buf,"hello ros %d", i); - Bottle msg; - msg.addString(buf); - port.write(msg); - printf("Wrote: [%s]\n", buf); - Time::delay(1); - } + for (int i=0; i<1000; i++) { + char buf[256]; + sprintf(buf,"hello ros %d", i); + Bottle msg; + msg.addString(buf); + port.write(msg); + printf("Wrote: [%s]\n", buf); + Time::delay(1); + } - return 0; + return 0; } From 3c13475bab672ebf3ed52bfdfe964a304d70e5d7 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 11 Apr 2014 17:02:57 +0200 Subject: [PATCH 069/187] [ros] change XmlRpc namespace to avoid conflict YARP and ROS both use the XmlRpc++ library. When YARP is compiled statically, these libraries can conflict if the user is also linking ROS. (This is not a problem when YARP is compiled as a shared library, where the XmlRpc-related symbols are not exposed). To support static linking, the XmlRpc namespace in YARP is renamed to YarpXmlRpc. See #167 --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 2 +- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 2 +- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 2 +- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h | 2 +- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp | 2 +- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h | 4 ++-- .../xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp | 2 +- .../xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp | 8 ++++---- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp | 6 +++--- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h | 6 +++--- 19 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index ffacee6..2b4e73a 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -16,7 +16,7 @@ #include "XmlRpc.h" using namespace yarp::os; -using namespace XmlRpc; +using namespace YarpXmlRpc; void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { if (vin.isInt()) { diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index ae9eb55..fb06e32 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -13,7 +13,7 @@ #include using namespace yarp::os; -using namespace XmlRpc; +using namespace YarpXmlRpc; using namespace std; diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 4916c05..88f942e 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -31,8 +31,8 @@ class yarp::os::XmlRpcStream : public TwoWayStream, { private: TwoWayStream *delegate; - XmlRpc::XmlRpcClient client; - XmlRpc::XmlRpcServerConnection server; + YarpXmlRpc::XmlRpcClient client; + YarpXmlRpc::XmlRpcServerConnection server; StringInputStream sis; StringOutputStream sos; bool sender; diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h index 6810b0b..f168b53 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h @@ -35,7 +35,7 @@ #include "XmlRpcValue.h" #include "XmlRpcUtil.h" -namespace XmlRpc { +namespace YarpXmlRpc { //! An interface allowing custom handling of error message reporting. @@ -96,6 +96,6 @@ namespace XmlRpc { //! Version identifier extern const char XMLRPC_VERSION[]; -} // namespace XmlRpc +} // namespace YarpXmlRpc #endif // _XMLRPC_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp index d31ffb5..98eb5f3 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp @@ -12,7 +12,7 @@ #include -using namespace XmlRpc; +using namespace YarpXmlRpc; // Static data const char XmlRpcClient::REQUEST_BEGIN[] = diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h index 6596618..b7775c2 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h @@ -17,7 +17,7 @@ #include "XmlRpcSource.h" -namespace XmlRpc { +namespace YarpXmlRpc { // Arguments and results are represented by XmlRpcValues class XmlRpcValue; @@ -125,6 +125,6 @@ namespace XmlRpc { }; // class XmlRpcClient -} // namespace XmlRpc +} // namespace YarpXmlRpc #endif // _XMLRPCCLIENT_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h index 31b6409..bef8ae1 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h @@ -16,7 +16,7 @@ #endif -namespace XmlRpc { +namespace YarpXmlRpc { //! A class representing an error. //! If server methods throw this exception, a fault response is returned diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp index bd4f582..a07bc2d 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp @@ -9,7 +9,7 @@ #include "XmlRpcException.h" -using namespace XmlRpc; +using namespace YarpXmlRpc; XmlRpcServer::XmlRpcServer() diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h index 16bb4a4..41f2352 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h @@ -19,7 +19,7 @@ //#include "XmlRpcDispatch.h" #include "XmlRpcSource.h" -namespace XmlRpc { +namespace YarpXmlRpc { // An abstract class supporting XML RPC methods @@ -102,6 +102,6 @@ namespace XmlRpc { XmlRpcServerMethod* _methodHelp; }; -} // namespace XmlRpc +} // namespace YarpXmlRpc #endif //_XMLRPCSERVER_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp index 73f3681..92b88d9 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp @@ -11,7 +11,7 @@ # include #endif -using namespace XmlRpc; +using namespace YarpXmlRpc; // Static data const char XmlRpcServerConnection::METHODNAME_TAG[] = ""; diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h index b388aa2..69916c5 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h @@ -17,7 +17,7 @@ #include "XmlRpcValue.h" #include "XmlRpcSource.h" -namespace XmlRpc { +namespace YarpXmlRpc { // The server waits for client connections and provides methods @@ -107,6 +107,6 @@ namespace XmlRpc { // Whether to keep the current client connection open for further requests bool _keepAlive; }; -} // namespace XmlRpc +} // namespace YarpXmlRpc #endif // _XMLRPCSERVERCONNECTION_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp index 1dbed4d..041a7c2 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp @@ -5,7 +5,7 @@ #include "XmlRpcServerMethod.h" #include "XmlRpcServer.h" -namespace XmlRpc { +namespace YarpXmlRpc { XmlRpcServerMethod::XmlRpcServerMethod(std::string const& name, XmlRpcServer* server) @@ -21,4 +21,4 @@ namespace XmlRpc { } -} // namespace XmlRpc +} // namespace YarpXmlRpc diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h index 9332ebd..5149e1b 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h @@ -16,7 +16,7 @@ # include #endif -namespace XmlRpc { +namespace YarpXmlRpc { // Representation of a parameter or result value class XmlRpcValue; @@ -46,6 +46,6 @@ namespace XmlRpc { std::string _name; XmlRpcServer* _server; }; -} // namespace XmlRpc +} // namespace YarpXmlRpc #endif // _XMLRPCSERVERMETHOD_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp index 52da4f3..f490b0f 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp @@ -5,7 +5,7 @@ #include "XmlRpcSource.h" #include "XmlRpcUtil.h" -namespace XmlRpc { +namespace YarpXmlRpc { XmlRpcSource::XmlRpcSource(int fd /*= -1*/, bool deleteOnClose /*= false*/) @@ -28,4 +28,4 @@ namespace XmlRpc { } } -} // namespace XmlRpc +} // namespace YarpXmlRpc diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h index 5ad5cbb..4933cb5 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h @@ -11,7 +11,7 @@ # pragma warning(disable:4786) // identifier was truncated in debug info #endif -namespace XmlRpc { +namespace YarpXmlRpc { //! An RPC source represents a file descriptor to monitor class XmlRpcSource { @@ -53,6 +53,6 @@ namespace XmlRpc { // In the client, keep connections open if you intend to make multiple calls. bool _keepOpen; }; -} // namespace XmlRpc +} // namespace YarpXmlRpc #endif //_XMLRPCSOURCE_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp index 8a60e2c..c1bb193 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp @@ -14,7 +14,7 @@ #include "XmlRpc.h" -using namespace XmlRpc; +using namespace YarpXmlRpc; //#define USE_WINDOWS_DEBUG // To make the error and log messages go to VC++ debug output @@ -24,7 +24,7 @@ using namespace XmlRpc; #endif // Version id -const char XmlRpc::XMLRPC_VERSION[] = "XMLRPC++ 0.7"; +const char YarpXmlRpc::XMLRPC_VERSION[] = "XMLRPC++ 0.7"; // Default log verbosity: 0 for no messages through 5 (writes everything) int XmlRpcLogHandler::_verbosity = 0; @@ -66,8 +66,8 @@ XmlRpcErrorHandler* XmlRpcErrorHandler::_errorHandler = &defaultErrorHandler; // Easy API for log verbosity -int XmlRpc::getVerbosity() { return XmlRpcLogHandler::getVerbosity(); } -void XmlRpc::setVerbosity(int level) { XmlRpcLogHandler::setVerbosity(level); } +int YarpXmlRpc::getVerbosity() { return XmlRpcLogHandler::getVerbosity(); } +void YarpXmlRpc::setVerbosity(int level) { XmlRpcLogHandler::setVerbosity(level); } diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h index e48e6a0..b48a681 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h @@ -24,7 +24,7 @@ # define strncasecmp strnicmp #endif -namespace XmlRpc { +namespace YarpXmlRpc { //! Utilities for XML parsing, encoding, and decoding and message handlers. class XmlRpcUtil { @@ -59,6 +59,6 @@ namespace XmlRpc { static void error(const char* fmt, ...); }; -} // namespace XmlRpc +} // namespace YarpXmlRpc #endif // _XMLRPCUTIL_H_ diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp index 26bc55e..7efb039 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp @@ -18,7 +18,7 @@ # include #endif -namespace XmlRpc { +namespace YarpXmlRpc { static const char VALUE_TAG[] = ""; @@ -618,11 +618,11 @@ namespace XmlRpc { return os; } -} // namespace XmlRpc +} // namespace YarpXmlRpc // ostream -std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v) +std::ostream& operator<<(std::ostream& os, YarpXmlRpc::XmlRpcValue& v) { // If you want to output in xml format: //return os << v.toXml(); diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h index b68fbdb..fae12c2 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h @@ -18,7 +18,7 @@ # include #endif -namespace XmlRpc { +namespace YarpXmlRpc { //! RPC method arguments and results are represented by Values // should probably refcount them... @@ -184,10 +184,10 @@ namespace XmlRpc { } _value; }; -} // namespace XmlRpc +} // namespace YarpXmlRpc -std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v); +std::ostream& operator<<(std::ostream& os, YarpXmlRpc::XmlRpcValue& v); #endif // _XMLRPCVALUE_H_ From 4078b0409e4d3567ad02cf2925c76f12a6c417dc Mon Sep 17 00:00:00 2001 From: Lorenzo Natale Date: Sat, 3 May 2014 14:54:13 +0200 Subject: [PATCH 070/187] portable example with ros msg --- example/idl/rosPortable/CMakeLists.txt | 18 ++++++++++ example/idl/rosPortable/SharedData.msg | 3 ++ example/idl/rosPortable/receiver.cpp | 38 +++++++++++++++++++++ example/idl/rosPortable/sender.cpp | 46 ++++++++++++++++++++++++++ 4 files changed, 105 insertions(+) create mode 100644 example/idl/rosPortable/CMakeLists.txt create mode 100644 example/idl/rosPortable/SharedData.msg create mode 100644 example/idl/rosPortable/receiver.cpp create mode 100644 example/idl/rosPortable/sender.cpp diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt new file mode 100644 index 0000000..6238d50 --- /dev/null +++ b/example/idl/rosPortable/CMakeLists.txt @@ -0,0 +1,18 @@ +# Copyright: (C) 2014 iCub Facility +# Authors: Lorenzo Natale +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + +cmake_minimum_required(VERSION 2.8.7) + +#find YARP +find_package(YARP REQUIRED) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${YARP_INCLUDE_DIRS}) + +add_executable(sender sender.cpp) +TARGET_LINK_LIBRARIES(sender ${YARP_LIBRARIES}) + +add_executable(receiver receiver.cpp) +TARGET_LINK_LIBRARIES(receiver ${YARP_LIBRARIES}) + + diff --git a/example/idl/rosPortable/SharedData.msg b/example/idl/rosPortable/SharedData.msg new file mode 100644 index 0000000..bde2fe2 --- /dev/null +++ b/example/idl/rosPortable/SharedData.msg @@ -0,0 +1,3 @@ +string text +float64[] content + diff --git a/example/idl/rosPortable/receiver.cpp b/example/idl/rosPortable/receiver.cpp new file mode 100644 index 0000000..3befa49 --- /dev/null +++ b/example/idl/rosPortable/receiver.cpp @@ -0,0 +1,38 @@ +/** Copyright: (C) 2014 iCub Facility +* Authors: Lorenzo Natale +* CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +*/ + +#include +#include +#include +#include + +using namespace std; + +int main() +{ + yarp::os::Network network; + + cout<<"Starting receiver\n"; + + yarp::os::Port port; + if (!port.open("/receiver")) + { + cerr<<"Error opening port, check your yarp network\n"; + return -1; + } + + while(true) + { + SharedData d; + port.read(d); + + //access d + cout << "Received SharedData:\n"; + cout << d.text << "\n"; + } + + return 0; +} + diff --git a/example/idl/rosPortable/sender.cpp b/example/idl/rosPortable/sender.cpp new file mode 100644 index 0000000..b4c99eb --- /dev/null +++ b/example/idl/rosPortable/sender.cpp @@ -0,0 +1,46 @@ +/** Copyright: (C) 2014 iCub Facility +* Authors: Lorenzo Natale +* CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +*/ + +#include "SharedData.h" +#include +#include +#include +#include + +using namespace std; + +int main() +{ + yarp::os::Network network; + + yarp::os::Port port; + + if (!port.open("/sender")) + { + cerr<<"Error opening port, check your yarp network\n"; + return -1; + } + + cout<<"Starting sender\n"; + + while(true) + { + SharedData d; + + // d.text is a string + d.text="Hello from sender"; + + //d.content is a vector, let's push some data + d.content.push_back(0.0); + d.content.push_back(0.0); + + port.write(d); + + yarp::os::Time::delay(0.1); + } + + return 0; +} + From 6c3d9cae3058f4a1d33e0f850a1e9a89bd469e65 Mon Sep 17 00:00:00 2001 From: Lorenzo Natale Date: Sun, 4 May 2014 23:07:48 +0200 Subject: [PATCH 071/187] tutorials + code improvements --- example/idl/rosPortable/receiver.cpp | 13 +++++++++++-- example/idl/rosPortable/sender.cpp | 8 ++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/example/idl/rosPortable/receiver.cpp b/example/idl/rosPortable/receiver.cpp index 3befa49..cabc9e3 100644 --- a/example/idl/rosPortable/receiver.cpp +++ b/example/idl/rosPortable/receiver.cpp @@ -23,14 +23,23 @@ int main() return -1; } + network.connect("/sender", "/receiver"); + + int count=0; while(true) { SharedData d; port.read(d); //access d - cout << "Received SharedData:\n"; - cout << d.text << "\n"; + cout << count << " Received SharedData:\n"; + cout << d.text << "\n"; + for (int i=0; i Date: Tue, 8 Jul 2014 18:42:25 +0200 Subject: [PATCH 072/187] [ros] show use of Publisher/Subscriber helper classes closes #195 --- example/idl/rosPortable/CMakeLists.txt | 14 +++++++- example/idl/rosPortable/receiver2.cpp | 49 ++++++++++++++++++++++++++ example/idl/rosPortable/sender2.cpp | 48 +++++++++++++++++++++++++ 3 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 example/idl/rosPortable/receiver2.cpp create mode 100644 example/idl/rosPortable/sender2.cpp diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index 6238d50..f9d334d 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -4,15 +4,27 @@ cmake_minimum_required(VERSION 2.8.7) -#find YARP find_package(YARP REQUIRED) +list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH}) +set(ALLOW_IDL_GENERATION TRUE) +include(YarpIDL) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${YARP_INCLUDE_DIRS}) +set(generated_libs_dir ${CMAKE_CURRENT_BINARY_DIR}) +yarp_idl_to_dir(SharedData.msg ${generated_libs_dir}) +include_directories(${generated_libs_dir}/include ${YARP_INCLUDE_DIRS}) + add_executable(sender sender.cpp) TARGET_LINK_LIBRARIES(sender ${YARP_LIBRARIES}) add_executable(receiver receiver.cpp) TARGET_LINK_LIBRARIES(receiver ${YARP_LIBRARIES}) +add_executable(sender2 sender2.cpp) +TARGET_LINK_LIBRARIES(sender2 ${YARP_LIBRARIES}) + +add_executable(receiver2 receiver2.cpp) +TARGET_LINK_LIBRARIES(receiver2 ${YARP_LIBRARIES}) + diff --git a/example/idl/rosPortable/receiver2.cpp b/example/idl/rosPortable/receiver2.cpp new file mode 100644 index 0000000..ff31b90 --- /dev/null +++ b/example/idl/rosPortable/receiver2.cpp @@ -0,0 +1,49 @@ +/** Copyright: (C) 2014 iCub Facility +* Authors: Lorenzo Natale +* CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +*/ + +#include +#include +#include +#include +#include + +using namespace std; + +int main() +{ + yarp::os::Network network; + + cout<<"Starting receiver\n"; + + yarp::os::Node node("/receiver/node"); // added a Node + yarp::os::Subscriber port; // changed Port to Subscriber + if (!port.topic("/data")) // replaced open() with topic() + { + cerr<<"Error opening port, check your yarp network\n"; + return -1; + } + + // network.connect("/sender", "/receiver"); // don't need this anymore + + int count=0; + while(true) + { + SharedData d; + port.read(d); + + //access d + cout << count << " Received SharedData:\n"; + cout << d.text << "\n"; + for (int i=0; i +#include +#include +#include +#include + +using namespace std; + +int main() +{ + yarp::os::Network network; + + yarp::os::Node node("/sender/node"); // added a Node + yarp::os::Publisher port; // changed Port to Publisher + + if (!port.topic("/data")) // replaced open() with topic() + { + cerr<<"Error opening port, check your yarp network\n"; + return -1; + } + + cout<<"Starting sender\n"; + double count=0.0; + while(true) + { + SharedData d; + + // d.text is a string + d.text="Hello from sender"; + + //d.content is a vector, let's push some data + d.content.push_back(count++); + d.content.push_back(count++); + + port.write(d); + + yarp::os::Time::delay(0.1); + } + + return 0; +} + From df93c4d228f9bad5cb85db5623c0bed20fc8ba0e Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 26 Aug 2014 17:55:17 +0200 Subject: [PATCH 073/187] [ros] remove stray Makefile --- example/yarpros_examples/Makefile | 456 ------------------------------ 1 file changed, 456 deletions(-) delete mode 100644 example/yarpros_examples/Makefile diff --git a/example/yarpros_examples/Makefile b/example/yarpros_examples/Makefile deleted file mode 100644 index c47785e..0000000 --- a/example/yarpros_examples/Makefile +++ /dev/null @@ -1,456 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.8 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canoncical targets will work. -.SUFFIXES: - -# Remove some rules from gmake that .SUFFIXES does not remove. -SUFFIXES = - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /usr/bin/cmake - -# The command to remove a file. -RM = /usr/bin/cmake -E remove -f - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/bin/ccmake - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/paulfitz/cvs/yarp2/example/yarpros_examples - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/paulfitz/cvs/yarp2/example/yarpros_examples - -#============================================================================= -# Targets provided globally by CMake. - -# Special rule for the target edit_cache -edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : edit_cache - -# Special rule for the target edit_cache -edit_cache/fast: edit_cache -.PHONY : edit_cache/fast - -# Special rule for the target rebuild_cache -rebuild_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) -.PHONY : rebuild_cache - -# Special rule for the target rebuild_cache -rebuild_cache/fast: rebuild_cache -.PHONY : rebuild_cache/fast - -# The main all target -all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/paulfitz/cvs/yarp2/example/yarpros_examples/CMakeFiles /home/paulfitz/cvs/yarp2/example/yarpros_examples/CMakeFiles/progress.marks - $(MAKE) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /home/paulfitz/cvs/yarp2/example/yarpros_examples/CMakeFiles 0 -.PHONY : all - -# The main clean target -clean: - $(MAKE) -f CMakeFiles/Makefile2 clean -.PHONY : clean - -# The main clean target -clean/fast: clean -.PHONY : clean/fast - -# Prepare targets for installation. -preinstall: all - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall - -# Prepare targets for installation. -preinstall/fast: - $(MAKE) -f CMakeFiles/Makefile2 preinstall -.PHONY : preinstall/fast - -# clear depends -depend: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 -.PHONY : depend - -#============================================================================= -# Target rules for targets named ROSBUILD_genmsg_cpp - -# Build rule for target. -ROSBUILD_genmsg_cpp: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_genmsg_cpp -.PHONY : ROSBUILD_genmsg_cpp - -# fast build rule for target. -ROSBUILD_genmsg_cpp/fast: - $(MAKE) -f CMakeFiles/ROSBUILD_genmsg_cpp.dir/build.make CMakeFiles/ROSBUILD_genmsg_cpp.dir/build -.PHONY : ROSBUILD_genmsg_cpp/fast - -#============================================================================= -# Target rules for targets named ROSBUILD_genmsg_lisp - -# Build rule for target. -ROSBUILD_genmsg_lisp: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_genmsg_lisp -.PHONY : ROSBUILD_genmsg_lisp - -# fast build rule for target. -ROSBUILD_genmsg_lisp/fast: - $(MAKE) -f CMakeFiles/ROSBUILD_genmsg_lisp.dir/build.make CMakeFiles/ROSBUILD_genmsg_lisp.dir/build -.PHONY : ROSBUILD_genmsg_lisp/fast - -#============================================================================= -# Target rules for targets named ROSBUILD_genmsg_py - -# Build rule for target. -ROSBUILD_genmsg_py: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_genmsg_py -.PHONY : ROSBUILD_genmsg_py - -# fast build rule for target. -ROSBUILD_genmsg_py/fast: - $(MAKE) -f CMakeFiles/ROSBUILD_genmsg_py.dir/build.make CMakeFiles/ROSBUILD_genmsg_py.dir/build -.PHONY : ROSBUILD_genmsg_py/fast - -#============================================================================= -# Target rules for targets named ROSBUILD_gensrv_cpp - -# Build rule for target. -ROSBUILD_gensrv_cpp: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_gensrv_cpp -.PHONY : ROSBUILD_gensrv_cpp - -# fast build rule for target. -ROSBUILD_gensrv_cpp/fast: - $(MAKE) -f CMakeFiles/ROSBUILD_gensrv_cpp.dir/build.make CMakeFiles/ROSBUILD_gensrv_cpp.dir/build -.PHONY : ROSBUILD_gensrv_cpp/fast - -#============================================================================= -# Target rules for targets named ROSBUILD_gensrv_lisp - -# Build rule for target. -ROSBUILD_gensrv_lisp: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 ROSBUILD_gensrv_lisp -.PHONY : ROSBUILD_gensrv_lisp - -# fast build rule for target. -ROSBUILD_gensrv_lisp/fast: - $(MAKE) -f CMakeFiles/ROSBUILD_gensrv_lisp.dir/build.make CMakeFiles/ROSBUILD_gensrv_lisp.dir/build -.PHONY : ROSBUILD_gensrv_lisp/fast - -#============================================================================= -# Target rules for targets named clean-test-results - -# Build rule for target. -clean-test-results: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 clean-test-results -.PHONY : clean-test-results - -# fast build rule for target. -clean-test-results/fast: - $(MAKE) -f CMakeFiles/clean-test-results.dir/build.make CMakeFiles/clean-test-results.dir/build -.PHONY : clean-test-results/fast - -#============================================================================= -# Target rules for targets named grab_enc - -# Build rule for target. -grab_enc: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 grab_enc -.PHONY : grab_enc - -# fast build rule for target. -grab_enc/fast: - $(MAKE) -f CMakeFiles/grab_enc.dir/build.make CMakeFiles/grab_enc.dir/build -.PHONY : grab_enc/fast - -#============================================================================= -# Target rules for targets named grab_image - -# Build rule for target. -grab_image: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 grab_image -.PHONY : grab_image - -# fast build rule for target. -grab_image/fast: - $(MAKE) -f CMakeFiles/grab_image.dir/build.make CMakeFiles/grab_image.dir/build -.PHONY : grab_image/fast - -#============================================================================= -# Target rules for targets named rosbuild_precompile - -# Build rule for target. -rosbuild_precompile: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 rosbuild_precompile -.PHONY : rosbuild_precompile - -# fast build rule for target. -rosbuild_precompile/fast: - $(MAKE) -f CMakeFiles/rosbuild_precompile.dir/build.make CMakeFiles/rosbuild_precompile.dir/build -.PHONY : rosbuild_precompile/fast - -#============================================================================= -# Target rules for targets named rosbuild_premsgsrvgen - -# Build rule for target. -rosbuild_premsgsrvgen: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 rosbuild_premsgsrvgen -.PHONY : rosbuild_premsgsrvgen - -# fast build rule for target. -rosbuild_premsgsrvgen/fast: - $(MAKE) -f CMakeFiles/rosbuild_premsgsrvgen.dir/build.make CMakeFiles/rosbuild_premsgsrvgen.dir/build -.PHONY : rosbuild_premsgsrvgen/fast - -#============================================================================= -# Target rules for targets named rospack_genmsg - -# Build rule for target. -rospack_genmsg: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 rospack_genmsg -.PHONY : rospack_genmsg - -# fast build rule for target. -rospack_genmsg/fast: - $(MAKE) -f CMakeFiles/rospack_genmsg.dir/build.make CMakeFiles/rospack_genmsg.dir/build -.PHONY : rospack_genmsg/fast - -#============================================================================= -# Target rules for targets named rospack_genmsg_all - -# Build rule for target. -rospack_genmsg_all: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 rospack_genmsg_all -.PHONY : rospack_genmsg_all - -# fast build rule for target. -rospack_genmsg_all/fast: - $(MAKE) -f CMakeFiles/rospack_genmsg_all.dir/build.make CMakeFiles/rospack_genmsg_all.dir/build -.PHONY : rospack_genmsg_all/fast - -#============================================================================= -# Target rules for targets named rospack_genmsg_libexe - -# Build rule for target. -rospack_genmsg_libexe: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 rospack_genmsg_libexe -.PHONY : rospack_genmsg_libexe - -# fast build rule for target. -rospack_genmsg_libexe/fast: - $(MAKE) -f CMakeFiles/rospack_genmsg_libexe.dir/build.make CMakeFiles/rospack_genmsg_libexe.dir/build -.PHONY : rospack_genmsg_libexe/fast - -#============================================================================= -# Target rules for targets named rospack_gensrv - -# Build rule for target. -rospack_gensrv: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 rospack_gensrv -.PHONY : rospack_gensrv - -# fast build rule for target. -rospack_gensrv/fast: - $(MAKE) -f CMakeFiles/rospack_gensrv.dir/build.make CMakeFiles/rospack_gensrv.dir/build -.PHONY : rospack_gensrv/fast - -#============================================================================= -# Target rules for targets named test - -# Build rule for target. -test: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 test -.PHONY : test - -# fast build rule for target. -test/fast: - $(MAKE) -f CMakeFiles/test.dir/build.make CMakeFiles/test.dir/build -.PHONY : test/fast - -#============================================================================= -# Target rules for targets named test-future - -# Build rule for target. -test-future: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 test-future -.PHONY : test-future - -# fast build rule for target. -test-future/fast: - $(MAKE) -f CMakeFiles/test-future.dir/build.make CMakeFiles/test-future.dir/build -.PHONY : test-future/fast - -#============================================================================= -# Target rules for targets named test-results - -# Build rule for target. -test-results: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 test-results -.PHONY : test-results - -# fast build rule for target. -test-results/fast: - $(MAKE) -f CMakeFiles/test-results.dir/build.make CMakeFiles/test-results.dir/build -.PHONY : test-results/fast - -#============================================================================= -# Target rules for targets named test-results-run - -# Build rule for target. -test-results-run: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 test-results-run -.PHONY : test-results-run - -# fast build rule for target. -test-results-run/fast: - $(MAKE) -f CMakeFiles/test-results-run.dir/build.make CMakeFiles/test-results-run.dir/build -.PHONY : test-results-run/fast - -#============================================================================= -# Target rules for targets named tests - -# Build rule for target. -tests: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 tests -.PHONY : tests - -# fast build rule for target. -tests/fast: - $(MAKE) -f CMakeFiles/tests.dir/build.make CMakeFiles/tests.dir/build -.PHONY : tests/fast - -#============================================================================= -# Target rules for targets named waggler - -# Build rule for target. -waggler: cmake_check_build_system - $(MAKE) -f CMakeFiles/Makefile2 waggler -.PHONY : waggler - -# fast build rule for target. -waggler/fast: - $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/build -.PHONY : waggler/fast - -# target to build an object file -src/grab_encoders.o: - $(MAKE) -f CMakeFiles/grab_enc.dir/build.make CMakeFiles/grab_enc.dir/src/grab_encoders.o -.PHONY : src/grab_encoders.o - -# target to preprocess a source file -src/grab_encoders.i: - $(MAKE) -f CMakeFiles/grab_enc.dir/build.make CMakeFiles/grab_enc.dir/src/grab_encoders.i -.PHONY : src/grab_encoders.i - -# target to generate assembly for a file -src/grab_encoders.s: - $(MAKE) -f CMakeFiles/grab_enc.dir/build.make CMakeFiles/grab_enc.dir/src/grab_encoders.s -.PHONY : src/grab_encoders.s - -# target to build an object file -src/grab_image.o: - $(MAKE) -f CMakeFiles/grab_image.dir/build.make CMakeFiles/grab_image.dir/src/grab_image.o -.PHONY : src/grab_image.o - -# target to preprocess a source file -src/grab_image.i: - $(MAKE) -f CMakeFiles/grab_image.dir/build.make CMakeFiles/grab_image.dir/src/grab_image.i -.PHONY : src/grab_image.i - -# target to generate assembly for a file -src/grab_image.s: - $(MAKE) -f CMakeFiles/grab_image.dir/build.make CMakeFiles/grab_image.dir/src/grab_image.s -.PHONY : src/grab_image.s - -# target to build an object file -src/waggler.o: - $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/src/waggler.o -.PHONY : src/waggler.o - -# target to preprocess a source file -src/waggler.i: - $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/src/waggler.i -.PHONY : src/waggler.i - -# target to generate assembly for a file -src/waggler.s: - $(MAKE) -f CMakeFiles/waggler.dir/build.make CMakeFiles/waggler.dir/src/waggler.s -.PHONY : src/waggler.s - -# Help Target -help: - @echo "The following are some of the valid targets for this Makefile:" - @echo "... all (the default if no target is provided)" - @echo "... clean" - @echo "... depend" - @echo "... ROSBUILD_genmsg_cpp" - @echo "... ROSBUILD_genmsg_lisp" - @echo "... ROSBUILD_genmsg_py" - @echo "... ROSBUILD_gensrv_cpp" - @echo "... ROSBUILD_gensrv_lisp" - @echo "... clean-test-results" - @echo "... edit_cache" - @echo "... grab_enc" - @echo "... grab_image" - @echo "... rebuild_cache" - @echo "... rosbuild_precompile" - @echo "... rosbuild_premsgsrvgen" - @echo "... rospack_genmsg" - @echo "... rospack_genmsg_all" - @echo "... rospack_genmsg_libexe" - @echo "... rospack_gensrv" - @echo "... test" - @echo "... test-future" - @echo "... test-results" - @echo "... test-results-run" - @echo "... tests" - @echo "... waggler" - @echo "... src/grab_encoders.o" - @echo "... src/grab_encoders.i" - @echo "... src/grab_encoders.s" - @echo "... src/grab_image.o" - @echo "... src/grab_image.i" - @echo "... src/grab_image.s" - @echo "... src/waggler.o" - @echo "... src/waggler.i" - @echo "... src/waggler.s" -.PHONY : help - - - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - From 6848ed7e5df9f7ea17c8165d1536f46c2ffeba07 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 26 Aug 2014 11:22:57 +0200 Subject: [PATCH 074/187] Bump dependency on CMake 2.8.9 --- example/idl/rosPortable/CMakeLists.txt | 2 +- example/ros/CMakeLists.txt | 2 +- example/yarpros_examples/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index f9d334d..ee604c8 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -2,7 +2,7 @@ # Authors: Lorenzo Natale # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.9) find_package(YARP REQUIRED) list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH}) diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index 6debfc5..c3a3270 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -2,7 +2,7 @@ # Authors: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.9) find_package(YARP REQUIRED) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 839cdc1..46f7052 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -4,7 +4,7 @@ # Author: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -cmake_minimum_required(VERSION 2.8.7) +cmake_minimum_required(VERSION 2.8.9) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) # Set the build type. Options are: From e486312f15888e6822a55a551d6c3a15122f0881 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Tue, 16 Dec 2014 06:47:47 +0100 Subject: [PATCH 075/187] [ros] add service example using generated code --- example/ros/CMakeLists.txt | 8 +++++ example/ros/add_int_client_v1b.cpp | 44 ++++++++++++++++++++++++++++ example/ros/add_int_server_v1.cpp | 2 +- example/ros/add_int_server_v1b.cpp | 39 ++++++++++++++++++++++++ example/ros/yarp_test/AddTwoInts.srv | 4 +++ 5 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 example/ros/add_int_client_v1b.cpp create mode 100644 example/ros/add_int_server_v1b.cpp create mode 100644 example/ros/yarp_test/AddTwoInts.srv diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index c3a3270..513b9f3 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -26,3 +26,11 @@ target_link_libraries(listener_v1 ${YARP_LIBRARIES}) add_executable(listener_v2 listener_v2.cpp) target_link_libraries(listener_v2 ${YARP_LIBRARIES}) +yarp_idl_to_dir(yarp_test/AddTwoInts.srv ${CMAKE_BINARY_DIR}/msg SOURCES HEADERS INCLUDES) +include_directories(${INCLUDES}) + +add_executable(add_int_server_v1b add_int_server_v1b.cpp ${SOURCES} ${HEADERS}) +target_link_libraries(add_int_server_v1b ${YARP_LIBRARIES}) + +add_executable(add_int_client_v1b add_int_client_v1b.cpp ${SOURCES} ${HEADERS}) +target_link_libraries(add_int_client_v1b ${YARP_LIBRARIES}) diff --git a/example/ros/add_int_client_v1b.cpp b/example/ros/add_int_client_v1b.cpp new file mode 100644 index 0000000..7713f56 --- /dev/null +++ b/example/ros/add_int_client_v1b.cpp @@ -0,0 +1,44 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +/* + * Copyright (C) 2013 iCub Facility + * Authors: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + +#include +#include +#include +#include "yarp_test/AddTwoInts.h" +#include "yarp_test/AddTwoIntsReply.h" + +using namespace yarp::os; + +int main(int argc, char *argv[]) { + if (argc!=3) { + fprintf(stderr,"Call as %s X Y\n", argv[0]); + return 1; + } + + Network yarp; + RpcClient client; + yarp_test::AddTwoInts example; + client.promiseType(example.getType()); + + if (!client.open("/add_two_ints@/yarp_add_int_client")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } + + yarp_test::AddTwoInts msg; + yarp_test::AddTwoIntsReply reply; + msg.a = atoi(argv[1]); + msg.b = atoi(argv[2]); + if (!client.write(msg,reply)) { + fprintf(stderr,"Failed to call service\n"); + return 1; + } + printf("Got %d\n", reply.sum); + + return 0; +} diff --git a/example/ros/add_int_server_v1.cpp b/example/ros/add_int_server_v1.cpp index 8987a18..60c8260 100644 --- a/example/ros/add_int_server_v1.cpp +++ b/example/ros/add_int_server_v1.cpp @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) { while (true) { Bottle msg, reply; - server.read(msg,true); + if (!server.read(msg,true)) continue; int x = msg.get(0).asInt(); int y = msg.get(1).asInt(); int sum = x + y; diff --git a/example/ros/add_int_server_v1b.cpp b/example/ros/add_int_server_v1b.cpp new file mode 100644 index 0000000..44dc6e2 --- /dev/null +++ b/example/ros/add_int_server_v1b.cpp @@ -0,0 +1,39 @@ +// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- + +/* + * Copyright (C) 2014 iCub Facility + * Authors: Paul Fitzpatrick + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + +#include +#include +#include +#include "yarp_test/AddTwoInts.h" +#include "yarp_test/AddTwoIntsReply.h" + +using namespace yarp::os; + +int main(int argc, char *argv[]) { + Network yarp; + RpcServer server; + + yarp_test::AddTwoInts example; + server.promiseType(example.getType()); + + if (!server.open("/add_two_ints@/yarp_add_int_server")) { + fprintf(stderr,"Failed to open port\n"); + return 1; + } + + while (true) { + yarp_test::AddTwoInts msg; + yarp_test::AddTwoIntsReply reply; + if (!server.read(msg,true)) continue; + reply.sum = msg.a + msg.b; + printf("Got %d + %d, answering %d\n", msg.a, msg.b, reply.sum); + server.reply(reply); + } + + return 0; +} diff --git a/example/ros/yarp_test/AddTwoInts.srv b/example/ros/yarp_test/AddTwoInts.srv new file mode 100644 index 0000000..3a68808 --- /dev/null +++ b/example/ros/yarp_test/AddTwoInts.srv @@ -0,0 +1,4 @@ +int64 a +int64 b +--- +int64 sum From 7f2c6890a7af58dd43b04691e30b32f5559550e2 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 2 Feb 2015 23:20:28 +0100 Subject: [PATCH 076/187] [ros] add rpc examples to integration tests --- example/ros/CMakeLists.txt | 2 +- example/ros/add_int_client_v1b.cpp | 6 +++--- example/ros/add_int_server_v1b.cpp | 6 +++--- example/ros/package/src/yarp_test/CMakeLists.txt | 6 ++++++ example/ros/package/src/yarp_test/package.xml | 12 ++++++++++++ .../src/yarp_test/srv}/AddTwoInts.srv | 0 6 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 example/ros/package/src/yarp_test/CMakeLists.txt create mode 100644 example/ros/package/src/yarp_test/package.xml rename example/ros/{yarp_test => package/src/yarp_test/srv}/AddTwoInts.srv (100%) diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index 513b9f3..5d158be 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -26,7 +26,7 @@ target_link_libraries(listener_v1 ${YARP_LIBRARIES}) add_executable(listener_v2 listener_v2.cpp) target_link_libraries(listener_v2 ${YARP_LIBRARIES}) -yarp_idl_to_dir(yarp_test/AddTwoInts.srv ${CMAKE_BINARY_DIR}/msg SOURCES HEADERS INCLUDES) +yarp_idl_to_dir(package/src/yarp_test/srv/AddTwoInts.srv ${CMAKE_BINARY_DIR}/msg SOURCES HEADERS INCLUDES) include_directories(${INCLUDES}) add_executable(add_int_server_v1b add_int_server_v1b.cpp ${SOURCES} ${HEADERS}) diff --git a/example/ros/add_int_client_v1b.cpp b/example/ros/add_int_client_v1b.cpp index 7713f56..9fbccae 100644 --- a/example/ros/add_int_client_v1b.cpp +++ b/example/ros/add_int_client_v1b.cpp @@ -9,8 +9,8 @@ #include #include #include -#include "yarp_test/AddTwoInts.h" -#include "yarp_test/AddTwoIntsReply.h" +#include "package/src/yarp_test/srv/AddTwoInts.h" +#include "package/src/yarp_test/srv/AddTwoIntsReply.h" using namespace yarp::os; @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) { fprintf(stderr,"Failed to call service\n"); return 1; } - printf("Got %d\n", reply.sum); + printf("Got %d\n", (int)reply.sum); return 0; } diff --git a/example/ros/add_int_server_v1b.cpp b/example/ros/add_int_server_v1b.cpp index 44dc6e2..3e0ace2 100644 --- a/example/ros/add_int_server_v1b.cpp +++ b/example/ros/add_int_server_v1b.cpp @@ -9,8 +9,8 @@ #include #include #include -#include "yarp_test/AddTwoInts.h" -#include "yarp_test/AddTwoIntsReply.h" +#include "package/src/yarp_test/srv/AddTwoInts.h" +#include "package/src/yarp_test/srv/AddTwoIntsReply.h" using namespace yarp::os; @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) { yarp_test::AddTwoIntsReply reply; if (!server.read(msg,true)) continue; reply.sum = msg.a + msg.b; - printf("Got %d + %d, answering %d\n", msg.a, msg.b, reply.sum); + printf("Got %d + %d, answering %d\n", (int)msg.a, (int)msg.b, (int)reply.sum); server.reply(reply); } diff --git a/example/ros/package/src/yarp_test/CMakeLists.txt b/example/ros/package/src/yarp_test/CMakeLists.txt new file mode 100644 index 0000000..af1ec90 --- /dev/null +++ b/example/ros/package/src/yarp_test/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 2.8) +project(yarp_test) +find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) +add_service_files(FILES AddTwoInts.srv) +generate_messages(DEPENDENCIES std_msgs) +catkin_package(CATKIN_DEPENDS message_runtime) diff --git a/example/ros/package/src/yarp_test/package.xml b/example/ros/package/src/yarp_test/package.xml new file mode 100644 index 0000000..a384053 --- /dev/null +++ b/example/ros/package/src/yarp_test/package.xml @@ -0,0 +1,12 @@ + + + yarp_test + 0.0.0 + A test yarp package - this .xml file is here for ROS only, YARP does not use it + Paul Fitzpatrick + BSD + message_generation + message_runtime + catkin + + diff --git a/example/ros/yarp_test/AddTwoInts.srv b/example/ros/package/src/yarp_test/srv/AddTwoInts.srv similarity index 100% rename from example/ros/yarp_test/AddTwoInts.srv rename to example/ros/package/src/yarp_test/srv/AddTwoInts.srv From cddf946beb506b3767cf95fe2cf9bcd04f64d0a2 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 16 Feb 2015 18:50:21 +0100 Subject: [PATCH 077/187] [CMake] Do not omit namespace when preparing carriers and devices This works only because we add "using namespace"s in generated files but we should not endorse this. --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index f633202..30c91f7 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -3,7 +3,7 @@ # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT if (COMPILE_PLUGIN_LIBRARY) - yarp_prepare_carrier(xmlrpc_carrier TYPE XmlRpcCarrier INCLUDE XmlRpcCarrier.h) + yarp_prepare_carrier(xmlrpc_carrier TYPE yarp::os::XmlRpcCarrier INCLUDE XmlRpcCarrier.h) yarp_add_carrier_fingerprint(xmlrpc.ini xmlrpc_carrier) endif (COMPILE_PLUGIN_LIBRARY) From 35002b90322c9a53eab339d0d42e38ed09e123db Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 17 Feb 2015 22:09:32 +0100 Subject: [PATCH 078/187] Fix docs and device tests Docs are no longer in the src/doc --- example/yarpros_examples/mainpage.dox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/yarpros_examples/mainpage.dox b/example/yarpros_examples/mainpage.dox index 46acd16..ed14d20 100644 --- a/example/yarpros_examples/mainpage.dox +++ b/example/yarpros_examples/mainpage.dox @@ -19,7 +19,7 @@ YARP users: For compiling: * Make sure the $YARP_ROOT/example directory is in your ROS_PACKAGE_PATH. * Do "rosmake" in the current directory. -Follow the steps in $YARP_ROOT/src/doc/yarp_with_ros.dox. +Follow the steps in $YARP_ROOT/doc/yarp_with_ros.dox. Then run waggler. Then do: \verbatim yarp read /read-#/pos From 88e9da3099392295de828a89179d2e7a1934ed29 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 18 Feb 2015 14:53:30 +0100 Subject: [PATCH 079/187] [CMake] Deprecate YARP_ADD_CARRIER_FINGERPRINT and YARP_ADD_DEVICE_FINGERPRINT Both methods puts the build tree files in the wrong directory (should use the name passed to YARP_CONFIGURE_EXTERNAL_INSTALLATION) that is correct only for YARP. The install command is performed only for YARP, moreover it is not clear from the macro name that it will copy/install the file, explicitly using YARP_INSTALL is more clear and the correct destination can be passed to external installations. Also since the installation is not performed, another INSTALL or YARP_INSTALL command is already required. iCub already uses YARP_INSTALL for these reasons. Finally, the additional arguments are useless and are just discarded and might cause confusion or be outdated, therefore there isn't any real advantage in using these macros. --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 30c91f7..689fdd5 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -4,7 +4,9 @@ if (COMPILE_PLUGIN_LIBRARY) yarp_prepare_carrier(xmlrpc_carrier TYPE yarp::os::XmlRpcCarrier INCLUDE XmlRpcCarrier.h) - yarp_add_carrier_fingerprint(xmlrpc.ini xmlrpc_carrier) + yarp_install(FILES xmlrpc.ini + COMPONENT runtime + DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}) endif (COMPILE_PLUGIN_LIBRARY) if (NOT SKIP_xmlrpc_carrier) From dc4950236f88e8fd72b879ab9f441f95bf030901 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 20 Feb 2015 14:53:35 +0100 Subject: [PATCH 080/187] [CMake] Improve plugin installation Add install dir variables for plugins and explicitly install them Handle TARGETS argument in YARP_INSTALL. Normal targets are just installed, plugins targets are fixed so that they are built and installed in the proper directory, and are not EXPORTed. Dynamic plugins are now installed in lib/${YARP_PACKAGE_NAME} instead of just in lib. This makes it easier to understand what is a library and what is a plugin. YARP plugins are no longer automatically installed by YarpPlugin.cmake but manually in the right place. --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 689fdd5..57d5961 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -26,4 +26,9 @@ if (NOT SKIP_xmlrpc_carrier) xmlrpc/XmlRpcValue.cpp) target_link_libraries(yarp_xmlrpc YARP_OS YARP_sig) target_link_libraries(yarp_xmlrpc ${ACE_LIBRARIES}) + yarp_install(TARGETS yarp_xmlrpc + EXPORT YARP + COMPONENT runtime + LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR} + ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR}) endif (NOT SKIP_xmlrpc_carrier) From 6e1af8471dd741c422481d41d006d228d19e92f5 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 27 Aug 2015 16:41:10 +0200 Subject: [PATCH 081/187] [Cleanup] --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h index fae12c2..2d4bda8 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h @@ -1,12 +1,14 @@ - -#ifndef _XMLRPCVALUE_H_ -#define _XMLRPCVALUE_H_ // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // // Summary for YARP: // Copyright: 2002, 2003 Chris Morley // CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + +#ifndef _XMLRPCVALUE_H_ +#define _XMLRPCVALUE_H_ + + #if defined(_MSC_VER) # pragma warning(disable:4786) // identifier was truncated in debug info #endif @@ -182,7 +184,7 @@ namespace YarpXmlRpc { ValueArray* asArray; ValueStruct* asStruct; } _value; - + }; } // namespace YarpXmlRpc From 41b3e728514ef5ed41cb6a251eeb20b027053191 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 8 Oct 2015 10:39:38 +0200 Subject: [PATCH 082/187] Cleanup and Fix issues with latex/pdf generation --- src/carriers/xmlrpc_carrier/xmlrpc/README.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/README.html b/src/carriers/xmlrpc_carrier/xmlrpc/README.html index fd8e7f8..b9c3c40 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/README.html +++ b/src/carriers/xmlrpc_carrier/xmlrpc/README.html @@ -5,7 +5,7 @@ - +

XmlRpc++ Library

From a081f79fec0018191b6e7ceaabd747ab6bcd6cb8 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jan 2016 17:59:15 +0100 Subject: [PATCH 083/187] Cleanup and add missing includes --- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index fb06e32..bd2797b 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -11,6 +11,7 @@ #include "XmlRpcValue.h" #include +#include using namespace yarp::os; using namespace YarpXmlRpc; From 17d7d188be4fe71941e652416f9e1c4e6283cb66 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jan 2016 17:59:31 +0100 Subject: [PATCH 084/187] Enable -Woverloaded-virtual and fix warnings --- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 88f942e..095c4cc 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -89,8 +89,10 @@ class yarp::os::XmlRpcStream : public TwoWayStream, delegate->endPacket(); } + using yarp::os::OutputStream::write; virtual void write(const Bytes& b); + using yarp::os::InputStream::read; virtual YARP_SSIZE_T read(const Bytes& b); virtual void interrupt() { From 6408ac2fc816f8276fe1baca6af3dba89655edc8 Mon Sep 17 00:00:00 2001 From: Francesco Romano Date: Wed, 6 Jan 2016 10:31:56 +0100 Subject: [PATCH 085/187] Renamed macros to avoid leading underscore --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h | 4 ++-- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h index f168b53..3447181 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h @@ -1,5 +1,5 @@ -#ifndef _XMLRPC_H_ -#define _XMLRPC_H_ +#ifndef XMLRPC_H +#define XMLRPC_H // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // This library is free software; you can redistribute it and/or diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h index b7775c2..6a473da 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h @@ -1,6 +1,6 @@ -#ifndef _XMLRPCCLIENT_H_ -#define _XMLRPCCLIENT_H_ +#ifndef XMLRPCCLIENT_H +#define XMLRPCCLIENT_H // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h index bef8ae1..662b815 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h @@ -1,6 +1,6 @@ -#ifndef _XMLRPCEXCEPTION_H_ -#define _XMLRPCEXCEPTION_H_ +#ifndef XMLRPCEXCEPTION_H +#define XMLRPCEXCEPTION_H // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // Summary for YARP: diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h index 41f2352..decfafa 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h @@ -1,6 +1,6 @@ -#ifndef _XMLRPCSERVER_H_ -#define _XMLRPCSERVER_H_ +#ifndef XMLRPCSERVER_H +#define XMLRPCSERVER_H // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h index 69916c5..3a12697 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h @@ -1,5 +1,5 @@ -#ifndef _XMLRPCSERVERCONNECTION_H_ -#define _XMLRPCSERVERCONNECTION_H_ +#ifndef XMLRPCSERVERCONNECTION_H +#define XMLRPCSERVERCONNECTION_H // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h index 5149e1b..4ef4de4 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h @@ -1,6 +1,6 @@ -#ifndef _XMLRPCSERVERMETHOD_H_ -#define _XMLRPCSERVERMETHOD_H_ +#ifndef XMLRPCSERVERMETHOD_H +#define XMLRPCSERVERMETHOD_H // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h index 4933cb5..e96d619 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h @@ -1,6 +1,6 @@ -#ifndef _XMLRPCSOURCE_H_ -#define _XMLRPCSOURCE_H_ +#ifndef XMLRPCSOURCE_H +#define XMLRPCSOURCE_H // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h index b48a681..e4f9282 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h @@ -1,5 +1,5 @@ -#ifndef _XMLRPCUTIL_H_ -#define _XMLRPCUTIL_H_ +#ifndef XMLRPCUTIL_H +#define XMLRPCUTIL_H // // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley // diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h index 2d4bda8..ca41ba8 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h @@ -5,8 +5,8 @@ // Copyright: 2002, 2003 Chris Morley // CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -#ifndef _XMLRPCVALUE_H_ -#define _XMLRPCVALUE_H_ +#ifndef XMLRPCVALUE_H +#define XMLRPCVALUE_H #if defined(_MSC_VER) From 594a127aab911a4f762d8c65528d971c6b012ccf Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 26 Feb 2016 10:22:41 +0100 Subject: [PATCH 086/187] Cleanup, remove emacs modelines --- example/ros/add_int_client_v1.cpp | 2 -- example/ros/add_int_client_v1b.cpp | 2 -- example/ros/add_int_client_v2.cpp | 2 -- example/ros/add_int_server_v1.cpp | 2 -- example/ros/add_int_server_v1b.cpp | 2 -- example/ros/listener_v1.cpp | 2 -- example/ros/listener_v2.cpp | 2 -- example/ros/talker.cpp | 2 -- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 2 -- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 -- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 2 -- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 2 -- 12 files changed, 24 deletions(-) diff --git a/example/ros/add_int_client_v1.cpp b/example/ros/add_int_client_v1.cpp index a6aed83..6d00835 100644 --- a/example/ros/add_int_client_v1.cpp +++ b/example/ros/add_int_client_v1.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2013 iCub Facility * Authors: Paul Fitzpatrick diff --git a/example/ros/add_int_client_v1b.cpp b/example/ros/add_int_client_v1b.cpp index 9fbccae..14b6ebf 100644 --- a/example/ros/add_int_client_v1b.cpp +++ b/example/ros/add_int_client_v1b.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2013 iCub Facility * Authors: Paul Fitzpatrick diff --git a/example/ros/add_int_client_v2.cpp b/example/ros/add_int_client_v2.cpp index abe8c99..d4459fc 100644 --- a/example/ros/add_int_client_v2.cpp +++ b/example/ros/add_int_client_v2.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2013 iCub Facility * Authors: Paul Fitzpatrick diff --git a/example/ros/add_int_server_v1.cpp b/example/ros/add_int_server_v1.cpp index 60c8260..66e7947 100644 --- a/example/ros/add_int_server_v1.cpp +++ b/example/ros/add_int_server_v1.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2013 iCub Facility * Authors: Paul Fitzpatrick diff --git a/example/ros/add_int_server_v1b.cpp b/example/ros/add_int_server_v1b.cpp index 3e0ace2..ac9b8cd 100644 --- a/example/ros/add_int_server_v1b.cpp +++ b/example/ros/add_int_server_v1b.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2014 iCub Facility * Authors: Paul Fitzpatrick diff --git a/example/ros/listener_v1.cpp b/example/ros/listener_v1.cpp index 2f17a8c..3dee5cc 100644 --- a/example/ros/listener_v1.cpp +++ b/example/ros/listener_v1.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2013 iCub Facility * Authors: Paul Fitzpatrick diff --git a/example/ros/listener_v2.cpp b/example/ros/listener_v2.cpp index d6bad89..9aa8851 100644 --- a/example/ros/listener_v2.cpp +++ b/example/ros/listener_v2.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2013 iCub Facility * Authors: Paul Fitzpatrick diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp index b3a3321..671c87b 100644 --- a/example/ros/talker.cpp +++ b/example/ros/talker.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2013 iCub Facility * Authors: Paul Fitzpatrick diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 2b4e73a..e6a800d 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2010 RobotCub Consortium * Authors: Paul Fitzpatrick diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index b0de9aa..c17a032 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2010 RobotCub Consortium * Authors: Paul Fitzpatrick diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index bd2797b..a2a3c04 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2010 RobotCub Consortium * Authors: Paul Fitzpatrick diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 095c4cc..0bd8215 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -1,5 +1,3 @@ -// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- - /* * Copyright (C) 2010 RobotCub Consortium * Authors: Paul Fitzpatrick From 9d001afeb0d72ca6069de4179a594bea97938d02 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 8 Mar 2016 13:38:28 +0100 Subject: [PATCH 087/187] Require CMake 2.8.9 everywhere --- example/ros/package/src/yarp_test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/ros/package/src/yarp_test/CMakeLists.txt b/example/ros/package/src/yarp_test/CMakeLists.txt index af1ec90..9ad9180 100644 --- a/example/ros/package/src/yarp_test/CMakeLists.txt +++ b/example/ros/package/src/yarp_test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.9) project(yarp_test) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) add_service_files(FILES AddTwoInts.srv) From 3d8930548d6be893b044d8bad9dd00a02da55039 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 9 Mar 2016 09:38:03 +0100 Subject: [PATCH 088/187] Fix a few warnings * -Wnewline-eof * -Wnull-conversion * -Wtautological-undefined-compare * -Wreturn-type * -Wc++98-compat-pedantic * -Wunused-private-field * -Wunused-variable * -Wsequence-point * -Wunused-variable * -Wunused-but-set-variable * -Wformat-nonliteral --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 57d5961..997d37f 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -14,6 +14,12 @@ if (NOT SKIP_xmlrpc_carrier) include_directories(${YARP_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc) + + check_cxx_compiler_flag("-Wformat-nonliteral" CXX_HAS_WFORMAT_NONLITERAL) + if(CXX_HAS_WFORMAT_NONLITERAL) + set_source_files_properties(xmlrpc/XmlRpcValue.cpp PROPERTIES COMPILE_FLAGS "-Wno-format-nonliteral") + endif() + yarp_add_plugin(yarp_xmlrpc XmlRpcCarrier.h XmlRpcCarrier.cpp XmlRpcStream.h XmlRpcStream.cpp From 518d7e9294c439ae249926152a6370294561cb64 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 10 Mar 2016 18:45:05 +0100 Subject: [PATCH 089/187] Fix build when YARP_NO_DEPRECATED is enabled --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index e6a800d..d15c274 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -6,12 +6,15 @@ */ #include "XmlRpcCarrier.h" + +#include "XmlRpc.h" + #include #include #include #include -#include "XmlRpc.h" +#include using namespace yarp::os; using namespace YarpXmlRpc; From 21ed20e690ce53d3a3f81a552db8d0e9231c80b2 Mon Sep 17 00:00:00 2001 From: Lorenzo Natale Date: Thu, 26 May 2016 09:01:56 +0200 Subject: [PATCH 090/187] yarp ros documentation revised (#769) --- example/ros/CMakeLists.txt | 17 ++++++++++++-- example/ros/README.txt | 6 +++++ example/ros/listener.cpp | 38 ++++++++++++++++++++++++++++++++ example/ros/talker.cpp | 45 ++++++++++++++++++++++++-------------- 4 files changed, 87 insertions(+), 19 deletions(-) create mode 100644 example/ros/listener.cpp diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index 5d158be..3a8f9c1 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -26,11 +26,24 @@ target_link_libraries(listener_v1 ${YARP_LIBRARIES}) add_executable(listener_v2 listener_v2.cpp) target_link_libraries(listener_v2 ${YARP_LIBRARIES}) +if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/String.h") + message(STATUS "File String. not found, please generate it by running: yarpidl_rosmsg String") + message(STATUS "Skipping compilation of talker and listener") + + add_executable(listener listener.cpp) + target_link_libraries(listener ${YARP_LIBRARIES}) + + add_executable(talker talker.cpp) + target_link_libraries(talker ${YARP_LIBRARIES}) +endif() + yarp_idl_to_dir(package/src/yarp_test/srv/AddTwoInts.srv ${CMAKE_BINARY_DIR}/msg SOURCES HEADERS INCLUDES) + include_directories(${INCLUDES}) add_executable(add_int_server_v1b add_int_server_v1b.cpp ${SOURCES} ${HEADERS}) -target_link_libraries(add_int_server_v1b ${YARP_LIBRARIES}) +target_link_libraries(add_int_server_v1b ${YARP_LIBRARIES}) add_executable(add_int_client_v1b add_int_client_v1b.cpp ${SOURCES} ${HEADERS}) -target_link_libraries(add_int_client_v1b ${YARP_LIBRARIES}) + +target_link_libraries(add_int_client_v1b ${YARP_LIBRARIES}) \ No newline at end of file diff --git a/example/ros/README.txt b/example/ros/README.txt index 3344ef9..3854ab0 100644 --- a/example/ros/README.txt +++ b/example/ros/README.txt @@ -3,3 +3,9 @@ Before trying these examples, make sure you read: http://wiki.icub.org/wiki/YARP_ROS_Interoperation There are prerequisites. + +Make sure you run: + +$ yarpidl_rosmsg String + +to generate String.h (required to compile listener.cpp talker.cpp) diff --git a/example/ros/listener.cpp b/example/ros/listener.cpp new file mode 100644 index 0000000..85a5b6e --- /dev/null +++ b/example/ros/listener.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2016 iCub Facility + * Authors: Lorenzo Natale + * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + */ + +#include +#include + +using namespace yarp::os; +using namespace std; + +/* Make sure you run yarpidl_rosmsg std_msg/String */ +/* to generate String.h */ +#include "String.h" + +int main(int argc, char *argv[]) { + Network yarp; + + /* creates a node called /yarp/listener */ + Node node("/yarp/listener"); + + /* subscribe to topic chatter */ + yarp::os::Subscriber subscriber; + if (!subscriber.topic("/chatter")) { + cerr<< "Failed to subscriber to /chatter\n"; + return -1; + } + + /* read data from the topic */ + while (true) { + String data; + subscriber.read(data); + cout << "Received:" << data.data << " " << endl; + } + + return 0; +} diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp index 671c87b..dbaef8b 100644 --- a/example/ros/talker.cpp +++ b/example/ros/talker.cpp @@ -1,32 +1,43 @@ /* - * Copyright (C) 2013 iCub Facility - * Authors: Paul Fitzpatrick + * Copyright (C) 2016 iCub Facility + * Authors: Lorenzo Natale * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ -#include +#include #include using namespace yarp::os; +using namespace std; + +/* Make sure you run yarpidl_rosmsg std_msg/String */ +/* to generate String.h */ +#include "String.h" int main(int argc, char *argv[]) { Network yarp; - Port port; - port.setWriteOnly(); - if (!port.open("/chatter@/yarp/talker")) { - fprintf(stderr,"Failed to open port\n"); - return 1; + + /* creates a node called /yarp/talker */ + Node node("/yarp/talker"); + + /* subscribe to topic chatter */ + yarp::os::Publisher publisher; + if (!publisher.topic("/chatter")) { + cerr<< "Failed to create publisher to /chatter\n"; + return -1; } - for (int i=0; i<1000; i++) { - char buf[256]; - sprintf(buf,"hello ros %d", i); - Bottle msg; - msg.addString(buf); - port.write(msg); - printf("Wrote: [%s]\n", buf); - Time::delay(1); - } + while (true) { + /* prepare some data */ + String data; + data.data="Hello from YARP"; + /* publish it to the topic */ + publisher.write(data); + + /* wait some time to avoid flooding with messages */ + Time::delay(0.1); + } + return 0; } From 69abbca7a7c216385dece7f72fe01e23d2598a7f Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 17 Aug 2016 14:32:34 +0200 Subject: [PATCH 091/187] Cleanup --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 997d37f..e332802 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -2,18 +2,20 @@ # Authors: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -if (COMPILE_PLUGIN_LIBRARY) - yarp_prepare_carrier(xmlrpc_carrier TYPE yarp::os::XmlRpcCarrier INCLUDE XmlRpcCarrier.h) +if(COMPILE_PLUGIN_LIBRARY) + yarp_prepare_carrier(xmlrpc_carrier + TYPE yarp::os::XmlRpcCarrier + INCLUDE XmlRpcCarrier.h) yarp_install(FILES xmlrpc.ini COMPONENT runtime DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}) -endif (COMPILE_PLUGIN_LIBRARY) +endif() -if (NOT SKIP_xmlrpc_carrier) - find_package(YARP REQUIRED) - include_directories(${YARP_INCLUDE_DIRS}) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +if(NOT SKIP_xmlrpc_carrier) + set(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc) + get_property(YARP_OS_INCLUDE_DIRS TARGET YARP_OS PROPERTY INCLUDE_DIRS) + include_directories(${YARP_OS_INCLUDE_DIRS}) check_cxx_compiler_flag("-Wformat-nonliteral" CXX_HAS_WFORMAT_NONLITERAL) if(CXX_HAS_WFORMAT_NONLITERAL) @@ -21,8 +23,10 @@ if (NOT SKIP_xmlrpc_carrier) endif() yarp_add_plugin(yarp_xmlrpc - XmlRpcCarrier.h XmlRpcCarrier.cpp - XmlRpcStream.h XmlRpcStream.cpp + XmlRpcCarrier.h + XmlRpcCarrier.cpp + XmlRpcStream.h + XmlRpcStream.cpp xmlrpc/XmlRpcClient.cpp xmlrpc/XmlRpcServer.cpp xmlrpc/XmlRpcServerConnection.cpp @@ -30,11 +34,10 @@ if (NOT SKIP_xmlrpc_carrier) xmlrpc/XmlRpcSource.cpp xmlrpc/XmlRpcUtil.cpp xmlrpc/XmlRpcValue.cpp) - target_link_libraries(yarp_xmlrpc YARP_OS YARP_sig) - target_link_libraries(yarp_xmlrpc ${ACE_LIBRARIES}) + target_link_libraries(yarp_xmlrpc YARP_OS) yarp_install(TARGETS yarp_xmlrpc EXPORT YARP COMPONENT runtime LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR} ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR}) -endif (NOT SKIP_xmlrpc_carrier) +endif() From 76d935eaf9e31495770706ac9ee6844a65f8ed99 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 16 Mar 2016 17:01:12 +0100 Subject: [PATCH 092/187] Cleanup and add missing .ini files --- src/carriers/xmlrpc_carrier/xmlrpc.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc.ini b/src/carriers/xmlrpc_carrier/xmlrpc.ini index 0c7405f..96fffae 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc.ini +++ b/src/carriers/xmlrpc_carrier/xmlrpc.ini @@ -2,5 +2,4 @@ type carrier name xmlrpc library yarp_xmlrpc -part xmlrpc_carrier code "POST /" From 68dd0e0ed3e0a23b00055381a9c86aa72e79a03e Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 31 Aug 2016 12:00:49 +0200 Subject: [PATCH 093/187] Replace yarp_prepare_carrier with yarp_prepare_plugin(CATEGORY carrier) --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index e332802..a7db9cf 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -3,9 +3,10 @@ # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT if(COMPILE_PLUGIN_LIBRARY) - yarp_prepare_carrier(xmlrpc_carrier - TYPE yarp::os::XmlRpcCarrier - INCLUDE XmlRpcCarrier.h) + yarp_prepare_plugin(xmlrpc_carrier + CATEGORY carrier + TYPE yarp::os::XmlRpcCarrier + INCLUDE XmlRpcCarrier.h) yarp_install(FILES xmlrpc.ini COMPONENT runtime DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}) From e61cc539fb3c91cd4a514e7ee8d1ac2a71a675cd Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 31 Aug 2016 18:01:18 +0200 Subject: [PATCH 094/187] Update and clean plugins --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index a7db9cf..8599c0a 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -2,15 +2,13 @@ # Authors: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -if(COMPILE_PLUGIN_LIBRARY) - yarp_prepare_plugin(xmlrpc_carrier - CATEGORY carrier - TYPE yarp::os::XmlRpcCarrier - INCLUDE XmlRpcCarrier.h) - yarp_install(FILES xmlrpc.ini - COMPONENT runtime - DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}) -endif() +yarp_prepare_plugin(xmlrpc + CATEGORY carrier + TYPE yarp::os::XmlRpcCarrier + INCLUDE XmlRpcCarrier.h + EXTRA_CONFIG CODE="POST /" + DEPENDS "CREATE_OPTIONAL_CARRIERS;YARP_HAS_ACE" + DEFAULT ON) if(NOT SKIP_xmlrpc_carrier) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -41,4 +39,7 @@ if(NOT SKIP_xmlrpc_carrier) COMPONENT runtime LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR} ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR}) + yarp_install(FILES xmlrpc.ini + COMPONENT runtime + DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}) endif() From 2bfd214e42755de3a58c797d36f462b4733a6d2a Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 5 Oct 2016 16:28:16 +0200 Subject: [PATCH 095/187] Cleanup --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 31 +++++-- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 93 ++++++++++++------- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 12 ++- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 57 ++++++++---- 4 files changed, 126 insertions(+), 67 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index d15c274..387d519 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -17,9 +17,12 @@ #include using namespace yarp::os; -using namespace YarpXmlRpc; +using YarpXmlRpc::XmlRpcValue; +using YarpXmlRpc::XmlRpcClient; +using YarpXmlRpc::XmlRpcServerConnection; -void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { +void toXmlRpcValue(Value& vin, XmlRpcValue& vout) +{ if (vin.isInt()) { vout = vin.asInt(); } else if (vin.isDouble()) { @@ -70,12 +73,14 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { } } -bool XmlRpcCarrier::expectSenderSpecifier(ConnectionState& proto) { +bool XmlRpcCarrier::expectSenderSpecifier(ConnectionState& proto) +{ proto.setRoute(proto.getRoute().addFromName("rpc")); return true; } -bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) { +bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) +{ StringOutputStream sos; StringInputStream sis; writer.write(sos); @@ -111,7 +116,7 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) { c.generateRequest(methodName.c_str(),args); req = c.getRequest(); } else { - XmlRpcServerConnection c(0,NULL); + XmlRpcServerConnection c(0, YARP_NULLPTR); c.generateResponse(args.toXml()); req = c.getResponse(); } @@ -141,12 +146,14 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) { } -bool XmlRpcCarrier::reply(ConnectionState& proto, SizedWriter& writer) { +bool XmlRpcCarrier::reply(ConnectionState& proto, SizedWriter& writer) +{ return write(proto,writer); } -bool XmlRpcCarrier::shouldInterpretRosMessages(ConnectionState& proto) { +bool XmlRpcCarrier::shouldInterpretRosMessages(ConnectionState& proto) +{ // We need to set the interpretRos flag, which controls // whether ROS-style admin messages are treated as // admin messages or data messages in YARP. @@ -180,7 +187,8 @@ bool XmlRpcCarrier::shouldInterpretRosMessages(ConnectionState& proto) { return interpretRos; } -bool XmlRpcCarrier::sendHeader(ConnectionState& proto) { +bool XmlRpcCarrier::sendHeader(ConnectionState& proto) +{ shouldInterpretRosMessages(proto); ConstString target = "POST /RPC2"; Name n(proto.getRoute().getCarrierName() + "://test"); @@ -199,13 +207,16 @@ bool XmlRpcCarrier::sendHeader(ConnectionState& proto) { } -bool XmlRpcCarrier::respondToHeader(ConnectionState& proto) { +bool XmlRpcCarrier::respondToHeader(ConnectionState& proto) +{ shouldInterpretRosMessages(proto); sender = false; XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(), sender, interpretRos); - if (stream==NULL) { return false; } + if (stream == YARP_NULLPTR) { + return false; + } proto.takeStreams(stream); return true; } diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index c17a032..903e27f 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -5,8 +5,8 @@ * */ -#ifndef XMLRPCCARRIER_INC -#define XMLRPCCARRIER_INC +#ifndef YARP_XMLRPC_CARRIER_XMLRPCCARRIER_H +#define YARP_XMLRPC_CARRIER_XMLRPCCARRIER_H #include #include "XmlRpcStream.h" @@ -39,7 +39,8 @@ namespace yarp { * will produce the output "30" if the server still exists. * */ -class yarp::os::XmlRpcCarrier : public Carrier { +class yarp::os::XmlRpcCarrier : public Carrier +{ private: bool firstRound; bool sender; @@ -47,64 +48,78 @@ class yarp::os::XmlRpcCarrier : public Carrier { ConstString http; bool interpretRos; public: - XmlRpcCarrier() { - firstRound = true; - sender = false; - interpretRos = false; + XmlRpcCarrier() : + firstRound(true), + sender(false), + interpretRos(false) + { } - virtual Carrier *create() { + virtual Carrier *create() + { return new XmlRpcCarrier(); } - virtual ConstString getName() { + virtual ConstString getName() + { return "xmlrpc"; } - virtual bool isConnectionless() { + virtual bool isConnectionless() + { return false; } - virtual bool canAccept() { + virtual bool canAccept() + { return true; } - virtual bool canOffer() { + virtual bool canOffer() + { return true; } - virtual bool isTextMode() { + virtual bool isTextMode() + { return true; } - virtual bool canEscape() { + virtual bool canEscape() + { return true; } - virtual bool requireAck() { + virtual bool requireAck() + { return false; } - virtual bool supportReply() { + virtual bool supportReply() + { return true; } - virtual bool isLocal() { + virtual bool isLocal() + { return false; } - virtual ConstString toString() { + virtual ConstString toString() + { return "xmlrpc_carrier"; } - virtual void getHeader(const Bytes& header) { + virtual void getHeader(const Bytes& header) + { const char *target = "POST /RP"; for (size_t i=0; i<8 && i using namespace yarp::os; -using namespace YarpXmlRpc; using namespace std; +using YarpXmlRpc::XmlRpcValue; - -Value toValue(XmlRpcValue& v, bool outer) { +Value toValue(XmlRpcValue& v, bool outer) +{ int t = v.getType(); switch (t) { case XmlRpcValue::TypeInt: @@ -86,7 +86,8 @@ Value toValue(XmlRpcValue& v, bool outer) { return Value("(type not supported yet out of laziness)"); } -YARP_SSIZE_T XmlRpcStream::read(const Bytes& b) { +YARP_SSIZE_T XmlRpcStream::read(const Bytes& b) +{ //printf("XMLRPC READ\n"); YARP_SSIZE_T result = sis.read(b); if (result>0) { @@ -170,6 +171,7 @@ YARP_SSIZE_T XmlRpcStream::read(const Bytes& b) { } -void XmlRpcStream::write(const Bytes& b) { +void XmlRpcStream::write(const Bytes& b) +{ delegate->getOutputStream().write(b); } diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 0bd8215..8c96b86 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -5,8 +5,8 @@ * */ -#ifndef XMLRPCSTREAM_INC -#define XMLRPCSTREAM_INC +#ifndef YARP_XMLRPC_CARRIER_XMLRPCSTREAM_H +#define YARP_XMLRPC_CARRIER_XMLRPCSTREAM_H #include #include @@ -38,52 +38,68 @@ class yarp::os::XmlRpcStream : public TwoWayStream, bool interpretRos; public: XmlRpcStream(TwoWayStream *delegate, bool sender, bool interpretRos) : - client("notset",0), - server(0,0/*NULL*/), - sender(sender), - interpretRos(interpretRos) { + client("notset", 0), + server(0, YARP_NULLPTR), + sender(sender), + interpretRos(interpretRos) + { this->delegate = delegate; client.reset(); server.reset(); firstRound = true; } - virtual ~XmlRpcStream() { - if (delegate!=NULL) { + virtual ~XmlRpcStream() + { + if (delegate != YARP_NULLPTR) { delete delegate; - delegate = NULL; + delegate = YARP_NULLPTR; } } - virtual yarp::os::InputStream& getInputStream() { return *this; } - virtual yarp::os::OutputStream& getOutputStream() { return *this; } + virtual yarp::os::InputStream& getInputStream() + { + return *this; + } + + virtual yarp::os::OutputStream& getOutputStream() + { + return *this; + } - virtual const yarp::os::Contact& getLocalAddress() { + virtual const yarp::os::Contact& getLocalAddress() + { return delegate->getLocalAddress(); } - virtual const yarp::os::Contact& getRemoteAddress() { + virtual const yarp::os::Contact& getRemoteAddress() + { return delegate->getRemoteAddress(); } - virtual bool isOk() { + virtual bool isOk() + { return delegate->isOk(); } - virtual void reset() { + virtual void reset() + { delegate->reset(); } - virtual void close() { + virtual void close() + { delegate->close(); } - virtual void beginPacket() { + virtual void beginPacket() + { delegate->beginPacket(); } - virtual void endPacket() { + virtual void endPacket() + { delegate->endPacket(); } @@ -93,10 +109,11 @@ class yarp::os::XmlRpcStream : public TwoWayStream, using yarp::os::InputStream::read; virtual YARP_SSIZE_T read(const Bytes& b); - virtual void interrupt() { + virtual void interrupt() + { delegate->getInputStream().interrupt(); } }; -#endif +#endif // YARP_XMLRPC_CARRIER_XMLRPCSTREAM_H From 25461257828c6e36fcc1ddc4a58f3b494955840b Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 11 Oct 2016 17:48:10 +0200 Subject: [PATCH 096/187] xmlrpc++: Fix tmEq() method --- src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp index 7efb039..2e176a6 100644 --- a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp +++ b/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp @@ -148,7 +148,7 @@ namespace YarpXmlRpc { // Predicate for tm equality static bool tmEq(struct tm const& t1, struct tm const& t2) { return t1.tm_sec == t2.tm_sec && t1.tm_min == t2.tm_min && - t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday && + t1.tm_hour == t2.tm_hour && t1.tm_mday == t2.tm_mday && t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year; } From 7ad98a5a6a1968af5aa47cdde4fbc019d0c4a60b Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 17 Oct 2016 11:58:19 +0200 Subject: [PATCH 097/187] XmlRpc++: Move library in the extern folder. --- extern/xmlrpcpp/CMakeLists.txt | 41 + extern/xmlrpcpp/README.txt | 82 + .../0001-Fix-EOL-and-permissions.patch | 8835 +++++++++++++++++ ...002-first-pass-at-an-xml-rpc-carrier.patch | 321 + .../patches/0003-more-LGPL-tagging.patch | 735 ++ .../patches/0004-small-windows-fixes.patch | 29 + .../0005-fix-a-few-trivial-warnings.patch | 35 + ...cpros-.msg-support-from-yarpros-bran.patch | 50 + ...y-up-windows-build-of-tcpros-carrier.patch | 36 + .../patches/0008-fix-integer-type.patch | 26 + ...d-library-needed-with-msvc-dll-build.patch | 28 + ...lrpc-code-that-is-choking-msvc-dll-b.patch | 1132 +++ extern/xmlrpcpp/patches/0011-Cleanup.patch | 61 + .../patches/0012-Documentation-tweaks.patch | 24 + ...e-XmlRpc-namespace-to-avoid-conflict.patch | 357 + extern/xmlrpcpp/patches/0014-Cleanup.patch | 43 + ...Fix-issues-with-latex-pdf-generation.patch | 25 + ...d-macros-to-avoid-leading-underscore.patch | 136 + .../patches/0017-xmlrpc-Fix-tmEq-method.patch | 25 + .../xmlrpcpp/xmlrpcpp}/COPYING | 0 .../xmlrpcpp/xmlrpcpp}/README.html | 0 extern/xmlrpcpp/xmlrpcpp/XmlRpc.sln | 73 + extern/xmlrpcpp/xmlrpcpp/XmlRpc.vcproj | 184 + extern/xmlrpcpp/xmlrpcpp/makefile | 42 + extern/xmlrpcpp/xmlrpcpp/src/Doxyfile | 1041 ++ .../xmlrpcpp/xmlrpcpp/src}/XmlRpc.h | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcClient.cpp | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcClient.h | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcException.h | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcServer.cpp | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcServer.h | 0 .../xmlrpcpp/src}/XmlRpcServerConnection.cpp | 0 .../xmlrpcpp/src}/XmlRpcServerConnection.h | 0 .../xmlrpcpp/src}/XmlRpcServerMethod.cpp | 0 .../xmlrpcpp/src}/XmlRpcServerMethod.h | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcSource.cpp | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcSource.h | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcUtil.cpp | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcUtil.h | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcValue.cpp | 0 .../xmlrpcpp/xmlrpcpp/src}/XmlRpcValue.h | 0 extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp | 108 + extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp | 96 + .../xmlrpcpp/xmlrpcpp/test/FileClient.vcproj | 164 + extern/xmlrpcpp/xmlrpcpp/test/HelloClient.cpp | 85 + extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp | 96 + .../xmlrpcpp/xmlrpcpp/test/HelloClient.vcproj | 164 + extern/xmlrpcpp/xmlrpcpp/test/HelloServer.cpp | 82 + extern/xmlrpcpp/xmlrpcpp/test/HelloServer.dsp | 96 + .../xmlrpcpp/xmlrpcpp/test/HelloServer.vcproj | 164 + extern/xmlrpcpp/xmlrpcpp/test/Makefile | 26 + .../xmlrpcpp/test/TestBase64Client.cpp | 45 + .../xmlrpcpp/test/TestBase64Client.dsp | 96 + .../xmlrpcpp/test/TestBase64Client.vcproj | 164 + .../xmlrpcpp/test/TestBase64Server.cpp | 68 + .../xmlrpcpp/test/TestBase64Server.dsp | 96 + .../xmlrpcpp/test/TestBase64Server.vcproj | 164 + extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp | 233 + extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp | 95 + .../xmlrpcpp/xmlrpcpp/test/TestValues.vcproj | 162 + .../xmlrpcpp/test/TestValuesWin32.cpp | 253 + extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp | 53 + extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp | 96 + extern/xmlrpcpp/xmlrpcpp/test/TestXml.vcproj | 164 + extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp | 207 + extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp | 95 + .../xmlrpcpp/xmlrpcpp/test/Validator.vcproj | 163 + .../xmlrpcpp/test/arrayOfStructsTest.xml | 255 + .../xmlrpcpp/test/countTheEntities.xml | 10 + .../xmlrpcpp/xmlrpcpp/test/easyStructTest.xml | 29 + extern/xmlrpcpp/xmlrpcpp/test/echo.xml | 9 + .../xmlrpcpp/xmlrpcpp/test/echoStructTest.xml | 261 + extern/xmlrpcpp/xmlrpcpp/test/pngnow.png | 1 + extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp | 183 + extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw | 149 + src/carriers/xmlrpc_carrier/CMakeLists.txt | 14 +- 76 files changed, 17497 insertions(+), 10 deletions(-) create mode 100644 extern/xmlrpcpp/CMakeLists.txt create mode 100644 extern/xmlrpcpp/README.txt create mode 100644 extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch create mode 100644 extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch create mode 100644 extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch create mode 100644 extern/xmlrpcpp/patches/0004-small-windows-fixes.patch create mode 100644 extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch create mode 100644 extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch create mode 100644 extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch create mode 100644 extern/xmlrpcpp/patches/0008-fix-integer-type.patch create mode 100644 extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch create mode 100644 extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch create mode 100644 extern/xmlrpcpp/patches/0011-Cleanup.patch create mode 100644 extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch create mode 100644 extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch create mode 100644 extern/xmlrpcpp/patches/0014-Cleanup.patch create mode 100644 extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch create mode 100644 extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch create mode 100644 extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp}/COPYING (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp}/README.html (100%) create mode 100644 extern/xmlrpcpp/xmlrpcpp/XmlRpc.sln create mode 100644 extern/xmlrpcpp/xmlrpcpp/XmlRpc.vcproj create mode 100644 extern/xmlrpcpp/xmlrpcpp/makefile create mode 100644 extern/xmlrpcpp/xmlrpcpp/src/Doxyfile rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpc.h (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcClient.cpp (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcClient.h (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcException.h (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcServer.cpp (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcServer.h (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcServerConnection.cpp (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcServerConnection.h (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcServerMethod.cpp (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcServerMethod.h (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcSource.cpp (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcSource.h (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcUtil.cpp (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcUtil.h (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcValue.cpp (100%) rename {src/carriers/xmlrpc_carrier/xmlrpc => extern/xmlrpcpp/xmlrpcpp/src}/XmlRpcValue.h (100%) create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/FileClient.vcproj create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/HelloClient.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/HelloClient.vcproj create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/HelloServer.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/HelloServer.dsp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/HelloServer.vcproj create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/Makefile create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.dsp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.vcproj create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.dsp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.vcproj create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestValues.vcproj create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestValuesWin32.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/TestXml.vcproj create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/Validator.vcproj create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/arrayOfStructsTest.xml create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/countTheEntities.xml create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/easyStructTest.xml create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/echo.xml create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/echoStructTest.xml create mode 100644 extern/xmlrpcpp/xmlrpcpp/test/pngnow.png create mode 100644 extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp create mode 100644 extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt new file mode 100644 index 0000000..cbf7164 --- /dev/null +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -0,0 +1,41 @@ +# Copyright (C) 2012 iCub Facility, Istituto Italiano di Tecnologia +# Author: Daniele E. Domenichelli +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + + +# XmlRpc++ +project(YARP_priv_xmlrpcpp) + +set(xmlrpcpp_SRCS xmlrpcpp/src/XmlRpcClient.cpp + xmlrpcpp/src/XmlRpcServerConnection.cpp + xmlrpcpp/src/XmlRpcServer.cpp + xmlrpcpp/src/XmlRpcServerMethod.cpp + xmlrpcpp/src/XmlRpcSource.cpp + xmlrpcpp/src/XmlRpcUtil.cpp + xmlrpcpp/src/XmlRpcValue.cpp) + +set(xmlrpcpp_HDRS xmlrpcpp/src/XmlRpcClient.h + xmlrpcpp/src/XmlRpcException.h + xmlrpcpp/src/XmlRpc.h + xmlrpcpp/src/XmlRpcServerConnection.h + xmlrpcpp/src/XmlRpcServer.h + xmlrpcpp/src/XmlRpcServerMethod.h + xmlrpcpp/src/XmlRpcSource.h + xmlrpcpp/src/XmlRpcUtil.h + xmlrpcpp/src/XmlRpcValue.h) + +add_library(YARP_priv_xmlrpcpp STATIC ${xmlrpcpp_SRCS}) + +set_property(TARGET YARP_priv_xmlrpcpp PROPERTY FOLDER "External Libraries") + +set(xmlrpcpp_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpcpp/src PARENT_SCOPE) +set(xmlrpcpp_LIBRARIES "YARP_priv_xmlrpcpp" PARENT_SCOPE) + +install(TARGETS YARP_priv_xmlrpcpp + EXPORT YARP + COMPONENT runtime + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + +set_property(GLOBAL APPEND PROPERTY YARP_LIBS YARP_priv_xmlrpcpp) diff --git a/extern/xmlrpcpp/README.txt b/extern/xmlrpcpp/README.txt new file mode 100644 index 0000000..554588d --- /dev/null +++ b/extern/xmlrpcpp/README.txt @@ -0,0 +1,82 @@ +XmlRpc++ + +XmlRpc++ is an implementation of the XmlRpc protocol written in C++, +based upon Shilad Sen's excellent py-xmlrpc library. It is designed to +make it easy to incorporate XmlRpc client+server support into C++ +applications and requires no other libraries. + +This version contains several modification (including a change of +namespace from XmlRpc to YarpXmlRpc and the removal of a few classes) +and a few bug fixes for YARP. + +Homepage: http://xmlrpcpp.sourceforge.net/ + https://sourceforge.net/projects/xmlrpcpp/ + +Copyright: Copyright (c) 2002-2003 Chris Morley + +License: LGPL2.1 or later + +Version: 0.7 + +Patches: + * 0001-Fix-EOL-and-permissions.patch: Fix EOL and permissions + (from commit 19a3ac4fbd725719a6dae0ee87c9536d388d427a) + + * 0002-first-pass-at-an-xml-rpc-carrier.patch: first pass at an xml/rpc + carrier + (from commit 19a3ac4fbd725719a6dae0ee87c9536d388d427a) + + * 0003-more-LGPL-tagging.patch: more LGPL tagging + (from commit b3e24151e815a3cb634d0a1c6a8815449ff9db7a) + + * 0004-small-windows-fixes.patch: small windows fixes + (from commit 9ea098942e14e08150c5736c71ebe6c58e47fdda) + + * 0005-fix-a-few-trivial-warnings.patch: fix a few trivial warnings + (from commit 2a78f5e6766785c435bf03053761760e4d944f3f) + + * 0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch: + merge improved tcpros + .msg support from yarpros branch on launchpad + (from commit 48e3b01d0a66e135f239f824033ff6c857827364) + + * 0007-tidy-up-windows-build-of-tcpros-carrier.patch: tidy up windows + build of tcpros carrier + (from commit 447f0b0d141f162b8481d05bfbbb317878761388) + + * 0008-fix-integer-type.patch: fix integer type + (from commit ae3580f308d7b30b6e04121fdcf0fd64ab52126c) + + * 0009-add-library-needed-with-msvc-dll-build.patch: add library needed + with msvc dll build + (from commit dfa12005a8b39bc8abe76cdbdea1f19d086cc836) + + * 0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch: drop + unneeded xmlrpc code that is choking msvc dll build + (from commit 57c407b67df1110c74881f32e4bf8b05e1b1cd91) + + * 0011-Cleanup.patch: [Cleanup] + (from commit c44cf5c842b7bd679155d751ae7b4d46907a58a3) + + * 0012-Documentation-tweaks.patch: Documentation tweaks + (from commit 85ca0d444c8462cd0d9da9130f82d6cfbf02f7fa) + + * 0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch: YARP is + compiled as a shared library, where the XmlRpc-related symbols are + not exposed). To support static linking, the XmlRpc namespace in + YARP is renamed to YarpXmlRpc. + See https://github.com/robotology/yarp/issues/167 + (from commit 8ecaff0464bec2b6deb1538b3cb6b6d322cc0ac4) + + * 0014-Cleanup.patch: [Cleanup] + (from commit 53ea746a7fa2d2603df46763b8cb380dcc2407ab) + + * 0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch: Cleanup + and Fix issues with latex/pdf generation + (from commit 9ddf972da49e7e258e8f0df7ef8c1a643d02f5b8) + + * 0016-Renamed-macros-to-avoid-leading-underscore.patch: Renamed macros + to avoid leading underscore + (from commit df486e58f8ec80e140e0f55e1c3833ac8ca50603) + + * 0017-xmlrpc-Fix-tmEq-method.patch: xmlrpc++: Fix tmEq() method + (from commit 95238ffbcd164594ace75baff278ac936a14484b) diff --git a/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch b/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch new file mode 100644 index 0000000..99bc45e --- /dev/null +++ b/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch @@ -0,0 +1,8835 @@ +From 19a3ac4fbd725719a6dae0ee87c9536d388d427a Mon Sep 17 00:00:00 2001 +From: "Paul Fitzpatrick" +Date: Fri May 28 03:23:50 2010 +0000 +Subject: [PATCH 01/17] Fix EOL and permissions + +--- + extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h | 250 +++++----- + extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp | 520 ++++++++++---------- + extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp | 216 ++++----- + extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp | 192 ++++---- + extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp | 192 ++++---- + extern/xmlrpcpp/xmlrpcpp/test/HelloServer.dsp | 192 ++++---- + extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.cpp | 90 ++-- + extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.dsp | 192 ++++---- + extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.cpp | 136 +++--- + extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.dsp | 192 ++++---- + extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp | 466 +++++++++--------- + extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp | 190 ++++---- + extern/xmlrpcpp/xmlrpcpp/test/TestValuesWin32.cpp | 506 ++++++++++---------- + extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp | 106 ++--- + extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp | 192 ++++---- + extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp | 414 ++++++++-------- + extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp | 190 ++++---- + .../xmlrpcpp/xmlrpcpp/test/arrayOfStructsTest.xml | 510 ++++++++++---------- + extern/xmlrpcpp/xmlrpcpp/test/countTheEntities.xml | 20 +- + extern/xmlrpcpp/xmlrpcpp/test/easyStructTest.xml | 58 +-- + extern/xmlrpcpp/xmlrpcpp/test/echo.xml | 18 +- + extern/xmlrpcpp/xmlrpcpp/test/echoStructTest.xml | 522 ++++++++++----------- + extern/xmlrpcpp/xmlrpcpp/test/pngnow.png | 2 +- + extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp | 366 +++++++-------- + extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw | 298 ++++++------ + 25 files changed, 3015 insertions(+), 3015 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +index e3969af..c5e5301 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +@@ -1,125 +1,125 @@ +- +-#ifndef _XMLRPCCLIENT_H_ +-#define _XMLRPCCLIENT_H_ +-// +-// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +-// +-#if defined(_MSC_VER) +-# pragma warning(disable:4786) // identifier was truncated in debug info +-#endif +- +- +-#ifndef MAKEDEPEND +-# include +-#endif +- +-#include "XmlRpcDispatch.h" +-#include "XmlRpcSource.h" +- +-namespace XmlRpc { +- +- // Arguments and results are represented by XmlRpcValues +- class XmlRpcValue; +- +- //! A class to send XML RPC requests to a server and return the results. +- class XmlRpcClient : public XmlRpcSource { +- public: +- // Static data +- static const char REQUEST_BEGIN[]; +- static const char REQUEST_END_METHODNAME[]; +- static const char PARAMS_TAG[]; +- static const char PARAMS_ETAG[]; +- static const char PARAM_TAG[]; +- static const char PARAM_ETAG[]; +- static const char REQUEST_END[]; +- // Result tags +- static const char METHODRESPONSE_TAG[]; +- static const char FAULT_TAG[]; +- +- //! Construct a client to connect to the server at the specified host:port address +- //! @param host The name of the remote machine hosting the server +- //! @param port The port on the remote machine where the server is listening +- //! @param uri An optional string to be sent as the URI in the HTTP GET header +- XmlRpcClient(const char* host, int port, const char* uri=0); +- +- //! Destructor +- virtual ~XmlRpcClient(); +- +- //! Execute the named procedure on the remote server. +- //! @param method The name of the remote procedure to execute +- //! @param params An array of the arguments for the method +- //! @param result The result value to be returned to the client +- //! @return true if the request was sent and a result received +- //! (although the result might be a fault). +- //! +- //! Currently this is a synchronous (blocking) implementation (execute +- //! does not return until it receives a response or an error). Use isFault() +- //! to determine whether the result is a fault response. +- bool execute(const char* method, XmlRpcValue const& params, XmlRpcValue& result); +- +- //! Returns true if the result of the last execute() was a fault response. +- bool isFault() const { return _isFault; } +- +- +- // XmlRpcSource interface implementation +- //! Close the connection +- virtual void close(); +- +- //! Handle server responses. Called by the event dispatcher during execute. +- //! @param eventType The type of event that occurred. +- //! @see XmlRpcDispatch::EventType +- virtual unsigned handleEvent(unsigned eventType); +- +- protected: +- // Execution processing helpers +- virtual bool doConnect(); +- virtual bool setupConnection(); +- +- virtual bool generateRequest(const char* method, XmlRpcValue const& params); +- virtual std::string generateHeader(std::string const& body); +- virtual bool writeRequest(); +- virtual bool readHeader(); +- virtual bool readResponse(); +- virtual bool parseResponse(XmlRpcValue& result); +- +- // Possible IO states for the connection +- enum ClientConnectionState { NO_CONNECTION, CONNECTING, WRITE_REQUEST, READ_HEADER, READ_RESPONSE, IDLE }; +- ClientConnectionState _connectionState; +- +- // Server location +- std::string _host; +- std::string _uri; +- int _port; +- +- // The xml-encoded request, http header of response, and response xml +- std::string _request; +- std::string _header; +- std::string _response; +- +- // Number of times the client has attempted to send the request +- int _sendAttempts; +- +- // Number of bytes of the request that have been written to the socket so far +- int _bytesWritten; +- +- // True if we are currently executing a request. If you want to multithread, +- // each thread should have its own client. +- bool _executing; +- +- // True if the server closed the connection +- bool _eof; +- + +- // True if a fault response was returned by the server + +- bool _isFault; + +- +- // Number of bytes expected in the response body (parsed from response header) +- int _contentLength; +- +- // Event dispatcher +- XmlRpcDispatch _disp; +- +- }; // class XmlRpcClient +- +-} // namespace XmlRpc +- +-#endif // _XMLRPCCLIENT_H_ ++ ++#ifndef _XMLRPCCLIENT_H_ ++#define _XMLRPCCLIENT_H_ ++// ++// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley ++// ++#if defined(_MSC_VER) ++# pragma warning(disable:4786) // identifier was truncated in debug info ++#endif ++ ++ ++#ifndef MAKEDEPEND ++# include ++#endif ++ ++#include "XmlRpcDispatch.h" ++#include "XmlRpcSource.h" ++ ++namespace XmlRpc { ++ ++ // Arguments and results are represented by XmlRpcValues ++ class XmlRpcValue; ++ ++ //! A class to send XML RPC requests to a server and return the results. ++ class XmlRpcClient : public XmlRpcSource { ++ public: ++ // Static data ++ static const char REQUEST_BEGIN[]; ++ static const char REQUEST_END_METHODNAME[]; ++ static const char PARAMS_TAG[]; ++ static const char PARAMS_ETAG[]; ++ static const char PARAM_TAG[]; ++ static const char PARAM_ETAG[]; ++ static const char REQUEST_END[]; ++ // Result tags ++ static const char METHODRESPONSE_TAG[]; ++ static const char FAULT_TAG[]; ++ ++ //! Construct a client to connect to the server at the specified host:port address ++ //! @param host The name of the remote machine hosting the server ++ //! @param port The port on the remote machine where the server is listening ++ //! @param uri An optional string to be sent as the URI in the HTTP GET header ++ XmlRpcClient(const char* host, int port, const char* uri=0); ++ ++ //! Destructor ++ virtual ~XmlRpcClient(); ++ ++ //! Execute the named procedure on the remote server. ++ //! @param method The name of the remote procedure to execute ++ //! @param params An array of the arguments for the method ++ //! @param result The result value to be returned to the client ++ //! @return true if the request was sent and a result received ++ //! (although the result might be a fault). ++ //! ++ //! Currently this is a synchronous (blocking) implementation (execute ++ //! does not return until it receives a response or an error). Use isFault() ++ //! to determine whether the result is a fault response. ++ bool execute(const char* method, XmlRpcValue const& params, XmlRpcValue& result); ++ ++ //! Returns true if the result of the last execute() was a fault response. ++ bool isFault() const { return _isFault; } ++ ++ ++ // XmlRpcSource interface implementation ++ //! Close the connection ++ virtual void close(); ++ ++ //! Handle server responses. Called by the event dispatcher during execute. ++ //! @param eventType The type of event that occurred. ++ //! @see XmlRpcDispatch::EventType ++ virtual unsigned handleEvent(unsigned eventType); ++ ++ protected: ++ // Execution processing helpers ++ virtual bool doConnect(); ++ virtual bool setupConnection(); ++ ++ virtual bool generateRequest(const char* method, XmlRpcValue const& params); ++ virtual std::string generateHeader(std::string const& body); ++ virtual bool writeRequest(); ++ virtual bool readHeader(); ++ virtual bool readResponse(); ++ virtual bool parseResponse(XmlRpcValue& result); ++ ++ // Possible IO states for the connection ++ enum ClientConnectionState { NO_CONNECTION, CONNECTING, WRITE_REQUEST, READ_HEADER, READ_RESPONSE, IDLE }; ++ ClientConnectionState _connectionState; ++ ++ // Server location ++ std::string _host; ++ std::string _uri; ++ int _port; ++ ++ // The xml-encoded request, http header of response, and response xml ++ std::string _request; ++ std::string _header; ++ std::string _response; ++ ++ // Number of times the client has attempted to send the request ++ int _sendAttempts; ++ ++ // Number of bytes of the request that have been written to the socket so far ++ int _bytesWritten; ++ ++ // True if we are currently executing a request. If you want to multithread, ++ // each thread should have its own client. ++ bool _executing; ++ ++ // True if the server closed the connection ++ bool _eof; ++ ++ // True if a fault response was returned by the server ++ bool _isFault; ++ ++ // Number of bytes expected in the response body (parsed from response header) ++ int _contentLength; ++ ++ // Event dispatcher ++ XmlRpcDispatch _disp; ++ ++ }; // class XmlRpcClient ++ ++} // namespace XmlRpc ++ ++#endif // _XMLRPCCLIENT_H_ +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +index 3c77c07..56b8d52 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +@@ -1,260 +1,260 @@ +- +-#include "XmlRpcSocket.h" +-#include "XmlRpcUtil.h" +- +-#ifndef MAKEDEPEND +- +-#if defined(_WINDOWS) +-# include + +-# include +-//# pragma lib(WS2_32.lib) +- +-# define EINPROGRESS WSAEINPROGRESS +-# define EWOULDBLOCK WSAEWOULDBLOCK +-# define ETIMEDOUT WSAETIMEDOUT +-#else +-extern "C" { +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-} +-#endif // _WINDOWS +- +-#endif // MAKEDEPEND +- +- +-using namespace XmlRpc; +- +- +- +-#if defined(_WINDOWS) +- +-static void initWinSock() +-{ +- static bool wsInit = false; +- if (! wsInit) +- { +- WORD wVersionRequested = MAKEWORD( 2, 0 ); +- WSADATA wsaData; +- WSAStartup(wVersionRequested, &wsaData); +- wsInit = true; +- } +-} +- +-#else +- +-#define initWinSock() +- +-#endif // _WINDOWS +- +- +-// These errors are not considered fatal for an IO operation; the operation will be re-tried. + +-static inline bool + +-nonFatalError() + +-{ + +- int err = XmlRpcSocket::getError(); + +- return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR); + +-} + +- + +- + +- +-int +-XmlRpcSocket::socket() +-{ +- initWinSock(); +- return (int) ::socket(AF_INET, SOCK_STREAM, 0); +-} +- +- +-void +-XmlRpcSocket::close(int fd) +-{ +- XmlRpcUtil::log(4, "XmlRpcSocket::close: fd %d.", fd); +-#if defined(_WINDOWS) +- closesocket(fd); +-#else +- ::close(fd); +-#endif // _WINDOWS +-} +- +- +- +- +-bool +-XmlRpcSocket::setNonBlocking(int fd) +-{ +-#if defined(_WINDOWS) +- unsigned long flag = 1; +- return (ioctlsocket((SOCKET)fd, FIONBIO, &flag) == 0); +-#else +- return (fcntl(fd, F_SETFL, O_NONBLOCK) == 0); +-#endif // _WINDOWS +-} +- +- +-bool +-XmlRpcSocket::setReuseAddr(int fd) +-{ +- // Allow this port to be re-bound immediately so server re-starts are not delayed +- int sflag = 1; +- return (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char *)&sflag, sizeof(sflag)) == 0); +-} +- +- +-// Bind to a specified port +-bool +-XmlRpcSocket::bind(int fd, int port) +-{ +- struct sockaddr_in saddr; +- memset(&saddr, 0, sizeof(saddr)); +- saddr.sin_family = AF_INET; +- saddr.sin_addr.s_addr = htonl(INADDR_ANY); +- saddr.sin_port = htons((u_short) port); +- return (::bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) == 0); +-} +- +- +-// Set socket in listen mode +-bool +-XmlRpcSocket::listen(int fd, int backlog) +-{ +- return (::listen(fd, backlog) == 0); +-} +- +- +-int +-XmlRpcSocket::accept(int fd) +-{ +- struct sockaddr_in addr; +-#if defined(_WINDOWS) +- int +-#else +- socklen_t +-#endif +- addrlen = sizeof(addr); +- +- return (int) ::accept(fd, (struct sockaddr*)&addr, &addrlen); +-} +- +- +- +-// Connect a socket to a server (from a client) +-bool +-XmlRpcSocket::connect(int fd, std::string& host, int port) +-{ +- struct sockaddr_in saddr; +- memset(&saddr, 0, sizeof(saddr)); +- saddr.sin_family = AF_INET; +- +- struct hostent *hp = gethostbyname(host.c_str()); +- if (hp == 0) return false; +- +- saddr.sin_family = hp->h_addrtype; +- memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length); +- saddr.sin_port = htons((u_short) port); +- +- // For asynch operation, this will return EWOULDBLOCK (windows) or +- // EINPROGRESS (linux) and we just need to wait for the socket to be writable... +- int result = ::connect(fd, (struct sockaddr *)&saddr, sizeof(saddr)); +- return result == 0 || nonFatalError(); +-} +- +- +- +-// Read available text from the specified socket. Returns false on error. +-bool +-XmlRpcSocket::nbRead(int fd, std::string& s, bool *eof) +-{ +- const int READ_SIZE = 4096; // Number of bytes to attempt to read at a time +- char readBuf[READ_SIZE]; +- +- bool wouldBlock = false; +- *eof = false; +- +- while ( ! wouldBlock && ! *eof) { +-#if defined(_WINDOWS) +- int n = recv(fd, readBuf, READ_SIZE-1, 0); +-#else +- int n = read(fd, readBuf, READ_SIZE-1); +-#endif +- XmlRpcUtil::log(5, "XmlRpcSocket::nbRead: read/recv returned %d.", n); +- + +- if (n > 0) { +- readBuf[n] = 0; +- s.append(readBuf, n); +- } else if (n == 0) { +- *eof = true; +- } else if (nonFatalError()) { +- wouldBlock = true; +- } else { +- return false; // Error +- } +- } +- return true; +-} +- +- +-// Write text to the specified socket. Returns false on error. +-bool +-XmlRpcSocket::nbWrite(int fd, std::string& s, int *bytesSoFar) +-{ +- int nToWrite = int(s.length()) - *bytesSoFar; +- char *sp = const_cast(s.c_str()) + *bytesSoFar; +- bool wouldBlock = false; +- +- while ( nToWrite > 0 && ! wouldBlock ) { +-#if defined(_WINDOWS) +- int n = send(fd, sp, nToWrite, 0); +-#else +- int n = write(fd, sp, nToWrite); +-#endif +- XmlRpcUtil::log(5, "XmlRpcSocket::nbWrite: send/write returned %d.", n); +- +- if (n > 0) { +- sp += n; +- *bytesSoFar += n; +- nToWrite -= n; +- } else if (nonFatalError()) { +- wouldBlock = true; +- } else { +- return false; // Error +- } +- } +- return true; +-} +- +- +-// Returns last errno +-int +-XmlRpcSocket::getError() +-{ +-#if defined(_WINDOWS) +- return WSAGetLastError(); +-#else +- return errno; +-#endif +-} +- +- +-// Returns message corresponding to last errno +-std::string +-XmlRpcSocket::getErrorMsg() +-{ +- return getErrorMsg(getError()); +-} +- +-// Returns message corresponding to errno... well, it should anyway +-std::string +-XmlRpcSocket::getErrorMsg(int error) +-{ +- char err[60]; +- snprintf(err,sizeof(err),"error %d", error); +- return std::string(err); +-} +- +- ++ ++#include "XmlRpcSocket.h" ++#include "XmlRpcUtil.h" ++ ++#ifndef MAKEDEPEND ++ ++#if defined(_WINDOWS) ++# include ++# include ++//# pragma lib(WS2_32.lib) ++ ++# define EINPROGRESS WSAEINPROGRESS ++# define EWOULDBLOCK WSAEWOULDBLOCK ++# define ETIMEDOUT WSAETIMEDOUT ++#else ++extern "C" { ++# include ++# include ++# include ++# include ++# include ++# include ++# include ++# include ++} ++#endif // _WINDOWS ++ ++#endif // MAKEDEPEND ++ ++ ++using namespace XmlRpc; ++ ++ ++ ++#if defined(_WINDOWS) ++ ++static void initWinSock() ++{ ++ static bool wsInit = false; ++ if (! wsInit) ++ { ++ WORD wVersionRequested = MAKEWORD( 2, 0 ); ++ WSADATA wsaData; ++ WSAStartup(wVersionRequested, &wsaData); ++ wsInit = true; ++ } ++} ++ ++#else ++ ++#define initWinSock() ++ ++#endif // _WINDOWS ++ ++ ++// These errors are not considered fatal for an IO operation; the operation will be re-tried. ++static inline bool ++nonFatalError() ++{ ++ int err = XmlRpcSocket::getError(); ++ return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR); ++} ++ ++ ++ ++int ++XmlRpcSocket::socket() ++{ ++ initWinSock(); ++ return (int) ::socket(AF_INET, SOCK_STREAM, 0); ++} ++ ++ ++void ++XmlRpcSocket::close(int fd) ++{ ++ XmlRpcUtil::log(4, "XmlRpcSocket::close: fd %d.", fd); ++#if defined(_WINDOWS) ++ closesocket(fd); ++#else ++ ::close(fd); ++#endif // _WINDOWS ++} ++ ++ ++ ++ ++bool ++XmlRpcSocket::setNonBlocking(int fd) ++{ ++#if defined(_WINDOWS) ++ unsigned long flag = 1; ++ return (ioctlsocket((SOCKET)fd, FIONBIO, &flag) == 0); ++#else ++ return (fcntl(fd, F_SETFL, O_NONBLOCK) == 0); ++#endif // _WINDOWS ++} ++ ++ ++bool ++XmlRpcSocket::setReuseAddr(int fd) ++{ ++ // Allow this port to be re-bound immediately so server re-starts are not delayed ++ int sflag = 1; ++ return (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char *)&sflag, sizeof(sflag)) == 0); ++} ++ ++ ++// Bind to a specified port ++bool ++XmlRpcSocket::bind(int fd, int port) ++{ ++ struct sockaddr_in saddr; ++ memset(&saddr, 0, sizeof(saddr)); ++ saddr.sin_family = AF_INET; ++ saddr.sin_addr.s_addr = htonl(INADDR_ANY); ++ saddr.sin_port = htons((u_short) port); ++ return (::bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) == 0); ++} ++ ++ ++// Set socket in listen mode ++bool ++XmlRpcSocket::listen(int fd, int backlog) ++{ ++ return (::listen(fd, backlog) == 0); ++} ++ ++ ++int ++XmlRpcSocket::accept(int fd) ++{ ++ struct sockaddr_in addr; ++#if defined(_WINDOWS) ++ int ++#else ++ socklen_t ++#endif ++ addrlen = sizeof(addr); ++ ++ return (int) ::accept(fd, (struct sockaddr*)&addr, &addrlen); ++} ++ ++ ++ ++// Connect a socket to a server (from a client) ++bool ++XmlRpcSocket::connect(int fd, std::string& host, int port) ++{ ++ struct sockaddr_in saddr; ++ memset(&saddr, 0, sizeof(saddr)); ++ saddr.sin_family = AF_INET; ++ ++ struct hostent *hp = gethostbyname(host.c_str()); ++ if (hp == 0) return false; ++ ++ saddr.sin_family = hp->h_addrtype; ++ memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length); ++ saddr.sin_port = htons((u_short) port); ++ ++ // For asynch operation, this will return EWOULDBLOCK (windows) or ++ // EINPROGRESS (linux) and we just need to wait for the socket to be writable... ++ int result = ::connect(fd, (struct sockaddr *)&saddr, sizeof(saddr)); ++ return result == 0 || nonFatalError(); ++} ++ ++ ++ ++// Read available text from the specified socket. Returns false on error. ++bool ++XmlRpcSocket::nbRead(int fd, std::string& s, bool *eof) ++{ ++ const int READ_SIZE = 4096; // Number of bytes to attempt to read at a time ++ char readBuf[READ_SIZE]; ++ ++ bool wouldBlock = false; ++ *eof = false; ++ ++ while ( ! wouldBlock && ! *eof) { ++#if defined(_WINDOWS) ++ int n = recv(fd, readBuf, READ_SIZE-1, 0); ++#else ++ int n = read(fd, readBuf, READ_SIZE-1); ++#endif ++ XmlRpcUtil::log(5, "XmlRpcSocket::nbRead: read/recv returned %d.", n); ++ ++ if (n > 0) { ++ readBuf[n] = 0; ++ s.append(readBuf, n); ++ } else if (n == 0) { ++ *eof = true; ++ } else if (nonFatalError()) { ++ wouldBlock = true; ++ } else { ++ return false; // Error ++ } ++ } ++ return true; ++} ++ ++ ++// Write text to the specified socket. Returns false on error. ++bool ++XmlRpcSocket::nbWrite(int fd, std::string& s, int *bytesSoFar) ++{ ++ int nToWrite = int(s.length()) - *bytesSoFar; ++ char *sp = const_cast(s.c_str()) + *bytesSoFar; ++ bool wouldBlock = false; ++ ++ while ( nToWrite > 0 && ! wouldBlock ) { ++#if defined(_WINDOWS) ++ int n = send(fd, sp, nToWrite, 0); ++#else ++ int n = write(fd, sp, nToWrite); ++#endif ++ XmlRpcUtil::log(5, "XmlRpcSocket::nbWrite: send/write returned %d.", n); ++ ++ if (n > 0) { ++ sp += n; ++ *bytesSoFar += n; ++ nToWrite -= n; ++ } else if (nonFatalError()) { ++ wouldBlock = true; ++ } else { ++ return false; // Error ++ } ++ } ++ return true; ++} ++ ++ ++// Returns last errno ++int ++XmlRpcSocket::getError() ++{ ++#if defined(_WINDOWS) ++ return WSAGetLastError(); ++#else ++ return errno; ++#endif ++} ++ ++ ++// Returns message corresponding to last errno ++std::string ++XmlRpcSocket::getErrorMsg() ++{ ++ return getErrorMsg(getError()); ++} ++ ++// Returns message corresponding to errno... well, it should anyway ++std::string ++XmlRpcSocket::getErrorMsg(int error) ++{ ++ char err[60]; ++ snprintf(err,sizeof(err),"error %d", error); ++ return std::string(err); ++} ++ ++ +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp +index 65fe3a5..a0f79ee 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp +@@ -1,108 +1,108 @@ +-// FileClient.cpp : A simple xmlrpc client. Usage: FileClient serverHost serverPort xmlfile + +-// Reads an xmlrpc request from the specified xmlfile and calls the method on the server. + +-// + +-// Link against xmlrpc lib and whatever socket libs your system needs (ws2_32.lib on windows) + +- + +-#include "XmlRpc.h" + +-#include + +-#include + +-#include + +- + +-using namespace XmlRpc; + +- + +-std::string parseRequest(std::string const& xml, XmlRpcValue& params); + +- + +- + +-int main(int argc, char* argv[]) + +-{ + +- if (argc != 4) { + +- std::cerr << "Usage: FileClient serverHost serverPort requestXmlFile\n"; + +- return -1; + +- } + +- int port = atoi(argv[2]); + +- + +- XmlRpc::setVerbosity(5); + +- XmlRpcClient c(argv[1], port); + +- + +- // + +- std::ifstream infile(argv[3]); + +- if (infile.fail()) { + +- std::cerr << "Could not open file '" << argv[3] << "'.\n"; + +- return -1; + +- } + +- + +- // Suck in the file. This is a one-liner in good compilers (which vc++ 6 is not)... + +- infile.seekg(0L, std::ios::end); + +- long nb = infile.tellg(); + +- infile.clear(); + +- infile.seekg(0L); + +- char* b = new char[nb+1]; + +- infile.read(b, nb); + +- b[nb] = 0; + +- + +- std::cout << "Read file.\n"; + +- + +- // Find the methodName and parse the params + +- std::string s(b); + +- XmlRpcValue params; + +- std::string name = parseRequest(s, params); + +- + +- if (name.empty()) { + +- std::cerr << "Could not parse file\n"; + +- return -1; + +- } + +- + +- for (;;) { + +- XmlRpcValue result; + +- std::cout << "Calling " << name << std::endl; + +- if (c.execute(name.c_str(), params, result)) + +- std::cout << result << "\n\n"; + +- else + +- std::cout << "Error calling '" << name << "'\n\n"; + +- std::cout << "Again? [y]: "; + +- std::string ans; + +- std::cin >> ans; + +- if (ans != "" && ans != "y") break; + +- } + +- + +- return 0; + +-} + +- + +- + +-// + +-std::string + +-parseRequest(std::string const& xml, XmlRpcValue& params) + +-{ + +- const char METHODNAME_TAG[] = ""; + +- const char PARAMS_TAG[] = ""; + +- const char PARAMS_ETAG[] = ""; + +- const char PARAM_TAG[] = ""; + +- const char PARAM_ETAG[] = ""; + +- + +- int offset = 0; // Number of chars parsed from the request + +- + +- std::string methodName = XmlRpcUtil::parseTag(METHODNAME_TAG, xml, &offset); + +- XmlRpcUtil::log(3, "XmlRpcServerConnection::parseRequest: parsed methodName %s.", methodName.c_str()); + +- + +- if (! methodName.empty() && XmlRpcUtil::findTag(PARAMS_TAG, xml, &offset)) + +- { + +- int nArgs = 0; + +- while (XmlRpcUtil::nextTagIs(PARAM_TAG, xml, &offset)) { + +- std::cout << "Parsing arg " << nArgs+1 << std::endl; + +- XmlRpcValue arg(xml, &offset); + +- if ( ! arg.valid()) { + +- std::cerr << "Invalid argument\n"; + +- return std::string(); + +- } + +- std::cout << "Adding arg " << nArgs+1 << " to params array." << std::endl; + +- params[nArgs++] = arg; + +- (void) XmlRpcUtil::nextTagIs(PARAM_ETAG, xml, &offset); + +- } + +- + +- XmlRpcUtil::log(3, "XmlRpcServerConnection::parseRequest: parsed %d params.", nArgs); + +- + +- (void) XmlRpcUtil::nextTagIs(PARAMS_ETAG, xml, &offset); + +- } + +- + +- return methodName; + +-} + ++// FileClient.cpp : A simple xmlrpc client. Usage: FileClient serverHost serverPort xmlfile ++// Reads an xmlrpc request from the specified xmlfile and calls the method on the server. ++// ++// Link against xmlrpc lib and whatever socket libs your system needs (ws2_32.lib on windows) ++ ++#include "XmlRpc.h" ++#include ++#include ++#include ++ ++using namespace XmlRpc; ++ ++std::string parseRequest(std::string const& xml, XmlRpcValue& params); ++ ++ ++int main(int argc, char* argv[]) ++{ ++ if (argc != 4) { ++ std::cerr << "Usage: FileClient serverHost serverPort requestXmlFile\n"; ++ return -1; ++ } ++ int port = atoi(argv[2]); ++ ++ XmlRpc::setVerbosity(5); ++ XmlRpcClient c(argv[1], port); ++ ++ // ++ std::ifstream infile(argv[3]); ++ if (infile.fail()) { ++ std::cerr << "Could not open file '" << argv[3] << "'.\n"; ++ return -1; ++ } ++ ++ // Suck in the file. This is a one-liner in good compilers (which vc++ 6 is not)... ++ infile.seekg(0L, std::ios::end); ++ long nb = infile.tellg(); ++ infile.clear(); ++ infile.seekg(0L); ++ char* b = new char[nb+1]; ++ infile.read(b, nb); ++ b[nb] = 0; ++ ++ std::cout << "Read file.\n"; ++ ++ // Find the methodName and parse the params ++ std::string s(b); ++ XmlRpcValue params; ++ std::string name = parseRequest(s, params); ++ ++ if (name.empty()) { ++ std::cerr << "Could not parse file\n"; ++ return -1; ++ } ++ ++ for (;;) { ++ XmlRpcValue result; ++ std::cout << "Calling " << name << std::endl; ++ if (c.execute(name.c_str(), params, result)) ++ std::cout << result << "\n\n"; ++ else ++ std::cout << "Error calling '" << name << "'\n\n"; ++ std::cout << "Again? [y]: "; ++ std::string ans; ++ std::cin >> ans; ++ if (ans != "" && ans != "y") break; ++ } ++ ++ return 0; ++} ++ ++ ++// ++std::string ++parseRequest(std::string const& xml, XmlRpcValue& params) ++{ ++ const char METHODNAME_TAG[] = ""; ++ const char PARAMS_TAG[] = ""; ++ const char PARAMS_ETAG[] = ""; ++ const char PARAM_TAG[] = ""; ++ const char PARAM_ETAG[] = ""; ++ ++ int offset = 0; // Number of chars parsed from the request ++ ++ std::string methodName = XmlRpcUtil::parseTag(METHODNAME_TAG, xml, &offset); ++ XmlRpcUtil::log(3, "XmlRpcServerConnection::parseRequest: parsed methodName %s.", methodName.c_str()); ++ ++ if (! methodName.empty() && XmlRpcUtil::findTag(PARAMS_TAG, xml, &offset)) ++ { ++ int nArgs = 0; ++ while (XmlRpcUtil::nextTagIs(PARAM_TAG, xml, &offset)) { ++ std::cout << "Parsing arg " << nArgs+1 << std::endl; ++ XmlRpcValue arg(xml, &offset); ++ if ( ! arg.valid()) { ++ std::cerr << "Invalid argument\n"; ++ return std::string(); ++ } ++ std::cout << "Adding arg " << nArgs+1 << " to params array." << std::endl; ++ params[nArgs++] = arg; ++ (void) XmlRpcUtil::nextTagIs(PARAM_ETAG, xml, &offset); ++ } ++ ++ XmlRpcUtil::log(3, "XmlRpcServerConnection::parseRequest: parsed %d params.", nArgs); ++ ++ (void) XmlRpcUtil::nextTagIs(PARAMS_ETAG, xml, &offset); ++ } ++ ++ return methodName; ++} +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp +index 7935fdc..1173af0 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp +@@ -1,96 +1,96 @@ +-# Microsoft Developer Studio Project File - Name="FileClient" - Package Owner=<4> + +-# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +-# ** DO NOT EDIT ** + +- + +-# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +- + +-CFG=FileClient - Win32 Debug + +-!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +-!MESSAGE use the Export Makefile command and run + +-!MESSAGE + +-!MESSAGE NMAKE /f "FileClient.mak". + +-!MESSAGE + +-!MESSAGE You can specify a configuration when running NMAKE + +-!MESSAGE by defining the macro CFG on the command line. For example: + +-!MESSAGE + +-!MESSAGE NMAKE /f "FileClient.mak" CFG="FileClient - Win32 Debug" + +-!MESSAGE + +-!MESSAGE Possible choices for configuration are: + +-!MESSAGE + +-!MESSAGE "FileClient - Win32 Release" (based on "Win32 (x86) Console Application") + +-!MESSAGE "FileClient - Win32 Debug" (based on "Win32 (x86) Console Application") + +-!MESSAGE + +- + +-# Begin Project + +-# PROP AllowPerConfigDependencies 0 + +-# PROP Scc_ProjName "" + +-# PROP Scc_LocalPath "" + +-CPP=cl.exe + +-RSC=rc.exe + +- + +-!IF "$(CFG)" == "FileClient - Win32 Release" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 0 + +-# PROP BASE Output_Dir "Release" + +-# PROP BASE Intermediate_Dir "Release" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 0 + +-# PROP Output_Dir "Release" + +-# PROP Intermediate_Dir "Release" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c + +-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "NDEBUG" + +-# ADD RSC /l 0x409 /d "NDEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +- + +-!ELSEIF "$(CFG)" == "FileClient - Win32 Debug" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 1 + +-# PROP BASE Output_Dir "Debug" + +-# PROP BASE Intermediate_Dir "Debug" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 1 + +-# PROP Output_Dir "Debug" + +-# PROP Intermediate_Dir "Debug" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c + +-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "_DEBUG" + +-# ADD RSC /l 0x409 /d "_DEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +- + +-!ENDIF + +- + +-# Begin Target + +- + +-# Name "FileClient - Win32 Release" + +-# Name "FileClient - Win32 Debug" + +-# Begin Group "Source Files" + +- + +-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +-# Begin Source File + +- + +-SOURCE=.\FileClient.cpp + +-# End Source File + +-# End Group + +-# End Target + +-# End Project + ++# Microsoft Developer Studio Project File - Name="FileClient" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Console Application" 0x0103 ++ ++CFG=FileClient - Win32 Debug ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "FileClient.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "FileClient.mak" CFG="FileClient - Win32 Debug" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "FileClient - Win32 Release" (based on "Win32 (x86) Console Application") ++!MESSAGE "FileClient - Win32 Debug" (based on "Win32 (x86) Console Application") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "FileClient - Win32 Release" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release" ++# PROP BASE Intermediate_Dir "Release" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release" ++# PROP Intermediate_Dir "Release" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c ++# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "NDEBUG" ++# ADD RSC /l 0x409 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" ++ ++!ELSEIF "$(CFG)" == "FileClient - Win32 Debug" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug" ++# PROP BASE Intermediate_Dir "Debug" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "Debug" ++# PROP Intermediate_Dir "Debug" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c ++# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "_DEBUG" ++# ADD RSC /l 0x409 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "FileClient - Win32 Release" ++# Name "FileClient - Win32 Debug" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\FileClient.cpp ++# End Source File ++# End Group ++# End Target ++# End Project +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp b/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp +index 3cb7132..c7c8fc0 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp +@@ -1,96 +1,96 @@ +-# Microsoft Developer Studio Project File - Name="HelloClient" - Package Owner=<4> + +-# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +-# ** DO NOT EDIT ** + +- + +-# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +- + +-CFG=HelloClient - Win32 Debug + +-!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +-!MESSAGE use the Export Makefile command and run + +-!MESSAGE + +-!MESSAGE NMAKE /f "HelloClient.mak". + +-!MESSAGE + +-!MESSAGE You can specify a configuration when running NMAKE + +-!MESSAGE by defining the macro CFG on the command line. For example: + +-!MESSAGE + +-!MESSAGE NMAKE /f "HelloClient.mak" CFG="HelloClient - Win32 Debug" + +-!MESSAGE + +-!MESSAGE Possible choices for configuration are: + +-!MESSAGE + +-!MESSAGE "HelloClient - Win32 Release" (based on "Win32 (x86) Console Application") + +-!MESSAGE "HelloClient - Win32 Debug" (based on "Win32 (x86) Console Application") + +-!MESSAGE + +- + +-# Begin Project + +-# PROP AllowPerConfigDependencies 0 + +-# PROP Scc_ProjName "" + +-# PROP Scc_LocalPath "" + +-CPP=cl.exe + +-RSC=rc.exe + +- + +-!IF "$(CFG)" == "HelloClient - Win32 Release" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 0 + +-# PROP BASE Output_Dir "Release" + +-# PROP BASE Intermediate_Dir "Release" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 0 + +-# PROP Output_Dir "Release" + +-# PROP Intermediate_Dir "Release" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c + +-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "NDEBUG" + +-# ADD RSC /l 0x409 /d "NDEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +- + +-!ELSEIF "$(CFG)" == "HelloClient - Win32 Debug" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 1 + +-# PROP BASE Output_Dir "Debug" + +-# PROP BASE Intermediate_Dir "Debug" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 1 + +-# PROP Output_Dir "Debug" + +-# PROP Intermediate_Dir "Debug" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c + +-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "_DEBUG" + +-# ADD RSC /l 0x409 /d "_DEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +- + +-!ENDIF + +- + +-# Begin Target + +- + +-# Name "HelloClient - Win32 Release" + +-# Name "HelloClient - Win32 Debug" + +-# Begin Group "Source Files" + +- + +-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +-# Begin Source File + +- + +-SOURCE=.\HelloClient.cpp + +-# End Source File + +-# End Group + +-# End Target + +-# End Project + ++# Microsoft Developer Studio Project File - Name="HelloClient" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Console Application" 0x0103 ++ ++CFG=HelloClient - Win32 Debug ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "HelloClient.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "HelloClient.mak" CFG="HelloClient - Win32 Debug" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "HelloClient - Win32 Release" (based on "Win32 (x86) Console Application") ++!MESSAGE "HelloClient - Win32 Debug" (based on "Win32 (x86) Console Application") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "HelloClient - Win32 Release" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release" ++# PROP BASE Intermediate_Dir "Release" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release" ++# PROP Intermediate_Dir "Release" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c ++# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "NDEBUG" ++# ADD RSC /l 0x409 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" ++ ++!ELSEIF "$(CFG)" == "HelloClient - Win32 Debug" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug" ++# PROP BASE Intermediate_Dir "Debug" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "Debug" ++# PROP Intermediate_Dir "Debug" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c ++# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "_DEBUG" ++# ADD RSC /l 0x409 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "HelloClient - Win32 Release" ++# Name "HelloClient - Win32 Debug" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\HelloClient.cpp ++# End Source File ++# End Group ++# End Target ++# End Project +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.dsp b/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.dsp +index bd1a871..a5dd0eb 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.dsp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.dsp +@@ -1,96 +1,96 @@ +-# Microsoft Developer Studio Project File - Name="HelloServer" - Package Owner=<4> + +-# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +-# ** DO NOT EDIT ** + +- + +-# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +- + +-CFG=HelloServer - Win32 Debug + +-!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +-!MESSAGE use the Export Makefile command and run + +-!MESSAGE + +-!MESSAGE NMAKE /f "HelloServer.mak". + +-!MESSAGE + +-!MESSAGE You can specify a configuration when running NMAKE + +-!MESSAGE by defining the macro CFG on the command line. For example: + +-!MESSAGE + +-!MESSAGE NMAKE /f "HelloServer.mak" CFG="HelloServer - Win32 Debug" + +-!MESSAGE + +-!MESSAGE Possible choices for configuration are: + +-!MESSAGE + +-!MESSAGE "HelloServer - Win32 Release" (based on "Win32 (x86) Console Application") + +-!MESSAGE "HelloServer - Win32 Debug" (based on "Win32 (x86) Console Application") + +-!MESSAGE + +- + +-# Begin Project + +-# PROP AllowPerConfigDependencies 0 + +-# PROP Scc_ProjName "" + +-# PROP Scc_LocalPath "" + +-CPP=cl.exe + +-RSC=rc.exe + +- + +-!IF "$(CFG)" == "HelloServer - Win32 Release" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 0 + +-# PROP BASE Output_Dir "Release" + +-# PROP BASE Intermediate_Dir "Release" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 0 + +-# PROP Output_Dir "Release" + +-# PROP Intermediate_Dir "Release" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c + +-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "NDEBUG" + +-# ADD RSC /l 0x409 /d "NDEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +- + +-!ELSEIF "$(CFG)" == "HelloServer - Win32 Debug" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 1 + +-# PROP BASE Output_Dir "Debug" + +-# PROP BASE Intermediate_Dir "Debug" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 1 + +-# PROP Output_Dir "Debug" + +-# PROP Intermediate_Dir "Debug" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c + +-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "_DEBUG" + +-# ADD RSC /l 0x409 /d "_DEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +- + +-!ENDIF + +- + +-# Begin Target + +- + +-# Name "HelloServer - Win32 Release" + +-# Name "HelloServer - Win32 Debug" + +-# Begin Group "Source Files" + +- + +-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +-# Begin Source File + +- + +-SOURCE=.\HelloServer.cpp + +-# End Source File + +-# End Group + +-# End Target + +-# End Project + ++# Microsoft Developer Studio Project File - Name="HelloServer" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Console Application" 0x0103 ++ ++CFG=HelloServer - Win32 Debug ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "HelloServer.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "HelloServer.mak" CFG="HelloServer - Win32 Debug" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "HelloServer - Win32 Release" (based on "Win32 (x86) Console Application") ++!MESSAGE "HelloServer - Win32 Debug" (based on "Win32 (x86) Console Application") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "HelloServer - Win32 Release" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release" ++# PROP BASE Intermediate_Dir "Release" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release" ++# PROP Intermediate_Dir "Release" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c ++# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "NDEBUG" ++# ADD RSC /l 0x409 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" ++ ++!ELSEIF "$(CFG)" == "HelloServer - Win32 Debug" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug" ++# PROP BASE Intermediate_Dir "Debug" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "Debug" ++# PROP Intermediate_Dir "Debug" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c ++# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "_DEBUG" ++# ADD RSC /l 0x409 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "HelloServer - Win32 Release" ++# Name "HelloServer - Win32 Debug" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\HelloServer.cpp ++# End Source File ++# End Group ++# End Target ++# End Project +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.cpp +index 8a8f057..5cebf56 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.cpp +@@ -1,45 +1,45 @@ +-// TestBase64Client.cpp : A simple xmlrpc client that returns a png file + +-// encoded as base64 data to the client. + +-// + +-// Usage: TestBase64Client serverHost serverPort outputfile + +-// Requests a png file from the specified server and saves it in outputfile. + +-// Link against xmlrpc lib and whatever socket libs your system needs (ws2_32.lib on windows) + +- + +-#include "XmlRpc.h" + +-#include + +-#include + +-#include + +- + +-using namespace XmlRpc; + +- + +-int main(int argc, char* argv[]) + +-{ + +- if (argc != 4) { + +- std::cerr << "Usage: TestBase64Client serverHost serverPort outputFile\n"; + +- return -1; + +- } + +- int port = atoi(argv[2]); + +- + +- //XmlRpc::setVerbosity(5); + +- XmlRpcClient c(argv[1], port); + +- + +- XmlRpcValue noArgs, result; + +- if (c.execute("TestBase64", noArgs, result)) + +- { + +- const XmlRpcValue::BinaryData& data = result; + +- std::ofstream outfile(argv[3], std::ios::binary | std::ios::trunc); + +- if (outfile.fail()) + +- std::cerr << "Error opening " << argv[3] << " for output.\n"; + +- else + +- { + +- int n = int(data.size()); + +- for (int i=0; i ++#include ++#include ++ ++using namespace XmlRpc; ++ ++int main(int argc, char* argv[]) ++{ ++ if (argc != 4) { ++ std::cerr << "Usage: TestBase64Client serverHost serverPort outputFile\n"; ++ return -1; ++ } ++ int port = atoi(argv[2]); ++ ++ //XmlRpc::setVerbosity(5); ++ XmlRpcClient c(argv[1], port); ++ ++ XmlRpcValue noArgs, result; ++ if (c.execute("TestBase64", noArgs, result)) ++ { ++ const XmlRpcValue::BinaryData& data = result; ++ std::ofstream outfile(argv[3], std::ios::binary | std::ios::trunc); ++ if (outfile.fail()) ++ std::cerr << "Error opening " << argv[3] << " for output.\n"; ++ else ++ { ++ int n = int(data.size()); ++ for (int i=0; i + +-# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +-# ** DO NOT EDIT ** + +- + +-# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +- + +-CFG=TestBase64Client - Win32 Debug + +-!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +-!MESSAGE use the Export Makefile command and run + +-!MESSAGE + +-!MESSAGE NMAKE /f "TestBase64Client.mak". + +-!MESSAGE + +-!MESSAGE You can specify a configuration when running NMAKE + +-!MESSAGE by defining the macro CFG on the command line. For example: + +-!MESSAGE + +-!MESSAGE NMAKE /f "TestBase64Client.mak" CFG="TestBase64Client - Win32 Debug" + +-!MESSAGE + +-!MESSAGE Possible choices for configuration are: + +-!MESSAGE + +-!MESSAGE "TestBase64Client - Win32 Release" (based on "Win32 (x86) Console Application") + +-!MESSAGE "TestBase64Client - Win32 Debug" (based on "Win32 (x86) Console Application") + +-!MESSAGE + +- + +-# Begin Project + +-# PROP AllowPerConfigDependencies 0 + +-# PROP Scc_ProjName "" + +-# PROP Scc_LocalPath "" + +-CPP=cl.exe + +-RSC=rc.exe + +- + +-!IF "$(CFG)" == "TestBase64Client - Win32 Release" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 0 + +-# PROP BASE Output_Dir "Release" + +-# PROP BASE Intermediate_Dir "Release" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 0 + +-# PROP Output_Dir "Release" + +-# PROP Intermediate_Dir "Release" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c + +-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "NDEBUG" + +-# ADD RSC /l 0x409 /d "NDEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +- + +-!ELSEIF "$(CFG)" == "TestBase64Client - Win32 Debug" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 1 + +-# PROP BASE Output_Dir "Debug" + +-# PROP BASE Intermediate_Dir "Debug" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 1 + +-# PROP Output_Dir "Debug" + +-# PROP Intermediate_Dir "Debug" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c + +-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "_DEBUG" + +-# ADD RSC /l 0x409 /d "_DEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +- + +-!ENDIF + +- + +-# Begin Target + +- + +-# Name "TestBase64Client - Win32 Release" + +-# Name "TestBase64Client - Win32 Debug" + +-# Begin Group "Source Files" + +- + +-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +-# Begin Source File + +- + +-SOURCE=.\TestBase64Client.cpp + +-# End Source File + +-# End Group + +-# End Target + +-# End Project + ++# Microsoft Developer Studio Project File - Name="TestBase64Client" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Console Application" 0x0103 ++ ++CFG=TestBase64Client - Win32 Debug ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "TestBase64Client.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "TestBase64Client.mak" CFG="TestBase64Client - Win32 Debug" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "TestBase64Client - Win32 Release" (based on "Win32 (x86) Console Application") ++!MESSAGE "TestBase64Client - Win32 Debug" (based on "Win32 (x86) Console Application") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "TestBase64Client - Win32 Release" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release" ++# PROP BASE Intermediate_Dir "Release" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release" ++# PROP Intermediate_Dir "Release" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c ++# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "NDEBUG" ++# ADD RSC /l 0x409 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" ++ ++!ELSEIF "$(CFG)" == "TestBase64Client - Win32 Debug" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug" ++# PROP BASE Intermediate_Dir "Debug" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "Debug" ++# PROP Intermediate_Dir "Debug" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c ++# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "_DEBUG" ++# ADD RSC /l 0x409 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "TestBase64Client - Win32 Release" ++# Name "TestBase64Client - Win32 Debug" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\TestBase64Client.cpp ++# End Source File ++# End Group ++# End Target ++# End Project +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.cpp +index 3f78d04..c916592 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.cpp +@@ -1,68 +1,68 @@ +-// TestBase64Server.cpp : Simple XMLRPC server example. Usage: TestBase64Server serverPort + +-// + +-#if defined(_MSC_VER) + +-# pragma warning(disable:4786) // identifier was truncated in debug info + +-#endif + +- + +- + +-#include + +-#include + +-#include + +-#include + +- + +- + +-#include "XmlRpc.h" + +-using namespace XmlRpc; + +- + +- + +-// The server + +-XmlRpcServer s; + +- + +-// No arguments, result is Base64-encoded pngnow.png data. + +-class TestBase64 : public XmlRpcServerMethod + +-{ + +-public: + +- TestBase64(XmlRpcServer* s) : XmlRpcServerMethod("TestBase64", s) {} + +- + +- void execute(XmlRpcValue& params, XmlRpcValue& result) + +- { + +- std::ifstream infile("pngnow.png", std::ios::binary); + +- if (infile.fail()) + +- infile.open("../pngnow.png", std::ios::binary); + +- if (infile.fail()) + +- result = "Could not open file pngnow.png"; + +- else { + +- + +- XmlRpcValue::BinaryData& data = result; + +- int n = 0; + +- for (;; ++n) { + +- char c = infile.get(); + +- if (infile.eof()) break; + +- data.push_back(c); + +- } + +- std::cerr << "Read " << n << " bytes from pngnow.png\n"; + +- } + +- } + +-} TestBase64(&s); // This constructor registers the method with the server + +- + +- + +- + +-int main(int argc, char* argv[]) + +-{ + +- if (argc != 2) { + +- std::cerr << "Usage: TestBase64Server serverPort\n"; + +- return -1; + +- } + +- int port = atoi(argv[1]); + +- + +- //XmlRpc::setVerbosity(5); + +- + +- // Create the server socket on the specified port + +- s.bindAndListen(port); + +- + +- // Wait for requests indefinitely + +- s.work(-1.0); + +- + +- return 0; + +-} + +- + ++// TestBase64Server.cpp : Simple XMLRPC server example. Usage: TestBase64Server serverPort ++// ++#if defined(_MSC_VER) ++# pragma warning(disable:4786) // identifier was truncated in debug info ++#endif ++ ++ ++#include ++#include ++#include ++#include ++ ++ ++#include "XmlRpc.h" ++using namespace XmlRpc; ++ ++ ++// The server ++XmlRpcServer s; ++ ++// No arguments, result is Base64-encoded pngnow.png data. ++class TestBase64 : public XmlRpcServerMethod ++{ ++public: ++ TestBase64(XmlRpcServer* s) : XmlRpcServerMethod("TestBase64", s) {} ++ ++ void execute(XmlRpcValue& params, XmlRpcValue& result) ++ { ++ std::ifstream infile("pngnow.png", std::ios::binary); ++ if (infile.fail()) ++ infile.open("../pngnow.png", std::ios::binary); ++ if (infile.fail()) ++ result = "Could not open file pngnow.png"; ++ else { ++ ++ XmlRpcValue::BinaryData& data = result; ++ int n = 0; ++ for (;; ++n) { ++ char c = infile.get(); ++ if (infile.eof()) break; ++ data.push_back(c); ++ } ++ std::cerr << "Read " << n << " bytes from pngnow.png\n"; ++ } ++ } ++} TestBase64(&s); // This constructor registers the method with the server ++ ++ ++ ++int main(int argc, char* argv[]) ++{ ++ if (argc != 2) { ++ std::cerr << "Usage: TestBase64Server serverPort\n"; ++ return -1; ++ } ++ int port = atoi(argv[1]); ++ ++ //XmlRpc::setVerbosity(5); ++ ++ // Create the server socket on the specified port ++ s.bindAndListen(port); ++ ++ // Wait for requests indefinitely ++ s.work(-1.0); ++ ++ return 0; ++} ++ +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.dsp b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.dsp +index 271f9f6..0a00d33 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.dsp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.dsp +@@ -1,96 +1,96 @@ +-# Microsoft Developer Studio Project File - Name="TestBase64Server" - Package Owner=<4> + +-# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +-# ** DO NOT EDIT ** + +- + +-# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +- + +-CFG=TestBase64Server - Win32 Debug + +-!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +-!MESSAGE use the Export Makefile command and run + +-!MESSAGE + +-!MESSAGE NMAKE /f "TestBase64Server.mak". + +-!MESSAGE + +-!MESSAGE You can specify a configuration when running NMAKE + +-!MESSAGE by defining the macro CFG on the command line. For example: + +-!MESSAGE + +-!MESSAGE NMAKE /f "TestBase64Server.mak" CFG="TestBase64Server - Win32 Debug" + +-!MESSAGE + +-!MESSAGE Possible choices for configuration are: + +-!MESSAGE + +-!MESSAGE "TestBase64Server - Win32 Release" (based on "Win32 (x86) Console Application") + +-!MESSAGE "TestBase64Server - Win32 Debug" (based on "Win32 (x86) Console Application") + +-!MESSAGE + +- + +-# Begin Project + +-# PROP AllowPerConfigDependencies 0 + +-# PROP Scc_ProjName "" + +-# PROP Scc_LocalPath "" + +-CPP=cl.exe + +-RSC=rc.exe + +- + +-!IF "$(CFG)" == "TestBase64Server - Win32 Release" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 0 + +-# PROP BASE Output_Dir "Release" + +-# PROP BASE Intermediate_Dir "Release" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 0 + +-# PROP Output_Dir "Release" + +-# PROP Intermediate_Dir "Release" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c + +-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c + +-# SUBTRACT CPP /Fr /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "NDEBUG" + +-# ADD RSC /l 0x409 /d "NDEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +- + +-!ELSEIF "$(CFG)" == "TestBase64Server - Win32 Debug" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 1 + +-# PROP BASE Output_Dir "Debug" + +-# PROP BASE Intermediate_Dir "Debug" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 1 + +-# PROP Output_Dir "Debug" + +-# PROP Intermediate_Dir "Debug" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c + +-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "_DEBUG" + +-# ADD RSC /l 0x409 /d "_DEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +-# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +- + +-!ENDIF + +- + +-# Begin Target + +- + +-# Name "TestBase64Server - Win32 Release" + +-# Name "TestBase64Server - Win32 Debug" + +-# Begin Group "Source Files" + +- + +-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +-# Begin Source File + +- + +-SOURCE=.\TestBase64Server.cpp + +-# End Source File + +-# End Group + +-# End Target + +-# End Project + ++# Microsoft Developer Studio Project File - Name="TestBase64Server" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Console Application" 0x0103 ++ ++CFG=TestBase64Server - Win32 Debug ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "TestBase64Server.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "TestBase64Server.mak" CFG="TestBase64Server - Win32 Debug" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "TestBase64Server - Win32 Release" (based on "Win32 (x86) Console Application") ++!MESSAGE "TestBase64Server - Win32 Debug" (based on "Win32 (x86) Console Application") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "TestBase64Server - Win32 Release" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release" ++# PROP BASE Intermediate_Dir "Release" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release" ++# PROP Intermediate_Dir "Release" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c ++# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c ++# SUBTRACT CPP /Fr /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "NDEBUG" ++# ADD RSC /l 0x409 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" ++ ++!ELSEIF "$(CFG)" == "TestBase64Server - Win32 Debug" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug" ++# PROP BASE Intermediate_Dir "Debug" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "Debug" ++# PROP Intermediate_Dir "Debug" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c ++# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "_DEBUG" ++# ADD RSC /l 0x409 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ++# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "TestBase64Server - Win32 Release" ++# Name "TestBase64Server - Win32 Debug" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\TestBase64Server.cpp ++# End Source File ++# End Group ++# End Target ++# End Project +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp +index 4b2c1ec..ad726f1 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp +@@ -1,233 +1,233 @@ +-// TestValues.cpp : Test XML encoding and decoding of XmlRpcValues. + +- + +-#include + +- + +-#include "XmlRpcValue.h" + +- + +- + +-#include + +-#include + +- + +- + +-using namespace XmlRpc; + +- + +- + +-void testBoolean() + +-{ + +- XmlRpcValue booleanFalse(false); + +- XmlRpcValue booleanTrue(true); + +- int offset = 0; + +- XmlRpcValue booleanFalseXml("0", &offset); + +- offset = 0; + +- XmlRpcValue booleanTrueXml("1", &offset); + +- assert(booleanFalse != booleanTrue); + +- assert(booleanFalse == booleanFalseXml); + +- assert(booleanFalse != booleanTrueXml); + +- + +- if (bool(booleanFalse)) + +- assert(false); + +- + +- if ( ! bool(booleanTrue)) + +- assert(false); + +-} + +- + +-// Int + +-void testInt() + +-{ + +- XmlRpcValue int0(0); + +- XmlRpcValue int1(1); + +- XmlRpcValue int10(10); + +- XmlRpcValue int_1(-1); + +- int offset = 0; + +- XmlRpcValue int0Xml("0", &offset); + +- offset = 0; + +- XmlRpcValue int9Xml("9", &offset); + +- assert(int0 == int0Xml); + +- assert(int(int10) - int(int1) == int(int9Xml)); + +- assert(9 == int(int9Xml)); + +- assert(int(int10) + int(int_1) == int(int9Xml)); + +-} + +- + +-void testDouble() + +-{ + +- // Double + +- XmlRpcValue d(43.7); + +- int offset = 0; + +- XmlRpcValue dXml("56.3", &offset); + +- assert(double(d) + double(dXml) == 100.0); // questionable practice... + +-} + +- + +-void testString() + +-{ + +- // String + +- XmlRpcValue s("Now is the time <&"); + +- char csxml[] = "Now is the time <&"; + +- std::string ssxml = csxml; + +- int offset = 0; + +- XmlRpcValue vscXml(csxml, &offset); + +- offset = 0; + +- XmlRpcValue vssXml(ssxml, &offset); + +- assert(s == vscXml); + +- assert(s == vssXml); + +- offset = 0; + +- XmlRpcValue fromXml(vssXml.toXml(), &offset); + +- assert(s == fromXml); + +- + +- // Empty or blank strings with no tags + +- std::string emptyStringXml(""); + +- offset = 0; + +- XmlRpcValue emptyStringVal1(emptyStringXml, &offset); + +- XmlRpcValue emptyStringVal2(""); + +- assert(emptyStringVal1 == emptyStringVal2); + +- + +- emptyStringXml = " "; + +- offset = 0; + +- XmlRpcValue blankStringVal(emptyStringXml, &offset); + +- assert(std::string(blankStringVal) == " "); + +-} + +- + +- + +-void testDateTime() + +-{ + +- // DateTime + +- int offset = 0; + +- XmlRpcValue dateTime("19040101T03:12:35", &offset); + +- struct tm &t = dateTime; + +- assert(t.tm_year == 1904 && t.tm_min == 12); + +-} + +- + +- + +-void testArray(XmlRpcValue const& d) + +-{ + +- // Array + +- XmlRpcValue a; + +- a.setSize(4); + +- a[0] = 1; + +- a[1] = std::string("two"); + +- a[2] = 43.7; + +- a[3] = "four"; + +- assert(int(a[0]) == 1); + +- assert(a[2] == d); + +- + +- char csaXml[] = + +- "\n" + +- " \n" + +- " 1 \n" + +- " two\n" + +- " 43.7\n" + +- " four\n" + +- " \n" + +- ""; + +- + +- int offset = 0; + +- XmlRpcValue aXml(csaXml, &offset); + +- assert(a == aXml); + +-} + +- + +-void testStruct() + +-{ + +- // Struct + +- XmlRpcValue struct1; + +- struct1["i4"] = 1; + +- struct1["str"] = "two"; + +- struct1["d"] = 43.7; + +- + +- XmlRpcValue a; + +- a.setSize(4); + +- a[0] = 1; + +- a[1] = std::string("two"); + +- a[2] = 43.7; + +- a[3] = "four"; + +- + +- assert(struct1["d"] == a[2]); + +- + +- char csStructXml[] = + +- "\n" + +- " \n" + +- " i4 \n" + +- " 1 \n" + +- " \n" + +- " \n" + +- " d \n" + +- " 43.7\n" + +- " \n" + +- " \n" + +- " str \n" + +- " two\n" + +- " \n" + +- ""; + +- + +- int offset = 0; + +- XmlRpcValue structXml(csStructXml, &offset); + +- assert(struct1 == structXml); + +- + +- XmlRpcValue astruct; + +- astruct["array"] = a; + +- assert(astruct["array"][2] == struct1["d"]); + +- + +- for (int i=0; i<10; i++) { + +- XmlRpcValue Event; + +- Event["Name"] = "string"; + +- + +- Event.clear(); + +- + +- const int NELMTS = 100; + +- int ii; + +- + +- for (ii=0; ii< NELMTS; ++ii) { + +- char buf[40]; + +- sprintf(buf,"%d", ii); + +- Event[std::string(buf)] = buf; + +- } + +- + +- Event.clear(); + +- + +- for (ii=0; ii< NELMTS; ++ii) { + +- char buf[40]; + +- sprintf(buf,"%d", ii); + +- if (ii != NELMTS/2) + +- Event[std::string(buf)] = ii; + +- else + +- for (int jj=0; jj< NELMTS; ++jj) { + +- char bufj[40]; + +- sprintf(bufj,"%d", jj); + +- Event[std::string(buf)][std::string(bufj)] = bufj; + +- } + +- } + +- + +- for (ii=0; ii< NELMTS; ++ii) { + +- char buf[40]; + +- sprintf(buf,"%d", ii); + +- if (ii != NELMTS/2) + +- assert(Event[std::string(buf)] == XmlRpcValue(ii)); + +- else + +- assert(Event[std::string(buf)].size() == NELMTS); + +- } + +- } + +-} + +- + +- + +- + +-int main(int argc, char* argv[]) + +-{ + +- testBoolean(); + +- + +- testInt(); + +- + +- + +- testDouble(); + +- + +- + +- testString(); + +- + +- + +- testDateTime(); + +- + +- + +- testArray(43.7); + +- + +- + +- testStruct(); + +- + +- return 0; + +-} + ++// TestValues.cpp : Test XML encoding and decoding of XmlRpcValues. ++ ++#include ++ ++#include "XmlRpcValue.h" ++ ++ ++#include ++#include ++ ++ ++using namespace XmlRpc; ++ ++ ++void testBoolean() ++{ ++ XmlRpcValue booleanFalse(false); ++ XmlRpcValue booleanTrue(true); ++ int offset = 0; ++ XmlRpcValue booleanFalseXml("0", &offset); ++ offset = 0; ++ XmlRpcValue booleanTrueXml("1", &offset); ++ assert(booleanFalse != booleanTrue); ++ assert(booleanFalse == booleanFalseXml); ++ assert(booleanFalse != booleanTrueXml); ++ ++ if (bool(booleanFalse)) ++ assert(false); ++ ++ if ( ! bool(booleanTrue)) ++ assert(false); ++} ++ ++// Int ++void testInt() ++{ ++ XmlRpcValue int0(0); ++ XmlRpcValue int1(1); ++ XmlRpcValue int10(10); ++ XmlRpcValue int_1(-1); ++ int offset = 0; ++ XmlRpcValue int0Xml("0", &offset); ++ offset = 0; ++ XmlRpcValue int9Xml("9", &offset); ++ assert(int0 == int0Xml); ++ assert(int(int10) - int(int1) == int(int9Xml)); ++ assert(9 == int(int9Xml)); ++ assert(int(int10) + int(int_1) == int(int9Xml)); ++} ++ ++void testDouble() ++{ ++ // Double ++ XmlRpcValue d(43.7); ++ int offset = 0; ++ XmlRpcValue dXml("56.3", &offset); ++ assert(double(d) + double(dXml) == 100.0); // questionable practice... ++} ++ ++void testString() ++{ ++ // String ++ XmlRpcValue s("Now is the time <&"); ++ char csxml[] = "Now is the time <&"; ++ std::string ssxml = csxml; ++ int offset = 0; ++ XmlRpcValue vscXml(csxml, &offset); ++ offset = 0; ++ XmlRpcValue vssXml(ssxml, &offset); ++ assert(s == vscXml); ++ assert(s == vssXml); ++ offset = 0; ++ XmlRpcValue fromXml(vssXml.toXml(), &offset); ++ assert(s == fromXml); ++ ++ // Empty or blank strings with no tags ++ std::string emptyStringXml(""); ++ offset = 0; ++ XmlRpcValue emptyStringVal1(emptyStringXml, &offset); ++ XmlRpcValue emptyStringVal2(""); ++ assert(emptyStringVal1 == emptyStringVal2); ++ ++ emptyStringXml = " "; ++ offset = 0; ++ XmlRpcValue blankStringVal(emptyStringXml, &offset); ++ assert(std::string(blankStringVal) == " "); ++} ++ ++ ++void testDateTime() ++{ ++ // DateTime ++ int offset = 0; ++ XmlRpcValue dateTime("19040101T03:12:35", &offset); ++ struct tm &t = dateTime; ++ assert(t.tm_year == 1904 && t.tm_min == 12); ++} ++ ++ ++void testArray(XmlRpcValue const& d) ++{ ++ // Array ++ XmlRpcValue a; ++ a.setSize(4); ++ a[0] = 1; ++ a[1] = std::string("two"); ++ a[2] = 43.7; ++ a[3] = "four"; ++ assert(int(a[0]) == 1); ++ assert(a[2] == d); ++ ++ char csaXml[] = ++ "\n" ++ " \n" ++ " 1 \n" ++ " two\n" ++ " 43.7\n" ++ " four\n" ++ " \n" ++ ""; ++ ++ int offset = 0; ++ XmlRpcValue aXml(csaXml, &offset); ++ assert(a == aXml); ++} ++ ++void testStruct() ++{ ++ // Struct ++ XmlRpcValue struct1; ++ struct1["i4"] = 1; ++ struct1["str"] = "two"; ++ struct1["d"] = 43.7; ++ ++ XmlRpcValue a; ++ a.setSize(4); ++ a[0] = 1; ++ a[1] = std::string("two"); ++ a[2] = 43.7; ++ a[3] = "four"; ++ ++ assert(struct1["d"] == a[2]); ++ ++ char csStructXml[] = ++ "\n" ++ " \n" ++ " i4 \n" ++ " 1 \n" ++ " \n" ++ " \n" ++ " d \n" ++ " 43.7\n" ++ " \n" ++ " \n" ++ " str \n" ++ " two\n" ++ " \n" ++ ""; ++ ++ int offset = 0; ++ XmlRpcValue structXml(csStructXml, &offset); ++ assert(struct1 == structXml); ++ ++ XmlRpcValue astruct; ++ astruct["array"] = a; ++ assert(astruct["array"][2] == struct1["d"]); ++ ++ for (int i=0; i<10; i++) { ++ XmlRpcValue Event; ++ Event["Name"] = "string"; ++ ++ Event.clear(); ++ ++ const int NELMTS = 100; ++ int ii; ++ ++ for (ii=0; ii< NELMTS; ++ii) { ++ char buf[40]; ++ sprintf(buf,"%d", ii); ++ Event[std::string(buf)] = buf; ++ } ++ ++ Event.clear(); ++ ++ for (ii=0; ii< NELMTS; ++ii) { ++ char buf[40]; ++ sprintf(buf,"%d", ii); ++ if (ii != NELMTS/2) ++ Event[std::string(buf)] = ii; ++ else ++ for (int jj=0; jj< NELMTS; ++jj) { ++ char bufj[40]; ++ sprintf(bufj,"%d", jj); ++ Event[std::string(buf)][std::string(bufj)] = bufj; ++ } ++ } ++ ++ for (ii=0; ii< NELMTS; ++ii) { ++ char buf[40]; ++ sprintf(buf,"%d", ii); ++ if (ii != NELMTS/2) ++ assert(Event[std::string(buf)] == XmlRpcValue(ii)); ++ else ++ assert(Event[std::string(buf)].size() == NELMTS); ++ } ++ } ++} ++ ++ ++ ++int main(int argc, char* argv[]) ++{ ++ testBoolean(); ++ ++ testInt(); ++ ++ ++ testDouble(); ++ ++ ++ testString(); ++ ++ ++ testDateTime(); ++ ++ ++ testArray(43.7); ++ ++ ++ testStruct(); ++ ++ return 0; ++} +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp +index 6d35e3f..f902a70 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp +@@ -1,95 +1,95 @@ +-# Microsoft Developer Studio Project File - Name="TestValues" - Package Owner=<4> + +-# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +-# ** DO NOT EDIT ** + +- + +-# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +- + +-CFG=TestValues - Win32 Debug + +-!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +-!MESSAGE use the Export Makefile command and run + +-!MESSAGE + +-!MESSAGE NMAKE /f "TestValues.mak". + +-!MESSAGE + +-!MESSAGE You can specify a configuration when running NMAKE + +-!MESSAGE by defining the macro CFG on the command line. For example: + +-!MESSAGE + +-!MESSAGE NMAKE /f "TestValues.mak" CFG="TestValues - Win32 Debug" + +-!MESSAGE + +-!MESSAGE Possible choices for configuration are: + +-!MESSAGE + +-!MESSAGE "TestValues - Win32 Release" (based on "Win32 (x86) Console Application") + +-!MESSAGE "TestValues - Win32 Debug" (based on "Win32 (x86) Console Application") + +-!MESSAGE + +- + +-# Begin Project + +-# PROP AllowPerConfigDependencies 0 + +-# PROP Scc_ProjName "" + +-# PROP Scc_LocalPath "" + +-CPP=cl.exe + +-RSC=rc.exe + +- + +-!IF "$(CFG)" == "TestValues - Win32 Release" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 0 + +-# PROP BASE Output_Dir "Release" + +-# PROP BASE Intermediate_Dir "Release" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 0 + +-# PROP Output_Dir "Release" + +-# PROP Intermediate_Dir "Release" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c + +-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c + +-# ADD BASE RSC /l 0x409 /d "NDEBUG" + +-# ADD RSC /l 0x409 /d "NDEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +-# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\Release" + +- + +-!ELSEIF "$(CFG)" == "TestValues - Win32 Debug" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 1 + +-# PROP BASE Output_Dir "Debug" + +-# PROP BASE Intermediate_Dir "Debug" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 1 + +-# PROP Output_Dir "Debug" + +-# PROP Intermediate_Dir "Debug" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c + +-# ADD CPP /MDd /W3 /GX /Zi /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c + +-# SUBTRACT CPP /nologo + +-# ADD BASE RSC /l 0x409 /d "_DEBUG" + +-# ADD RSC /l 0x409 /d "_DEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +-# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +- + +-!ENDIF + +- + +-# Begin Target + +- + +-# Name "TestValues - Win32 Release" + +-# Name "TestValues - Win32 Debug" + +-# Begin Group "Source Files" + +- + +-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +-# Begin Source File + +- + +-SOURCE=.\TestValuesWin32.cpp + +-# End Source File + +-# End Group + +-# End Target + +-# End Project + ++# Microsoft Developer Studio Project File - Name="TestValues" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Console Application" 0x0103 ++ ++CFG=TestValues - Win32 Debug ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "TestValues.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "TestValues.mak" CFG="TestValues - Win32 Debug" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "TestValues - Win32 Release" (based on "Win32 (x86) Console Application") ++!MESSAGE "TestValues - Win32 Debug" (based on "Win32 (x86) Console Application") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "TestValues - Win32 Release" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release" ++# PROP BASE Intermediate_Dir "Release" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release" ++# PROP Intermediate_Dir "Release" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ++# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ++# ADD BASE RSC /l 0x409 /d "NDEBUG" ++# ADD RSC /l 0x409 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ++# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\Release" ++ ++!ELSEIF "$(CFG)" == "TestValues - Win32 Debug" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug" ++# PROP BASE Intermediate_Dir "Debug" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "Debug" ++# PROP Intermediate_Dir "Debug" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c ++# ADD CPP /MDd /W3 /GX /Zi /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c ++# SUBTRACT CPP /nologo ++# ADD BASE RSC /l 0x409 /d "_DEBUG" ++# ADD RSC /l 0x409 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ++# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "TestValues - Win32 Release" ++# Name "TestValues - Win32 Debug" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\TestValuesWin32.cpp ++# End Source File ++# End Group ++# End Target ++# End Project +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestValuesWin32.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestValuesWin32.cpp +index b5136c7..29658cd 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/TestValuesWin32.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/TestValuesWin32.cpp +@@ -1,253 +1,253 @@ +-// TestValues.cpp : Test XML encoding and decoding of XmlRpcValues. + +- + +-#define _CRTDBG_MAP_ALLOC + +-#include + +-#include + +- + +-#include "XmlRpcValue.h" + +- + +- + +-#include + +-#include + +- + +- + +-using namespace XmlRpc; + +- + +- + +-void testBoolean() + +-{ + +- XmlRpcValue booleanFalse(false); + +- XmlRpcValue booleanTrue(true); + +- int offset = 0; + +- XmlRpcValue booleanFalseXml("0", &offset); + +- offset = 0; + +- XmlRpcValue booleanTrueXml("1", &offset); + +- assert(booleanFalse != booleanTrue); + +- assert(booleanFalse == booleanFalseXml); + +- assert(booleanFalse == booleanFalseXml); + +- if (booleanFalse) + +- assert(false); + +- + +- if (booleanTrue) + +- assert( ! false); + +- else + +- assert(false); + +-} + +- + +-// Int + +-void testInt() + +-{ + +- XmlRpcValue int0(0); + +- XmlRpcValue int1(1); + +- XmlRpcValue int10(10); + +- XmlRpcValue int_1(-1); + +- int offset = 0; + +- XmlRpcValue int0Xml("0", &offset); + +- offset = 0; + +- XmlRpcValue int9Xml("9", &offset); + +- assert(int0 == int0Xml); + +- assert(int(int10) - int(int1) == int(int9Xml)); + +- assert(9 == int(int9Xml)); + +- assert(int(int10) + int(int_1) == int(int9Xml)); + +-} + +- + +-void testDouble() + +-{ + +- // Double + +- XmlRpcValue d(43.7); + +- int offset = 0; + +- XmlRpcValue dXml("56.3", &offset); + +- assert(double(d) + double(dXml) == 100.0); // questionable practice... + +-} + +- + +-void testString() + +-{ + +- // String + +- XmlRpcValue s("Now is the time <&"); + +- char csxml[] = "Now is the time <&"; + +- std::string ssxml = csxml; + +- int offset = 0; + +- XmlRpcValue vscXml(csxml, &offset); + +- offset = 0; + +- XmlRpcValue vssXml(ssxml, &offset); + +- assert(s == vscXml); + +- assert(s == vssXml); + +- offset = 0; + +- XmlRpcValue fromXml(vssXml.toXml(), &offset); + +- assert(s == fromXml); + +- + +- // Empty or blank strings with no tags + +- std::string emptyStringXml(""); + +- offset = 0; + +- XmlRpcValue emptyStringVal1(emptyStringXml, &offset); + +- XmlRpcValue emptyStringVal2(""); + +- assert(emptyStringVal1 == emptyStringVal2); + +- + +- emptyStringXml = " "; + +- offset = 0; + +- XmlRpcValue blankStringVal(emptyStringXml, &offset); + +- assert(std::string(blankStringVal) == " "); + +-} + +- + +- + +-void testDateTime() + +-{ + +- // DateTime + +- int offset = 0; + +- XmlRpcValue dateTime("19040101T03:12:35", &offset); + +- struct tm &t = dateTime; + +- assert(t.tm_year == 1904 && t.tm_min == 12); + +-} + +- + +- + +-void testArray(XmlRpcValue const& d) + +-{ + +- // Array + +- XmlRpcValue a; + +- a.setSize(4); + +- a[0] = 1; + +- a[1] = std::string("two"); + +- a[2] = 43.7; + +- a[3] = "four"; + +- assert(int(a[0]) == 1); + +- assert(a[2] == d); + +- + +- char csaXml[] = + +- "\n" + +- " \n" + +- " 1 \n" + +- " two\n" + +- " 43.7\n" + +- " four\n" + +- " \n" + +- ""; + +- + +- int offset = 0; + +- XmlRpcValue aXml(csaXml, &offset); + +- assert(a == aXml); + +-} + +- + +-void testStruct() + +-{ + +- // Struct + +- XmlRpcValue struct1; + +- struct1["i4"] = 1; + +- struct1["str"] = "two"; + +- struct1["d"] = 43.7; + +- + +- XmlRpcValue a; + +- a.setSize(4); + +- a[0] = 1; + +- a[1] = std::string("two"); + +- a[2] = 43.7; + +- a[3] = "four"; + +- + +- assert(struct1["d"] == a[2]); + +- + +- char csStructXml[] = + +- "\n" + +- " \n" + +- " i4 \n" + +- " 1 \n" + +- " \n" + +- " \n" + +- " d \n" + +- " 43.7\n" + +- " \n" + +- " \n" + +- " str \n" + +- " two\n" + +- " \n" + +- ""; + +- + +- int offset = 0; + +- XmlRpcValue structXml(csStructXml, &offset); + +- assert(struct1 == structXml); + +- + +- XmlRpcValue astruct; + +- astruct["array"] = a; + +- assert(astruct["array"][2] == struct1["d"]); + +- + +- for (int i=0; i<10; i++) { + +- XmlRpcValue Event; + +- Event["Name"] = "string"; + +- + +- Event.clear(); + +- + +- const int NELMTS = 100; + +- int ii; + +- + +- for (ii=0; ii< NELMTS; ++ii) { + +- char buf[40]; + +- sprintf(buf,"%d", ii); + +- Event[buf] = buf; + +- } + +- + +- Event.clear(); + +- + +- for (ii=0; ii< NELMTS; ++ii) { + +- char buf[40]; + +- sprintf(buf,"%d", ii); + +- if (ii != NELMTS/2) + +- Event[buf] = ii; + +- else + +- for (int jj=0; jj< NELMTS; ++jj) { + +- char bufj[40]; + +- sprintf(bufj,"%d", jj); + +- Event[buf][bufj] = bufj; + +- } + +- } + +- + +- for (ii=0; ii< NELMTS; ++ii) { + +- char buf[40]; + +- sprintf(buf,"%d", ii); + +- if (ii != NELMTS/2) + +- assert(Event[buf] == XmlRpcValue(ii)); + +- else + +- assert(Event[buf].size() == NELMTS); + +- } + +- } + +-} + +- + +- + +- + +-int main(int argc, char* argv[]) + +-{ + +- _CrtDumpMemoryLeaks(); + +- _CrtCheckMemory( ); + +- + +- testBoolean(); + +- _CrtDumpMemoryLeaks(); + +- _CrtCheckMemory( ); + +- + +- testInt(); + +- _CrtDumpMemoryLeaks(); + +- _CrtCheckMemory( ); + +- + +- + +- testDouble(); + +- _CrtDumpMemoryLeaks(); + +- _CrtCheckMemory( ); + +- + +- + +- testString(); + +- _CrtDumpMemoryLeaks(); + +- _CrtCheckMemory( ); + +- + +- + +- testDateTime(); + +- _CrtDumpMemoryLeaks(); + +- _CrtCheckMemory( ); + +- + +- + +- testArray(43.7); + +- _CrtDumpMemoryLeaks(); + +- _CrtCheckMemory( ); + +- + +- + +- testStruct(); + +- _CrtDumpMemoryLeaks(); + +- _CrtCheckMemory( ); + +- + +- return 0; + +-} + ++// TestValues.cpp : Test XML encoding and decoding of XmlRpcValues. ++ ++#define _CRTDBG_MAP_ALLOC ++#include ++#include ++ ++#include "XmlRpcValue.h" ++ ++ ++#include ++#include ++ ++ ++using namespace XmlRpc; ++ ++ ++void testBoolean() ++{ ++ XmlRpcValue booleanFalse(false); ++ XmlRpcValue booleanTrue(true); ++ int offset = 0; ++ XmlRpcValue booleanFalseXml("0", &offset); ++ offset = 0; ++ XmlRpcValue booleanTrueXml("1", &offset); ++ assert(booleanFalse != booleanTrue); ++ assert(booleanFalse == booleanFalseXml); ++ assert(booleanFalse == booleanFalseXml); ++ if (booleanFalse) ++ assert(false); ++ ++ if (booleanTrue) ++ assert( ! false); ++ else ++ assert(false); ++} ++ ++// Int ++void testInt() ++{ ++ XmlRpcValue int0(0); ++ XmlRpcValue int1(1); ++ XmlRpcValue int10(10); ++ XmlRpcValue int_1(-1); ++ int offset = 0; ++ XmlRpcValue int0Xml("0", &offset); ++ offset = 0; ++ XmlRpcValue int9Xml("9", &offset); ++ assert(int0 == int0Xml); ++ assert(int(int10) - int(int1) == int(int9Xml)); ++ assert(9 == int(int9Xml)); ++ assert(int(int10) + int(int_1) == int(int9Xml)); ++} ++ ++void testDouble() ++{ ++ // Double ++ XmlRpcValue d(43.7); ++ int offset = 0; ++ XmlRpcValue dXml("56.3", &offset); ++ assert(double(d) + double(dXml) == 100.0); // questionable practice... ++} ++ ++void testString() ++{ ++ // String ++ XmlRpcValue s("Now is the time <&"); ++ char csxml[] = "Now is the time <&"; ++ std::string ssxml = csxml; ++ int offset = 0; ++ XmlRpcValue vscXml(csxml, &offset); ++ offset = 0; ++ XmlRpcValue vssXml(ssxml, &offset); ++ assert(s == vscXml); ++ assert(s == vssXml); ++ offset = 0; ++ XmlRpcValue fromXml(vssXml.toXml(), &offset); ++ assert(s == fromXml); ++ ++ // Empty or blank strings with no tags ++ std::string emptyStringXml(""); ++ offset = 0; ++ XmlRpcValue emptyStringVal1(emptyStringXml, &offset); ++ XmlRpcValue emptyStringVal2(""); ++ assert(emptyStringVal1 == emptyStringVal2); ++ ++ emptyStringXml = " "; ++ offset = 0; ++ XmlRpcValue blankStringVal(emptyStringXml, &offset); ++ assert(std::string(blankStringVal) == " "); ++} ++ ++ ++void testDateTime() ++{ ++ // DateTime ++ int offset = 0; ++ XmlRpcValue dateTime("19040101T03:12:35", &offset); ++ struct tm &t = dateTime; ++ assert(t.tm_year == 1904 && t.tm_min == 12); ++} ++ ++ ++void testArray(XmlRpcValue const& d) ++{ ++ // Array ++ XmlRpcValue a; ++ a.setSize(4); ++ a[0] = 1; ++ a[1] = std::string("two"); ++ a[2] = 43.7; ++ a[3] = "four"; ++ assert(int(a[0]) == 1); ++ assert(a[2] == d); ++ ++ char csaXml[] = ++ "\n" ++ " \n" ++ " 1 \n" ++ " two\n" ++ " 43.7\n" ++ " four\n" ++ " \n" ++ ""; ++ ++ int offset = 0; ++ XmlRpcValue aXml(csaXml, &offset); ++ assert(a == aXml); ++} ++ ++void testStruct() ++{ ++ // Struct ++ XmlRpcValue struct1; ++ struct1["i4"] = 1; ++ struct1["str"] = "two"; ++ struct1["d"] = 43.7; ++ ++ XmlRpcValue a; ++ a.setSize(4); ++ a[0] = 1; ++ a[1] = std::string("two"); ++ a[2] = 43.7; ++ a[3] = "four"; ++ ++ assert(struct1["d"] == a[2]); ++ ++ char csStructXml[] = ++ "\n" ++ " \n" ++ " i4 \n" ++ " 1 \n" ++ " \n" ++ " \n" ++ " d \n" ++ " 43.7\n" ++ " \n" ++ " \n" ++ " str \n" ++ " two\n" ++ " \n" ++ ""; ++ ++ int offset = 0; ++ XmlRpcValue structXml(csStructXml, &offset); ++ assert(struct1 == structXml); ++ ++ XmlRpcValue astruct; ++ astruct["array"] = a; ++ assert(astruct["array"][2] == struct1["d"]); ++ ++ for (int i=0; i<10; i++) { ++ XmlRpcValue Event; ++ Event["Name"] = "string"; ++ ++ Event.clear(); ++ ++ const int NELMTS = 100; ++ int ii; ++ ++ for (ii=0; ii< NELMTS; ++ii) { ++ char buf[40]; ++ sprintf(buf,"%d", ii); ++ Event[buf] = buf; ++ } ++ ++ Event.clear(); ++ ++ for (ii=0; ii< NELMTS; ++ii) { ++ char buf[40]; ++ sprintf(buf,"%d", ii); ++ if (ii != NELMTS/2) ++ Event[buf] = ii; ++ else ++ for (int jj=0; jj< NELMTS; ++jj) { ++ char bufj[40]; ++ sprintf(bufj,"%d", jj); ++ Event[buf][bufj] = bufj; ++ } ++ } ++ ++ for (ii=0; ii< NELMTS; ++ii) { ++ char buf[40]; ++ sprintf(buf,"%d", ii); ++ if (ii != NELMTS/2) ++ assert(Event[buf] == XmlRpcValue(ii)); ++ else ++ assert(Event[buf].size() == NELMTS); ++ } ++ } ++} ++ ++ ++ ++int main(int argc, char* argv[]) ++{ ++ _CrtDumpMemoryLeaks(); ++ _CrtCheckMemory( ); ++ ++ testBoolean(); ++ _CrtDumpMemoryLeaks(); ++ _CrtCheckMemory( ); ++ ++ testInt(); ++ _CrtDumpMemoryLeaks(); ++ _CrtCheckMemory( ); ++ ++ ++ testDouble(); ++ _CrtDumpMemoryLeaks(); ++ _CrtCheckMemory( ); ++ ++ ++ testString(); ++ _CrtDumpMemoryLeaks(); ++ _CrtCheckMemory( ); ++ ++ ++ testDateTime(); ++ _CrtDumpMemoryLeaks(); ++ _CrtCheckMemory( ); ++ ++ ++ testArray(43.7); ++ _CrtDumpMemoryLeaks(); ++ _CrtCheckMemory( ); ++ ++ ++ testStruct(); ++ _CrtDumpMemoryLeaks(); ++ _CrtCheckMemory( ); ++ ++ return 0; ++} +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp +index 58b96ed..2107df1 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp +@@ -1,53 +1,53 @@ +-// TestXml.cpp : Test XML encoding and decoding. + +-// The characters <>&'" are illegal in xml and must be encoded. + +- + +- + +-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +- + +-#include + +-// If you are using MSVC++6, you should update to fix + +-// BUG: getline Template Function Reads Extra Character + +-#include + +-#include + +-#include + +- + +-#include "XmlRpcUtil.h" + +- + +-using namespace XmlRpc; + +- + +- + +-int main(int argc, char* argv[]) + +-{ + +- // Basic tests + +- std::string empty; + +- assert(empty == XmlRpcUtil::xmlEncode(empty)); + +- assert(empty == XmlRpcUtil::xmlDecode(empty)); + +- assert(empty == XmlRpcUtil::xmlEncode("")); + +- assert(empty == XmlRpcUtil::xmlDecode("")); + +- + +- std::string raw("<>&'\""); + +- assert(XmlRpcUtil::xmlDecode(XmlRpcUtil::xmlEncode(raw)) == raw); + +- + +- std::cout << "Basic tests passed.\n"; + +- + +- // Interactive tests + +- std::string s; + +- for (;;) { + +- std::cout << "\nEnter line of raw text to encode:\n"; + +- std::getline(std::cin, s); + +- if (s.empty()) break; + +- + +- std::cout << XmlRpcUtil::xmlEncode(s) << std::endl; + +- } + +- + +- for (;;) { + +- std::cout << "\nEnter line of xml-encoded text to decode:\n"; + +- std::getline(std::cin, s); + +- if (s.empty()) break; + +- + +- std::cout << XmlRpcUtil::xmlDecode(s) << std::endl; + +- } + +- + +- return 0; + +-} + +- + ++// TestXml.cpp : Test XML encoding and decoding. ++// The characters <>&'" are illegal in xml and must be encoded. ++ ++ ++#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers ++ ++#include ++// If you are using MSVC++6, you should update to fix ++// BUG: getline Template Function Reads Extra Character ++#include ++#include ++#include ++ ++#include "XmlRpcUtil.h" ++ ++using namespace XmlRpc; ++ ++ ++int main(int argc, char* argv[]) ++{ ++ // Basic tests ++ std::string empty; ++ assert(empty == XmlRpcUtil::xmlEncode(empty)); ++ assert(empty == XmlRpcUtil::xmlDecode(empty)); ++ assert(empty == XmlRpcUtil::xmlEncode("")); ++ assert(empty == XmlRpcUtil::xmlDecode("")); ++ ++ std::string raw("<>&'\""); ++ assert(XmlRpcUtil::xmlDecode(XmlRpcUtil::xmlEncode(raw)) == raw); ++ ++ std::cout << "Basic tests passed.\n"; ++ ++ // Interactive tests ++ std::string s; ++ for (;;) { ++ std::cout << "\nEnter line of raw text to encode:\n"; ++ std::getline(std::cin, s); ++ if (s.empty()) break; ++ ++ std::cout << XmlRpcUtil::xmlEncode(s) << std::endl; ++ } ++ ++ for (;;) { ++ std::cout << "\nEnter line of xml-encoded text to decode:\n"; ++ std::getline(std::cin, s); ++ if (s.empty()) break; ++ ++ std::cout << XmlRpcUtil::xmlDecode(s) << std::endl; ++ } ++ ++ return 0; ++} ++ +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp +index 30758b2..791976d 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp +@@ -1,96 +1,96 @@ +-# Microsoft Developer Studio Project File - Name="TestXml" - Package Owner=<4> + +-# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +-# ** DO NOT EDIT ** + +- + +-# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +- + +-CFG=TestXml - Win32 Debug + +-!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +-!MESSAGE use the Export Makefile command and run + +-!MESSAGE + +-!MESSAGE NMAKE /f "TestXml.mak". + +-!MESSAGE + +-!MESSAGE You can specify a configuration when running NMAKE + +-!MESSAGE by defining the macro CFG on the command line. For example: + +-!MESSAGE + +-!MESSAGE NMAKE /f "TestXml.mak" CFG="TestXml - Win32 Debug" + +-!MESSAGE + +-!MESSAGE Possible choices for configuration are: + +-!MESSAGE + +-!MESSAGE "TestXml - Win32 Release" (based on "Win32 (x86) Console Application") + +-!MESSAGE "TestXml - Win32 Debug" (based on "Win32 (x86) Console Application") + +-!MESSAGE + +- + +-# Begin Project + +-# PROP AllowPerConfigDependencies 0 + +-# PROP Scc_ProjName "" + +-# PROP Scc_LocalPath "" + +-CPP=cl.exe + +-RSC=rc.exe + +- + +-!IF "$(CFG)" == "TestXml - Win32 Release" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 0 + +-# PROP BASE Output_Dir "Release" + +-# PROP BASE Intermediate_Dir "Release" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 0 + +-# PROP Output_Dir "Release" + +-# PROP Intermediate_Dir "Release" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c + +-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "NDEBUG" + +-# ADD RSC /l 0x409 /d "NDEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +-# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +- + +-!ELSEIF "$(CFG)" == "TestXml - Win32 Debug" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 1 + +-# PROP BASE Output_Dir "Debug" + +-# PROP BASE Intermediate_Dir "Debug" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 1 + +-# PROP Output_Dir "Debug" + +-# PROP Intermediate_Dir "Debug" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c + +-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "_DEBUG" + +-# ADD RSC /l 0x409 /d "_DEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +-# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +- + +-!ENDIF + +- + +-# Begin Target + +- + +-# Name "TestXml - Win32 Release" + +-# Name "TestXml - Win32 Debug" + +-# Begin Group "Source Files" + +- + +-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +-# Begin Source File + +- + +-SOURCE=.\TestXml.cpp + +-# End Source File + +-# End Group + +-# End Target + +-# End Project + ++# Microsoft Developer Studio Project File - Name="TestXml" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Console Application" 0x0103 ++ ++CFG=TestXml - Win32 Debug ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "TestXml.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "TestXml.mak" CFG="TestXml - Win32 Debug" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "TestXml - Win32 Release" (based on "Win32 (x86) Console Application") ++!MESSAGE "TestXml - Win32 Debug" (based on "Win32 (x86) Console Application") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "TestXml - Win32 Release" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release" ++# PROP BASE Intermediate_Dir "Release" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release" ++# PROP Intermediate_Dir "Release" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c ++# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "NDEBUG" ++# ADD RSC /l 0x409 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ++# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" ++ ++!ELSEIF "$(CFG)" == "TestXml - Win32 Debug" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug" ++# PROP BASE Intermediate_Dir "Debug" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "Debug" ++# PROP Intermediate_Dir "Debug" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c ++# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "_DEBUG" ++# ADD RSC /l 0x409 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ++# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "TestXml - Win32 Release" ++# Name "TestXml - Win32 Debug" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\TestXml.cpp ++# End Source File ++# End Group ++# End Target ++# End Project +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp b/extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp +index df4090d..95ce1cc 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp +@@ -1,207 +1,207 @@ +-// Validator.cpp : XMLRPC server based on the compliancy test at validator.xmlrpc.com. + +-// + +-#include "XmlRpc.h" + +-using namespace XmlRpc; + +- + +-#include + +- + +- + +-XmlRpcServer s; + +- + +- + +-// One argument is passed, an array of structs, each with a member named curly with + +-// an integer value. Return the sum of those values. + +- + +-class ArrayOfStructsTest : public XmlRpcServerMethod + +-{ + +-public: + +- ArrayOfStructsTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.arrayOfStructsTest", s) {} + +- + +- void execute(XmlRpcValue& params, XmlRpcValue& result) + +- { + +- std::cerr << "ArrayOfStructsTest\n"; + +- XmlRpcValue& arg1 = params[0]; + +- int n = arg1.size(), sum = 0; + +- for (int i=0; i, &, ' and ". + +-// The handler must return a struct that contains five fields, all numbers: ctLeftAngleBrackets, + +-// ctRightAngleBrackets, ctAmpersands, ctApostrophes, ctQuotes. + +-// To validate, the numbers must be correct. + +- + +-class CountTheEntities : public XmlRpcServerMethod + +-{ + +-public: + +- CountTheEntities(XmlRpcServer* s) : XmlRpcServerMethod("validator1.countTheEntities", s) {} + +- + +- void execute(XmlRpcValue& params, XmlRpcValue& result) + +- { + +- std::cerr << "CountTheEntities\n"; + +- std::string& arg = params[0]; + +- int ctLeftAngleBrackets = 0; + +- int ctRightAngleBrackets = 0; + +- int ctAmpersands = 0; + +- int ctApostrophes = 0; + +- int ctQuotes = 0; + +- + +- int n = int(arg.length()); + +- for (int i=0; i': ++ctRightAngleBrackets; break; + +- case '&': ++ctAmpersands; break; + +- case '\'': ++ctApostrophes; break; + +- case '\"': ++ctQuotes; break; + +- } + +- + +- result["ctLeftAngleBrackets"] = ctLeftAngleBrackets; + +- result["ctRightAngleBrackets"] = ctRightAngleBrackets; + +- result["ctAmpersands"] = ctAmpersands; + +- result["ctApostrophes"] = ctApostrophes; + +- result["ctQuotes"] = ctQuotes; + +- } + +-} countTheEntities(&s); + +- + +- + +- + +-// This handler takes a single parameter, a struct, containing at least three elements + +-// named moe, larry and curly, all s. Your handler must add the three numbers and + +-// return the result. + +- + +-class EasyStructTest : public XmlRpcServerMethod + +-{ + +-public: + +- EasyStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.easyStructTest", s) {} + +- + +- void execute(XmlRpcValue& params, XmlRpcValue& result) + +- { + +- std::cerr << "EasyStructTest\n"; + +- XmlRpcValue& arg1 = params[0]; + +- int sum = int(arg1["moe"]) + int(arg1["larry"]) + int(arg1["curly"]); + +- result = sum; + +- } + +-} easyStructTest(&s); + +- + +- + +-// This handler takes a single parameter, a struct. Your handler must return the struct. + +- + +-class EchoStructTest : public XmlRpcServerMethod + +-{ + +-public: + +- EchoStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.echoStructTest", s) {} + +- + +- void execute(XmlRpcValue& params, XmlRpcValue& result) + +- { + +- std::cerr << "EchoStructTest\n"; + +- result = params[0]; + +- } + +-} echoStructTest(&s); + +- + +- + +- + +-// This handler takes six parameters, and returns an array containing all the parameters. + +- + +-class ManyTypesTest : public XmlRpcServerMethod + +-{ + +-public: + +- ManyTypesTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.manyTypesTest", s) {} + +- + +- void execute(XmlRpcValue& params, XmlRpcValue& result) + +- { + +- std::cerr << "ManyTypesTest\n"; + +- result = params; + +- } + +-} manyTypesTest(&s); + +- + +- + +- + +-// This handler takes a single parameter, which is an array containing between 100 and + +-// 200 elements. Each of the items is a string, your handler must return a string + +-// containing the concatenated text of the first and last elements. + +- + +- + +-class ModerateSizeArrayCheck : public XmlRpcServerMethod + +-{ + +-public: + +- ModerateSizeArrayCheck(XmlRpcServer* s) : XmlRpcServerMethod("validator1.moderateSizeArrayCheck", s) {} + +- + +- void execute(XmlRpcValue& params, XmlRpcValue& result) + +- { + +- std::cerr << "ModerateSizeArrayCheck\n"; + +- std::string s = params[0][0]; + +- s += params[0][params[0].size()-1]; + +- result = s; + +- } + +-} moderateSizeArrayCheck(&s); + +- + +- + +-// This handler takes a single parameter, a struct, that models a daily calendar. + +-// At the top level, there is one struct for each year. Each year is broken down + +-// into months, and months into days. Most of the days are empty in the struct + +-// you receive, but the entry for April 1, 2000 contains a least three elements + +-// named moe, larry and curly, all s. Your handler must add the three numbers + +-// and return the result. + +- + +-class NestedStructTest : public XmlRpcServerMethod + +-{ + +-public: + +- NestedStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.nestedStructTest", s) {} + +- + +- void execute(XmlRpcValue& params, XmlRpcValue& result) + +- { + +- std::cerr << "NestedStructTest\n"; + +- XmlRpcValue& dayStruct = params[0]["2000"]["04"]["01"]; + +- int sum = int(dayStruct["moe"]) + int(dayStruct["larry"]) + int(dayStruct["curly"]); + +- result = sum; + +- } + +-} nestedStructTest(&s); + +- + +- + +- + +-// This handler takes one parameter, and returns a struct containing three elements, + +-// times10, times100 and times1000, the result of multiplying the number by 10, 100 and 1000. + +- + +-class SimpleStructReturnTest : public XmlRpcServerMethod + +-{ + +-public: + +- SimpleStructReturnTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.simpleStructReturnTest", s) {} + +- + +- void execute(XmlRpcValue& params, XmlRpcValue& result) + +- { + +- std::cerr << "SimpleStructReturnTest\n"; + +- int n = params[0]; + +- result["times10"] = n * 10; + +- result["times100"] = n * 100; + +- result["times1000"] = n * 1000; + +- } + +-} simpleStructReturnTest(&s); + +- + +- + +- + +-int main(int argc, char* argv[]) + +-{ + +- if (argc != 2) { + +- std::cerr << "Usage: Validator port\n"; + +- return -1; + +- } + +- int port = atoi(argv[1]); + +- + +- XmlRpc::setVerbosity(5); + +- + +- // Create the server socket on the specified port + +- s.bindAndListen(port); + +- + +- // Wait for requests indefinitely + +- s.work(-1.0); + +- + +- return 0; + +-} + +- + ++// Validator.cpp : XMLRPC server based on the compliancy test at validator.xmlrpc.com. ++// ++#include "XmlRpc.h" ++using namespace XmlRpc; ++ ++#include ++ ++ ++XmlRpcServer s; ++ ++ ++// One argument is passed, an array of structs, each with a member named curly with ++// an integer value. Return the sum of those values. ++ ++class ArrayOfStructsTest : public XmlRpcServerMethod ++{ ++public: ++ ArrayOfStructsTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.arrayOfStructsTest", s) {} ++ ++ void execute(XmlRpcValue& params, XmlRpcValue& result) ++ { ++ std::cerr << "ArrayOfStructsTest\n"; ++ XmlRpcValue& arg1 = params[0]; ++ int n = arg1.size(), sum = 0; ++ for (int i=0; i, &, ' and ". ++// The handler must return a struct that contains five fields, all numbers: ctLeftAngleBrackets, ++// ctRightAngleBrackets, ctAmpersands, ctApostrophes, ctQuotes. ++// To validate, the numbers must be correct. ++ ++class CountTheEntities : public XmlRpcServerMethod ++{ ++public: ++ CountTheEntities(XmlRpcServer* s) : XmlRpcServerMethod("validator1.countTheEntities", s) {} ++ ++ void execute(XmlRpcValue& params, XmlRpcValue& result) ++ { ++ std::cerr << "CountTheEntities\n"; ++ std::string& arg = params[0]; ++ int ctLeftAngleBrackets = 0; ++ int ctRightAngleBrackets = 0; ++ int ctAmpersands = 0; ++ int ctApostrophes = 0; ++ int ctQuotes = 0; ++ ++ int n = int(arg.length()); ++ for (int i=0; i': ++ctRightAngleBrackets; break; ++ case '&': ++ctAmpersands; break; ++ case '\'': ++ctApostrophes; break; ++ case '\"': ++ctQuotes; break; ++ } ++ ++ result["ctLeftAngleBrackets"] = ctLeftAngleBrackets; ++ result["ctRightAngleBrackets"] = ctRightAngleBrackets; ++ result["ctAmpersands"] = ctAmpersands; ++ result["ctApostrophes"] = ctApostrophes; ++ result["ctQuotes"] = ctQuotes; ++ } ++} countTheEntities(&s); ++ ++ ++ ++// This handler takes a single parameter, a struct, containing at least three elements ++// named moe, larry and curly, all s. Your handler must add the three numbers and ++// return the result. ++ ++class EasyStructTest : public XmlRpcServerMethod ++{ ++public: ++ EasyStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.easyStructTest", s) {} ++ ++ void execute(XmlRpcValue& params, XmlRpcValue& result) ++ { ++ std::cerr << "EasyStructTest\n"; ++ XmlRpcValue& arg1 = params[0]; ++ int sum = int(arg1["moe"]) + int(arg1["larry"]) + int(arg1["curly"]); ++ result = sum; ++ } ++} easyStructTest(&s); ++ ++ ++// This handler takes a single parameter, a struct. Your handler must return the struct. ++ ++class EchoStructTest : public XmlRpcServerMethod ++{ ++public: ++ EchoStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.echoStructTest", s) {} ++ ++ void execute(XmlRpcValue& params, XmlRpcValue& result) ++ { ++ std::cerr << "EchoStructTest\n"; ++ result = params[0]; ++ } ++} echoStructTest(&s); ++ ++ ++ ++// This handler takes six parameters, and returns an array containing all the parameters. ++ ++class ManyTypesTest : public XmlRpcServerMethod ++{ ++public: ++ ManyTypesTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.manyTypesTest", s) {} ++ ++ void execute(XmlRpcValue& params, XmlRpcValue& result) ++ { ++ std::cerr << "ManyTypesTest\n"; ++ result = params; ++ } ++} manyTypesTest(&s); ++ ++ ++ ++// This handler takes a single parameter, which is an array containing between 100 and ++// 200 elements. Each of the items is a string, your handler must return a string ++// containing the concatenated text of the first and last elements. ++ ++ ++class ModerateSizeArrayCheck : public XmlRpcServerMethod ++{ ++public: ++ ModerateSizeArrayCheck(XmlRpcServer* s) : XmlRpcServerMethod("validator1.moderateSizeArrayCheck", s) {} ++ ++ void execute(XmlRpcValue& params, XmlRpcValue& result) ++ { ++ std::cerr << "ModerateSizeArrayCheck\n"; ++ std::string s = params[0][0]; ++ s += params[0][params[0].size()-1]; ++ result = s; ++ } ++} moderateSizeArrayCheck(&s); ++ ++ ++// This handler takes a single parameter, a struct, that models a daily calendar. ++// At the top level, there is one struct for each year. Each year is broken down ++// into months, and months into days. Most of the days are empty in the struct ++// you receive, but the entry for April 1, 2000 contains a least three elements ++// named moe, larry and curly, all s. Your handler must add the three numbers ++// and return the result. ++ ++class NestedStructTest : public XmlRpcServerMethod ++{ ++public: ++ NestedStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.nestedStructTest", s) {} ++ ++ void execute(XmlRpcValue& params, XmlRpcValue& result) ++ { ++ std::cerr << "NestedStructTest\n"; ++ XmlRpcValue& dayStruct = params[0]["2000"]["04"]["01"]; ++ int sum = int(dayStruct["moe"]) + int(dayStruct["larry"]) + int(dayStruct["curly"]); ++ result = sum; ++ } ++} nestedStructTest(&s); ++ ++ ++ ++// This handler takes one parameter, and returns a struct containing three elements, ++// times10, times100 and times1000, the result of multiplying the number by 10, 100 and 1000. ++ ++class SimpleStructReturnTest : public XmlRpcServerMethod ++{ ++public: ++ SimpleStructReturnTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.simpleStructReturnTest", s) {} ++ ++ void execute(XmlRpcValue& params, XmlRpcValue& result) ++ { ++ std::cerr << "SimpleStructReturnTest\n"; ++ int n = params[0]; ++ result["times10"] = n * 10; ++ result["times100"] = n * 100; ++ result["times1000"] = n * 1000; ++ } ++} simpleStructReturnTest(&s); ++ ++ ++ ++int main(int argc, char* argv[]) ++{ ++ if (argc != 2) { ++ std::cerr << "Usage: Validator port\n"; ++ return -1; ++ } ++ int port = atoi(argv[1]); ++ ++ XmlRpc::setVerbosity(5); ++ ++ // Create the server socket on the specified port ++ s.bindAndListen(port); ++ ++ // Wait for requests indefinitely ++ s.work(-1.0); ++ ++ return 0; ++} ++ +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp b/extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp +index 31427c3..c87f32d 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp ++++ b/extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp +@@ -1,95 +1,95 @@ +-# Microsoft Developer Studio Project File - Name="Validator" - Package Owner=<4> + +-# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +-# ** DO NOT EDIT ** + +- + +-# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +- + +-CFG=Validator - Win32 Debug + +-!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +-!MESSAGE use the Export Makefile command and run + +-!MESSAGE + +-!MESSAGE NMAKE /f "Validator.mak". + +-!MESSAGE + +-!MESSAGE You can specify a configuration when running NMAKE + +-!MESSAGE by defining the macro CFG on the command line. For example: + +-!MESSAGE + +-!MESSAGE NMAKE /f "Validator.mak" CFG="Validator - Win32 Debug" + +-!MESSAGE + +-!MESSAGE Possible choices for configuration are: + +-!MESSAGE + +-!MESSAGE "Validator - Win32 Release" (based on "Win32 (x86) Console Application") + +-!MESSAGE "Validator - Win32 Debug" (based on "Win32 (x86) Console Application") + +-!MESSAGE + +- + +-# Begin Project + +-# PROP AllowPerConfigDependencies 0 + +-# PROP Scc_ProjName "" + +-# PROP Scc_LocalPath "" + +-CPP=cl.exe + +-RSC=rc.exe + +- + +-!IF "$(CFG)" == "Validator - Win32 Release" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 0 + +-# PROP BASE Output_Dir "Release" + +-# PROP BASE Intermediate_Dir "Release" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 0 + +-# PROP Output_Dir "Release" + +-# PROP Intermediate_Dir "Release" + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c + +-# ADD CPP /nologo /MD /W3 /GX /Zd /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "NDEBUG" + +-# ADD RSC /l 0x409 /d "NDEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +-# ADD LINK32 xmlrpc.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +- + +-!ELSEIF "$(CFG)" == "Validator - Win32 Debug" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 1 + +-# PROP BASE Output_Dir "Debug" + +-# PROP BASE Intermediate_Dir "Debug" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 1 + +-# PROP Output_Dir "Debug" + +-# PROP Intermediate_Dir "Debug" + +-# PROP Ignore_Export_Lib 0 + +-# PROP Target_Dir "" + +-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c + +-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c + +-# SUBTRACT CPP /YX /Yc /Yu + +-# ADD BASE RSC /l 0x409 /d "_DEBUG" + +-# ADD RSC /l 0x409 /d "_DEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LINK32=link.exe + +-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +-# ADD LINK32 xmlrpc.lib WS2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\debug" + +- + +-!ENDIF + +- + +-# Begin Target + +- + +-# Name "Validator - Win32 Release" + +-# Name "Validator - Win32 Debug" + +-# Begin Group "Source Files" + +- + +-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +-# Begin Source File + +- + +-SOURCE=.\Validator.cpp + +-# End Source File + +-# End Group + +-# End Target + +-# End Project + ++# Microsoft Developer Studio Project File - Name="Validator" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Console Application" 0x0103 ++ ++CFG=Validator - Win32 Debug ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "Validator.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "Validator.mak" CFG="Validator - Win32 Debug" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "Validator - Win32 Release" (based on "Win32 (x86) Console Application") ++!MESSAGE "Validator - Win32 Debug" (based on "Win32 (x86) Console Application") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "Validator - Win32 Release" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release" ++# PROP BASE Intermediate_Dir "Release" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release" ++# PROP Intermediate_Dir "Release" ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c ++# ADD CPP /nologo /MD /W3 /GX /Zd /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "NDEBUG" ++# ADD RSC /l 0x409 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 ++# ADD LINK32 xmlrpc.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" ++ ++!ELSEIF "$(CFG)" == "Validator - Win32 Debug" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug" ++# PROP BASE Intermediate_Dir "Debug" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "Debug" ++# PROP Intermediate_Dir "Debug" ++# PROP Ignore_Export_Lib 0 ++# PROP Target_Dir "" ++# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c ++# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c ++# SUBTRACT CPP /YX /Yc /Yu ++# ADD BASE RSC /l 0x409 /d "_DEBUG" ++# ADD RSC /l 0x409 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LINK32=link.exe ++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept ++# ADD LINK32 xmlrpc.lib WS2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\debug" ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "Validator - Win32 Release" ++# Name "Validator - Win32 Debug" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\Validator.cpp ++# End Source File ++# End Group ++# End Target ++# End Project +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/arrayOfStructsTest.xml b/extern/xmlrpcpp/xmlrpcpp/test/arrayOfStructsTest.xml +index 8218ee3..ec03378 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/arrayOfStructsTest.xml ++++ b/extern/xmlrpcpp/xmlrpcpp/test/arrayOfStructsTest.xml +@@ -1,255 +1,255 @@ +- + +- + +- validator1.arrayOfStructsTest + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -84 + +- + +- + +- + +- larry + +- + +- 87 + +- + +- + +- + +- moe + +- + +- 77 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -46 + +- + +- + +- + +- larry + +- + +- 27 + +- + +- + +- + +- moe + +- + +- 33 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -70 + +- + +- + +- + +- larry + +- + +- 89 + +- + +- + +- + +- moe + +- + +- 30 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -90 + +- + +- + +- + +- larry + +- + +- 42 + +- + +- + +- + +- moe + +- + +- 6 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -28 + +- + +- + +- + +- larry + +- + +- 96 + +- + +- + +- + +- moe + +- + +- 92 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -31 + +- + +- + +- + +- larry + +- + +- 81 + +- + +- + +- + +- moe + +- + +- 85 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -18 + +- + +- + +- + +- larry + +- + +- 62 + +- + +- + +- + +- moe + +- + +- 9 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -98 + +- + +- + +- + +- larry + +- + +- 79 + +- + +- + +- + +- moe + +- + +- 66 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -3 + +- + +- + +- + +- larry + +- + +- 59 + +- + +- + +- + +- moe + +- + +- 80 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -83 + +- + +- + +- + +- larry + +- + +- 27 + +- + +- + +- + +- moe + +- + +- 19 + +- + +- + +- + +- + +- + +- + +- + +- curly + +- + +- -85 + +- + +- + +- + +- larry + +- + +- 4 + +- + +- + +- + +- moe + +- + +- 16 + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + ++ ++ ++ validator1.arrayOfStructsTest ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -84 ++ ++ ++ ++ larry ++ ++ 87 ++ ++ ++ ++ moe ++ ++ 77 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -46 ++ ++ ++ ++ larry ++ ++ 27 ++ ++ ++ ++ moe ++ ++ 33 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -70 ++ ++ ++ ++ larry ++ ++ 89 ++ ++ ++ ++ moe ++ ++ 30 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -90 ++ ++ ++ ++ larry ++ ++ 42 ++ ++ ++ ++ moe ++ ++ 6 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -28 ++ ++ ++ ++ larry ++ ++ 96 ++ ++ ++ ++ moe ++ ++ 92 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -31 ++ ++ ++ ++ larry ++ ++ 81 ++ ++ ++ ++ moe ++ ++ 85 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -18 ++ ++ ++ ++ larry ++ ++ 62 ++ ++ ++ ++ moe ++ ++ 9 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -98 ++ ++ ++ ++ larry ++ ++ 79 ++ ++ ++ ++ moe ++ ++ 66 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -3 ++ ++ ++ ++ larry ++ ++ 59 ++ ++ ++ ++ moe ++ ++ 80 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -83 ++ ++ ++ ++ larry ++ ++ 27 ++ ++ ++ ++ moe ++ ++ 19 ++ ++ ++ ++ ++ ++ ++ ++ curly ++ ++ -85 ++ ++ ++ ++ larry ++ ++ 4 ++ ++ ++ ++ moe ++ ++ 16 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/countTheEntities.xml b/extern/xmlrpcpp/xmlrpcpp/test/countTheEntities.xml +index 4770a4c..33e478f 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/countTheEntities.xml ++++ b/extern/xmlrpcpp/xmlrpcpp/test/countTheEntities.xml +@@ -1,10 +1,10 @@ +- + +- + +- validator1.countTheEntities + +- + +- + +- &''<&"'>ehv<>iu'<<qo>"z"f + +- + +- + +- + +- + ++ ++ ++ validator1.countTheEntities ++ ++ ++ &''<&"'>ehv<>iu'<<qo>"z"f ++ ++ ++ ++ +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/easyStructTest.xml b/extern/xmlrpcpp/xmlrpcpp/test/easyStructTest.xml +index 2e054e1..34d77a4 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/easyStructTest.xml ++++ b/extern/xmlrpcpp/xmlrpcpp/test/easyStructTest.xml +@@ -1,29 +1,29 @@ +- + +- + +- validator1.easyStructTest + +- + +- + +- + +- + +- curly + +- + +- -78 + +- + +- + +- + +- larry + +- + +- 23 + +- + +- + +- + +- moe + +- + +- 38 + +- + +- + +- + +- + +- + +- + +- + ++ ++ ++ validator1.easyStructTest ++ ++ ++ ++ ++ curly ++ ++ -78 ++ ++ ++ ++ larry ++ ++ 23 ++ ++ ++ ++ moe ++ ++ 38 ++ ++ ++ ++ ++ ++ ++ +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/echo.xml b/extern/xmlrpcpp/xmlrpcpp/test/echo.xml +index 659d7d6..4940a6b 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/echo.xml ++++ b/extern/xmlrpcpp/xmlrpcpp/test/echo.xml +@@ -1,9 +1,9 @@ +- + +- + +- echo + +- + +- Hello Chris + +- 123 + +- + +- + +- + ++ ++ ++ echo ++ ++ Hello Chris ++ 123 ++ ++ ++ +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/echoStructTest.xml b/extern/xmlrpcpp/xmlrpcpp/test/echoStructTest.xml +index f744d04..8ce3f83 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/echoStructTest.xml ++++ b/extern/xmlrpcpp/xmlrpcpp/test/echoStructTest.xml +@@ -1,261 +1,261 @@ +- + +- + +- validator1.echoStructTest + +- + +- + +- + +- + +- substruct0 + +- + +- + +- + +- curly + +- + +- -76 + +- + +- + +- + +- larry + +- + +- 31 + +- + +- + +- + +- moe + +- + +- 44 + +- + +- + +- + +- + +- + +- + +- substruct1 + +- + +- + +- + +- curly + +- + +- -9 + +- + +- + +- + +- larry + +- + +- 42 + +- + +- + +- + +- moe + +- + +- 57 + +- + +- + +- + +- + +- + +- + +- substruct2 + +- + +- + +- + +- curly + +- + +- -15 + +- + +- + +- + +- larry + +- + +- 69 + +- + +- + +- + +- moe + +- + +- 78 + +- + +- + +- + +- + +- + +- + +- substruct3 + +- + +- + +- + +- curly + +- + +- -91 + +- + +- + +- + +- larry + +- + +- 66 + +- + +- + +- + +- moe + +- + +- 4 + +- + +- + +- + +- + +- + +- + +- substruct4 + +- + +- + +- + +- curly + +- + +- -47 + +- + +- + +- + +- larry + +- + +- 66 + +- + +- + +- + +- moe + +- + +- 8 + +- + +- + +- + +- + +- + +- + +- substruct5 + +- + +- + +- + +- curly + +- + +- -68 + +- + +- + +- + +- larry + +- + +- 26 + +- + +- + +- + +- moe + +- + +- 87 + +- + +- + +- + +- + +- + +- + +- substruct6 + +- + +- + +- + +- curly + +- + +- -59 + +- + +- + +- + +- larry + +- + +- 20 + +- + +- + +- + +- moe + +- + +- 74 + +- + +- + +- + +- + +- + +- + +- substruct7 + +- + +- + +- + +- curly + +- + +- -57 + +- + +- + +- + +- larry + +- + +- 30 + +- + +- + +- + +- moe + +- + +- 75 + +- + +- + +- + +- + +- + +- + +- substruct8 + +- + +- + +- + +- curly + +- + +- -34 + +- + +- + +- + +- larry + +- + +- 33 + +- + +- + +- + +- moe + +- + +- 30 + +- + +- + +- + +- + +- + +- + +- substruct9 + +- + +- + +- + +- curly + +- + +- -64 + +- + +- + +- + +- larry + +- + +- 98 + +- + +- + +- + +- moe + +- + +- 17 + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + ++ ++ ++ validator1.echoStructTest ++ ++ ++ ++ ++ substruct0 ++ ++ ++ ++ curly ++ ++ -76 ++ ++ ++ ++ larry ++ ++ 31 ++ ++ ++ ++ moe ++ ++ 44 ++ ++ ++ ++ ++ ++ ++ substruct1 ++ ++ ++ ++ curly ++ ++ -9 ++ ++ ++ ++ larry ++ ++ 42 ++ ++ ++ ++ moe ++ ++ 57 ++ ++ ++ ++ ++ ++ ++ substruct2 ++ ++ ++ ++ curly ++ ++ -15 ++ ++ ++ ++ larry ++ ++ 69 ++ ++ ++ ++ moe ++ ++ 78 ++ ++ ++ ++ ++ ++ ++ substruct3 ++ ++ ++ ++ curly ++ ++ -91 ++ ++ ++ ++ larry ++ ++ 66 ++ ++ ++ ++ moe ++ ++ 4 ++ ++ ++ ++ ++ ++ ++ substruct4 ++ ++ ++ ++ curly ++ ++ -47 ++ ++ ++ ++ larry ++ ++ 66 ++ ++ ++ ++ moe ++ ++ 8 ++ ++ ++ ++ ++ ++ ++ substruct5 ++ ++ ++ ++ curly ++ ++ -68 ++ ++ ++ ++ larry ++ ++ 26 ++ ++ ++ ++ moe ++ ++ 87 ++ ++ ++ ++ ++ ++ ++ substruct6 ++ ++ ++ ++ curly ++ ++ -59 ++ ++ ++ ++ larry ++ ++ 20 ++ ++ ++ ++ moe ++ ++ 74 ++ ++ ++ ++ ++ ++ ++ substruct7 ++ ++ ++ ++ curly ++ ++ -57 ++ ++ ++ ++ larry ++ ++ 30 ++ ++ ++ ++ moe ++ ++ 75 ++ ++ ++ ++ ++ ++ ++ substruct8 ++ ++ ++ ++ curly ++ ++ -34 ++ ++ ++ ++ larry ++ ++ 33 ++ ++ ++ ++ moe ++ ++ 30 ++ ++ ++ ++ ++ ++ ++ substruct9 ++ ++ ++ ++ curly ++ ++ -64 ++ ++ ++ ++ larry ++ ++ 98 ++ ++ ++ ++ moe ++ ++ 17 ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/extern/xmlrpcpp/xmlrpcpp/test/pngnow.png b/extern/xmlrpcpp/xmlrpcpp/test/pngnow.png +index 7f0da0c..f1ad755 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/test/pngnow.png ++++ b/extern/xmlrpcpp/xmlrpcpp/test/pngnow.png +@@ -1 +1 @@ +-‰PNG + ++‰PNG +diff --git a/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp b/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp +index 168cf5e..d5bfbff 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp ++++ b/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp +@@ -1,183 +1,183 @@ +-# Microsoft Developer Studio Project File - Name="xmlrpc" - Package Owner=<4> + +-# Microsoft Developer Studio Generated Build File, Format Version 6.00 + +-# ** DO NOT EDIT ** + +- + +-# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +- + +-CFG=xmlrpc - Win32 Debug + +-!MESSAGE This is not a valid makefile. To build this project using NMAKE, + +-!MESSAGE use the Export Makefile command and run + +-!MESSAGE + +-!MESSAGE NMAKE /f "xmlrpc.mak". + +-!MESSAGE + +-!MESSAGE You can specify a configuration when running NMAKE + +-!MESSAGE by defining the macro CFG on the command line. For example: + +-!MESSAGE + +-!MESSAGE NMAKE /f "xmlrpc.mak" CFG="xmlrpc - Win32 Debug" + +-!MESSAGE + +-!MESSAGE Possible choices for configuration are: + +-!MESSAGE + +-!MESSAGE "xmlrpc - Win32 Release" (based on "Win32 (x86) Static Library") + +-!MESSAGE "xmlrpc - Win32 Debug" (based on "Win32 (x86) Static Library") + +-!MESSAGE + +- + +-# Begin Project + +-# PROP AllowPerConfigDependencies 0 + +-# PROP Scc_ProjName "" + +-# PROP Scc_LocalPath "" + +-CPP=cl.exe + +-RSC=rc.exe + +- + +-!IF "$(CFG)" == "xmlrpc - Win32 Release" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 0 + +-# PROP BASE Output_Dir "Release" + +-# PROP BASE Intermediate_Dir "Release" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 0 + +-# PROP Output_Dir "Release" + +-# PROP Intermediate_Dir "Release" + +-# PROP Target_Dir "" + +-MTL=midl.exe + +-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 + +-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 + +-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /YX /FD /c + +-# ADD CPP /nologo /MD /W3 /GX /Zd /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /FR /YX /FD /c + +-# ADD BASE RSC /l 0x409 /d "NDEBUG" + +-# ADD RSC /l 0x409 /d "NDEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LIB32=link.exe -lib + +-# ADD BASE LIB32 /nologo + +-# ADD LIB32 /nologo + +- + +-!ELSEIF "$(CFG)" == "xmlrpc - Win32 Debug" + +- + +-# PROP BASE Use_MFC 0 + +-# PROP BASE Use_Debug_Libraries 1 + +-# PROP BASE Output_Dir "Debug" + +-# PROP BASE Intermediate_Dir "Debug" + +-# PROP BASE Target_Dir "" + +-# PROP Use_MFC 0 + +-# PROP Use_Debug_Libraries 1 + +-# PROP Output_Dir "Debug" + +-# PROP Intermediate_Dir "Debug" + +-# PROP Target_Dir "" + +-MTL=midl.exe + +-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 + +-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 + +-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c + +-# ADD CPP /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /FR /FD /c + +-# SUBTRACT CPP /nologo /YX + +-# ADD BASE RSC /l 0x409 /d "_DEBUG" + +-# ADD RSC /l 0x409 /d "_DEBUG" + +-BSC32=bscmake.exe + +-# ADD BASE BSC32 /nologo + +-# ADD BSC32 /nologo + +-LIB32=link.exe -lib + +-# ADD BASE LIB32 /nologo + +-# ADD LIB32 /nologo + +- + +-!ENDIF + +- + +-# Begin Target + +- + +-# Name "xmlrpc - Win32 Release" + +-# Name "xmlrpc - Win32 Debug" + +-# Begin Group "Source Files" + +- + +-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcClient.cpp + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcDispatch.cpp + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcServer.cpp + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcServerConnection.cpp + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcServerMethod.cpp + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcSocket.cpp + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcSource.cpp + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcUtil.cpp + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcValue.cpp + +-# End Source File + +-# End Group + +-# Begin Group "Header Files" + +- + +-# PROP Default_Filter "h;hpp;hxx;hm;inl" + +-# Begin Source File + +- + +-SOURCE=.\src\base64.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpc.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcClient.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcDispatch.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcServer.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcServerConnection.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcServerMethod.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcSocket.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcSource.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcUtil.h + +-# End Source File + +-# Begin Source File + +- + +-SOURCE=.\src\XmlRpcValue.h + +-# End Source File + +-# End Group + +-# Begin Source File + +- + +-SOURCE=.\README.html + +-# End Source File + +-# End Target + +-# End Project + ++# Microsoft Developer Studio Project File - Name="xmlrpc" - Package Owner=<4> ++# Microsoft Developer Studio Generated Build File, Format Version 6.00 ++# ** DO NOT EDIT ** ++ ++# TARGTYPE "Win32 (x86) Static Library" 0x0104 ++ ++CFG=xmlrpc - Win32 Debug ++!MESSAGE This is not a valid makefile. To build this project using NMAKE, ++!MESSAGE use the Export Makefile command and run ++!MESSAGE ++!MESSAGE NMAKE /f "xmlrpc.mak". ++!MESSAGE ++!MESSAGE You can specify a configuration when running NMAKE ++!MESSAGE by defining the macro CFG on the command line. For example: ++!MESSAGE ++!MESSAGE NMAKE /f "xmlrpc.mak" CFG="xmlrpc - Win32 Debug" ++!MESSAGE ++!MESSAGE Possible choices for configuration are: ++!MESSAGE ++!MESSAGE "xmlrpc - Win32 Release" (based on "Win32 (x86) Static Library") ++!MESSAGE "xmlrpc - Win32 Debug" (based on "Win32 (x86) Static Library") ++!MESSAGE ++ ++# Begin Project ++# PROP AllowPerConfigDependencies 0 ++# PROP Scc_ProjName "" ++# PROP Scc_LocalPath "" ++CPP=cl.exe ++RSC=rc.exe ++ ++!IF "$(CFG)" == "xmlrpc - Win32 Release" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 0 ++# PROP BASE Output_Dir "Release" ++# PROP BASE Intermediate_Dir "Release" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 0 ++# PROP Output_Dir "Release" ++# PROP Intermediate_Dir "Release" ++# PROP Target_Dir "" ++MTL=midl.exe ++# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 ++# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /YX /FD /c ++# ADD CPP /nologo /MD /W3 /GX /Zd /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /FR /YX /FD /c ++# ADD BASE RSC /l 0x409 /d "NDEBUG" ++# ADD RSC /l 0x409 /d "NDEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LIB32=link.exe -lib ++# ADD BASE LIB32 /nologo ++# ADD LIB32 /nologo ++ ++!ELSEIF "$(CFG)" == "xmlrpc - Win32 Debug" ++ ++# PROP BASE Use_MFC 0 ++# PROP BASE Use_Debug_Libraries 1 ++# PROP BASE Output_Dir "Debug" ++# PROP BASE Intermediate_Dir "Debug" ++# PROP BASE Target_Dir "" ++# PROP Use_MFC 0 ++# PROP Use_Debug_Libraries 1 ++# PROP Output_Dir "Debug" ++# PROP Intermediate_Dir "Debug" ++# PROP Target_Dir "" ++MTL=midl.exe ++# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 ++# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 ++# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c ++# ADD CPP /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /FR /FD /c ++# SUBTRACT CPP /nologo /YX ++# ADD BASE RSC /l 0x409 /d "_DEBUG" ++# ADD RSC /l 0x409 /d "_DEBUG" ++BSC32=bscmake.exe ++# ADD BASE BSC32 /nologo ++# ADD BSC32 /nologo ++LIB32=link.exe -lib ++# ADD BASE LIB32 /nologo ++# ADD LIB32 /nologo ++ ++!ENDIF ++ ++# Begin Target ++ ++# Name "xmlrpc - Win32 Release" ++# Name "xmlrpc - Win32 Debug" ++# Begin Group "Source Files" ++ ++# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcClient.cpp ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcDispatch.cpp ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcServer.cpp ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcServerConnection.cpp ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcServerMethod.cpp ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcSocket.cpp ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcSource.cpp ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcUtil.cpp ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcValue.cpp ++# End Source File ++# End Group ++# Begin Group "Header Files" ++ ++# PROP Default_Filter "h;hpp;hxx;hm;inl" ++# Begin Source File ++ ++SOURCE=.\src\base64.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpc.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcClient.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcDispatch.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcServer.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcServerConnection.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcServerMethod.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcSocket.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcSource.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcUtil.h ++# End Source File ++# Begin Source File ++ ++SOURCE=.\src\XmlRpcValue.h ++# End Source File ++# End Group ++# Begin Source File ++ ++SOURCE=.\README.html ++# End Source File ++# End Target ++# End Project +diff --git a/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw b/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw +index bd663ac..c24adb3 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw ++++ b/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw +@@ -1,149 +1,149 @@ +-Microsoft Developer Studio Workspace File, Format Version 6.00 + +-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +- + +-############################################################################### + +- + +-Project: "FileClient"=".\Test\FileClient.dsp" - Package Owner=<4> + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<4> + +-{{{ + +- Begin Project Dependency + +- Project_Dep_Name xmlrpc + +- End Project Dependency + +-}}} + +- + +-############################################################################### + +- + +-Project: "HelloClient"=".\Test\HelloClient.dsp" - Package Owner=<4> + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<4> + +-{{{ + +- Begin Project Dependency + +- Project_Dep_Name xmlrpc + +- End Project Dependency + +-}}} + +- + +-############################################################################### + +- + +-Project: "HelloServer"=".\Test\HelloServer.dsp" - Package Owner=<4> + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<4> + +-{{{ + +- Begin Project Dependency + +- Project_Dep_Name xmlrpc + +- End Project Dependency + +-}}} + +- + +-############################################################################### + +- + +-Project: "TestBase64Client"=".\Test\TestBase64Client.dsp" - Package Owner=<4> + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<4> + +-{{{ + +- Begin Project Dependency + +- Project_Dep_Name xmlrpc + +- End Project Dependency + +-}}} + +- + +-############################################################################### + +- + +-Project: "TestBase64Server"=".\Test\TestBase64Server.dsp" - Package Owner=<4> + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<4> + +-{{{ + +- Begin Project Dependency + +- Project_Dep_Name xmlrpc + +- End Project Dependency + +-}}} + +- + +-############################################################################### + +- + +-Project: "TestValues"=".\Test\TestValues.dsp" - Package Owner=<4> + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<4> + +-{{{ + +- Begin Project Dependency + +- Project_Dep_Name xmlrpc + +- End Project Dependency + +-}}} + +- + +-############################################################################### + +- + +-Project: "TestXml"=".\Test\TestXml.dsp" - Package Owner=<4> + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<4> + +-{{{ + +- Begin Project Dependency + +- Project_Dep_Name xmlrpc + +- End Project Dependency + +-}}} + +- + +-############################################################################### + +- + +-Project: "Validator"=".\Test\Validator.dsp" - Package Owner=<4> + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<4> + +-{{{ + +- Begin Project Dependency + +- Project_Dep_Name xmlrpc + +- End Project Dependency + +-}}} + +- + +-############################################################################### + +- + +-Project: "xmlrpc"=".\xmlrpc.dsp" - Package Owner=<4> + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<4> + +-{{{ + +-}}} + +- + +-############################################################################### + +- + +-Global: + +- + +-Package=<5> + +-{{{ + +-}}} + +- + +-Package=<3> + +-{{{ + +-}}} + +- + +-############################################################################### + +- + ++Microsoft Developer Studio Workspace File, Format Version 6.00 ++# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ++ ++############################################################################### ++ ++Project: "FileClient"=".\Test\FileClient.dsp" - Package Owner=<4> ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<4> ++{{{ ++ Begin Project Dependency ++ Project_Dep_Name xmlrpc ++ End Project Dependency ++}}} ++ ++############################################################################### ++ ++Project: "HelloClient"=".\Test\HelloClient.dsp" - Package Owner=<4> ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<4> ++{{{ ++ Begin Project Dependency ++ Project_Dep_Name xmlrpc ++ End Project Dependency ++}}} ++ ++############################################################################### ++ ++Project: "HelloServer"=".\Test\HelloServer.dsp" - Package Owner=<4> ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<4> ++{{{ ++ Begin Project Dependency ++ Project_Dep_Name xmlrpc ++ End Project Dependency ++}}} ++ ++############################################################################### ++ ++Project: "TestBase64Client"=".\Test\TestBase64Client.dsp" - Package Owner=<4> ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<4> ++{{{ ++ Begin Project Dependency ++ Project_Dep_Name xmlrpc ++ End Project Dependency ++}}} ++ ++############################################################################### ++ ++Project: "TestBase64Server"=".\Test\TestBase64Server.dsp" - Package Owner=<4> ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<4> ++{{{ ++ Begin Project Dependency ++ Project_Dep_Name xmlrpc ++ End Project Dependency ++}}} ++ ++############################################################################### ++ ++Project: "TestValues"=".\Test\TestValues.dsp" - Package Owner=<4> ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<4> ++{{{ ++ Begin Project Dependency ++ Project_Dep_Name xmlrpc ++ End Project Dependency ++}}} ++ ++############################################################################### ++ ++Project: "TestXml"=".\Test\TestXml.dsp" - Package Owner=<4> ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<4> ++{{{ ++ Begin Project Dependency ++ Project_Dep_Name xmlrpc ++ End Project Dependency ++}}} ++ ++############################################################################### ++ ++Project: "Validator"=".\Test\Validator.dsp" - Package Owner=<4> ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<4> ++{{{ ++ Begin Project Dependency ++ Project_Dep_Name xmlrpc ++ End Project Dependency ++}}} ++ ++############################################################################### ++ ++Project: "xmlrpc"=".\xmlrpc.dsp" - Package Owner=<4> ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<4> ++{{{ ++}}} ++ ++############################################################################### ++ ++Global: ++ ++Package=<5> ++{{{ ++}}} ++ ++Package=<3> ++{{{ ++}}} ++ ++############################################################################### ++ +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch b/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch new file mode 100644 index 0000000..ed58f43 --- /dev/null +++ b/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch @@ -0,0 +1,321 @@ +From 19a3ac4fbd725719a6dae0ee87c9536d388d427a Mon Sep 17 00:00:00 2001 +From: "Paul Fitzpatrick" +Date: Fri May 28 03:23:50 2010 +0000 +Subject: [PATCH 02/17] first pass at an xml/rpc carrier + +--- + .../xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 64 +++++++++++++--------- + extern/xmlrpcpp/xmlrpcpp/XmlRpcClient.h | 15 +++-- + .../xmlrpc/XmlRpcServerConnection.cpp | 55 +++++++++++++------ + .../xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h | 21 ++++--- + .../xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp | 3 + + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.h | 1 + + 6 files changed, 107 insertions(+), 52 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +index e706d0a..f37f417 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +@@ -6,6 +6,7 @@ + + #include + #include ++#include + + + using namespace XmlRpc; +@@ -277,29 +278,37 @@ XmlRpcClient::writeRequest() + return true; + } + ++void XmlRpcClient::reset() { ++ _header = ""; ++ _response = ""; ++ _eof = false; ++ _connectionState = READ_HEADER; ++} ++ ++bool XmlRpcClient::read(const std::string& txt) { ++ std::string got = txt; ++ if (_connectionState==READ_HEADER) { ++ readHeader(got); ++ got = ""; ++ } ++ if (_connectionState==READ_RESPONSE) { ++ readResponse(got); ++ } ++ return (_connectionState == IDLE); ++} + + // Read the header from the response + bool + XmlRpcClient::readHeader() + { +- // Read available data +- if ( ! XmlRpcSocket::nbRead(this->getfd(), _header, &_eof) || +- (_eof && _header.length() == 0)) { +- +- // If we haven't read any data yet and this is a keep-alive connection, the server may +- // have timed out, so we try one more time. +- if (getKeepOpen() && _header.length() == 0 && _sendAttempts++ == 0) { +- XmlRpcUtil::log(4, "XmlRpcClient::readHeader: re-trying connection"); +- XmlRpcSource::close(); +- _connectionState = NO_CONNECTION; +- _eof = false; +- return setupConnection(); +- } ++ return false; ++} + +- XmlRpcUtil::error("Error in XmlRpcClient::readHeader: error while reading header (%s) on fd %d.", +- XmlRpcSocket::getErrorMsg().c_str(), getfd()); +- return false; +- } ++// Read the header from the response ++bool ++XmlRpcClient::readHeader(const std::string& txt) { ++ _header += txt; ++ _eof = false; + + XmlRpcUtil::log(4, "XmlRpcClient::readHeader: client has read %d bytes", _header.length()); + +@@ -349,16 +358,21 @@ XmlRpcClient::readHeader() + return true; // Continue monitoring this source + } + ++ + + bool +-XmlRpcClient::readResponse() ++XmlRpcClient::readResponse() { ++ return false; ++} ++ ++bool ++XmlRpcClient::readResponse(const std::string& txt) + { ++ _eof = false; ++ + // If we dont have the entire response yet, read available data + if (int(_response.length()) < _contentLength) { +- if ( ! XmlRpcSocket::nbRead(this->getfd(), _response, &_eof)) { +- XmlRpcUtil::error("Error in XmlRpcClient::readResponse: read error (%s).",XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } ++ _response += txt; + + // If we haven't gotten the entire _response yet, return (keep reading) + if (int(_response.length()) < _contentLength) { +@@ -392,9 +406,9 @@ XmlRpcClient::parseResponse(XmlRpcValue& result) + } + + // Expect either ... or ... +- if ((XmlRpcUtil::nextTagIs(PARAMS_TAG,_response,&offset) && +- XmlRpcUtil::nextTagIs(PARAM_TAG,_response,&offset)) || +- XmlRpcUtil::nextTagIs(FAULT_TAG,_response,&offset) && (_isFault = true)) ++ if (((XmlRpcUtil::nextTagIs(PARAMS_TAG,_response,&offset) && ++ XmlRpcUtil::nextTagIs(PARAM_TAG,_response,&offset))) || ++ (XmlRpcUtil::nextTagIs(FAULT_TAG,_response,&offset) && (_isFault = true))) + { + if ( ! result.fromXml(_response, &offset)) { + XmlRpcUtil::error("Error in XmlRpcClient::parseResponse: Invalid response value. Response:\n%s", _response.c_str()); +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +index c5e5301..bcdcc32 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +@@ -70,17 +70,24 @@ namespace XmlRpc { + //! @see XmlRpcDispatch::EventType + virtual unsigned handleEvent(unsigned eventType); + ++ virtual bool generateRequest(const char* method, XmlRpcValue const& params); ++ std::string getRequest() { return _request; } ++ ++ virtual void reset(); ++ virtual bool read(const std::string& txt); ++ virtual bool readHeader(const std::string& txt); ++ virtual bool readResponse(const std::string& txt); ++ virtual bool parseResponse(XmlRpcValue& result); ++ + protected: + // Execution processing helpers + virtual bool doConnect(); + virtual bool setupConnection(); ++ virtual bool readHeader(); ++ virtual bool readResponse(); + +- virtual bool generateRequest(const char* method, XmlRpcValue const& params); + virtual std::string generateHeader(std::string const& body); + virtual bool writeRequest(); +- virtual bool readHeader(); +- virtual bool readResponse(); +- virtual bool parseResponse(XmlRpcValue& result); + + // Possible IO states for the connection + enum ClientConnectionState { NO_CONNECTION, CONNECTING, WRITE_REQUEST, READ_HEADER, READ_RESPONSE, IDLE }; +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +index b9d6def..82d3bfd 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +@@ -6,6 +6,7 @@ + #ifndef MAKEDEPEND + # include + # include ++# include + #endif + + using namespace XmlRpc; +@@ -40,7 +41,9 @@ XmlRpcServerConnection::XmlRpcServerConnection(int fd, XmlRpcServer* server, boo + XmlRpcServerConnection::~XmlRpcServerConnection() + { + XmlRpcUtil::log(4,"XmlRpcServerConnection dtor."); +- _server->removeConnection(this); ++ if (_server!=NULL) { ++ _server->removeConnection(this); ++ } + } + + +@@ -63,18 +66,36 @@ XmlRpcServerConnection::handleEvent(unsigned /*eventType*/) + ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent; + } + ++void XmlRpcServerConnection::reset() { ++ _header = ""; ++ _response = ""; ++ _connectionState = READ_HEADER; ++} ++ ++bool XmlRpcServerConnection::read(const std::string& txt) { ++ std::string got = txt; ++ if (_connectionState==READ_HEADER) { ++ readHeader(got); ++ got = ""; ++ } ++ if (_connectionState==READ_REQUEST) { ++ readRequest(got); ++ } ++ return (_connectionState == WRITE_RESPONSE); ++} ++ + + bool +-XmlRpcServerConnection::readHeader() +-{ ++XmlRpcServerConnection::readHeader() { ++ return false; ++} ++ ++ ++bool ++XmlRpcServerConnection::readHeader(const std::string& txt) { + // Read available data +- bool eof; +- if ( ! XmlRpcSocket::nbRead(this->getfd(), _header, &eof)) { +- // Its only an error if we already have read some data +- if (_header.length() > 0) +- XmlRpcUtil::error("XmlRpcServerConnection::readHeader: error while reading header (%s).",XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } ++ bool eof = false; ++ _header += txt; + + XmlRpcUtil::log(4, "XmlRpcServerConnection::readHeader: read %d bytes.", _header.length()); + char *hp = (char*)_header.c_str(); // Start of header +@@ -142,15 +163,17 @@ XmlRpcServerConnection::readHeader() + } + + bool +-XmlRpcServerConnection::readRequest() ++XmlRpcServerConnection::readRequest() { ++ return false; ++} ++ ++bool ++XmlRpcServerConnection::readRequest(const std::string& txt) + { + // If we dont have the entire request yet, read available data + if (int(_request.length()) < _contentLength) { +- bool eof; +- if ( ! XmlRpcSocket::nbRead(this->getfd(), _request, &eof)) { +- XmlRpcUtil::error("XmlRpcServerConnection::readRequest: read error (%s).",XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } ++ bool eof = false; ++ _request += txt; + + // If we haven't gotten the entire request yet, return (keep reading) + if (int(_request.length()) < _contentLength) { +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h +index 9efbbaf..23d8f43 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h +@@ -48,26 +48,33 @@ namespace XmlRpc { + //! @param eventType Type of IO event that occurred. @see XmlRpcDispatch::EventType. + virtual unsigned handleEvent(unsigned eventType); + +- protected: +- + bool readHeader(); + bool readRequest(); ++ ++ void reset(); ++ bool read(const std::string& txt); ++ bool readHeader(const std::string& txt); ++ bool readRequest(const std::string& txt); ++ // Parse the methodName and parameters from the request. ++ std::string parseRequest(XmlRpcValue& params); ++ ++ // Construct a response from the result XML. ++ void generateResponse(std::string const& resultXml); ++ std::string getResponse() { return _response; } ++ ++ protected: ++ + bool writeResponse(); + + // Parses the request, runs the method, generates the response xml. + virtual void executeRequest(); + +- // Parse the methodName and parameters from the request. +- std::string parseRequest(XmlRpcValue& params); +- + // Execute a named method with the specified params. + bool executeMethod(const std::string& methodName, XmlRpcValue& params, XmlRpcValue& result); + + // Execute multiple calls and return the results in an array. + bool executeMulticall(const std::string& methodName, XmlRpcValue& params, XmlRpcValue& result); + +- // Construct a response from the result XML. +- void generateResponse(std::string const& resultXml); + void generateFaultResponse(std::string const& msg, int errorCode = -1); + std::string generateHeader(std::string const& body); + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +index 56b8d52..2aa21d4 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +@@ -25,6 +25,9 @@ extern "C" { + } + #endif // _WINDOWS + ++#include ++#include ++ + #endif // MAKEDEPEND + + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +index 7535d4a..4726aa7 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +@@ -90,6 +90,7 @@ namespace XmlRpc { + operator std::string&() { assertTypeOrInvalid(TypeString); return *_value.asString; } + operator BinaryData&() { assertTypeOrInvalid(TypeBase64); return *_value.asBinary; } + operator struct tm&() { assertTypeOrInvalid(TypeDateTime); return *_value.asTime; } ++ operator ValueStruct&() { assertStruct(); return *_value.asStruct; } + + XmlRpcValue const& operator[](int i) const { assertArray(i+1); return _value.asArray->at(i); } + XmlRpcValue& operator[](int i) { assertArray(i+1); return _value.asArray->at(i); } +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch b/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch new file mode 100644 index 0000000..49366e2 --- /dev/null +++ b/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch @@ -0,0 +1,735 @@ +From b3e24151e815a3cb634d0a1c6a8815449ff9db7a Mon Sep 17 00:00:00 2001 +From: Paul Fitzpatrick +Date: Mon, 14 Jun 2010 14:31:38 +0000 +Subject: [PATCH 03/17] more LGPL tagging + +svn path=/trunk/yarp2/; revision=8007 +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpc.h | 3 + + .../xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 4 + + extern/xmlrpcpp/xmlrpcpp/XmlRpcClient.h | 2 + + .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp | 4 + + .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h | 3 + + .../xmlrpc_carrier/xmlrpc/XmlRpcException.h | 3 + + .../xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp | 3 + + extern/xmlrpcpp/xmlrpcpp/XmlRpcServer.h | 3 + + .../xmlrpc/XmlRpcServerConnection.cpp | 3 + + .../xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h | 3 + + .../xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp | 3 + + .../xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h | 4 + + .../xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp | 3 + + extern/xmlrpcpp/xmlrpcpp/XmlRpcSocket.h | 3 + + .../xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp | 3 + + extern/xmlrpcpp/xmlrpcpp/XmlRpcSource.h | 3 + + extern/xmlrpcpp/xmlrpcpp/XmlRpcUtil.cpp | 3 + + extern/xmlrpcpp/xmlrpcpp/XmlRpcUtil.h | 3 + + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.cpp | 23 +- + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.h | 3 + + extern/xmlrpcpp/xmlrpcpp/base64.h | 379 --------------------- + 21 files changed, 81 insertions(+), 380 deletions(-) + delete mode 100644 extern/xmlrpcpp/xmlrpcpp/base64.h + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h +index 9611af7..a2e062d 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h +@@ -17,6 +17,9 @@ + // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + // + ++// Summary for YARP: ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT ++ + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +index f37f417..e968e7e 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +@@ -1,4 +1,8 @@ + ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT ++ + #include "XmlRpcClient.h" + + #include "XmlRpcSocket.h" +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +index bcdcc32..949c739 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +@@ -4,6 +4,8 @@ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // ++// Summary for YARP: ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.cpp +index 3bbca40..9fc41cb 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.cpp +@@ -1,4 +1,8 @@ + ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT ++ + #include "XmlRpcDispatch.h" + #include "XmlRpcSource.h" + #include "XmlRpcUtil.h" +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.h +index b3c4ec0..0f6448a 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.h +@@ -4,6 +4,9 @@ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h +index 6090450..31b6409 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h +@@ -3,6 +3,9 @@ + #define _XMLRPCEXCEPTION_H_ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + // + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp +index f6b4aa5..b3351e5 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp +@@ -1,3 +1,6 @@ ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + + #include "XmlRpcServer.h" + #include "XmlRpcServerConnection.h" +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h +index 8172733..566bf75 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h +@@ -4,6 +4,9 @@ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +index 82d3bfd..7377fab 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +@@ -1,3 +1,6 @@ ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + + #include "XmlRpcServerConnection.h" + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h +index 23d8f43..b388aa2 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h +@@ -3,6 +3,9 @@ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp +index 1616ff4..1dbed4d 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp +@@ -1,3 +1,6 @@ ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + + #include "XmlRpcServerMethod.h" + #include "XmlRpcServer.h" +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h +index 738a9c8..9332ebd 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h +@@ -4,6 +4,10 @@ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT ++ + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +index 2aa21d4..5a174a4 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +@@ -1,3 +1,6 @@ ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + + #include "XmlRpcSocket.h" + #include "XmlRpcUtil.h" +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.h +index fa7f950..b549f3b 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.h +@@ -3,6 +3,9 @@ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp +index 99203b0..67b69ba 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp +@@ -1,3 +1,6 @@ ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + + #include "XmlRpcSource.h" + #include "XmlRpcSocket.h" +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h +index 135dce4..5ad5cbb 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h +@@ -4,6 +4,9 @@ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp +index 1bd583a..8a60e2c 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp +@@ -1,3 +1,6 @@ ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + + #include "XmlRpcUtil.h" + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h +index 8128f72..c44f553 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h +@@ -3,6 +3,9 @@ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +index 607b7a1..9929e6d 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +@@ -1,8 +1,15 @@ ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + + #include "XmlRpcValue.h" + #include "XmlRpcException.h" + #include "XmlRpcUtil.h" +-#include "base64.h" ++ ++// base64.h removed - not clear that it is "really" under LGPL license. ++// origin seems to be this: ++// http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4095/ ++//#include "base64.h" + + #ifndef MAKEDEPEND + # include +@@ -416,6 +423,10 @@ namespace XmlRpc { + // Base64 + bool XmlRpcValue::binaryFromXml(std::string const& valueXml, int* offset) + { ++ printf("binaryFromXml disabled until license of base64.h determined\n"); ++ exit(1); ++ return false; ++ /* + size_t valueEnd = valueXml.find('<', *offset); + if (valueEnd == std::string::npos) + return false; // No end tag; +@@ -433,11 +444,16 @@ namespace XmlRpc { + + *offset += int(asString.length()); + return true; ++ */ + } + + + std::string XmlRpcValue::binaryToXml() const + { ++ printf("binaryToXml disabled until license of base64.h determined\n"); ++ exit(1); ++ return false; ++ /* + // convert to base64 + std::vector base64data; + int iostatus = 0; +@@ -452,6 +468,7 @@ namespace XmlRpc { + xml += BASE64_ETAG; + xml += VALUE_ETAG; + return xml; ++ */ + } + + +@@ -562,8 +579,12 @@ namespace XmlRpc { + { + int iostatus = 0; + std::ostreambuf_iterator out(os); ++ /* + base64 encoder; + encoder.put(_value.asBinary->begin(), _value.asBinary->end(), out, iostatus, base64<>::crlf()); ++ */ ++ printf("base64 disabled until license of base64.h determined\n"); ++ exit(1); + break; + } + case TypeArray: +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +index 4726aa7..b68fbdb 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +@@ -4,6 +4,9 @@ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // ++// Summary for YARP: ++// Copyright: 2002, 2003 Chris Morley ++// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/base64.h b/extern/xmlrpcpp/xmlrpcpp/base64.h +deleted file mode 100644 +index 519ee0f..0000000 +--- a/extern/xmlrpcpp/xmlrpcpp/base64.h ++++ /dev/null +@@ -1,379 +0,0 @@ +- +- +-// base64.hpp +-// Autor Konstantin Pilipchuk +-// mailto:lostd@ukr.net +-// +-// +- +-#if !defined(__BASE64_H_INCLUDED__) +-#define __BASE64_H_INCLUDED__ 1 +- +-#ifndef MAKEDEPEND +-# include +-#endif +- +-static +-int _base64Chars[]= {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z', +- 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z', +- '0','1','2','3','4','5','6','7','8','9', +- '+','/' }; +- +- +-#define _0000_0011 0x03 +-#define _1111_1100 0xFC +-#define _1111_0000 0xF0 +-#define _0011_0000 0x30 +-#define _0011_1100 0x3C +-#define _0000_1111 0x0F +-#define _1100_0000 0xC0 +-#define _0011_1111 0x3F +- +-#define _EQUAL_CHAR (-1) +-#define _UNKNOWN_CHAR (-2) +- +-#define _IOS_FAILBIT std::ios_base::failbit +-#define _IOS_EOFBIT std::ios_base::eofbit +-#define _IOS_BADBIT std::ios_base::badbit +-#define _IOS_GOODBIT std::ios_base::goodbit +- +-// TEMPLATE CLASS base64_put +-template > +-class base64 +-{ +-public: +- +- typedef unsigned char byte_t; +- typedef _E char_type; +- typedef _Tr traits_type; +- +- // base64 requires max line length <= 72 characters +- // you can fill end of line +- // it may be crlf, crlfsp, noline or other class like it +- +- +- struct crlf +- { +- template +- _OI operator()(_OI _To) const{ +- *_To = _Tr::to_char_type('\r'); ++_To; +- *_To = _Tr::to_char_type('\n'); ++_To; +- +- return (_To); +- } +- }; +- +- +- struct crlfsp +- { +- template +- _OI operator()(_OI _To) const{ +- *_To = _Tr::to_char_type('\r'); ++_To; +- *_To = _Tr::to_char_type('\n'); ++_To; +- *_To = _Tr::to_char_type(' '); ++_To; +- +- return (_To); +- } +- }; +- +- struct noline +- { +- template +- _OI operator()(_OI _To) const{ +- return (_To); +- } +- }; +- +- struct three2four +- { +- void zero() +- { +- _data[0] = 0; +- _data[1] = 0; +- _data[2] = 0; +- } +- +- byte_t get_0() const +- { +- return _data[0]; +- } +- byte_t get_1() const +- { +- return _data[1]; +- } +- byte_t get_2() const +- { +- return _data[2]; +- } +- +- void set_0(byte_t _ch) +- { +- _data[0] = _ch; +- } +- +- void set_1(byte_t _ch) +- { +- _data[1] = _ch; +- } +- +- void set_2(byte_t _ch) +- { +- _data[2] = _ch; +- } +- +- // 0000 0000 1111 1111 2222 2222 +- // xxxx xxxx xxxx xxxx xxxx xxxx +- // 0000 0011 1111 2222 2233 3333 +- +- int b64_0() const {return (_data[0] & _1111_1100) >> 2;} +- int b64_1() const {return ((_data[0] & _0000_0011) << 4) + ((_data[1] & _1111_0000)>>4);} +- int b64_2() const {return ((_data[1] & _0000_1111) << 2) + ((_data[2] & _1100_0000)>>6);} +- int b64_3() const {return (_data[2] & _0011_1111);} +- +- void b64_0(int _ch) {_data[0] = ((_ch & _0011_1111) << 2) | (_0000_0011 & _data[0]);} +- +- void b64_1(int _ch) { +- _data[0] = ((_ch & _0011_0000) >> 4) | (_1111_1100 & _data[0]); +- _data[1] = ((_ch & _0000_1111) << 4) | (_0000_1111 & _data[1]); } +- +- void b64_2(int _ch) { +- _data[1] = ((_ch & _0011_1100) >> 2) | (_1111_0000 & _data[1]); +- _data[2] = ((_ch & _0000_0011) << 6) | (_0011_1111 & _data[2]); } +- +- void b64_3(int _ch){ +- _data[2] = (_ch & _0011_1111) | (_1100_0000 & _data[2]);} +- +- private: +- byte_t _data[3]; +- +- }; +- +- +- +- +- template +- _II put(_II _First, _II _Last, _OI _To, _State& _St, _Endline _Endl) const +- { +- three2four _3to4; +- int line_octets = 0; +- +- while(_First != _Last) +- { +- _3to4.zero(); +- +- // áåð¸ì ïî 3 ñèìâîëà +- _3to4.set_0(*_First); +- _First++; +- +- if(_First == _Last) +- { +- *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To; +- *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To; +- *_To = _Tr::to_char_type('='); ++_To; +- *_To = _Tr::to_char_type('='); ++_To; +- goto __end; +- } +- +- _3to4.set_1(*_First); +- _First++; +- +- if(_First == _Last) +- { +- *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To; +- *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To; +- *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_2()]); ++_To; +- *_To = _Tr::to_char_type('='); ++_To; +- goto __end; +- } +- +- _3to4.set_2(*_First); +- _First++; +- +- *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_0()]); ++_To; +- *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_1()]); ++_To; +- *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_2()]); ++_To; +- *_To = _Tr::to_char_type(_base64Chars[_3to4.b64_3()]); ++_To; +- +- if(line_octets == 17) // base64 ïîçâîëÿåò äëèíó ñòðîêè íå áîëåå 72 ñèìâîëîâ +- { +- //_To = _Endl(_To); +- *_To = '\n'; ++_To; +- line_octets = 0; +- } +- else +- ++line_octets; +- } +- +- __end: ; +- +- return (_First); +- +- } +- +- +- template +- _II get(_II _First, _II _Last, _OI _To, _State& _St) const +- { +- three2four _3to4; +- int _Char; +- +- while(_First != _Last) +- { +- +- // Take octet +- _3to4.zero(); +- +- // -- 0 -- +- // Search next valid char... +- while((_Char = _getCharType(*_First)) < 0 && _Char == _UNKNOWN_CHAR) +- { +- if(++_First == _Last) +- { +- _St |= _IOS_FAILBIT|_IOS_EOFBIT; return _First; // unexpected EOF +- } +- } +- +- if(_Char == _EQUAL_CHAR){ +- // Error! First character in octet can't be '=' +- _St |= _IOS_FAILBIT; +- return _First; +- } +- else +- _3to4.b64_0(_Char); +- +- +- // -- 1 -- +- // Search next valid char... +- while(++_First != _Last) +- if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR) +- break; +- +- if(_First == _Last) { +- _St |= _IOS_FAILBIT|_IOS_EOFBIT; // unexpected EOF +- return _First; +- } +- +- if(_Char == _EQUAL_CHAR){ +- // Error! Second character in octet can't be '=' +- _St |= _IOS_FAILBIT; +- return _First; +- } +- else +- _3to4.b64_1(_Char); +- +- +- // -- 2 -- +- // Search next valid char... +- while(++_First != _Last) +- if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR) +- break; +- +- if(_First == _Last) { +- // Error! Unexpected EOF. Must be '=' or base64 character +- _St |= _IOS_FAILBIT|_IOS_EOFBIT; +- return _First; +- } +- +- if(_Char == _EQUAL_CHAR){ +- // OK! +- _3to4.b64_2(0); +- _3to4.b64_3(0); +- +- // chek for EOF +- if(++_First == _Last) +- { +- // Error! Unexpected EOF. Must be '='. Ignore it. +- //_St |= _IOS_BADBIT|_IOS_EOFBIT; +- _St |= _IOS_EOFBIT; +- } +- else +- if(_getCharType(*_First) != _EQUAL_CHAR) +- { +- // Error! Must be '='. Ignore it. +- //_St |= _IOS_BADBIT; +- } +- else +- ++_First; // Skip '=' +- +- // write 1 byte to output +- *_To = (byte_t) _3to4.get_0(); +- return _First; +- } +- else +- _3to4.b64_2(_Char); +- +- +- // -- 3 -- +- // Search next valid char... +- while(++_First != _Last) +- if((_Char = _getCharType(*_First)) != _UNKNOWN_CHAR) +- break; +- +- if(_First == _Last) { +- // Unexpected EOF. It's error. But ignore it. +- //_St |= _IOS_FAILBIT|_IOS_EOFBIT; +- _St |= _IOS_EOFBIT; +- +- return _First; +- } +- +- if(_Char == _EQUAL_CHAR) +- { +- // OK! +- _3to4.b64_3(0); +- +- // write to output 2 bytes +- *_To = (byte_t) _3to4.get_0(); +- *_To = (byte_t) _3to4.get_1(); +- +- ++_First; // set position to next character +- +- return _First; +- } +- else +- _3to4.b64_3(_Char); +- +- +- // write to output 3 bytes +- *_To = (byte_t) _3to4.get_0(); +- *_To = (byte_t) _3to4.get_1(); +- *_To = (byte_t) _3to4.get_2(); +- +- ++_First; +- +- +- } // while(_First != _Last) +- +- return (_First); +- } +- +-protected: +- +- int _getCharType(int _Ch) const +- { +- if(_base64Chars[62] == _Ch) +- return 62; +- +- if(_base64Chars[63] == _Ch) +- return 63; +- +- if((_base64Chars[0] <= _Ch) && (_base64Chars[25] >= _Ch)) +- return _Ch - _base64Chars[0]; +- +- if((_base64Chars[26] <= _Ch) && (_base64Chars[51] >= _Ch)) +- return _Ch - _base64Chars[26] + 26; +- +- if((_base64Chars[52] <= _Ch) && (_base64Chars[61] >= _Ch)) +- return _Ch - _base64Chars[52] + 52; +- +- if(_Ch == _Tr::to_int_type('=')) +- return _EQUAL_CHAR; +- +- return _UNKNOWN_CHAR; +- } +- +- +-}; +- +- +-#endif +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch b/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch new file mode 100644 index 0000000..f26557a --- /dev/null +++ b/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch @@ -0,0 +1,29 @@ +From 9ea098942e14e08150c5736c71ebe6c58e47fdda Mon Sep 17 00:00:00 2001 +From: Paul Fitzpatrick +Date: Thu, 8 Jul 2010 20:49:31 +0000 +Subject: [PATCH 04/17] small windows fixes + +svn path=/trunk/yarp2/; revision=8095 +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcSocket.cpp | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +index 5a174a4..c73de9e 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +@@ -63,8 +63,9 @@ static void initWinSock() + static inline bool + nonFatalError() + { +- int err = XmlRpcSocket::getError(); +- return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR); ++ //int err = XmlRpcSocket::getError(); ++ //return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR); ++ return false; // do not need this for YARP, and causes problems on windows + } + + +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch b/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch new file mode 100644 index 0000000..aabb873 --- /dev/null +++ b/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch @@ -0,0 +1,35 @@ +From 2a78f5e6766785c435bf03053761760e4d944f3f Mon Sep 17 00:00:00 2001 +From: Paul Fitzpatrick +Date: Mon, 30 Aug 2010 14:30:11 +0000 +Subject: [PATCH 05/17] fix a few trivial warnings + +svn path=/trunk/yarp2/; revision=8227 +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpc.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h +index a2e062d..6810b0b 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h +@@ -52,6 +52,8 @@ namespace XmlRpc { + //! Report an error. Custom error handlers should define this method. + virtual void error(const char* msg) = 0; + ++ virtual ~XmlRpcErrorHandler() {} ++ + protected: + static XmlRpcErrorHandler* _errorHandler; + }; +@@ -78,6 +80,8 @@ namespace XmlRpc { + //! Output a message. Custom error handlers should define this method. + virtual void log(int level, const char* msg) = 0; + ++ virtual ~XmlRpcLogHandler() {} ++ + protected: + static XmlRpcLogHandler* _logHandler; + static int _verbosity; +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch b/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch new file mode 100644 index 0000000..afecae5 --- /dev/null +++ b/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch @@ -0,0 +1,50 @@ +From 48e3b01d0a66e135f239f824033ff6c857827364 Mon Sep 17 00:00:00 2001 +From: Paul Fitzpatrick +Date: Mon, 11 Jul 2011 16:51:09 +0000 +Subject: [PATCH 06/17] merge improved tcpros + .msg support from yarpros + branch on launchpad + +svn path=/trunk/yarp2/; revision=8682 +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServerConnection.cpp | 2 +- + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.cpp | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +index 7377fab..13cad73 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +@@ -371,7 +371,7 @@ XmlRpcServerConnection::generateHeader(std::string const& body) + "Content-length: "; + + char buffLen[40]; +- sprintf(buffLen,"%d\r\n\r\n", body.size()); ++ sprintf(buffLen,"%d\r\n\r\n", (int)body.size()); + + return header + buffLen; + } +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +index 9929e6d..cf56423 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +@@ -452,7 +452,7 @@ namespace XmlRpc { + { + printf("binaryToXml disabled until license of base64.h determined\n"); + exit(1); +- return false; ++ return ""; + /* + // convert to base64 + std::vector base64data; +@@ -577,7 +577,7 @@ namespace XmlRpc { + } + case TypeBase64: + { +- int iostatus = 0; ++ //int iostatus = 0; + std::ostreambuf_iterator out(os); + /* + base64 encoder; +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch b/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch new file mode 100644 index 0000000..994c6e2 --- /dev/null +++ b/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch @@ -0,0 +1,36 @@ +From 447f0b0d141f162b8481d05bfbbb317878761388 Mon Sep 17 00:00:00 2001 +From: Paul Fitzpatrick +Date: Mon, 29 Aug 2011 22:19:07 +0000 +Subject: [PATCH 07/17] tidy up windows build of tcpros carrier + +svn path=/trunk/yarp2/; revision=8803 +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcSocket.cpp | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +index c73de9e..078c32f 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +@@ -12,9 +12,15 @@ + # include + //# pragma lib(WS2_32.lib) + +-# define EINPROGRESS WSAEINPROGRESS +-# define EWOULDBLOCK WSAEWOULDBLOCK +-# define ETIMEDOUT WSAETIMEDOUT ++# ifndef EINPROGRESS ++# define EINPROGRESS WSAEINPROGRESS ++# endif ++# ifndef EWOULDBLOCK ++# define EWOULDBLOCK WSAEWOULDBLOCK ++# endif ++# ifndef ETIMEDOUT ++# define ETIMEDOUT WSAETIMEDOUT ++# endif + #else + extern "C" { + # include +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0008-fix-integer-type.patch b/extern/xmlrpcpp/patches/0008-fix-integer-type.patch new file mode 100644 index 0000000..fd92a47 --- /dev/null +++ b/extern/xmlrpcpp/patches/0008-fix-integer-type.patch @@ -0,0 +1,26 @@ +From ae3580f308d7b30b6e04121fdcf0fd64ab52126c Mon Sep 17 00:00:00 2001 +From: Paul Fitzpatrick +Date: Wed, 19 Oct 2011 20:04:53 +0000 +Subject: [PATCH 08/17] fix integer type + +svn path=/trunk/yarp2/; revision=8884 +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcClient.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +index e968e7e..f5dc84c 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +@@ -254,7 +254,7 @@ XmlRpcClient::generateHeader(std::string const& body) + header += buff; + header += "Content-Type: text/xml\r\nContent-length: "; + +- sprintf(buff,"%d\r\n\r\n", body.size()); ++ sprintf(buff,"%d\r\n\r\n", (int)body.size()); + + return header + buff; + } +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch b/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch new file mode 100644 index 0000000..5f89c65 --- /dev/null +++ b/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch @@ -0,0 +1,28 @@ +From dfa12005a8b39bc8abe76cdbdea1f19d086cc836 Mon Sep 17 00:00:00 2001 +From: Paul Fitzpatrick +Date: Wed, 16 May 2012 00:55:46 +0000 +Subject: [PATCH 09/17] add library needed with msvc dll build + +svn path=/trunk/yarp2/; revision=9153 +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcSocket.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +index 078c32f..3b7b3c6 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +@@ -10,7 +10,9 @@ + #if defined(_WINDOWS) + # include + # include +-//# pragma lib(WS2_32.lib) ++# ifdef _MSC_VER ++# pragma lib(WS2_32.lib) ++# endif + + # ifndef EINPROGRESS + # define EINPROGRESS WSAEINPROGRESS +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch b/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch new file mode 100644 index 0000000..2141117 --- /dev/null +++ b/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch @@ -0,0 +1,1132 @@ +From 57c407b67df1110c74881f32e4bf8b05e1b1cd91 Mon Sep 17 00:00:00 2001 +From: Paul Fitzpatrick +Date: Wed, 16 May 2012 21:12:05 +0000 +Subject: [PATCH 10/17] drop unneeded xmlrpc code that is choking msvc dll + build + +svn path=/trunk/yarp2/; revision=9157 +--- + .../xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 108 +------- + extern/xmlrpcpp/xmlrpcpp/XmlRpcClient.h | 4 - + .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.cpp | 213 ---------------- + .../xmlrpc_carrier/xmlrpc/XmlRpcDispatch.h | 91 ------- + .../xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp | 79 +----- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServer.h | 4 +- + .../xmlrpc/XmlRpcServerConnection.cpp | 30 +-- + .../xmlrpc_carrier/xmlrpc/XmlRpcSocket.cpp | 275 --------------------- + extern/xmlrpcpp/xmlrpcpp/XmlRpcSocket.h | 72 ------ + .../xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp | 7 - + 10 files changed, 12 insertions(+), 871 deletions(-) + delete mode 100644 extern/xmlrpcpp/xmlrpcpp/XmlRpcDispatch.cpp + delete mode 100644 extern/xmlrpcpp/xmlrpcpp/XmlRpcDispatch.h + delete mode 100644 extern/xmlrpcpp/xmlrpcpp/XmlRpcSocket.cpp + delete mode 100644 extern/xmlrpcpp/xmlrpcpp/XmlRpcSocket.h + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +index f5dc84c..d31ffb5 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +@@ -5,7 +5,6 @@ + + #include "XmlRpcClient.h" + +-#include "XmlRpcSocket.h" + #include "XmlRpc.h" + + #include +@@ -59,8 +58,6 @@ XmlRpcClient::close() + { + XmlRpcUtil::log(4, "XmlRpcClient::close: fd %d.", getfd()); + _connectionState = NO_CONNECTION; +- _disp.exit(); +- _disp.removeSource(this); + XmlRpcSource::close(); + } + +@@ -79,36 +76,7 @@ struct ClearFlagOnExit { + bool + XmlRpcClient::execute(const char* method, XmlRpcValue const& params, XmlRpcValue& result) + { +- XmlRpcUtil::log(1, "XmlRpcClient::execute: method %s (_connectionState %d).", method, _connectionState); +- +- // This is not a thread-safe operation, if you want to do multithreading, use separate +- // clients for each thread. If you want to protect yourself from multiple threads +- // accessing the same client, replace this code with a real mutex. +- if (_executing) +- return false; +- +- _executing = true; +- ClearFlagOnExit cf(_executing); +- +- _sendAttempts = 0; +- _isFault = false; +- +- if ( ! setupConnection()) +- return false; +- +- if ( ! generateRequest(method, params)) +- return false; +- +- result.clear(); +- double msTime = -1.0; // Process until exit is called +- _disp.work(msTime); +- +- if (_connectionState != IDLE || ! parseResponse(result)) +- return false; +- +- XmlRpcUtil::log(1, "XmlRpcClient::execute: method %s completed.", method); +- _response = ""; +- return true; ++ return false; + } + + // XmlRpcSource interface implementation +@@ -116,29 +84,7 @@ XmlRpcClient::execute(const char* method, XmlRpcValue const& params, XmlRpcValue + unsigned + XmlRpcClient::handleEvent(unsigned eventType) + { +- if (eventType == XmlRpcDispatch::Exception) +- { +- if (_connectionState == WRITE_REQUEST && _bytesWritten == 0) +- XmlRpcUtil::error("Error in XmlRpcClient::handleEvent: could not connect to server (%s).", +- XmlRpcSocket::getErrorMsg().c_str()); +- else +- XmlRpcUtil::error("Error in XmlRpcClient::handleEvent (state %d): %s.", +- _connectionState, XmlRpcSocket::getErrorMsg().c_str()); +- return 0; +- } +- +- if (_connectionState == WRITE_REQUEST) +- if ( ! writeRequest()) return 0; +- +- if (_connectionState == READ_HEADER) +- if ( ! readHeader()) return 0; +- +- if (_connectionState == READ_RESPONSE) +- if ( ! readResponse()) return 0; +- +- // This should probably always ask for Exception events too +- return (_connectionState == WRITE_REQUEST) +- ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent; ++ return 0; + } + + +@@ -159,10 +105,6 @@ XmlRpcClient::setupConnection() + _connectionState = WRITE_REQUEST; + _bytesWritten = 0; + +- // Notify the dispatcher to listen on this source (calls handleEvent when the socket is writable) +- _disp.removeSource(this); // Make sure nothing is left over +- _disp.addSource(this, XmlRpcDispatch::WritableEvent | XmlRpcDispatch::Exception); +- + return true; + } + +@@ -171,32 +113,7 @@ XmlRpcClient::setupConnection() + bool + XmlRpcClient::doConnect() + { +- int fd = XmlRpcSocket::socket(); +- if (fd < 0) +- { +- XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not create socket (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- +- XmlRpcUtil::log(3, "XmlRpcClient::doConnect: fd %d.", fd); +- this->setfd(fd); +- +- // Don't block on connect/reads/writes +- if ( ! XmlRpcSocket::setNonBlocking(fd)) +- { +- this->close(); +- XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not set socket to non-blocking IO mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- +- if ( ! XmlRpcSocket::connect(fd, _host, _port)) +- { +- this->close(); +- XmlRpcUtil::error("Error in XmlRpcClient::doConnect: Could not connect to server (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- +- return true; ++ return false; + } + + // Encode the request to call the specified method with the specified parameters into xml +@@ -262,24 +179,7 @@ XmlRpcClient::generateHeader(std::string const& body) + bool + XmlRpcClient::writeRequest() + { +- if (_bytesWritten == 0) +- XmlRpcUtil::log(5, "XmlRpcClient::writeRequest (attempt %d):\n%s\n", _sendAttempts+1, _request.c_str()); +- +- // Try to write the request +- if ( ! XmlRpcSocket::nbWrite(this->getfd(), _request, &_bytesWritten)) { +- XmlRpcUtil::error("Error in XmlRpcClient::writeRequest: write error (%s).",XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- +- XmlRpcUtil::log(3, "XmlRpcClient::writeRequest: wrote %d of %d bytes.", _bytesWritten, _request.length()); +- +- // Wait for the result +- if (_bytesWritten == int(_request.length())) { +- _header = ""; +- _response = ""; +- _connectionState = READ_HEADER; +- } +- return true; ++ return false; + } + + void XmlRpcClient::reset() { +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +index 949c739..6596618 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +@@ -15,7 +15,6 @@ + # include + #endif + +-#include "XmlRpcDispatch.h" + #include "XmlRpcSource.h" + + namespace XmlRpc { +@@ -124,9 +123,6 @@ namespace XmlRpc { + // Number of bytes expected in the response body (parsed from response header) + int _contentLength; + +- // Event dispatcher +- XmlRpcDispatch _disp; +- + }; // class XmlRpcClient + + } // namespace XmlRpc +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.cpp +deleted file mode 100644 +index 9fc41cb..0000000 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.cpp ++++ /dev/null +@@ -1,213 +0,0 @@ +- +-// Summary for YARP: +-// Copyright: 2002, 2003 Chris Morley +-// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +- +-#include "XmlRpcDispatch.h" +-#include "XmlRpcSource.h" +-#include "XmlRpcUtil.h" +- +-#include +-#include +- +-#if defined(_WINDOWS) +-# include +- +-# define USE_FTIME +-# if defined(_MSC_VER) +-# define timeb _timeb +-# define ftime _ftime +-# endif +-#else +-# include +-#endif // _WINDOWS +- +- +-using namespace XmlRpc; +- +- +-XmlRpcDispatch::XmlRpcDispatch() +-{ +- _endTime = -1.0; +- _doClear = false; +- _inWork = false; +-} +- +- +-XmlRpcDispatch::~XmlRpcDispatch() +-{ +-} +- +-// Monitor this source for the specified events and call its event handler +-// when the event occurs +-void +-XmlRpcDispatch::addSource(XmlRpcSource* source, unsigned mask) +-{ +- _sources.push_back(MonitoredSource(source, mask)); +-} +- +-// Stop monitoring this source. Does not close the source. +-void +-XmlRpcDispatch::removeSource(XmlRpcSource* source) +-{ +- for (SourceList::iterator it=_sources.begin(); it!=_sources.end(); ++it) +- if (it->getSource() == source) +- { +- _sources.erase(it); +- break; +- } +-} +- +- +-// Modify the types of events to watch for on this source +-void +-XmlRpcDispatch::setSourceEvents(XmlRpcSource* source, unsigned eventMask) +-{ +- for (SourceList::iterator it=_sources.begin(); it!=_sources.end(); ++it) +- if (it->getSource() == source) +- { +- it->getMask() = eventMask; +- break; +- } +-} +- +- +- +-// Watch current set of sources and process events +-void +-XmlRpcDispatch::work(double timeout) +-{ +- // Compute end time +- _endTime = (timeout < 0.0) ? -1.0 : (getTime() + timeout); +- _doClear = false; +- _inWork = true; +- +- // Only work while there is something to monitor +- while (_sources.size() > 0) { +- +- // Construct the sets of descriptors we are interested in +- fd_set inFd, outFd, excFd; +- FD_ZERO(&inFd); +- FD_ZERO(&outFd); +- FD_ZERO(&excFd); +- +- int maxFd = -1; // Not used on windows +- SourceList::iterator it; +- for (it=_sources.begin(); it!=_sources.end(); ++it) { +- int fd = it->getSource()->getfd(); +- if (it->getMask() & ReadableEvent) FD_SET(fd, &inFd); +- if (it->getMask() & WritableEvent) FD_SET(fd, &outFd); +- if (it->getMask() & Exception) FD_SET(fd, &excFd); +- if (it->getMask() && fd > maxFd) maxFd = fd; +- } +- +- // Check for events +- int nEvents; +- if (timeout < 0.0) +- nEvents = select(maxFd+1, &inFd, &outFd, &excFd, NULL); +- else +- { +- struct timeval tv; +- tv.tv_sec = (int)floor(timeout); +- tv.tv_usec = ((int)floor(1000000.0 * (timeout-floor(timeout)))) % 1000000; +- nEvents = select(maxFd+1, &inFd, &outFd, &excFd, &tv); +- } +- +- if (nEvents < 0) +- { +- XmlRpcUtil::error("Error in XmlRpcDispatch::work: error in select (%d).", nEvents); +- _inWork = false; +- return; +- } +- +- // Process events +- for (it=_sources.begin(); it != _sources.end(); ) +- { +- SourceList::iterator thisIt = it++; +- XmlRpcSource* src = thisIt->getSource(); +- int fd = src->getfd(); +- unsigned newMask = (unsigned) -1; +- if (fd <= maxFd) { +- // If you select on multiple event types this could be ambiguous +- if (FD_ISSET(fd, &inFd)) +- newMask &= src->handleEvent(ReadableEvent); +- if (FD_ISSET(fd, &outFd)) +- newMask &= src->handleEvent(WritableEvent); +- if (FD_ISSET(fd, &excFd)) +- newMask &= src->handleEvent(Exception); +- +- if ( ! newMask) { +- _sources.erase(thisIt); // Stop monitoring this one +- if ( ! src->getKeepOpen()) +- src->close(); +- } else if (newMask != (unsigned) -1) { +- thisIt->getMask() = newMask; +- } +- } +- } +- +- // Check whether to clear all sources +- if (_doClear) +- { +- SourceList closeList = _sources; +- _sources.clear(); +- for (SourceList::iterator it=closeList.begin(); it!=closeList.end(); ++it) { +- XmlRpcSource *src = it->getSource(); +- src->close(); +- } +- +- _doClear = false; +- } +- +- // Check whether end time has passed +- if (0 <= _endTime && getTime() > _endTime) +- break; +- } +- +- _inWork = false; +-} +- +- +-// Exit from work routine. Presumably this will be called from +-// one of the source event handlers. +-void +-XmlRpcDispatch::exit() +-{ +- _endTime = 0.0; // Return from work asap +-} +- +-// Clear all sources from the monitored sources list +-void +-XmlRpcDispatch::clear() +-{ +- if (_inWork) +- _doClear = true; // Finish reporting current events before clearing +- else +- { +- SourceList closeList = _sources; +- _sources.clear(); +- for (SourceList::iterator it=closeList.begin(); it!=closeList.end(); ++it) +- it->getSource()->close(); +- } +-} +- +- +-double +-XmlRpcDispatch::getTime() +-{ +-#ifdef USE_FTIME +- struct timeb tbuff; +- +- ftime(&tbuff); +- return ((double) tbuff.time + ((double)tbuff.millitm / 1000.0) + +- ((double) tbuff.timezone * 60)); +-#else +- struct timeval tv; +- struct timezone tz; +- +- gettimeofday(&tv, &tz); +- return (tv.tv_sec + tv.tv_usec / 1000000.0); +-#endif /* USE_FTIME */ +-} +- +- +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.h +deleted file mode 100644 +index 0f6448a..0000000 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcDispatch.h ++++ /dev/null +@@ -1,91 +0,0 @@ +- +-#ifndef _XMLRPCDISPATCH_H_ +-#define _XMLRPCDISPATCH_H_ +-// +-// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +-// +-// Summary for YARP: +-// Copyright: 2002, 2003 Chris Morley +-// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +-#if defined(_MSC_VER) +-# pragma warning(disable:4786) // identifier was truncated in debug info +-#endif +- +-#ifndef MAKEDEPEND +-# include +-#endif +- +-namespace XmlRpc { +- +- // An RPC source represents a file descriptor to monitor +- class XmlRpcSource; +- +- //! An object which monitors file descriptors for events and performs +- //! callbacks when interesting events happen. +- class XmlRpcDispatch { +- public: +- //! Constructor +- XmlRpcDispatch(); +- ~XmlRpcDispatch(); +- +- //! Values indicating the type of events a source is interested in +- enum EventType { +- ReadableEvent = 1, //!< data available to read +- WritableEvent = 2, //!< connected/data can be written without blocking +- Exception = 4 //!< uh oh +- }; +- +- //! Monitor this source for the event types specified by the event mask +- //! and call its event handler when any of the events occur. +- //! @param source The source to monitor +- //! @param eventMask Which event types to watch for. \see EventType +- void addSource(XmlRpcSource* source, unsigned eventMask); +- +- //! Stop monitoring this source. +- //! @param source The source to stop monitoring +- void removeSource(XmlRpcSource* source); +- +- //! Modify the types of events to watch for on this source +- void setSourceEvents(XmlRpcSource* source, unsigned eventMask); +- +- +- //! Watch current set of sources and process events for the specified +- //! duration (in ms, -1 implies wait forever, or until exit is called) +- void work(double msTime); +- +- //! Exit from work routine +- void exit(); +- +- //! Clear all sources from the monitored sources list. Sources are closed. +- void clear(); +- +- protected: +- +- // helper +- double getTime(); +- +- // A source to monitor and what to monitor it for +- struct MonitoredSource { +- MonitoredSource(XmlRpcSource* src, unsigned mask) : _src(src), _mask(mask) {} +- XmlRpcSource* getSource() const { return _src; } +- unsigned& getMask() { return _mask; } +- XmlRpcSource* _src; +- unsigned _mask; +- }; +- +- // A list of sources to monitor +- typedef std::list< MonitoredSource > SourceList; +- +- // Sources being monitored +- SourceList _sources; +- +- // When work should stop (-1 implies wait forever, or until exit is called) +- double _endTime; +- +- bool _doClear; +- bool _inWork; +- +- }; +-} // namespace XmlRpc +- +-#endif // _XMLRPCDISPATCH_H_ +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp +index b3351e5..bd4f582 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp +@@ -5,7 +5,6 @@ + #include "XmlRpcServer.h" + #include "XmlRpcServerConnection.h" + #include "XmlRpcServerMethod.h" +-#include "XmlRpcSocket.h" + #include "XmlRpcUtil.h" + #include "XmlRpcException.h" + +@@ -72,53 +71,7 @@ XmlRpcServer::findMethod(const std::string& name) const + bool + XmlRpcServer::bindAndListen(int port, int backlog /*= 5*/) + { +- int fd = XmlRpcSocket::socket(); +- if (fd < 0) +- { +- XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not create socket (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- +- this->setfd(fd); +- +- // Don't block on reads/writes +- if ( ! XmlRpcSocket::setNonBlocking(fd)) +- { +- this->close(); +- XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set socket to non-blocking input mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- +- // Allow this port to be re-bound immediately so server re-starts are not delayed +- if ( ! XmlRpcSocket::setReuseAddr(fd)) +- { +- this->close(); +- XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set SO_REUSEADDR socket option (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- +- // Bind to the specified port on the default interface +- if ( ! XmlRpcSocket::bind(fd, port)) +- { +- this->close(); +- XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not bind to specified port (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- +- // Set in listening mode +- if ( ! XmlRpcSocket::listen(fd, backlog)) +- { +- this->close(); +- XmlRpcUtil::error("XmlRpcServer::bindAndListen: Could not set socket in listening mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- +- XmlRpcUtil::log(2, "XmlRpcServer::bindAndListen: server listening on port %d fd %d", port, fd); +- +- // Notify the dispatcher to listen on this source when we are in work() +- _disp.addSource(this, XmlRpcDispatch::ReadableEvent); +- +- return true; ++ return false; + } + + +@@ -126,8 +79,7 @@ XmlRpcServer::bindAndListen(int port, int backlog /*= 5*/) + void + XmlRpcServer::work(double msTime) + { +- XmlRpcUtil::log(2, "XmlRpcServer::work: waiting for a connection"); +- _disp.work(msTime); ++ return; + } + + +@@ -137,8 +89,7 @@ XmlRpcServer::work(double msTime) + unsigned + XmlRpcServer::handleEvent(unsigned mask) + { +- acceptConnection(); +- return XmlRpcDispatch::ReadableEvent; // Continue to monitor this fd ++ return -1; + } + + +@@ -147,23 +98,6 @@ XmlRpcServer::handleEvent(unsigned mask) + void + XmlRpcServer::acceptConnection() + { +- int s = XmlRpcSocket::accept(this->getfd()); +- XmlRpcUtil::log(2, "XmlRpcServer::acceptConnection: socket %d", s); +- if (s < 0) +- { +- //this->close(); +- XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not accept connection (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- } +- else if ( ! XmlRpcSocket::setNonBlocking(s)) +- { +- XmlRpcSocket::close(s); +- XmlRpcUtil::error("XmlRpcServer::acceptConnection: Could not set socket to non-blocking input mode (%s).", XmlRpcSocket::getErrorMsg().c_str()); +- } +- else // Notify the dispatcher to listen for input on this source when we are in work() +- { +- XmlRpcUtil::log(2, "XmlRpcServer::acceptConnection: creating a connection"); +- _disp.addSource(this->createConnection(s), XmlRpcDispatch::ReadableEvent); +- } + } + + +@@ -171,15 +105,13 @@ XmlRpcServer::acceptConnection() + XmlRpcServerConnection* + XmlRpcServer::createConnection(int s) + { +- // Specify that the connection object be deleted when it is closed +- return new XmlRpcServerConnection(s, this, true); ++ return NULL; + } + + + void + XmlRpcServer::removeConnection(XmlRpcServerConnection* sc) + { +- _disp.removeSource(sc); + } + + +@@ -187,7 +119,6 @@ XmlRpcServer::removeConnection(XmlRpcServerConnection* sc) + void + XmlRpcServer::exit() + { +- _disp.exit(); + } + + +@@ -195,8 +126,6 @@ XmlRpcServer::exit() + void + XmlRpcServer::shutdown() + { +- // This closes and destroys all connections as well as closing this socket +- _disp.clear(); + } + + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h +index 566bf75..16bb4a4 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h +@@ -16,7 +16,7 @@ + # include + #endif + +-#include "XmlRpcDispatch.h" ++//#include "XmlRpcDispatch.h" + #include "XmlRpcSource.h" + + namespace XmlRpc { +@@ -91,7 +91,7 @@ namespace XmlRpc { + bool _introspectionEnabled; + + // Event dispatcher +- XmlRpcDispatch _disp; ++ //XmlRpcDispatch _disp; + + // Collection of methods. This could be a set keyed on method name if we wanted... + typedef std::map< std::string, XmlRpcServerMethod* > MethodMap; +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +index 13cad73..73f3681 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +@@ -4,7 +4,6 @@ + + #include "XmlRpcServerConnection.h" + +-#include "XmlRpcSocket.h" + #include "XmlRpc.h" + #ifndef MAKEDEPEND + # include +@@ -65,8 +64,7 @@ XmlRpcServerConnection::handleEvent(unsigned /*eventType*/) + if (_connectionState == WRITE_RESPONSE) + if ( ! writeResponse()) return 0; + +- return (_connectionState == WRITE_RESPONSE) +- ? XmlRpcDispatch::WritableEvent : XmlRpcDispatch::ReadableEvent; ++ return 0; + } + + void XmlRpcServerConnection::reset() { +@@ -201,31 +199,7 @@ XmlRpcServerConnection::readRequest(const std::string& txt) + bool + XmlRpcServerConnection::writeResponse() + { +- if (_response.length() == 0) { +- executeRequest(); +- _bytesWritten = 0; +- if (_response.length() == 0) { +- XmlRpcUtil::error("XmlRpcServerConnection::writeResponse: empty response."); +- return false; +- } +- } +- +- // Try to write the response +- if ( ! XmlRpcSocket::nbWrite(this->getfd(), _response, &_bytesWritten)) { +- XmlRpcUtil::error("XmlRpcServerConnection::writeResponse: write error (%s).",XmlRpcSocket::getErrorMsg().c_str()); +- return false; +- } +- XmlRpcUtil::log(3, "XmlRpcServerConnection::writeResponse: wrote %d of %d bytes.", _bytesWritten, _response.length()); +- +- // Prepare to read the next request +- if (_bytesWritten == int(_response.length())) { +- _header = ""; +- _request = ""; +- _response = ""; +- _connectionState = READ_HEADER; +- } +- +- return _keepAlive; // Continue monitoring this source if true ++ return false; + } + + // Run the method, generate _response string +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp +deleted file mode 100644 +index 3b7b3c6..0000000 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.cpp ++++ /dev/null +@@ -1,275 +0,0 @@ +-// Summary for YARP: +-// Copyright: 2002, 2003 Chris Morley +-// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +- +-#include "XmlRpcSocket.h" +-#include "XmlRpcUtil.h" +- +-#ifndef MAKEDEPEND +- +-#if defined(_WINDOWS) +-# include +-# include +-# ifdef _MSC_VER +-# pragma lib(WS2_32.lib) +-# endif +- +-# ifndef EINPROGRESS +-# define EINPROGRESS WSAEINPROGRESS +-# endif +-# ifndef EWOULDBLOCK +-# define EWOULDBLOCK WSAEWOULDBLOCK +-# endif +-# ifndef ETIMEDOUT +-# define ETIMEDOUT WSAETIMEDOUT +-# endif +-#else +-extern "C" { +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-# include +-} +-#endif // _WINDOWS +- +-#include +-#include +- +-#endif // MAKEDEPEND +- +- +-using namespace XmlRpc; +- +- +- +-#if defined(_WINDOWS) +- +-static void initWinSock() +-{ +- static bool wsInit = false; +- if (! wsInit) +- { +- WORD wVersionRequested = MAKEWORD( 2, 0 ); +- WSADATA wsaData; +- WSAStartup(wVersionRequested, &wsaData); +- wsInit = true; +- } +-} +- +-#else +- +-#define initWinSock() +- +-#endif // _WINDOWS +- +- +-// These errors are not considered fatal for an IO operation; the operation will be re-tried. +-static inline bool +-nonFatalError() +-{ +- //int err = XmlRpcSocket::getError(); +- //return (err == EINPROGRESS || err == EAGAIN || err == EWOULDBLOCK || err == EINTR); +- return false; // do not need this for YARP, and causes problems on windows +-} +- +- +- +-int +-XmlRpcSocket::socket() +-{ +- initWinSock(); +- return (int) ::socket(AF_INET, SOCK_STREAM, 0); +-} +- +- +-void +-XmlRpcSocket::close(int fd) +-{ +- XmlRpcUtil::log(4, "XmlRpcSocket::close: fd %d.", fd); +-#if defined(_WINDOWS) +- closesocket(fd); +-#else +- ::close(fd); +-#endif // _WINDOWS +-} +- +- +- +- +-bool +-XmlRpcSocket::setNonBlocking(int fd) +-{ +-#if defined(_WINDOWS) +- unsigned long flag = 1; +- return (ioctlsocket((SOCKET)fd, FIONBIO, &flag) == 0); +-#else +- return (fcntl(fd, F_SETFL, O_NONBLOCK) == 0); +-#endif // _WINDOWS +-} +- +- +-bool +-XmlRpcSocket::setReuseAddr(int fd) +-{ +- // Allow this port to be re-bound immediately so server re-starts are not delayed +- int sflag = 1; +- return (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (const char *)&sflag, sizeof(sflag)) == 0); +-} +- +- +-// Bind to a specified port +-bool +-XmlRpcSocket::bind(int fd, int port) +-{ +- struct sockaddr_in saddr; +- memset(&saddr, 0, sizeof(saddr)); +- saddr.sin_family = AF_INET; +- saddr.sin_addr.s_addr = htonl(INADDR_ANY); +- saddr.sin_port = htons((u_short) port); +- return (::bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)) == 0); +-} +- +- +-// Set socket in listen mode +-bool +-XmlRpcSocket::listen(int fd, int backlog) +-{ +- return (::listen(fd, backlog) == 0); +-} +- +- +-int +-XmlRpcSocket::accept(int fd) +-{ +- struct sockaddr_in addr; +-#if defined(_WINDOWS) +- int +-#else +- socklen_t +-#endif +- addrlen = sizeof(addr); +- +- return (int) ::accept(fd, (struct sockaddr*)&addr, &addrlen); +-} +- +- +- +-// Connect a socket to a server (from a client) +-bool +-XmlRpcSocket::connect(int fd, std::string& host, int port) +-{ +- struct sockaddr_in saddr; +- memset(&saddr, 0, sizeof(saddr)); +- saddr.sin_family = AF_INET; +- +- struct hostent *hp = gethostbyname(host.c_str()); +- if (hp == 0) return false; +- +- saddr.sin_family = hp->h_addrtype; +- memcpy(&saddr.sin_addr, hp->h_addr, hp->h_length); +- saddr.sin_port = htons((u_short) port); +- +- // For asynch operation, this will return EWOULDBLOCK (windows) or +- // EINPROGRESS (linux) and we just need to wait for the socket to be writable... +- int result = ::connect(fd, (struct sockaddr *)&saddr, sizeof(saddr)); +- return result == 0 || nonFatalError(); +-} +- +- +- +-// Read available text from the specified socket. Returns false on error. +-bool +-XmlRpcSocket::nbRead(int fd, std::string& s, bool *eof) +-{ +- const int READ_SIZE = 4096; // Number of bytes to attempt to read at a time +- char readBuf[READ_SIZE]; +- +- bool wouldBlock = false; +- *eof = false; +- +- while ( ! wouldBlock && ! *eof) { +-#if defined(_WINDOWS) +- int n = recv(fd, readBuf, READ_SIZE-1, 0); +-#else +- int n = read(fd, readBuf, READ_SIZE-1); +-#endif +- XmlRpcUtil::log(5, "XmlRpcSocket::nbRead: read/recv returned %d.", n); +- +- if (n > 0) { +- readBuf[n] = 0; +- s.append(readBuf, n); +- } else if (n == 0) { +- *eof = true; +- } else if (nonFatalError()) { +- wouldBlock = true; +- } else { +- return false; // Error +- } +- } +- return true; +-} +- +- +-// Write text to the specified socket. Returns false on error. +-bool +-XmlRpcSocket::nbWrite(int fd, std::string& s, int *bytesSoFar) +-{ +- int nToWrite = int(s.length()) - *bytesSoFar; +- char *sp = const_cast(s.c_str()) + *bytesSoFar; +- bool wouldBlock = false; +- +- while ( nToWrite > 0 && ! wouldBlock ) { +-#if defined(_WINDOWS) +- int n = send(fd, sp, nToWrite, 0); +-#else +- int n = write(fd, sp, nToWrite); +-#endif +- XmlRpcUtil::log(5, "XmlRpcSocket::nbWrite: send/write returned %d.", n); +- +- if (n > 0) { +- sp += n; +- *bytesSoFar += n; +- nToWrite -= n; +- } else if (nonFatalError()) { +- wouldBlock = true; +- } else { +- return false; // Error +- } +- } +- return true; +-} +- +- +-// Returns last errno +-int +-XmlRpcSocket::getError() +-{ +-#if defined(_WINDOWS) +- return WSAGetLastError(); +-#else +- return errno; +-#endif +-} +- +- +-// Returns message corresponding to last errno +-std::string +-XmlRpcSocket::getErrorMsg() +-{ +- return getErrorMsg(getError()); +-} +- +-// Returns message corresponding to errno... well, it should anyway +-std::string +-XmlRpcSocket::getErrorMsg(int error) +-{ +- char err[60]; +- snprintf(err,sizeof(err),"error %d", error); +- return std::string(err); +-} +- +- +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.h +deleted file mode 100644 +index b549f3b..0000000 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSocket.h ++++ /dev/null +@@ -1,72 +0,0 @@ +-#ifndef _XMLRPCSOCKET_H_ +-#define _XMLRPCSOCKET_H_ +-// +-// XmlRpc++ Copyright (c) 2002-2003 by Chris Morley +-// +-// Summary for YARP: +-// Copyright: 2002, 2003 Chris Morley +-// CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +-#if defined(_MSC_VER) +-# pragma warning(disable:4786) // identifier was truncated in debug info +-#endif +- +-#ifndef MAKEDEPEND +-# include +-#endif +- +-namespace XmlRpc { +- +- //! A platform-independent socket API. +- class XmlRpcSocket { +- public: +- +- //! Creates a stream (TCP) socket. Returns -1 on failure. +- static int socket(); +- +- //! Closes a socket. +- static void close(int socket); +- +- +- //! Sets a stream (TCP) socket to perform non-blocking IO. Returns false on failure. +- static bool setNonBlocking(int socket); +- +- //! Read text from the specified socket. Returns false on error. +- static bool nbRead(int socket, std::string& s, bool *eof); +- +- //! Write text to the specified socket. Returns false on error. +- static bool nbWrite(int socket, std::string& s, int *bytesSoFar); +- +- +- // The next four methods are appropriate for servers. +- +- //! Allow the port the specified socket is bound to to be re-bound immediately so +- //! server re-starts are not delayed. Returns false on failure. +- static bool setReuseAddr(int socket); +- +- //! Bind to a specified port +- static bool bind(int socket, int port); +- +- //! Set socket in listen mode +- static bool listen(int socket, int backlog); +- +- //! Accept a client connection request +- static int accept(int socket); +- +- +- //! Connect a socket to a server (from a client) +- static bool connect(int socket, std::string& host, int port); +- +- +- //! Returns last errno +- static int getError(); +- +- //! Returns message corresponding to last error +- static std::string getErrorMsg(); +- +- //! Returns message corresponding to error +- static std::string getErrorMsg(int error); +- }; +- +-} // namespace XmlRpc +- +-#endif +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp +index 67b69ba..52da4f3 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp +@@ -3,7 +3,6 @@ + // CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + + #include "XmlRpcSource.h" +-#include "XmlRpcSocket.h" + #include "XmlRpcUtil.h" + + namespace XmlRpc { +@@ -22,12 +21,6 @@ namespace XmlRpc { + void + XmlRpcSource::close() + { +- if (_fd != -1) { +- XmlRpcUtil::log(2,"XmlRpcSource::close: closing socket %d.", _fd); +- XmlRpcSocket::close(_fd); +- XmlRpcUtil::log(2,"XmlRpcSource::close: done closing socket %d.", _fd); +- _fd = -1; +- } + if (_deleteOnClose) { + XmlRpcUtil::log(2,"XmlRpcSource::close: deleting this"); + _deleteOnClose = false; +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0011-Cleanup.patch b/extern/xmlrpcpp/patches/0011-Cleanup.patch new file mode 100644 index 0000000..04c76fc --- /dev/null +++ b/extern/xmlrpcpp/patches/0011-Cleanup.patch @@ -0,0 +1,61 @@ +From c44cf5c842b7bd679155d751ae7b4d46907a58a3 Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Mon, 4 Mar 2013 17:43:33 +0000 +Subject: [PATCH 11/17] [Cleanup] + +svn path=/trunk/yarp2/; revision=9933 +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.cpp | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +index cf56423..26bc55e 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +@@ -50,7 +50,7 @@ namespace XmlRpc { + static const char STRUCT_ETAG[] = ""; + + +- ++ + // Format strings + std::string XmlRpcValue::_doubleFormat("%f"); + +@@ -71,7 +71,7 @@ namespace XmlRpc { + _value.asBinary = 0; + } + +- ++ + // Type checking + void XmlRpcValue::assertTypeOrInvalid(Type t) + { +@@ -172,7 +172,7 @@ namespace XmlRpc { + { + if (_value.asStruct->size() != other._value.asStruct->size()) + return false; +- ++ + ValueStruct::const_iterator it1=_value.asStruct->begin(); + ValueStruct::const_iterator it2=other._value.asStruct->begin(); + while (it1 != _value.asStruct->end()) { +@@ -612,9 +612,9 @@ namespace XmlRpc { + os << ']'; + break; + } +- ++ + } +- ++ + return os; + } + +@@ -628,4 +628,3 @@ std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v) + //return os << v.toXml(); + return v.write(os); + } +- +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch b/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch new file mode 100644 index 0000000..b149e30 --- /dev/null +++ b/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch @@ -0,0 +1,24 @@ +From 85ca0d444c8462cd0d9da9130f82d6cfbf02f7fa Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Wed, 13 Nov 2013 11:51:20 +0100 +Subject: [PATCH 12/17] Documentation tweaks +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcUtil.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h +index c44f553..e48e6a0 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h +@@ -30,7 +30,7 @@ namespace XmlRpc { + class XmlRpcUtil { + public: + // hokey xml parsing +- //! Returns contents between and , updates offset to char after ++ //! Returns contents between \ and \, updates offset to char after \ + static std::string parseTag(const char* tag, std::string const& xml, int* offset); + + //! Returns true if the tag is found and updates offset to the char after the tag +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch b/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch new file mode 100644 index 0000000..9dd0abd --- /dev/null +++ b/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch @@ -0,0 +1,357 @@ +From 8ecaff0464bec2b6deb1538b3cb6b6d322cc0ac4 Mon Sep 17 00:00:00 2001 +From: Paul Fitzpatrick +Date: Fri, 11 Apr 2014 17:02:57 +0200 +Subject: [PATCH 13/17] [ros] change XmlRpc namespace to avoid conflict + +YARP and ROS both use the XmlRpc++ library. When YARP is +compiled statically, these libraries can conflict if the +user is also linking ROS. (This is not a problem when +YARP is compiled as a shared library, where the +XmlRpc-related symbols are not exposed). To support +static linking, the XmlRpc namespace in YARP is renamed +to YarpXmlRpc. See #167 +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpc.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcClient.cpp | 2 +- + extern/xmlrpcpp/xmlrpcpp/XmlRpcClient.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcException.h | 2 +- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServer.cpp | 2 +- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServer.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServerConnection.cpp | 2 +- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServerConnection.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServerMethod.cpp | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServerMethod.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcSource.cpp | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcSource.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcUtil.cpp | 8 ++++---- + extern/xmlrpcpp/xmlrpcpp/XmlRpcUtil.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.cpp | 6 +++--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.h | 6 +++--- + 16 files changed, 32 insertions(+), 32 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h +index 6810b0b..f168b53 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h +@@ -35,7 +35,7 @@ + #include "XmlRpcValue.h" + #include "XmlRpcUtil.h" + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + + //! An interface allowing custom handling of error message reporting. +@@ -96,6 +96,6 @@ namespace XmlRpc { + //! Version identifier + extern const char XMLRPC_VERSION[]; + +-} // namespace XmlRpc ++} // namespace YarpXmlRpc + + #endif // _XMLRPC_H_ +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +index d31ffb5..98eb5f3 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp +@@ -12,7 +12,7 @@ + #include + + +-using namespace XmlRpc; ++using namespace YarpXmlRpc; + + // Static data + const char XmlRpcClient::REQUEST_BEGIN[] = +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +index 6596618..b7775c2 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +@@ -17,7 +17,7 @@ + + #include "XmlRpcSource.h" + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + // Arguments and results are represented by XmlRpcValues + class XmlRpcValue; +@@ -125,6 +125,6 @@ namespace XmlRpc { + + }; // class XmlRpcClient + +-} // namespace XmlRpc ++} // namespace YarpXmlRpc + + #endif // _XMLRPCCLIENT_H_ +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h +index 31b6409..bef8ae1 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h +@@ -16,7 +16,7 @@ + #endif + + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + //! A class representing an error. + //! If server methods throw this exception, a fault response is returned +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp +index bd4f582..a07bc2d 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp +@@ -9,7 +9,7 @@ + #include "XmlRpcException.h" + + +-using namespace XmlRpc; ++using namespace YarpXmlRpc; + + + XmlRpcServer::XmlRpcServer() +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h +index 16bb4a4..41f2352 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h +@@ -19,7 +19,7 @@ + //#include "XmlRpcDispatch.h" + #include "XmlRpcSource.h" + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + + // An abstract class supporting XML RPC methods +@@ -102,6 +102,6 @@ namespace XmlRpc { + XmlRpcServerMethod* _methodHelp; + + }; +-} // namespace XmlRpc ++} // namespace YarpXmlRpc + + #endif //_XMLRPCSERVER_H_ +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +index 73f3681..92b88d9 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp +@@ -11,7 +11,7 @@ + # include + #endif + +-using namespace XmlRpc; ++using namespace YarpXmlRpc; + + // Static data + const char XmlRpcServerConnection::METHODNAME_TAG[] = ""; +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h +index b388aa2..69916c5 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h +@@ -17,7 +17,7 @@ + #include "XmlRpcValue.h" + #include "XmlRpcSource.h" + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + + // The server waits for client connections and provides methods +@@ -107,6 +107,6 @@ namespace XmlRpc { + // Whether to keep the current client connection open for further requests + bool _keepAlive; + }; +-} // namespace XmlRpc ++} // namespace YarpXmlRpc + + #endif // _XMLRPCSERVERCONNECTION_H_ +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp +index 1dbed4d..041a7c2 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp +@@ -5,7 +5,7 @@ + #include "XmlRpcServerMethod.h" + #include "XmlRpcServer.h" + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + + XmlRpcServerMethod::XmlRpcServerMethod(std::string const& name, XmlRpcServer* server) +@@ -21,4 +21,4 @@ namespace XmlRpc { + } + + +-} // namespace XmlRpc ++} // namespace YarpXmlRpc +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h +index 9332ebd..5149e1b 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h +@@ -16,7 +16,7 @@ + # include + #endif + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + // Representation of a parameter or result value + class XmlRpcValue; +@@ -46,6 +46,6 @@ namespace XmlRpc { + std::string _name; + XmlRpcServer* _server; + }; +-} // namespace XmlRpc ++} // namespace YarpXmlRpc + + #endif // _XMLRPCSERVERMETHOD_H_ +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp +index 52da4f3..f490b0f 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp +@@ -5,7 +5,7 @@ + #include "XmlRpcSource.h" + #include "XmlRpcUtil.h" + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + + XmlRpcSource::XmlRpcSource(int fd /*= -1*/, bool deleteOnClose /*= false*/) +@@ -28,4 +28,4 @@ namespace XmlRpc { + } + } + +-} // namespace XmlRpc ++} // namespace YarpXmlRpc +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h +index 5ad5cbb..4933cb5 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h +@@ -11,7 +11,7 @@ + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + //! An RPC source represents a file descriptor to monitor + class XmlRpcSource { +@@ -53,6 +53,6 @@ namespace XmlRpc { + // In the client, keep connections open if you intend to make multiple calls. + bool _keepOpen; + }; +-} // namespace XmlRpc ++} // namespace YarpXmlRpc + + #endif //_XMLRPCSOURCE_H_ +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp +index 8a60e2c..c1bb193 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp +@@ -14,7 +14,7 @@ + + #include "XmlRpc.h" + +-using namespace XmlRpc; ++using namespace YarpXmlRpc; + + + //#define USE_WINDOWS_DEBUG // To make the error and log messages go to VC++ debug output +@@ -24,7 +24,7 @@ using namespace XmlRpc; + #endif + + // Version id +-const char XmlRpc::XMLRPC_VERSION[] = "XMLRPC++ 0.7"; ++const char YarpXmlRpc::XMLRPC_VERSION[] = "XMLRPC++ 0.7"; + + // Default log verbosity: 0 for no messages through 5 (writes everything) + int XmlRpcLogHandler::_verbosity = 0; +@@ -66,8 +66,8 @@ XmlRpcErrorHandler* XmlRpcErrorHandler::_errorHandler = &defaultErrorHandler; + + + // Easy API for log verbosity +-int XmlRpc::getVerbosity() { return XmlRpcLogHandler::getVerbosity(); } +-void XmlRpc::setVerbosity(int level) { XmlRpcLogHandler::setVerbosity(level); } ++int YarpXmlRpc::getVerbosity() { return XmlRpcLogHandler::getVerbosity(); } ++void YarpXmlRpc::setVerbosity(int level) { XmlRpcLogHandler::setVerbosity(level); } + + + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h +index e48e6a0..b48a681 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h +@@ -24,7 +24,7 @@ + # define strncasecmp strnicmp + #endif + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + //! Utilities for XML parsing, encoding, and decoding and message handlers. + class XmlRpcUtil { +@@ -59,6 +59,6 @@ namespace XmlRpc { + static void error(const char* fmt, ...); + + }; +-} // namespace XmlRpc ++} // namespace YarpXmlRpc + + #endif // _XMLRPCUTIL_H_ +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +index 26bc55e..7efb039 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +@@ -18,7 +18,7 @@ + # include + #endif + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + + static const char VALUE_TAG[] = ""; +@@ -618,11 +618,11 @@ namespace XmlRpc { + return os; + } + +-} // namespace XmlRpc ++} // namespace YarpXmlRpc + + + // ostream +-std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v) ++std::ostream& operator<<(std::ostream& os, YarpXmlRpc::XmlRpcValue& v) + { + // If you want to output in xml format: + //return os << v.toXml(); +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +index b68fbdb..fae12c2 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +@@ -18,7 +18,7 @@ + # include + #endif + +-namespace XmlRpc { ++namespace YarpXmlRpc { + + //! RPC method arguments and results are represented by Values + // should probably refcount them... +@@ -184,10 +184,10 @@ namespace XmlRpc { + } _value; + + }; +-} // namespace XmlRpc ++} // namespace YarpXmlRpc + + +-std::ostream& operator<<(std::ostream& os, XmlRpc::XmlRpcValue& v); ++std::ostream& operator<<(std::ostream& os, YarpXmlRpc::XmlRpcValue& v); + + + #endif // _XMLRPCVALUE_H_ +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0014-Cleanup.patch b/extern/xmlrpcpp/patches/0014-Cleanup.patch new file mode 100644 index 0000000..786fb25 --- /dev/null +++ b/extern/xmlrpcpp/patches/0014-Cleanup.patch @@ -0,0 +1,43 @@ +From 53ea746a7fa2d2603df46763b8cb380dcc2407ab Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Thu, 27 Aug 2015 16:41:10 +0200 +Subject: [PATCH 14/17] [Cleanup] + +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.h | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +index fae12c2..2d4bda8 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +@@ -1,12 +1,14 @@ +- +-#ifndef _XMLRPCVALUE_H_ +-#define _XMLRPCVALUE_H_ + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // + // Summary for YARP: + // Copyright: 2002, 2003 Chris Morley + // CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT ++ ++#ifndef _XMLRPCVALUE_H_ ++#define _XMLRPCVALUE_H_ ++ ++ + #if defined(_MSC_VER) + # pragma warning(disable:4786) // identifier was truncated in debug info + #endif +@@ -182,7 +184,7 @@ namespace YarpXmlRpc { + ValueArray* asArray; + ValueStruct* asStruct; + } _value; +- ++ + }; + } // namespace YarpXmlRpc + +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch b/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch new file mode 100644 index 0000000..5a8d0be --- /dev/null +++ b/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch @@ -0,0 +1,25 @@ +From 9ddf972da49e7e258e8f0df7ef8c1a643d02f5b8 Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Thu, 8 Oct 2015 10:39:38 +0200 +Subject: [PATCH 15/17] Cleanup and Fix issues with latex/pdf generation + +--- + extern/xmlrpcpp/xmlrpcpp/README.html | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/README.html b/extern/xmlrpcpp/xmlrpcpp/README.html +index fd8e7f8..b9c3c40 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/README.html ++++ b/extern/xmlrpcpp/xmlrpcpp/README.html +@@ -5,7 +5,7 @@ + + + +- ++ + + +

XmlRpc++ Library

+-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch b/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch new file mode 100644 index 0000000..4c965be --- /dev/null +++ b/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch @@ -0,0 +1,136 @@ +From df486e58f8ec80e140e0f55e1c3833ac8ca50603 Mon Sep 17 00:00:00 2001 +From: Francesco Romano +Date: Wed, 6 Jan 2016 10:31:56 +0100 +Subject: [PATCH 16/17] Renamed macros to avoid leading underscore + +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpc.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcClient.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcException.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServer.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServerConnection.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcServerMethod.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcSource.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcUtil.h | 4 ++-- + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.h | 4 ++-- + 9 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h +index f168b53..3447181 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h +@@ -1,5 +1,5 @@ +-#ifndef _XMLRPC_H_ +-#define _XMLRPC_H_ ++#ifndef XMLRPC_H ++#define XMLRPC_H + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // This library is free software; you can redistribute it and/or +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +index b7775c2..6a473da 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h +@@ -1,6 +1,6 @@ + +-#ifndef _XMLRPCCLIENT_H_ +-#define _XMLRPCCLIENT_H_ ++#ifndef XMLRPCCLIENT_H ++#define XMLRPCCLIENT_H + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h +index bef8ae1..662b815 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h +@@ -1,6 +1,6 @@ + +-#ifndef _XMLRPCEXCEPTION_H_ +-#define _XMLRPCEXCEPTION_H_ ++#ifndef XMLRPCEXCEPTION_H ++#define XMLRPCEXCEPTION_H + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // Summary for YARP: +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h +index 41f2352..decfafa 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h +@@ -1,6 +1,6 @@ + +-#ifndef _XMLRPCSERVER_H_ +-#define _XMLRPCSERVER_H_ ++#ifndef XMLRPCSERVER_H ++#define XMLRPCSERVER_H + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h +index 69916c5..3a12697 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h +@@ -1,5 +1,5 @@ +-#ifndef _XMLRPCSERVERCONNECTION_H_ +-#define _XMLRPCSERVERCONNECTION_H_ ++#ifndef XMLRPCSERVERCONNECTION_H ++#define XMLRPCSERVERCONNECTION_H + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h +index 5149e1b..4ef4de4 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h +@@ -1,6 +1,6 @@ + +-#ifndef _XMLRPCSERVERMETHOD_H_ +-#define _XMLRPCSERVERMETHOD_H_ ++#ifndef XMLRPCSERVERMETHOD_H ++#define XMLRPCSERVERMETHOD_H + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h +index 4933cb5..e96d619 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h +@@ -1,6 +1,6 @@ + +-#ifndef _XMLRPCSOURCE_H_ +-#define _XMLRPCSOURCE_H_ ++#ifndef XMLRPCSOURCE_H ++#define XMLRPCSOURCE_H + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h +index b48a681..e4f9282 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h +@@ -1,5 +1,5 @@ +-#ifndef _XMLRPCUTIL_H_ +-#define _XMLRPCUTIL_H_ ++#ifndef XMLRPCUTIL_H ++#define XMLRPCUTIL_H + // + // XmlRpc++ Copyright (c) 2002-2003 by Chris Morley + // +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +index 2d4bda8..ca41ba8 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h +@@ -5,8 +5,8 @@ + // Copyright: 2002, 2003 Chris Morley + // CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + +-#ifndef _XMLRPCVALUE_H_ +-#define _XMLRPCVALUE_H_ ++#ifndef XMLRPCVALUE_H ++#define XMLRPCVALUE_H + + + #if defined(_MSC_VER) +-- +2.9.3 + diff --git a/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch b/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch new file mode 100644 index 0000000..5e7f16d --- /dev/null +++ b/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch @@ -0,0 +1,25 @@ +From 95238ffbcd164594ace75baff278ac936a14484b Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Tue, 11 Oct 2016 17:48:10 +0200 +Subject: [PATCH 17/17] xmlrpc++: Fix tmEq() method + +--- + extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +index 7efb039..2e176a6 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +@@ -148,7 +148,7 @@ namespace YarpXmlRpc { + // Predicate for tm equality + static bool tmEq(struct tm const& t1, struct tm const& t2) { + return t1.tm_sec == t2.tm_sec && t1.tm_min == t2.tm_min && +- t1.tm_hour == t2.tm_hour && t1.tm_mday == t1.tm_mday && ++ t1.tm_hour == t2.tm_hour && t1.tm_mday == t2.tm_mday && + t1.tm_mon == t2.tm_mon && t1.tm_year == t2.tm_year; + } + +-- +2.9.3 + diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/COPYING b/extern/xmlrpcpp/xmlrpcpp/COPYING similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/COPYING rename to extern/xmlrpcpp/xmlrpcpp/COPYING diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/README.html b/extern/xmlrpcpp/xmlrpcpp/README.html similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/README.html rename to extern/xmlrpcpp/xmlrpcpp/README.html diff --git a/extern/xmlrpcpp/xmlrpcpp/XmlRpc.sln b/extern/xmlrpcpp/xmlrpcpp/XmlRpc.sln new file mode 100644 index 0000000..674cd07 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/XmlRpc.sln @@ -0,0 +1,73 @@ +Microsoft Visual Studio Solution File, Format Version 7.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XmlRpc", "XmlRpc.vcproj", "{C9C8B7B0-2509-4B8A-9224-9FF04297C33B}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestXml", "Test\TestXml.vcproj", "{6F0C2ADA-0341-4183-8FAA-576668F1788A}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestValues", "Test\TestValues.vcproj", "{6181BBE3-DA50-4EEE-8D52-1F4245A1D603}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloClient", "Test\HelloClient.vcproj", "{F6860B2F-0F3B-445E-92F2-6DF3D36C90F0}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Validator", "Test\Validator.vcproj", "{E68AB694-4805-43EA-A96E-21B8FE285DE4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloServer", "Test\HelloServer.vcproj", "{08C4FFA8-A9E5-4EEA-9703-53C293C2F724}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FileClient", "test\FileClient.vcproj", "{C3B49855-CD45-448E-991E-3E4C9B02F465}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestBase64Client", "test\TestBase64Client.vcproj", "{1E8B725B-E898-494C-84C6-DB77EF38E6CB}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestBase64Server", "test\TestBase64Server.vcproj", "{D3107CC6-6300-47DE-B183-255B75CFE85A}" +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + ConfigName.0 = Debug + ConfigName.1 = Release + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + {6F0C2ADA-0341-4183-8FAA-576668F1788A}.0 = {C9C8B7B0-2509-4B8A-9224-9FF04297C33B} + {6181BBE3-DA50-4EEE-8D52-1F4245A1D603}.0 = {C9C8B7B0-2509-4B8A-9224-9FF04297C33B} + {F6860B2F-0F3B-445E-92F2-6DF3D36C90F0}.0 = {C9C8B7B0-2509-4B8A-9224-9FF04297C33B} + {08C4FFA8-A9E5-4EEA-9703-53C293C2F724}.0 = {C9C8B7B0-2509-4B8A-9224-9FF04297C33B} + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {C9C8B7B0-2509-4B8A-9224-9FF04297C33B}.Debug.ActiveCfg = Debug|Win32 + {C9C8B7B0-2509-4B8A-9224-9FF04297C33B}.Debug.Build.0 = Debug|Win32 + {C9C8B7B0-2509-4B8A-9224-9FF04297C33B}.Release.ActiveCfg = Release|Win32 + {C9C8B7B0-2509-4B8A-9224-9FF04297C33B}.Release.Build.0 = Release|Win32 + {6F0C2ADA-0341-4183-8FAA-576668F1788A}.Debug.ActiveCfg = Debug|Win32 + {6F0C2ADA-0341-4183-8FAA-576668F1788A}.Debug.Build.0 = Debug|Win32 + {6F0C2ADA-0341-4183-8FAA-576668F1788A}.Release.ActiveCfg = Release|Win32 + {6F0C2ADA-0341-4183-8FAA-576668F1788A}.Release.Build.0 = Release|Win32 + {6181BBE3-DA50-4EEE-8D52-1F4245A1D603}.Debug.ActiveCfg = Debug|Win32 + {6181BBE3-DA50-4EEE-8D52-1F4245A1D603}.Debug.Build.0 = Debug|Win32 + {6181BBE3-DA50-4EEE-8D52-1F4245A1D603}.Release.ActiveCfg = Release|Win32 + {6181BBE3-DA50-4EEE-8D52-1F4245A1D603}.Release.Build.0 = Release|Win32 + {F6860B2F-0F3B-445E-92F2-6DF3D36C90F0}.Debug.ActiveCfg = Debug|Win32 + {F6860B2F-0F3B-445E-92F2-6DF3D36C90F0}.Debug.Build.0 = Debug|Win32 + {F6860B2F-0F3B-445E-92F2-6DF3D36C90F0}.Release.ActiveCfg = Release|Win32 + {F6860B2F-0F3B-445E-92F2-6DF3D36C90F0}.Release.Build.0 = Release|Win32 + {E68AB694-4805-43EA-A96E-21B8FE285DE4}.Debug.ActiveCfg = Debug|Win32 + {E68AB694-4805-43EA-A96E-21B8FE285DE4}.Debug.Build.0 = Debug|Win32 + {E68AB694-4805-43EA-A96E-21B8FE285DE4}.Release.ActiveCfg = Release|Win32 + {E68AB694-4805-43EA-A96E-21B8FE285DE4}.Release.Build.0 = Release|Win32 + {08C4FFA8-A9E5-4EEA-9703-53C293C2F724}.Debug.ActiveCfg = Debug|Win32 + {08C4FFA8-A9E5-4EEA-9703-53C293C2F724}.Debug.Build.0 = Debug|Win32 + {08C4FFA8-A9E5-4EEA-9703-53C293C2F724}.Release.ActiveCfg = Release|Win32 + {08C4FFA8-A9E5-4EEA-9703-53C293C2F724}.Release.Build.0 = Release|Win32 + {C3B49855-CD45-448E-991E-3E4C9B02F465}.Debug.ActiveCfg = Debug|Win32 + {C3B49855-CD45-448E-991E-3E4C9B02F465}.Debug.Build.0 = Debug|Win32 + {C3B49855-CD45-448E-991E-3E4C9B02F465}.Release.ActiveCfg = Release|Win32 + {C3B49855-CD45-448E-991E-3E4C9B02F465}.Release.Build.0 = Release|Win32 + {1E8B725B-E898-494C-84C6-DB77EF38E6CB}.Debug.ActiveCfg = Debug|Win32 + {1E8B725B-E898-494C-84C6-DB77EF38E6CB}.Debug.Build.0 = Debug|Win32 + {1E8B725B-E898-494C-84C6-DB77EF38E6CB}.Release.ActiveCfg = Release|Win32 + {1E8B725B-E898-494C-84C6-DB77EF38E6CB}.Release.Build.0 = Release|Win32 + {D3107CC6-6300-47DE-B183-255B75CFE85A}.Debug.ActiveCfg = Debug|Win32 + {D3107CC6-6300-47DE-B183-255B75CFE85A}.Debug.Build.0 = Debug|Win32 + {D3107CC6-6300-47DE-B183-255B75CFE85A}.Release.ActiveCfg = Release|Win32 + {D3107CC6-6300-47DE-B183-255B75CFE85A}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/extern/xmlrpcpp/xmlrpcpp/XmlRpc.vcproj b/extern/xmlrpcpp/xmlrpcpp/XmlRpc.vcproj new file mode 100644 index 0000000..0a8d3cb --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/XmlRpc.vcproj @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/makefile b/extern/xmlrpcpp/xmlrpcpp/makefile new file mode 100644 index 0000000..1dcd466 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/makefile @@ -0,0 +1,42 @@ +# makefile written for gnu make +CXX = g++ +SRC = ./src +CPPFLAGS = -I$(SRC) +DEBUG = -g +OPTIMIZE = -O2 +GCCWARN = -Wall -Wstrict-prototypes +CXXFLAGS = $(DEBUG) $(GCCWARN) $(OPTIMIZE) $(INCLUDES) + +LIB = ./libXmlRpc.a + +# Add your system-dependent network libs here. These are +# only used to build the tests (your application will need them too). +# Linux: none +# Solaris: -lsocket -lnsl +#SYSTEMLIBS = -lsocket -lnsl +SYSTEMLIBS = +LDLIBS = $(LIB) $(SYSTEMLIBS) + +OBJ = $(SRC)/XmlRpcClient.o $(SRC)/XmlRpcDispatch.o \ + $(SRC)/XmlRpcServer.o $(SRC)/XmlRpcServerConnection.o \ + $(SRC)/XmlRpcServerMethod.o $(SRC)/XmlRpcSocket.o $(SRC)/XmlRpcSource.o \ + $(SRC)/XmlRpcUtil.o $(SRC)/XmlRpcValue.o + +all: $(LIB) tests + +$(LIB): $(OBJ) + $(AR) $(ARFLAGS) $(LIB) $(OBJ) + + +tests: $(LIB) + cd test && $(MAKE) CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" SYSTEMLIBS="$(SYSTEMLIBS)" + +doc doxygen: + cd src && doxygen Doxyfile + +clean: + rm -f $(SRC)/*.o + rm -f $(SRC)/*~ + rm -f $(LIB) + cd test && $(MAKE) clean + diff --git a/extern/xmlrpcpp/xmlrpcpp/src/Doxyfile b/extern/xmlrpcpp/xmlrpcpp/src/Doxyfile new file mode 100644 index 0000000..2d8a346 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/src/Doxyfile @@ -0,0 +1,1041 @@ +# Doxyfile 1.3-rc3 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = XmlRpc++ + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 0.7 + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = ../doc + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, +# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en +# (Japanese with english messages), Korean, Norwegian, Polish, Portuguese, +# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these class will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = YES + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited +# members of a class in the documentation of that class as if those members were +# ordinary class members. Constructors, destructors and assignment operators of +# the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = NO + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. It is allowed to use relative paths in the argument list. + +STRIP_FROM_PATH = + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower case letters. If set to YES upper case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# users are adviced to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like the Qt-style comments (thus requiring an +# explict @brief command for a brief description. + +JAVADOC_AUTOBRIEF = YES + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# reimplements. + +INHERIT_DOCS = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consist of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. +# For instance some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources +# only. Doxygen will then generate output that is more tailored for Java. +# For instance namespaces will be presented as packages, qualified scopes +# will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp +# *.h++ *.idl *.odl + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = base64.h + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories +# that are symbolic links (a Unix filesystem feature) are excluded from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. + +EXCLUDE_PATTERNS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. + +INPUT_FILTER = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES (the default) +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES (the default) +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = NO + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output dir. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non empty doxygen will try to run +# the html help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the Html help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be +# generated containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimised for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assigments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_XML = NO + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_PREDEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse the +# parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES tag can be used to specify one or more tagfiles. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or +# super classes. Setting the tag to NO turns the diagrams off. Note that this +# option is superceded by the HAVE_DOT option below. This is only a fallback. It is +# recommended to install and use dot, since it yield more powerful graphs. + +CLASS_DIAGRAMS = YES + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found on the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_WIDTH = 1024 + +# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height +# (in pixels) of the graphs generated by dot. If a graph becomes larger than +# this value, doxygen will try to truncate the graph, so that it fits within +# the specified constraint. Beware that most browsers cannot cope with very +# large images. + +MAX_DOT_GRAPH_HEIGHT = 1024 + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermedate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO + +# The CGI_NAME tag should be the name of the CGI script that +# starts the search engine (doxysearch) with the correct parameters. +# A script with this name will be generated by doxygen. + +CGI_NAME = search.cgi + +# The CGI_URL tag should be the absolute URL to the directory where the +# cgi binaries are located. See the documentation of your http daemon for +# details. + +CGI_URL = + +# The DOC_URL tag should be the absolute URL to the directory where the +# documentation is located. If left blank the absolute path to the +# documentation, with file:// prepended to it, will be used. + +DOC_URL = + +# The DOC_ABSPATH tag should be the absolute path to the directory where the +# documentation is located. If left blank the directory on the local machine +# will be used. + +DOC_ABSPATH = + +# The BIN_ABSPATH tag must point to the directory where the doxysearch binary +# is installed. + +BIN_ABSPATH = /usr/local/bin/ + +# The EXT_DOC_PATHS tag can be used to specify one or more paths to +# documentation generated for other projects. This allows doxysearch to search +# the documentation for these projects as well. + +EXT_DOC_PATHS = diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpc.h rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpc.h diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.cpp diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcClient.h rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcException.h rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcException.h diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.cpp rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.cpp diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServer.h rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServer.h diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.cpp rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.cpp diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerConnection.h rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerConnection.h diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.cpp rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.cpp diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcServerMethod.h rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcServerMethod.h diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.cpp rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.cpp diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcSource.h rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcSource.h diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.cpp rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcUtil.h rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.h diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.cpp rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp diff --git a/src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h similarity index 100% rename from src/carriers/xmlrpc_carrier/xmlrpc/XmlRpcValue.h rename to extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.h diff --git a/extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp new file mode 100644 index 0000000..81d9f3e --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.cpp @@ -0,0 +1,108 @@ +// FileClient.cpp : A simple xmlrpc client. Usage: FileClient serverHost serverPort xmlfile +// Reads an xmlrpc request from the specified xmlfile and calls the method on the server. +// +// Link against xmlrpc lib and whatever socket libs your system needs (ws2_32.lib on windows) + +#include "XmlRpc.h" +#include +#include +#include + +using namespace XmlRpc; + +std::string parseRequest(std::string const& xml, XmlRpcValue& params); + + +int main(int argc, char* argv[]) +{ + if (argc != 4) { + std::cerr << "Usage: FileClient serverHost serverPort requestXmlFile\n"; + return -1; + } + int port = atoi(argv[2]); + + XmlRpc::setVerbosity(5); + XmlRpcClient c(argv[1], port); + + // + std::ifstream infile(argv[3]); + if (infile.fail()) { + std::cerr << "Could not open file '" << argv[3] << "'.\n"; + return -1; + } + + // Suck in the file. This is a one-liner in good compilers (which vc++ 6 is not)... + infile.seekg(0L, std::ios::end); + long nb = infile.tellg(); + infile.clear(); + infile.seekg(0L); + char* b = new char[nb+1]; + infile.read(b, nb); + b[nb] = 0; + + std::cout << "Read file.\n"; + + // Find the methodName and parse the params + std::string s(b); + XmlRpcValue params; + std::string name = parseRequest(s, params); + + if (name.empty()) { + std::cerr << "Could not parse file\n"; + return -1; + } + + for (;;) { + XmlRpcValue result; + std::cout << "Calling " << name << std::endl; + if (c.execute(name.c_str(), params, result)) + std::cout << result << "\n\n"; + else + std::cout << "Error calling '" << name << "'\n\n"; + std::cout << "Again? [y]: "; + std::string ans; + std::cin >> ans; + if (ans != "" && ans != "y") break; + } + + return 0; +} + + +// +std::string +parseRequest(std::string const& xml, XmlRpcValue& params) +{ + const char METHODNAME_TAG[] = ""; + const char PARAMS_TAG[] = ""; + const char PARAMS_ETAG[] = ""; + const char PARAM_TAG[] = ""; + const char PARAM_ETAG[] = ""; + + int offset = 0; // Number of chars parsed from the request + + std::string methodName = XmlRpcUtil::parseTag(METHODNAME_TAG, xml, &offset); + XmlRpcUtil::log(3, "XmlRpcServerConnection::parseRequest: parsed methodName %s.", methodName.c_str()); + + if (! methodName.empty() && XmlRpcUtil::findTag(PARAMS_TAG, xml, &offset)) + { + int nArgs = 0; + while (XmlRpcUtil::nextTagIs(PARAM_TAG, xml, &offset)) { + std::cout << "Parsing arg " << nArgs+1 << std::endl; + XmlRpcValue arg(xml, &offset); + if ( ! arg.valid()) { + std::cerr << "Invalid argument\n"; + return std::string(); + } + std::cout << "Adding arg " << nArgs+1 << " to params array." << std::endl; + params[nArgs++] = arg; + (void) XmlRpcUtil::nextTagIs(PARAM_ETAG, xml, &offset); + } + + XmlRpcUtil::log(3, "XmlRpcServerConnection::parseRequest: parsed %d params.", nArgs); + + (void) XmlRpcUtil::nextTagIs(PARAMS_ETAG, xml, &offset); + } + + return methodName; +} diff --git a/extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp new file mode 100644 index 0000000..65ada0f --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.dsp @@ -0,0 +1,96 @@ +# Microsoft Developer Studio Project File - Name="FileClient" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=FileClient - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "FileClient.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "FileClient.mak" CFG="FileClient - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "FileClient - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "FileClient - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "FileClient - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +!ELSEIF "$(CFG)" == "FileClient - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "FileClient - Win32 Release" +# Name "FileClient - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\FileClient.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/extern/xmlrpcpp/xmlrpcpp/test/FileClient.vcproj b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.vcproj new file mode 100644 index 0000000..5dfa0b5 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/FileClient.vcproj @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.cpp b/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.cpp new file mode 100644 index 0000000..f11c094 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.cpp @@ -0,0 +1,85 @@ +// HelloClient.cpp : A simple xmlrpc client. Usage: HelloClient serverHost serverPort +// Link against xmlrpc lib and whatever socket libs your system needs (ws2_32.lib +// on windows) +#include "XmlRpc.h" +#include +using namespace XmlRpc; + +int main(int argc, char* argv[]) +{ + if (argc != 3) { + std::cerr << "Usage: HelloClient serverHost serverPort\n"; + return -1; + } + int port = atoi(argv[2]); + //XmlRpc::setVerbosity(5); + + // Use introspection API to look up the supported methods + XmlRpcClient c(argv[1], port); + XmlRpcValue noArgs, result; + if (c.execute("system.listMethods", noArgs, result)) + std::cout << "\nMethods:\n " << result << "\n\n"; + else + std::cout << "Error calling 'listMethods'\n\n"; + + // Use introspection API to get the help string for the Hello method + XmlRpcValue oneArg; + oneArg[0] = "Hello"; + if (c.execute("system.methodHelp", oneArg, result)) + std::cout << "Help for 'Hello' method: " << result << "\n\n"; + else + std::cout << "Error calling 'methodHelp'\n\n"; + + // Call the Hello method + if (c.execute("Hello", noArgs, result)) + std::cout << result << "\n\n"; + else + std::cout << "Error calling 'Hello'\n\n"; + + // Call the HelloName method + oneArg[0] = "Chris"; + if (c.execute("HelloName", oneArg, result)) + std::cout << result << "\n\n"; + else + std::cout << "Error calling 'HelloName'\n\n"; + + // Add up an array of numbers + XmlRpcValue numbers; + numbers[0] = 33.33; + numbers[1] = 112.57; + numbers[2] = 76.1; + std::cout << "numbers.size() is " << numbers.size() << std::endl; + if (c.execute("Sum", numbers, result)) + std::cout << "Sum = " << double(result) << "\n\n"; + else + std::cout << "Error calling 'Sum'\n\n"; + + // Test the "no such method" fault + if (c.execute("NoSuchMethod", numbers, result)) + std::cout << "NoSuchMethod call: fault: " << c.isFault() << ", result = " << result << std::endl; + else + std::cout << "Error calling 'Sum'\n"; + + // Test the multicall method. It accepts one arg, an array of structs + XmlRpcValue multicall; + multicall[0][0]["methodName"] = "Sum"; + multicall[0][0]["params"][0] = 5.0; + multicall[0][0]["params"][1] = 9.0; + + multicall[0][1]["methodName"] = "NoSuchMethod"; + multicall[0][1]["params"][0] = ""; + + multicall[0][2]["methodName"] = "Sum"; + // Missing params + + multicall[0][3]["methodName"] = "Sum"; + multicall[0][3]["params"][0] = 10.5; + multicall[0][3]["params"][1] = 12.5; + + if (c.execute("system.multicall", multicall, result)) + std::cout << "\nmulticall result = " << result << std::endl; + else + std::cout << "\nError calling 'system.multicall'\n"; + + return 0; +} diff --git a/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp b/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp new file mode 100644 index 0000000..2580caf --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.dsp @@ -0,0 +1,96 @@ +# Microsoft Developer Studio Project File - Name="HelloClient" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=HelloClient - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "HelloClient.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "HelloClient.mak" CFG="HelloClient - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "HelloClient - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "HelloClient - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "HelloClient - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +!ELSEIF "$(CFG)" == "HelloClient - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "HelloClient - Win32 Release" +# Name "HelloClient - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\HelloClient.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.vcproj b/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.vcproj new file mode 100644 index 0000000..3fe36a0 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/HelloClient.vcproj @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.cpp b/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.cpp new file mode 100644 index 0000000..ff81ad8 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.cpp @@ -0,0 +1,82 @@ +// HelloServer.cpp : Simple XMLRPC server example. Usage: HelloServer serverPort +// +#include "XmlRpc.h" + +#include +#include + +using namespace XmlRpc; + +// The server +XmlRpcServer s; + +// No arguments, result is "Hello". +class Hello : public XmlRpcServerMethod +{ +public: + Hello(XmlRpcServer* s) : XmlRpcServerMethod("Hello", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + result = "Hello"; + } + + std::string help() { return std::string("Say hello"); } + +} hello(&s); // This constructor registers the method with the server + + +// One argument is passed, result is "Hello, " + arg. +class HelloName : public XmlRpcServerMethod +{ +public: + HelloName(XmlRpcServer* s) : XmlRpcServerMethod("HelloName", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::string resultString = "Hello, "; + resultString += std::string(params[0]); + result = resultString; + } +} helloName(&s); + + +// A variable number of arguments are passed, all doubles, result is their sum. +class Sum : public XmlRpcServerMethod +{ +public: + Sum(XmlRpcServer* s) : XmlRpcServerMethod("Sum", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + int nArgs = params.size(); + double sum = 0.0; + for (int i=0; i +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=HelloServer - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "HelloServer.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "HelloServer.mak" CFG="HelloServer - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "HelloServer - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "HelloServer - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "HelloServer - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +!ELSEIF "$(CFG)" == "HelloServer - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "HelloServer - Win32 Release" +# Name "HelloServer - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\HelloServer.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.vcproj b/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.vcproj new file mode 100644 index 0000000..9841f47 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/HelloServer.vcproj @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/Makefile b/extern/xmlrpcpp/xmlrpcpp/test/Makefile new file mode 100644 index 0000000..a539d74 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/Makefile @@ -0,0 +1,26 @@ +# makefile written for gnu make +CXX = /usr/local/gcc-3.1/bin/g++ +SRC = ../src +CPPFLAGS = -I$(SRC) +DEBUG = -g +#OPTIMIZE = -O2 +GCCWARN = -Wall -Wstrict-prototypes +CXXFLAGS = $(DEBUG) $(GCCWARN) $(OPTIMIZE) $(INCLUDES) + +LIB = ../libXmlRpc.a + +# Add your system-dependent network libs here +# Solaris: -lsocket -lnsl +SYSTEMLIBS = + +LDLIBS = $(SYSTEMLIBS) $(LIB) + +TESTS = HelloClient HelloServer TestBase64Client TestBase64Server TestValues TestXml Validator + +all: $(TESTS) + +$(TESTS): $(LIB) + +clean: + rm -f *.o + rm -f $(TESTS) diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.cpp new file mode 100644 index 0000000..de95438 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.cpp @@ -0,0 +1,45 @@ +// TestBase64Client.cpp : A simple xmlrpc client that returns a png file +// encoded as base64 data to the client. +// +// Usage: TestBase64Client serverHost serverPort outputfile +// Requests a png file from the specified server and saves it in outputfile. +// Link against xmlrpc lib and whatever socket libs your system needs (ws2_32.lib on windows) + +#include "XmlRpc.h" +#include +#include +#include + +using namespace XmlRpc; + +int main(int argc, char* argv[]) +{ + if (argc != 4) { + std::cerr << "Usage: TestBase64Client serverHost serverPort outputFile\n"; + return -1; + } + int port = atoi(argv[2]); + + //XmlRpc::setVerbosity(5); + XmlRpcClient c(argv[1], port); + + XmlRpcValue noArgs, result; + if (c.execute("TestBase64", noArgs, result)) + { + const XmlRpcValue::BinaryData& data = result; + std::ofstream outfile(argv[3], std::ios::binary | std::ios::trunc); + if (outfile.fail()) + std::cerr << "Error opening " << argv[3] << " for output.\n"; + else + { + int n = int(data.size()); + for (int i=0; i +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=TestBase64Client - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "TestBase64Client.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "TestBase64Client.mak" CFG="TestBase64Client - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "TestBase64Client - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "TestBase64Client - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "TestBase64Client - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +!ELSEIF "$(CFG)" == "TestBase64Client - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "TestBase64Client - Win32 Release" +# Name "TestBase64Client - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\TestBase64Client.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.vcproj b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.vcproj new file mode 100644 index 0000000..040ff42 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Client.vcproj @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.cpp new file mode 100644 index 0000000..7cb4a63 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.cpp @@ -0,0 +1,68 @@ +// TestBase64Server.cpp : Simple XMLRPC server example. Usage: TestBase64Server serverPort +// +#if defined(_MSC_VER) +# pragma warning(disable:4786) // identifier was truncated in debug info +#endif + + +#include +#include +#include +#include + + +#include "XmlRpc.h" +using namespace XmlRpc; + + +// The server +XmlRpcServer s; + +// No arguments, result is Base64-encoded pngnow.png data. +class TestBase64 : public XmlRpcServerMethod +{ +public: + TestBase64(XmlRpcServer* s) : XmlRpcServerMethod("TestBase64", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::ifstream infile("pngnow.png", std::ios::binary); + if (infile.fail()) + infile.open("../pngnow.png", std::ios::binary); + if (infile.fail()) + result = "Could not open file pngnow.png"; + else { + + XmlRpcValue::BinaryData& data = result; + int n = 0; + for (;; ++n) { + char c = infile.get(); + if (infile.eof()) break; + data.push_back(c); + } + std::cerr << "Read " << n << " bytes from pngnow.png\n"; + } + } +} TestBase64(&s); // This constructor registers the method with the server + + + +int main(int argc, char* argv[]) +{ + if (argc != 2) { + std::cerr << "Usage: TestBase64Server serverPort\n"; + return -1; + } + int port = atoi(argv[1]); + + //XmlRpc::setVerbosity(5); + + // Create the server socket on the specified port + s.bindAndListen(port); + + // Wait for requests indefinitely + s.work(-1.0); + + return 0; +} + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.dsp b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.dsp new file mode 100644 index 0000000..8d8480f --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.dsp @@ -0,0 +1,96 @@ +# Microsoft Developer Studio Project File - Name="TestBase64Server" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=TestBase64Server - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "TestBase64Server.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "TestBase64Server.mak" CFG="TestBase64Server - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "TestBase64Server - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "TestBase64Server - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "TestBase64Server - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /Fr /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +!ELSEIF "$(CFG)" == "TestBase64Server - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 xmlrpc.lib Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "TestBase64Server - Win32 Release" +# Name "TestBase64Server - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\TestBase64Server.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.vcproj b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.vcproj new file mode 100644 index 0000000..6abccd9 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestBase64Server.vcproj @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp new file mode 100644 index 0000000..e770e51 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.cpp @@ -0,0 +1,233 @@ +// TestValues.cpp : Test XML encoding and decoding of XmlRpcValues. + +#include + +#include "XmlRpcValue.h" + + +#include +#include + + +using namespace XmlRpc; + + +void testBoolean() +{ + XmlRpcValue booleanFalse(false); + XmlRpcValue booleanTrue(true); + int offset = 0; + XmlRpcValue booleanFalseXml("0", &offset); + offset = 0; + XmlRpcValue booleanTrueXml("1", &offset); + assert(booleanFalse != booleanTrue); + assert(booleanFalse == booleanFalseXml); + assert(booleanFalse != booleanTrueXml); + + if (bool(booleanFalse)) + assert(false); + + if ( ! bool(booleanTrue)) + assert(false); +} + +// Int +void testInt() +{ + XmlRpcValue int0(0); + XmlRpcValue int1(1); + XmlRpcValue int10(10); + XmlRpcValue int_1(-1); + int offset = 0; + XmlRpcValue int0Xml("0", &offset); + offset = 0; + XmlRpcValue int9Xml("9", &offset); + assert(int0 == int0Xml); + assert(int(int10) - int(int1) == int(int9Xml)); + assert(9 == int(int9Xml)); + assert(int(int10) + int(int_1) == int(int9Xml)); +} + +void testDouble() +{ + // Double + XmlRpcValue d(43.7); + int offset = 0; + XmlRpcValue dXml("56.3", &offset); + assert(double(d) + double(dXml) == 100.0); // questionable practice... +} + +void testString() +{ + // String + XmlRpcValue s("Now is the time <&"); + char csxml[] = "Now is the time <&"; + std::string ssxml = csxml; + int offset = 0; + XmlRpcValue vscXml(csxml, &offset); + offset = 0; + XmlRpcValue vssXml(ssxml, &offset); + assert(s == vscXml); + assert(s == vssXml); + offset = 0; + XmlRpcValue fromXml(vssXml.toXml(), &offset); + assert(s == fromXml); + + // Empty or blank strings with no tags + std::string emptyStringXml(""); + offset = 0; + XmlRpcValue emptyStringVal1(emptyStringXml, &offset); + XmlRpcValue emptyStringVal2(""); + assert(emptyStringVal1 == emptyStringVal2); + + emptyStringXml = " "; + offset = 0; + XmlRpcValue blankStringVal(emptyStringXml, &offset); + assert(std::string(blankStringVal) == " "); +} + + +void testDateTime() +{ + // DateTime + int offset = 0; + XmlRpcValue dateTime("19040101T03:12:35", &offset); + struct tm &t = dateTime; + assert(t.tm_year == 1904 && t.tm_min == 12); +} + + +void testArray(XmlRpcValue const& d) +{ + // Array + XmlRpcValue a; + a.setSize(4); + a[0] = 1; + a[1] = std::string("two"); + a[2] = 43.7; + a[3] = "four"; + assert(int(a[0]) == 1); + assert(a[2] == d); + + char csaXml[] = + "\n" + " \n" + " 1 \n" + " two\n" + " 43.7\n" + " four\n" + " \n" + ""; + + int offset = 0; + XmlRpcValue aXml(csaXml, &offset); + assert(a == aXml); +} + +void testStruct() +{ + // Struct + XmlRpcValue struct1; + struct1["i4"] = 1; + struct1["str"] = "two"; + struct1["d"] = 43.7; + + XmlRpcValue a; + a.setSize(4); + a[0] = 1; + a[1] = std::string("two"); + a[2] = 43.7; + a[3] = "four"; + + assert(struct1["d"] == a[2]); + + char csStructXml[] = + "\n" + " \n" + " i4 \n" + " 1 \n" + " \n" + " \n" + " d \n" + " 43.7\n" + " \n" + " \n" + " str \n" + " two\n" + " \n" + ""; + + int offset = 0; + XmlRpcValue structXml(csStructXml, &offset); + assert(struct1 == structXml); + + XmlRpcValue astruct; + astruct["array"] = a; + assert(astruct["array"][2] == struct1["d"]); + + for (int i=0; i<10; i++) { + XmlRpcValue Event; + Event["Name"] = "string"; + + Event.clear(); + + const int NELMTS = 100; + int ii; + + for (ii=0; ii< NELMTS; ++ii) { + char buf[40]; + sprintf(buf,"%d", ii); + Event[std::string(buf)] = buf; + } + + Event.clear(); + + for (ii=0; ii< NELMTS; ++ii) { + char buf[40]; + sprintf(buf,"%d", ii); + if (ii != NELMTS/2) + Event[std::string(buf)] = ii; + else + for (int jj=0; jj< NELMTS; ++jj) { + char bufj[40]; + sprintf(bufj,"%d", jj); + Event[std::string(buf)][std::string(bufj)] = bufj; + } + } + + for (ii=0; ii< NELMTS; ++ii) { + char buf[40]; + sprintf(buf,"%d", ii); + if (ii != NELMTS/2) + assert(Event[std::string(buf)] == XmlRpcValue(ii)); + else + assert(Event[std::string(buf)].size() == NELMTS); + } + } +} + + + +int main(int argc, char* argv[]) +{ + testBoolean(); + + testInt(); + + + testDouble(); + + + testString(); + + + testDateTime(); + + + testArray(43.7); + + + testStruct(); + + return 0; +} diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp new file mode 100644 index 0000000..f62da8c --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.dsp @@ -0,0 +1,95 @@ +# Microsoft Developer Studio Project File - Name="TestValues" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=TestValues - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "TestValues.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "TestValues.mak" CFG="TestValues - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "TestValues - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "TestValues - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "TestValues - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\Release" + +!ELSEIF "$(CFG)" == "TestValues - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /MDd /W3 /GX /Zi /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c +# SUBTRACT CPP /nologo +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "TestValues - Win32 Release" +# Name "TestValues - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\TestValuesWin32.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestValues.vcproj b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.vcproj new file mode 100644 index 0000000..a95eae6 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestValues.vcproj @@ -0,0 +1,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestValuesWin32.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestValuesWin32.cpp new file mode 100644 index 0000000..f4cdafd --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestValuesWin32.cpp @@ -0,0 +1,253 @@ +// TestValues.cpp : Test XML encoding and decoding of XmlRpcValues. + +#define _CRTDBG_MAP_ALLOC +#include +#include + +#include "XmlRpcValue.h" + + +#include +#include + + +using namespace XmlRpc; + + +void testBoolean() +{ + XmlRpcValue booleanFalse(false); + XmlRpcValue booleanTrue(true); + int offset = 0; + XmlRpcValue booleanFalseXml("0", &offset); + offset = 0; + XmlRpcValue booleanTrueXml("1", &offset); + assert(booleanFalse != booleanTrue); + assert(booleanFalse == booleanFalseXml); + assert(booleanFalse == booleanFalseXml); + if (booleanFalse) + assert(false); + + if (booleanTrue) + assert( ! false); + else + assert(false); +} + +// Int +void testInt() +{ + XmlRpcValue int0(0); + XmlRpcValue int1(1); + XmlRpcValue int10(10); + XmlRpcValue int_1(-1); + int offset = 0; + XmlRpcValue int0Xml("0", &offset); + offset = 0; + XmlRpcValue int9Xml("9", &offset); + assert(int0 == int0Xml); + assert(int(int10) - int(int1) == int(int9Xml)); + assert(9 == int(int9Xml)); + assert(int(int10) + int(int_1) == int(int9Xml)); +} + +void testDouble() +{ + // Double + XmlRpcValue d(43.7); + int offset = 0; + XmlRpcValue dXml("56.3", &offset); + assert(double(d) + double(dXml) == 100.0); // questionable practice... +} + +void testString() +{ + // String + XmlRpcValue s("Now is the time <&"); + char csxml[] = "Now is the time <&"; + std::string ssxml = csxml; + int offset = 0; + XmlRpcValue vscXml(csxml, &offset); + offset = 0; + XmlRpcValue vssXml(ssxml, &offset); + assert(s == vscXml); + assert(s == vssXml); + offset = 0; + XmlRpcValue fromXml(vssXml.toXml(), &offset); + assert(s == fromXml); + + // Empty or blank strings with no tags + std::string emptyStringXml(""); + offset = 0; + XmlRpcValue emptyStringVal1(emptyStringXml, &offset); + XmlRpcValue emptyStringVal2(""); + assert(emptyStringVal1 == emptyStringVal2); + + emptyStringXml = " "; + offset = 0; + XmlRpcValue blankStringVal(emptyStringXml, &offset); + assert(std::string(blankStringVal) == " "); +} + + +void testDateTime() +{ + // DateTime + int offset = 0; + XmlRpcValue dateTime("19040101T03:12:35", &offset); + struct tm &t = dateTime; + assert(t.tm_year == 1904 && t.tm_min == 12); +} + + +void testArray(XmlRpcValue const& d) +{ + // Array + XmlRpcValue a; + a.setSize(4); + a[0] = 1; + a[1] = std::string("two"); + a[2] = 43.7; + a[3] = "four"; + assert(int(a[0]) == 1); + assert(a[2] == d); + + char csaXml[] = + "\n" + " \n" + " 1 \n" + " two\n" + " 43.7\n" + " four\n" + " \n" + ""; + + int offset = 0; + XmlRpcValue aXml(csaXml, &offset); + assert(a == aXml); +} + +void testStruct() +{ + // Struct + XmlRpcValue struct1; + struct1["i4"] = 1; + struct1["str"] = "two"; + struct1["d"] = 43.7; + + XmlRpcValue a; + a.setSize(4); + a[0] = 1; + a[1] = std::string("two"); + a[2] = 43.7; + a[3] = "four"; + + assert(struct1["d"] == a[2]); + + char csStructXml[] = + "\n" + " \n" + " i4 \n" + " 1 \n" + " \n" + " \n" + " d \n" + " 43.7\n" + " \n" + " \n" + " str \n" + " two\n" + " \n" + ""; + + int offset = 0; + XmlRpcValue structXml(csStructXml, &offset); + assert(struct1 == structXml); + + XmlRpcValue astruct; + astruct["array"] = a; + assert(astruct["array"][2] == struct1["d"]); + + for (int i=0; i<10; i++) { + XmlRpcValue Event; + Event["Name"] = "string"; + + Event.clear(); + + const int NELMTS = 100; + int ii; + + for (ii=0; ii< NELMTS; ++ii) { + char buf[40]; + sprintf(buf,"%d", ii); + Event[buf] = buf; + } + + Event.clear(); + + for (ii=0; ii< NELMTS; ++ii) { + char buf[40]; + sprintf(buf,"%d", ii); + if (ii != NELMTS/2) + Event[buf] = ii; + else + for (int jj=0; jj< NELMTS; ++jj) { + char bufj[40]; + sprintf(bufj,"%d", jj); + Event[buf][bufj] = bufj; + } + } + + for (ii=0; ii< NELMTS; ++ii) { + char buf[40]; + sprintf(buf,"%d", ii); + if (ii != NELMTS/2) + assert(Event[buf] == XmlRpcValue(ii)); + else + assert(Event[buf].size() == NELMTS); + } + } +} + + + +int main(int argc, char* argv[]) +{ + _CrtDumpMemoryLeaks(); + _CrtCheckMemory( ); + + testBoolean(); + _CrtDumpMemoryLeaks(); + _CrtCheckMemory( ); + + testInt(); + _CrtDumpMemoryLeaks(); + _CrtCheckMemory( ); + + + testDouble(); + _CrtDumpMemoryLeaks(); + _CrtCheckMemory( ); + + + testString(); + _CrtDumpMemoryLeaks(); + _CrtCheckMemory( ); + + + testDateTime(); + _CrtDumpMemoryLeaks(); + _CrtCheckMemory( ); + + + testArray(43.7); + _CrtDumpMemoryLeaks(); + _CrtCheckMemory( ); + + + testStruct(); + _CrtDumpMemoryLeaks(); + _CrtCheckMemory( ); + + return 0; +} diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp new file mode 100644 index 0000000..4fa707d --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.cpp @@ -0,0 +1,53 @@ +// TestXml.cpp : Test XML encoding and decoding. +// The characters <>&'" are illegal in xml and must be encoded. + + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers + +#include +// If you are using MSVC++6, you should update to fix +// BUG: getline Template Function Reads Extra Character +#include +#include +#include + +#include "XmlRpcUtil.h" + +using namespace XmlRpc; + + +int main(int argc, char* argv[]) +{ + // Basic tests + std::string empty; + assert(empty == XmlRpcUtil::xmlEncode(empty)); + assert(empty == XmlRpcUtil::xmlDecode(empty)); + assert(empty == XmlRpcUtil::xmlEncode("")); + assert(empty == XmlRpcUtil::xmlDecode("")); + + std::string raw("<>&'\""); + assert(XmlRpcUtil::xmlDecode(XmlRpcUtil::xmlEncode(raw)) == raw); + + std::cout << "Basic tests passed.\n"; + + // Interactive tests + std::string s; + for (;;) { + std::cout << "\nEnter line of raw text to encode:\n"; + std::getline(std::cin, s); + if (s.empty()) break; + + std::cout << XmlRpcUtil::xmlEncode(s) << std::endl; + } + + for (;;) { + std::cout << "\nEnter line of xml-encoded text to decode:\n"; + std::getline(std::cin, s); + if (s.empty()) break; + + std::cout << XmlRpcUtil::xmlDecode(s) << std::endl; + } + + return 0; +} + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp new file mode 100644 index 0000000..7fba0e4 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.dsp @@ -0,0 +1,96 @@ +# Microsoft Developer Studio Project File - Name="TestXml" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=TestXml - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "TestXml.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "TestXml.mak" CFG="TestXml - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "TestXml - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "TestXml - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "TestXml - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +!ELSEIF "$(CFG)" == "TestXml - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 xmlrpc.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug" + +!ENDIF + +# Begin Target + +# Name "TestXml - Win32 Release" +# Name "TestXml - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\TestXml.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/extern/xmlrpcpp/xmlrpcpp/test/TestXml.vcproj b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.vcproj new file mode 100644 index 0000000..c71dc24 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/TestXml.vcproj @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp b/extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp new file mode 100644 index 0000000..16d2e79 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/Validator.cpp @@ -0,0 +1,207 @@ +// Validator.cpp : XMLRPC server based on the compliancy test at validator.xmlrpc.com. +// +#include "XmlRpc.h" +using namespace XmlRpc; + +#include + + +XmlRpcServer s; + + +// One argument is passed, an array of structs, each with a member named curly with +// an integer value. Return the sum of those values. + +class ArrayOfStructsTest : public XmlRpcServerMethod +{ +public: + ArrayOfStructsTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.arrayOfStructsTest", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::cerr << "ArrayOfStructsTest\n"; + XmlRpcValue& arg1 = params[0]; + int n = arg1.size(), sum = 0; + for (int i=0; i, &, ' and ". +// The handler must return a struct that contains five fields, all numbers: ctLeftAngleBrackets, +// ctRightAngleBrackets, ctAmpersands, ctApostrophes, ctQuotes. +// To validate, the numbers must be correct. + +class CountTheEntities : public XmlRpcServerMethod +{ +public: + CountTheEntities(XmlRpcServer* s) : XmlRpcServerMethod("validator1.countTheEntities", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::cerr << "CountTheEntities\n"; + std::string& arg = params[0]; + int ctLeftAngleBrackets = 0; + int ctRightAngleBrackets = 0; + int ctAmpersands = 0; + int ctApostrophes = 0; + int ctQuotes = 0; + + int n = int(arg.length()); + for (int i=0; i': ++ctRightAngleBrackets; break; + case '&': ++ctAmpersands; break; + case '\'': ++ctApostrophes; break; + case '\"': ++ctQuotes; break; + } + + result["ctLeftAngleBrackets"] = ctLeftAngleBrackets; + result["ctRightAngleBrackets"] = ctRightAngleBrackets; + result["ctAmpersands"] = ctAmpersands; + result["ctApostrophes"] = ctApostrophes; + result["ctQuotes"] = ctQuotes; + } +} countTheEntities(&s); + + + +// This handler takes a single parameter, a struct, containing at least three elements +// named moe, larry and curly, all s. Your handler must add the three numbers and +// return the result. + +class EasyStructTest : public XmlRpcServerMethod +{ +public: + EasyStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.easyStructTest", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::cerr << "EasyStructTest\n"; + XmlRpcValue& arg1 = params[0]; + int sum = int(arg1["moe"]) + int(arg1["larry"]) + int(arg1["curly"]); + result = sum; + } +} easyStructTest(&s); + + +// This handler takes a single parameter, a struct. Your handler must return the struct. + +class EchoStructTest : public XmlRpcServerMethod +{ +public: + EchoStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.echoStructTest", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::cerr << "EchoStructTest\n"; + result = params[0]; + } +} echoStructTest(&s); + + + +// This handler takes six parameters, and returns an array containing all the parameters. + +class ManyTypesTest : public XmlRpcServerMethod +{ +public: + ManyTypesTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.manyTypesTest", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::cerr << "ManyTypesTest\n"; + result = params; + } +} manyTypesTest(&s); + + + +// This handler takes a single parameter, which is an array containing between 100 and +// 200 elements. Each of the items is a string, your handler must return a string +// containing the concatenated text of the first and last elements. + + +class ModerateSizeArrayCheck : public XmlRpcServerMethod +{ +public: + ModerateSizeArrayCheck(XmlRpcServer* s) : XmlRpcServerMethod("validator1.moderateSizeArrayCheck", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::cerr << "ModerateSizeArrayCheck\n"; + std::string s = params[0][0]; + s += params[0][params[0].size()-1]; + result = s; + } +} moderateSizeArrayCheck(&s); + + +// This handler takes a single parameter, a struct, that models a daily calendar. +// At the top level, there is one struct for each year. Each year is broken down +// into months, and months into days. Most of the days are empty in the struct +// you receive, but the entry for April 1, 2000 contains a least three elements +// named moe, larry and curly, all s. Your handler must add the three numbers +// and return the result. + +class NestedStructTest : public XmlRpcServerMethod +{ +public: + NestedStructTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.nestedStructTest", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::cerr << "NestedStructTest\n"; + XmlRpcValue& dayStruct = params[0]["2000"]["04"]["01"]; + int sum = int(dayStruct["moe"]) + int(dayStruct["larry"]) + int(dayStruct["curly"]); + result = sum; + } +} nestedStructTest(&s); + + + +// This handler takes one parameter, and returns a struct containing three elements, +// times10, times100 and times1000, the result of multiplying the number by 10, 100 and 1000. + +class SimpleStructReturnTest : public XmlRpcServerMethod +{ +public: + SimpleStructReturnTest(XmlRpcServer* s) : XmlRpcServerMethod("validator1.simpleStructReturnTest", s) {} + + void execute(XmlRpcValue& params, XmlRpcValue& result) + { + std::cerr << "SimpleStructReturnTest\n"; + int n = params[0]; + result["times10"] = n * 10; + result["times100"] = n * 100; + result["times1000"] = n * 1000; + } +} simpleStructReturnTest(&s); + + + +int main(int argc, char* argv[]) +{ + if (argc != 2) { + std::cerr << "Usage: Validator port\n"; + return -1; + } + int port = atoi(argv[1]); + + XmlRpc::setVerbosity(5); + + // Create the server socket on the specified port + s.bindAndListen(port); + + // Wait for requests indefinitely + s.work(-1.0); + + return 0; +} + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp b/extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp new file mode 100644 index 0000000..12058c1 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/Validator.dsp @@ -0,0 +1,95 @@ +# Microsoft Developer Studio Project File - Name="Validator" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=Validator - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Validator.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Validator.mak" CFG="Validator - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Validator - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "Validator - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Validator - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zd /O2 /I "..\src" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 xmlrpc.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\release" + +!ELSEIF "$(CFG)" == "Validator - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\src" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 xmlrpc.lib WS2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\debug" + +!ENDIF + +# Begin Target + +# Name "Validator - Win32 Release" +# Name "Validator - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Validator.cpp +# End Source File +# End Group +# End Target +# End Project diff --git a/extern/xmlrpcpp/xmlrpcpp/test/Validator.vcproj b/extern/xmlrpcpp/xmlrpcpp/test/Validator.vcproj new file mode 100644 index 0000000..73c7bf1 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/Validator.vcproj @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/arrayOfStructsTest.xml b/extern/xmlrpcpp/xmlrpcpp/test/arrayOfStructsTest.xml new file mode 100644 index 0000000..5690a18 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/arrayOfStructsTest.xml @@ -0,0 +1,255 @@ + + + validator1.arrayOfStructsTest + + + + + + + + curly + + -84 + + + + larry + + 87 + + + + moe + + 77 + + + + + + + + curly + + -46 + + + + larry + + 27 + + + + moe + + 33 + + + + + + + + curly + + -70 + + + + larry + + 89 + + + + moe + + 30 + + + + + + + + curly + + -90 + + + + larry + + 42 + + + + moe + + 6 + + + + + + + + curly + + -28 + + + + larry + + 96 + + + + moe + + 92 + + + + + + + + curly + + -31 + + + + larry + + 81 + + + + moe + + 85 + + + + + + + + curly + + -18 + + + + larry + + 62 + + + + moe + + 9 + + + + + + + + curly + + -98 + + + + larry + + 79 + + + + moe + + 66 + + + + + + + + curly + + -3 + + + + larry + + 59 + + + + moe + + 80 + + + + + + + + curly + + -83 + + + + larry + + 27 + + + + moe + + 19 + + + + + + + + curly + + -85 + + + + larry + + 4 + + + + moe + + 16 + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/countTheEntities.xml b/extern/xmlrpcpp/xmlrpcpp/test/countTheEntities.xml new file mode 100644 index 0000000..b37495a --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/countTheEntities.xml @@ -0,0 +1,10 @@ + + + validator1.countTheEntities + + + &''<&"'>ehv<>iu'<<qo>"z"f + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/easyStructTest.xml b/extern/xmlrpcpp/xmlrpcpp/test/easyStructTest.xml new file mode 100644 index 0000000..a0a8634 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/easyStructTest.xml @@ -0,0 +1,29 @@ + + + validator1.easyStructTest + + + + + curly + + -78 + + + + larry + + 23 + + + + moe + + 38 + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/echo.xml b/extern/xmlrpcpp/xmlrpcpp/test/echo.xml new file mode 100644 index 0000000..6aeff92 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/echo.xml @@ -0,0 +1,9 @@ + + + echo + + Hello Chris + 123 + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/echoStructTest.xml b/extern/xmlrpcpp/xmlrpcpp/test/echoStructTest.xml new file mode 100644 index 0000000..6cbb472 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/echoStructTest.xml @@ -0,0 +1,261 @@ + + + validator1.echoStructTest + + + + + substruct0 + + + + curly + + -76 + + + + larry + + 31 + + + + moe + + 44 + + + + + + + substruct1 + + + + curly + + -9 + + + + larry + + 42 + + + + moe + + 57 + + + + + + + substruct2 + + + + curly + + -15 + + + + larry + + 69 + + + + moe + + 78 + + + + + + + substruct3 + + + + curly + + -91 + + + + larry + + 66 + + + + moe + + 4 + + + + + + + substruct4 + + + + curly + + -47 + + + + larry + + 66 + + + + moe + + 8 + + + + + + + substruct5 + + + + curly + + -68 + + + + larry + + 26 + + + + moe + + 87 + + + + + + + substruct6 + + + + curly + + -59 + + + + larry + + 20 + + + + moe + + 74 + + + + + + + substruct7 + + + + curly + + -57 + + + + larry + + 30 + + + + moe + + 75 + + + + + + + substruct8 + + + + curly + + -34 + + + + larry + + 33 + + + + moe + + 30 + + + + + + + substruct9 + + + + curly + + -64 + + + + larry + + 98 + + + + moe + + 17 + + + + + + + + + + diff --git a/extern/xmlrpcpp/xmlrpcpp/test/pngnow.png b/extern/xmlrpcpp/xmlrpcpp/test/pngnow.png new file mode 100644 index 0000000..3e501c1 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/test/pngnow.png @@ -0,0 +1 @@ +‰PNG diff --git a/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp b/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp new file mode 100644 index 0000000..7f5212b --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsp @@ -0,0 +1,183 @@ +# Microsoft Developer Studio Project File - Name="xmlrpc" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=xmlrpc - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "xmlrpc.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "xmlrpc.mak" CFG="xmlrpc - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "xmlrpc - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "xmlrpc - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "xmlrpc - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +MTL=midl.exe +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zd /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /FR /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ELSEIF "$(CFG)" == "xmlrpc - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +MTL=midl.exe +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c +# ADD CPP /MDd /W3 /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_LIB" /FR /FD /c +# SUBTRACT CPP /nologo /YX +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo + +!ENDIF + +# Begin Target + +# Name "xmlrpc - Win32 Release" +# Name "xmlrpc - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\src\XmlRpcClient.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcDispatch.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcServer.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcServerConnection.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcServerMethod.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcSocket.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcSource.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcUtil.cpp +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcValue.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\src\base64.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpc.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcClient.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcDispatch.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcServer.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcServerConnection.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcServerMethod.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcSocket.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcSource.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcUtil.h +# End Source File +# Begin Source File + +SOURCE=.\src\XmlRpcValue.h +# End Source File +# End Group +# Begin Source File + +SOURCE=.\README.html +# End Source File +# End Target +# End Project diff --git a/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw b/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw new file mode 100644 index 0000000..6c19989 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/xmlrpc.dsw @@ -0,0 +1,149 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "FileClient"=".\Test\FileClient.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name xmlrpc + End Project Dependency +}}} + +############################################################################### + +Project: "HelloClient"=".\Test\HelloClient.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name xmlrpc + End Project Dependency +}}} + +############################################################################### + +Project: "HelloServer"=".\Test\HelloServer.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name xmlrpc + End Project Dependency +}}} + +############################################################################### + +Project: "TestBase64Client"=".\Test\TestBase64Client.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name xmlrpc + End Project Dependency +}}} + +############################################################################### + +Project: "TestBase64Server"=".\Test\TestBase64Server.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name xmlrpc + End Project Dependency +}}} + +############################################################################### + +Project: "TestValues"=".\Test\TestValues.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name xmlrpc + End Project Dependency +}}} + +############################################################################### + +Project: "TestXml"=".\Test\TestXml.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name xmlrpc + End Project Dependency +}}} + +############################################################################### + +Project: "Validator"=".\Test\Validator.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ + Begin Project Dependency + Project_Dep_Name xmlrpc + End Project Dependency +}}} + +############################################################################### + +Project: "xmlrpc"=".\xmlrpc.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 8599c0a..472357c 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -12,9 +12,9 @@ yarp_prepare_plugin(xmlrpc if(NOT SKIP_xmlrpc_carrier) set(CMAKE_INCLUDE_CURRENT_DIR ON) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc) get_property(YARP_OS_INCLUDE_DIRS TARGET YARP_OS PROPERTY INCLUDE_DIRS) include_directories(${YARP_OS_INCLUDE_DIRS}) + include_directories(${xmlrpcpp_INCLUDE_DIRS}) check_cxx_compiler_flag("-Wformat-nonliteral" CXX_HAS_WFORMAT_NONLITERAL) if(CXX_HAS_WFORMAT_NONLITERAL) @@ -25,15 +25,9 @@ if(NOT SKIP_xmlrpc_carrier) XmlRpcCarrier.h XmlRpcCarrier.cpp XmlRpcStream.h - XmlRpcStream.cpp - xmlrpc/XmlRpcClient.cpp - xmlrpc/XmlRpcServer.cpp - xmlrpc/XmlRpcServerConnection.cpp - xmlrpc/XmlRpcServerMethod.cpp - xmlrpc/XmlRpcSource.cpp - xmlrpc/XmlRpcUtil.cpp - xmlrpc/XmlRpcValue.cpp) - target_link_libraries(yarp_xmlrpc YARP_OS) + XmlRpcStream.cpp) + target_link_libraries(yarp_xmlrpc YARP_OS + ${xmlrpcpp_LIBRARIES}) yarp_install(TARGETS yarp_xmlrpc EXPORT YARP COMPONENT runtime From 41ea424032d1440043ef55395319b2e0eacd54d6 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 18 Oct 2016 14:12:19 +0200 Subject: [PATCH 098/187] XmlRpc++: Import different encoding and decoding base64 functions The original base64 functions in XmlRpc++ license is currently unknown and the methods using them are disabled. This version is taken from http://www.adp-gmbh.ch/cpp/common/base64.html and the license is explicit (zlib license) and it is compatible with LGPL. base64 replacement XmlRpcValue --- extern/xmlrpcpp/README.txt | 37 ++++++- extern/xmlrpcpp/xmlrpcpp/src/base64.cpp | 123 ++++++++++++++++++++++++ extern/xmlrpcpp/xmlrpcpp/src/base64.h | 4 + 3 files changed, 162 insertions(+), 2 deletions(-) create mode 100644 extern/xmlrpcpp/xmlrpcpp/src/base64.cpp create mode 100644 extern/xmlrpcpp/xmlrpcpp/src/base64.h diff --git a/extern/xmlrpcpp/README.txt b/extern/xmlrpcpp/README.txt index 554588d..1ddc07f 100644 --- a/extern/xmlrpcpp/README.txt +++ b/extern/xmlrpcpp/README.txt @@ -6,8 +6,10 @@ make it easy to incorporate XmlRpc client+server support into C++ applications and requires no other libraries. This version contains several modification (including a change of -namespace from XmlRpc to YarpXmlRpc and the removal of a few classes) -and a few bug fixes for YARP. +namespace from XmlRpc to YarpXmlRpc and the removal of a few classes and +the replacement of the original base64.h which license is unknown with a +different implementation by René Nyffenegger released as BSD) and a few +bug fixes for YARP. Homepage: http://xmlrpcpp.sourceforge.net/ https://sourceforge.net/projects/xmlrpcpp/ @@ -18,6 +20,37 @@ License: LGPL2.1 or later Version: 0.7 + + +base64.cpp and base64.h + +Encoding and decoding base64 with C++ + +Homepage: http://www.adp-gmbh.ch/cpp/common/base64.html + +Copyright (C) 2004-2008 René Nyffenegger + +License: zlib + This source code is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this source code must not be misrepresented; you must not + claim that you wrote the original source code. If you use this source code + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original source code. + + 3. This notice may not be removed or altered from any source distribution. + + + Patches: * 0001-Fix-EOL-and-permissions.patch: Fix EOL and permissions (from commit 19a3ac4fbd725719a6dae0ee87c9536d388d427a) diff --git a/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp b/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp new file mode 100644 index 0000000..5cb8591 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp @@ -0,0 +1,123 @@ +/* + base64.cpp and base64.h + + Copyright (C) 2004-2008 René Nyffenegger + + This source code is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this source code must not be misrepresented; you must not + claim that you wrote the original source code. If you use this source code + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original source code. + + 3. This notice may not be removed or altered from any source distribution. + + René Nyffenegger rene.nyffenegger@adp-gmbh.ch + +*/ + +#include "base64.h" +#include + +static const std::string base64_chars = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; + + +static inline bool is_base64(unsigned char c) { + return (isalnum(c) || (c == '+') || (c == '/')); +} + +std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) { + std::string ret; + int i = 0; + int j = 0; + unsigned char char_array_3[3]; + unsigned char char_array_4[4]; + + while (in_len--) { + char_array_3[i++] = *(bytes_to_encode++); + if (i == 3) { + char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); + char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); + char_array_4[3] = char_array_3[2] & 0x3f; + + for(i = 0; (i <4) ; i++) + ret += base64_chars[char_array_4[i]]; + i = 0; + } + } + + if (i) + { + for(j = i; j < 3; j++) + char_array_3[j] = '\0'; + + char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); + char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); + char_array_4[3] = char_array_3[2] & 0x3f; + + for (j = 0; (j < i + 1); j++) + ret += base64_chars[char_array_4[j]]; + + while((i++ < 3)) + ret += '='; + + } + + return ret; + +} + +std::string base64_decode(std::string const& encoded_string) { + int in_len = encoded_string.size(); + int i = 0; + int j = 0; + int in_ = 0; + unsigned char char_array_4[4], char_array_3[3]; + std::string ret; + + while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { + char_array_4[i++] = encoded_string[in_]; in_++; + if (i ==4) { + for (i = 0; i <4; i++) + char_array_4[i] = base64_chars.find(char_array_4[i]); + + char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); + char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + + for (i = 0; (i < 3); i++) + ret += char_array_3[i]; + i = 0; + } + } + + if (i) { + for (j = i; j <4; j++) + char_array_4[j] = 0; + + for (j = 0; j <4; j++) + char_array_4[j] = base64_chars.find(char_array_4[j]); + + char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); + char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + + for (j = 0; (j < i - 1); j++) ret += char_array_3[j]; + } + + return ret; +} diff --git a/extern/xmlrpcpp/xmlrpcpp/src/base64.h b/extern/xmlrpcpp/xmlrpcpp/src/base64.h new file mode 100644 index 0000000..65d5db8 --- /dev/null +++ b/extern/xmlrpcpp/xmlrpcpp/src/base64.h @@ -0,0 +1,4 @@ +#include + +std::string base64_encode(unsigned char const* , unsigned int len); +std::string base64_decode(std::string const& s); From 7bcd13ec458b809e2d9d4c84d8d5953bbfbe4fcd Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 18 Oct 2016 14:12:46 +0200 Subject: [PATCH 099/187] XmlRpc++: Adapt and build base64.{cpp,h} The original methods were modified to: std::string YarpXmlRpc::base64_encode(const std::vector& bytes_to_encode); std::vector YarpXmlRpc::base64_decode(const std::string& encoded_string); --- extern/xmlrpcpp/CMakeLists.txt | 6 ++-- extern/xmlrpcpp/xmlrpcpp/src/base64.cpp | 19 ++++++++----- extern/xmlrpcpp/xmlrpcpp/src/base64.h | 37 +++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 11 deletions(-) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index cbf7164..5b58d85 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -6,7 +6,8 @@ # XmlRpc++ project(YARP_priv_xmlrpcpp) -set(xmlrpcpp_SRCS xmlrpcpp/src/XmlRpcClient.cpp +set(xmlrpcpp_SRCS xmlrpcpp/src/base64.cpp + xmlrpcpp/src/XmlRpcClient.cpp xmlrpcpp/src/XmlRpcServerConnection.cpp xmlrpcpp/src/XmlRpcServer.cpp xmlrpcpp/src/XmlRpcServerMethod.cpp @@ -14,7 +15,8 @@ set(xmlrpcpp_SRCS xmlrpcpp/src/XmlRpcClient.cpp xmlrpcpp/src/XmlRpcUtil.cpp xmlrpcpp/src/XmlRpcValue.cpp) -set(xmlrpcpp_HDRS xmlrpcpp/src/XmlRpcClient.h +set(xmlrpcpp_HDRS xmlrpcpp/src/base64.h + xmlrpcpp/src/XmlRpcClient.h xmlrpcpp/src/XmlRpcException.h xmlrpcpp/src/XmlRpc.h xmlrpcpp/src/XmlRpcServerConnection.h diff --git a/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp b/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp index 5cb8591..e6bfe37 100644 --- a/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp +++ b/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp @@ -38,15 +38,18 @@ static inline bool is_base64(unsigned char c) { return (isalnum(c) || (c == '+') || (c == '/')); } -std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) { + +namespace YarpXmlRpc { + +std::string base64_encode(const std::vector& bytes_to_encode) { std::string ret; int i = 0; int j = 0; unsigned char char_array_3[3]; unsigned char char_array_4[4]; - while (in_len--) { - char_array_3[i++] = *(bytes_to_encode++); + for(std::vector::const_iterator it = bytes_to_encode.begin(); it != bytes_to_encode.end(); ++it) { + char_array_3[i++] = *it; if (i == 3) { char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); @@ -81,13 +84,13 @@ std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_ } -std::string base64_decode(std::string const& encoded_string) { +std::vector base64_decode(const std::string& encoded_string) { int in_len = encoded_string.size(); int i = 0; int j = 0; int in_ = 0; unsigned char char_array_4[4], char_array_3[3]; - std::string ret; + std::vector ret; while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { char_array_4[i++] = encoded_string[in_]; in_++; @@ -100,7 +103,7 @@ std::string base64_decode(std::string const& encoded_string) { char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; for (i = 0; (i < 3); i++) - ret += char_array_3[i]; + ret.push_back(char_array_3[i]); i = 0; } } @@ -116,8 +119,10 @@ std::string base64_decode(std::string const& encoded_string) { char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; - for (j = 0; (j < i - 1); j++) ret += char_array_3[j]; + for (j = 0; (j < i - 1); j++) ret.push_back(char_array_3[j]); } return ret; } + +} diff --git a/extern/xmlrpcpp/xmlrpcpp/src/base64.h b/extern/xmlrpcpp/xmlrpcpp/src/base64.h index 65d5db8..ede7ddc 100644 --- a/extern/xmlrpcpp/xmlrpcpp/src/base64.h +++ b/extern/xmlrpcpp/xmlrpcpp/src/base64.h @@ -1,4 +1,37 @@ +/* + base64.cpp and base64.h + + Copyright (C) 2004-2008 René Nyffenegger + + This source code is provided 'as-is', without any express or implied + warranty. In no event will the author be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this source code must not be misrepresented; you must not + claim that you wrote the original source code. If you use this source code + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original source code. + + 3. This notice may not be removed or altered from any source distribution. + + René Nyffenegger rene.nyffenegger@adp-gmbh.ch + +*/ + + #include +#include + +namespace YarpXmlRpc { + +std::string base64_encode(const std::vector& bytes_to_encode); +std::vector base64_decode(const std::string& encoded_string); -std::string base64_encode(unsigned char const* , unsigned int len); -std::string base64_decode(std::string const& s); +} From dc19ace7844f8e39f0a4b75d96909e56f60d2d4f Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 18 Oct 2016 14:12:32 +0200 Subject: [PATCH 100/187] XmlRpc++: Adapt XmlRpcValue to use the new base64 metods --- extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp | 38 +++----------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp index 2e176a6..9808312 100644 --- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp @@ -5,11 +5,7 @@ #include "XmlRpcValue.h" #include "XmlRpcException.h" #include "XmlRpcUtil.h" - -// base64.h removed - not clear that it is "really" under LGPL license. -// origin seems to be this: -// http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4095/ -//#include "base64.h" +#include "base64.h" #ifndef MAKEDEPEND # include @@ -423,10 +419,6 @@ namespace YarpXmlRpc { // Base64 bool XmlRpcValue::binaryFromXml(std::string const& valueXml, int* offset) { - printf("binaryFromXml disabled until license of base64.h determined\n"); - exit(1); - return false; - /* size_t valueEnd = valueXml.find('<', *offset); if (valueEnd == std::string::npos) return false; // No end tag; @@ -437,29 +429,18 @@ namespace YarpXmlRpc { // check whether base64 encodings can contain chars xml encodes... // convert from base64 to binary - int iostatus = 0; - base64 decoder; + std::vector v = base64_decode(asString); std::back_insert_iterator ins = std::back_inserter(*(_value.asBinary)); - decoder.get(asString.begin(), asString.end(), ins, iostatus); - + std::copy(asString.begin(), asString.end(), ins); *offset += int(asString.length()); return true; - */ } std::string XmlRpcValue::binaryToXml() const { - printf("binaryToXml disabled until license of base64.h determined\n"); - exit(1); - return ""; - /* // convert to base64 - std::vector base64data; - int iostatus = 0; - base64 encoder; - std::back_insert_iterator > ins = std::back_inserter(base64data); - encoder.put(_value.asBinary->begin(), _value.asBinary->end(), ins, iostatus, base64<>::crlf()); + std::string base64data = base64_encode(*(_value.asBinary)); // Wrap with xml std::string xml = VALUE_TAG; @@ -468,7 +449,6 @@ namespace YarpXmlRpc { xml += BASE64_ETAG; xml += VALUE_ETAG; return xml; - */ } @@ -577,15 +557,7 @@ namespace YarpXmlRpc { } case TypeBase64: { - //int iostatus = 0; - std::ostreambuf_iterator out(os); - /* - base64 encoder; - encoder.put(_value.asBinary->begin(), _value.asBinary->end(), out, iostatus, base64<>::crlf()); - */ - printf("base64 disabled until license of base64.h determined\n"); - exit(1); - break; + os << base64_encode(*(_value.asBinary)); break; } case TypeArray: { From 25ac02c592e1b6a0a8fc1e608f9f7134971cfca3 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 14 Nov 2016 15:06:31 +0100 Subject: [PATCH 101/187] xmlrpcpp: Add missing include Fixes #945 --- extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp index 9808312..b421992 100644 --- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp @@ -6,6 +6,7 @@ #include "XmlRpcException.h" #include "XmlRpcUtil.h" #include "base64.h" +#include #ifndef MAKEDEPEND # include From c53c9aeed5e90f1d2682aaaf3544524b1d369624 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 14 Nov 2016 15:20:38 +0100 Subject: [PATCH 102/187] xmlrpc: Update patches --- .../0001-Fix-EOL-and-permissions.patch | 2 +- ...002-first-pass-at-an-xml-rpc-carrier.patch | 2 +- .../patches/0003-more-LGPL-tagging.patch | 2 +- .../patches/0004-small-windows-fixes.patch | 2 +- .../0005-fix-a-few-trivial-warnings.patch | 2 +- ...cpros-.msg-support-from-yarpros-bran.patch | 2 +- ...y-up-windows-build-of-tcpros-carrier.patch | 2 +- .../patches/0008-fix-integer-type.patch | 2 +- ...d-library-needed-with-msvc-dll-build.patch | 2 +- ...lrpc-code-that-is-choking-msvc-dll-b.patch | 2 +- extern/xmlrpcpp/patches/0011-Cleanup.patch | 2 +- .../patches/0012-Documentation-tweaks.patch | 2 +- ...e-XmlRpc-namespace-to-avoid-conflict.patch | 2 +- extern/xmlrpcpp/patches/0014-Cleanup.patch | 2 +- ...Fix-issues-with-latex-pdf-generation.patch | 2 +- ...d-macros-to-avoid-leading-underscore.patch | 2 +- .../patches/0017-xmlrpc-Fix-tmEq-method.patch | 2 +- ...fferent-encoding-and-decoding-base64.patch | 168 ++++++++++++++++++ ...XmlRpc-Adapt-and-build-base64.-cpp-h.patch | 124 +++++++++++++ ...RpcValue-to-use-the-new-base64-metod.patch | 98 ++++++++++ .../0021-xmlrpcpp-Add-missing-include.patch | 25 +++ 21 files changed, 432 insertions(+), 17 deletions(-) create mode 100644 extern/xmlrpcpp/patches/0018-XmlRpc-Import-different-encoding-and-decoding-base64.patch create mode 100644 extern/xmlrpcpp/patches/0019-XmlRpc-Adapt-and-build-base64.-cpp-h.patch create mode 100644 extern/xmlrpcpp/patches/0020-XmlRpc-Adapt-XmlRpcValue-to-use-the-new-base64-metod.patch create mode 100644 extern/xmlrpcpp/patches/0021-xmlrpcpp-Add-missing-include.patch diff --git a/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch b/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch index 99bc45e..4c916e0 100644 --- a/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch +++ b/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch @@ -1,7 +1,7 @@ From 19a3ac4fbd725719a6dae0ee87c9536d388d427a Mon Sep 17 00:00:00 2001 From: "Paul Fitzpatrick" Date: Fri May 28 03:23:50 2010 +0000 -Subject: [PATCH 01/17] Fix EOL and permissions +Subject: [PATCH 01/21] Fix EOL and permissions --- extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h | 250 +++++----- diff --git a/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch b/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch index ed58f43..3eff02c 100644 --- a/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch +++ b/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch @@ -1,7 +1,7 @@ From 19a3ac4fbd725719a6dae0ee87c9536d388d427a Mon Sep 17 00:00:00 2001 From: "Paul Fitzpatrick" Date: Fri May 28 03:23:50 2010 +0000 -Subject: [PATCH 02/17] first pass at an xml/rpc carrier +Subject: [PATCH 02/21] first pass at an xml/rpc carrier --- .../xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 64 +++++++++++++--------- diff --git a/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch b/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch index 49366e2..82ac2e7 100644 --- a/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch +++ b/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch @@ -1,7 +1,7 @@ From b3e24151e815a3cb634d0a1c6a8815449ff9db7a Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 14 Jun 2010 14:31:38 +0000 -Subject: [PATCH 03/17] more LGPL tagging +Subject: [PATCH 03/21] more LGPL tagging svn path=/trunk/yarp2/; revision=8007 --- diff --git a/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch b/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch index f26557a..ac6738c 100644 --- a/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch +++ b/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch @@ -1,7 +1,7 @@ From 9ea098942e14e08150c5736c71ebe6c58e47fdda Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 8 Jul 2010 20:49:31 +0000 -Subject: [PATCH 04/17] small windows fixes +Subject: [PATCH 04/21] small windows fixes svn path=/trunk/yarp2/; revision=8095 --- diff --git a/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch b/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch index aabb873..235c1e4 100644 --- a/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch +++ b/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch @@ -1,7 +1,7 @@ From 2a78f5e6766785c435bf03053761760e4d944f3f Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 30 Aug 2010 14:30:11 +0000 -Subject: [PATCH 05/17] fix a few trivial warnings +Subject: [PATCH 05/21] fix a few trivial warnings svn path=/trunk/yarp2/; revision=8227 --- diff --git a/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch b/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch index afecae5..b893663 100644 --- a/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch +++ b/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch @@ -1,7 +1,7 @@ From 48e3b01d0a66e135f239f824033ff6c857827364 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 11 Jul 2011 16:51:09 +0000 -Subject: [PATCH 06/17] merge improved tcpros + .msg support from yarpros +Subject: [PATCH 06/21] merge improved tcpros + .msg support from yarpros branch on launchpad svn path=/trunk/yarp2/; revision=8682 diff --git a/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch b/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch index 994c6e2..63a32f0 100644 --- a/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch +++ b/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch @@ -1,7 +1,7 @@ From 447f0b0d141f162b8481d05bfbbb317878761388 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 29 Aug 2011 22:19:07 +0000 -Subject: [PATCH 07/17] tidy up windows build of tcpros carrier +Subject: [PATCH 07/21] tidy up windows build of tcpros carrier svn path=/trunk/yarp2/; revision=8803 --- diff --git a/extern/xmlrpcpp/patches/0008-fix-integer-type.patch b/extern/xmlrpcpp/patches/0008-fix-integer-type.patch index fd92a47..5695c8d 100644 --- a/extern/xmlrpcpp/patches/0008-fix-integer-type.patch +++ b/extern/xmlrpcpp/patches/0008-fix-integer-type.patch @@ -1,7 +1,7 @@ From ae3580f308d7b30b6e04121fdcf0fd64ab52126c Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 19 Oct 2011 20:04:53 +0000 -Subject: [PATCH 08/17] fix integer type +Subject: [PATCH 08/21] fix integer type svn path=/trunk/yarp2/; revision=8884 --- diff --git a/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch b/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch index 5f89c65..6ee47b0 100644 --- a/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch +++ b/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch @@ -1,7 +1,7 @@ From dfa12005a8b39bc8abe76cdbdea1f19d086cc836 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 16 May 2012 00:55:46 +0000 -Subject: [PATCH 09/17] add library needed with msvc dll build +Subject: [PATCH 09/21] add library needed with msvc dll build svn path=/trunk/yarp2/; revision=9153 --- diff --git a/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch b/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch index 2141117..da9156c 100644 --- a/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch +++ b/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch @@ -1,7 +1,7 @@ From 57c407b67df1110c74881f32e4bf8b05e1b1cd91 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 16 May 2012 21:12:05 +0000 -Subject: [PATCH 10/17] drop unneeded xmlrpc code that is choking msvc dll +Subject: [PATCH 10/21] drop unneeded xmlrpc code that is choking msvc dll build svn path=/trunk/yarp2/; revision=9157 diff --git a/extern/xmlrpcpp/patches/0011-Cleanup.patch b/extern/xmlrpcpp/patches/0011-Cleanup.patch index 04c76fc..02c50a2 100644 --- a/extern/xmlrpcpp/patches/0011-Cleanup.patch +++ b/extern/xmlrpcpp/patches/0011-Cleanup.patch @@ -1,7 +1,7 @@ From c44cf5c842b7bd679155d751ae7b4d46907a58a3 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Mar 2013 17:43:33 +0000 -Subject: [PATCH 11/17] [Cleanup] +Subject: [PATCH 11/21] [Cleanup] svn path=/trunk/yarp2/; revision=9933 --- diff --git a/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch b/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch index b149e30..e5f7a3b 100644 --- a/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch +++ b/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch @@ -1,7 +1,7 @@ From 85ca0d444c8462cd0d9da9130f82d6cfbf02f7fa Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 13 Nov 2013 11:51:20 +0100 -Subject: [PATCH 12/17] Documentation tweaks +Subject: [PATCH 12/21] Documentation tweaks --- extern/xmlrpcpp/xmlrpcpp/XmlRpcUtil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch b/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch index 9dd0abd..aa9ce8c 100644 --- a/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch +++ b/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch @@ -1,7 +1,7 @@ From 8ecaff0464bec2b6deb1538b3cb6b6d322cc0ac4 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 11 Apr 2014 17:02:57 +0200 -Subject: [PATCH 13/17] [ros] change XmlRpc namespace to avoid conflict +Subject: [PATCH 13/21] [ros] change XmlRpc namespace to avoid conflict YARP and ROS both use the XmlRpc++ library. When YARP is compiled statically, these libraries can conflict if the diff --git a/extern/xmlrpcpp/patches/0014-Cleanup.patch b/extern/xmlrpcpp/patches/0014-Cleanup.patch index 786fb25..c1fef35 100644 --- a/extern/xmlrpcpp/patches/0014-Cleanup.patch +++ b/extern/xmlrpcpp/patches/0014-Cleanup.patch @@ -1,7 +1,7 @@ From 53ea746a7fa2d2603df46763b8cb380dcc2407ab Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 27 Aug 2015 16:41:10 +0200 -Subject: [PATCH 14/17] [Cleanup] +Subject: [PATCH 14/21] [Cleanup] --- extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.h | 10 ++++++---- diff --git a/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch b/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch index 5a8d0be..eef887a 100644 --- a/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch +++ b/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch @@ -1,7 +1,7 @@ From 9ddf972da49e7e258e8f0df7ef8c1a643d02f5b8 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 8 Oct 2015 10:39:38 +0200 -Subject: [PATCH 15/17] Cleanup and Fix issues with latex/pdf generation +Subject: [PATCH 15/21] Cleanup and Fix issues with latex/pdf generation --- extern/xmlrpcpp/xmlrpcpp/README.html | 2 +- diff --git a/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch b/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch index 4c965be..c9b53ea 100644 --- a/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch +++ b/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch @@ -1,7 +1,7 @@ From df486e58f8ec80e140e0f55e1c3833ac8ca50603 Mon Sep 17 00:00:00 2001 From: Francesco Romano Date: Wed, 6 Jan 2016 10:31:56 +0100 -Subject: [PATCH 16/17] Renamed macros to avoid leading underscore +Subject: [PATCH 16/21] Renamed macros to avoid leading underscore --- extern/xmlrpcpp/xmlrpcpp/XmlRpc.h | 4 ++-- diff --git a/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch b/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch index 5e7f16d..0ca20ca 100644 --- a/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch +++ b/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch @@ -1,7 +1,7 @@ From 95238ffbcd164594ace75baff278ac936a14484b Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 11 Oct 2016 17:48:10 +0200 -Subject: [PATCH 17/17] xmlrpc++: Fix tmEq() method +Subject: [PATCH 17/21] xmlrpc++: Fix tmEq() method --- extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.cpp | 2 +- diff --git a/extern/xmlrpcpp/patches/0018-XmlRpc-Import-different-encoding-and-decoding-base64.patch b/extern/xmlrpcpp/patches/0018-XmlRpc-Import-different-encoding-and-decoding-base64.patch new file mode 100644 index 0000000..abe38e2 --- /dev/null +++ b/extern/xmlrpcpp/patches/0018-XmlRpc-Import-different-encoding-and-decoding-base64.patch @@ -0,0 +1,168 @@ +From 4842124481bbe9eeda37cbeaef70fa318d377921 Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Tue, 18 Oct 2016 14:12:19 +0200 +Subject: [PATCH 18/21] XmlRpc++: Import different encoding and decoding base64 + functions + +The original base64 functions in XmlRpc++ license is currently unknown +and the methods using them are disabled. + +This version is taken from + + http://www.adp-gmbh.ch/cpp/common/base64.html + +and the license is explicit (zlib license) and it is compatible with +LGPL. + +base64 replacement + +XmlRpcValue +--- + extern/xmlrpcpp/xmlrpcpp/src/base64.cpp | 123 ++++++++++++++++++++++++++++++++ + extern/xmlrpcpp/xmlrpcpp/src/base64.h | 4 ++ + 2 files changed, 127 insertions(+), 0 deletions(-) + create mode 100644 extern/xmlrpcpp/xmlrpcpp/src/base64.cpp + create mode 100644 extern/xmlrpcpp/xmlrpcpp/src/base64.h + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp b/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp +new file mode 100644 +index 0000000..5cb8591 +--- /dev/null ++++ b/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp +@@ -0,0 +1,123 @@ ++/* ++ base64.cpp and base64.h ++ ++ Copyright (C) 2004-2008 René Nyffenegger ++ ++ This source code is provided 'as-is', without any express or implied ++ warranty. In no event will the author be held liable for any damages ++ arising from the use of this software. ++ ++ Permission is granted to anyone to use this software for any purpose, ++ including commercial applications, and to alter it and redistribute it ++ freely, subject to the following restrictions: ++ ++ 1. The origin of this source code must not be misrepresented; you must not ++ claim that you wrote the original source code. If you use this source code ++ in a product, an acknowledgment in the product documentation would be ++ appreciated but is not required. ++ ++ 2. Altered source versions must be plainly marked as such, and must not be ++ misrepresented as being the original source code. ++ ++ 3. This notice may not be removed or altered from any source distribution. ++ ++ René Nyffenegger rene.nyffenegger@adp-gmbh.ch ++ ++*/ ++ ++#include "base64.h" ++#include ++ ++static const std::string base64_chars = ++ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ++ "abcdefghijklmnopqrstuvwxyz" ++ "0123456789+/"; ++ ++ ++static inline bool is_base64(unsigned char c) { ++ return (isalnum(c) || (c == '+') || (c == '/')); ++} ++ ++std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) { ++ std::string ret; ++ int i = 0; ++ int j = 0; ++ unsigned char char_array_3[3]; ++ unsigned char char_array_4[4]; ++ ++ while (in_len--) { ++ char_array_3[i++] = *(bytes_to_encode++); ++ if (i == 3) { ++ char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; ++ char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); ++ char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); ++ char_array_4[3] = char_array_3[2] & 0x3f; ++ ++ for(i = 0; (i <4) ; i++) ++ ret += base64_chars[char_array_4[i]]; ++ i = 0; ++ } ++ } ++ ++ if (i) ++ { ++ for(j = i; j < 3; j++) ++ char_array_3[j] = '\0'; ++ ++ char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; ++ char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); ++ char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6); ++ char_array_4[3] = char_array_3[2] & 0x3f; ++ ++ for (j = 0; (j < i + 1); j++) ++ ret += base64_chars[char_array_4[j]]; ++ ++ while((i++ < 3)) ++ ret += '='; ++ ++ } ++ ++ return ret; ++ ++} ++ ++std::string base64_decode(std::string const& encoded_string) { ++ int in_len = encoded_string.size(); ++ int i = 0; ++ int j = 0; ++ int in_ = 0; ++ unsigned char char_array_4[4], char_array_3[3]; ++ std::string ret; ++ ++ while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { ++ char_array_4[i++] = encoded_string[in_]; in_++; ++ if (i ==4) { ++ for (i = 0; i <4; i++) ++ char_array_4[i] = base64_chars.find(char_array_4[i]); ++ ++ char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); ++ char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); ++ char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; ++ ++ for (i = 0; (i < 3); i++) ++ ret += char_array_3[i]; ++ i = 0; ++ } ++ } ++ ++ if (i) { ++ for (j = i; j <4; j++) ++ char_array_4[j] = 0; ++ ++ for (j = 0; j <4; j++) ++ char_array_4[j] = base64_chars.find(char_array_4[j]); ++ ++ char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); ++ char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); ++ char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; ++ ++ for (j = 0; (j < i - 1); j++) ret += char_array_3[j]; ++ } ++ ++ return ret; ++} +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/base64.h b/extern/xmlrpcpp/xmlrpcpp/src/base64.h +new file mode 100644 +index 0000000..65d5db8 +--- /dev/null ++++ b/extern/xmlrpcpp/xmlrpcpp/src/base64.h +@@ -0,0 +1,4 @@ ++#include ++ ++std::string base64_encode(unsigned char const* , unsigned int len); ++std::string base64_decode(std::string const& s); +-- +2.10.2 + diff --git a/extern/xmlrpcpp/patches/0019-XmlRpc-Adapt-and-build-base64.-cpp-h.patch b/extern/xmlrpcpp/patches/0019-XmlRpc-Adapt-and-build-base64.-cpp-h.patch new file mode 100644 index 0000000..b7148a1 --- /dev/null +++ b/extern/xmlrpcpp/patches/0019-XmlRpc-Adapt-and-build-base64.-cpp-h.patch @@ -0,0 +1,124 @@ +From e5c25aa456515956a444b315e30e79f04de2c33d Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Tue, 18 Oct 2016 14:12:46 +0200 +Subject: [PATCH 19/21] XmlRpc++: Adapt and build base64.{cpp,h} + +The original methods were modified to: + + std::string YarpXmlRpc::base64_encode(const std::vector& bytes_to_encode); + std::vector YarpXmlRpc::base64_decode(const std::string& encoded_string); +--- + extern/xmlrpcpp/xmlrpcpp/src/base64.cpp | 19 ++++++++++------- + extern/xmlrpcpp/xmlrpcpp/src/base64.h | 37 +++++++++++++++++++++++++++++++-- + 2 files changed, 47 insertions(+), 9 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp b/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp +index 5cb8591..e6bfe37 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/base64.cpp +@@ -38,15 +38,18 @@ static inline bool is_base64(unsigned char c) { + return (isalnum(c) || (c == '+') || (c == '/')); + } + +-std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) { ++ ++namespace YarpXmlRpc { ++ ++std::string base64_encode(const std::vector& bytes_to_encode) { + std::string ret; + int i = 0; + int j = 0; + unsigned char char_array_3[3]; + unsigned char char_array_4[4]; + +- while (in_len--) { +- char_array_3[i++] = *(bytes_to_encode++); ++ for(std::vector::const_iterator it = bytes_to_encode.begin(); it != bytes_to_encode.end(); ++it) { ++ char_array_3[i++] = *it; + if (i == 3) { + char_array_4[0] = (char_array_3[0] & 0xfc) >> 2; + char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4); +@@ -81,13 +84,13 @@ std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_ + + } + +-std::string base64_decode(std::string const& encoded_string) { ++std::vector base64_decode(const std::string& encoded_string) { + int in_len = encoded_string.size(); + int i = 0; + int j = 0; + int in_ = 0; + unsigned char char_array_4[4], char_array_3[3]; +- std::string ret; ++ std::vector ret; + + while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { + char_array_4[i++] = encoded_string[in_]; in_++; +@@ -100,7 +103,7 @@ std::string base64_decode(std::string const& encoded_string) { + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + + for (i = 0; (i < 3); i++) +- ret += char_array_3[i]; ++ ret.push_back(char_array_3[i]); + i = 0; + } + } +@@ -116,8 +119,10 @@ std::string base64_decode(std::string const& encoded_string) { + char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); + char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3]; + +- for (j = 0; (j < i - 1); j++) ret += char_array_3[j]; ++ for (j = 0; (j < i - 1); j++) ret.push_back(char_array_3[j]); + } + + return ret; + } ++ ++} +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/base64.h b/extern/xmlrpcpp/xmlrpcpp/src/base64.h +index 65d5db8..ede7ddc 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/base64.h ++++ b/extern/xmlrpcpp/xmlrpcpp/src/base64.h +@@ -1,4 +1,37 @@ ++/* ++ base64.cpp and base64.h ++ ++ Copyright (C) 2004-2008 René Nyffenegger ++ ++ This source code is provided 'as-is', without any express or implied ++ warranty. In no event will the author be held liable for any damages ++ arising from the use of this software. ++ ++ Permission is granted to anyone to use this software for any purpose, ++ including commercial applications, and to alter it and redistribute it ++ freely, subject to the following restrictions: ++ ++ 1. The origin of this source code must not be misrepresented; you must not ++ claim that you wrote the original source code. If you use this source code ++ in a product, an acknowledgment in the product documentation would be ++ appreciated but is not required. ++ ++ 2. Altered source versions must be plainly marked as such, and must not be ++ misrepresented as being the original source code. ++ ++ 3. This notice may not be removed or altered from any source distribution. ++ ++ René Nyffenegger rene.nyffenegger@adp-gmbh.ch ++ ++*/ ++ ++ + #include ++#include ++ ++namespace YarpXmlRpc { ++ ++std::string base64_encode(const std::vector& bytes_to_encode); ++std::vector base64_decode(const std::string& encoded_string); + +-std::string base64_encode(unsigned char const* , unsigned int len); +-std::string base64_decode(std::string const& s); ++} +-- +2.10.2 + diff --git a/extern/xmlrpcpp/patches/0020-XmlRpc-Adapt-XmlRpcValue-to-use-the-new-base64-metod.patch b/extern/xmlrpcpp/patches/0020-XmlRpc-Adapt-XmlRpcValue-to-use-the-new-base64-metod.patch new file mode 100644 index 0000000..f56f2b4 --- /dev/null +++ b/extern/xmlrpcpp/patches/0020-XmlRpc-Adapt-XmlRpcValue-to-use-the-new-base64-metod.patch @@ -0,0 +1,98 @@ +From 9e57d52f1da4e962704a4ba133a526ec931141b0 Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Tue, 18 Oct 2016 14:12:32 +0200 +Subject: [PATCH 20/21] XmlRpc++: Adapt XmlRpcValue to use the new base64 metods + +--- + extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp | 38 ++++------------------------ + 1 file changed, 5 insertions(+), 33 deletions(-) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +index 2e176a6..9808312 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +@@ -5,11 +5,7 @@ + #include "XmlRpcValue.h" + #include "XmlRpcException.h" + #include "XmlRpcUtil.h" +- +-// base64.h removed - not clear that it is "really" under LGPL license. +-// origin seems to be this: +-// http://www.codeguru.com/cpp/cpp/cpp_mfc/article.php/c4095/ +-//#include "base64.h" ++#include "base64.h" + + #ifndef MAKEDEPEND + # include +@@ -423,10 +419,6 @@ namespace YarpXmlRpc { + // Base64 + bool XmlRpcValue::binaryFromXml(std::string const& valueXml, int* offset) + { +- printf("binaryFromXml disabled until license of base64.h determined\n"); +- exit(1); +- return false; +- /* + size_t valueEnd = valueXml.find('<', *offset); + if (valueEnd == std::string::npos) + return false; // No end tag; +@@ -437,29 +429,18 @@ namespace YarpXmlRpc { + // check whether base64 encodings can contain chars xml encodes... + + // convert from base64 to binary +- int iostatus = 0; +- base64 decoder; ++ std::vector v = base64_decode(asString); + std::back_insert_iterator ins = std::back_inserter(*(_value.asBinary)); +- decoder.get(asString.begin(), asString.end(), ins, iostatus); +- ++ std::copy(asString.begin(), asString.end(), ins); + *offset += int(asString.length()); + return true; +- */ + } + + + std::string XmlRpcValue::binaryToXml() const + { +- printf("binaryToXml disabled until license of base64.h determined\n"); +- exit(1); +- return ""; +- /* + // convert to base64 +- std::vector base64data; +- int iostatus = 0; +- base64 encoder; +- std::back_insert_iterator > ins = std::back_inserter(base64data); +- encoder.put(_value.asBinary->begin(), _value.asBinary->end(), ins, iostatus, base64<>::crlf()); ++ std::string base64data = base64_encode(*(_value.asBinary)); + + // Wrap with xml + std::string xml = VALUE_TAG; +@@ -468,7 +449,6 @@ namespace YarpXmlRpc { + xml += BASE64_ETAG; + xml += VALUE_ETAG; + return xml; +- */ + } + + +@@ -577,15 +557,7 @@ namespace YarpXmlRpc { + } + case TypeBase64: + { +- //int iostatus = 0; +- std::ostreambuf_iterator out(os); +- /* +- base64 encoder; +- encoder.put(_value.asBinary->begin(), _value.asBinary->end(), out, iostatus, base64<>::crlf()); +- */ +- printf("base64 disabled until license of base64.h determined\n"); +- exit(1); +- break; ++ os << base64_encode(*(_value.asBinary)); break; + } + case TypeArray: + { +-- +2.10.2 + diff --git a/extern/xmlrpcpp/patches/0021-xmlrpcpp-Add-missing-include.patch b/extern/xmlrpcpp/patches/0021-xmlrpcpp-Add-missing-include.patch new file mode 100644 index 0000000..59b76e3 --- /dev/null +++ b/extern/xmlrpcpp/patches/0021-xmlrpcpp-Add-missing-include.patch @@ -0,0 +1,25 @@ +From 50b5bd857791bc176a17d464bb0a2ce21aff7ae8 Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Mon, 14 Nov 2016 15:06:31 +0100 +Subject: [PATCH 21/21] xmlrpcpp: Add missing include + +Fixes #945 +--- + extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +index 9808312..b421992 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp +@@ -6,6 +6,7 @@ + #include "XmlRpcException.h" + #include "XmlRpcUtil.h" + #include "base64.h" ++#include + + #ifndef MAKEDEPEND + # include +-- +2.10.2 + From 1692f7b8451143cfb8f10cfd925c0b8be0f48ebf Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 23 Dec 2016 19:31:18 +0100 Subject: [PATCH 103/187] CMake 3.0 is now required Start using a few features and remove all workarounds no longer needed. --- example/idl/rosPortable/CMakeLists.txt | 2 +- example/ros/CMakeLists.txt | 2 +- example/ros/package/src/yarp_test/CMakeLists.txt | 2 +- example/yarpros_examples/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index ee604c8..1a0319b 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -2,7 +2,7 @@ # Authors: Lorenzo Natale # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.0) find_package(YARP REQUIRED) list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH}) diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index 3a8f9c1..d2a8faf 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -2,7 +2,7 @@ # Authors: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.0) find_package(YARP REQUIRED) diff --git a/example/ros/package/src/yarp_test/CMakeLists.txt b/example/ros/package/src/yarp_test/CMakeLists.txt index 9ad9180..4f12c9a 100644 --- a/example/ros/package/src/yarp_test/CMakeLists.txt +++ b/example/ros/package/src/yarp_test/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.0) project(yarp_test) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) add_service_files(FILES AddTwoInts.srv) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 46f7052..0dc7a18 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -4,7 +4,7 @@ # Author: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 3.0) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) # Set the build type. Options are: From 0a6be8a4cf0a9e0910ac5ffc5e649e9f10af7c86 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 15 Feb 2017 15:37:53 +0100 Subject: [PATCH 104/187] xmlrpcpp: Call va_end() where required --- extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp index c1bb193..cb5aa7f 100644 --- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp +++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp @@ -79,6 +79,7 @@ void XmlRpcUtil::log(int level, const char* fmt, ...) char buf[1024]; va_start( va, fmt); vsnprintf(buf,sizeof(buf)-1,fmt,va); + va_end(va); buf[sizeof(buf)-1] = 0; XmlRpcLogHandler::getLogHandler()->log(level, buf); } @@ -91,6 +92,7 @@ void XmlRpcUtil::error(const char* fmt, ...) va_start(va, fmt); char buf[1024]; vsnprintf(buf,sizeof(buf)-1,fmt,va); + va_end(va); buf[sizeof(buf)-1] = 0; XmlRpcErrorHandler::getErrorHandler()->error(buf); } From c7c8a47fe3ca7013f01e2e5b12ef0c3407368791 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 15 Feb 2017 15:44:08 +0100 Subject: [PATCH 105/187] xmlrpcpp: Update patches --- .../0001-Fix-EOL-and-permissions.patch | 2 +- ...002-first-pass-at-an-xml-rpc-carrier.patch | 2 +- .../patches/0003-more-LGPL-tagging.patch | 2 +- .../patches/0004-small-windows-fixes.patch | 2 +- .../0005-fix-a-few-trivial-warnings.patch | 2 +- ...cpros-.msg-support-from-yarpros-bran.patch | 2 +- ...y-up-windows-build-of-tcpros-carrier.patch | 2 +- .../patches/0008-fix-integer-type.patch | 2 +- ...d-library-needed-with-msvc-dll-build.patch | 2 +- ...lrpc-code-that-is-choking-msvc-dll-b.patch | 2 +- extern/xmlrpcpp/patches/0011-Cleanup.patch | 2 +- .../patches/0012-Documentation-tweaks.patch | 2 +- ...e-XmlRpc-namespace-to-avoid-conflict.patch | 2 +- extern/xmlrpcpp/patches/0014-Cleanup.patch | 2 +- ...Fix-issues-with-latex-pdf-generation.patch | 2 +- ...d-macros-to-avoid-leading-underscore.patch | 2 +- .../patches/0017-xmlrpc-Fix-tmEq-method.patch | 2 +- ...fferent-encoding-and-decoding-base64.patch | 2 +- ...XmlRpc-Adapt-and-build-base64.-cpp-h.patch | 2 +- ...RpcValue-to-use-the-new-base64-metod.patch | 2 +- .../0021-xmlrpcpp-Add-missing-include.patch | 2 +- ...-xmlrpcpp-Call-va_end-where-required.patch | 32 +++++++++++++++++++ 22 files changed, 53 insertions(+), 21 deletions(-) create mode 100644 extern/xmlrpcpp/patches/0022-xmlrpcpp-Call-va_end-where-required.patch diff --git a/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch b/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch index 4c916e0..b6ca3d1 100644 --- a/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch +++ b/extern/xmlrpcpp/patches/0001-Fix-EOL-and-permissions.patch @@ -1,7 +1,7 @@ From 19a3ac4fbd725719a6dae0ee87c9536d388d427a Mon Sep 17 00:00:00 2001 From: "Paul Fitzpatrick" Date: Fri May 28 03:23:50 2010 +0000 -Subject: [PATCH 01/21] Fix EOL and permissions +Subject: [PATCH 01/22] Fix EOL and permissions --- extern/xmlrpcpp/xmlrpcpp/src/XmlRpcClient.h | 250 +++++----- diff --git a/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch b/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch index 3eff02c..3983241 100644 --- a/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch +++ b/extern/xmlrpcpp/patches/0002-first-pass-at-an-xml-rpc-carrier.patch @@ -1,7 +1,7 @@ From 19a3ac4fbd725719a6dae0ee87c9536d388d427a Mon Sep 17 00:00:00 2001 From: "Paul Fitzpatrick" Date: Fri May 28 03:23:50 2010 +0000 -Subject: [PATCH 02/21] first pass at an xml/rpc carrier +Subject: [PATCH 02/22] first pass at an xml/rpc carrier --- .../xmlrpc_carrier/xmlrpc/XmlRpcClient.cpp | 64 +++++++++++++--------- diff --git a/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch b/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch index 82ac2e7..bdaa1ac 100644 --- a/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch +++ b/extern/xmlrpcpp/patches/0003-more-LGPL-tagging.patch @@ -1,7 +1,7 @@ From b3e24151e815a3cb634d0a1c6a8815449ff9db7a Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 14 Jun 2010 14:31:38 +0000 -Subject: [PATCH 03/21] more LGPL tagging +Subject: [PATCH 03/22] more LGPL tagging svn path=/trunk/yarp2/; revision=8007 --- diff --git a/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch b/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch index ac6738c..41af963 100644 --- a/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch +++ b/extern/xmlrpcpp/patches/0004-small-windows-fixes.patch @@ -1,7 +1,7 @@ From 9ea098942e14e08150c5736c71ebe6c58e47fdda Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Thu, 8 Jul 2010 20:49:31 +0000 -Subject: [PATCH 04/21] small windows fixes +Subject: [PATCH 04/22] small windows fixes svn path=/trunk/yarp2/; revision=8095 --- diff --git a/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch b/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch index 235c1e4..fd4e582 100644 --- a/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch +++ b/extern/xmlrpcpp/patches/0005-fix-a-few-trivial-warnings.patch @@ -1,7 +1,7 @@ From 2a78f5e6766785c435bf03053761760e4d944f3f Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 30 Aug 2010 14:30:11 +0000 -Subject: [PATCH 05/21] fix a few trivial warnings +Subject: [PATCH 05/22] fix a few trivial warnings svn path=/trunk/yarp2/; revision=8227 --- diff --git a/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch b/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch index b893663..9cb0688 100644 --- a/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch +++ b/extern/xmlrpcpp/patches/0006-merge-improved-tcpros-.msg-support-from-yarpros-bran.patch @@ -1,7 +1,7 @@ From 48e3b01d0a66e135f239f824033ff6c857827364 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 11 Jul 2011 16:51:09 +0000 -Subject: [PATCH 06/21] merge improved tcpros + .msg support from yarpros +Subject: [PATCH 06/22] merge improved tcpros + .msg support from yarpros branch on launchpad svn path=/trunk/yarp2/; revision=8682 diff --git a/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch b/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch index 63a32f0..817a955 100644 --- a/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch +++ b/extern/xmlrpcpp/patches/0007-tidy-up-windows-build-of-tcpros-carrier.patch @@ -1,7 +1,7 @@ From 447f0b0d141f162b8481d05bfbbb317878761388 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Mon, 29 Aug 2011 22:19:07 +0000 -Subject: [PATCH 07/21] tidy up windows build of tcpros carrier +Subject: [PATCH 07/22] tidy up windows build of tcpros carrier svn path=/trunk/yarp2/; revision=8803 --- diff --git a/extern/xmlrpcpp/patches/0008-fix-integer-type.patch b/extern/xmlrpcpp/patches/0008-fix-integer-type.patch index 5695c8d..c65193a 100644 --- a/extern/xmlrpcpp/patches/0008-fix-integer-type.patch +++ b/extern/xmlrpcpp/patches/0008-fix-integer-type.patch @@ -1,7 +1,7 @@ From ae3580f308d7b30b6e04121fdcf0fd64ab52126c Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 19 Oct 2011 20:04:53 +0000 -Subject: [PATCH 08/21] fix integer type +Subject: [PATCH 08/22] fix integer type svn path=/trunk/yarp2/; revision=8884 --- diff --git a/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch b/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch index 6ee47b0..40a92c5 100644 --- a/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch +++ b/extern/xmlrpcpp/patches/0009-add-library-needed-with-msvc-dll-build.patch @@ -1,7 +1,7 @@ From dfa12005a8b39bc8abe76cdbdea1f19d086cc836 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 16 May 2012 00:55:46 +0000 -Subject: [PATCH 09/21] add library needed with msvc dll build +Subject: [PATCH 09/22] add library needed with msvc dll build svn path=/trunk/yarp2/; revision=9153 --- diff --git a/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch b/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch index da9156c..1ac38c5 100644 --- a/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch +++ b/extern/xmlrpcpp/patches/0010-drop-unneeded-xmlrpc-code-that-is-choking-msvc-dll-b.patch @@ -1,7 +1,7 @@ From 57c407b67df1110c74881f32e4bf8b05e1b1cd91 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 16 May 2012 21:12:05 +0000 -Subject: [PATCH 10/21] drop unneeded xmlrpc code that is choking msvc dll +Subject: [PATCH 10/22] drop unneeded xmlrpc code that is choking msvc dll build svn path=/trunk/yarp2/; revision=9157 diff --git a/extern/xmlrpcpp/patches/0011-Cleanup.patch b/extern/xmlrpcpp/patches/0011-Cleanup.patch index 02c50a2..566d60c 100644 --- a/extern/xmlrpcpp/patches/0011-Cleanup.patch +++ b/extern/xmlrpcpp/patches/0011-Cleanup.patch @@ -1,7 +1,7 @@ From c44cf5c842b7bd679155d751ae7b4d46907a58a3 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Mar 2013 17:43:33 +0000 -Subject: [PATCH 11/21] [Cleanup] +Subject: [PATCH 11/22] [Cleanup] svn path=/trunk/yarp2/; revision=9933 --- diff --git a/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch b/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch index e5f7a3b..dbda234 100644 --- a/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch +++ b/extern/xmlrpcpp/patches/0012-Documentation-tweaks.patch @@ -1,7 +1,7 @@ From 85ca0d444c8462cd0d9da9130f82d6cfbf02f7fa Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 13 Nov 2013 11:51:20 +0100 -Subject: [PATCH 12/21] Documentation tweaks +Subject: [PATCH 12/22] Documentation tweaks --- extern/xmlrpcpp/xmlrpcpp/XmlRpcUtil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch b/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch index aa9ce8c..a1a7bc7 100644 --- a/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch +++ b/extern/xmlrpcpp/patches/0013-ros-change-XmlRpc-namespace-to-avoid-conflict.patch @@ -1,7 +1,7 @@ From 8ecaff0464bec2b6deb1538b3cb6b6d322cc0ac4 Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Fri, 11 Apr 2014 17:02:57 +0200 -Subject: [PATCH 13/21] [ros] change XmlRpc namespace to avoid conflict +Subject: [PATCH 13/22] [ros] change XmlRpc namespace to avoid conflict YARP and ROS both use the XmlRpc++ library. When YARP is compiled statically, these libraries can conflict if the diff --git a/extern/xmlrpcpp/patches/0014-Cleanup.patch b/extern/xmlrpcpp/patches/0014-Cleanup.patch index c1fef35..954277e 100644 --- a/extern/xmlrpcpp/patches/0014-Cleanup.patch +++ b/extern/xmlrpcpp/patches/0014-Cleanup.patch @@ -1,7 +1,7 @@ From 53ea746a7fa2d2603df46763b8cb380dcc2407ab Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 27 Aug 2015 16:41:10 +0200 -Subject: [PATCH 14/21] [Cleanup] +Subject: [PATCH 14/22] [Cleanup] --- extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.h | 10 ++++++---- diff --git a/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch b/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch index eef887a..2197923 100644 --- a/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch +++ b/extern/xmlrpcpp/patches/0015-Cleanup-and-Fix-issues-with-latex-pdf-generation.patch @@ -1,7 +1,7 @@ From 9ddf972da49e7e258e8f0df7ef8c1a643d02f5b8 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 8 Oct 2015 10:39:38 +0200 -Subject: [PATCH 15/21] Cleanup and Fix issues with latex/pdf generation +Subject: [PATCH 15/22] Cleanup and Fix issues with latex/pdf generation --- extern/xmlrpcpp/xmlrpcpp/README.html | 2 +- diff --git a/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch b/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch index c9b53ea..ac866db 100644 --- a/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch +++ b/extern/xmlrpcpp/patches/0016-Renamed-macros-to-avoid-leading-underscore.patch @@ -1,7 +1,7 @@ From df486e58f8ec80e140e0f55e1c3833ac8ca50603 Mon Sep 17 00:00:00 2001 From: Francesco Romano Date: Wed, 6 Jan 2016 10:31:56 +0100 -Subject: [PATCH 16/21] Renamed macros to avoid leading underscore +Subject: [PATCH 16/22] Renamed macros to avoid leading underscore --- extern/xmlrpcpp/xmlrpcpp/XmlRpc.h | 4 ++-- diff --git a/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch b/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch index 0ca20ca..a4f05b6 100644 --- a/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch +++ b/extern/xmlrpcpp/patches/0017-xmlrpc-Fix-tmEq-method.patch @@ -1,7 +1,7 @@ From 95238ffbcd164594ace75baff278ac936a14484b Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 11 Oct 2016 17:48:10 +0200 -Subject: [PATCH 17/21] xmlrpc++: Fix tmEq() method +Subject: [PATCH 17/22] xmlrpc++: Fix tmEq() method --- extern/xmlrpcpp/xmlrpcpp/XmlRpcValue.cpp | 2 +- diff --git a/extern/xmlrpcpp/patches/0018-XmlRpc-Import-different-encoding-and-decoding-base64.patch b/extern/xmlrpcpp/patches/0018-XmlRpc-Import-different-encoding-and-decoding-base64.patch index abe38e2..a0b7e1c 100644 --- a/extern/xmlrpcpp/patches/0018-XmlRpc-Import-different-encoding-and-decoding-base64.patch +++ b/extern/xmlrpcpp/patches/0018-XmlRpc-Import-different-encoding-and-decoding-base64.patch @@ -1,7 +1,7 @@ From 4842124481bbe9eeda37cbeaef70fa318d377921 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 18 Oct 2016 14:12:19 +0200 -Subject: [PATCH 18/21] XmlRpc++: Import different encoding and decoding base64 +Subject: [PATCH 18/22] XmlRpc++: Import different encoding and decoding base64 functions The original base64 functions in XmlRpc++ license is currently unknown diff --git a/extern/xmlrpcpp/patches/0019-XmlRpc-Adapt-and-build-base64.-cpp-h.patch b/extern/xmlrpcpp/patches/0019-XmlRpc-Adapt-and-build-base64.-cpp-h.patch index b7148a1..6656ec2 100644 --- a/extern/xmlrpcpp/patches/0019-XmlRpc-Adapt-and-build-base64.-cpp-h.patch +++ b/extern/xmlrpcpp/patches/0019-XmlRpc-Adapt-and-build-base64.-cpp-h.patch @@ -1,7 +1,7 @@ From e5c25aa456515956a444b315e30e79f04de2c33d Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 18 Oct 2016 14:12:46 +0200 -Subject: [PATCH 19/21] XmlRpc++: Adapt and build base64.{cpp,h} +Subject: [PATCH 19/22] XmlRpc++: Adapt and build base64.{cpp,h} The original methods were modified to: diff --git a/extern/xmlrpcpp/patches/0020-XmlRpc-Adapt-XmlRpcValue-to-use-the-new-base64-metod.patch b/extern/xmlrpcpp/patches/0020-XmlRpc-Adapt-XmlRpcValue-to-use-the-new-base64-metod.patch index f56f2b4..fa7ae29 100644 --- a/extern/xmlrpcpp/patches/0020-XmlRpc-Adapt-XmlRpcValue-to-use-the-new-base64-metod.patch +++ b/extern/xmlrpcpp/patches/0020-XmlRpc-Adapt-XmlRpcValue-to-use-the-new-base64-metod.patch @@ -1,7 +1,7 @@ From 9e57d52f1da4e962704a4ba133a526ec931141b0 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 18 Oct 2016 14:12:32 +0200 -Subject: [PATCH 20/21] XmlRpc++: Adapt XmlRpcValue to use the new base64 metods +Subject: [PATCH 20/22] XmlRpc++: Adapt XmlRpcValue to use the new base64 metods --- extern/xmlrpcpp/xmlrpcpp/src/XmlRpcValue.cpp | 38 ++++------------------------ diff --git a/extern/xmlrpcpp/patches/0021-xmlrpcpp-Add-missing-include.patch b/extern/xmlrpcpp/patches/0021-xmlrpcpp-Add-missing-include.patch index 59b76e3..c66994d 100644 --- a/extern/xmlrpcpp/patches/0021-xmlrpcpp-Add-missing-include.patch +++ b/extern/xmlrpcpp/patches/0021-xmlrpcpp-Add-missing-include.patch @@ -1,7 +1,7 @@ From 50b5bd857791bc176a17d464bb0a2ce21aff7ae8 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 14 Nov 2016 15:06:31 +0100 -Subject: [PATCH 21/21] xmlrpcpp: Add missing include +Subject: [PATCH 21/22] xmlrpcpp: Add missing include Fixes #945 --- diff --git a/extern/xmlrpcpp/patches/0022-xmlrpcpp-Call-va_end-where-required.patch b/extern/xmlrpcpp/patches/0022-xmlrpcpp-Call-va_end-where-required.patch new file mode 100644 index 0000000..6535752 --- /dev/null +++ b/extern/xmlrpcpp/patches/0022-xmlrpcpp-Call-va_end-where-required.patch @@ -0,0 +1,32 @@ +From f8a7b800c4f9f361f762624593993cbac304973d Mon Sep 17 00:00:00 2001 +From: "Daniele E. Domenichelli" +Date: Wed, 15 Feb 2017 15:37:53 +0100 +Subject: [PATCH 22/22] xmlrpcpp: Call va_end() where required + +--- + extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp +index c1bb19336..cb5aa7fb5 100644 +--- a/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp ++++ b/extern/xmlrpcpp/xmlrpcpp/src/XmlRpcUtil.cpp +@@ -79,6 +79,7 @@ void XmlRpcUtil::log(int level, const char* fmt, ...) + char buf[1024]; + va_start( va, fmt); + vsnprintf(buf,sizeof(buf)-1,fmt,va); ++ va_end(va); + buf[sizeof(buf)-1] = 0; + XmlRpcLogHandler::getLogHandler()->log(level, buf); + } +@@ -91,6 +92,7 @@ void XmlRpcUtil::error(const char* fmt, ...) + va_start(va, fmt); + char buf[1024]; + vsnprintf(buf,sizeof(buf)-1,fmt,va); ++ va_end(va); + buf[sizeof(buf)-1] = 0; + XmlRpcErrorHandler::getErrorHandler()->error(buf); + } +-- +2.11.0 + From f35d3219a4cd31679e097f4b00a51afc053acc8d Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 13 Mar 2017 17:05:08 +0100 Subject: [PATCH 106/187] CMake: Use project folders and keep files hierarchy in Visual Studio --- extern/xmlrpcpp/CMakeLists.txt | 2 +- src/carriers/xmlrpc_carrier/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index 5b58d85..e0a0e71 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -28,7 +28,7 @@ set(xmlrpcpp_HDRS xmlrpcpp/src/base64.h add_library(YARP_priv_xmlrpcpp STATIC ${xmlrpcpp_SRCS}) -set_property(TARGET YARP_priv_xmlrpcpp PROPERTY FOLDER "External Libraries") +set_property(TARGET YARP_priv_xmlrpcpp PROPERTY FOLDER "Libraries/External") set(xmlrpcpp_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpcpp/src PARENT_SCOPE) set(xmlrpcpp_LIBRARIES "YARP_priv_xmlrpcpp" PARENT_SCOPE) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 472357c..da9b0ef 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -36,4 +36,6 @@ if(NOT SKIP_xmlrpc_carrier) yarp_install(FILES xmlrpc.ini COMPONENT runtime DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}) + + set_property(TARGET yarp_xmlrpc PROPERTY FOLDER "Plugins/Carrier") endif() From fdf74fdeb7b8a6bda808a929fdcd90b166120c67 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 16 Mar 2017 14:08:15 +0100 Subject: [PATCH 107/187] CMake: Fix variable names --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 472357c..16fa396 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -10,7 +10,7 @@ yarp_prepare_plugin(xmlrpc DEPENDS "CREATE_OPTIONAL_CARRIERS;YARP_HAS_ACE" DEFAULT ON) -if(NOT SKIP_xmlrpc_carrier) +if(NOT SKIP_xmlrpc) set(CMAKE_INCLUDE_CURRENT_DIR ON) get_property(YARP_OS_INCLUDE_DIRS TARGET YARP_OS PROPERTY INCLUDE_DIRS) include_directories(${YARP_OS_INCLUDE_DIRS}) From b39b555936ade282b8605f65b03eda6e4ec9c817 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 30 May 2017 19:32:58 +0200 Subject: [PATCH 108/187] OS: Refactor yarp::os::Route --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 387d519..d2e6a51 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -75,7 +75,9 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) bool XmlRpcCarrier::expectSenderSpecifier(ConnectionState& proto) { - proto.setRoute(proto.getRoute().addFromName("rpc")); + Route route = proto.getRoute(); + route.setFromName("rpc"); + proto.setRoute(route); return true; } From 125ed7b74aec1a9eb3d960cc9ea4f0e44133b867 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 6 Jun 2017 18:04:31 +0200 Subject: [PATCH 109/187] Use override everywhere in implementations and private API --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 2 +- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 54 ++++++++++----------- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 24 ++++----- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 9c06507..10085e3 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -14,7 +14,7 @@ if(NOT SKIP_xmlrpc) set(CMAKE_INCLUDE_CURRENT_DIR ON) get_property(YARP_OS_INCLUDE_DIRS TARGET YARP_OS PROPERTY INCLUDE_DIRS) include_directories(${YARP_OS_INCLUDE_DIRS}) - include_directories(${xmlrpcpp_INCLUDE_DIRS}) + include_directories(SYSTEM ${xmlrpcpp_INCLUDE_DIRS}) check_cxx_compiler_flag("-Wformat-nonliteral" CXX_HAS_WFORMAT_NONLITERAL) if(CXX_HAS_WFORMAT_NONLITERAL) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 903e27f..feecdf1 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -55,62 +55,62 @@ class yarp::os::XmlRpcCarrier : public Carrier { } - virtual Carrier *create() + virtual Carrier *create() override { return new XmlRpcCarrier(); } - virtual ConstString getName() + virtual ConstString getName() override { return "xmlrpc"; } - virtual bool isConnectionless() + virtual bool isConnectionless() override { return false; } - virtual bool canAccept() + virtual bool canAccept() override { return true; } - virtual bool canOffer() + virtual bool canOffer() override { return true; } - virtual bool isTextMode() + virtual bool isTextMode() override { return true; } - virtual bool canEscape() + virtual bool canEscape() override { return true; } - virtual bool requireAck() + virtual bool requireAck() override { return false; } - virtual bool supportReply() + virtual bool supportReply() override { return true; } - virtual bool isLocal() + virtual bool isLocal() override { return false; } - virtual ConstString toString() + virtual ConstString toString() override { return "xmlrpc_carrier"; } - virtual void getHeader(const Bytes& header) + virtual void getHeader(const Bytes& header) override { const char *target = "POST /RP"; for (size_t i=0; i<8 && igetLocalAddress(); } - virtual const yarp::os::Contact& getRemoteAddress() + virtual const yarp::os::Contact& getRemoteAddress() override { return delegate->getRemoteAddress(); } - virtual bool isOk() + virtual bool isOk() override { return delegate->isOk(); } - virtual void reset() + virtual void reset() override { delegate->reset(); } - virtual void close() + virtual void close() override { delegate->close(); } - virtual void beginPacket() + virtual void beginPacket() override { delegate->beginPacket(); } - virtual void endPacket() + virtual void endPacket() override { delegate->endPacket(); } using yarp::os::OutputStream::write; - virtual void write(const Bytes& b); + virtual void write(const Bytes& b) override; using yarp::os::InputStream::read; - virtual YARP_SSIZE_T read(const Bytes& b); + virtual YARP_SSIZE_T read(const Bytes& b) override; - virtual void interrupt() + virtual void interrupt() override { delegate->getInputStream().interrupt(); } From f21db8316fa4164c4a227c25777ca84d3b36adda Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 7 Jun 2017 19:34:27 +0200 Subject: [PATCH 110/187] CMake: Start removing some useless include_directories for internal libraries --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 10085e3..b1a2ecf 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -12,8 +12,6 @@ yarp_prepare_plugin(xmlrpc if(NOT SKIP_xmlrpc) set(CMAKE_INCLUDE_CURRENT_DIR ON) - get_property(YARP_OS_INCLUDE_DIRS TARGET YARP_OS PROPERTY INCLUDE_DIRS) - include_directories(${YARP_OS_INCLUDE_DIRS}) include_directories(SYSTEM ${xmlrpcpp_INCLUDE_DIRS}) check_cxx_compiler_flag("-Wformat-nonliteral" CXX_HAS_WFORMAT_NONLITERAL) @@ -26,7 +24,7 @@ if(NOT SKIP_xmlrpc) XmlRpcCarrier.cpp XmlRpcStream.h XmlRpcStream.cpp) - target_link_libraries(yarp_xmlrpc YARP_OS + target_link_libraries(yarp_xmlrpc YARP::YARP_OS ${xmlrpcpp_LIBRARIES}) yarp_install(TARGETS yarp_xmlrpc EXPORT YARP From acc9d08e0b282100ef1bd951dac2413ec3a4c2a7 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 8 Jun 2017 14:05:41 +0200 Subject: [PATCH 111/187] Cleanup, update documentation, examples, and release notes --- example/idl/rosPortable/CMakeLists.txt | 18 +++++++----------- example/ros/CMakeLists.txt | 8 +++----- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index 1a0319b..3382c57 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -5,26 +5,22 @@ cmake_minimum_required(VERSION 3.0) find_package(YARP REQUIRED) -list(APPEND CMAKE_MODULE_PATH ${YARP_MODULE_PATH}) -set(ALLOW_IDL_GENERATION TRUE) -include(YarpIDL) -include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${YARP_INCLUDE_DIRS}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +set(ALLOW_IDL_GENERATION TRUE) set(generated_libs_dir ${CMAKE_CURRENT_BINARY_DIR}) yarp_idl_to_dir(SharedData.msg ${generated_libs_dir}) -include_directories(${generated_libs_dir}/include ${YARP_INCLUDE_DIRS}) +include_directories(${generated_libs_dir}/include) add_executable(sender sender.cpp) -TARGET_LINK_LIBRARIES(sender ${YARP_LIBRARIES}) +target_link_libraries(sender ${YARP_LIBRARIES}) add_executable(receiver receiver.cpp) -TARGET_LINK_LIBRARIES(receiver ${YARP_LIBRARIES}) +target_link_libraries(receiver ${YARP_LIBRARIES}) add_executable(sender2 sender2.cpp) -TARGET_LINK_LIBRARIES(sender2 ${YARP_LIBRARIES}) +target_link_libraries(sender2 ${YARP_LIBRARIES}) add_executable(receiver2 receiver2.cpp) -TARGET_LINK_LIBRARIES(receiver2 ${YARP_LIBRARIES}) - - +target_link_libraries(receiver2 ${YARP_LIBRARIES}) diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index d2a8faf..be0f6c7 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -6,8 +6,6 @@ cmake_minimum_required(VERSION 3.0) find_package(YARP REQUIRED) -include_directories(${YARP_INCLUDE_DIRS}) - add_executable(add_int_client_v1 add_int_client_v1.cpp) target_link_libraries(add_int_client_v1 ${YARP_LIBRARIES}) @@ -27,9 +25,9 @@ add_executable(listener_v2 listener_v2.cpp) target_link_libraries(listener_v2 ${YARP_LIBRARIES}) if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/String.h") - message(STATUS "File String. not found, please generate it by running: yarpidl_rosmsg String") + message(STATUS "File String. not found, please generate it by running: yarpidl_rosmsg String") message(STATUS "Skipping compilation of talker and listener") - + add_executable(listener listener.cpp) target_link_libraries(listener ${YARP_LIBRARIES}) @@ -46,4 +44,4 @@ add_executable(add_int_server_v1b add_int_server_v1b.cpp ${SOURCES} ${HEADERS}) target_link_libraries(add_int_server_v1b ${YARP_LIBRARIES}) add_executable(add_int_client_v1b add_int_client_v1b.cpp ${SOURCES} ${HEADERS}) -target_link_libraries(add_int_client_v1b ${YARP_LIBRARIES}) \ No newline at end of file +target_link_libraries(add_int_client_v1b ${YARP_LIBRARIES}) From 4de2ed38dce772cc768324ed9694fa577952db41 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 8 Aug 2017 18:51:16 +0200 Subject: [PATCH 112/187] Cleanup copyright --- example/idl/rosPortable/CMakeLists.txt | 2 +- example/idl/rosPortable/receiver.cpp | 2 +- example/idl/rosPortable/receiver2.cpp | 2 +- example/idl/rosPortable/sender.cpp | 2 +- example/idl/rosPortable/sender2.cpp | 2 +- example/ros/CMakeLists.txt | 2 +- example/ros/add_int_client_v1.cpp | 2 +- example/ros/add_int_client_v1b.cpp | 2 +- example/ros/add_int_client_v2.cpp | 2 +- example/ros/add_int_server_v1.cpp | 2 +- example/ros/add_int_server_v1b.cpp | 2 +- example/ros/listener.cpp | 2 +- example/ros/listener_v1.cpp | 2 +- example/ros/listener_v2.cpp | 2 +- example/ros/talker.cpp | 2 +- example/yarpros_examples/src/grab_encoders.cpp | 2 +- example/yarpros_examples/src/grab_image.cpp | 2 +- extern/xmlrpcpp/CMakeLists.txt | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index 3382c57..bda9cf5 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright: (C) 2014 iCub Facility +# Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) # Authors: Lorenzo Natale # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT diff --git a/example/idl/rosPortable/receiver.cpp b/example/idl/rosPortable/receiver.cpp index cabc9e3..6a2cef0 100644 --- a/example/idl/rosPortable/receiver.cpp +++ b/example/idl/rosPortable/receiver.cpp @@ -1,4 +1,4 @@ -/** Copyright: (C) 2014 iCub Facility +/** Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) * Authors: Lorenzo Natale * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/idl/rosPortable/receiver2.cpp b/example/idl/rosPortable/receiver2.cpp index ff31b90..9dc6fcd 100644 --- a/example/idl/rosPortable/receiver2.cpp +++ b/example/idl/rosPortable/receiver2.cpp @@ -1,4 +1,4 @@ -/** Copyright: (C) 2014 iCub Facility +/** Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) * Authors: Lorenzo Natale * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/idl/rosPortable/sender.cpp b/example/idl/rosPortable/sender.cpp index 041a3f2..ebfd0a9 100644 --- a/example/idl/rosPortable/sender.cpp +++ b/example/idl/rosPortable/sender.cpp @@ -1,4 +1,4 @@ -/** Copyright: (C) 2014 iCub Facility +/** Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) * Authors: Lorenzo Natale * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/idl/rosPortable/sender2.cpp b/example/idl/rosPortable/sender2.cpp index 1ad251b..a08eca0 100644 --- a/example/idl/rosPortable/sender2.cpp +++ b/example/idl/rosPortable/sender2.cpp @@ -1,4 +1,4 @@ -/** Copyright: (C) 2014 iCub Facility +/** Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) * Authors: Lorenzo Natale * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index be0f6c7..28ffbf6 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright: (C) 2013 iCub Facility +# Copyright: (C) 2013 Istituto Italiano di Tecnologia (IIT) # Authors: Paul Fitzpatrick # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT diff --git a/example/ros/add_int_client_v1.cpp b/example/ros/add_int_client_v1.cpp index 6d00835..e3a7e9b 100644 --- a/example/ros/add_int_client_v1.cpp +++ b/example/ros/add_int_client_v1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 iCub Facility + * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/ros/add_int_client_v1b.cpp b/example/ros/add_int_client_v1b.cpp index 14b6ebf..577ee24 100644 --- a/example/ros/add_int_client_v1b.cpp +++ b/example/ros/add_int_client_v1b.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 iCub Facility + * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/ros/add_int_client_v2.cpp b/example/ros/add_int_client_v2.cpp index d4459fc..9e7f079 100644 --- a/example/ros/add_int_client_v2.cpp +++ b/example/ros/add_int_client_v2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 iCub Facility + * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/ros/add_int_server_v1.cpp b/example/ros/add_int_server_v1.cpp index 66e7947..b5d6c78 100644 --- a/example/ros/add_int_server_v1.cpp +++ b/example/ros/add_int_server_v1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 iCub Facility + * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/ros/add_int_server_v1b.cpp b/example/ros/add_int_server_v1b.cpp index ac9b8cd..f648ae5 100644 --- a/example/ros/add_int_server_v1b.cpp +++ b/example/ros/add_int_server_v1b.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 iCub Facility + * Copyright (C) 2014 Istituto Italiano di Tecnologia (IIT) * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/ros/listener.cpp b/example/ros/listener.cpp index 85a5b6e..32cb479 100644 --- a/example/ros/listener.cpp +++ b/example/ros/listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 iCub Facility + * Copyright (C) 2016 Istituto Italiano di Tecnologia (IIT) * Authors: Lorenzo Natale * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/ros/listener_v1.cpp b/example/ros/listener_v1.cpp index 3dee5cc..5b5c64e 100644 --- a/example/ros/listener_v1.cpp +++ b/example/ros/listener_v1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 iCub Facility + * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/ros/listener_v2.cpp b/example/ros/listener_v2.cpp index 9aa8851..c5211b2 100644 --- a/example/ros/listener_v2.cpp +++ b/example/ros/listener_v2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 iCub Facility + * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) * Authors: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp index dbaef8b..ceb50c8 100644 --- a/example/ros/talker.cpp +++ b/example/ros/talker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016 iCub Facility + * Copyright (C) 2016 Istituto Italiano di Tecnologia (IIT) * Authors: Lorenzo Natale * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/yarpros_examples/src/grab_encoders.cpp b/example/yarpros_examples/src/grab_encoders.cpp index 08b0e65..16b20b3 100644 --- a/example/yarpros_examples/src/grab_encoders.cpp +++ b/example/yarpros_examples/src/grab_encoders.cpp @@ -1,5 +1,5 @@ /* - * Copyright: (C) 2012 IITRBCS + * Copyright: (C) 2012 Istituto Italiano di Tecnologia (IIT) * Author: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/example/yarpros_examples/src/grab_image.cpp b/example/yarpros_examples/src/grab_image.cpp index ee0c2af..8366f42 100644 --- a/example/yarpros_examples/src/grab_image.cpp +++ b/example/yarpros_examples/src/grab_image.cpp @@ -1,5 +1,5 @@ /* - * Copyright: (C) 2012 IITRBCS + * Copyright: (C) 2012 Istituto Italiano di Tecnologia (IIT) * Author: Paul Fitzpatrick * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT */ diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index e0a0e71..0f84641 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2012 iCub Facility, Istituto Italiano di Tecnologia +# Copyright (C) 2012 Istituto Italiano di Tecnologia (IIT) # Author: Daniele E. Domenichelli # CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT From 81c5d46b74c9922a895f53998cc40e131ecf9e0d Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 11 Aug 2017 18:02:06 +0200 Subject: [PATCH 113/187] Cleanup: YARP_NULLPTR->nullptr + clang-tidy modernize-use-nullptr --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 4 ++-- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index d2e6a51..486b4d9 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -118,7 +118,7 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) c.generateRequest(methodName.c_str(),args); req = c.getRequest(); } else { - XmlRpcServerConnection c(0, YARP_NULLPTR); + XmlRpcServerConnection c(0, nullptr); c.generateResponse(args.toXml()); req = c.getResponse(); } @@ -216,7 +216,7 @@ bool XmlRpcCarrier::respondToHeader(ConnectionState& proto) XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(), sender, interpretRos); - if (stream == YARP_NULLPTR) { + if (stream == nullptr) { return false; } proto.takeStreams(stream); diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index feecdf1..b70f54f 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -163,7 +163,7 @@ class yarp::os::XmlRpcCarrier : public Carrier sender = true; XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(),sender, interpretRos); - if (stream == YARP_NULLPTR) { + if (stream == nullptr) { return false; } proto.takeStreams(stream); diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 75c8662..2cc1754 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -39,7 +39,7 @@ class yarp::os::XmlRpcStream : public TwoWayStream, public: XmlRpcStream(TwoWayStream *delegate, bool sender, bool interpretRos) : client("notset", 0), - server(0, YARP_NULLPTR), + server(0, nullptr), sender(sender), interpretRos(interpretRos) { @@ -51,9 +51,9 @@ class yarp::os::XmlRpcStream : public TwoWayStream, virtual ~XmlRpcStream() { - if (delegate != YARP_NULLPTR) { + if (delegate != nullptr) { delete delegate; - delegate = YARP_NULLPTR; + delegate = nullptr; } } From 56f586aca8bde1d4621829e9aa657338cd8e584c Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 28 Aug 2017 19:03:39 +0200 Subject: [PATCH 114/187] Cleanup, add YARP_UNUSED around the code, update warnings --- extern/xmlrpcpp/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index 0f84641..1f94983 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -26,6 +26,13 @@ set(xmlrpcpp_HDRS xmlrpcpp/src/base64.h xmlrpcpp/src/XmlRpcUtil.h xmlrpcpp/src/XmlRpcValue.h) +if(NOT MSVC) + check_cxx_compiler_flag("-Wno-unused-parameter" CXX_HAS_WNO_UNUSED_PARAMETER) + if(CXX_HAS_WNO_UNUSED_PARAMETER) + set_property(SOURCE ${xmlrpcpp_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-unused-parameter") + endif() +endif() + add_library(YARP_priv_xmlrpcpp STATIC ${xmlrpcpp_SRCS}) set_property(TARGET YARP_priv_xmlrpcpp PROPERTY FOLDER "Libraries/External") From 7f2d5ee11f41c5e01084b58621f5eedf08ce50af Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 1 Dec 2017 09:49:49 +0100 Subject: [PATCH 115/187] Remove unused ACE dependencies on carriers Fixes #1476 --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index b1a2ecf..4e73fcb 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -7,7 +7,7 @@ yarp_prepare_plugin(xmlrpc TYPE yarp::os::XmlRpcCarrier INCLUDE XmlRpcCarrier.h EXTRA_CONFIG CODE="POST /" - DEPENDS "CREATE_OPTIONAL_CARRIERS;YARP_HAS_ACE" + DEPENDS "CREATE_OPTIONAL_CARRIERS" DEFAULT ON) if(NOT SKIP_xmlrpc) From bd7a4eca47760cd8a2939d9852008a0de50eddb9 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Sun, 18 Feb 2018 18:16:28 +0100 Subject: [PATCH 116/187] Examples: Re-license BSD --- example/idl/rosPortable/CMakeLists.txt | 8 +++++--- example/idl/rosPortable/receiver.cpp | 11 +++++++---- example/idl/rosPortable/receiver2.cpp | 11 +++++++---- example/idl/rosPortable/sender.cpp | 11 +++++++---- example/idl/rosPortable/sender2.cpp | 11 +++++++---- example/ros/CMakeLists.txt | 8 +++++--- example/ros/add_int_client_v1.cpp | 8 +++++--- example/ros/add_int_client_v1b.cpp | 8 +++++--- example/ros/add_int_client_v2.cpp | 8 +++++--- example/ros/add_int_server_v1.cpp | 8 +++++--- example/ros/add_int_server_v1b.cpp | 8 +++++--- example/ros/listener.cpp | 8 +++++--- example/ros/listener_v1.cpp | 8 +++++--- example/ros/listener_v2.cpp | 8 +++++--- example/ros/package/src/yarp_test/CMakeLists.txt | 6 ++++++ example/ros/package/src/yarp_test/package.xml | 2 +- example/ros/talker.cpp | 8 +++++--- example/yarpros_examples/CMakeLists.txt | 10 ++++++---- example/yarpros_examples/README.TXT | 9 ++++++--- example/yarpros_examples/mainpage.dox | 9 ++++++--- example/yarpros_examples/manifest.xml | 14 ++++++++++---- example/yarpros_examples/msg/VocabVocabDoubles.msg | 9 ++++++--- example/yarpros_examples/src/grab_encoders.cpp | 8 +++++--- example/yarpros_examples/src/grab_image.cpp | 8 +++++--- example/yarpros_examples/src/waggler.cpp | 9 ++++++--- 25 files changed, 140 insertions(+), 76 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index bda9cf5..269cc8f 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -1,6 +1,8 @@ -# Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) -# Authors: Lorenzo Natale -# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. cmake_minimum_required(VERSION 3.0) diff --git a/example/idl/rosPortable/receiver.cpp b/example/idl/rosPortable/receiver.cpp index 6a2cef0..e0b1f21 100644 --- a/example/idl/rosPortable/receiver.cpp +++ b/example/idl/rosPortable/receiver.cpp @@ -1,7 +1,10 @@ -/** Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) -* Authors: Lorenzo Natale -* CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -*/ +/* + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. + */ #include #include diff --git a/example/idl/rosPortable/receiver2.cpp b/example/idl/rosPortable/receiver2.cpp index 9dc6fcd..560759e 100644 --- a/example/idl/rosPortable/receiver2.cpp +++ b/example/idl/rosPortable/receiver2.cpp @@ -1,7 +1,10 @@ -/** Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) -* Authors: Lorenzo Natale -* CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -*/ +/* + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. + */ #include #include diff --git a/example/idl/rosPortable/sender.cpp b/example/idl/rosPortable/sender.cpp index ebfd0a9..a567f91 100644 --- a/example/idl/rosPortable/sender.cpp +++ b/example/idl/rosPortable/sender.cpp @@ -1,7 +1,10 @@ -/** Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) -* Authors: Lorenzo Natale -* CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -*/ +/* + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. + */ #include "SharedData.h" #include diff --git a/example/idl/rosPortable/sender2.cpp b/example/idl/rosPortable/sender2.cpp index a08eca0..7ef3cc4 100644 --- a/example/idl/rosPortable/sender2.cpp +++ b/example/idl/rosPortable/sender2.cpp @@ -1,7 +1,10 @@ -/** Copyright: (C) 2014 Istituto Italiano di Tecnologia (IIT) -* Authors: Lorenzo Natale -* CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT -*/ +/* + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. + */ #include "SharedData.h" #include diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index 28ffbf6..25d4c6e 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -1,6 +1,8 @@ -# Copyright: (C) 2013 Istituto Italiano di Tecnologia (IIT) -# Authors: Paul Fitzpatrick -# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. cmake_minimum_required(VERSION 3.0) diff --git a/example/ros/add_int_client_v1.cpp b/example/ros/add_int_client_v1.cpp index e3a7e9b..fed2dbd 100644 --- a/example/ros/add_int_client_v1.cpp +++ b/example/ros/add_int_client_v1.cpp @@ -1,7 +1,9 @@ /* - * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/ros/add_int_client_v1b.cpp b/example/ros/add_int_client_v1b.cpp index 577ee24..01ecbea 100644 --- a/example/ros/add_int_client_v1b.cpp +++ b/example/ros/add_int_client_v1b.cpp @@ -1,7 +1,9 @@ /* - * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/ros/add_int_client_v2.cpp b/example/ros/add_int_client_v2.cpp index 9e7f079..b016cee 100644 --- a/example/ros/add_int_client_v2.cpp +++ b/example/ros/add_int_client_v2.cpp @@ -1,7 +1,9 @@ /* - * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/ros/add_int_server_v1.cpp b/example/ros/add_int_server_v1.cpp index b5d6c78..38bc222 100644 --- a/example/ros/add_int_server_v1.cpp +++ b/example/ros/add_int_server_v1.cpp @@ -1,7 +1,9 @@ /* - * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/ros/add_int_server_v1b.cpp b/example/ros/add_int_server_v1b.cpp index f648ae5..8868525 100644 --- a/example/ros/add_int_server_v1b.cpp +++ b/example/ros/add_int_server_v1b.cpp @@ -1,7 +1,9 @@ /* - * Copyright (C) 2014 Istituto Italiano di Tecnologia (IIT) - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/ros/listener.cpp b/example/ros/listener.cpp index 32cb479..2c3d3b7 100644 --- a/example/ros/listener.cpp +++ b/example/ros/listener.cpp @@ -1,7 +1,9 @@ /* - * Copyright (C) 2016 Istituto Italiano di Tecnologia (IIT) - * Authors: Lorenzo Natale - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/ros/listener_v1.cpp b/example/ros/listener_v1.cpp index 5b5c64e..4d35ac1 100644 --- a/example/ros/listener_v1.cpp +++ b/example/ros/listener_v1.cpp @@ -1,7 +1,9 @@ /* - * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/ros/listener_v2.cpp b/example/ros/listener_v2.cpp index c5211b2..b517b8b 100644 --- a/example/ros/listener_v2.cpp +++ b/example/ros/listener_v2.cpp @@ -1,7 +1,9 @@ /* - * Copyright (C) 2013 Istituto Italiano di Tecnologia (IIT) - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/ros/package/src/yarp_test/CMakeLists.txt b/example/ros/package/src/yarp_test/CMakeLists.txt index 4f12c9a..601cf6a 100644 --- a/example/ros/package/src/yarp_test/CMakeLists.txt +++ b/example/ros/package/src/yarp_test/CMakeLists.txt @@ -1,3 +1,9 @@ +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. + cmake_minimum_required(VERSION 3.0) project(yarp_test) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) diff --git a/example/ros/package/src/yarp_test/package.xml b/example/ros/package/src/yarp_test/package.xml index a384053..c0d8054 100644 --- a/example/ros/package/src/yarp_test/package.xml +++ b/example/ros/package/src/yarp_test/package.xml @@ -4,7 +4,7 @@ 0.0.0 A test yarp package - this .xml file is here for ROS only, YARP does not use it Paul Fitzpatrick - BSD + BSD-3-Clause message_generation message_runtime catkin diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp index ceb50c8..49ffadb 100644 --- a/example/ros/talker.cpp +++ b/example/ros/talker.cpp @@ -1,7 +1,9 @@ /* - * Copyright (C) 2016 Istituto Italiano di Tecnologia (IIT) - * Authors: Lorenzo Natale - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 0dc7a18..9391160 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -1,8 +1,10 @@ - # This is in large part a generated file. Modifications to it are: -# Copyright: (C) 2010 RobotCub Consortium -# Author: Paul Fitzpatrick -# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2010 RobotCub Consortium +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. cmake_minimum_required(VERSION 3.0) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) diff --git a/example/yarpros_examples/README.TXT b/example/yarpros_examples/README.TXT index 78f25eb..a379e6a 100644 --- a/example/yarpros_examples/README.TXT +++ b/example/yarpros_examples/README.TXT @@ -1,6 +1,9 @@ -# Copyright: (C) 2010 RobotCub Consortium -# Authors: Paul Fitzpatrick -# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2010 RobotCub Consortium +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. Make sure the directory above this one is in your ROS_PACKAGE_PATH. diff --git a/example/yarpros_examples/mainpage.dox b/example/yarpros_examples/mainpage.dox index ed14d20..fde95f0 100644 --- a/example/yarpros_examples/mainpage.dox +++ b/example/yarpros_examples/mainpage.dox @@ -5,9 +5,12 @@ \b waggler is a test program for YARP/ROS interoperability. \verbatim - Copyright: (C) 2010 RobotCub Consortium - Author: Paul Fitzpatrick - CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2010 RobotCub Consortium +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. \endverbatim waggler is written in unmodified ROS, and does not use YARP. It publishes diff --git a/example/yarpros_examples/manifest.xml b/example/yarpros_examples/manifest.xml index a1fffee..6fa7c4f 100644 --- a/example/yarpros_examples/manifest.xml +++ b/example/yarpros_examples/manifest.xml @@ -1,14 +1,20 @@ + + - - - YARP/ROS interoperability examples Paul Fitzpatrick - LGPLv2.1 + BSD-3-Clause diff --git a/example/yarpros_examples/msg/VocabVocabDoubles.msg b/example/yarpros_examples/msg/VocabVocabDoubles.msg index ef64679..a403372 100644 --- a/example/yarpros_examples/msg/VocabVocabDoubles.msg +++ b/example/yarpros_examples/msg/VocabVocabDoubles.msg @@ -1,6 +1,9 @@ -# Copyright: (C) 2010 RobotCub Consortium -# Author: Paul Fitzpatrick -# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2010 RobotCub Consortium +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. # The port we are communicating with can accept many kinds of commands. # We set up a header here to make it clear we want to do the equivalent of: diff --git a/example/yarpros_examples/src/grab_encoders.cpp b/example/yarpros_examples/src/grab_encoders.cpp index 16b20b3..0ac3a72 100644 --- a/example/yarpros_examples/src/grab_encoders.cpp +++ b/example/yarpros_examples/src/grab_encoders.cpp @@ -1,7 +1,9 @@ /* - * Copyright: (C) 2012 Istituto Italiano di Tecnologia (IIT) - * Author: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/yarpros_examples/src/grab_image.cpp b/example/yarpros_examples/src/grab_image.cpp index 8366f42..e8f57d7 100644 --- a/example/yarpros_examples/src/grab_image.cpp +++ b/example/yarpros_examples/src/grab_image.cpp @@ -1,7 +1,9 @@ /* - * Copyright: (C) 2012 Istituto Italiano di Tecnologia (IIT) - * Author: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp index ed0a42c..6a7d683 100644 --- a/example/yarpros_examples/src/waggler.cpp +++ b/example/yarpros_examples/src/waggler.cpp @@ -1,7 +1,10 @@ /* - * Copyright: (C) 2010 RobotCub Consortium - * Author: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2010 RobotCub Consortium + * All rights reserved. + * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include From bf190e04b4018edd0b4a833e5b91a000da05c3a0 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 19 Feb 2018 22:37:51 +0100 Subject: [PATCH 117/187] carriers/xmlrpc_carrier: Re-license BSD --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 8 +++++--- src/carriers/xmlrpc_carrier/README.TXT | 9 +++++---- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 7 ++++--- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 7 ++++--- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 7 ++++--- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 7 ++++--- 6 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 4e73fcb..c86633c 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -1,6 +1,8 @@ -# Copyright (C) 2010 RobotCub Consortium -# Authors: Paul Fitzpatrick -# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. yarp_prepare_plugin(xmlrpc CATEGORY carrier diff --git a/src/carriers/xmlrpc_carrier/README.TXT b/src/carriers/xmlrpc_carrier/README.TXT index a1b4fcf..710aa32 100644 --- a/src/carriers/xmlrpc_carrier/README.TXT +++ b/src/carriers/xmlrpc_carrier/README.TXT @@ -1,7 +1,8 @@ -# Copyright (C) 2010 RobotCub Consortium -# Authors: Paul Fitzpatrick -# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT - +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. XMLRPC to Bottle translation: xmlrpc / bottle diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 486b4d9..6b6faf0 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -1,8 +1,9 @@ /* - * Copyright (C) 2010 RobotCub Consortium - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include "XmlRpcCarrier.h" diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index b70f54f..51aa4c2 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -1,8 +1,9 @@ /* - * Copyright (C) 2010 RobotCub Consortium - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #ifndef YARP_XMLRPC_CARRIER_XMLRPCCARRIER_H diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 5f11d3e..d51757d 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -1,8 +1,9 @@ /* - * Copyright (C) 2010 RobotCub Consortium - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #include "XmlRpcStream.h" diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index 2cc1754..d1b11c8 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -1,8 +1,9 @@ /* - * Copyright (C) 2010 RobotCub Consortium - * Authors: Paul Fitzpatrick - * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * All rights reserved. * + * This software may be modified and distributed under the terms of the + * BSD-3-Clause license. See the accompanying LICENSE file for details. */ #ifndef YARP_XMLRPC_CARRIER_XMLRPCSTREAM_H From 9954388dc83ad960ef0718a05ad780f9d036811b Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Sun, 18 Feb 2018 15:15:30 +0100 Subject: [PATCH 118/187] Re-license BSD the remaining CMake, scripts and data files --- extern/xmlrpcpp/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index 1f94983..da154bc 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -1,7 +1,8 @@ -# Copyright (C) 2012 Istituto Italiano di Tecnologia (IIT) -# Author: Daniele E. Domenichelli -# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT - +# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# All rights reserved. +# +# This software may be modified and distributed under the terms of the +# BSD-3-Clause license. See the accompanying LICENSE file for details. # XmlRpc++ project(YARP_priv_xmlrpcpp) From 0c62a52f4b9e35b0041a1da7da42686c25992b2f Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 23 Feb 2018 18:08:28 +0100 Subject: [PATCH 119/187] CMake: Add YARP_priv_xmlrpcpp_TYPE to allow building xmlrpcpp as a shared library --- extern/xmlrpcpp/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index da154bc..ed814ce 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -34,7 +34,15 @@ if(NOT MSVC) endif() endif() -add_library(YARP_priv_xmlrpcpp STATIC ${xmlrpcpp_SRCS}) +set(YARP_priv_xmlrpcpp_TYPE "STATIC" CACHE STRING "YARP_priv_xmlrpcpp (LGPL2.1+) library type (STATIC or SHARED)" ) +set_property(CACHE YARP_priv_xmlrpcpp_TYPE PROPERTY STRINGS "STATIC" "SHARED") +mark_as_advanced(YARP_priv_xmlrpcpp_TYPE) +if(NOT YARP_priv_xmlrpcpp_TYPE MATCHES "(STATIC|SHARED)") + message(WARNING "Invalid value for YARP_priv_xmlrpcpp_TYPE: ${YARP_priv_xmlrpcpp_TYPE}. Valid values are \"STATIC\" and \"SHARED\". Resetting to default value (STATIC).") + set_property(CACHE YARP_priv_xmlrpcpp_TYPE PROPERTY VALUE "STATIC") + unset(YARP_priv_xmlrpcpp_TYPE) +endif() +add_library(YARP_priv_xmlrpcpp ${TYPE} ${xmlrpcpp_SRCS}) set_property(TARGET YARP_priv_xmlrpcpp PROPERTY FOLDER "Libraries/External") From dd2571710b4f2d80f0b8c80641b766c3ee22dbd8 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 27 Feb 2018 09:21:38 +0100 Subject: [PATCH 120/187] Fix xmlrpcpp library type --- extern/xmlrpcpp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index ed814ce..5579f4a 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -42,7 +42,7 @@ if(NOT YARP_priv_xmlrpcpp_TYPE MATCHES "(STATIC|SHARED)") set_property(CACHE YARP_priv_xmlrpcpp_TYPE PROPERTY VALUE "STATIC") unset(YARP_priv_xmlrpcpp_TYPE) endif() -add_library(YARP_priv_xmlrpcpp ${TYPE} ${xmlrpcpp_SRCS}) +add_library(YARP_priv_xmlrpcpp ${YARP_priv_xmlrpcpp_TYPE} ${xmlrpcpp_SRCS}) set_property(TARGET YARP_priv_xmlrpcpp PROPERTY FOLDER "Libraries/External") From 4a696e8ea6750b793672b53efcb67622ff94adaf Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 7 Mar 2018 08:48:04 +0100 Subject: [PATCH 121/187] examples: Update after yarpidl_rosmsg changes --- example/idl/rosPortable/receiver.cpp | 64 +++++++++++++------------- example/idl/rosPortable/receiver2.cpp | 66 +++++++++++++-------------- example/idl/rosPortable/sender.cpp | 60 ++++++++++++------------ example/idl/rosPortable/sender2.cpp | 60 ++++++++++++------------ 4 files changed, 125 insertions(+), 125 deletions(-) diff --git a/example/idl/rosPortable/receiver.cpp b/example/idl/rosPortable/receiver.cpp index e0b1f21..538e116 100644 --- a/example/idl/rosPortable/receiver.cpp +++ b/example/idl/rosPortable/receiver.cpp @@ -6,7 +6,7 @@ * BSD-3-Clause license. See the accompanying LICENSE file for details. */ -#include +#include #include #include #include @@ -15,36 +15,36 @@ using namespace std; int main() { - yarp::os::Network network; - - cout<<"Starting receiver\n"; - - yarp::os::Port port; - if (!port.open("/receiver")) - { - cerr<<"Error opening port, check your yarp network\n"; - return -1; - } - - network.connect("/sender", "/receiver"); - - int count=0; - while(true) - { - SharedData d; - port.read(d); - - //access d - cout << count << " Received SharedData:\n"; - cout << d.text << "\n"; - for (int i=0; i +#include #include #include #include @@ -16,37 +16,37 @@ using namespace std; int main() { - yarp::os::Network network; - - cout<<"Starting receiver\n"; - - yarp::os::Node node("/receiver/node"); // added a Node - yarp::os::Subscriber port; // changed Port to Subscriber - if (!port.topic("/data")) // replaced open() with topic() - { - cerr<<"Error opening port, check your yarp network\n"; - return -1; - } - - // network.connect("/sender", "/receiver"); // don't need this anymore - - int count=0; - while(true) - { - SharedData d; - port.read(d); - - //access d - cout << count << " Received SharedData:\n"; - cout << d.text << "\n"; - for (int i=0; i port; // changed Port to Subscriber + if (!port.topic("/data")) // replaced open() with topic() + { + cerr<<"Error opening port, check your yarp network\n"; + return -1; + } + + // network.connect("/sender", "/receiver"); // don't need this anymore + + int count=0; + while(true) + { + yarp::rosmsg::SharedData d; + port.read(d); + + //access d + cout << count << " Received SharedData:\n"; + cout << d.text << "\n"; + for (int i=0; i #include #include #include @@ -16,34 +16,34 @@ using namespace std; int main() { - yarp::os::Network network; - - yarp::os::Port port; - - if (!port.open("/sender")) - { - cerr<<"Error opening port, check your yarp network\n"; - return -1; - } - - cout<<"Starting sender\n"; - double count=0.0; - while(true) - { - SharedData d; - - // d.text is a string - d.text="Hello from sender"; - - //d.content is a vector, let's push some data - d.content.push_back(count++); - d.content.push_back(count++); - - port.write(d); - - yarp::os::Time::delay(0.1); - } - - return 0; + yarp::os::Network network; + + yarp::os::Port port; + + if (!port.open("/sender")) + { + cerr<<"Error opening port, check your yarp network\n"; + return -1; + } + + cout<<"Starting sender\n"; + double count=0.0; + while(true) + { + yarp::rosmsg::SharedData d; + + // d.text is a string + d.text="Hello from sender"; + + //d.content is a vector, let's push some data + d.content.push_back(count++); + d.content.push_back(count++); + + port.write(d); + + yarp::os::Time::delay(0.1); + } + + return 0; } diff --git a/example/idl/rosPortable/sender2.cpp b/example/idl/rosPortable/sender2.cpp index 7ef3cc4..6452ece 100644 --- a/example/idl/rosPortable/sender2.cpp +++ b/example/idl/rosPortable/sender2.cpp @@ -6,7 +6,7 @@ * BSD-3-Clause license. See the accompanying LICENSE file for details. */ -#include "SharedData.h" +#include #include #include #include @@ -17,35 +17,35 @@ using namespace std; int main() { - yarp::os::Network network; - - yarp::os::Node node("/sender/node"); // added a Node - yarp::os::Publisher port; // changed Port to Publisher - - if (!port.topic("/data")) // replaced open() with topic() - { - cerr<<"Error opening port, check your yarp network\n"; - return -1; - } - - cout<<"Starting sender\n"; - double count=0.0; - while(true) - { - SharedData d; - - // d.text is a string - d.text="Hello from sender"; - - //d.content is a vector, let's push some data - d.content.push_back(count++); - d.content.push_back(count++); - - port.write(d); - - yarp::os::Time::delay(0.1); - } - + yarp::os::Network network; + + yarp::os::Node node("/sender/node"); // added a Node + yarp::os::Publisher port; // changed Port to Publisher + + if (!port.topic("/data")) // replaced open() with topic() + { + cerr<<"Error opening port, check your yarp network\n"; + return -1; + } + + cout<<"Starting sender\n"; + double count=0.0; + while(true) + { + yarp::rosmsg::SharedData d; + + // d.text is a string + d.text="Hello from sender"; + + //d.content is a vector, let's push some data + d.content.push_back(count++); + d.content.push_back(count++); + + port.write(d); + + yarp::os::Time::delay(0.1); + } + return 0; } From be240937f5e0982e4520806d67f22a853c0d4d63 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 7 Mar 2018 09:06:52 +0100 Subject: [PATCH 122/187] examples: Update after yarpidl_rosmsg changes --- example/ros/CMakeLists.txt | 21 +++++++++------------ example/ros/add_int_client_v1b.cpp | 10 +++++----- example/ros/add_int_server_v1b.cpp | 10 +++++----- example/ros/listener.cpp | 12 ++++++------ example/ros/listener_v2.cpp | 2 +- example/ros/std_msgs/String.msg | 1 + example/ros/talker.cpp | 12 ++++++------ 7 files changed, 33 insertions(+), 35 deletions(-) create mode 100644 example/ros/std_msgs/String.msg diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index 25d4c6e..0cf4119 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -17,27 +17,24 @@ target_link_libraries(add_int_client_v2 ${YARP_LIBRARIES}) add_executable(add_int_server_v1 add_int_server_v1.cpp) target_link_libraries(add_int_server_v1 ${YARP_LIBRARIES}) -add_executable(talker talker.cpp) -target_link_libraries(talker ${YARP_LIBRARIES}) - add_executable(listener_v1 listener_v1.cpp) target_link_libraries(listener_v1 ${YARP_LIBRARIES}) add_executable(listener_v2 listener_v2.cpp) target_link_libraries(listener_v2 ${YARP_LIBRARIES}) -if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/String.h") - message(STATUS "File String. not found, please generate it by running: yarpidl_rosmsg String") - message(STATUS "Skipping compilation of talker and listener") +add_executable(listener listener.cpp) +target_link_libraries(listener ${YARP_LIBRARIES}) - add_executable(listener listener.cpp) - target_link_libraries(listener ${YARP_LIBRARIES}) +add_executable(talker talker.cpp) +target_link_libraries(talker ${YARP_LIBRARIES}) - add_executable(talker talker.cpp) - target_link_libraries(talker ${YARP_LIBRARIES}) -endif() +yarp_idl_to_dir(package/src/yarp_test/srv/AddTwoInts.srv ${CMAKE_BINARY_DIR}/msg AddTwoInts_SOURCES AddTwoInts_HEADERS AddTwoInts_INCLUDES) +yarp_idl_to_dir(std_msgs/String.msg ${CMAKE_BINARY_DIR}/msg String_SOURCES String_HEADERS String_INCLUDES) +set(SOURCES ${AddTwoInts_SOURCES} ${String_SOURCES}) +set(HEADERS ${AddTwoInts_HEADERS} ${String_HEADERS}) +set(INCLUDES ${AddTwoInts_INCLUDES} ${String_INCLUDES}) -yarp_idl_to_dir(package/src/yarp_test/srv/AddTwoInts.srv ${CMAKE_BINARY_DIR}/msg SOURCES HEADERS INCLUDES) include_directories(${INCLUDES}) diff --git a/example/ros/add_int_client_v1b.cpp b/example/ros/add_int_client_v1b.cpp index 01ecbea..99817be 100644 --- a/example/ros/add_int_client_v1b.cpp +++ b/example/ros/add_int_client_v1b.cpp @@ -9,8 +9,8 @@ #include #include #include -#include "package/src/yarp_test/srv/AddTwoInts.h" -#include "package/src/yarp_test/srv/AddTwoIntsReply.h" +#include +#include using namespace yarp::os; @@ -22,7 +22,7 @@ int main(int argc, char *argv[]) { Network yarp; RpcClient client; - yarp_test::AddTwoInts example; + yarp::rosmsg::yarp_test::AddTwoInts example; client.promiseType(example.getType()); if (!client.open("/add_two_ints@/yarp_add_int_client")) { @@ -30,8 +30,8 @@ int main(int argc, char *argv[]) { return 1; } - yarp_test::AddTwoInts msg; - yarp_test::AddTwoIntsReply reply; + yarp::rosmsg::yarp_test::AddTwoInts msg; + yarp::rosmsg::yarp_test::AddTwoIntsReply reply; msg.a = atoi(argv[1]); msg.b = atoi(argv[2]); if (!client.write(msg,reply)) { diff --git a/example/ros/add_int_server_v1b.cpp b/example/ros/add_int_server_v1b.cpp index 8868525..c14f095 100644 --- a/example/ros/add_int_server_v1b.cpp +++ b/example/ros/add_int_server_v1b.cpp @@ -9,8 +9,8 @@ #include #include #include -#include "package/src/yarp_test/srv/AddTwoInts.h" -#include "package/src/yarp_test/srv/AddTwoIntsReply.h" +#include +#include using namespace yarp::os; @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) { Network yarp; RpcServer server; - yarp_test::AddTwoInts example; + yarp::rosmsg::yarp_test::AddTwoInts example; server.promiseType(example.getType()); if (!server.open("/add_two_ints@/yarp_add_int_server")) { @@ -27,8 +27,8 @@ int main(int argc, char *argv[]) { } while (true) { - yarp_test::AddTwoInts msg; - yarp_test::AddTwoIntsReply reply; + yarp::rosmsg::yarp_test::AddTwoInts msg; + yarp::rosmsg::yarp_test::AddTwoIntsReply reply; if (!server.read(msg,true)) continue; reply.sum = msg.a + msg.b; printf("Got %d + %d, answering %d\n", (int)msg.a, (int)msg.b, (int)reply.sum); diff --git a/example/ros/listener.cpp b/example/ros/listener.cpp index 2c3d3b7..a79b382 100644 --- a/example/ros/listener.cpp +++ b/example/ros/listener.cpp @@ -14,16 +14,16 @@ using namespace std; /* Make sure you run yarpidl_rosmsg std_msg/String */ /* to generate String.h */ -#include "String.h" +#include int main(int argc, char *argv[]) { Network yarp; - + /* creates a node called /yarp/listener */ Node node("/yarp/listener"); - + /* subscribe to topic chatter */ - yarp::os::Subscriber subscriber; + yarp::os::Subscriber subscriber; if (!subscriber.topic("/chatter")) { cerr<< "Failed to subscriber to /chatter\n"; return -1; @@ -31,10 +31,10 @@ int main(int argc, char *argv[]) { /* read data from the topic */ while (true) { - String data; + yarp::rosmsg::std_msgs::String data; subscriber.read(data); cout << "Received:" << data.data << " " << endl; } - + return 0; } diff --git a/example/ros/listener_v2.cpp b/example/ros/listener_v2.cpp index b517b8b..ef02766 100644 --- a/example/ros/listener_v2.cpp +++ b/example/ros/listener_v2.cpp @@ -29,6 +29,6 @@ int main(int argc, char *argv[]) { } printf("Got [%s]\n", msg.get(0).asString().c_str()); } - + return 0; } diff --git a/example/ros/std_msgs/String.msg b/example/ros/std_msgs/String.msg new file mode 100644 index 0000000..ae72173 --- /dev/null +++ b/example/ros/std_msgs/String.msg @@ -0,0 +1 @@ +string data diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp index 49ffadb..9d5eb52 100644 --- a/example/ros/talker.cpp +++ b/example/ros/talker.cpp @@ -14,16 +14,16 @@ using namespace std; /* Make sure you run yarpidl_rosmsg std_msg/String */ /* to generate String.h */ -#include "String.h" +#include int main(int argc, char *argv[]) { Network yarp; - + /* creates a node called /yarp/talker */ Node node("/yarp/talker"); - + /* subscribe to topic chatter */ - yarp::os::Publisher publisher; + yarp::os::Publisher publisher; if (!publisher.topic("/chatter")) { cerr<< "Failed to create publisher to /chatter\n"; return -1; @@ -31,7 +31,7 @@ int main(int argc, char *argv[]) { while (true) { /* prepare some data */ - String data; + yarp::rosmsg::std_msgs::String data; data.data="Hello from YARP"; /* publish it to the topic */ @@ -40,6 +40,6 @@ int main(int argc, char *argv[]) { /* wait some time to avoid flooding with messages */ Time::delay(0.1); } - + return 0; } From feba135a9d17f4591d171f0db059c8e720e9a70f Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 14 May 2018 18:20:00 +0200 Subject: [PATCH 123/187] OS: Deprecate ConstString in favour of std::string The `YARP_WRAP_STL_STRING` and `YARP_WRAP_STL_STRING_INLINE` are now always undefined, and they are now considered deprecated. --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 14 +++++++------- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 8 ++++---- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 6b6faf0..d02cada 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -36,7 +36,7 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) Bottle *bot = vin.asList(); bool struc = true; int offset = 0; - ConstString tag = bot->get(0).asString(); + std::string tag = bot->get(0).asString(); if (tag=="list") { struc = false; offset = 1; @@ -88,11 +88,11 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) StringInputStream sis; writer.write(sos); sis.reset(sos.toString()); - ConstString header; + std::string header; if (sender) { header = sis.readLine(); } - ConstString body = sis.readLine(); + std::string body = sis.readLine(); Value v; if (header.length()>0 && header[0]=='q') { body = "yarp.quit"; @@ -101,7 +101,7 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) } Bottle *bot = v.asList(); bot->fromString(body.c_str()); - ConstString methodName; + std::string methodName; if (sender) { methodName = bot->get(0).toString(); *bot = bot->tail(); @@ -179,7 +179,7 @@ bool XmlRpcCarrier::shouldInterpretRosMessages(ConnectionState& proto) } Name n(proto.getRoute().getCarrierName() + "://test"); - ConstString rospass = n.getCarrierModifier("ros"); + std::string rospass = n.getCarrierModifier("ros"); interpretRos = !nodelike; if (rospass=="1"||rospass=="on") { interpretRos = true; @@ -193,9 +193,9 @@ bool XmlRpcCarrier::shouldInterpretRosMessages(ConnectionState& proto) bool XmlRpcCarrier::sendHeader(ConnectionState& proto) { shouldInterpretRosMessages(proto); - ConstString target = "POST /RPC2"; + std::string target = "POST /RPC2"; Name n(proto.getRoute().getCarrierName() + "://test"); - ConstString pathValue = n.getCarrierModifier("path"); + std::string pathValue = n.getCarrierModifier("path"); if (pathValue!="") { target = "POST /"; target += pathValue; diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 51aa4c2..c18024b 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -46,7 +46,7 @@ class yarp::os::XmlRpcCarrier : public Carrier bool firstRound; bool sender; Contact host; - ConstString http; + std::string http; bool interpretRos; public: XmlRpcCarrier() : @@ -61,7 +61,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return new XmlRpcCarrier(); } - virtual ConstString getName() override + virtual std::string getName() override { return "xmlrpc"; } @@ -106,7 +106,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return false; } - virtual ConstString toString() override + virtual std::string toString() override { return "xmlrpc_carrier"; } @@ -203,7 +203,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return true; } - virtual ConstString getBootstrapCarrierName() override + virtual std::string getBootstrapCarrierName() override { return ""; } diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index d51757d..afc85ac 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -47,7 +47,7 @@ Value toValue(XmlRpcValue& v, bool outer) if (v2.getType()!=XmlRpcValue::TypeInvalid) { Value v = toValue(v2,false); if (i==0) { - ConstString tag = v.asString(); + std::string tag = v.asString(); if (tag=="list"||tag=="dict") { if (!outer) { bot->addString("list"); From 67c946a74622c7ab89e16ec3f10a3d558dc8dde0 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 7 May 2018 18:13:31 +0200 Subject: [PATCH 124/187] Update carriers --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 8 ++++---- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 4 ++-- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index d02cada..8f20dcb 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -24,10 +24,10 @@ using YarpXmlRpc::XmlRpcServerConnection; void toXmlRpcValue(Value& vin, XmlRpcValue& vout) { - if (vin.isInt()) { - vout = vin.asInt(); - } else if (vin.isDouble()) { - vout = vin.asDouble(); + if (vin.isInt32()) { + vout = vin.asInt32(); + } else if (vin.isFloat64()) { + vout = vin.asFloat64(); } else if (vin.isString()) { vout = std::string(vin.asString()); } else if (vin.isVocab()) { diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index afc85ac..2e1523c 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -87,10 +87,10 @@ Value toValue(XmlRpcValue& v, bool outer) return Value("(type not supported yet out of laziness)"); } -YARP_SSIZE_T XmlRpcStream::read(const Bytes& b) +yarp::conf::ssize_t XmlRpcStream::read(const Bytes& b) { //printf("XMLRPC READ\n"); - YARP_SSIZE_T result = sis.read(b); + yarp::conf::ssize_t result = sis.read(b); if (result>0) { //printf("RETURNING %d bytes\n", result); return result; diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index d1b11c8..c8332a1 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -108,7 +108,7 @@ class yarp::os::XmlRpcStream : public TwoWayStream, virtual void write(const Bytes& b) override; using yarp::os::InputStream::read; - virtual YARP_SSIZE_T read(const Bytes& b) override; + virtual yarp::conf::ssize_t read(const Bytes& b) override; virtual void interrupt() override { From 1f578e9734b1c58baa2934e7f2029bf4a1cb1313 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 7 May 2018 18:13:36 +0200 Subject: [PATCH 125/187] Update documentation and examples --- example/ros/add_int_client_v1.cpp | 6 +++--- example/ros/add_int_client_v2.cpp | 6 +++--- example/ros/add_int_server_v1.cpp | 6 +++--- example/yarpros_examples/msg/VocabVocabDoubles.msg | 2 +- example/yarpros_examples/src/waggler.cpp | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/example/ros/add_int_client_v1.cpp b/example/ros/add_int_client_v1.cpp index fed2dbd..9ab5a4b 100644 --- a/example/ros/add_int_client_v1.cpp +++ b/example/ros/add_int_client_v1.cpp @@ -26,13 +26,13 @@ int main(int argc, char *argv[]) { } Bottle msg, reply; - msg.addInt(atoi(argv[1])); - msg.addInt(atoi(argv[2])); + msg.addInt32(atoi(argv[1])); + msg.addInt32(atoi(argv[2])); if (!client.write(msg,reply)) { fprintf(stderr,"Failed to call service\n"); return 1; } - printf("Got %d\n", reply.get(0).asInt()); + printf("Got %d\n", reply.get(0).asInt32()); return 0; } diff --git a/example/ros/add_int_client_v2.cpp b/example/ros/add_int_client_v2.cpp index b016cee..2554f4a 100644 --- a/example/ros/add_int_client_v2.cpp +++ b/example/ros/add_int_client_v2.cpp @@ -28,13 +28,13 @@ int main(int argc, char *argv[]) { } Bottle msg, reply; - msg.addInt(atoi(argv[1])); - msg.addInt(atoi(argv[2])); + msg.addInt32(atoi(argv[1])); + msg.addInt32(atoi(argv[2])); if (!client.write(msg,reply)) { fprintf(stderr,"Failed to call service\n"); return 1; } - printf("Got %d\n", reply.get(0).asInt()); + printf("Got %d\n", reply.get(0).asInt32()); return 0; } diff --git a/example/ros/add_int_server_v1.cpp b/example/ros/add_int_server_v1.cpp index 38bc222..cb5d9ea 100644 --- a/example/ros/add_int_server_v1.cpp +++ b/example/ros/add_int_server_v1.cpp @@ -26,10 +26,10 @@ int main(int argc, char *argv[]) { while (true) { Bottle msg, reply; if (!server.read(msg,true)) continue; - int x = msg.get(0).asInt(); - int y = msg.get(1).asInt(); + int x = msg.get(0).asInt32(); + int y = msg.get(1).asInt32(); int sum = x + y; - reply.addInt(sum); + reply.addInt32(sum); printf("Got %d + %d, answering %d\n", x, y, sum); server.reply(reply); } diff --git a/example/yarpros_examples/msg/VocabVocabDoubles.msg b/example/yarpros_examples/msg/VocabVocabDoubles.msg index a403372..98fa0e6 100644 --- a/example/yarpros_examples/msg/VocabVocabDoubles.msg +++ b/example/yarpros_examples/msg/VocabVocabDoubles.msg @@ -16,6 +16,6 @@ int32 vocab1_tag # set to 9 (BOTTLE_TAG_VOCAB) int32 vocab1_val # set to (256^2)*'s' + 256*'e' + 't' int32 vocab2_tag # set to 9 (BOTTLE_TAG_VOCAB) int32 vocab2_val # set to (256^3)*'p' + (256^2)*'o' + 256*'s' + 's' -int32 setpoints_tag # set to 256+10 (BOTTLE_TAG_LIST+BOTTLE_TAG_DOUBLE) +int32 setpoints_tag # set to 256+10 (BOTTLE_TAG_LIST+BOTTLE_TAG_FLOAT64) float64[] setpoints diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp index 6a7d683..c539fb0 100644 --- a/example/yarpros_examples/src/waggler.cpp +++ b/example/yarpros_examples/src/waggler.cpp @@ -12,9 +12,9 @@ #include // A few YARP defines -#define BOTTLE_TAG_INT 1 +#define BOTTLE_TAG_INT32 1 #define BOTTLE_TAG_VOCAB (1+8) -#define BOTTLE_TAG_DOUBLE (2+8) +#define BOTTLE_TAG_FLOAT64 (2+8) #define BOTTLE_TAG_LIST 256 #define VOCAB(a,b,c,d) ((((int)(d))<<24)+(((int)(c))<<16)+(((int)(b))<<8)+((int)(a))) // YARP defines over @@ -41,7 +41,7 @@ int main(int argc, char** argv) { msg.vocab1_val = VOCAB('s','e','t',0); msg.vocab2_tag = BOTTLE_TAG_VOCAB; msg.vocab2_val = VOCAB('p','o','s','s'); - msg.setpoints_tag = BOTTLE_TAG_LIST+BOTTLE_TAG_DOUBLE; + msg.setpoints_tag = BOTTLE_TAG_LIST+BOTTLE_TAG_FLOAT64; msg.setpoints.resize(joint_count); for (int i=0; i Date: Tue, 22 May 2018 15:30:42 +0200 Subject: [PATCH 126/187] Suppress some MSVC warnings in dependencies --- extern/xmlrpcpp/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index 5579f4a..4545406 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -32,6 +32,8 @@ if(NOT MSVC) if(CXX_HAS_WNO_UNUSED_PARAMETER) set_property(SOURCE ${xmlrpcpp_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-unused-parameter") endif() +else() + set_property(SOURCE ${xmlrpcpp_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " /wd4267") endif() set(YARP_priv_xmlrpcpp_TYPE "STATIC" CACHE STRING "YARP_priv_xmlrpcpp (LGPL2.1+) library type (STATIC or SHARED)" ) From 4a39564408d92ea19d356ca7133c9bf24c33cb16 Mon Sep 17 00:00:00 2001 From: Nicogene Date: Wed, 30 May 2018 09:49:40 +0200 Subject: [PATCH 127/187] Carriers: fix warnings after replace of int with size_t in `Bottle`. --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 8f20dcb..3f5f869 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -45,7 +45,7 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) offset = 1; } else { // auto-detect - for (int i=0; isize(); i++) { + for (size_t i=0; isize(); i++) { Value& vi = bot->get(i); if (!vi.isList()) { struc = false; @@ -59,14 +59,14 @@ void toXmlRpcValue(Value& vin, XmlRpcValue& vout) } if (struc) { vout = XmlRpcValue(); - for (int i=offset; isize(); i++) { + for (size_t i=offset; isize(); i++) { Bottle *boti = bot->get(i).asList(); XmlRpcValue& vouti=vout[std::string(boti->get(0).toString())]=XmlRpcValue(); toXmlRpcValue(boti->get(1),vouti); } } else { vout = XmlRpcValue(); - for (int i=offset; isize(); i++) { + for (size_t i=offset; isize(); i++) { XmlRpcValue& vouti = vout[i] = XmlRpcValue(); toXmlRpcValue(bot->get(i),vouti); } From 43516b8ff543b4664280cb114eb4665421443bb4 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 30 May 2018 18:58:03 +0200 Subject: [PATCH 128/187] CMake: Implement components in YARP + cleanup and enhancements * Implement components: it is now possible to check for yarp components using (for example) find_package(YARP 3 COMPONENTS OS math) It is now also possible to create proper packages for single libraries or to add a new YARP component from an external repository. * Remove all internal properties (no longer needed) and use CMake targets and export instead. * Remove _REENTRANT flag when building YARP that is automatically enabled by all "recent" compilers (since 1995). * Export build flags in YARPConfig.cmake. * Change COMPATIBILITY to SameMajorVersion (YARP 3 will not be considered compatible when requesting YARP 2). * Deprecate YARP_INCLUDE_DIRS variable. * Cleanup libYARP_dev cmake-related files. * Bump YARP_VERSION to 2.3.73.5. * Bump YARP_SOVERSION to 3. --- extern/xmlrpcpp/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index 4545406..a9a5045 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -57,5 +57,3 @@ install(TARGETS YARP_priv_xmlrpcpp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") - -set_property(GLOBAL APPEND PROPERTY YARP_LIBS YARP_priv_xmlrpcpp) From 6bf50a3816b3d1ad85d2b2fe05c779a77daf05f5 Mon Sep 17 00:00:00 2001 From: Andrea Ruzzenenti Date: Wed, 30 May 2018 15:04:41 +0200 Subject: [PATCH 129/187] CMake: Rename CREATE_OPTIONAL_CARRIERS in YARP_COMPILE_CARRIER_PLUGINS and enable it by default Remove flag where no longer needed --- src/carriers/xmlrpc_carrier/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index c86633c..e7e4a22 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -9,7 +9,6 @@ yarp_prepare_plugin(xmlrpc TYPE yarp::os::XmlRpcCarrier INCLUDE XmlRpcCarrier.h EXTRA_CONFIG CODE="POST /" - DEPENDS "CREATE_OPTIONAL_CARRIERS" DEFAULT ON) if(NOT SKIP_xmlrpc) From d43cf13ad1e8552ad8fd7fa1b855225f345009b0 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 20:25:04 +0200 Subject: [PATCH 130/187] OS: isOk()/checkStreams() const * bool InputProtocol::isOk() const * bool InputStream::isOk() const * bool OutputProtocol::isOk() const * bool OutputStream::isOk() const * bool TwoWayStream::isOk() const * bool ConnectionState::checkStreams() const --- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index c8332a1..abbbd56 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -79,7 +79,7 @@ class yarp::os::XmlRpcStream : public TwoWayStream, return delegate->getRemoteAddress(); } - virtual bool isOk() override + virtual bool isOk() const override { return delegate->isOk(); } From 7deb98dd1f09bb0459556a999c6f5dea8937e353 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:27:50 +0200 Subject: [PATCH 131/187] OS: getName() const * std::string yarp::os::Connection::getName() const * std::string yarp::os::AbstractCarrier::getName() const * std::string yarp::os::ModifyingCarrier::getName() const * Update carriers --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index c18024b..814fdc3 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -61,7 +61,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return new XmlRpcCarrier(); } - virtual std::string getName() override + virtual std::string getName() const override { return "xmlrpc"; } From 711823a934e10b5eeea043fe84a2bc70c2a00d05 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:28:24 +0200 Subject: [PATCH 132/187] OS: isTextMode() const bool yarp::os::Connection::isTextMode() const bool yarp::os::Carrier::isTextMode() const bool yarp::os::AbstractCarrier::isTextMode() const bool yarp::os::ConnectionReader::isTextMode() const bool yarp::os::ConnectionWriter::isTextMode() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 814fdc3..f926922 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -81,7 +81,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return true; } - virtual bool isTextMode() override + virtual bool isTextMode() const override { return true; } From d4e49a445a5fa8fd735f6f618376b25461334c87 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:34:56 +0200 Subject: [PATCH 133/187] OS: isConnectionless() const * bool yarp::os::Connection::isConnectionless() const * bool yarp::os::Carrier::isConnectionless() const * bool yarp::os::AbstractCarrier::isConnectionless() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index f926922..82848e0 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -66,7 +66,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return "xmlrpc"; } - virtual bool isConnectionless() override + virtual bool isConnectionless() const override { return false; } From 03895fc12618aac7e883ddd40aec3d9c83faad2c Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:33:01 +0200 Subject: [PATCH 134/187] OS: canEscape() const * bool yarp::os::Connection::canEscape() const * bool yarp::os::Carrier::canEscape() const * bool yarp::os::AbstractCarrier::canEscape() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 82848e0..ec26ee3 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -86,7 +86,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return true; } - virtual bool canEscape() override + virtual bool canEscape() const override { return true; } From 75fdcbee39860d9af5d500d47266346dcb447fe2 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:29:43 +0200 Subject: [PATCH 135/187] OS: isActive() const * bool yarp::os::Connection::isActive() const * bool yarp::os::Carrier::isActive() const * bool yarp::os::AbstractCarrier::isActive() const * bool yarp::os::ConnectionReader::isActive() const * bool yarp::os::ConnectionWriter::isActive() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index ec26ee3..ed232de 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -171,7 +171,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return true; } - virtual bool isActive() override + virtual bool isActive() const override { return true; } From 4b2cf07528af1bcd634ce55f3664d6f72bb16dc8 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:33:09 +0200 Subject: [PATCH 136/187] OS: requireAck() const * bool yarp::os::Connection::requireAck() const * bool yarp::os::Carrier::requireAck() const * bool yarp::os::AbstractCarrier::requireAck() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index ed232de..e3eef52 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -91,7 +91,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return true; } - virtual bool requireAck() override + virtual bool requireAck() const override { return false; } From 41fdb9734ff3a65c41935e1149c02e46f1f67186 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 18:07:20 +0200 Subject: [PATCH 137/187] OS: get{Local,Remote}Address() const * yarp::os::Contact yarp::os::Face::getLocalAddress() const * const yarp::os::Contact& yarp::os::TwoWayStream::getLocalAddress() const * const yarp::os::Contact& yarp::os::TwoWayStream::getRemoteAddress() const --- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index abbbd56..a169c0b 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -69,12 +69,12 @@ class yarp::os::XmlRpcStream : public TwoWayStream, } - virtual const yarp::os::Contact& getLocalAddress() override + virtual const yarp::os::Contact& getLocalAddress() const override { return delegate->getLocalAddress(); } - virtual const yarp::os::Contact& getRemoteAddress() override + virtual const yarp::os::Contact& getRemoteAddress() const override { return delegate->getRemoteAddress(); } From 3b4c151e48765011e9ff94f9707026c95b778bdd Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:33:20 +0200 Subject: [PATCH 138/187] OS: supportReply() const * bool yarp::os::Connection::supportReply() const * bool yarp::os::Carrier::supportReply() const * bool yarp::os::AbstractCarrier::supportReply() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index e3eef52..635352e 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -96,7 +96,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return false; } - virtual bool supportReply() override + virtual bool supportReply() const override { return true; } From 0542c1d2c23ece98d4a09656af6ac880ddb26f35 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:32:14 +0200 Subject: [PATCH 139/187] OS: canAccept() const * bool yarp::os::Carrier::canAccept() const * bool yarp::os::AbstractCarrier::canAccept() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 635352e..2693447 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -71,7 +71,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return false; } - virtual bool canAccept() override + virtual bool canAccept() const override { return true; } From 75d1db8694e3f4a159848778573fbf2b6b64fe21 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 18:04:54 +0200 Subject: [PATCH 140/187] OS: canOffer() const * bool yarp::os::Carrier::canOffer() const * bool yarp::os::AbstractCarrier::canOffer() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 2693447..b15ceee 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -76,7 +76,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return true; } - virtual bool canOffer() override + virtual bool canOffer() const override { return true; } From 85a49e61860403bf378760a34c9156705559bc31 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:33:29 +0200 Subject: [PATCH 141/187] OS: isLocal() const * bool yarp::os::Connection::isLocal() const * bool yarp::os::Carrier::isLocal() const * bool yarp::os::AbstractCarrier::isLocal() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index b15ceee..656732e 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -101,7 +101,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return true; } - virtual bool isLocal() override + virtual bool isLocal() const override { return false; } From a2c7f5b248bbb64e159933ca1c9c3d88eda7e5b1 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:34:25 +0200 Subject: [PATCH 142/187] OS: getBootstrapCarrierName() const * std::string yarp::os::Carrier::getBootstrapCarrierName() const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 656732e..7d975c1 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -203,7 +203,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return true; } - virtual std::string getBootstrapCarrierName() override + virtual std::string getBootstrapCarrierName() const override { return ""; } From 9cfaf65b0c851d207ab635e4716fda4c48f7e203 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 6 Jun 2018 17:38:04 +0200 Subject: [PATCH 143/187] OS,dev,...: toString() const * std::string yarp::os::Carrier::toString() const * std::string yarp::os::AbstractCarrier::toString() const * std::string yarp::os::StringInputStream::toString() const * std::string yarp::os::StringOutputStream::toString() const * std::string yarp::os::idl::WireVocab::toString() const * std::string yarp::dev::DriverCreator::toString() const * and more --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 7d975c1..3f6ad90 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -106,7 +106,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return false; } - virtual std::string toString() override + virtual std::string toString() const override { return "xmlrpc_carrier"; } From a0937e8e75527376bbd7b1c30a1d8711d91669d3 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 4 Jun 2018 17:34:03 +0200 Subject: [PATCH 144/187] OS: getHeader() const and remove from argument The content of the variable is actually modified. * void yarp::os::Connection::getHeader(yarp::os::Bytes& header) const * void yarp::os::AbstractCarrier::getHeader(yarp::os::Bytes& header) const * void yarp::os::Carrier::getHeader(yarp::os::Bytes& header) const * void yarp::os::ModifyingCarrier::getHeader(yarp::os::Bytes& header) const --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 3f6ad90..3e58e72 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -111,7 +111,7 @@ class yarp::os::XmlRpcCarrier : public Carrier return "xmlrpc_carrier"; } - virtual void getHeader(const Bytes& header) override + virtual void getHeader(Bytes& header) const override { const char *target = "POST /RP"; for (size_t i=0; i<8 && i Date: Wed, 6 Jun 2018 21:55:34 +0200 Subject: [PATCH 145/187] OS: Remove const from read() The content of the variable is actually modified. * yarp::conf::ssize_t yarp::os::InputStream::read(Bytes& b, size_t offset, yarp::conf::ssize_t len) * yarp::conf::ssize_t yarp::os::InputStream::read(yarp::os::Bytes& b) * yarp::conf::ssize_t yarp::os::InputStream::partialRead(yarp::os::Bytes& b) * yarp::conf::ssize_t yarp::os::InputStream::readFull(Bytes& b) * yarp::conf::ssize_t yarp::os::TwoWayStream::read(Bytes& b) --- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 2 +- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 2e1523c..66c1f14 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -87,7 +87,7 @@ Value toValue(XmlRpcValue& v, bool outer) return Value("(type not supported yet out of laziness)"); } -yarp::conf::ssize_t XmlRpcStream::read(const Bytes& b) +yarp::conf::ssize_t XmlRpcStream::read(Bytes& b) { //printf("XMLRPC READ\n"); yarp::conf::ssize_t result = sis.read(b); diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index a169c0b..f09568a 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -108,7 +108,7 @@ class yarp::os::XmlRpcStream : public TwoWayStream, virtual void write(const Bytes& b) override; using yarp::os::InputStream::read; - virtual yarp::conf::ssize_t read(const Bytes& b) override; + virtual yarp::conf::ssize_t read(Bytes& b) override; virtual void interrupt() override { From 0c993411e9e51c0c99d7d0cc0d78670daf808237 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 6 Jun 2018 14:24:27 +0200 Subject: [PATCH 146/187] OS,dev,... create() const * yarp::os::Carrier* yarp::os::Carrier::create() const * yarp::os::Carrier* yarp::os::AbstractCarrier::create() const * yarp::os::Carrier* yarp::os::ModifyingCarrier::create() const * yarp::os::PortReader* yarp::os::PortReaderBufferBufferBase::create() const * yarp::os::PortReader* yarp::os::PortReaderBuffer::create() const * yarp::os::PortReader* yarp::os::PortReaderCreator::create() const * yarp::dev::DeviceDriver* yarp::dev::DriverCreatorcreate() const This requires a few const_casts in special devices --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 3e58e72..20b0bdb 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -56,7 +56,7 @@ class yarp::os::XmlRpcCarrier : public Carrier { } - virtual Carrier *create() override + virtual Carrier *create() const override { return new XmlRpcCarrier(); } From 58c18f65b8662dbc341bbeb83826f320f0aec65a Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 11 Jun 2018 12:04:46 +0200 Subject: [PATCH 147/187] Require CMake 3.5 or later --- example/idl/rosPortable/CMakeLists.txt | 2 +- example/ros/CMakeLists.txt | 2 +- example/ros/package/src/yarp_test/CMakeLists.txt | 2 +- example/yarpros_examples/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index 269cc8f..8847c2f 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -4,7 +4,7 @@ # This software may be modified and distributed under the terms of the # BSD-3-Clause license. See the accompanying LICENSE file for details. -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) find_package(YARP REQUIRED) diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index 0cf4119..de09c09 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -4,7 +4,7 @@ # This software may be modified and distributed under the terms of the # BSD-3-Clause license. See the accompanying LICENSE file for details. -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) find_package(YARP REQUIRED) diff --git a/example/ros/package/src/yarp_test/CMakeLists.txt b/example/ros/package/src/yarp_test/CMakeLists.txt index 601cf6a..a84a935 100644 --- a/example/ros/package/src/yarp_test/CMakeLists.txt +++ b/example/ros/package/src/yarp_test/CMakeLists.txt @@ -4,7 +4,7 @@ # This software may be modified and distributed under the terms of the # BSD-3-Clause license. See the accompanying LICENSE file for details. -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) project(yarp_test) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) add_service_files(FILES AddTwoInts.srv) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 9391160..0df9d94 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -6,7 +6,7 @@ # This software may be modified and distributed under the terms of the # BSD-3-Clause license. See the accompanying LICENSE file for details. -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.5) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) # Set the build type. Options are: From b1449c015e916c12f7971a05efcc8b936bfb3122 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 14 Jun 2018 16:11:03 +0200 Subject: [PATCH 148/187] Fix static builds * Add components for private libraries (needed for static builds) * Add components for yarpcar and yarpmod. * When using YARP_MODULE_PATH a deprecation warning is used (YCM should be used instead) * Do not print deprecation warnings when calling find_package(YARP) more than once. --- extern/xmlrpcpp/CMakeLists.txt | 9 +++++++-- src/carriers/xmlrpc_carrier/CMakeLists.txt | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index a9a5045..f152217 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -52,8 +52,13 @@ set(xmlrpcpp_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpcpp/src PARENT_SCOPE) set(xmlrpcpp_LIBRARIES "YARP_priv_xmlrpcpp" PARENT_SCOPE) install(TARGETS YARP_priv_xmlrpcpp - EXPORT YARP - COMPONENT runtime + EXPORT YARP_priv_xmlrpcpp + COMPONENT YARP_priv_xmlrpcpp RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + +if(NOT CREATE_SHARED_LIBS) + include(YarpInstallBasicPackageFiles) + yarp_install_basic_package_files(YARP_priv_xmlrpcpp) +endif() diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index e7e4a22..f6fa76d 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -13,7 +13,6 @@ yarp_prepare_plugin(xmlrpc if(NOT SKIP_xmlrpc) set(CMAKE_INCLUDE_CURRENT_DIR ON) - include_directories(SYSTEM ${xmlrpcpp_INCLUDE_DIRS}) check_cxx_compiler_flag("-Wformat-nonliteral" CXX_HAS_WFORMAT_NONLITERAL) if(CXX_HAS_WFORMAT_NONLITERAL) @@ -25,16 +24,23 @@ if(NOT SKIP_xmlrpc) XmlRpcCarrier.cpp XmlRpcStream.h XmlRpcStream.cpp) - target_link_libraries(yarp_xmlrpc YARP::YARP_OS - ${xmlrpcpp_LIBRARIES}) + target_link_libraries(yarp_xmlrpc PRIVATE YARP::YARP_OS) + list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS YARP_OS) + + target_include_directories(yarp_xmlrpc SYSTEM PRIVATE ${xmlrpcpp_INCLUDE_DIRS}) + target_link_libraries(yarp_xmlrpc PRIVATE ${xmlrpcpp_LIBRARIES}) + list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS xmlrpcpp) + yarp_install(TARGETS yarp_xmlrpc - EXPORT YARP - COMPONENT runtime + EXPORT YARP_${YARP_PLUGIN_MASTER} + COMPONENT ${YARP_PLUGIN_MASTER} LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR} ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR}) yarp_install(FILES xmlrpc.ini - COMPONENT runtime + COMPONENT ${YARP_PLUGIN_MASTER} DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}) + set(YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS ${YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS} PARENT_SCOPE) + set_property(TARGET yarp_xmlrpc PROPERTY FOLDER "Plugins/Carrier") endif() From 063c8ed2fbe179d058f33bca9c156e0110b9baa9 Mon Sep 17 00:00:00 2001 From: Nicogene Date: Fri, 22 Jun 2018 15:03:44 +0200 Subject: [PATCH 149/187] example: change VOCABx deprecated to createVocab. --- example/yarpros_examples/src/waggler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp index c539fb0..0ef8599 100644 --- a/example/yarpros_examples/src/waggler.cpp +++ b/example/yarpros_examples/src/waggler.cpp @@ -16,7 +16,7 @@ #define BOTTLE_TAG_VOCAB (1+8) #define BOTTLE_TAG_FLOAT64 (2+8) #define BOTTLE_TAG_LIST 256 -#define VOCAB(a,b,c,d) ((((int)(d))<<24)+(((int)(c))<<16)+(((int)(b))<<8)+((int)(a))) +#define yarp::os::createVocab(a,b,c,d) ((((int)(d))<<24)+(((int)(c))<<16)+(((int)(b))<<8)+((int)(a))) // YARP defines over int main(int argc, char** argv) { @@ -38,9 +38,9 @@ int main(int argc, char** argv) { msg.list_tag = BOTTLE_TAG_LIST; msg.list_len = 3; msg.vocab1_tag = BOTTLE_TAG_VOCAB; - msg.vocab1_val = VOCAB('s','e','t',0); + msg.vocab1_val = yarp::os::createVocab('s','e','t',0); msg.vocab2_tag = BOTTLE_TAG_VOCAB; - msg.vocab2_val = VOCAB('p','o','s','s'); + msg.vocab2_val = yarp::os::createVocab('p','o','s','s'); msg.setpoints_tag = BOTTLE_TAG_LIST+BOTTLE_TAG_FLOAT64; msg.setpoints.resize(joint_count); for (int i=0; i Date: Mon, 16 Jul 2018 19:25:54 +0200 Subject: [PATCH 150/187] extern: Cleanup and add missing README.txt for rplidar [ci skip] --- extern/xmlrpcpp/README.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/extern/xmlrpcpp/README.txt b/extern/xmlrpcpp/README.txt index 1ddc07f..581ccb4 100644 --- a/extern/xmlrpcpp/README.txt +++ b/extern/xmlrpcpp/README.txt @@ -1,4 +1,5 @@ XmlRpc++ +-------- XmlRpc++ is an implementation of the XmlRpc protocol written in C++, based upon Shilad Sen's excellent py-xmlrpc library. It is designed to From 114b56fc57f0346cbf47fd284c370897d78cdb87 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 19 Jul 2018 19:23:29 +0200 Subject: [PATCH 151/187] Fix copyright headers Everything that was not BSD is now LGPL2.1+ with these exceptions: * src/yarpscope uses QCustomPlot that is GPL3+ and it is therefore GPL3+ * src/yarpviz uses qgv that is GPL3+ and it is therefore GPL3+ * example/ContainerExample uses yarpscope and it is therefore GPL3+ * example/matrix/gsl_example.cpp uses GSL and it is therefore GPL2+ --- example/yarpros_examples/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 0df9d94..7ba0d20 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -1,4 +1,3 @@ -# This is in large part a generated file. Modifications to it are: # Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) # Copyright (C) 2006-2010 RobotCub Consortium # All rights reserved. From dba2c93aa8782e285ab01749946bd68e0b3bcdd9 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 21 Sep 2018 16:09:29 +0200 Subject: [PATCH 152/187] carriers: Cleanup + IWYU --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 4 ++++ src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 1 + 2 files changed, 5 insertions(+) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 3f5f869..966ef37 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -14,6 +14,10 @@ #include #include #include +#include +#include +#include +#include #include diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 20b0bdb..2552bc1 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -10,6 +10,7 @@ #define YARP_XMLRPC_CARRIER_XMLRPCCARRIER_H #include +#include #include "XmlRpcStream.h" namespace yarp { From cf931322c7beb6d9fb1e0dabeb1516ed37b941cb Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 17 Oct 2018 16:06:53 +0200 Subject: [PATCH 153/187] Remove several redundant c_str() [clang-tidy readability-redundant-string-cstr] --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 2 +- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 966ef37..97bdb5a 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -104,7 +104,7 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) return false; } Bottle *bot = v.asList(); - bot->fromString(body.c_str()); + bot->fromString(body); std::string methodName; if (sender) { methodName = bot->get(0).toString(); diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 66c1f14..c86cc0f 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -30,7 +30,7 @@ Value toValue(XmlRpcValue& v, bool outer) { string s = (string)v; if (s.length()==0 || s[0]!='[') { - return Value(s.c_str()); + return Value(s); } else { Value v; v.fromString(s.c_str()); @@ -157,9 +157,9 @@ yarp::conf::ssize_t XmlRpcStream::read(Bytes& b) //printf("xmlrpc block is %s\n", xresult.toXml().c_str()); Value v = toValue(xresult,true); if (!v.isNull()) { - sis.reset((prefix + v.toString().c_str() + "\n").c_str()); + sis.reset(prefix + v.toString() + "\n"); } else { - sis.reset((prefix + "\n").c_str()); + sis.reset(prefix + "\n"); } //printf("String version is %s\n", sis.toString().c_str()); result = sis.read(b); From 887624683cd0b9291a3e50f90259da02af63e81d Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Thu, 18 Oct 2018 09:16:21 +0200 Subject: [PATCH 154/187] Fix several redundant string initialization [clang-tidy readability-redundant-string-init] --- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index c86cc0f..77ce3cc 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -129,8 +129,8 @@ yarp::conf::ssize_t XmlRpcStream::read(Bytes& b) if (ok) { //printf("got a block!\n"); XmlRpcValue xresult; - std::string prefix = ""; - std::string cprefix = ""; + std::string prefix; + std::string cprefix; if (sender) { client.parseResponse(xresult); } else { From 11a2e16abcf088459259bd979f8c14b4e00beb31 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 19 Oct 2018 13:49:24 +0200 Subject: [PATCH 155/187] Modernize for loops [clang-tidy: modernize-loop-convert] --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 4 ++-- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 97bdb5a..649e510 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -133,8 +133,8 @@ bool XmlRpcCarrier::write(ConnectionState& proto, SizedWriter& writer) fprintf(stderr, "XmlRpcCarrier fail, %s:%d\n", __FILE__, __LINE__); return false; } - for (int i=0; i<(int)req.length(); i++) { - if (req[i] == '\n') { + for (char i : req) { + if (i == '\n') { start++; break; } diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 77ce3cc..211f79e 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -66,12 +66,10 @@ Value toValue(XmlRpcValue& v, bool outer) Bottle *bot = vbot.asList(); XmlRpcValue::ValueStruct& vals = v; bot->addString("dict"); - for (XmlRpcValue::ValueStruct::iterator it = vals.begin(); - it!= vals.end(); - it++) { - XmlRpcValue& v2 = it->second; + for (auto& val : vals) { + XmlRpcValue& v2 = val.second; Bottle& sub = bot->addList(); - sub.addString(it->first.c_str()); + sub.addString(val.first.c_str()); if (v2.getType()!=XmlRpcValue::TypeInvalid) { sub.add(toValue(v2,false)); } From b6609c7325191e17789ac6089c4e24df2fb56d2e Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Sun, 28 Oct 2018 02:39:05 +0200 Subject: [PATCH 156/187] [clang-tidy: modernize-use-override] --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 52 ++++++++++----------- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 24 +++++----- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 2552bc1..d466679 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -57,62 +57,62 @@ class yarp::os::XmlRpcCarrier : public Carrier { } - virtual Carrier *create() const override + Carrier *create() const override { return new XmlRpcCarrier(); } - virtual std::string getName() const override + std::string getName() const override { return "xmlrpc"; } - virtual bool isConnectionless() const override + bool isConnectionless() const override { return false; } - virtual bool canAccept() const override + bool canAccept() const override { return true; } - virtual bool canOffer() const override + bool canOffer() const override { return true; } - virtual bool isTextMode() const override + bool isTextMode() const override { return true; } - virtual bool canEscape() const override + bool canEscape() const override { return true; } - virtual bool requireAck() const override + bool requireAck() const override { return false; } - virtual bool supportReply() const override + bool supportReply() const override { return true; } - virtual bool isLocal() const override + bool isLocal() const override { return false; } - virtual std::string toString() const override + std::string toString() const override { return "xmlrpc_carrier"; } - virtual void getHeader(Bytes& header) const override + void getHeader(Bytes& header) const override { const char *target = "POST /RP"; for (size_t i=0; i<8 && igetLocalAddress(); } - virtual const yarp::os::Contact& getRemoteAddress() const override + const yarp::os::Contact& getRemoteAddress() const override { return delegate->getRemoteAddress(); } - virtual bool isOk() const override + bool isOk() const override { return delegate->isOk(); } - virtual void reset() override + void reset() override { delegate->reset(); } - virtual void close() override + void close() override { delegate->close(); } - virtual void beginPacket() override + void beginPacket() override { delegate->beginPacket(); } - virtual void endPacket() override + void endPacket() override { delegate->endPacket(); } using yarp::os::OutputStream::write; - virtual void write(const Bytes& b) override; + void write(const Bytes& b) override; using yarp::os::InputStream::read; - virtual yarp::conf::ssize_t read(Bytes& b) override; + yarp::conf::ssize_t read(Bytes& b) override; - virtual void interrupt() override + void interrupt() override { delegate->getInputStream().interrupt(); } From cc9f58c2574a63d281faa644dedb14ab55230205 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Sun, 28 Oct 2018 11:49:05 +0100 Subject: [PATCH 157/187] [clang-tidy: modernize-return-braced-init-list] --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index d466679..b516e1e 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -206,7 +206,7 @@ class yarp::os::XmlRpcCarrier : public Carrier std::string getBootstrapCarrierName() const override { - return ""; + return {}; } private: From f406b6465d3adb65c6ec4179a1a9ccb987ebda16 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Sun, 28 Oct 2018 13:06:01 +0100 Subject: [PATCH 158/187] [clang-tidy: modernize-use-auto] --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index 649e510..5f45ddb 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -218,9 +218,9 @@ bool XmlRpcCarrier::respondToHeader(ConnectionState& proto) { shouldInterpretRosMessages(proto); sender = false; - XmlRpcStream *stream = new XmlRpcStream(proto.giveStreams(), - sender, - interpretRos); + auto* stream = new XmlRpcStream(proto.giveStreams(), + sender, + interpretRos); if (stream == nullptr) { return false; } From b299912123023eebd9f01f23bae7a22a1f896826 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Fri, 23 Nov 2018 19:52:13 +0100 Subject: [PATCH 159/187] Disable all warnings for extern and bindings folders --- extern/xmlrpcpp/CMakeLists.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index f152217..7799400 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -27,15 +27,6 @@ set(xmlrpcpp_HDRS xmlrpcpp/src/base64.h xmlrpcpp/src/XmlRpcUtil.h xmlrpcpp/src/XmlRpcValue.h) -if(NOT MSVC) - check_cxx_compiler_flag("-Wno-unused-parameter" CXX_HAS_WNO_UNUSED_PARAMETER) - if(CXX_HAS_WNO_UNUSED_PARAMETER) - set_property(SOURCE ${xmlrpcpp_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-unused-parameter") - endif() -else() - set_property(SOURCE ${xmlrpcpp_SRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " /wd4267") -endif() - set(YARP_priv_xmlrpcpp_TYPE "STATIC" CACHE STRING "YARP_priv_xmlrpcpp (LGPL2.1+) library type (STATIC or SHARED)" ) set_property(CACHE YARP_priv_xmlrpcpp_TYPE PROPERTY STRINGS "STATIC" "SHARED") mark_as_advanced(YARP_priv_xmlrpcpp_TYPE) From c4b6c127d8f2432abaadc25abfc615e84ca0bcfa Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Wed, 6 Feb 2019 13:53:59 +0100 Subject: [PATCH 160/187] Update copyright up to 2019 --- example/idl/rosPortable/CMakeLists.txt | 2 +- example/idl/rosPortable/receiver.cpp | 2 +- example/idl/rosPortable/receiver2.cpp | 2 +- example/idl/rosPortable/sender.cpp | 2 +- example/idl/rosPortable/sender2.cpp | 2 +- example/ros/CMakeLists.txt | 2 +- example/ros/add_int_client_v1.cpp | 2 +- example/ros/add_int_client_v1b.cpp | 2 +- example/ros/add_int_client_v2.cpp | 2 +- example/ros/add_int_server_v1.cpp | 2 +- example/ros/add_int_server_v1b.cpp | 2 +- example/ros/listener.cpp | 2 +- example/ros/listener_v1.cpp | 2 +- example/ros/listener_v2.cpp | 2 +- example/ros/package/src/yarp_test/CMakeLists.txt | 2 +- example/ros/talker.cpp | 2 +- example/yarpros_examples/CMakeLists.txt | 2 +- example/yarpros_examples/README.TXT | 2 +- example/yarpros_examples/mainpage.dox | 2 +- example/yarpros_examples/manifest.xml | 2 +- example/yarpros_examples/msg/VocabVocabDoubles.msg | 2 +- example/yarpros_examples/src/grab_encoders.cpp | 2 +- example/yarpros_examples/src/grab_image.cpp | 2 +- example/yarpros_examples/src/waggler.cpp | 2 +- extern/xmlrpcpp/CMakeLists.txt | 2 +- src/carriers/xmlrpc_carrier/CMakeLists.txt | 2 +- src/carriers/xmlrpc_carrier/README.TXT | 2 +- src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp | 2 +- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 2 +- src/carriers/xmlrpc_carrier/XmlRpcStream.h | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index 8847c2f..f1636d0 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) # All rights reserved. # # This software may be modified and distributed under the terms of the diff --git a/example/idl/rosPortable/receiver.cpp b/example/idl/rosPortable/receiver.cpp index 538e116..f7bc432 100644 --- a/example/idl/rosPortable/receiver.cpp +++ b/example/idl/rosPortable/receiver.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/idl/rosPortable/receiver2.cpp b/example/idl/rosPortable/receiver2.cpp index 21bfad9..a0b1800 100644 --- a/example/idl/rosPortable/receiver2.cpp +++ b/example/idl/rosPortable/receiver2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/idl/rosPortable/sender.cpp b/example/idl/rosPortable/sender.cpp index 1144da3..aea8115 100644 --- a/example/idl/rosPortable/sender.cpp +++ b/example/idl/rosPortable/sender.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/idl/rosPortable/sender2.cpp b/example/idl/rosPortable/sender2.cpp index 6452ece..835e299 100644 --- a/example/idl/rosPortable/sender2.cpp +++ b/example/idl/rosPortable/sender2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index de09c09..03c2bfe 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) # All rights reserved. # # This software may be modified and distributed under the terms of the diff --git a/example/ros/add_int_client_v1.cpp b/example/ros/add_int_client_v1.cpp index 9ab5a4b..a44857e 100644 --- a/example/ros/add_int_client_v1.cpp +++ b/example/ros/add_int_client_v1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/ros/add_int_client_v1b.cpp b/example/ros/add_int_client_v1b.cpp index 99817be..b0ca5a4 100644 --- a/example/ros/add_int_client_v1b.cpp +++ b/example/ros/add_int_client_v1b.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/ros/add_int_client_v2.cpp b/example/ros/add_int_client_v2.cpp index 2554f4a..2cc9495 100644 --- a/example/ros/add_int_client_v2.cpp +++ b/example/ros/add_int_client_v2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/ros/add_int_server_v1.cpp b/example/ros/add_int_server_v1.cpp index cb5d9ea..f514c99 100644 --- a/example/ros/add_int_server_v1.cpp +++ b/example/ros/add_int_server_v1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/ros/add_int_server_v1b.cpp b/example/ros/add_int_server_v1b.cpp index c14f095..80b4f5d 100644 --- a/example/ros/add_int_server_v1b.cpp +++ b/example/ros/add_int_server_v1b.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/ros/listener.cpp b/example/ros/listener.cpp index a79b382..754d75a 100644 --- a/example/ros/listener.cpp +++ b/example/ros/listener.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/ros/listener_v1.cpp b/example/ros/listener_v1.cpp index 4d35ac1..0ad6327 100644 --- a/example/ros/listener_v1.cpp +++ b/example/ros/listener_v1.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/ros/listener_v2.cpp b/example/ros/listener_v2.cpp index ef02766..78d7f6c 100644 --- a/example/ros/listener_v2.cpp +++ b/example/ros/listener_v2.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/ros/package/src/yarp_test/CMakeLists.txt b/example/ros/package/src/yarp_test/CMakeLists.txt index a84a935..b31ef50 100644 --- a/example/ros/package/src/yarp_test/CMakeLists.txt +++ b/example/ros/package/src/yarp_test/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) # All rights reserved. # # This software may be modified and distributed under the terms of the diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp index 9d5eb52..93825bb 100644 --- a/example/ros/talker.cpp +++ b/example/ros/talker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) + * Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) * All rights reserved. * * This software may be modified and distributed under the terms of the diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 7ba0d20..2ae54c3 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) # Copyright (C) 2006-2010 RobotCub Consortium # All rights reserved. # diff --git a/example/yarpros_examples/README.TXT b/example/yarpros_examples/README.TXT index a379e6a..ff4ec22 100644 --- a/example/yarpros_examples/README.TXT +++ b/example/yarpros_examples/README.TXT @@ -1,4 +1,4 @@ -# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) # Copyright (C) 2006-2010 RobotCub Consortium # All rights reserved. # diff --git a/example/yarpros_examples/mainpage.dox b/example/yarpros_examples/mainpage.dox index fde95f0..d69df7c 100644 --- a/example/yarpros_examples/mainpage.dox +++ b/example/yarpros_examples/mainpage.dox @@ -5,7 +5,7 @@ \b waggler is a test program for YARP/ROS interoperability. \verbatim -# Copyright (C) 2006-2018 Istituto Italiano di Tecnologia (IIT) +# Copyright (C) 2006-2019 Istituto Italiano di Tecnologia (IIT) # Copyright (C) 2006-2010 RobotCub Consortium # All rights reserved. # diff --git a/example/yarpros_examples/manifest.xml b/example/yarpros_examples/manifest.xml index 6fa7c4f..0bbe85f 100644 --- a/example/yarpros_examples/manifest.xml +++ b/example/yarpros_examples/manifest.xml @@ -1,5 +1,5 @@ + yarp_test 0.0.0 diff --git a/example/ros/rosmap_publisher.cpp b/example/ros/rosmap_publisher.cpp index 4941dd6..ac4f41f 100644 --- a/example/ros/rosmap_publisher.cpp +++ b/example/ros/rosmap_publisher.cpp @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #include diff --git a/example/ros/talker.cpp b/example/ros/talker.cpp index b364433..2d40654 100644 --- a/example/ros/talker.cpp +++ b/example/ros/talker.cpp @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #include diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index 0a98133..d451061 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -1,9 +1,6 @@ -# Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) -# Copyright (C) 2006-2010 RobotCub Consortium -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. +# SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) +# SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium +# SPDX-License-Identifier: BSD-3-Clause cmake_minimum_required(VERSION 3.12) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) diff --git a/example/yarpros_examples/README.TXT b/example/yarpros_examples/README.TXT index d420f46..6080cdf 100644 --- a/example/yarpros_examples/README.TXT +++ b/example/yarpros_examples/README.TXT @@ -1,9 +1,6 @@ -# Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) -# Copyright (C) 2006-2010 RobotCub Consortium -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. +# SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) +# SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium +# SPDX-License-Identifier: BSD-3-Clause Make sure the directory above this one is in your ROS_PACKAGE_PATH. diff --git a/example/yarpros_examples/mainpage.dox b/example/yarpros_examples/mainpage.dox index 49abd30..eda7cc1 100644 --- a/example/yarpros_examples/mainpage.dox +++ b/example/yarpros_examples/mainpage.dox @@ -5,12 +5,9 @@ \b waggler is a test program for YARP/ROS interoperability. \verbatim -# Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) -# Copyright (C) 2006-2010 RobotCub Consortium -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. +# SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) +# SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium +# SPDX-License-Identifier: BSD-3-Clause \endverbatim waggler is written in unmodified ROS, and does not use YARP. It publishes diff --git a/example/yarpros_examples/manifest.xml b/example/yarpros_examples/manifest.xml index e9d474d..44fb726 100644 --- a/example/yarpros_examples/manifest.xml +++ b/example/yarpros_examples/manifest.xml @@ -1,10 +1,7 @@ diff --git a/example/yarpros_examples/msg/VocabVocabDoubles.msg b/example/yarpros_examples/msg/VocabVocabDoubles.msg index b170a07..b0ce46e 100644 --- a/example/yarpros_examples/msg/VocabVocabDoubles.msg +++ b/example/yarpros_examples/msg/VocabVocabDoubles.msg @@ -1,9 +1,6 @@ -# Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) -# Copyright (C) 2006-2010 RobotCub Consortium -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. +# SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) +# SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium +# SPDX-License-Identifier: BSD-3-Clause # The port we are communicating with can accept many kinds of commands. # We set up a header here to make it clear we want to do the equivalent of: diff --git a/example/yarpros_examples/src/grab_encoders.cpp b/example/yarpros_examples/src/grab_encoders.cpp index 2f5a7d8..7518e32 100644 --- a/example/yarpros_examples/src/grab_encoders.cpp +++ b/example/yarpros_examples/src/grab_encoders.cpp @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #include diff --git a/example/yarpros_examples/src/grab_image.cpp b/example/yarpros_examples/src/grab_image.cpp index 07c5d1d..24fe3c8 100644 --- a/example/yarpros_examples/src/grab_image.cpp +++ b/example/yarpros_examples/src/grab_image.cpp @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #include diff --git a/example/yarpros_examples/src/waggler.cpp b/example/yarpros_examples/src/waggler.cpp index 2d6317b..29083e7 100644 --- a/example/yarpros_examples/src/waggler.cpp +++ b/example/yarpros_examples/src/waggler.cpp @@ -1,10 +1,7 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * Copyright (C) 2006-2010 RobotCub Consortium - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium + * SPDX-License-Identifier: BSD-3-Clause */ #include diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index 8263fc2..69787c6 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -1,8 +1,5 @@ -# Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. +# SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) +# SPDX-License-Identifier: BSD-3-Clause # XmlRpc++ project(YARP_priv_xmlrpcpp) diff --git a/extern/xmlrpcpp/LICENSES/LGPL-2.1-or-later.txt b/extern/xmlrpcpp/LICENSES/LGPL-2.1-or-later.txt new file mode 100644 index 0000000..aaaba16 --- /dev/null +++ b/extern/xmlrpcpp/LICENSES/LGPL-2.1-or-later.txt @@ -0,0 +1,462 @@ +GNU LESSER GENERAL PUBLIC LICENSE + +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts as +the successor of the GNU Library Public License, version 2, hence the version +number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public Licenses are intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. + +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software Foundation +and other authors who decide to use it. You can use it too, but we suggest +you first think carefully about whether this license or the ordinary General +Public License is the better strategy to use in any particular case, based +on the explanations below. + +When we speak of free software, we are referring to freedom of use, not price. +Our General Public Licenses are designed to make sure that you have the freedom +to distribute copies of free software (and charge for this service if you +wish); that you receive source code or can get it if you want it; that you +can change the software and use pieces of it in new free programs; and that +you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid distributors +to deny you these rights or to ask you to surrender these rights. These restrictions +translate to certain responsibilities for you if you distribute copies of +the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis or for +a fee, you must give the recipients all the rights that we gave you. You must +make sure that they, too, receive or can get the source code. If you link +other code with the library, you must provide complete object files to the +recipients, so that they can relink them with the library after making changes +to the library and recompiling it. And you must show them these terms so they +know their rights. + +We protect your rights with a two-step method: (1) we copyright the library, +and (2) we offer you this license, which gives you legal permission to copy, +distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there is no +warranty for the free library. Also, if the library is modified by someone +else and passed on, the recipients should know that what they have is not +the original version, so that the original author's reputation will not be +affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of any free +program. We wish to make sure that a company cannot effectively restrict the +users of a free program by obtaining a restrictive license from a patent holder. +Therefore, we insist that any patent license obtained for a version of the +library must be consistent with the full freedom of use specified in this +license. + +Most GNU software, including some libraries, is covered by the ordinary GNU +General Public License. This license, the GNU Lesser General Public License, +applies to certain designated libraries, and is quite different from the ordinary +General Public License. We use this license for certain libraries in order +to permit linking those libraries into non-free programs. + +When a program is linked with a library, whether statically or using a shared +library, the combination of the two is legally speaking a combined work, a +derivative of the original library. The ordinary General Public License therefore +permits such linking only if the entire combination fits its criteria of freedom. +The Lesser General Public License permits more lax criteria for linking other +code with the library. + +We call this license the "Lesser" General Public License because it does Less +to protect the user's freedom than the ordinary General Public License. It +also provides other free software developers Less of an advantage over competing +non-free programs. These disadvantages are the reason we use the ordinary +General Public License for many libraries. However, the Lesser license provides +advantages in certain special circumstances. + +For example, on rare occasions, there may be a special need to encourage the +widest possible use of a certain library, so that it becomes a de-facto standard. +To achieve this, non-free programs must be allowed to use the library. A more +frequent case is that a free library does the same job as widely used non-free +libraries. In this case, there is little to gain by limiting the free library +to free software only, so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free programs +enables a greater number of people to use a large body of free software. For +example, permission to use the GNU C Library in non-free programs enables +many more people to use the whole GNU operating system, as well as its variant, +the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the users' +freedom, it does ensure that the user of a program that is linked with the +Library has the freedom and the wherewithal to run that program using a modified +version of the Library. + +The precise terms and conditions for copying, distribution and modification +follow. Pay close attention to the difference between a "work based on the +library" and a "work that uses the library". The former contains code derived +from the library, whereas the latter must be combined with the library in +order to run. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program +which contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Lesser General +Public License (also called "this License"). Each licensee is addressed as +"you". + +A "library" means a collection of software functions and/or data prepared +so as to be conveniently linked with application programs (which use some +of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has +been distributed under these terms. A "work based on the Library" means either +the Library or any derivative work under copyright law: that is to say, a +work containing the Library or a portion of it, either verbatim or with modifications +and/or translated straightforwardly into another language. (Hereinafter, translation +is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications +to it. For a library, complete source code means all the source code for all +modules it contains, plus any associated interface definition files, plus +the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered +by this License; they are outside its scope. The act of running a program +using the Library is not restricted, and output from such a program is covered +only if its contents constitute a work based on the Library (independent of +the use of the Library in a tool for writing it). Whether that is true depends +on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source +code as you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and disclaimer +of warranty; keep intact all the notices that refer to this License and to +the absence of any warranty; and distribute a copy of this License along with +the Library. + +You may charge a fee for the physical act of transferring a copy, and you +may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, +thus forming a work based on the Library, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all +of these conditions: + + a) The modified work must itself be a software library. + +b) You must cause the files modified to carry prominent notices stating that +you changed the files and the date of any change. + +c) You must cause the whole of the work to be licensed at no charge to all +third parties under the terms of this License. + +d) If a facility in the modified Library refers to a function or a table of +data to be supplied by an application program that uses the facility, other +than as an argument passed when the facility is invoked, then you must make +a good faith effort to ensure that, in the event an application does not supply +such function or table, the facility still operates, and performs whatever +part of its purpose remains meaningful. + +(For example, a function in a library to compute square roots has a purpose +that is entirely well-defined independent of the application. Therefore, Subsection +2d requires that any application-supplied function or table used by this function +must be optional: if the application does not supply it, the square root function +must still compute square roots.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Library, and can be reasonably +considered independent and separate works in themselves, then this License, +and its terms, do not apply to those sections when you distribute them as +separate works. But when you distribute the same sections as part of a whole +which is a work based on the Library, the distribution of the whole must be +on the terms of this License, whose permissions for other licensees extend +to the entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise +the right to control the distribution of derivative or collective works based +on the Library. + +In addition, mere aggregation of another work not based on the Library with +the Library (or with a work based on the Library) on a volume of a storage +or distribution medium does not bring the other work under the scope of this +License. + +3. You may opt to apply the terms of the ordinary GNU General Public License +instead of this License to a given copy of the Library. To do this, you must +alter all the notices that refer to this License, so that they refer to the +ordinary GNU General Public License, version 2, instead of to this License. +(If a newer version than version 2 of the ordinary GNU General Public License +has appeared, then you can specify that version instead if you wish.) Do not +make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, +so the ordinary GNU General Public License applies to all subsequent copies +and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library +into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of +it, under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you accompany it with the complete corresponding +machine-readable source code, which must be distributed under the terms of +Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated +place, then offering equivalent access to copy the source code from the same +place satisfies the requirement to distribute the source code, even though +third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but +is designed to work with the Library by being compiled or linked with it, +is called a "work that uses the Library". Such a work, in isolation, is not +a derivative work of the Library, and therefore falls outside the scope of +this License. + +However, linking a "work that uses the Library" with the Library creates an +executable that is a derivative of the Library (because it contains portions +of the Library), rather than a "work that uses the library". The executable +is therefore covered by this License. Section 6 states terms for distribution +of such executables. + +When a "work that uses the Library" uses material from a header file that +is part of the Library, the object code for the work may be a derivative work +of the Library even though the source code is not. Whether this is true is +especially significant if the work can be linked without the Library, or if +the work is itself a library. The threshold for this to be true is not precisely +defined by law. + +If such an object file uses only numerical parameters, data structure layouts +and accessors, and small macros and small inline functions (ten lines or less +in length), then the use of the object file is unrestricted, regardless of +whether it is legally a derivative work. (Executables containing this object +code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute +the object code for the work under the terms of Section 6. Any executables +containing that work also fall under Section 6, whether or not they are linked +directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work +that uses the Library" with the Library to produce a work containing portions +of the Library, and distribute that work under terms of your choice, provided +that the terms permit modification of the work for the customer's own use +and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library +is used in it and that the Library and its use are covered by this License. +You must supply a copy of this License. If the work during execution displays +copyright notices, you must include the copyright notice for the Library among +them, as well as a reference directing the user to the copy of this License. +Also, you must do one of these things: + +a) Accompany the work with the complete corresponding machine-readable source +code for the Library including whatever changes were used in the work (which +must be distributed under Sections 1 and 2 above); and, if the work is an +executable linked with the Library, with the complete machine-readable "work +that uses the Library", as object code and/or source code, so that the user +can modify the Library and then relink to produce a modified executable containing +the modified Library. (It is understood that the user who changes the contents +of definitions files in the Library will not necessarily be able to recompile +the application to use the modified definitions.) + +b) Use a suitable shared library mechanism for linking with the Library. A +suitable mechanism is one that (1) uses at run time a copy of the library +already present on the user's computer system, rather than copying library +functions into the executable, and (2) will operate properly with a modified +version of the library, if the user installs one, as long as the modified +version is interface-compatible with the version that the work was made with. + +c) Accompany the work with a written offer, valid for at least three years, +to give the same user the materials specified in Subsection 6a, above, for +a charge no more than the cost of performing this distribution. + +d) If distribution of the work is made by offering access to copy from a designated +place, offer equivalent access to copy the above specified materials from +the same place. + +e) Verify that the user has already received a copy of these materials or +that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must +include any data and utility programs needed for reproducing the executable +from it. However, as a special exception, the materials to be distributed +need not include anything that is normally distributed (in either source or +binary form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component itself +accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of +other proprietary libraries that do not normally accompany the operating system. +Such a contradiction means you cannot use both them and the Library together +in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side +in a single library together with other library facilities not covered by +this License, and distribute such a combined library, provided that the separate +distribution of the work based on the Library and of the other library facilities +is otherwise permitted, and provided that you do these two things: + +a) Accompany the combined library with a copy of the same work based on the +Library, uncombined with any other library facilities. This must be distributed +under the terms of the Sections above. + +b) Give prominent notice with the combined library of the fact that part of +it is a work based on the Library, and explaining where to find the accompanying +uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library +except as expressly provided under this License. Any attempt otherwise to +copy, modify, sublicense, link with, or distribute the Library is void, and +will automatically terminate your rights under this License. However, parties +who have received copies, or rights, from you under this License will not +have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed +it. However, nothing else grants you permission to modify or distribute the +Library or its derivative works. These actions are prohibited by law if you +do not accept this License. Therefore, by modifying or distributing the Library +(or any work based on the Library), you indicate your acceptance of this License +to do so, and all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), +the recipient automatically receives a license from the original licensor +to copy, distribute, link with or modify the Library subject to these terms +and conditions. You may not impose any further restrictions on the recipients' +exercise of the rights granted herein. You are not responsible for enforcing +compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement +or for any other reason (not limited to patent issues), conditions are imposed +on you (whether by court order, agreement or otherwise) that contradict the +conditions of this License, they do not excuse you from the conditions of +this License. If you cannot distribute so as to satisfy simultaneously your +obligations under this License and any other pertinent obligations, then as +a consequence you may not distribute the Library at all. For example, if a +patent license would not permit royalty-free redistribution of the Library +by all those who receive copies directly or indirectly through you, then the +only way you could satisfy both it and this License would be to refrain entirely +from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents +or other property right claims or to contest validity of any such claims; +this section has the sole purpose of protecting the integrity of the free +software distribution system which is implemented by public license practices. +Many people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose +that choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain +countries either by patents or by copyrighted interfaces, the original copyright +holder who places the Library under this License may add an explicit geographical +distribution limitation excluding those countries, so that distribution is +permitted only in or among countries not thus excluded. In such case, this +License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of +the Lesser General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address +new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies +a version number of this License which applies to it and "any later version", +you have the option of following the terms and conditions either of that version +or of any later version published by the Free Software Foundation. If the +Library does not specify a license version number, you may choose any version +ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs +whose distribution conditions are incompatible with these, write to the author +to ask for permission. For software which is copyrighted by the Free Software +Foundation, write to the Free Software Foundation; we sometimes make exceptions +for this. Our decision will be guided by the two goals of preserving the free +status of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY +"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE +OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE +THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE +OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA +OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES +OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH +HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Libraries + +If you develop a new library, and you want it to be of the greatest possible +use to the public, we recommend making it free software that everyone can +redistribute and change. You can do so by permitting redistribution under +these terms (or, alternatively, under the terms of the ordinary General Public +License). + +To apply these terms, attach the following notices to the library. It is safest +to attach them to the start of each source file to most effectively convey +the exclusion of warranty; and each file should have at least the "copyright" +line and a pointer to where the full notice is found. + + one line to give the library's name and an idea of what it does. + Copyright (C) year name of author + +This library is free software; you can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2.1 of the License, or (at your option) +any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. + +You should have received a copy of the GNU Lesser General Public License along +with this library; if not, write to the Free Software Foundation, Inc., 51 +Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information +on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the library, if necessary. Here +is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in +the library `Frob' (a library for tweaking knobs) written +by James Random Hacker. + +signature of Ty Coon, 1 April 1990 +Ty Coon, President of Vice +That's all there is to it! diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index c4dd506..9710edb 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -1,8 +1,5 @@ -# Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. +# SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) +# SPDX-License-Identifier: BSD-3-Clause yarp_prepare_plugin(xmlrpc CATEGORY carrier diff --git a/src/carriers/xmlrpc_carrier/README.TXT b/src/carriers/xmlrpc_carrier/README.TXT index 804f918..710c8af 100644 --- a/src/carriers/xmlrpc_carrier/README.TXT +++ b/src/carriers/xmlrpc_carrier/README.TXT @@ -1,8 +1,5 @@ -# Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) -# All rights reserved. -# -# This software may be modified and distributed under the terms of the -# BSD-3-Clause license. See the accompanying LICENSE file for details. +# SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) +# SPDX-License-Identifier: BSD-3-Clause XMLRPC to Bottle translation: xmlrpc / bottle diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp index e6d531e..90fb196 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.cpp @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #include "XmlRpcCarrier.h" diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index ce263f0..5e695d3 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef YARP_XMLRPC_CARRIER_XMLRPCCARRIER_H diff --git a/src/carriers/xmlrpc_carrier/XmlRpcLogComponent.cpp b/src/carriers/xmlrpc_carrier/XmlRpcLogComponent.cpp index b4f396e..52ea64c 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcLogComponent.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcLogComponent.cpp @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #include "XmlRpcLogComponent.h" diff --git a/src/carriers/xmlrpc_carrier/XmlRpcLogComponent.h b/src/carriers/xmlrpc_carrier/XmlRpcLogComponent.h index 03f9f7d..3750090 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcLogComponent.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcLogComponent.h @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef YARP_XMLRPCLOGCOMPONENT_H diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 0ff8251..9ed504e 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #include "XmlRpcStream.h" diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.h b/src/carriers/xmlrpc_carrier/XmlRpcStream.h index ca03fa4..85d476b 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.h @@ -1,9 +1,6 @@ /* - * Copyright (C) 2006-2021 Istituto Italiano di Tecnologia (IIT) - * All rights reserved. - * - * This software may be modified and distributed under the terms of the - * BSD-3-Clause license. See the accompanying LICENSE file for details. + * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) + * SPDX-License-Identifier: BSD-3-Clause */ #ifndef YARP_XMLRPC_CARRIER_XMLRPCSTREAM_H From 01bf9882a598992b29d83221b5603568e8e9983e Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 13 Jul 2021 20:26:36 +0200 Subject: [PATCH 182/187] Update CMake style --- extern/xmlrpcpp/CMakeLists.txt | 56 ++++++++++++---------- src/carriers/xmlrpc_carrier/CMakeLists.txt | 41 +++++++++------- 2 files changed, 55 insertions(+), 42 deletions(-) diff --git a/extern/xmlrpcpp/CMakeLists.txt b/extern/xmlrpcpp/CMakeLists.txt index 69787c6..c3e6ac8 100644 --- a/extern/xmlrpcpp/CMakeLists.txt +++ b/extern/xmlrpcpp/CMakeLists.txt @@ -15,25 +15,29 @@ endif() add_library(YARP_priv_xmlrpcpp ${YARP_priv_xmlrpcpp_TYPE}) -set(xmlrpcpp_SRCS xmlrpcpp/src/base64.cpp - xmlrpcpp/src/XmlRpcClient.cpp - xmlrpcpp/src/XmlRpcServerConnection.cpp - xmlrpcpp/src/XmlRpcServer.cpp - xmlrpcpp/src/XmlRpcServerMethod.cpp - xmlrpcpp/src/XmlRpcSource.cpp - xmlrpcpp/src/XmlRpcUtil.cpp - xmlrpcpp/src/XmlRpcValue.cpp) - -set(xmlrpcpp_HDRS xmlrpcpp/src/base64.h - xmlrpcpp/src/XmlRpcClient.h - xmlrpcpp/src/XmlRpcException.h - xmlrpcpp/src/XmlRpc.h - xmlrpcpp/src/XmlRpcServerConnection.h - xmlrpcpp/src/XmlRpcServer.h - xmlrpcpp/src/XmlRpcServerMethod.h - xmlrpcpp/src/XmlRpcSource.h - xmlrpcpp/src/XmlRpcUtil.h - xmlrpcpp/src/XmlRpcValue.h) +set(xmlrpcpp_SRCS + xmlrpcpp/src/base64.cpp + xmlrpcpp/src/XmlRpcClient.cpp + xmlrpcpp/src/XmlRpcServerConnection.cpp + xmlrpcpp/src/XmlRpcServer.cpp + xmlrpcpp/src/XmlRpcServerMethod.cpp + xmlrpcpp/src/XmlRpcSource.cpp + xmlrpcpp/src/XmlRpcUtil.cpp + xmlrpcpp/src/XmlRpcValue.cpp +) + +set(xmlrpcpp_HDRS + xmlrpcpp/src/base64.h + xmlrpcpp/src/XmlRpcClient.h + xmlrpcpp/src/XmlRpcException.h + xmlrpcpp/src/XmlRpc.h + xmlrpcpp/src/XmlRpcServerConnection.h + xmlrpcpp/src/XmlRpcServer.h + xmlrpcpp/src/XmlRpcServerMethod.h + xmlrpcpp/src/XmlRpcSource.h + xmlrpcpp/src/XmlRpcUtil.h + xmlrpcpp/src/XmlRpcValue.h +) target_sources(YARP_priv_xmlrpcpp PRIVATE ${xmlrpcpp_SRCS}) @@ -44,12 +48,14 @@ set_property(TARGET YARP_priv_xmlrpcpp PROPERTY FOLDER "Libraries/External") set(xmlrpcpp_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpcpp/src PARENT_SCOPE) set(xmlrpcpp_LIBRARIES "YARP_priv_xmlrpcpp" PARENT_SCOPE) -install(TARGETS YARP_priv_xmlrpcpp - EXPORT YARP_priv_xmlrpcpp - COMPONENT YARP_priv_xmlrpcpp - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") +install( + TARGETS YARP_priv_xmlrpcpp + EXPORT YARP_priv_xmlrpcpp + COMPONENT YARP_priv_xmlrpcpp + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" +) if(NOT CREATE_SHARED_LIBS) include(YarpInstallBasicPackageFiles) diff --git a/src/carriers/xmlrpc_carrier/CMakeLists.txt b/src/carriers/xmlrpc_carrier/CMakeLists.txt index 9710edb..0bb0aff 100644 --- a/src/carriers/xmlrpc_carrier/CMakeLists.txt +++ b/src/carriers/xmlrpc_carrier/CMakeLists.txt @@ -2,21 +2,26 @@ # SPDX-License-Identifier: BSD-3-Clause yarp_prepare_plugin(xmlrpc - CATEGORY carrier - TYPE XmlRpcCarrier - INCLUDE XmlRpcCarrier.h - EXTRA_CONFIG CODE="POST /" - DEFAULT ON) + CATEGORY carrier + TYPE XmlRpcCarrier + INCLUDE XmlRpcCarrier.h + EXTRA_CONFIG + CODE="POST /" + DEFAULT ON +) if(NOT SKIP_xmlrpc) yarp_add_plugin(yarp_xmlrpc) - target_sources(yarp_xmlrpc PRIVATE XmlRpcCarrier.h - XmlRpcCarrier.cpp - XmlRpcStream.h - XmlRpcStream.cpp - XmlRpcLogComponent.h - XmlRpcLogComponent.cpp) + target_sources(yarp_xmlrpc + PRIVATE + XmlRpcCarrier.h + XmlRpcCarrier.cpp + XmlRpcStream.h + XmlRpcStream.cpp + XmlRpcLogComponent.h + XmlRpcLogComponent.cpp + ) check_cxx_compiler_flag("-Wformat-nonliteral" CXX_HAS_WFORMAT_NONLITERAL) if(CXX_HAS_WFORMAT_NONLITERAL) @@ -30,12 +35,14 @@ if(NOT SKIP_xmlrpc) target_link_libraries(yarp_xmlrpc PRIVATE ${xmlrpcpp_LIBRARIES}) list(APPEND YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS xmlrpcpp) - yarp_install(TARGETS yarp_xmlrpc - EXPORT YARP_${YARP_PLUGIN_MASTER} - COMPONENT ${YARP_PLUGIN_MASTER} - LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR} - ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR} - YARP_INI DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR}) + yarp_install( + TARGETS yarp_xmlrpc + EXPORT YARP_${YARP_PLUGIN_MASTER} + COMPONENT ${YARP_PLUGIN_MASTER} + LIBRARY DESTINATION ${YARP_DYNAMIC_PLUGINS_INSTALL_DIR} + ARCHIVE DESTINATION ${YARP_STATIC_PLUGINS_INSTALL_DIR} + YARP_INI DESTINATION ${YARP_PLUGIN_MANIFESTS_INSTALL_DIR} + ) set(YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS ${YARP_${YARP_PLUGIN_MASTER}_PRIVATE_DEPS} PARENT_SCOPE) From 3b3ee47414564ccd8a8e6c73061a90bd081da90d Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 31 Aug 2021 17:24:49 +0200 Subject: [PATCH 183/187] Remove all 'using namespace std' --- src/carriers/xmlrpc_carrier/XmlRpcStream.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp index 9ed504e..761ece0 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp +++ b/src/carriers/xmlrpc_carrier/XmlRpcStream.cpp @@ -11,7 +11,6 @@ #include using namespace yarp::os; -using namespace std; using YarpXmlRpc::XmlRpcValue; Value toValue(XmlRpcValue& v, bool outer) @@ -26,7 +25,7 @@ Value toValue(XmlRpcValue& v, bool outer) break; case XmlRpcValue::TypeString: { - string s = (string)v; + std::string s = (std::string)v; if (s.length()==0 || s[0]!='[') { return Value(s); } else { @@ -115,7 +114,7 @@ yarp::conf::ssize_t XmlRpcStream::read(Bytes& b) if (result2<=0) { return result2; } - string s(buf,result2); + std::string s(buf,result2); yCTrace(XMLRPCCARRIER, "Giving %s to parser", s.c_str()); if (sender) { ok = client.read(s); From 01c9db1baab95d360e4988dc44b5f8b8e53738b6 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 31 Aug 2021 12:50:43 +0200 Subject: [PATCH 184/187] Require CMake 3.16 or later --- example/idl/rosPortable/CMakeLists.txt | 2 +- example/ros/CMakeLists.txt | 2 +- example/ros/package/src/yarp_test/CMakeLists.txt | 2 +- example/yarpros_examples/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index 067a9d5..9b84996 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.16) find_package(YARP COMPONENTS os idl_tools REQUIRED) diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index fc17300..0b7bf36 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.16) project(yarp_ros_example) find_package(YARP 3.3.103 COMPONENTS os dev math rosmsg idl_tools REQUIRED) diff --git a/example/ros/package/src/yarp_test/CMakeLists.txt b/example/ros/package/src/yarp_test/CMakeLists.txt index e546c16..c9ca173 100644 --- a/example/ros/package/src/yarp_test/CMakeLists.txt +++ b/example/ros/package/src/yarp_test/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.16) project(yarp_test) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) add_service_files(FILES AddTwoInts.srv) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index d451061..fd3f525 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.16) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) # Set the build type. Options are: From 7660daa566de3cb73b00f13c11f024351694c5b2 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 6 Sep 2021 14:16:50 +0200 Subject: [PATCH 185/187] Revert "Require CMake 3.16 or later" This reverts commit 01c9db1baab95d360e4988dc44b5f8b8e53738b6. --- example/idl/rosPortable/CMakeLists.txt | 2 +- example/ros/CMakeLists.txt | 2 +- example/ros/package/src/yarp_test/CMakeLists.txt | 2 +- example/yarpros_examples/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index 9b84996..067a9d5 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.12) find_package(YARP COMPONENTS os idl_tools REQUIRED) diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index 0b7bf36..fc17300 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.12) project(yarp_ros_example) find_package(YARP 3.3.103 COMPONENTS os dev math rosmsg idl_tools REQUIRED) diff --git a/example/ros/package/src/yarp_test/CMakeLists.txt b/example/ros/package/src/yarp_test/CMakeLists.txt index c9ca173..e546c16 100644 --- a/example/ros/package/src/yarp_test/CMakeLists.txt +++ b/example/ros/package/src/yarp_test/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.12) project(yarp_test) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) add_service_files(FILES AddTwoInts.srv) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index fd3f525..d451061 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.16) +cmake_minimum_required(VERSION 3.12) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) # Set the build type. Options are: From 657175178460271c039dfab656a9107cbc65fe0a Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Tue, 31 Aug 2021 12:50:43 +0200 Subject: [PATCH 186/187] Require CMake 3.16 or later --- example/idl/rosPortable/CMakeLists.txt | 2 +- example/ros/CMakeLists.txt | 2 +- example/ros/package/src/yarp_test/CMakeLists.txt | 2 +- example/yarpros_examples/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/example/idl/rosPortable/CMakeLists.txt b/example/idl/rosPortable/CMakeLists.txt index 067a9d5..9b84996 100644 --- a/example/idl/rosPortable/CMakeLists.txt +++ b/example/idl/rosPortable/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.16) find_package(YARP COMPONENTS os idl_tools REQUIRED) diff --git a/example/ros/CMakeLists.txt b/example/ros/CMakeLists.txt index fc17300..0b7bf36 100644 --- a/example/ros/CMakeLists.txt +++ b/example/ros/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.16) project(yarp_ros_example) find_package(YARP 3.3.103 COMPONENTS os dev math rosmsg idl_tools REQUIRED) diff --git a/example/ros/package/src/yarp_test/CMakeLists.txt b/example/ros/package/src/yarp_test/CMakeLists.txt index e546c16..c9ca173 100644 --- a/example/ros/package/src/yarp_test/CMakeLists.txt +++ b/example/ros/package/src/yarp_test/CMakeLists.txt @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT) # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.16) project(yarp_test) find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation) add_service_files(FILES AddTwoInts.srv) diff --git a/example/yarpros_examples/CMakeLists.txt b/example/yarpros_examples/CMakeLists.txt index d451061..fd3f525 100644 --- a/example/yarpros_examples/CMakeLists.txt +++ b/example/yarpros_examples/CMakeLists.txt @@ -2,7 +2,7 @@ # SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium # SPDX-License-Identifier: BSD-3-Clause -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.16) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) # Set the build type. Options are: From 9726efef397ec66e56f2dd002528d0ebf4517682 Mon Sep 17 00:00:00 2001 From: Marco Randazzo Date: Wed, 29 Jun 2022 18:37:18 +0200 Subject: [PATCH 187/187] Major Documentation cleanup --- src/carriers/xmlrpc_carrier/XmlRpcCarrier.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h index 5e695d3..b2699bc 100644 --- a/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h +++ b/src/carriers/xmlrpc_carrier/XmlRpcCarrier.h @@ -11,7 +11,7 @@ #include "XmlRpcStream.h" /** - * + * \ingroup carriers_lists * This carrier enables XML/RPC message transmission. * * Example: at the time of writing, there is a public XML/RPC server at