From a8521c09cf08d7b89ef0a6b4a068ec0f7d487c86 Mon Sep 17 00:00:00 2001 From: Marcelo Roberto Jimenez Date: Mon, 26 May 2008 02:19:24 +0000 Subject: [PATCH] More doxygen. Now some gena files are documented. git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@394 119443c7-1b9e-41f8-b6fc-b9c35fce742c --- Doxyfile | 4 +- upnp/inc/upnp.h | 6 +-- upnp/src/gena/gena_ctrlpt.c | 5 +++ upnp/src/gena/gena_device.c | 82 +++++++++++++++++++------------------ upnp/src/inc/gena.h | 13 +++--- 5 files changed, 60 insertions(+), 50 deletions(-) diff --git a/Doxyfile b/Doxyfile index 39d1a11..bc7aff1 100644 --- a/Doxyfile +++ b/Doxyfile @@ -995,7 +995,7 @@ ENABLE_PREPROCESSING = YES # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. -MACRO_EXPANSION = NO +MACRO_EXPANSION = YES # 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 @@ -1029,7 +1029,7 @@ INCLUDE_FILE_PATTERNS = # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = DEBUG +PREDEFINED = DEBUG INCLUDE_DEVICE_APIS INCLUDE_CLIENT_APIS EXCLUDE_GENA=0 # 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. diff --git a/upnp/inc/upnp.h b/upnp/inc/upnp.h index 5465459..f65ed5b 100644 --- a/upnp/inc/upnp.h +++ b/upnp/inc/upnp.h @@ -1295,14 +1295,13 @@ EXPORT_SPEC int UpnpSendAdvertisement( * \brief Queries the state of a state variable of a service on another device. * * \deprecated + * The use of this function is deprecated by the UPnP Forum. * * This is a synchronous call. * * A positive return value indicates a SOAP error code, whereas a negative * return code indicates an SDK error code. * - * Note that the use of this function is deprecated by the UPnP Forum. - * * \return An integer representing one of the following: * \li \c UPNP_E_SUCCESS: The operation completed successfully. * \li \c UPNP_E_INVALID_HANDLE: The handle is not a valid control @@ -1335,8 +1334,7 @@ EXPORT_SPEC int UpnpGetServiceVarStatus( * when the operation is complete. * * \deprecated - * - * Note that the use of this function is deprecated by the UPnP Forum. + * The use of this function is deprecated by the UPnP Forum. * * \return An integer representing one of the following: * \li \c UPNP_E_SUCCESS: The operation completed successfully. diff --git a/upnp/src/gena/gena_ctrlpt.c b/upnp/src/gena/gena_ctrlpt.c index 5ef5458..4ab6265 100644 --- a/upnp/src/gena/gena_ctrlpt.c +++ b/upnp/src/gena/gena_ctrlpt.c @@ -33,6 +33,11 @@ #include "config.h" +/*! + * \file + */ + + #if EXCLUDE_GENA == 0 #ifdef INCLUDE_CLIENT_APIS diff --git a/upnp/src/gena/gena_device.c b/upnp/src/gena/gena_device.c index 797605d..e660cee 100644 --- a/upnp/src/gena/gena_device.c +++ b/upnp/src/gena/gena_device.c @@ -33,6 +33,11 @@ #include "config.h" +/*! + * \file + */ + + #if EXCLUDE_GENA == 0 #ifdef INCLUDE_DEVICE_APIS @@ -82,8 +87,8 @@ int genaUnregisterDevice( * * \return UPNP_E_SUCCESS if successful else returns GENA_E_BAD_HANDLE. * - * \note XML_VERSION comment is NOT sent due to interop issues with other - * UPnP vendors. + * \note The XML_VERSION comment is NOT sent due to interoperability issues + * with other UPnP vendors. */ static int GeneratePropertySet( /*! [in] Array of variable names (go in the event notify). */ @@ -95,45 +100,44 @@ static int GeneratePropertySet( /*! [out] PropertySet node in the string format. */ OUT DOMString *out) { - char *buffer; - int counter = 0; - int size = 0; - int temp_counter = 0; + char *buffer; + int counter = 0; + int size = 0; + int temp_counter = 0; - //size+=strlen(XML_VERSION); the XML_VERSION is not interopeable with - //other vendors - size += strlen( XML_PROPERTYSET_HEADER ); - size += strlen( "\n\n" ); + /*size += strlen(XML_VERSION);*/ + size += strlen(XML_PROPERTYSET_HEADER); + size += strlen("\n\n"); + for (temp_counter = 0, counter = 0; counter < count; counter++) { + size += strlen( "\n\n" ); + size += 2 * strlen(names[counter]) + + strlen(values[counter]) + + strlen("<>\n"); + } - for( temp_counter = 0, counter = 0; counter < count; counter++ ) { - size += strlen( "\n\n" ); - size += - ( 2 * strlen( names[counter] ) + strlen( values[counter] ) + - ( strlen( "<>\n" ) ) ); + buffer = (char *)malloc(size + 1); + if (buffer == NULL) { + return UPNP_E_OUTOF_MEMORY; + } + memset(buffer, 0, size + 1); + /* + strcpy(buffer,XML_VERSION); + strcat(buffer, XML_PROPERTYSET_HEADER); + */ + strcpy(buffer, XML_PROPERTYSET_HEADER); + for (counter = 0; counter < count; counter++) { + strcat(buffer, "\n"); + sprintf(&buffer[strlen(buffer)], + "<%s>%s\n\n", + names[counter], + values[counter], + names[counter]); + } + strcat(buffer, "\n\n"); + *out = ixmlCloneDOMString(buffer); + free(buffer); - } - buffer = ( char * )malloc( size + 1 ); - - if( buffer == NULL ) { - return UPNP_E_OUTOF_MEMORY; - } - memset( buffer, 0, size + 1 ); - - //strcpy(buffer,XML_VERSION); the XML_VERSION is not interopeable with - //other vendors - strcpy( buffer, XML_PROPERTYSET_HEADER ); - - for( counter = 0; counter < count; counter++ ) { - strcat( buffer, "\n" ); - sprintf( &buffer[strlen( buffer )], - "<%s>%s\n\n", names[counter], - values[counter], names[counter] ); - } - strcat( buffer, "\n\n" ); - ( *out ) = ixmlCloneDOMString( buffer ); - free( buffer ); - - return XML_SUCCESS; + return XML_SUCCESS; } @@ -253,7 +257,7 @@ static UPNP_INLINE int notify_send_and_recv( * appropriate error code. */ static int genaNotify( - /*! [in] Null terminated, includes all headers (including \r\n) except SID and SEQ. */ + /*! [in] Null terminated, includes all headers (including \\r\\n) except SID and SEQ. */ IN char *headers, /*! [in] The evented XML. */ IN char *propertySet, diff --git a/upnp/src/inc/gena.h b/upnp/src/inc/gena.h index 649813d..a188141 100644 --- a/upnp/src/inc/gena.h +++ b/upnp/src/inc/gena.h @@ -66,15 +66,18 @@ #endif /* __cplusplus */ +/*! + * \brief XML version comment. Not used because it is not interopeable with + * other UPnP vendors. + */ #define XML_VERSION "\n" #define XML_PROPERTYSET_HEADER \ - "\n" + "\n" #define UNABLE_MEMORY "HTTP/1.1 500 Internal Server Error\r\n\r\n" #define UNABLE_SERVICE_UNKNOWN "HTTP/1.1 404 Not Found\r\n\r\n" -#define UNABLE_SERVICE_NOT_ACCEPT \ - "HTTP/1.1 503 Service Not Available\r\n\r\n" +#define UNABLE_SERVICE_NOT_ACCEPT "HTTP/1.1 503 Service Not Available\r\n\r\n" #define NOT_IMPLEMENTED "HTTP/1.1 501 Not Implemented\r\n\r\n" @@ -114,7 +117,7 @@ extern ithread_mutex_t GlobalClientSubscribeMutex; /*! - * Lock the subscription + * \brief Locks the subscription. */ #define SubscribeLock() \ UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__, \ @@ -125,7 +128,7 @@ extern ithread_mutex_t GlobalClientSubscribeMutex; /*! - * Unlock the subscription + * \brief Unlocks the subscription. */ #define SubscribeUnlock() \ UpnpPrintf(UPNP_INFO, GENA, __FILE__, __LINE__, \