summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-08-01 09:24:58 +0000
committerBenny Prijono <bennylp@teluu.com>2010-08-01 09:24:58 +0000
commit42cd3a38756cc1baef47cd808273435518c56401 (patch)
tree2092f37d8bcc0bb0cb170a08a79a4d382fb92fc2 /pjsip/include/pjsip
parent311528e2bc573606fb611175fbd7b981780664e2 (diff)
Re #1070 (support for multipart bodies): modified the param field of pjsip_media_type from a simple string to pjsip_param, to support a more complex use of this field
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3241 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsip')
-rw-r--r--pjsip/include/pjsip/sip_msg.h49
1 files changed, 48 insertions, 1 deletions
diff --git a/pjsip/include/pjsip/sip_msg.h b/pjsip/include/pjsip/sip_msg.h
index 489fb025..4c112dc9 100644
--- a/pjsip/include/pjsip/sip_msg.h
+++ b/pjsip/include/pjsip/sip_msg.h
@@ -515,11 +515,45 @@ typedef struct pjsip_media_type
{
pj_str_t type; /**< Media type. */
pj_str_t subtype; /**< Media subtype. */
- pj_str_t param; /**< Media type parameters (concatenated). */
+ pjsip_param param; /**< Media type parameters */
} pjsip_media_type;
/**
+ * Initialize the media type with the specified type and subtype string.
+ *
+ * @param mt The media type.
+ * @param type Optionally specify the media type.
+ * @param subtype Optionally specify the media subtype.
+ */
+PJ_DECL(void) pjsip_media_type_init(pjsip_media_type *mt,
+ pj_str_t *type,
+ pj_str_t *subtype);
+
+/**
+ * Initialize the media type with the specified type and subtype string.
+ *
+ * @param mt The media type.
+ * @param type Optionally specify the media type.
+ * @param subtype Optionally specify the media subtype.
+ */
+PJ_DECL(void) pjsip_media_type_init2(pjsip_media_type *mt,
+ char *type,
+ char *subtype);
+
+/**
+ * Compare two media types.
+ *
+ * @param mt1 The first media type.
+ * @param mt2 The second media type.
+ *
+ * @return Zero if both media types are equal, -1 if mt1 < mt2,
+ * 1 if mt1 > mt2.
+ */
+PJ_DECL(int) pjsip_media_type_cmp(const pjsip_media_type *mt1,
+ const pjsip_media_type *mt2);
+
+/**
* Copy SIP media type to another.
*
* @param pool Pool to duplicate strings.
@@ -531,6 +565,19 @@ PJ_DECL(void) pjsip_media_type_cp(pj_pool_t *pool,
const pjsip_media_type *src);
/**
+ * Print media type to the specified buffer.
+ *
+ * @param buf Destination buffer.
+ * @param len Length of the buffer.
+ * @param mt The media type to be printed.
+ *
+ * @return The number of characters printed to the buffer, or -1
+ * if there's not enough space in the buffer.
+ */
+PJ_DECL(int) pjsip_media_type_print(char *buf, unsigned len,
+ const pjsip_media_type *mt);
+
+/**
* @}
*/