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

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