Applying current development branch to 1.4.x stable branch.

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@30 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2006-07-04 02:49:47 +00:00
parent 854cc93854
commit 191814ec13
186 changed files with 1832 additions and 359 deletions

View File

@ -1,3 +1,26 @@
2006-07-03 Marcelo Jimenez <mroberto@users.sourceforge.net>
* Patch for FreeBSD, thanks to Markus Strobl.
2006-06-26 Marcelo Jimenez <mroberto@users.sourceforge.net>
* Fix for missing "else" in httpreadwrite.c. Thanks to npapadop
for the patch.
2006-06-26 Marcelo Jimenez <mroberto@users.sourceforge.net>
* Fix for va_list initialization in x86_64 architectures.
2006-06-12 Oxy <virtual_worlds@gmx.de>
* Windows support added, it compiles and exports DLL-symbols but
it is not fully tested yet
2006-06-08 Oxy <virtual_worlds@gmx.de>
* Patch to fix memory leaks and reasons for crashes added (thanks
to loigu)
*************************************************************************
Release of version 1.4.0
*************************************************************************

View File

View File

@ -2,6 +2,7 @@ Linux* SDK for UPnP* Devices (libupnp)
Copyright (c) 2000-2003 Intel Corporation - All Rights Reserved.
Copyright (c) 2005-2006 Rémi Turboult <r3mi@users.sourceforge.net>
Copyright (c) 2006 Michel Pfeiffer and others <virtual_worlds@gmx.de>
See LICENSE for details.
@ -118,6 +119,14 @@ All pieces of the SDK are configured and built from the $(LIBUPNP) directory.
will build a version of the binaries without debug support, and with default
options enabled (see below for options available at configure time).
% cd $(LIBUPNP)
% ./configure CFLAGS="-DSPARC_SOLARIS -mtune=<cputype> -mcpu=<cputype>"
% make
will build a Sparc Solaris version of the binaries without debug support
and with default options enabled (see below for options available at
configure time). Please note: <cputype> has to be replaced by a token that
fits to your platform and CPU (e.g. "supersparc").
To build the documentation, assuming all the necessary tools are installed
(see section 3) :

View File

@ -6,7 +6,7 @@ suggesting various improvements or submitting actual code.
Here is a list of these people. Help us keep it complete and
exempt of errors.
Patches: Arno Willig, Oskar Liljeblad, Chaos,
Patches: Loigu, Arno Willig, Oskar Liljeblad, Chaos,
Nektarios K. Papadopoulos, John Dennis, Jiri Zouhar,
Marcelo Jimenez
Solaris Port: Oxy

View File

View File

