📄 sip_extra.h
字号:
va_list ap; va_start(ap, fmt); h = sip_header_vformat(home, sip_refer_sub_class, fmt, ap); va_end(ap); return (sip_refer_sub_t *)h;}#endif/** @} *//**@ingroup sip_refer_sub * * Tag list item for pointer to a @ref sip_refer_sub "Refer-Sub header" * structure #sip_refer_sub_t. * * The SIPTAG_REFER_SUB() macro is used to include a tag item with a * pointer to a #sip_refer_sub_t structure in a tag list. * * @param x pointer to a #sip_refer_sub_t structure, or NULL. * * The corresponding tag taking reference parameter is * SIPTAG_REFER_SUB_REF(). * * @since New in @NEW_1_12_5. * * @HIDE */#define SIPTAG_REFER_SUB(x) siptag_refer_sub, siptag_refer_sub_v(x)SOFIAPUBVAR tag_typedef_t siptag_refer_sub;/**@ingroup sip_refer_sub * Tag list item for reference to a * @ref sip_refer_sub "Refer-Sub header" pointer. */#define SIPTAG_REFER_SUB_REF(x) siptag_refer_sub_ref, siptag_refer_sub_vr(&(x))SOFIAPUBVAR tag_typedef_t siptag_refer_sub_ref;/**@ingroup sip_refer_sub * * Tag list item for string with @ref sip_refer_sub "Refer-Sub header" value. * * The SIPTAG_REFER_SUB_STR() macro is used to include a tag item with a * string containing value of a #sip_refer_sub_t header in a tag list. * * @param s pointer to a string containing * @ref sip_refer_sub "Refer-Sub header" value, or NULL. * * The string in SIPTAG_REFER_SUB_STR() can be converted to a * #sip_refer_sub_t header structure by giving the string @a s has * second argument to function sip_refer_sub_make(). * * The corresponding tag taking reference parameter is * SIPTAG_REFER_SUB_STR_REF(). * * @since New in @NEW_1_12_5. * * @HIDE */#define SIPTAG_REFER_SUB_STR(s) siptag_refer_sub_str, tag_str_v(s)SOFIAPUBVAR tag_typedef_t siptag_refer_sub_str;/**@ingroup sip_refer_sub * Tag list item for reference to a * @ref sip_refer_sub "Refer-Sub header" string. */#define SIPTAG_REFER_SUB_STR_REF(x) siptag_refer_sub_str_ref, tag_str_vr(&(x))SOFIAPUBVAR tag_typedef_t siptag_refer_sub_str_ref;#if SU_INLINE_TAG_CASTsu_inline tag_value_tsiptag_refer_sub_v(sip_refer_sub_t const *v){ return (tag_value_t)v; }su_inline tag_value_tsiptag_refer_sub_vr(sip_refer_sub_t const **vp){ return (tag_value_t)vp; }#else#define siptag_refer_sub_v(v) (tag_value_t)(v)#define siptag_refer_sub_vr(vp) (tag_value_t)(vp)#endif/** Defined as 1 if the @ref sip_alert_info "Alert-Info header" is supported */#define SIP_HAVE_ALERT_INFO 1enum { /**@ingroup sip_alert_info @internal * * Hash of @ref sip_alert_info "Alert-Info header". * * @since New in @NEW_1_12_7. */ sip_alert_info_hash = 53913 };/**Header class for @ref sip_alert_info "Alert-Info header". * * The header class sip_alert_info_class defines how a SIP * @ref sip_alert_info "Alert-Info header" is parsed and printed. * It also contains methods used by SIP parser and other functions to * manipulate the #sip_alert_info_t header structure. * * @ingroup sip_alert_info * * @since New in @NEW_1_12_7. */SIP_DLL extern msg_hclass_t sip_alert_info_class[];/**@addtogroup sip_alert_info * @{ *//** Parse a SIP @ref sip_alert_info "Alert-Info header". @internal */SOFIAPUBFUN issize_t sip_alert_info_d(su_home_t *, msg_header_t *, char *s, isize_t slen);/** Print a SIP @ref sip_alert_info "Alert-Info header". @internal */SOFIAPUBFUN issize_t sip_alert_info_e(char b[], isize_t bsiz, msg_header_t const *h, int flags);/**Access a SIP @ref sip_alert_info "Alert-Info header" * structure #sip_alert_info_t from #sip_t. * * @since New in @NEW_1_12_7. */#define sip_alert_info(sip) \ ((sip_alert_info_t *)msg_header_access((msg_pub_t*)(sip), sip_alert_info_class))/**Initializer for structure #sip_alert_info_t. * * A static #sip_alert_info_t structure for * @ref sip_alert_info "Alert-Info header" must be initialized with * the SIP_ALERT_INFO_INIT() macro. * For instance, * @code * * sip_alert_info_t sip_alert_info = SIP_ALERT_INFO_INIT; * * @endcode * @HI * * @since New in @NEW_1_12_7. */#define SIP_ALERT_INFO_INIT() SIP_HDR_INIT(alert_info)/**Initialize a structure #sip_alert_info_t. * * An #sip_alert_info_t structure for * @ref sip_alert_info "Alert-Info header" can be initialized with the * sip_alert_info_init() function/macro. For instance, * @code * * sip_alert_info_t sip_alert_info; * * sip_alert_info_init(&sip_alert_info); * * @endcode * @HI * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline sip_alert_info_t *sip_alert_info_init(sip_alert_info_t x[1]){ return SIP_HEADER_INIT(x, sip_alert_info_class, sizeof(sip_alert_info_t));}#else#define sip_alert_info_init(x) \ SIP_HEADER_INIT(x, sip_alert_info_class, sizeof(sip_alert_info_t))#endif/**Test if header object is instance of #sip_alert_info_t. * * Check if the header class is an instance of * @ref sip_alert_info "Alert-Info header" object and return true (nonzero), * otherwise return false (zero). * * @param header pointer to the header structure to be tested * * @retval 1 (true) if the @a header is an instance of header alert_info * @retval 0 (false) otherwise * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline int sip_is_alert_info(sip_header_t const *header){ return header && header->sh_class->hc_hash == sip_alert_info_hash;}#elseint sip_is_alert_info(sip_header_t const *header);#endif#define sip_alert_info_p(h) sip_is_alert_info((h))/**Duplicate a list of @ref sip_alert_info "Alert-Info header" header structures #sip_alert_info_t. * * Duplicate a header * structure @a hdr. If the header structure @a hdr * contains a reference (@c hdr->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 hdr 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 * * alert_info = sip_alert_info_dup(home, sip->sip_alert_info); * * @endcode * * @return * A pointer to the * newly duplicated #sip_alert_info_t header structure, or NULL * upon an error. * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline#endifsip_alert_info_t *sip_alert_info_dup(su_home_t *home, sip_alert_info_t const *hdr) __attribute__((__malloc__));#if SU_HAVE_INLINEsu_inlinesip_alert_info_t *sip_alert_info_dup(su_home_t *home, sip_alert_info_t const *hdr){ return (sip_alert_info_t *) msg_header_dup_as(home, sip_alert_info_class, (msg_header_t const *)hdr);}#endif/**Copy a list of @ref sip_alert_info "Alert-Info header" header structures #sip_alert_info_t. * * The function sip_alert_info_copy() copies a header structure @a * hdr. If the header structure @a hdr contains a reference (@c * hdr->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 list of header * structure @a hdr. * * @param home memory home used to allocate new structure * @param hdr pointer to the header structure to be copied * * 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 hdr header, including the encoding of the * old header, if present. * * @par Example * @code * * alert_info = sip_alert_info_copy(home, sip->sip_alert_info); * * @endcode * * @return * A pointer to newly copied header structure, or NULL upon an error. * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline#endifsip_alert_info_t *sip_alert_info_copy(su_home_t *home, sip_alert_info_t const *hdr) __attribute__((__malloc__));#if SU_HAVE_INLINEsu_inlinesip_alert_info_t *sip_alert_info_copy(su_home_t *home, sip_alert_info_t const *hdr) { return (sip_alert_info_t *) msg_header_copy_as(home, sip_alert_info_class, (msg_header_t const *)hdr); }#endif/**Make a @ref sip_alert_info "Alert-Info header" structure #sip_alert_info_t. * * The function sip_alert_info_make() makes a new * #sip_alert_info_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 * * @return * A pointer to newly maked #sip_alert_info_t header structure, or NULL upon an * error. * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline #endifsip_alert_info_t *sip_alert_info_make(su_home_t *home, char const *s) __attribute__((__malloc__));#if SU_HAVE_INLINEsu_inline sip_alert_info_t *sip_alert_info_make(su_home_t *home, char const *s){ return (sip_alert_info_t *)sip_header_make(home, sip_alert_info_class, s);}#endif/**Make a @ref sip_alert_info "Alert-Info header" from formatting result. * * Make a new #sip_alert_info_t object using formatting 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 parses the * formatting result to the structure #sip_alert_info_t. * * @param home memory home used to allocate new header structure. * @param fmt string used as a printf()-style format * @param ... argument list for format * * @return * A pointer to newly * makes header structure, or NULL upon an error. * * @HIDE * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline#endifsip_alert_info_t *sip_alert_info_format(su_home_t *home, char const *fmt, ...) __attribute__((__malloc__, __format__ (printf, 2, 3)));#if SU_HAVE_INLINEsu_inline sip_alert_info_t *sip_alert_info_format(su_home_t *home, char const *fmt, ...){ sip_header_t *h; va_list ap; va_start(ap, fmt); h = sip_header_vformat(home, sip_alert_info_class, fmt, ap); va_end(ap); return (sip_alert_info_t *)h;}#endif/** @} *//**@ingroup sip_alert_info * * Tag list item for pointer to a @ref sip_alert_info "Alert-Info header" * structure #sip_alert_info_t. * * The SIPTAG_ALERT_INFO() macro is used to include a tag item with a * pointer to a #sip_alert_info_t structure in a tag list. * * @param x pointer to a #sip_alert_info_t structure, or NULL. * * The corresponding tag taking reference parameter is * SIPTAG_ALERT_INFO_REF(). * * @since New in @NEW_1_12_7. * * @HIDE */#define SIPTAG_ALERT_INFO(x) siptag_alert_info, siptag_alert_info_v(x)SOFIAPUBVAR tag_typedef_t siptag_alert_info;/**@ingroup sip_alert_info * Tag list item for reference to a * @ref sip_alert_info "Alert-Info header" pointer. */#define SIPTAG_ALERT_INFO_REF(x) siptag_alert_info_ref, siptag_alert_info_vr(&(x))SOFIAPUBVAR tag_typedef_t siptag_alert_info_ref;/**@ingroup sip_alert_info * * Tag list item for string with @ref sip_alert_info "Alert-Info header" value. * * The SIPTAG_ALERT_INFO_STR() macro is used to include a tag item with a * string containing value of a #sip_alert_info_t header in a tag list. * * @param s pointer to a string containing * @ref sip_alert_info "Alert-Info header" value, or NULL. * * The string in SIPTAG_ALERT_INFO_STR() can be converted to a * #sip_alert_info_t header structure by giving the string @a s has * second argument to function sip_alert_info_make(). * * The corresponding tag taking reference parameter is * SIPTAG_ALERT_INFO_STR_REF(). * * @since New in @NEW_1_12_7. * * @HIDE */#define SIPTAG_ALERT_INFO_STR(s) siptag_alert_info_str, tag_str_v(s)SOFIAPUBVAR tag_typedef_t siptag_alert_info_str;/**@ingroup sip_alert_info * Tag list item for reference to a * @ref sip_alert_info "Alert-Info header" string. */#define SIPTAG_ALERT_INFO_STR_REF(x) siptag_alert_info_str_ref, tag_str_vr(&(x))SOFIAPUBVAR tag_typedef_t siptag_alert_info_str_ref;#if SU_INLINE_TAG_CASTsu_inline tag_value_tsiptag_alert_info_v(sip_alert_info_t const *v){ return (tag_value_t)v; }su_inline tag_value_tsiptag_alert_info_vr(sip_alert_info_t const **vp)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -