Coherent name for the EventSubscribe externally exposed data structure.

git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@364 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez 2008-05-04 01:36:07 +00:00
parent a86a127f44
commit 6b7dc5d340
10 changed files with 77 additions and 77 deletions

View File

@ -11,46 +11,46 @@ extern "C" {
/** Returned along with a {\bf UPNP_EVENT_SUBSCRIBE_COMPLETE} or /** Returned along with a {\bf UPNP_EVENT_SUBSCRIBE_COMPLETE} or
* {\bf UPNP_EVENT_UNSUBSCRIBE_COMPLETE} callback. */ * {\bf UPNP_EVENT_UNSUBSCRIBE_COMPLETE} callback. */
typedef struct {} EventSubscribe; typedef struct {} UpnpEventSubscribe;
#include "String.h" // for UpnpString #include "String.h" // for UpnpString
/** Constructor */ /** Constructor */
EventSubscribe *UpnpEventSubscribe_new(); UpnpEventSubscribe *UpnpEventSubscribe_new();
/** Destructor */ /** Destructor */
void UpnpEventSubscribe_delete(EventSubscribe *p); void UpnpEventSubscribe_delete(UpnpEventSubscribe *p);
/** Copy Constructor */ /** Copy Constructor */
EventSubscribe *UpnpEventSubscribe_dup(const EventSubscribe *p); UpnpEventSubscribe *UpnpEventSubscribe_dup(const UpnpEventSubscribe *p);
/** Assignment operator */ /** Assignment operator */
void UpnpEventSubscribe_assign(EventSubscribe *q, const EventSubscribe *p); void UpnpEventSubscribe_assign(UpnpEventSubscribe *q, const UpnpEventSubscribe *p);
/** The result of the operation. */ /** The result of the operation. */
int UpnpEventSubscribe_get_ErrCode(const EventSubscribe *p); int UpnpEventSubscribe_get_ErrCode(const UpnpEventSubscribe *p);
void UpnpEventSubscribe_set_ErrCode(EventSubscribe *p, int n); void UpnpEventSubscribe_set_ErrCode(UpnpEventSubscribe *p, int n);
/** The actual subscription time (for subscriptions only). */ /** The actual subscription time (for subscriptions only). */
int UpnpEventSubscribe_get_TimeOut(const EventSubscribe *p); int UpnpEventSubscribe_get_TimeOut(const UpnpEventSubscribe *p);
void UpnpEventSubscribe_set_TimeOut(EventSubscribe *p, int n); void UpnpEventSubscribe_set_TimeOut(UpnpEventSubscribe *p, int n);
/** The SID for this subscription. For subscriptions, this only /** The SID for this subscription. For subscriptions, this only
* contains a valid SID if the {\bf Upnp_EventSubscribe.result} field * contains a valid SID if the {\bf Upnp_EventSubscribe.result} field
* contains a {\tt UPNP_E_SUCCESS} result code. For unsubscriptions, * contains a {\tt UPNP_E_SUCCESS} result code. For unsubscriptions,
* this contains the SID from which the subscription is being * this contains the SID from which the subscription is being
* unsubscribed. */ * unsubscribed. */
const UpnpString *UpnpEventSubscribe_get_SID(const EventSubscribe *p); const UpnpString *UpnpEventSubscribe_get_SID(const UpnpEventSubscribe *p);
void UpnpEventSubscribe_set_SID(EventSubscribe *p, const UpnpString *s); void UpnpEventSubscribe_set_SID(UpnpEventSubscribe *p, const UpnpString *s);
void UpnpEventSubscribe_strcpy_SID(EventSubscribe *p, const char *s); void UpnpEventSubscribe_strcpy_SID(UpnpEventSubscribe *p, const char *s);
/** The event URL being subscribed to or removed from. */ /** The event URL being subscribed to or removed from. */
const UpnpString *UpnpEventSubscribe_get_PublisherUrl(const EventSubscribe *p); const UpnpString *UpnpEventSubscribe_get_PublisherUrl(const UpnpEventSubscribe *p);
void UpnpEventSubscribe_set_PublisherUrl(EventSubscribe *p, const UpnpString *s); void UpnpEventSubscribe_set_PublisherUrl(UpnpEventSubscribe *p, const UpnpString *s);
void UpnpEventSubscribe_strcpy_PublisherUrl(EventSubscribe *p, const char *s); void UpnpEventSubscribe_strcpy_PublisherUrl(UpnpEventSubscribe *p, const char *s);

View File

@ -9,6 +9,7 @@ extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
/** Detailed description of this class should go here */
typedef struct {} UpnpFileInfo; typedef struct {} UpnpFileInfo;

View File

@ -652,18 +652,18 @@ enum Upnp_EventType_e {
/** A {\bf UpnpUnSubscribeAsync} call completed. The status of the /** A {\bf UpnpUnSubscribeAsync} call completed. The status of the
* subscription is in the {\bf Event} parameter as a {\bf * subscription is in the {\bf Event} parameter as a {\bf
* EventSubscribe} structure. */ * UpnpEventSubscribe} structure. */
UPNP_EVENT_UNSUBSCRIBE_COMPLETE, UPNP_EVENT_UNSUBSCRIBE_COMPLETE,
/** The auto-renewal of a client subscription failed. /** The auto-renewal of a client subscription failed.
* The {\bf Event} parameter is a {\bf EventSubscribe} structure * The {\bf Event} parameter is a {\bf UpnpEventSubscribe} structure
* with the error code set appropriately. The subscription is no longer * with the error code set appropriately. The subscription is no longer
* valid. */ * valid. */
UPNP_EVENT_AUTORENEWAL_FAILED, UPNP_EVENT_AUTORENEWAL_FAILED,
/** A client subscription has expired. This will only occur /** A client subscription has expired. This will only occur
* if auto-renewal of subscriptions is disabled. * if auto-renewal of subscriptions is disabled.
* The {\bf Event} parameter is a {\bf EventSubscribe} * The {\bf Event} parameter is a {\bf UpnpEventSubscribe}
* structure. The subscription is no longer valid. */ * structure. The subscription is no longer valid. */
UPNP_EVENT_SUBSCRIPTION_EXPIRED UPNP_EVENT_SUBSCRIPTION_EXPIRED
}; };
@ -1676,9 +1676,9 @@ EXPORT_SPEC int UpnpRenewSubscription(
* to expire, generating a callback when the operation is complete. * to expire, generating a callback when the operation is complete.
* *
* Note that many of the error codes for this function are returned in * Note that many of the error codes for this function are returned in
* the {\bf EventSubscribe} structure. In those cases, the function * the {\bf UpnpEventSubscribe} structure. In those cases, the function
* returns {\tt UPNP_E_SUCCESS} and the appropriate error code will * returns {\tt UPNP_E_SUCCESS} and the appropriate error code will
* be in the {\bf EventSubscribe.ErrCode} field in the {\bf Event} * be in the {\bf UpnpEventSubscribe.ErrCode} field in the {\bf Event}
* structure passed to the callback. * structure passed to the callback.
* *
* @return [int] An integer representing one of the following: * @return [int] An integer representing one of the following:
@ -1694,30 +1694,30 @@ EXPORT_SPEC int UpnpRenewSubscription(
* \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to * \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
* complete this operation. * complete this operation.
* \item {\tt UPNP_E_NETWORK_ERROR}: A network error occured (returned in * \item {\tt UPNP_E_NETWORK_ERROR}: A network error occured (returned in
* the {\bf EventSubscribe.ErrCode} field as part of the * the {\bf UpnpEventSubscribe.ErrCode} field as part of the
* callback). * callback).
* \item {\tt UPNP_E_SOCKET_WRITE}: An error or timeout occurred writing * \item {\tt UPNP_E_SOCKET_WRITE}: An error or timeout occurred writing
* to a socket (returned in the {\bf EventSubscribe.ErrCode} * to a socket (returned in the {\bf UpnpEventSubscribe.ErrCode}
* field as part of the callback). * field as part of the callback).
* \item {\tt UPNP_E_SOCKET_READ}: An error or timeout occurred reading * \item {\tt UPNP_E_SOCKET_READ}: An error or timeout occurred reading
* from a socket (returned in the * from a socket (returned in the
* {\bf EventSubscribe.ErrCode} field as part of the * {\bf UpnpEventSubscribe.ErrCode} field as part of the
* callback). * callback).
* \item {\tt UPNP_E_SOCKET_BIND}: An error occurred binding the socket * \item {\tt UPNP_E_SOCKET_BIND}: An error occurred binding the socket
* (returned in the {\bf EventSubscribe.ErrCode} field as * (returned in the {\bf UpnpEventSubscribe.ErrCode} field as
* part of the callback). * part of the callback).
* \item {\tt UPNP_E_SOCKET_CONNECT}: An error occurred connecting to * \item {\tt UPNP_E_SOCKET_CONNECT}: An error occurred connecting to
* {\bf PublisherUrl} (returned in the {\bf * {\bf PublisherUrl} (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \item {\tt UPNP_E_OUTOF_SOCKET}: An error occurred creating socket ( * \item {\tt UPNP_E_OUTOF_SOCKET}: An error occurred creating socket (
* returned in the {\bf EventSubscribe.ErrCode} field as * returned in the {\bf UpnpEventSubscribe.ErrCode} field as
* part of the callback). * part of the callback).
* \item {\tt UPNP_E_BAD_RESPONSE}: An error occurred in response from * \item {\tt UPNP_E_BAD_RESPONSE}: An error occurred in response from
* the publisher (returned in the {\bf * the publisher (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \item {\tt UPNP_E_SUBSCRIBE_UNACCEPTED}: The publisher refused * \item {\tt UPNP_E_SUBSCRIBE_UNACCEPTED}: The publisher refused
* the subscription request (returned in the {\bf * the subscription request (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \end{itemize} * \end{itemize}
*/ */
EXPORT_SPEC int UpnpRenewSubscriptionAsync( EXPORT_SPEC int UpnpRenewSubscriptionAsync(
@ -1822,9 +1822,9 @@ EXPORT_SPEC int UpnpSubscribe(
* callback function when the operation is complete. * callback function when the operation is complete.
* *
* Note that many of the error codes for this function are returned in * Note that many of the error codes for this function are returned in
* the {\bf EventSubscribe} structure. In those cases, the function * the {\bf UpnpEventSubscribe} structure. In those cases, the function
* returns {\tt UPNP_E_SUCCESS} and the appropriate error code will * returns {\tt UPNP_E_SUCCESS} and the appropriate error code will
* be in the {\bf EventSubscribe.ErrCode} field in the {\bf Event} * be in the {\bf UpnpEventSubscribe.ErrCode} field in the {\bf Event}
* structure passed to the callback. * structure passed to the callback.
* *
* @return [int] An integer representing one of the following: * @return [int] An integer representing one of the following:
@ -1839,31 +1839,31 @@ EXPORT_SPEC int UpnpSubscribe(
* \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to * \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
* complete this operation. * complete this operation.
* \item {\tt UPNP_E_NETWORK_ERROR}: A network error occured (returned in * \item {\tt UPNP_E_NETWORK_ERROR}: A network error occured (returned in
* the {\bf EventSubscribe.ErrCode} field as part of the * the {\bf UpnpEventSubscribe.ErrCode} field as part of the
* callback). * callback).
* \item {\tt UPNP_E_SOCKET_WRITE}: An error or timeout occurred writing * \item {\tt UPNP_E_SOCKET_WRITE}: An error or timeout occurred writing
* to a socket (returned in the * to a socket (returned in the
* {\bf EventSubscribe.ErrCode} field as part of the * {\bf UpnpEventSubscribe.ErrCode} field as part of the
* callback). * callback).
* \item {\tt UPNP_E_SOCKET_READ}: An error or timeout occurred reading * \item {\tt UPNP_E_SOCKET_READ}: An error or timeout occurred reading
* from a socket (returned in the * from a socket (returned in the
* {\bf EventSubscribe.ErrCode} field as part of the * {\bf UpnpEventSubscribe.ErrCode} field as part of the
* callback). * callback).
* \item {\tt UPNP_E_SOCKET_BIND}: An error occurred binding the socket * \item {\tt UPNP_E_SOCKET_BIND}: An error occurred binding the socket
* (returned in the {\bf EventSubscribe.ErrCode} field as * (returned in the {\bf UpnpEventSubscribe.ErrCode} field as
* part of the callback). * part of the callback).
* \item {\tt UPNP_E_SOCKET_CONNECT}: An error occurred connecting to * \item {\tt UPNP_E_SOCKET_CONNECT}: An error occurred connecting to
* {\bf PublisherUrl} (returned in the {\bf * {\bf PublisherUrl} (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \item {\tt UPNP_E_OUTOF_SOCKET}: An error occurred creating the * \item {\tt UPNP_E_OUTOF_SOCKET}: An error occurred creating the
* socket (returned in the {\bf EventSubscribe.ErrCode} * socket (returned in the {\bf UpnpEventSubscribe.ErrCode}
* field as part of the callback). * field as part of the callback).
* \item {\tt UPNP_E_BAD_RESPONSE}: An error occurred in response from * \item {\tt UPNP_E_BAD_RESPONSE}: An error occurred in response from
* the publisher (returned in the {\bf * the publisher (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \item {\tt UPNP_E_SUBSCRIBE_UNACCEPTED}: The publisher refused * \item {\tt UPNP_E_SUBSCRIBE_UNACCEPTED}: The publisher refused
* the subscription request (returned in the {\bf * the subscription request (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \end{itemize} * \end{itemize}
*/ */
EXPORT_SPEC int UpnpSubscribeAsync( EXPORT_SPEC int UpnpSubscribeAsync(
@ -1923,9 +1923,9 @@ EXPORT_SPEC int UpnpUnSubscribe(
* when the operation is complete. * when the operation is complete.
* *
* Note that many of the error codes for this function are returned in * Note that many of the error codes for this function are returned in
* the {\bf EventSubscribe} structure. In those cases, the function * the {\bf UpnpEventSubscribe} structure. In those cases, the function
* returns {\tt UPNP_E_SUCCESS} and the appropriate error code will * returns {\tt UPNP_E_SUCCESS} and the appropriate error code will
* be in the {\bf EventSubscribe.ErrCode} field in the {\bf Event} * be in the {\bf UpnpEventSubscribe.ErrCode} field in the {\bf Event}
* structure passed to the callback. * structure passed to the callback.
* *
* @return [int] An integer representing one of the following: * @return [int] An integer representing one of the following:
@ -1939,30 +1939,30 @@ EXPORT_SPEC int UpnpUnSubscribe(
* \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to * \item {\tt UPNP_E_OUTOF_MEMORY}: Insufficient resources exist to
* complete this operation. * complete this operation.
* \item {\tt UPNP_E_NETWORK_ERROR}: A network error occured (returned in * \item {\tt UPNP_E_NETWORK_ERROR}: A network error occured (returned in
* the {\bf EventSubscribe.ErrCode} field as part of the * the {\bf UpnpEventSubscribe.ErrCode} field as part of the
* callback). * callback).
* \item {\tt UPNP_E_SOCKET_WRITE}: An error or timeout occurred writing * \item {\tt UPNP_E_SOCKET_WRITE}: An error or timeout occurred writing
* to a socket (returned in the {\bf * to a socket (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \item {\tt UPNP_E_SOCKET_READ}: An error or timeout occurred reading * \item {\tt UPNP_E_SOCKET_READ}: An error or timeout occurred reading
* from a socket (returned in the * from a socket (returned in the
* {\bf EventSubscribe.ErrCode} field as part of the * {\bf UpnpEventSubscribe.ErrCode} field as part of the
* callback). * callback).
* \item {\tt UPNP_E_SOCKET_BIND}: An error occurred binding the socket * \item {\tt UPNP_E_SOCKET_BIND}: An error occurred binding the socket
* (returned in the {\bf EventSubscribe.ErrCode} field as * (returned in the {\bf UpnpEventSubscribe.ErrCode} field as
* part of the callback). * part of the callback).
* \item {\tt UPNP_E_SOCKET_CONNECT}: An error occurred connecting to * \item {\tt UPNP_E_SOCKET_CONNECT}: An error occurred connecting to
* {\bf PublisherUrl} (returned in the {\bf * {\bf PublisherUrl} (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \item {\tt UPNP_E_OUTOF_SOCKET}: An error occurred creating a socket ( * \item {\tt UPNP_E_OUTOF_SOCKET}: An error occurred creating a socket (
* returned in the {\bf EventSubscribe.ErrCode} field as * returned in the {\bf UpnpEventSubscribe.ErrCode} field as
* part of the callback). * part of the callback).
* \item {\tt UPNP_E_BAD_RESPONSE}: An error occurred in response from * \item {\tt UPNP_E_BAD_RESPONSE}: An error occurred in response from
* the publisher (returned in the {\bf * the publisher (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \item {\tt UPNP_E_UNSUBSCRIBE_UNACCEPTED}: The publisher refused * \item {\tt UPNP_E_UNSUBSCRIBE_UNACCEPTED}: The publisher refused
* the subscription request (returned in the {\bf * the subscription request (returned in the {\bf
* EventSubscribe.ErrCode} field as part of the callback). * UpnpEventSubscribe.ErrCode} field as part of the callback).
* \end{itemize} */ * \end{itemize} */
EXPORT_SPEC int UpnpUnSubscribeAsync( EXPORT_SPEC int UpnpUnSubscribeAsync(
IN UpnpClient_Handle Hnd, /** The handle of the subscribed control IN UpnpClient_Handle Hnd, /** The handle of the subscribed control

View File

@ -564,7 +564,7 @@ SampleUtil_PrintEvent( IN Upnp_EventType EventType,
case UPNP_EVENT_RENEWAL_COMPLETE: case UPNP_EVENT_RENEWAL_COMPLETE:
{ {
EventSubscribe *es_event = (EventSubscribe *)Event; UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
SampleUtil_Print( SampleUtil_Print(
"SID = %s\n" "SID = %s\n"
"ErrCode = %d\n" "ErrCode = %d\n"
@ -578,7 +578,7 @@ SampleUtil_PrintEvent( IN Upnp_EventType EventType,
case UPNP_EVENT_SUBSCRIBE_COMPLETE: case UPNP_EVENT_SUBSCRIBE_COMPLETE:
case UPNP_EVENT_UNSUBSCRIBE_COMPLETE: case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
{ {
EventSubscribe *es_event = (EventSubscribe *)Event; UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
SampleUtil_Print( SampleUtil_Print(
"SID = %s\n" "SID = %s\n"
"ErrCode = %d\n" "ErrCode = %d\n"
@ -594,7 +594,7 @@ SampleUtil_PrintEvent( IN Upnp_EventType EventType,
case UPNP_EVENT_AUTORENEWAL_FAILED: case UPNP_EVENT_AUTORENEWAL_FAILED:
case UPNP_EVENT_SUBSCRIPTION_EXPIRED: case UPNP_EVENT_SUBSCRIPTION_EXPIRED:
{ {
EventSubscribe *es_event = (EventSubscribe *)Event; UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
SampleUtil_Print( SampleUtil_Print(
"SID = %s\n" "SID = %s\n"
"ErrCode = %d\n" "ErrCode = %d\n"

View File

@ -1163,7 +1163,7 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
case UPNP_EVENT_SUBSCRIBE_COMPLETE: case UPNP_EVENT_SUBSCRIBE_COMPLETE:
case UPNP_EVENT_UNSUBSCRIBE_COMPLETE: case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
case UPNP_EVENT_RENEWAL_COMPLETE: { case UPNP_EVENT_RENEWAL_COMPLETE: {
EventSubscribe *es_event = (EventSubscribe *)Event; UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
errCode = UpnpEventSubscribe_get_ErrCode(es_event); errCode = UpnpEventSubscribe_get_ErrCode(es_event);
if (errCode != UPNP_E_SUCCESS) { if (errCode != UPNP_E_SUCCESS) {
SampleUtil_Print( SampleUtil_Print(
@ -1181,7 +1181,7 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
case UPNP_EVENT_AUTORENEWAL_FAILED: case UPNP_EVENT_AUTORENEWAL_FAILED:
case UPNP_EVENT_SUBSCRIPTION_EXPIRED: { case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
EventSubscribe *es_event = (EventSubscribe *)Event; UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
int TimeOut = default_timeout; int TimeOut = default_timeout;
Upnp_SID newSID; Upnp_SID newSID;

View File

@ -1163,7 +1163,7 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
case UPNP_EVENT_SUBSCRIBE_COMPLETE: case UPNP_EVENT_SUBSCRIBE_COMPLETE:
case UPNP_EVENT_UNSUBSCRIBE_COMPLETE: case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
case UPNP_EVENT_RENEWAL_COMPLETE: { case UPNP_EVENT_RENEWAL_COMPLETE: {
EventSubscribe *es_event = (EventSubscribe *)Event; UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
errCode = UpnpEventSubscribe_get_ErrCode(es_event); errCode = UpnpEventSubscribe_get_ErrCode(es_event);
if (errCode != UPNP_E_SUCCESS) { if (errCode != UPNP_E_SUCCESS) {
SampleUtil_Print( SampleUtil_Print(
@ -1181,7 +1181,7 @@ int TvCtrlPointCallbackEventHandler(Upnp_EventType EventType, void *Event, void
case UPNP_EVENT_AUTORENEWAL_FAILED: case UPNP_EVENT_AUTORENEWAL_FAILED:
case UPNP_EVENT_SUBSCRIPTION_EXPIRED: { case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
EventSubscribe *es_event = (EventSubscribe *)Event; UpnpEventSubscribe *es_event = (UpnpEventSubscribe *)Event;
int TimeOut = default_timeout; int TimeOut = default_timeout;
Upnp_SID newSID; Upnp_SID newSID;

View File

@ -18,7 +18,7 @@ struct SEventSubscribe
}; };
EventSubscribe *UpnpEventSubscribe_new() UpnpEventSubscribe *UpnpEventSubscribe_new()
{ {
struct SEventSubscribe *p = calloc(1, sizeof (struct SEventSubscribe)); struct SEventSubscribe *p = calloc(1, sizeof (struct SEventSubscribe));
#if 0 #if 0
@ -28,11 +28,11 @@ EventSubscribe *UpnpEventSubscribe_new()
p->m_SID = UpnpString_new(); p->m_SID = UpnpString_new();
p->m_publisherUrl = UpnpString_new(); p->m_publisherUrl = UpnpString_new();
return (EventSubscribe *)p; return (UpnpEventSubscribe *)p;
} }
void UpnpEventSubscribe_delete(EventSubscribe *p) void UpnpEventSubscribe_delete(UpnpEventSubscribe *p)
{ {
struct SEventSubscribe *q = (struct SEventSubscribe *)p; struct SEventSubscribe *q = (struct SEventSubscribe *)p;
@ -50,9 +50,9 @@ void UpnpEventSubscribe_delete(EventSubscribe *p)
} }
EventSubscribe *UpnpEventSubscribe_dup(const EventSubscribe *p) UpnpEventSubscribe *UpnpEventSubscribe_dup(const UpnpEventSubscribe *p)
{ {
EventSubscribe *q = UpnpEventSubscribe_new(); UpnpEventSubscribe *q = UpnpEventSubscribe_new();
UpnpEventSubscribe_assign(q, p); UpnpEventSubscribe_assign(q, p);
@ -60,7 +60,7 @@ EventSubscribe *UpnpEventSubscribe_dup(const EventSubscribe *p)
} }
void UpnpEventSubscribe_assign(EventSubscribe *q, const EventSubscribe *p) void UpnpEventSubscribe_assign(UpnpEventSubscribe *q, const UpnpEventSubscribe *p)
{ {
if (q != p) { if (q != p) {
UpnpEventSubscribe_set_ErrCode(q, UpnpEventSubscribe_get_ErrCode(p)); UpnpEventSubscribe_set_ErrCode(q, UpnpEventSubscribe_get_ErrCode(p));
@ -71,44 +71,44 @@ void UpnpEventSubscribe_assign(EventSubscribe *q, const EventSubscribe *p)
} }
int UpnpEventSubscribe_get_ErrCode(const EventSubscribe *p) int UpnpEventSubscribe_get_ErrCode(const UpnpEventSubscribe *p)
{ {
return ((struct SEventSubscribe *)p)->m_errCode; return ((struct SEventSubscribe *)p)->m_errCode;
} }
void UpnpEventSubscribe_set_ErrCode(EventSubscribe *p, int n) void UpnpEventSubscribe_set_ErrCode(UpnpEventSubscribe *p, int n)
{ {
((struct SEventSubscribe *)p)->m_errCode = n; ((struct SEventSubscribe *)p)->m_errCode = n;
} }
int UpnpEventSubscribe_get_TimeOut(const EventSubscribe *p) int UpnpEventSubscribe_get_TimeOut(const UpnpEventSubscribe *p)
{ {
return ((struct SEventSubscribe *)p)->m_timeOut; return ((struct SEventSubscribe *)p)->m_timeOut;
} }
void UpnpEventSubscribe_set_TimeOut(EventSubscribe *p, int n) void UpnpEventSubscribe_set_TimeOut(UpnpEventSubscribe *p, int n)
{ {
((struct SEventSubscribe *)p)->m_timeOut = n; ((struct SEventSubscribe *)p)->m_timeOut = n;
} }
const UpnpString *UpnpEventSubscribe_get_SID(const EventSubscribe *p) const UpnpString *UpnpEventSubscribe_get_SID(const UpnpEventSubscribe *p)
{ {
return ((struct SEventSubscribe *)p)->m_SID; return ((struct SEventSubscribe *)p)->m_SID;
} }
void UpnpEventSubscribe_set_SID(EventSubscribe *p, const UpnpString *s) void UpnpEventSubscribe_set_SID(UpnpEventSubscribe *p, const UpnpString *s)
{ {
UpnpString_delete(((struct SEventSubscribe *)p)->m_SID); UpnpString_delete(((struct SEventSubscribe *)p)->m_SID);
((struct SEventSubscribe *)p)->m_SID = UpnpString_dup(s); ((struct SEventSubscribe *)p)->m_SID = UpnpString_dup(s);
} }
void UpnpEventSubscribe_strcpy_SID(EventSubscribe *p, const char *s) void UpnpEventSubscribe_strcpy_SID(UpnpEventSubscribe *p, const char *s)
{ {
UpnpString_delete(((struct SEventSubscribe *)p)->m_SID); UpnpString_delete(((struct SEventSubscribe *)p)->m_SID);
((struct SEventSubscribe *)p)->m_SID = UpnpString_new(); ((struct SEventSubscribe *)p)->m_SID = UpnpString_new();
@ -116,20 +116,20 @@ void UpnpEventSubscribe_strcpy_SID(EventSubscribe *p, const char *s)
} }
const UpnpString *UpnpEventSubscribe_get_PublisherUrl(const EventSubscribe *p) const UpnpString *UpnpEventSubscribe_get_PublisherUrl(const UpnpEventSubscribe *p)
{ {
return ((struct SEventSubscribe *)p)->m_publisherUrl; return ((struct SEventSubscribe *)p)->m_publisherUrl;
} }
void UpnpEventSubscribe_set_PublisherUrl(EventSubscribe *p, const UpnpString *s) void UpnpEventSubscribe_set_PublisherUrl(UpnpEventSubscribe *p, const UpnpString *s)
{ {
UpnpString_delete(((struct SEventSubscribe *)p)->m_publisherUrl); UpnpString_delete(((struct SEventSubscribe *)p)->m_publisherUrl);
((struct SEventSubscribe *)p)->m_publisherUrl = UpnpString_dup(s); ((struct SEventSubscribe *)p)->m_publisherUrl = UpnpString_dup(s);
} }
void UpnpEventSubscribe_strcpy_PublisherUrl(EventSubscribe *p, const char *s) void UpnpEventSubscribe_strcpy_PublisherUrl(UpnpEventSubscribe *p, const char *s)
{ {
UpnpString_delete(((struct SEventSubscribe *)p)->m_publisherUrl); UpnpString_delete(((struct SEventSubscribe *)p)->m_publisherUrl);
((struct SEventSubscribe *)p)->m_publisherUrl = UpnpString_new(); ((struct SEventSubscribe *)p)->m_publisherUrl = UpnpString_new();

View File

@ -10,7 +10,6 @@
#include <string.h> // for strlen(), strdup() #include <string.h> // for strlen(), strdup()
/** This is a private struct, it belongs only to this file. */
struct SUpnpFileInfo struct SUpnpFileInfo
{ {
off_t m_fileLength; off_t m_fileLength;

View File

@ -4215,7 +4215,7 @@ UpnpThreadDistribution(struct UpnpNonblockParam *Param)
switch ( Param->FunName ) { switch ( Param->FunName ) {
#if EXCLUDE_GENA == 0 #if EXCLUDE_GENA == 0
case SUBSCRIBE: { case SUBSCRIBE: {
EventSubscribe *evt = UpnpEventSubscribe_new(); UpnpEventSubscribe *evt = UpnpEventSubscribe_new();
// cast away constness // cast away constness
UpnpString *sid = (UpnpString *)UpnpEventSubscribe_get_SID(evt); UpnpString *sid = (UpnpString *)UpnpEventSubscribe_get_SID(evt);
UpnpEventSubscribe_strcpy_PublisherUrl(evt, Param->Url); UpnpEventSubscribe_strcpy_PublisherUrl(evt, Param->Url);
@ -4232,7 +4232,7 @@ UpnpThreadDistribution(struct UpnpNonblockParam *Param)
break; break;
} }
case UNSUBSCRIBE: { case UNSUBSCRIBE: {
EventSubscribe *evt = UpnpEventSubscribe_new(); UpnpEventSubscribe *evt = UpnpEventSubscribe_new();
UpnpEventSubscribe_strcpy_SID(evt, Param->SubsId); UpnpEventSubscribe_strcpy_SID(evt, Param->SubsId);
errCode = genaUnSubscribe( errCode = genaUnSubscribe(
Param->Handle, Param->Handle,
@ -4246,7 +4246,7 @@ UpnpThreadDistribution(struct UpnpNonblockParam *Param)
break; break;
} }
case RENEW: { case RENEW: {
EventSubscribe *evt = UpnpEventSubscribe_new(); UpnpEventSubscribe *evt = UpnpEventSubscribe_new();
UpnpEventSubscribe_strcpy_SID(evt, Param->SubsId); UpnpEventSubscribe_strcpy_SID(evt, Param->SubsId);
errCode = genaRenewSubscription( errCode = genaRenewSubscription(
Param->Handle, Param->Handle,

View File

@ -66,7 +66,7 @@ static void
GenaAutoRenewSubscription( IN void *input ) GenaAutoRenewSubscription( IN void *input )
{ {
upnp_timeout *event = (upnp_timeout *) input; upnp_timeout *event = (upnp_timeout *) input;
EventSubscribe *sub_struct = (EventSubscribe *)event->Event; UpnpEventSubscribe *sub_struct = (UpnpEventSubscribe *)event->Event;
void *cookie; void *cookie;
Upnp_FunPtr callback_fun; Upnp_FunPtr callback_fun;
struct Handle_Info *handle_info; struct Handle_Info *handle_info;
@ -137,7 +137,7 @@ static int ScheduleGenaAutoRenew(
IN int TimeOut, IN int TimeOut,
IN ClientSubscription *sub) IN ClientSubscription *sub)
{ {
EventSubscribe *RenewEventStruct = NULL; UpnpEventSubscribe *RenewEventStruct = NULL;
upnp_timeout *RenewEvent = NULL; upnp_timeout *RenewEvent = NULL;
int return_code = GENA_SUCCESS; int return_code = GENA_SUCCESS;
ThreadPoolJob job; ThreadPoolJob job;