⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msg_mime_protos.h

📁 Sofia SIP is an open-source SIP User-Agent library, compliant with the IETF RFC3261 specification.
💻 H
📖 第 1 页 / 共 5 页
字号:
 * @return * The function msg_content_disposition_dup() returns a pointer to the * newly duplicated #msg_content_disposition_t header structure, or NULL * upon an error. */#if SU_HAVE_INLINEsu_inline#endifmsg_content_disposition_t *msg_content_disposition_dup(su_home_t *home, 				 msg_content_disposition_t const *header);#if SU_HAVE_INLINEsu_inlinemsg_content_disposition_t *msg_content_disposition_dup(su_home_t *home, 				 msg_content_disposition_t const *header){  return (msg_content_disposition_t *)    msg_header_dup_as(home, msg_content_disposition_class, (msg_header_t const *)header); }#endif/**Copy an #msg_content_disposition_t header structure. *  * The function msg_content_disposition_copy() copies a header structure @a * header. If the header structure @a header contains a reference * (@c header->h_next) to a list of headers, all the headers in that * list are copied, too. The function uses given memory @a home to * allocate all the memory areas used to copy the header structure * @a header. *  * @param home    memory home used to allocate new structure * @param header  pointer to the header structure to be duplicated *  * When copying, only the header structure and parameter lists * attached to it are duplicated. The new header structure retains * all the references to the strings within the old @a header, * including the encoding of the old header, if present. *  * @par Example * @code *  *   content_disposition = msg_content_disposition_copy(home, msg->msg_content_disposition); *  * @endcode *  * @return * The function msg_content_disposition_copy() returns a pointer to * newly copied header structure, or NULL upon an error. */#if SU_HAVE_INLINEsu_inline#endifmsg_content_disposition_t *msg_content_disposition_copy(su_home_t *home, 				  msg_content_disposition_t const *header);#if SU_HAVE_INLINEsu_inlinemsg_content_disposition_t *msg_content_disposition_copy(su_home_t *home, 				  msg_content_disposition_t const *header){  return (msg_content_disposition_t *)    msg_header_copy_as(home, msg_content_disposition_class, (msg_header_t const *)header); }#endif/**Make a header structure #msg_content_disposition_t. *  * The function msg_content_disposition_make() makes a new #msg_content_disposition_t header * structure. It allocates a new header structure, and decodes the string @a * s as the value of the structure. *  * @param home memory home used to allocate new header structure. * @param s    string to be decoded as value of the new header structure *  * @note This function may be implemented as a macro calling * msg_header_make(). *  * @return * The function msg_content_disposition_make() returns a pointer to newly maked * #msg_content_disposition_t header structure, or NULL upon an error. */#if SU_HAVE_INLINEsu_inline msg_content_disposition_t *msg_content_disposition_make(su_home_t *home, char const *s){  return (msg_content_disposition_t*)msg_header_make(home, msg_content_disposition_class, s);}#elsemsg_content_disposition_t *msg_content_disposition_make(su_home_t *home, char const *s);#endif/**Make a Content-Disposition header from formatting result. *  * The function msg_content_disposition_format() makes a new Content-Disposition header object * using snprintf-formatted result as its value. The function first * prints the arguments according to the format @a fmt specified. Then it * allocates a new header structure, and uses the formatting result as the * header value. *  * @param home   memory home used to allocate new header structure. * @param fmt    string used as a printf()-style format * @param ...    argument list for format *  * @note This function may be implemented as a macro calling * msg_header_format(). *  * @return * The function msg_content_disposition_format() returns a pointer to newly * makes header structure, or NULL upon an error. *  * @HIDE */#if SU_HAVE_INLINEsu_inline#endifmsg_content_disposition_t *msg_content_disposition_format(su_home_t *home, char const *fmt, ...)     __attribute__((__format__ (printf, 2, 3)));#if SU_HAVE_INLINEsu_inline msg_content_disposition_t *msg_content_disposition_format(su_home_t *home, char const *fmt, ...){  msg_header_t *h;  va_list ap;    va_start(ap, fmt);  h = msg_header_vformat(home, msg_content_disposition_class, fmt, ap);  va_end(ap);   return (msg_content_disposition_t*)h;}#endif/** @} *//* Declare internal prototypes for Content-Location header *//**@addtogroup msg_content_location  * @{  */enum {   /** Hash of Content-Location header. @internal */  msg_content_location_hash = 3453 };/** Parse a Content-Location header. @internal */MSG_DLL msg_parse_f msg_content_location_d;/** Print a Content-Location header. @internal */MSG_DLL msg_print_f msg_content_location_e;MSG_DLL msg_xtra_f msg_content_location_dup_xtra;MSG_DLL msg_dup_f msg_content_location_dup_one;/**Header class for Content-Location header. *  * The header class msg_content_location_class defines how a  * Content-Location header header is parsed and printed.  It also * contains methods used by message parser and other functions * to manipulate the #msg_content_location_t header structure. *  */#ifndef msg_content_location_classMSG_DLL extern msg_hclass_t msg_content_location_class[];#endif/**Initializer for an #msg_content_location_t structure. *  * A static msg_content_location_t structure must be initialized * with the MSG_CONTENT_LOCATION_INIT() macro. For instance, * @code  *  *  msg_content_location_t msg_content_location = MSG_CONTENT_LOCATION_INIT; *  * @endcode * @HI */#define MSG_CONTENT_LOCATION_INIT() MSG_HDR_INIT(content_location)/**Initialize an #msg_content_location_t structure. *  * An #msg_content_location_t structure can be initialized with the * msg_content_location_init() function/macro. For instance, * @code *  *  msg_content_location_t msg_content_location; *  *  msg_content_location_init(&msg_content_location); *  * @endcode *  * @param x pointer to #msg_content_location_t structure  */#if SU_HAVE_INLINEsu_inline msg_content_location_t *msg_content_location_init(msg_content_location_t x[1]){  return MSG_HEADER_INIT(x, msg_content_location_class, sizeof(msg_content_location_t));}#else#define msg_content_location_init(x) \  MSG_HEADER_INIT(x, msg_content_location_class, sizeof(msg_content_location_t))#endif/**Test if header object is an instance of #msg_content_location_t. *  * The function msg_is_content_location() returns true (nonzero) if * the header class is an instance of Content-Location header * object and false (zero) otherwise. *  * @param header pointer to the header structure to be tested *  * @return The function msg_is_content_location() returns true (nonzero) if the * header object is an instance of header Content-Location header and false (zero) * otherwise. */#if SU_HAVE_INLINEsu_inline int msg_is_content_location(msg_header_t const *header){  return header && header->sh_class->hc_hash == msg_content_location_hash;}#elseint msg_is_content_location(msg_header_t const *header);#endif#define msg_content_location_p(h) msg_is_content_location((h))/**Duplicate (deep copy) #msg_content_location_t. *  * The function msg_content_location_dup() duplicates a header structure @a * header. If the header structure @a header contains a reference * (@c header->x_next) to a list of headers, all the headers in the * list are duplicated, too. *  * @param home   memory home used to allocate new structure * @param header header structure to be duplicated *  * When duplicating, all parameter lists and non-constant strings * attached to the header are copied, too. The function uses given * memory @a home to allocate all the memory areas used to copy the * header. *  * @par Example * @code *  *   content_location = msg_content_location_dup(home, msg->msg_content_location); *  * @endcode *  * @return * The function msg_content_location_dup() returns a pointer to the * newly duplicated #msg_content_location_t header structure, or NULL * upon an error. */#if SU_HAVE_INLINEsu_inline#endifmsg_content_location_t *msg_content_location_dup(su_home_t *home, 				 msg_content_location_t const *header);#if SU_HAVE_INLINEsu_inlinemsg_content_location_t *msg_content_location_dup(su_home_t *home, 				 msg_content_location_t const *header){  return (msg_content_location_t *)    msg_header_dup_as(home, msg_content_location_class, (msg_header_t const *)header); }#endif/**Copy an #msg_content_location_t header structure. *  * The function msg_content_location_copy() copies a header structure @a * header. If the header structure @a header contains a reference * (@c header->h_next) to a list of headers, all the headers in that * list are copied, too. The function uses given memory @a home to * allocate all the memory areas used to copy the header structure * @a header. *  * @param home    memory home used to allocate new structure * @param header  pointer to the header structure to be duplicated *  * When copying, only the header structure and parameter lists * attached to it are duplicated. The new header structure retains * all the references to the strings within the old @a header, * including the encoding of the old header, if present. *  * @par Example * @code *  *   content_location = msg_content_location_copy(home, msg->msg_content_location); *  * @endcode *  * @return * The function msg_content_location_copy() returns a pointer to * newly copied header structure, or NULL upon an error. */#if SU_HAVE_INLINEsu_inline#endifmsg_content_location_t *msg_content_location_copy(su_home_t *home, 				  msg_content_location_t const *header);#if SU_HAVE_INLINEsu_inlinemsg_content_location_t *msg_content_location_copy(su_home_t *home, 				  msg_content_location_t const *header){  return (msg_content_location_t *)    msg_header_copy_as(home, msg_content_location_class, (msg_header_t const *)header); }#endif/**Make a header structure #msg_content_location_t. *  * The function msg_content_location_make() makes a new #msg_content_location_t header * structure. It allocates a new header structure, and decodes the string @a * s as the value of the structure. *  * @param home memory home used to allocate new header structure. * @param s    string to be decoded as value of the new header structure *  * @note This function may be implemented as a macro calling * msg_header_make(). *  * @return * The function msg_content_location_make() returns a pointer to newly maked * #msg_content_location_t header structure, or NULL upon an error. */#if SU_HAVE_INLINEsu_inline msg_content_location_t *msg_content_location_make(su_home_t *home, char const *s){  return (msg_content_location_t*)msg_header_make(home, msg_content_location_class, s);}#elsemsg_content_location_t *msg_content_location_make(su_home_t *home, char const *s);#endif/**Make a Content-Location header from formatting result. *  * The function msg_content_location_format() makes a new Content-Location header object * using snprintf-formatted result as its value. The function first * prints the arguments according to the format @a fmt specified. Then it * allocates a new header structure, and uses the formatting result as the * header value. *  * @param home   memory home used to allocate new header structure. * @param fmt    string used as a printf()-style format * @param ...    argument list for format *  * @note This function may be implemented as a macro calling * msg_header_format(). *  * @return * The function msg_content_location_format() returns a pointer to newly * makes header structure, or NULL upon an error. *  * @HIDE */#if SU_HAVE_INLINEsu_inline#endifmsg_content_location_t *msg_content_location_format(su_home_t *home, char const *fmt, ...)     __attribute__((__format__ (printf, 2, 3)));#if SU_HAVE_INLINEsu_inline msg_content_location_t *msg_content_location_format(su_home_t *home, char const *fmt, ...){  msg_header_t *h;  va_list ap;    va_start(ap, fmt);  h = msg_header_vformat(home, msg_content_location_class, fmt, ap);  va_end(ap);   return (msg_content_location_t*)h;}#endif/** @} *//* Declare internal prototypes for Content-ID header *//**@addtogroup msg_content_id  * @{  */enum {   /** Hash of Content-ID header. @internal */  msg_content_id_hash = 42909 };/** Parse a Content-ID header. @internal */MSG_DLL msg_parse_f msg_content_id_d;/** Print a Content-ID header. @internal */MSG_DLL msg_print_f msg_content_id_e;MSG_DLL msg_xtra_f msg_content_id_dup_xtra;MSG_DLL msg_dup_f msg_content_id_dup_one;/**Header class for Content-ID header. *  * The header class msg_content_id_class defines how a  * Content-ID header header is parsed and printed.  It also * contains methods used by message parser and other functions * to manipulate the #msg_content_id_t header structure. *  */#ifndef msg_content_id_classMSG_DLL extern msg_hclass_t msg_content_id_class[];#endif/**Initializer for an #msg_content_id_t structure. *  * A static msg_content_id_t structure must be initialized * with the MSG_CONTENT_ID_INIT() macro. For instance,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -