Lines Matching refs:buffer
41 uint8_t *buffer; variable
58 uint8_t *buffer = malloc(*len); in decode_base64_generic() local
59 if (buffer == NULL) in decode_base64_generic()
62 uint8_t *out = buffer; in decode_base64_generic()
97 free(buffer); in decode_base64_generic()
100 *len = out - buffer; in decode_base64_generic()
101 return buffer; in decode_base64_generic()
154 uint8_t *buffer = malloc(*len); in decode_base16() local
155 if (buffer == NULL) in decode_base16()
161 buffer[i] = (c - '0') << 4; in decode_base16()
163 buffer[i] = ((c | 0x20) - 'a' + 10) << 4; in decode_base16()
165 free(buffer); in decode_base16()
171 buffer[i] |= (c - '0'); in decode_base16()
173 buffer[i] |= ((c | 0x20) - 'a' + 10); in decode_base16()
175 free(buffer); in decode_base16()
180 return buffer; in decode_base16()
331 uint8_t *newbuffer = realloc(buffer, buffersize); in decode_json()
336 encoder->data.ptr = newbuffer + (container.data.ptr - buffer); in decode_json()
338 buffer = newbuffer; in decode_json()
436 buffer = malloc(buffersize); in main()
437 if (buffer == NULL) { in main()
443 fsize = fread(buffer, 1, fsize, in); in main()
444 buffer[fsize] = '\0'; in main()
448 buffer = NULL; in main()
450 buffer = realloc(buffer, buffersize + chunk); in main()
451 if (buffer == NULL) in main()
454 buffersize += fread(buffer + buffersize, 1, chunk, in); in main()
456 buffer[buffersize] = '\0'; in main()
467 cJSON *doc = cJSON_ParseWithOpts((char *)buffer, NULL, true); in main()
476 cbor_encoder_init(&encoder, buffer, buffersize, 0); in main()
487 fwrite(buffer, 1, cb.ptr - buffer, stdout); in main()
488 free(buffer); in main()