Lines Matching refs:b
24 void buffer_new(struct buffer_st *b) in buffer_new() argument
26 b->length = 512; in buffer_new()
27 b->data = malloc(sizeof(char)*(b->length)); in buffer_new()
28 b->data[0] = 0; in buffer_new()
29 b->ptr = b->data; in buffer_new()
30 b->offset = 0; in buffer_new()
33 void buffer_add(struct buffer_st *b, char c) in buffer_add() argument
35 if ((INT_MAX - b->length) <= 512) { in buffer_add()
38 *(b->ptr++) = c; in buffer_add()
39 b->offset++; in buffer_add()
40 if (b->offset == b->length) { in buffer_add()
41 b->length += 512; in buffer_add()
42 b->data = realloc(b->data, b->length); in buffer_add()
43 b->ptr = b->data + b->offset; in buffer_add()
47 void buffer_delete(struct buffer_st *b) in buffer_delete() argument
49 free(b->data); in buffer_delete()
50 b->length = 0; in buffer_delete()
51 b->offset = 0; in buffer_delete()
52 b->ptr = NULL; in buffer_delete()
53 b->data = NULL; in buffer_delete()
56 void base64_encode_xmlrpc(struct buffer_st *b, const char *source, int length) in base64_encode_xmlrpc() argument
64 buffer_new(b); in base64_encode_xmlrpc()
109 buffer_add(b, ogroup[i]); in base64_encode_xmlrpc()
110 if (!(b->offset % 72)) { in base64_encode_xmlrpc()
112 buffer_add(b, '\n'); in base64_encode_xmlrpc()
118 buffer_add(b, '\n'); in base64_encode_xmlrpc()
150 unsigned char a[4], b[4], o[3]; in base64_decode_xmlrpc() local
182 b[i] = (unsigned char) dtable[c]; in base64_decode_xmlrpc()
184 o[0] = (b[0] << 2) | (b[1] >> 4); in base64_decode_xmlrpc()
185 o[1] = (b[1] << 4) | (b[2] >> 2); in base64_decode_xmlrpc()
186 o[2] = (b[2] << 6) | b[3]; in base64_decode_xmlrpc()