Commit 3be4828d authored by Pekka Pessi's avatar Pekka Pessi

Added nua_dialog_usage_refresh() and nua_dialog_usage_public().

darcs-hash:20060320191320-65a35-e6027fa6dc99540d55adf47f4d004c79c51dcee1.gz
parent bb14faa7
......@@ -425,3 +425,18 @@ void nua_dialog_usage_set_refresh(nua_dialog_usage_t *du, unsigned delta)
du->du_refresh = target;
}
/** Call the owner operation function */
void nua_dialog_usage_refresh(nua_owner_t *owner,
nua_dialog_usage_t *du,
sip_time_t now)
{
if (du) {
nh_pending_f *pending = du->du_pending;
du->du_pending = NULL;
if (pending)
pending(owner, du, now);
}
}
......@@ -148,6 +148,10 @@ void nua_dialog_terminated(nua_owner_t *,
void nua_dialog_usage_set_refresh(nua_dialog_usage_t *du, unsigned delta);
void nua_dialog_usage_refresh(nua_owner_t *owner,
nua_dialog_usage_t *du,
sip_time_t now);
static inline
int nua_dialog_is_established(nua_dialog_state_t const *ds)
......@@ -159,10 +163,17 @@ int nua_dialog_is_established(nua_dialog_state_t const *ds)
static inline
void *nua_dialog_usage_private(nua_dialog_usage_t const *du)
{
return (void *)(du + 1);
return du ? (void *)(du + 1) : NULL;
}
static inline
nua_dialog_usage_t *nua_dialog_usage_public(void const *p)
{
return p ? (nua_dialog_usage_t *)p - 1 : NULL;
}
#else
#define nua_dialog_usage_private(du) ((void*)((du) + 1))
#define nua_dialog_usage_private(du) ((du) ? (void*)((du) + 1) : NULL)
#define nua_dialog_usage_public(p) ((p) ? (nua_dialog_usage_t*)(p) - 1 : NULL)
#endif
#endif /* NUA_DIALOG_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment