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

📄 sip_extra.h

📁 Sofia SIP is an open-source SIP User-Agent library, compliant with the IETF RFC3261 specification.
💻 H
📖 第 1 页 / 共 5 页
字号:
 *  sip_remote_party_id_t sip_remote_party_id; *  *  sip_remote_party_id_init(&sip_remote_party_id); *  * @endcode * @HI * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline sip_remote_party_id_t *sip_remote_party_id_init(sip_remote_party_id_t x[1]){  return SIP_HEADER_INIT(x, sip_remote_party_id_class, sizeof(sip_remote_party_id_t));}#else#define sip_remote_party_id_init(x) \  SIP_HEADER_INIT(x, sip_remote_party_id_class, sizeof(sip_remote_party_id_t))#endif/**Test if header object is instance of #sip_remote_party_id_t. *  * Check if the header class is an instance of * @ref sip_remote_party_id "Remote-Party-ID 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 remote_party_id  * @retval 0 (false) otherwise * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline int sip_is_remote_party_id(sip_header_t const *header){  return header && header->sh_class->hc_hash == sip_remote_party_id_hash;}#elseint sip_is_remote_party_id(sip_header_t const *header);#endif#define sip_remote_party_id_p(h) sip_is_remote_party_id((h))/**Duplicate a list of @ref sip_remote_party_id "Remote-Party-ID header" header structures #sip_remote_party_id_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 *  *   remote_party_id = sip_remote_party_id_dup(home, sip->sip_remote_party_id); *  * @endcode *  * @return * A pointer to the * newly duplicated #sip_remote_party_id_t header structure, or NULL * upon an error. * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline#endifsip_remote_party_id_t *sip_remote_party_id_dup(su_home_t *home, sip_remote_party_id_t const *hdr)      __attribute__((__malloc__));#if SU_HAVE_INLINEsu_inlinesip_remote_party_id_t *sip_remote_party_id_dup(su_home_t *home, sip_remote_party_id_t const *hdr){   return (sip_remote_party_id_t *)    msg_header_dup_as(home, sip_remote_party_id_class, (msg_header_t const *)hdr);}#endif/**Copy a list of @ref sip_remote_party_id "Remote-Party-ID header" header structures #sip_remote_party_id_t. *  * The function sip_remote_party_id_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 *  *   remote_party_id = sip_remote_party_id_copy(home, sip->sip_remote_party_id); *  * @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_remote_party_id_t *sip_remote_party_id_copy(su_home_t *home, sip_remote_party_id_t const *hdr)      __attribute__((__malloc__));#if SU_HAVE_INLINEsu_inlinesip_remote_party_id_t *sip_remote_party_id_copy(su_home_t *home, sip_remote_party_id_t const *hdr) {   return (sip_remote_party_id_t *)    msg_header_copy_as(home, sip_remote_party_id_class, (msg_header_t const *)hdr); }#endif/**Make a @ref sip_remote_party_id "Remote-Party-ID header" structure #sip_remote_party_id_t. *  * The function sip_remote_party_id_make() makes a new * #sip_remote_party_id_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_remote_party_id_t header structure, or NULL upon an * error. * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline #endifsip_remote_party_id_t *sip_remote_party_id_make(su_home_t *home, char const *s)     __attribute__((__malloc__));#if SU_HAVE_INLINEsu_inline sip_remote_party_id_t *sip_remote_party_id_make(su_home_t *home, char const *s){  return (sip_remote_party_id_t *)sip_header_make(home, sip_remote_party_id_class, s);}#endif/**Make a @ref sip_remote_party_id "Remote-Party-ID header" from formatting result. *  * Make a new #sip_remote_party_id_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_remote_party_id_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_remote_party_id_t *sip_remote_party_id_format(su_home_t *home, char const *fmt, ...)     __attribute__((__malloc__, __format__ (printf, 2, 3)));#if SU_HAVE_INLINEsu_inline sip_remote_party_id_t *sip_remote_party_id_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_remote_party_id_class, fmt, ap);  va_end(ap);   return (sip_remote_party_id_t *)h;}#endif/** @} *//**@ingroup sip_remote_party_id * * Tag list item for pointer to a @ref sip_remote_party_id "Remote-Party-ID header" * structure #sip_remote_party_id_t. * * The SIPTAG_REMOTE_PARTY_ID() macro is used to include a tag item with a * pointer to a #sip_remote_party_id_t structure in a tag list. * * @param x pointer to a #sip_remote_party_id_t structure, or NULL. * * The corresponding tag taking reference parameter is  * SIPTAG_REMOTE_PARTY_ID_REF(). * * @since New in @NEW_1_12_7. * * @HIDE */#define SIPTAG_REMOTE_PARTY_ID(x) siptag_remote_party_id, siptag_remote_party_id_v(x)SOFIAPUBVAR tag_typedef_t siptag_remote_party_id;/**@ingroup sip_remote_party_id * Tag list item for reference to a  * @ref sip_remote_party_id "Remote-Party-ID header" pointer. */#define SIPTAG_REMOTE_PARTY_ID_REF(x) siptag_remote_party_id_ref, siptag_remote_party_id_vr(&(x))SOFIAPUBVAR tag_typedef_t siptag_remote_party_id_ref;/**@ingroup sip_remote_party_id * * Tag list item for string with @ref sip_remote_party_id "Remote-Party-ID header" value. * * The SIPTAG_REMOTE_PARTY_ID_STR() macro is used to include a tag item with a  * string containing value of a #sip_remote_party_id_t header in a tag list. * * @param s pointer to a string containing  *    @ref sip_remote_party_id "Remote-Party-ID header" value, or NULL. * * The string in SIPTAG_REMOTE_PARTY_ID_STR() can be converted to a * #sip_remote_party_id_t header structure by giving the string @a s has * second argument to function sip_remote_party_id_make(). * * The corresponding tag taking reference parameter is  * SIPTAG_REMOTE_PARTY_ID_STR_REF(). * * @since New in @NEW_1_12_7. * * @HIDE */#define SIPTAG_REMOTE_PARTY_ID_STR(s) siptag_remote_party_id_str, tag_str_v(s)SOFIAPUBVAR tag_typedef_t siptag_remote_party_id_str;/**@ingroup sip_remote_party_id * Tag list item for reference to a * @ref sip_remote_party_id "Remote-Party-ID header" string. */#define SIPTAG_REMOTE_PARTY_ID_STR_REF(x) siptag_remote_party_id_str_ref, tag_str_vr(&(x))SOFIAPUBVAR tag_typedef_t siptag_remote_party_id_str_ref;#if SU_INLINE_TAG_CASTsu_inline tag_value_tsiptag_remote_party_id_v(sip_remote_party_id_t const *v){ return (tag_value_t)v; }su_inline tag_value_tsiptag_remote_party_id_vr(sip_remote_party_id_t const **vp){ return (tag_value_t)vp; }#else#define siptag_remote_party_id_v(v)   (tag_value_t)(v)#define siptag_remote_party_id_vr(vp) (tag_value_t)(vp)#endif/** Defined as 1 if the @ref sip_p_asserted_identity "P-Asserted-Identity header" is supported */#define SIP_HAVE_P_ASSERTED_IDENTITY 1enum {   /**@ingroup sip_p_asserted_identity @internal    *   * Hash of @ref sip_p_asserted_identity "P-Asserted-Identity header".   *   * @since New in @NEW_1_12_7.   */  sip_p_asserted_identity_hash = 16399 };/**Header class for @ref sip_p_asserted_identity "P-Asserted-Identity header". *  * The header class sip_p_asserted_identity_class defines how a SIP * @ref sip_p_asserted_identity "P-Asserted-Identity header" is parsed and printed. * It also contains methods used by SIP parser and other functions to * manipulate the #sip_p_asserted_identity_t header structure. * * @ingroup sip_p_asserted_identity * * @since New in @NEW_1_12_7. */SIP_DLL extern msg_hclass_t sip_p_asserted_identity_class[];/**@addtogroup sip_p_asserted_identity * @{ *//** Parse a SIP @ref sip_p_asserted_identity "P-Asserted-Identity header". @internal */SOFIAPUBFUN issize_t sip_p_asserted_identity_d(su_home_t *, msg_header_t *,				       char *s, isize_t slen);/** Print a SIP @ref sip_p_asserted_identity "P-Asserted-Identity header". @internal */SOFIAPUBFUN issize_t sip_p_asserted_identity_e(char b[], isize_t bsiz,                    	            msg_header_t const *h, int flags);/**Access a SIP @ref sip_p_asserted_identity "P-Asserted-Identity header" * structure #sip_p_asserted_identity_t from #sip_t. *  * @since New in @NEW_1_12_7. */#define sip_p_asserted_identity(sip) \  ((sip_p_asserted_identity_t *)msg_header_access((msg_pub_t*)(sip), sip_p_asserted_identity_class))/**Initializer for structure #sip_p_asserted_identity_t. *  * A static #sip_p_asserted_identity_t structure for * @ref sip_p_asserted_identity "P-Asserted-Identity header" must be initialized with * the SIP_P_ASSERTED_IDENTITY_INIT() macro.  * For instance, * @code  *  *  sip_p_asserted_identity_t sip_p_asserted_identity = SIP_P_ASSERTED_IDENTITY_INIT; *  * @endcode * @HI * * @since New in @NEW_1_12_7. */#define SIP_P_ASSERTED_IDENTITY_INIT() SIP_HDR_INIT(p_asserted_identity)/**Initialize a structure #sip_p_asserted_identity_t. *  * An #sip_p_asserted_identity_t structure for * @ref sip_p_asserted_identity "P-Asserted-Identity header" can be initialized with the * sip_p_asserted_identity_init() function/macro. For instance, * @code *  *  sip_p_asserted_identity_t sip_p_asserted_identity; *  *  sip_p_asserted_identity_init(&sip_p_asserted_identity); *  * @endcode * @HI * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline sip_p_asserted_identity_t *sip_p_asserted_identity_init(sip_p_asserted_identity_t x[1]){  return SIP_HEADER_INIT(x, sip_p_asserted_identity_class, sizeof(sip_p_asserted_identity_t));}#else#define sip_p_asserted_identity_init(x) \  SIP_HEADER_INIT(x, sip_p_asserted_identity_class, sizeof(sip_p_asserted_identity_t))#endif/**Test if header object is instance of #sip_p_asserted_identity_t. *  * Check if the header class is an instance of * @ref sip_p_asserted_identity "P-Asserted-Identity 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 p_asserted_identity  * @retval 0 (false) otherwise * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline int sip_is_p_asserted_identity(sip_header_t const *header){  return header && header->sh_class->hc_hash == sip_p_asserted_identity_hash;}#elseint sip_is_p_asserted_identity(sip_header_t const *header);#endif#define sip_p_asserted_identity_p(h) sip_is_p_asserted_identity((h))/**Duplicate a list of @ref sip_p_asserted_identity "P-Asserted-Identity header" header structures #sip_p_asserted_identity_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 *  *   p_asserted_identity = sip_p_asserted_identity_dup(home, sip->sip_p_asserted_identity); *  * @endcode *  * @return * A pointer to the * newly duplicated #sip_p_asserted_identity_t header structure, or NULL * upon an error. * * @since New in @NEW_1_12_7. */#if SU_HAVE_INLINEsu_inline#endifsip_p_asserted_identity_t *sip_p_asserted_identity_dup(su_home_t *home, sip_p_asserted_identity_t const *hdr)      __attribute__((__malloc__));

⌨️ 快捷键说明

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