Commit 465e6f01 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

soa: updated documentation. Using issize_t/isize_t with soa_set_params() and soa_get_params().

darcs-hash:20060925193637-65a35-8e34947abdb18e53022fdd1c36fca997ea2b61e2.gz
parent 17dca61c
......@@ -363,7 +363,13 @@ void soa_base_deinit(soa_session_t *ss)
(void)ss;
}
/** Set tagged parameters */
/** Set parameters.
*
* @param ss soa session object
* @param tag, value, ... tagged parameter list
*
* @return Number of parameters set, or -1 upon an error.
*/
int soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...)
{
ta_list ta;
......@@ -384,6 +390,13 @@ int soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...)
return n;
}
/**Base method for setting parameters.
*
* @param ss soa session object
* @param tags tag item list
*
* @return Number of parameters set, or -1 upon an error.
*/
int soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
{
int n, change_session = 0;
......@@ -522,12 +535,18 @@ int soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
return n;
}
/** Get tagged parameters */
int soa_get_params(soa_session_t const *ss,
tag_type_t tag, tag_value_t value, ...)
/** Get tagged parameters.
*
* @param ss soa session object
* @param tag, value, ... tagged parameter list
*
* @return Number of parameters get, or -1 upon an error.
*/
issize_t soa_get_params(soa_session_t const *ss,
tag_type_t tag, tag_value_t value, ...)
{
ta_list ta;
int n;
isize_t n;
SU_DEBUG_9(("soa_get_params(%s::%p, ...) called\n",
ss ? ss->ss_actions->soa_name : "", ss));
......@@ -541,12 +560,19 @@ int soa_get_params(soa_session_t const *ss,
ta_end(ta);
return n;
return (issize_t)n;
}
int soa_base_get_params(soa_session_t const *ss, tagi_t *tags)
/**Base method for getting tagged parameters.
*
* @param ss soa session object
* @param tags tag item list
*
* @return Number of parameters get, or -1 upon an error.
*/
isize_t soa_base_get_params(soa_session_t const *ss, tagi_t *tags)
{
int n;
isize_t n;
n = tl_tgets(tags,
SOATAG_CAPS_SDP(ss->ss_caps->ssd_sdp),
......@@ -578,7 +604,7 @@ int soa_base_get_params(soa_session_t const *ss, tagi_t *tags)
return n;
}
/** Return a list of parameters */
/** Return a list of parameters. */
tagi_t *soa_get_paramlist(soa_session_t const *ss,
tag_type_t tag, tag_value_t value, ...)
{
......@@ -598,6 +624,7 @@ tagi_t *soa_get_paramlist(soa_session_t const *ss,
}
/** Base bethod for getting list of parameters. */
tagi_t *soa_base_get_paramlist(soa_session_t const *ss,
tag_type_t tag, tag_value_t value,
...)
......@@ -648,6 +675,7 @@ tagi_t *soa_base_get_paramlist(soa_session_t const *ss,
#include <sofia-sip/sip_status.h>
/** Convert @soa error to a SIP response code and phrase. */
int soa_error_as_sip_response(soa_session_t *ss,
char const **return_phrase)
{
......@@ -665,6 +693,7 @@ int soa_error_as_sip_response(soa_session_t *ss,
return ss->ss_status;
}
/** Convert @soa error to a SIP @Reason header. */
char const *soa_error_as_sip_reason(soa_session_t *ss)
{
char const *phrase;
......@@ -688,7 +717,7 @@ char const *soa_error_as_sip_reason(soa_session_t *ss)
}
/** Return warning code and text */
/** Return SIP @Warning code and text. */
int soa_get_warning(soa_session_t *ss, char const **return_text)
{
if (!ss)
......
......@@ -71,8 +71,8 @@ struct soa_asynch_completed
static int soa_asynch_init(char const *, soa_session_t *, soa_session_t *);
static void soa_asynch_deinit(soa_session_t *);
static int soa_asynch_set_params(soa_session_t *ss, tagi_t const *tags);
static int soa_asynch_get_params(soa_session_t const *ss, tagi_t *tags);
static issize_t soa_asynch_set_params(soa_session_t *ss, tagi_t const *tags);
static issize_t soa_asynch_get_params(soa_session_t const *ss, tagi_t *tags);
static tagi_t *soa_asynch_get_paramlist(soa_session_t const *ss);
static int soa_asynch_generate_offer(soa_session_t *ss,
soa_callback_f *completed);
......@@ -121,12 +121,12 @@ static void soa_asynch_deinit(soa_session_t *ss)
soa_base_deinit(ss);
}
static int soa_asynch_set_params(soa_session_t *ss, tagi_t const *tags)
static issize_t soa_asynch_set_params(soa_session_t *ss, tagi_t const *tags)
{
return soa_base_set_params(ss, tags);
}
static int soa_asynch_get_params(soa_session_t const *ss, tagi_t *tags)
static issize_t soa_asynch_get_params(soa_session_t const *ss, tagi_t *tags)
{
return soa_base_get_params(ss, tags);
}
......
......@@ -85,8 +85,8 @@ soa_static_session_t;
static int soa_static_init(char const *, soa_session_t *, soa_session_t *);
static void soa_static_deinit(soa_session_t *);
static int soa_static_set_params(soa_session_t *ss, tagi_t const *tags);
static int soa_static_get_params(soa_session_t const *ss, tagi_t *tags);
static issize_t soa_static_set_params(soa_session_t *ss, tagi_t const *tags);
static issize_t soa_static_get_params(soa_session_t const *ss, tagi_t *tags);
static tagi_t *soa_static_get_paramlist(soa_session_t const *ss,
tag_type_t tag, tag_value_t value,
...);
......@@ -176,18 +176,15 @@ static int soa_static_set_params(soa_session_t *ss, tagi_t const *tags)
return n + m;
}
static int soa_static_get_params(soa_session_t const *ss, tagi_t *tags)
static issize_t soa_static_get_params(soa_session_t const *ss, tagi_t *tags)
{
soa_static_session_t *sss = (soa_static_session_t *)ss;
int n, m;
issize_t n, m;
n = tl_tgets(tags,
SOATAG_AUDIO_AUX(sss->sss_audio_aux),
TAG_END());
if (n < 0)
return n;
m = soa_base_get_params(ss, tags);
if (m < 0)
return m;
......
......@@ -60,9 +60,9 @@ SOFIAPUBFUN soa_session_t *soa_clone(soa_session_t *, su_root_t *, soa_magic_t *
SOFIAPUBFUN void soa_destroy(soa_session_t *);
SOFIAPUBFUN int soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...);
SOFIAPUBFUN int soa_get_params(soa_session_t const *ss,
tag_type_t tag, tag_value_t value, ...);
SOFIAPUBFUN issize_t soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...);
SOFIAPUBFUN issize_t soa_get_params(soa_session_t const *ss,
tag_type_t tag, tag_value_t value, ...);
SOFIAPUBFUN tagi_t *soa_get_paramlist(soa_session_t const *ss,
tag_type_t tag, tag_value_t value, ...);
......
......@@ -55,8 +55,8 @@ struct soa_session_actions
char const *soa_name;
int (*soa_init)(char const *name, soa_session_t *ss, soa_session_t *parent);
void (*soa_deinit)(soa_session_t *ss);
int (*soa_set_params)(soa_session_t *ss, tagi_t const *tags);
int (*soa_get_params)(soa_session_t const *ss, tagi_t *tags);
issize_t (*soa_set_params)(soa_session_t *ss, tagi_t const *tags);
issize_t (*soa_get_params)(soa_session_t const *ss, tagi_t *tags);
tagi_t *(*soa_get_paramlist)(soa_session_t const *ss,
tag_type_t, tag_value_t, ...);
char **(*soa_media_features)(soa_session_t *, int live, su_home_t *);
......
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