Commit a576102e authored by Pekka Pessi's avatar Pekka Pessi

tl_gets(), tl_tgets(): reverted back using int as return type. Ditto for...

tl_gets(), tl_tgets(): reverted back using int as return type. Ditto for soa_get_params()/soa_set_params().

darcs-hash:20060926092619-65a35-765f07b0b4d0020d328685caec866c2b018ba996.gz
parent 45aa33a5
......@@ -89,7 +89,7 @@ int test_nua_params(struct context *ctx)
nua_handle_t *nh;
struct event *e;
tagi_t const *t;
isize_t n;
int n;
su_home_auto(tmphome, sizeof(tmphome));
......
......@@ -370,10 +370,10 @@ void soa_base_deinit(soa_session_t *ss)
*
* @return Number of parameters set, or -1 upon an error.
*/
issize_t soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...)
int soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ...)
{
ta_list ta;
isize_t n;
int n;
SU_DEBUG_9(("soa_set_params(%s::%p, ...) called\n",
ss ? ss->ss_actions->soa_name : "", ss));
......@@ -387,7 +387,7 @@ issize_t soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ..
ta_end(ta);
return (issize_t)n;
return n;
}
/**Base method for setting parameters.
......@@ -397,9 +397,9 @@ issize_t soa_set_params(soa_session_t *ss, tag_type_t tag, tag_value_t value, ..
*
* @return Number of parameters set, or -1 upon an error.
*/
issize_t soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
int soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
{
isize_t n, change_session = 0;
int n, change_session = 0;
sdp_session_t const *caps_sdp, *user_sdp;
char const *caps_sdp_str, *user_sdp_str;
......@@ -532,7 +532,7 @@ issize_t soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
if (change_session)
ss->ss_user_version++;
return (issize_t)n;
return n;
}
/** Get tagged parameters.
......@@ -542,11 +542,11 @@ issize_t soa_base_set_params(soa_session_t *ss, tagi_t const *tags)
*
* @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, ...)
int soa_get_params(soa_session_t const *ss,
tag_type_t tag, tag_value_t value, ...)
{
ta_list ta;
isize_t n;
int n;
SU_DEBUG_9(("soa_get_params(%s::%p, ...) called\n",
ss ? ss->ss_actions->soa_name : "", ss));
......@@ -560,7 +560,7 @@ issize_t soa_get_params(soa_session_t const *ss,
ta_end(ta);
return (issize_t)n;
return n;
}
/**Base method for getting tagged parameters.
......@@ -570,9 +570,9 @@ issize_t soa_get_params(soa_session_t const *ss,
*
* @return Number of parameters get, or -1 upon an error.
*/
issize_t soa_base_get_params(soa_session_t const *ss, tagi_t *tags)
int soa_base_get_params(soa_session_t const *ss, tagi_t *tags)
{
isize_t n;
int n;
n = tl_tgets(tags,
SOATAG_CAPS_SDP(ss->ss_caps->ssd_sdp),
......
......@@ -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 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 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 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 issize_t soa_asynch_set_params(soa_session_t *ss, tagi_t const *tags)
static int soa_asynch_set_params(soa_session_t *ss, tagi_t const *tags)
{
return soa_base_set_params(ss, tags);
}
static issize_t soa_asynch_get_params(soa_session_t const *ss, tagi_t *tags)
static int 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 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 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 tagi_t *soa_static_get_paramlist(soa_session_t const *ss,
tag_type_t tag, tag_value_t value,
...);
......@@ -148,17 +148,17 @@ static void soa_static_deinit(soa_session_t *ss)
soa_base_deinit(ss);
}
static issize_t soa_static_set_params(soa_session_t *ss, tagi_t const *tags)
static int soa_static_set_params(soa_session_t *ss, tagi_t const *tags)
{
soa_static_session_t *sss = (soa_static_session_t *)ss;
char const *audio_aux = sss->sss_audio_aux;
issize_t n, m;
int n, m;
n = tl_gets(tags,
SOATAG_AUDIO_AUX_REF(audio_aux),
TAG_END());
if (str0casecmp(audio_aux, sss->sss_audio_aux)) {
if (n > 0 && str0casecmp(audio_aux, sss->sss_audio_aux)) {
char *s = su_strdup(ss->ss_home, audio_aux), *tbf = sss->sss_audio_aux;
if (s == NULL && audio_aux != NULL)
return -1;
......@@ -174,11 +174,11 @@ static issize_t soa_static_set_params(soa_session_t *ss, tagi_t const *tags)
return n + m;
}
static issize_t soa_static_get_params(soa_session_t const *ss, tagi_t *tags)
static int soa_static_get_params(soa_session_t const *ss, tagi_t *tags)
{
soa_static_session_t *sss = (soa_static_session_t *)ss;
issize_t n, m;
int n, m;
n = tl_tgets(tags,
SOATAG_AUDIO_AUX(sss->sss_audio_aux),
......
......@@ -60,9 +60,10 @@ SOFIAPUBFUN soa_session_t *soa_clone(soa_session_t *, su_root_t *, soa_magic_t *
SOFIAPUBFUN void soa_destroy(soa_session_t *);
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 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 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);
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);
int (*soa_set_params)(soa_session_t *ss, tagi_t const *tags);
int (*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 *);
......@@ -86,8 +86,8 @@ SOFIAPUBFUN void soa_session_unref(soa_session_t *ss);
SOFIAPUBFUN int soa_base_init(char const *name, soa_session_t *,
soa_session_t *parent);
SOFIAPUBFUN void soa_base_deinit(soa_session_t *ss);
SOFIAPUBFUN issize_t soa_base_set_params(soa_session_t *ss, tagi_t const *tags);
SOFIAPUBFUN issize_t soa_base_get_params(soa_session_t const *ss, tagi_t *tags);
SOFIAPUBFUN int soa_base_set_params(soa_session_t *ss, tagi_t const *tags);
SOFIAPUBFUN int soa_base_get_params(soa_session_t const *ss, tagi_t *tags);
SOFIAPUBFUN tagi_t *soa_base_get_paramlist(soa_session_t const *ss,
tag_type_t, tag_value_t, ...);
SOFIAPUBFUN char **soa_base_media_features(soa_session_t *,
......
......@@ -134,8 +134,8 @@ SOFIAPUBFUN int t_scan(tag_type_t tt, su_home_t *home, char const *s,
/* Tagarg functions */
SOFIAPUBFUN tagi_t *tl_tlist(su_home_t *, tag_type_t, tag_value_t, ...);
SOFIAPUBFUN size_t tl_tmove(tagi_t *dst, size_t, tag_type_t, tag_value_t, ...);
SOFIAPUBFUN isize_t tl_gets(tagi_t const lst[], tag_type_t, tag_value_t, ...);
SOFIAPUBFUN isize_t tl_tgets(tagi_t lst[], tag_type_t, tag_value_t, ...);
SOFIAPUBFUN int tl_gets(tagi_t const lst[], tag_type_t, tag_value_t, ...);
SOFIAPUBFUN int tl_tgets(tagi_t lst[], tag_type_t, tag_value_t, ...);
SOFIAPUBFUN tagi_t *tl_tfilter(su_home_t *, tagi_t const lst[],
tag_type_t, tag_value_t, ...);
SOFIAPUBFUN int tl_tremove(tagi_t lst[], tag_type_t, tag_value_t, ...);
......
......@@ -384,9 +384,9 @@ static int tl_get(tag_type_t tt, void *p, tagi_t const lst[])
}
/** Find tags from given list. */
isize_t tl_gets(tagi_t const lst[], tag_type_t tag, tag_value_t value, ...)
int tl_gets(tagi_t const lst[], tag_type_t tag, tag_value_t value, ...)
{
isize_t n = 0;
int n = 0;
tagi_t *t;
ta_list ta;
......@@ -418,14 +418,14 @@ isize_t tl_gets(tagi_t const lst[], tag_type_t tag, tag_value_t value, ...)
/** Find tags from given list.
*
* The function tl_tgets() copies values of argument tag list into the tag
* Copies values of argument tag list into the reference tags in the tag
* list @a lst.
*
* @sa tl_gets()
*/
isize_t tl_tgets(tagi_t lst[], tag_type_t tag, tag_value_t value, ...)
int tl_tgets(tagi_t lst[], tag_type_t tag, tag_value_t value, ...)
{
isize_t n = 0;
int n = 0;
tagi_t *t;
ta_list ta;
......
......@@ -2408,7 +2408,7 @@ int tport_accept(tport_primary_t *pri, int events)
}
/** Allocate a new message object */
msg_t *tport_msg_alloc(tport_t const *self, unsigned size)
msg_t *tport_msg_alloc(tport_t const *self, usize_t size)
{
if (self) {
tport_master_t *mr = self->tp_master;
......
......@@ -399,7 +399,7 @@ ssize_t tport_recv_iovec(tport_t const *self,
msg_iovec_t iovec[msg_n_fragments], size_t N,
int exact);
msg_t *tport_msg_alloc(tport_t const *self, unsigned size);
msg_t *tport_msg_alloc(tport_t const *self, usize_t size);
int tport_prepare_and_send(tport_t *self, msg_t *msg,
tp_name_t const *tpn,
......
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