@ -37,6 +37,17 @@
//#include <malloc.h>
#include <assert.h>
#ifdef WIN32
#ifdef LIBUPNP_EXPORTS
// set up declspec for dll export to make functions visible to library users
#define EXPORT_SPEC __declspec(dllexport)
#else
#define EXPORT_SPEC __declspec(dllimport)
#endif
#else
#define EXPORT_SPEC
#endif
typedef int BOOL;
#define DOMString char *
@ -234,7 +245,7 @@ extern "C" {
* @return [const DOMString] A constant {\bf DOMString} of the node name.
*/
const DOMString
EXPORT_SPEC const DOMString
ixmlNode_getNodeName(IXML_Node *nodeptr
/** Pointer to the node to retrieve the name. */
);
@ -245,7 +256,7 @@ ixmlNode_getNodeName(IXML_Node *nodeptr
* @return [DOMString] A {\bf DOMString} of the {\bf Node} value.
*/
DOMString
EXPORT_SPEC DOMString
ixmlNode_getNodeValue(IXML_Node *nodeptr
/** Pointer to the {\bf Node} to retrieve the value. */
);
@ -264,7 +275,7 @@ ixmlNode_getNodeValue(IXML_Node *nodeptr
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlNode_setNodeValue(IXML_Node *nodeptr,
/** The {\bf Node} to which to assign a new value. */
char *newNodeValue
@ -292,7 +303,7 @@ ixmlNode_setNodeValue(IXML_Node *nodeptr,
* {\bf Node}.
*/
unsigned short
EXPORT_SPEC unsigned short
ixmlNode_getNodeType(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the type. */
);
@ -303,7 +314,7 @@ ixmlNode_getNodeType(IXML_Node *nodeptr
* {\bf Node} has no parent.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNode_getParentNode(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the
parent. */
@ -316,7 +327,7 @@ ixmlNode_getParentNode(IXML_Node *nodeptr
* @return [NodeList*] A {\bf NodeList} of the children of the {\bf Node}.
*/
IXML_NodeList*
EXPORT_SPEC IXML_NodeList*
ixmlNode_getChildNodes(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the
children. */
@ -328,7 +339,7 @@ ixmlNode_getChildNodes(IXML_Node *nodeptr
* if the {\bf Node} does not have any children.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNode_getFirstChild(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the first
child. */
@ -340,7 +351,7 @@ ixmlNode_getFirstChild(IXML_Node *nodeptr
* the {\bf Node} does not have any children.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNode_getLastChild(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the last
child. */
@ -352,7 +363,7 @@ ixmlNode_getLastChild(IXML_Node *nodeptr
* {\tt NULL} if no such {\bf Node} exists.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNode_getPreviousSibling(IXML_Node *nodeptr
/** The {\bf Node} for which to retrieve the
previous sibling. */
@ -364,7 +375,7 @@ ixmlNode_getPreviousSibling(IXML_Node *nodeptr
* if no such {\bf Node} exists.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNode_getNextSibling(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the next
sibling. */
@ -377,7 +388,7 @@ ixmlNode_getNextSibling(IXML_Node *nodeptr
* {\tt NULL}.
*/
IXML_NamedNodeMap*
EXPORT_SPEC IXML_NamedNodeMap*
ixmlNode_getAttributes(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the
attributes. */
@ -392,7 +403,7 @@ ixmlNode_getAttributes(IXML_Node *nodeptr
* {\tt NULL}, if the {\bf Node} does not have an owner.
*/
IXML_Document*
EXPORT_SPEC IXML_Document*
ixmlNode_getOwnerDocument(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the
owner document. */
@ -408,7 +419,7 @@ ixmlNode_getOwnerDocument(IXML_Node *nodeptr
* namespace or {\tt NULL}.
*/
const DOMString
EXPORT_SPEC const DOMString
ixmlNode_getNamespaceURI(IXML_Node *nodeptr
/** The {\bf Node} for which to retrieve the
namespace. */
@ -424,7 +435,7 @@ ixmlNode_getNamespaceURI(IXML_Node *nodeptr
* or {\tt NULL}.
*/
DOMString
EXPORT_SPEC DOMString
ixmlNode_getPrefix(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the prefix. */
);
@ -439,7 +450,7 @@ ixmlNode_getPrefix(IXML_Node *nodeptr
* of the {\bf Element} or {\tt NULL}.
*/
const DOMString
EXPORT_SPEC const DOMString
ixmlNode_getLocalName(IXML_Node *nodeptr
/** The {\bf Node} from which to retrieve the local
name. */
@ -471,7 +482,7 @@ ixmlNode_getLocalName(IXML_Node *nodeptr
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlNode_insertBefore(IXML_Node *nodeptr,
/** The parent of the {\bf Node} before which to
insert the new child. */
@ -506,7 +517,7 @@ ixmlNode_insertBefore(IXML_Node *nodeptr,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlNode_replaceChild(IXML_Node *nodeptr,
/** The parent of the {\bf Node} which contains the
child to replace. */
@ -536,7 +547,7 @@ ixmlNode_replaceChild(IXML_Node *nodeptr,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlNode_removeChild(IXML_Node *nodeptr,
/** The parent of the child to remove. */
IXML_Node* oldChild,
@ -563,7 +574,7 @@ ixmlNode_removeChild(IXML_Node *nodeptr,
* read-only {\bf Node}.
*/
int
EXPORT_SPEC int
ixmlNode_appendChild(IXML_Node *nodeptr,
/** The {\bf Node} in which to append the new child. */
IXML_Node* newChild
@ -576,7 +587,7 @@ ixmlNode_appendChild(IXML_Node *nodeptr,
* otherwise {\tt FALSE}.
*/
BOOL
EXPORT_SPEC BOOL
ixmlNode_hasChildNodes(IXML_Node *nodeptr
/** The {\bf Node} to query for children. */
);
@ -589,7 +600,7 @@ ixmlNode_hasChildNodes(IXML_Node *nodeptr
* @return [Node*] A clone of {\bf nodeptr} or {\tt NULL}.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNode_cloneNode(IXML_Node *nodeptr,
/** The {\bf Node} to clone. */
BOOL deep
@ -604,7 +615,7 @@ ixmlNode_cloneNode(IXML_Node *nodeptr,
* {\tt FALSE}.
*/
BOOL
EXPORT_SPEC BOOL
ixmlNode_hasAttributes(IXML_Node *node
/** The {\bf Node} to query for attributes. */
);
@ -614,7 +625,7 @@ ixmlNode_hasAttributes(IXML_Node *node
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlNode_free(IXML_Node *IXML_Node
/** The {\bf Node} to free. */
);
@ -642,7 +653,7 @@ ixmlNode_free(IXML_Node *IXML_Node
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlAttr_free(IXML_Attr *attrNode
/** The {\bf Attr} node to free. */
);
@ -673,7 +684,7 @@ ixmlAttr_free(IXML_Attr *attrNode
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlCDATASection_init(IXML_CDATASection *nodeptr
/** The {\bf CDATASection} node to initialize. */
);
@ -684,7 +695,7 @@ ixmlCDATASection_init(IXML_CDATASection *nodeptr
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlCDATASection_free(IXML_CDATASection *nodeptr
/** The {\bf CDATASection} node to free. */
);
@ -711,7 +722,7 @@ ixmlCDATASection_free(IXML_CDATASection *nodeptr
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlDocument_init(IXML_Document *nodeptr
/** The {\bf Document} node to initialize. */
);
@ -729,7 +740,7 @@ ixmlDocument_init(IXML_Document *nodeptr
* \end{itemize}
*/
int ixmlDocument_createDocumentEx(IXML_Document** doc
EXPORT_SPEC int ixmlDocument_createDocumentEx(IXML_Document** doc
/** Pointer to a {\bf Document} where the
new object will be stored. */
);
@ -741,7 +752,7 @@ int ixmlDocument_createDocumentEx(IXML_Document** doc
* failure.
*/
IXML_Document* ixmlDocument_createDocument();
EXPORT_SPEC IXML_Document* ixmlDocument_createDocument();
/** Creates a new {\bf Element} node with the given tag name. The new
* {\bf Element} node has a {\tt nodeName} of {\bf tagName} and
@ -763,7 +774,7 @@ IXML_Document* ixmlDocument_createDocument();
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlDocument_createElementEx(IXML_Document *doc,
/** The owner {\bf Document} of the new node. */
const DOMString tagName,
@ -784,7 +795,7 @@ ixmlDocument_createElementEx(IXML_Document *doc,
* failure.
*/
IXML_Element*
EXPORT_SPEC IXML_Element*
ixmlDocument_createElement(IXML_Document *doc,
/** The owner {\bf Document} of the new node. */
const DOMString tagName
@ -807,7 +818,7 @@ ixmlDocument_createElement(IXML_Document *doc,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlDocument_createTextNodeEx(IXML_Document *doc,
/** The owner {\bf Document} of the new node. */
const DOMString data,
@ -824,7 +835,7 @@ ixmlDocument_createTextNodeEx(IXML_Document *doc,
* @return [Node*] A pointer to the new {\bf Node} or {\tt NULL} on failure.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlDocument_createTextNode(IXML_Document *doc,
/** The owner {\bf Document} of the new node. */
const DOMString data
@ -848,7 +859,7 @@ ixmlDocument_createTextNode(IXML_Document *doc,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlDocument_createCDATASectionEx(IXML_Document *doc,
/** The owner {\bf Document} of the new
node. */
@ -867,7 +878,7 @@ ixmlDocument_createCDATASectionEx(IXML_Document *doc,
* {\tt NULL} on failure.
*/
IXML_CDATASection*
EXPORT_SPEC IXML_CDATASection*
ixmlDocument_createCDATASection(IXML_Document *doc,
/** The owner {\bf Document} of the new
node. */
@ -881,7 +892,7 @@ ixmlDocument_createCDATASection(IXML_Document *doc,
* @return [Attr*] A pointer to the new {\bf Attr} or {\tt NULL} on failure.
*/
IXML_Attr*
EXPORT_SPEC IXML_Attr*
ixmlDocument_createAttribute(IXML_Document *doc,
/** The owner {\bf Document} of the new node. */
char *name
@ -905,7 +916,7 @@ ixmlDocument_createAttribute(IXML_Document *doc,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlDocument_createAttributeEx(IXML_Document *doc,
/** The owner {\bf Document} of the new
node. */
@ -925,7 +936,7 @@ ixmlDocument_createAttributeEx(IXML_Document *doc,
* matching items or {\tt NULL} on an error.
*/
IXML_NodeList*
EXPORT_SPEC IXML_NodeList*
ixmlDocument_getElementsByTagName(IXML_Document *doc,
/** The {\bf Document} to search. */
DOMString tagName
@ -951,7 +962,7 @@ ixmlDocument_getElementsByTagName(IXML_Document *doc,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlDocument_createElementNSEx(IXML_Document *doc,
/** The owner {\bf Document} of the new
node. */
@ -974,7 +985,7 @@ ixmlDocument_createElementNSEx(IXML_Document *doc,
* failure.
*/
IXML_Element*
EXPORT_SPEC IXML_Element*
ixmlDocument_createElementNS(IXML_Document *doc,
/** The owner {\bf Document} of the new node. */
DOMString namespaceURI,
@ -1002,7 +1013,7 @@ ixmlDocument_createElementNS(IXML_Document *doc,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlDocument_createAttributeNSEx(IXML_Document *doc,
/** The owner {\bf Document} of the new
{\bf Attr}. */
@ -1021,7 +1032,7 @@ ixmlDocument_createAttributeNSEx(IXML_Document *doc,
* @return [Attr*] A pointer to the new {\bf Attr} or {\tt NULL} on failure.
*/
IXML_Attr*
EXPORT_SPEC IXML_Attr*
ixmlDocument_createAttributeNS(IXML_Document *doc,
/** The owner {\bf Document} of the new
{\bf Attr}. */
@ -1041,7 +1052,7 @@ ixmlDocument_createAttributeNS(IXML_Document *doc,
* matching items or {\tt NULL} on an error.
*/
IXML_NodeList*
EXPORT_SPEC IXML_NodeList*
ixmlDocument_getElementsByTagNameNS(IXML_Document* doc,
/** The {\bf Document} to search. */
DOMString namespaceURI,
@ -1060,7 +1071,7 @@ ixmlDocument_getElementsByTagNameNS(IXML_Document* doc,
* {\tt NULL} on an error.
*/
IXML_Element*
EXPORT_SPEC IXML_Element*
ixmlDocument_getElementById(IXML_Document* doc,
/** The owner {\bf Document} of the {\bf
Element}. */
@ -1076,7 +1087,7 @@ ixmlDocument_getElementById(IXML_Document* doc,
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlDocument_free(IXML_Document* doc
/** The {\bf Document} to free. */
);
@ -1100,7 +1111,7 @@ ixmlDocument_free(IXML_Document* doc
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlDocument_importNode(IXML_Document* doc,
/** The {\bf Document} into which to import. */
IXML_Node* importNode,
@ -1136,7 +1147,7 @@ ixmlDocument_importNode(IXML_Document* doc,
* @return [void] This function does not return a value.
*/
void ixmlElement_init(IXML_Element *element
EXPORT_SPEC void ixmlElement_init(IXML_Element *element
/** The {\bf Element} to initialize.*/
);
@ -1147,7 +1158,7 @@ void ixmlElement_init(IXML_Element *element
* {\bf Element}.
*/
const DOMString
EXPORT_SPEC const DOMString
ixmlElement_getTagName(IXML_Element* element
/** The {\bf Element} from which to retrieve the
name. */
@ -1159,7 +1170,7 @@ ixmlElement_getTagName(IXML_Element* element
* attribute.
*/
DOMString
EXPORT_SPEC DOMString
ixmlElement_getAttribute(IXML_Element* element,
/** The {\bf Element} from which to retrieve the
attribute. */
@ -1183,7 +1194,7 @@ ixmlElement_getAttribute(IXML_Element* element,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlElement_setAttribute(IXML_Element* element,
/** The {\bf Element} on which to set the
attribute. */
@ -1205,7 +1216,7 @@ ixmlElement_setAttribute(IXML_Element* element,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlElement_removeAttribute(IXML_Element* element,
/** The {\bf Element} from which to remove the
attribute. */
@ -1221,7 +1232,7 @@ ixmlElement_removeAttribute(IXML_Element* element,
* {\tt NULL} on an error.
*/
IXML_Attr*
EXPORT_SPEC IXML_Attr*
ixmlElement_getAttributeNode(IXML_Element* element,
/** The {\bf Element} from which to get the
attribute node. */
@ -1245,7 +1256,7 @@ ixmlElement_getAttributeNode(IXML_Element* element,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlElement_setAttributeNode(IXML_Element* element,
/** The {\bf Element} in which to add the new
attribute. */
@ -1270,7 +1281,7 @@ ixmlElement_setAttributeNode(IXML_Element* element,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlElement_removeAttributeNode(IXML_Element* element,
/** The {\bf Element} from which to remove
the attribute. */
@ -1290,7 +1301,7 @@ ixmlElement_removeAttributeNode(IXML_Element* element,
* {\tt NULL} on an error.
*/
IXML_NodeList*
EXPORT_SPEC IXML_NodeList*
ixmlElement_getElementsByTagName(IXML_Element* element,
/** The {\bf Element} from which to start
the search. */
@ -1307,7 +1318,7 @@ ixmlElement_getElementsByTagName(IXML_Element* element,
* matching attribute.
*/
DOMString
EXPORT_SPEC DOMString
ixmlElement_getAttributeNS(IXML_Element* element,
/** The {\bf Element} from which to get the
attribute value. */
@ -1339,7 +1350,7 @@ ixmlElement_getAttributeNS(IXML_Element* element,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlElement_setAttributeNS(IXML_Element* element,
/** The {\bf Element} on which to set the
attribute. */
@ -1361,7 +1372,7 @@ ixmlElement_setAttributeNS(IXML_Element* element,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlElement_removeAttributeNS(IXML_Element* element,
/** The {\bf Element} from which to remove the
the attribute. */
@ -1376,7 +1387,7 @@ ixmlElement_removeAttributeNS(IXML_Element* element,
* @return [Attr*] A pointer to an {\bf Attr} or {\tt NULL} on an error.
*/
IXML_Attr*
EXPORT_SPEC IXML_Attr*
ixmlElement_getAttributeNodeNS(IXML_Element* element,
/** The {\bf Element} from which to get the
attribute. */
@ -1403,7 +1414,7 @@ ixmlElement_getAttributeNodeNS(IXML_Element* element,
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlElement_setAttributeNodeNS(IXML_Element* element,
/** The {\bf Element} in which to add the
attribute node. */
@ -1422,7 +1433,7 @@ ixmlElement_setAttributeNodeNS(IXML_Element* element,
* {\tt NULL} on an error.
*/
IXML_NodeList*
EXPORT_SPEC IXML_NodeList*
ixmlElement_getElementsByTagNameNS(IXML_Element* element,
/** The {\bf Element} from which to start
the search. */
@ -1442,7 +1453,7 @@ ixmlElement_getElementsByTagNameNS(IXML_Element* element,
* otherwise {\tt FALSE}.
*/
BOOL
EXPORT_SPEC BOOL
ixmlElement_hasAttribute(IXML_Element* element,
/** The {\bf Element} on which to check for an
attribute. */
@ -1458,7 +1469,7 @@ ixmlElement_hasAttribute(IXML_Element* element,
* value for that attribute, otherwise {\tt FALSE}.
*/
BOOL
EXPORT_SPEC BOOL
ixmlElement_hasAttributeNS(IXML_Element* element,
/** The {\bf Element} on which to check for the
attribute. */
@ -1473,7 +1484,7 @@ ixmlElement_hasAttributeNS(IXML_Element* element,
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlElement_free(IXML_Element* element
/** The {\bf Element} to free. */
);
@ -1500,7 +1511,7 @@ ixmlElement_free(IXML_Element* element
* @return [unsigned long] The number of nodes in this map.
*/
unsigned long
EXPORT_SPEC unsigned long
ixmlNamedNodeMap_getLength(IXML_NamedNodeMap *nnMap
/** The {\bf NamedNodeMap} from which to retrieve
the size. */
@ -1511,7 +1522,7 @@ ixmlNamedNodeMap_getLength(IXML_NamedNodeMap *nnMap
* @return [Node*] A {\bf Node} or {\tt NULL} if there is an error.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNamedNodeMap_getNamedItem(IXML_NamedNodeMap *nnMap,
/** The {\bf NamedNodeMap} to search. */
DOMString name
@ -1526,7 +1537,7 @@ ixmlNamedNodeMap_getNamedItem(IXML_NamedNodeMap *nnMap,
* {\bf NamedNodeMap} before.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNamedNodeMap_setNamedItem(IXML_NamedNodeMap *nnMap,
/** The {\bf NamedNodeMap} in which to add the
new {\bf Node}. */
@ -1541,7 +1552,7 @@ ixmlNamedNodeMap_setNamedItem(IXML_NamedNodeMap *nnMap,
* it wasn't.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNamedNodeMap_removeNamedItem(IXML_NamedNodeMap *nnMap,
/** The {\bf NamedNodeMap} from which to
remove the item. */
@ -1556,7 +1567,7 @@ ixmlNamedNodeMap_removeNamedItem(IXML_NamedNodeMap *nnMap,
* it wasn't.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNamedNodeMap_item(IXML_NamedNodeMap *nnMap,
/** The {\bf NamedNodeMap} from which to remove the
{\bf Node}. */
@ -1573,7 +1584,7 @@ ixmlNamedNodeMap_item(IXML_NamedNodeMap *nnMap,
* it wasn't
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNamedNodeMap_getNamedItemNS(IXML_NamedNodeMap *nnMap,
/** The {\bf NamedNodeMap} from which to
remove the {\bf Node}. */
@ -1593,7 +1604,7 @@ ixmlNamedNodeMap_getNamedItemNS(IXML_NamedNodeMap *nnMap,
* {\bf NamedNodeMap} before.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNamedNodeMap_setNamedItemNS(IXML_NamedNodeMap *nnMap,
/** The {\bf NamedNodeMap} in which to add
the {\bf Node}. */
@ -1608,7 +1619,7 @@ ixmlNamedNodeMap_setNamedItemNS(IXML_NamedNodeMap *nnMap,
* it wasn't.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNamedNodeMap_removeNamedItemNS(IXML_NamedNodeMap *nnMap,
/** The {\bf NamedNodeMap} from which to
remove the {\bf Node}. */
@ -1626,7 +1637,7 @@ ixmlNamedNodeMap_removeNamedItemNS(IXML_NamedNodeMap *nnMap,
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlNamedNodeMap_free(IXML_NamedNodeMap *nnMap
/** The {\bf NamedNodeMap to free}. */
);
@ -1655,7 +1666,7 @@ ixmlNamedNodeMap_free(IXML_NamedNodeMap *nnMap
* error.
*/
IXML_Node*
EXPORT_SPEC IXML_Node*
ixmlNodeList_item(IXML_NodeList *nList,
/** The {\bf NodeList} from which to retrieve the {\bf
Node}. */
@ -1668,7 +1679,7 @@ ixmlNodeList_item(IXML_NodeList *nList,
* @return [unsigned long] The number of {\bf Nodes} in the {\bf NodeList}.
*/
unsigned long
EXPORT_SPEC unsigned long
ixmlNodeList_length(IXML_NodeList *nList
/** The {\bf NodeList} for which to retrieve the
number of {\bf Nodes}. */
@ -1681,7 +1692,7 @@ ixmlNodeList_length(IXML_NodeList *nList
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlNodeList_free(IXML_NodeList *nList
/** The {\bf NodeList} to free. */
);
@ -1732,12 +1743,10 @@ ixmlPrintDocument(IXML_Document *doc);
* is no longer required.
*
* Note that this function can be used for any {\bf Node}-derived
* interface. The difference between {\bf ixmlPrintNode} and
* {\bf ixmlPrintDocument} is {\bf ixmlPrintNode} does not include
* the XML prolog, it only produces XML elements.
*
* This function introduces lots of white space to print the
* {\bf DOMString} in readable format.
* interface. A similar {\bf ixmlPrintDocument} function is defined
* to avoid casting when printing whole documents. This function
* introduces lots of white space to print the {\bf DOMString} in readable
* format.
*
* @return [DOMString] A {\bf DOMString} with the XML text representation
* of the DOM tree or {\tt NULL} on an error.
@ -1781,7 +1790,7 @@ ixmlDocumenttoString(IXML_Document *doc);
* of the DOM tree or {\tt NULL} on an error.
*/
DOMString
EXPORT_SPEC DOMString
ixmlNodetoString(IXML_Node *doc
/** The root of the {\bf Node} tree to render to XML text. */
);
@ -1805,7 +1814,7 @@ ixmlRelaxParser(char errorChar);
* @return [Document*] A {\bf Document} if the buffer correctly parses or
* {\tt NULL} on an error.
*/
IXML_Document*
EXPORT_SPEC IXML_Document*
ixmlParseBuffer(char *buffer
/** The buffer that contains the XML text to convert to a
{\bf Document}. */
@ -1828,7 +1837,7 @@ ixmlParseBuffer(char *buffer
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlParseBufferEx(char *buffer,
/** The buffer that contains the XML text to convert to a
{\bf Document}. */
@ -1843,7 +1852,7 @@ ixmlParseBufferEx(char *buffer,
* {\tt NULL} on an error.
*/
IXML_Document*
EXPORT_SPEC IXML_Document*
ixmlLoadDocument(char* xmlFile
/** The filename of the XML text to convert to a {\bf
Document}. */
@ -1865,7 +1874,7 @@ ixmlLoadDocument(char* xmlFile
* \end{itemize}
*/
int
EXPORT_SPEC int
ixmlLoadDocumentEx(char* xmlFile,
/** The filename of the XML text to convert to a {\bf
Document}. */
@ -1881,7 +1890,7 @@ ixmlLoadDocumentEx(char* xmlFile,
* be completed.
*/
DOMString
EXPORT_SPEC DOMString
ixmlCloneDOMString(const DOMString src
/** The source {\bf DOMString} to clone. */
);
@ -1891,7 +1900,7 @@ ixmlCloneDOMString(const DOMString src
* @return [void] This function does not return a value.
*/
void
EXPORT_SPEC void
ixmlFreeDOMString(DOMString buf
/** The {\bf DOMString} to free. */
);

View File

@ -38,7 +38,9 @@
#define MINVAL( a, b ) ( (a) < (b) ? (a) : (b) )
#define MAXVAL( a, b ) ( (a) > (b) ? (a) : (b) )
#define XINLINE inline
#ifndef WIN32
#define XINLINE inline
#endif
#define MEMBUF_DEF_SIZE_INC 20

View File

@ -32,6 +32,10 @@
#include <string.h>
#include "ixmlparser.h"
#ifdef WIN32
#define strncasecmp strnicmp
#endif
static char g_error_char = '\0';
static const char LESSTHAN = '<';
@ -1712,11 +1716,13 @@ Parser_xmlNamespace( IN Parser * xmlParser,
if( pCur->namespaceUri != NULL ) {
free( pCur->namespaceUri );
}
pCur->namespaceUri = strdup( newNode->nodeValue );
if( pCur->namespaceUri == NULL ) {
return IXML_INSUFFICIENT_MEMORY;
}
///here it goes to segfault on "" when not copying
if(newNode->nodeValue){
pCur->namespaceUri = strdup( newNode->nodeValue );
if( pCur->namespaceUri == NULL ) {
return IXML_INSUFFICIENT_MEMORY;
}
}
} else if( strncmp( newNode->nodeName, "xmlns:", strlen( "xmlns:" ) ) == 0 ) { // namespace definition
rc = Parser_setNodePrefixAndLocalName( newNode );
@ -2458,7 +2464,8 @@ Parser_getNextNode( IN Parser * xmlParser,
*bETag = TRUE;
return IXML_SUCCESS;
} else if( xmlParser->state == eATTRIBUTE ) {
} else if( (xmlParser->state == eATTRIBUTE) &&
(xmlParser->pCurElement != NULL) ) {
if( Parser_processAttribute( xmlParser, node ) !=
IXML_SUCCESS ) {
return IXML_SYNTAX_ERR;

View File

@ -929,6 +929,7 @@ ixmlNode_cloneElement( IN IXML_Element * nodeptr )
rc = ixmlElement_setTagName( newElement, nodeptr->tagName );
if( rc != IXML_SUCCESS ) {
ixmlElement_free( newElement );
return NULL;
}
elementNode = ( IXML_Node * ) newElement;
@ -936,26 +937,31 @@ ixmlNode_cloneElement( IN IXML_Element * nodeptr )
rc = ixmlNode_setNodeName( elementNode, srcNode->nodeName );
if( rc != IXML_SUCCESS ) {
ixmlElement_free( newElement );
return NULL;
}
rc = ixmlNode_setNodeValue( elementNode, srcNode->nodeValue );
if( rc != IXML_SUCCESS ) {
ixmlElement_free( newElement );
return NULL;
}
rc = ixmlNode_setNamespaceURI( elementNode, srcNode->namespaceURI );
if( rc != IXML_SUCCESS ) {
ixmlElement_free( newElement );
return NULL;
}
rc = ixmlNode_setPrefix( elementNode, srcNode->prefix );
if( rc != IXML_SUCCESS ) {
ixmlElement_free( newElement );
return NULL;
}
rc = ixmlNode_setLocalName( elementNode, srcNode->localName );
if( rc != IXML_SUCCESS ) {
ixmlElement_free( newElement );
return NULL;
}
elementNode->nodeType = eELEMENT_NODE;
@ -1247,6 +1253,10 @@ ixmlNode_cloneNodeTree( IN IXML_Node * nodeptr,
case eDOCUMENT_TYPE_NODE:
case eDOCUMENT_FRAGMENT_NODE:
case eNOTATION_NODE:
/* create a new node here? newNode = (IXML_Node *)malloc(sizeof(IXML_Node));
if( newNode == NULL ) {
return NULL;
}*/
break;
}

View File

@ -75,6 +75,8 @@ ixmlNodeList_item( IXML_NodeList * nList,
next = next->next;
}
if( next == NULL ) return NULL;
return next->nodeItem;
}

View File

@ -0,0 +1,162 @@
/* autoconfig.h. Generated by configure. */
/* autoconfig.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 to compile debug code */
/* #undef DEBUG */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
/* #undef HAVE_DOPRNT */
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define if you have POSIX threads libraries and header files. */
#define HAVE_PTHREAD 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <syslog.h> header file. */
#define HAVE_SYSLOG_H 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/timeb.h> header file. */
#define HAVE_SYS_TIMEB_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vprintf' function. */
#define HAVE_VPRINTF 1
/* Define to 1 to prevent compilation of assert() */
#define NDEBUG 1
/* Define to 1 to prevent some debug code */
#define NO_DEBUG 1
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
/* #undef NO_MINUS_C_MINUS_O */
/* Name of package */
#define PACKAGE "libupnp"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "virtual_worlds@gmx.de"
/* Define to the full name of this package. */
#define PACKAGE_NAME "libupnp"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libupnp 1.4.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libupnp"
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.4.0"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
/* #undef PTHREAD_CREATE_JOINABLE */
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* see upnpconfig.h */
#define UPNP_HAVE_CLIENT 1
/* see upnpconfig.h */
/* #undef UPNP_HAVE_DEBUG */
/* see upnpconfig.h */
#define UPNP_HAVE_DEVICE 1
/* see upnpconfig.h */
#define UPNP_HAVE_TOOLS 1
/* see upnpconfig.h */
#define UPNP_HAVE_WEBSERVER 1
/* see upnpconfig.h */
#define UPNP_VERSION_MAJOR 1
/* see upnpconfig.h */
#define UPNP_VERSION_MINOR 4
/* see upnpconfig.h */
#define UPNP_VERSION_PATCH 0
/* see upnpconfig.h */
#define UPNP_VERSION_STRING "1.4.0"
/* Version number of package */
#define VERSION "1.4.0"
/* Number of bits in a file offset, on hosts where this is settable. */
#define _FILE_OFFSET_BITS 64
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
/* #undef _LARGEFILE_SOURCE */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `unsigned' if <sys/types.h> does not define. */
/* #undef size_t */
/* Substitute for socklen_t */
/* #undef socklen_t */

362
libupnp/build/inc/config.h Normal file
View File

@ -0,0 +1,362 @@
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000-2003 Intel Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////
#ifndef INTERNAL_CONFIG_H
#define INTERNAL_CONFIG_H
#include "autoconfig.h"
/** @name Compile time configuration options
* The Linux SDK for UPnP Devices contains some compile-time parameters
* that effect the behavior of the SDK. All configuration options are
* located in {\tt src/inc/config.h}.
*/
//@{
/** @name THREAD_IDLE_TIME
* The {\tt THREAD_IDLE_TIME} constant determines when a thread will be
* removed from the thread pool and returned to the operating system. When
* a thread in the thread pool has been idle for this number of milliseconds
* the thread will be released from the thread pool. The default value is
* 5000 milliseconds (5 seconds).
*/
//@{
#define THREAD_IDLE_TIME 5000
//@}
/** @name JOBS_PER_THREAD
* The {\tt JOBS_PER_THREAD} constant determines when a new thread will be
* allocated to the thread pool inside the SDK. The thread pool will
* try and maintain this jobs/thread ratio. When the jobs/thread ratio
* becomes greater than this, then a new thread (up to the max) will be
* allocated to the thread pool. The default ratio is 10 jobs/thread.
*/
//@{
#define JOBS_PER_THREAD 10
//@}
/** @name MIN_THREADS
* The {\tt MIN_THREADS} constant defines the minimum number of threads the
* thread pool inside the SDK will create. The thread pool will
* always have this number of threads. These threads are used
* for both callbacks into applications built on top of the SDK and also
* for making connections to other control points and devices. This number
* includes persistent threads. The default value is two threads.
*/
//@{
#define MIN_THREADS 2
//@}
/** @name MAX_THREADS
* The {\tt MAX_THREADS} constant defines the maximum number of threads the
* thread pool inside the SDK will create. These threads are used
* for both callbacks into applications built on top of the library and also
* for making connections to other control points and devices. It is not
* recommended that this value be below 10, since the threads are
* necessary for correct operation. This value can be increased for greater
* performance in operation at the expense of greater memory overhead. The
* default value is 12.
*/
//@{
#define MAX_THREADS 12
//@}
/** @name DEFAULT_SOAP_CONTENT_LENGTH
* SOAP messages will read at most {\tt DEFAULT_SOAP_CONTENT_LENGTH} bytes.
* This prevents devices that have a misbehaving web server to send
* a large amount of data to the control point causing it to crash.
* This can be adjusted dynamically with {\tt UpnpSetMaxContentLength}.
*/
//@{
#define DEFAULT_SOAP_CONTENT_LENGTH 16000
//@}
/** @name NUM_SSDP_COPY
* This configuration parameter determines how many copies of each SSDP
* advertisement and search packets will be sent. By default it will send two
* copies of every packet.
*/
//@{
#define NUM_SSDP_COPY 2
//@}
/** @name SSDP_PAUSE
* This configuration parameter determines the pause between identical SSDP
* advertisement and search packets. The pause is measured in milliseconds
* and defaults to 100.
*/
//@{
#define SSDP_PAUSE 100
//@}
/** @name WEB_SERVER_BUF_SIZE
* This configuration parameter sets the maximum buffer size for the
* webserver. The default value is 1MB.
*/
//@{
#define WEB_SERVER_BUF_SIZE (1024*1024)
//@}
/** @name AUTO_RENEW_TIME
* The {\tt AUTO_RENEW_TIME} is the time, in seconds, before a subscription
* expires that the SDK automatically resubscribes. The default
* value is 10 seconds. Setting this value too low can result in the
* subscription renewal not making it to the device in time, causing the
* subscription to timeout. In order to avoid continually resubscribing
* the minimum subscription time is five seconds more than the auto renew
* time.
*/
//@{
#define AUTO_RENEW_TIME 10
//@}
/** @name CP_MINIMUM_SUBSCRIPTION_TIME
* The {\tt CP_MINIMUM_SUBSCRIPTION_TIME} is the minimum subscription time
* allowed for a control point using the SDK. Subscribing for less than
* this time automatically results in a subscription for this amount. The
* default value is 5 seconds more than the {\tt AUTO_RENEW_TIME}, or 15
* seconds.
*/
//@{
#define CP_MINIMUM_SUBSCRIPTION_TIME (AUTO_RENEW_TIME + 5)
//@}
/** @name MAX_SEARCH_TIME
* The {\tt MAX_SEARCH_TIME} is the maximum time
* allowed for an SSDP search by a control point. Searching for greater than
* this time automatically results in a search for this amount. The default
* value is 80 seconds.
*/
//@{
#define MAX_SEARCH_TIME 80
//@}
/** @name MIN_SEARCH_TIME
* The {\tt MIN_SEARCH_TIME} is the minimumm time
* allowed for an SSDP search by a control point. Searching for less than
* this time automatically results in a search for this amount. The default
* value is 2 seconds.
*/
//@{
#define MIN_SEARCH_TIME 2
//@}
/** @name AUTO_ADVERTISEMENT_TIME
* The {\tt AUTO_ADVERTISEMENT_TIME} is the time, in seconds, before an
* device advertisements expires before a renewed advertisement is sent.
* The default time is 30 seconds.
*/
//@{
#define AUTO_ADVERTISEMENT_TIME 30
//@}
/** @name SSDP_PACKET_DISTRIBUTE
* The {\tt SSDP_PACKET_DISTRIBUTE} enables the SSDP packets to be sent
* at an interval equal to half of the expiration time of SSDP packets
* minus the AUTO_ADVERTISEMENT_TIME. This is used to increase
* the probability of SSDP packets reaching to control points.
* It is recommended that this flag be turned on for embedded wireless
* devices.
*/
//@{
#define SSDP_PACKET_DISTRIBUTE 1
//@}
/** @name Module Exclusion
* Depending on the requirements, the user can selectively discard any of
* the major modules like SOAP, GENA, SSDP or the Internal web server. By
* default everything is included inside the SDK. By setting any of
* the values below to 0, that component will not be included in the final
* SDK.
* \begin{itemize}
* \item {\tt EXCLUDE_SOAP[0,1]}
* \item {\tt EXCLUDE_GENA[0,1]}
* \item {\tt EXCLUDE_SSDP[0,1]}
* \item {\tt EXCLUDE_DOM [0,1]}
* \item {\tt EXCLUDE_MINISERVER[0,1]}
* \item {\tt EXCLUDE_WEB_SERVER[0,1]}
* \item {\tt EXCLUDE_JNI[0,1]}
* \end{itemize}
*
*/
//@{
#define EXCLUDE_SSDP 0
#define EXCLUDE_SOAP 0
#define EXCLUDE_GENA 0
#define EXCLUDE_DOM 0
#define EXCLUDE_MINISERVER 0
#define EXCLUDE_WEB_SERVER 0
#ifdef USE_JNI
# define EXCLUDE_JNI 0
#else
# define EXCLUDE_JNI 1
#endif
//@}
/** @name DEBUG_TARGET
* The user has the option to redirect the library output debug messages
* to either the screen or to a log file. All the output messages with
* debug level 0 will go to {\tt upnp.err} and messages with debug level
* greater than zero will be redirected to {\tt upnp.out}.
*/
//@{
#define DEBUG_TARGET 1
//@}
/** @name Other debugging features
The UPnP SDK contains other features to aid in debugging:
see <upnp/upnpdebug.h>
*/
#define DEBUG_ALL 1
#define DEBUG_SSDP 0
#define DEBUG_SOAP 0
#define DEBUG_GENA 0
#define DEBUG_TPOOL 0
#define DEBUG_MSERV 0
#define DEBUG_DOM 0
#define DEBUG_HTTP 0
#define DEBUG_API 0
//@} // Compile time configuration options
/***************************************************************************
* Do not change, Internal purpose only!!!
***************************************************************************/
//@{
/*
* Set additional defines based on requested configuration
*/
// configure --enable-client
#if UPNP_HAVE_CLIENT
# define INCLUDE_CLIENT_APIS 1
#endif
// configure --enable-device
#if UPNP_HAVE_DEVICE
# define INCLUDE_DEVICE_APIS 1
#endif
// configure --enable-webserver --enable-device
#if UPNP_HAVE_WEBSERVER
# define INTERNAL_WEB_SERVER 1
#endif
/** @name DBGONLY
The {\bf DBGONLY} macro allows code to be marked so that it
is only included in the DEBUG build and not the release. To
use this macro, put the code inside of the parentheses:
{\tt DBGONLY(int i;)}
This will cause a declaration of the integer {\tt i} only
in the debug build.
*/
//@{
#ifndef WIN32
#ifdef DEBUG
# define DBGONLY(x) x
#else
# define DBGONLY(x)
#endif
#endif
//@}
#undef EXCLUDE_WEB_SERVER
#undef EXCLUDE_MINISERVER
#ifdef INTERNAL_WEB_SERVER
# define EXCLUDE_WEB_SERVER 0
# define EXCLUDE_MINISERVER 0
#else
# define EXCLUDE_WEB_SERVER 1
# define EXCLUDE_MINISERVER 1
#endif
#if EXCLUDE_GENA == 1 && EXCLUDE_SOAP == 1 && EXCLUDE_WEB_SERVER == 1
# undef EXCLUDE_MINISERVER
# define EXCLUDE_MINISERVER 1
# if INTERNAL_WEB_SERVER
# error "conflicting settings: use configure --disable-webserver"
# endif
#endif
#if EXCLUDE_GENA == 0 || EXCLUDE_SOAP == 0 || EXCLUDE_WEB_SERVER == 0
# undef EXCLUDE_MINISERVER
# define EXCLUDE_MINISERVER 0
# if EXCLUDE_WEB_SERVER == 0 && !defined INTERNAL_WEB_SERVER
# error "conflicting settings : use configure --enable-webserver"
# endif
#endif
#ifdef INCLUDE_CLIENT_APIS
# define CLIENTONLY(x) x
#else
# define CLIENTONLY(x)
#endif
#ifdef INCLUDE_DEVICE_APIS
# define DEVICEONLY(x) x
#else
# define DEVICEONLY(x)
#endif
//@}
#endif

View File

@ -0,0 +1,97 @@
/* upnp/inc/upnpconfig.h. Generated by configure. */
// -*- C -*-
///////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2006 Rémi Turboult <r3mi@users.sourceforge.net>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither name of Intel Corporation nor the names of its contributors
// may be used to endorse or promote products derived from this software
// without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
///////////////////////////////////////////////////////////////////////////
#ifndef UPNP_CONFIG_H
#define UPNP_CONFIG_H
/***************************************************************************
* Library version
***************************************************************************/
/** The library version (string) e.g. "1.3.0" */
#define UPNP_VERSION_STRING "1.4.0"
/** Major version of the library */
#define UPNP_VERSION_MAJOR 1
/** Minor version of the library */
#define UPNP_VERSION_MINOR 4
/** Patch version of the library */
#define UPNP_VERSION_PATCH 0
/** The library version (numeric) e.g. 10300 means version 1.3.0 */
#define UPNP_VERSION \
((UPNP_VERSION_MAJOR*100 + UPNP_VERSION_MINOR)*100 + UPNP_VERSION_PATCH)
/***************************************************************************
* Library optional features
***************************************************************************/
/*
* The following defines can be tested in order to know which
* optional features have been included in the installed library.
*/
/** Defined to 1 if the library has been compiled with DEBUG enabled
* (i.e. configure --enable-debug) : <upnp/upnpdebug.h> file is available */
#undef UPNP_HAVE_DEBUG
/** Defined to 1 if the library has been compiled with client API enabled
* (i.e. configure --enable-client) */
#define UPNP_HAVE_CLIENT 1
/** Defined to 1 if the library has been compiled with device API enabled
* (i.e. configure --enable-device) */
#define UPNP_HAVE_DEVICE 1
/** Defined to 1 if the library has been compiled with integrated web server
* (i.e. configure --enable-webserver --enable-device) */
#define UPNP_HAVE_WEBSERVER 1
/** Defined to 1 if the library has been compiled with helper API
* (i.e. configure --enable-tools) : <upnp/upnptools.h> file is available */
#define UPNP_HAVE_TOOLS 1
#endif // UPNP_CONFIG_H

View File

@ -78,10 +78,12 @@ typedef enum priority {LOW_PRIORITY,
#endif
//DEBUGGING
#ifdef DEBUG
#define DBGONLY(x) x
#else
#define DBGONLY(x)
#ifndef WIN32
#ifdef DEBUG
#define DBGONLY(x) x
#else
#define DBGONLY(x)
#endif
#endif
#include "LinkedList.h"

View File

@ -43,7 +43,9 @@ extern "C" {
#endif
#include <pthread.h>
#include <unistd.h>
#ifndef WIN32
#include <unistd.h>
#endif
#define ITHREAD_MUTEX_FAST_NP PTHREAD_MUTEX_FAST_NP
#define ITHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE_NP
@ -524,10 +526,20 @@ extern "C" {
*****************************************************************************/
#define imillisleep(x) usleep(1000*x)
#ifdef WIN32
#ifdef LIBUPNP_EXPORTS
// set up declspec for dll export to make functions visible to library users
#define EXPORT_SPEC __declspec(dllexport)
#else
#define EXPORT_SPEC __declspec(dllimport)
#endif
#else
#define EXPORT_SPEC
#endif
//NK: Added for satisfying the gcc compiler
int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
#ifdef __cplusplus
}

View File

@ -30,7 +30,11 @@
///////////////////////////////////////////////////////////////////////////
#include "LinkedList.h"
#ifdef __FreeBSD__
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include <assert.h>
static int

View File

@ -92,11 +92,15 @@ FreeThreadPoolJob( ThreadPool * tp,
static int
SetPolicyType( PolicyType in )
{
struct sched_param current;
#ifdef WIN32
return sched_setscheduler( 0, in);
#else
struct sched_param current;
sched_getparam( 0, &current );
current.sched_priority = DEFAULT_SCHED_PARAM;
return sched_setscheduler( 0, in, &current );
sched_getparam( 0, &current );
current.sched_priority = DEFAULT_SCHED_PARAM;
return sched_setscheduler( 0, in, &current );
#endif
}
/****************************************************************************
@ -341,7 +345,13 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
struct timeb t;
ftime( &t );
#if defined(WIN32)
srand( ( unsigned int )t.millitm + (unsigned int)ithread_get_current_thread_id( ).p );
#elif defined(__FreeBSD__)
srand( ( unsigned int )t.millitm + (unsigned int)ithread_get_current_thread_id( ) );
#else
srand( ( unsigned int )t.millitm + ithread_get_current_thread_id( ) );
#endif
}
/****************************************************************************
@ -1455,7 +1465,11 @@ tp->stats.totalJobsLQ++; tp->stats.totalTimeLQ += diff; break; default:
assert( stats != NULL ); if( stats == NULL ) {
return;}
#ifdef __FreeBSD__
printf( "ThreadPoolStats at Time: %d\n", time( NULL ) );
#else
printf( "ThreadPoolStats at Time: %ld\n", time( NULL ) );
#endif
printf
( "Average Wait in High Priority Q in milliseconds: %lf\n",
stats->avgWaitHQ );

View File

@ -31,7 +31,11 @@
#include <stdarg.h>
#include <assert.h>
#ifdef __FreeBSD__
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include <stdio.h>
#include "iasnprintf.h"
@ -39,6 +43,10 @@
#define NULL 0
#endif
#ifdef WIN32
#define vsnprintf _vsnprintf
#endif
/**
* Allocates enough memory for the
* Formatted string, up to max
@ -64,6 +72,8 @@ iasnprintf( char **ret,
assert( fmt );
( *ret ) = ( char * )malloc( incr );
if( ( *ret ) == NULL ) return -1;
while( 1 ) {
va_start( ap, fmt );
retc = vsnprintf( ( *ret ), size, fmt, ap );

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More