Commit 8ad2589a authored by Pekka Pessi's avatar Pekka Pessi

Using const with default mclasses.

darcs-hash:20070209105256-65a35-b5149bcaa2a0815cc1f13475cdf3a3fdc7045a86.gz
parent 7ad72a63
......@@ -61,9 +61,9 @@ char const http_version_1_0[] = "HTTP/1.0";
/** HTTP version 0.9 is an empty string. */
char const http_version_0_9[] = "";
msg_mclass_t *http_default_mclass(void)
msg_mclass_t const *http_default_mclass(void)
{
extern msg_mclass_t http_mclass[];
extern msg_mclass_t const http_mclass[];
return http_mclass;
}
......
......@@ -95,7 +95,7 @@ SOFIAPUBVAR char const http_version_1_1[];
*/
/** HTTP parser description. */
SOFIAPUBFUN msg_mclass_t *http_default_mclass(void);
SOFIAPUBFUN msg_mclass_t const *http_default_mclass(void);
/** Complete a HTTP request. */
SOFIAPUBFUN int http_request_complete(msg_t *msg);
......
......@@ -890,7 +890,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
unsigned threadpool = agent->sa_tport_threadpool;
char const *sigcomp = agent->sa_sigcomp_options;
char const *algorithm = NONE;
msg_mclass_t *mclass = NONE;
msg_mclass_t const *mclass = NONE;
sip_contact_t const *aliases = NONE;
url_string_t const *proxy = NONE;
tport_t *tport;
......
......@@ -108,7 +108,7 @@ struct nta_agent_s
uint32_t sa_nw_updates; /* Shall we enable network detector? */
uint32_t sa_flags; /**< Message flags */
msg_mclass_t *sa_mclass;
msg_mclass_t const *sa_mclass;
sip_contact_t *sa_contact;
sip_via_t *sa_vias; /**< @Via headers for all transports */
......
......@@ -59,10 +59,10 @@ NTA_DLL extern tag_typedef_t ntatag_any;
NTA_DLL extern tag_typedef_t ntatag_mclass;
/** Message class used by NTA. @HI */
#define NTATAG_MCLASS(x) ntatag_mclass, tag_ptr_v((x))
#define NTATAG_MCLASS(x) ntatag_mclass, tag_cptr_v((x))
NTA_DLL extern tag_typedef_t ntatag_mclass_ref;
#define NTATAG_MCLASS_REF(x) ntatag_mclass_ref, tag_ptr_vr(&(x), (x))
#define NTATAG_MCLASS_REF(x) ntatag_mclass_ref, tag_cptr_vr(&(x), (x))
NTA_DLL extern tag_typedef_t ntatag_bad_req_mask;
/** Mask for bad request messages.
......
......@@ -1301,10 +1301,10 @@ int main(int argc, char *argv[])
}
if (o_attach) {
char line[10];
char *response, line[10];
printf("nua_test: pid %lu\n", (unsigned long)getpid());
printf("<Press RETURN to continue>\n");
fgets(line, sizeof line, stdin);
response = fgets(line, sizeof line, stdin);
}
#if HAVE_ALARM
else if (o_alarm) {
......
......@@ -704,7 +704,7 @@ server_t *server_create(url_t const *url,
tag_type_t tag, tag_value_t value, ...)
{
server_t *srv;
msg_mclass_t *mclass = NULL;
msg_mclass_t const *mclass = NULL;
tp_name_t tpn[1] = {{ NULL }};
su_root_t *root = NULL;
http_server_t const *server = NULL;
......
......@@ -1211,7 +1211,7 @@ SOFIAPUBVAR tag_typedef_t nutag_outbound_set4_ref;
* nua_create()
*
* @par Parameter type
* msg_mclass_t *
* msg_mclass_t const *
*
* @par Values
* Pointer to an extended SIP parser.
......
......@@ -60,9 +60,9 @@ char const sip_parser_version[] = VERSION;
char const sip_version_2_0[] = "SIP/2.0";
/** Default message class */
extern msg_mclass_t sip_mclass[];
extern msg_mclass_t const sip_mclass[];
msg_mclass_t *sip_default_mclass(void)
msg_mclass_t const *sip_default_mclass(void)
{
return sip_mclass;
}
......
......@@ -58,7 +58,7 @@
SOFIA_BEGIN_DECLS
/** Return built-in SIP parser object. */
SOFIAPUBFUN msg_mclass_t *sip_default_mclass(void);
SOFIAPUBFUN msg_mclass_t const *sip_default_mclass(void);
/** Check that sip_t is a SIP structure (not RTSP or HTTP). @HIDE */
#define sip_is_sip(sip) ((sip) && (sip)->sip_ident == SIP_PROTOCOL_TAG)
......
......@@ -65,7 +65,7 @@ int diff(const char *olds, const char *news, int *linep, int *pos)
return *o != *n;
}
int test_msg_class(msg_mclass_t *mc)
int test_msg_class(msg_mclass_t const *mc)
{
int i, j, N;
......@@ -159,7 +159,7 @@ int main(int argc, char *argv[])
int m, tcp;
sip_t *sip;
int exitcode = 0;
msg_mclass_t *sip_mclass = sip_default_mclass();
msg_mclass_t const *sip_mclass = sip_default_mclass();
msg_t *msg = msg_create(sip_mclass, MSG_FLG_EXTRACT_COPY);
msg_iovec_t iovec[1];
......
......@@ -180,7 +180,7 @@ char *lastpart(char *path)
return path;
}
msg_mclass_t *mclass = NULL;
msg_mclass_t const *mclass = NULL;
int validate_file(int fd, char const *name, context_t *ctx);
int validate_dump(char *, off_t, context_t *ctx);
......
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