Lines Matching refs:br
38 void Curl_bufref_init(struct bufref *br) in Curl_bufref_init() argument
40 DEBUGASSERT(br); in Curl_bufref_init()
41 br->dtor = NULL; in Curl_bufref_init()
42 br->ptr = NULL; in Curl_bufref_init()
43 br->len = 0; in Curl_bufref_init()
46 br->signature = SIGNATURE; in Curl_bufref_init()
55 void Curl_bufref_free(struct bufref *br) in Curl_bufref_free() argument
57 DEBUGASSERT(br); in Curl_bufref_free()
58 DEBUGASSERT(br->signature == SIGNATURE); in Curl_bufref_free()
59 DEBUGASSERT(br->ptr || !br->len); in Curl_bufref_free()
61 if(br->ptr && br->dtor) in Curl_bufref_free()
62 br->dtor((void *) br->ptr); in Curl_bufref_free()
64 br->dtor = NULL; in Curl_bufref_free()
65 br->ptr = NULL; in Curl_bufref_free()
66 br->len = 0; in Curl_bufref_free()
73 void Curl_bufref_set(struct bufref *br, const void *ptr, size_t len, in Curl_bufref_set() argument
79 Curl_bufref_free(br); in Curl_bufref_set()
80 br->ptr = (const unsigned char *) ptr; in Curl_bufref_set()
81 br->len = len; in Curl_bufref_set()
82 br->dtor = dtor; in Curl_bufref_set()
88 const unsigned char *Curl_bufref_ptr(const struct bufref *br) in Curl_bufref_ptr() argument
90 DEBUGASSERT(br); in Curl_bufref_ptr()
91 DEBUGASSERT(br->signature == SIGNATURE); in Curl_bufref_ptr()
92 DEBUGASSERT(br->ptr || !br->len); in Curl_bufref_ptr()
94 return br->ptr; in Curl_bufref_ptr()
100 size_t Curl_bufref_len(const struct bufref *br) in Curl_bufref_len() argument
102 DEBUGASSERT(br); in Curl_bufref_len()
103 DEBUGASSERT(br->signature == SIGNATURE); in Curl_bufref_len()
104 DEBUGASSERT(br->ptr || !br->len); in Curl_bufref_len()
106 return br->len; in Curl_bufref_len()
109 CURLcode Curl_bufref_memdup(struct bufref *br, const void *ptr, size_t len) in Curl_bufref_memdup() argument
113 DEBUGASSERT(br); in Curl_bufref_memdup()
114 DEBUGASSERT(br->signature == SIGNATURE); in Curl_bufref_memdup()
115 DEBUGASSERT(br->ptr || !br->len); in Curl_bufref_memdup()
125 Curl_bufref_set(br, cpy, len, curl_free); in Curl_bufref_memdup()