BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

pjsip_hdr_vptr Struct Reference

#include <sip_msg.h>

Data Fields

void *(* clone )(pj_pool_t *pool, const void *hdr)
 
void *(* shallow_clone )(pj_pool_t *pool, const void *hdr)
 
int(* print_on )(void *hdr, char *buf, pj_size_t len)
 

Detailed Description

This structure provides the pointer to basic functions that are needed for generic header operations. All header fields will have pointer to this structure, so that they can be manipulated uniformly.

Field Documentation

◆ clone

void *(* pjsip_hdr_vptr::clone) (pj_pool_t *pool, const void *hdr)

Function to clone the header.

Parameters
poolMemory pool to allocate the new header.
hdrHeader to clone.
Returns
A new instance of the header.

◆ shallow_clone

void *(* pjsip_hdr_vptr::shallow_clone) (pj_pool_t *pool, const void *hdr)

Pointer to function to shallow clone the header. Shallow cloning will just make a memory copy of the original header, thus all pointers in original header will be kept intact. Because the function does not need to perform deep copy, the operation should be faster, but the application must make sure that the original header is still valid throughout the lifetime of new header.

Parameters
poolMemory pool to allocate the new header.
hdrThe header to clone.

◆ print_on

int(* pjsip_hdr_vptr::print_on) (void *hdr, char *buf, pj_size_t len)

Pointer to function to print the header to the specified buffer. Returns the length of string written, or -1 if the remaining buffer is not enough to hold the header.

Parameters
hdrThe header to print.
bufThe buffer.
lenThe size of the buffer.
Returns
The size copied to buffer, or -1 if there's not enough space.

The documentation for this struct was generated from the following file:

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.