From aec58e6c9e0b7761bc6ad770b1560ed0d4d710ed Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Tue, 13 Feb 2007 13:53:24 +0000 Subject: [PATCH] Merge of trunk. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/branches/branch-1.4.x@133 119443c7-1b9e-41f8-b6fc-b9c35fce742c --- upnp/src/api/upnpapi.c | 95 ++++++++++++++++++++++-------------------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c index b83c7d6..d447bed 100644 --- a/upnp/src/api/upnpapi.c +++ b/upnp/src/api/upnpapi.c @@ -3713,8 +3713,6 @@ FreeHandle( int Upnp_Handle ) } /****************** End of FreeHandle *********************/ -// **DBG**************************************************** -//DBGONLY( /************************************************************************** * Function: PrintHandleInfo @@ -3728,56 +3726,61 @@ FreeHandle( int Upnp_Handle ) * Return Values: int * UPNP_E_SUCCESS if successful else return appropriate error ***************************************************************************/ - int PrintHandleInfo( IN UpnpClient_Handle Hnd ) { - struct Handle_Info * HndInfo; if( HandleTable[Hnd] != NULL ) { - HndInfo = HandleTable[Hnd]; - DBGONLY( UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, - "Printing information for Handle_%d\n", - Hnd ); - UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, - "HType_%d\n", HndInfo->HType ); - DEVICEONLY( - if( HndInfo->HType != - HND_CLIENT ) UpnpPrintf( UPNP_ALL, API, __FILE__, - __LINE__, "DescURL_%s\n", - HndInfo->DescURL ); ) - ) - } - else - { - return UPNP_E_INVALID_HANDLE;} +int PrintHandleInfo( IN UpnpClient_Handle Hnd ) +{ + struct Handle_Info * HndInfo; + if (HandleTable[Hnd] != NULL) { + HndInfo = HandleTable[Hnd]; + DBGONLY( + UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, + "Printing information for Handle_%d\n", Hnd); + UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, + "HType_%d\n", HndInfo->HType); + DEVICEONLY( + if(HndInfo->HType != HND_CLIENT) + UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, + "DescURL_%s\n", HndInfo->DescURL ); + ) + ) + } else { + return UPNP_E_INVALID_HANDLE; + } + + return UPNP_E_SUCCESS; +} - return UPNP_E_SUCCESS;} /****************** End of PrintHandleInfo *********************/ - void printNodes( IXML_Node * tmpRoot, int depth ) { - int i; - IXML_NodeList * NodeList1; - IXML_Node * ChildNode1; - unsigned short NodeType; - const DOMString NodeValue; - const DOMString NodeName; - NodeList1 = ixmlNode_getChildNodes( tmpRoot ); - for( i = 0; i < 100; i++ ) { - ChildNode1 = ixmlNodeList_item( NodeList1, i ); - if( ChildNode1 == NULL ) { - break;} +void printNodes( IXML_Node * tmpRoot, int depth ) +{ + int i; + IXML_NodeList *NodeList1; + IXML_Node *ChildNode1; + unsigned short NodeType; + const DOMString NodeValue; + const DOMString NodeName; + NodeList1 = ixmlNode_getChildNodes(tmpRoot); + for (i = 0; i < 100; ++i) { + ChildNode1 = ixmlNodeList_item(NodeList1, i); + if (ChildNode1 == NULL) { + break; + } + + printNodes(ChildNode1, depth+1); + NodeType = ixmlNode_getNodeType(ChildNode1); + NodeValue = ixmlNode_getNodeValue(ChildNode1); + NodeName = ixmlNode_getNodeName(ChildNode1); + DBGONLY( + UpnpPrintf(UPNP_ALL, API, __FILE__, __LINE__, + "DEPTH-%2d-IXML_Node Type %d, " + "IXML_Node Name: %s, IXML_Node Value: %s\n", + depth, NodeType, NodeName, NodeValue); + ) + } +} - printNodes( ChildNode1, depth + 1 ); - NodeType = ixmlNode_getNodeType( ChildNode1 ); - NodeValue = ixmlNode_getNodeValue( ChildNode1 ); - NodeName = ixmlNode_getNodeName( ChildNode1 ); - DBGONLY( UpnpPrintf( UPNP_ALL, API, __FILE__, __LINE__, - "DEPTH-%2d-IXML_Node Type %d, " - "IXML_Node Name: %s, IXML_Node Value: %s\n", - depth, NodeType, NodeName, NodeValue ); ) - } - - } /****************** End of printNodes *********************/ -// ) // dbgonly - //******************************************************** //* Name: getlocalhostname //* Description: Function to get local IP address