/freebsd/contrib/ldns/ldns/ |
H A D | buffer.h | 77 ldns_buffer_invariant(const ldns_buffer *ATTR_UNUSED(buffer)) in ldns_buffer_invariant() argument 82 ldns_buffer_invariant(const ldns_buffer *buffer) in ldns_buffer_invariant() argument 84 assert(buffer != NULL); in ldns_buffer_invariant() 85 assert(buffer->_position <= buffer->_limit); in ldns_buffer_invariant() 86 assert(buffer->_limit <= buffer->_capacity); in ldns_buffer_invariant() 87 assert(buffer->_data != NULL); in ldns_buffer_invariant() 108 void ldns_buffer_new_frm_data(ldns_buffer *buffer, const void *data, size_t size); 115 INLINE void ldns_buffer_clear(ldns_buffer *buffer) in ldns_buffer_clear() argument 117 ldns_buffer_invariant(buffer); in ldns_buffer_clear() 121 buffer->_position = 0; in ldns_buffer_clear() [all …]
|
/freebsd/contrib/unbound/sldns/ |
H A D | sbuffer.h | 142 sldns_buffer_invariant(sldns_buffer *ATTR_UNUSED(buffer)) in sldns_buffer_invariant() argument 147 sldns_buffer_invariant(sldns_buffer *buffer) in sldns_buffer_invariant() argument 149 assert(buffer != NULL); in sldns_buffer_invariant() 150 assert(buffer->_position <= buffer->_limit); in sldns_buffer_invariant() 151 assert(buffer->_limit <= buffer->_capacity); in sldns_buffer_invariant() 152 assert(buffer->_data != NULL); in sldns_buffer_invariant() 173 void sldns_buffer_new_frm_data(sldns_buffer *buffer, void *data, size_t size); 182 void sldns_buffer_init_frm_data(sldns_buffer *buffer, void *data, size_t size); 189 INLINE void sldns_buffer_clear(sldns_buffer *buffer) in sldns_buffer_clear() argument 191 sldns_buffer_invariant(buffer); in sldns_buffer_clear() [all …]
|
H A D | sbuffer.c | 21 sldns_buffer *buffer = (sldns_buffer*)malloc(sizeof(sldns_buffer)); in sldns_buffer_new() local 23 if (!buffer) { in sldns_buffer_new() 27 buffer->_data = (uint8_t *) malloc(capacity); in sldns_buffer_new() 28 if (!buffer->_data) { in sldns_buffer_new() 29 free(buffer); in sldns_buffer_new() 33 buffer->_position = 0; in sldns_buffer_new() 34 buffer->_limit = buffer->_capacity = capacity; in sldns_buffer_new() 35 buffer->_fixed = 0; in sldns_buffer_new() 36 buffer->_status_err = 0; in sldns_buffer_new() 38 sldns_buffer_invariant(buffer); in sldns_buffer_new() [all …]
|
/freebsd/contrib/ldns/ |
H A D | buffer.c | 18 ldns_buffer *buffer = LDNS_MALLOC(ldns_buffer); in ldns_buffer_new() local 20 if (!buffer) { in ldns_buffer_new() 24 buffer->_data = (uint8_t *) LDNS_XMALLOC(uint8_t, capacity); in ldns_buffer_new() 25 if (!buffer->_data) { in ldns_buffer_new() 26 LDNS_FREE(buffer); in ldns_buffer_new() 30 buffer->_position = 0; in ldns_buffer_new() 31 buffer->_limit = buffer->_capacity = capacity; in ldns_buffer_new() 32 buffer->_fixed = 0; in ldns_buffer_new() 33 buffer->_status = LDNS_STATUS_OK; in ldns_buffer_new() 35 ldns_buffer_invariant(buffer); in ldns_buffer_new() [all …]
|
H A D | host2wire.c | 20 ldns_dname2buffer_wire(ldns_buffer *buffer, const ldns_rdf *name) in ldns_dname2buffer_wire() argument 22 return ldns_dname2buffer_wire_compress(buffer, name, NULL); in ldns_dname2buffer_wire() 26 ldns_dname2buffer_wire_compress(ldns_buffer *buffer, const ldns_rdf *name, ldns_rbtree_t *compressi… in ldns_dname2buffer_wire_compress() argument 38 if (ldns_buffer_reserve(buffer, ldns_rdf_size(name))) in ldns_dname2buffer_wire_compress() 40 ldns_buffer_write(buffer, ldns_rdf_data(name), ldns_rdf_size(name)); in ldns_dname2buffer_wire_compress() 42 return ldns_buffer_status(buffer); in ldns_dname2buffer_wire_compress() 48 if(ldns_buffer_reserve(buffer,1)) in ldns_dname2buffer_wire_compress() 50 ldns_buffer_write_u8(buffer, 0); in ldns_dname2buffer_wire_compress() 52 return ldns_buffer_status(buffer); in ldns_dname2buffer_wire_compress() 60 if (ldns_buffer_reserve(buffer, 2)) in ldns_dname2buffer_wire_compress() [all …]
|
/freebsd/contrib/libcbor/test/ |
H A D | float_ctrl_encoders_test.c | 12 unsigned char buffer[512]; variable 15 assert_size_equal(1, cbor_encode_bool(false, buffer, 512)); in test_bools() 16 assert_memory_equal(buffer, ((unsigned char[]){0xF4}), 1); in test_bools() 17 assert_size_equal(1, cbor_encode_bool(true, buffer, 512)); in test_bools() 18 assert_memory_equal(buffer, ((unsigned char[]){0xF5}), 1); in test_bools() 22 assert_size_equal(1, cbor_encode_null(buffer, 512)); in test_null() 23 assert_memory_equal(buffer, ((unsigned char[]){0xF6}), 1); in test_null() 27 assert_size_equal(1, cbor_encode_undef(buffer, 512)); in test_undef() 28 assert_memory_equal(buffer, ((unsigned char[]){0xF7}), 1); in test_undef() 32 assert_size_equal(1, cbor_encode_break(buffer, 512)); in test_break() [all …]
|
H A D | negint_encoders_test.c | 11 unsigned char buffer[512]; variable 14 assert_size_equal(1, cbor_encode_negint8(14, buffer, 512)); in test_embedded_negint8() 15 assert_memory_equal(buffer, (unsigned char[]){0x2E}, 1); in test_embedded_negint8() 19 assert_size_equal(0, cbor_encode_negint8(180, buffer, 1)); in test_negint8() 20 assert_size_equal(2, cbor_encode_negint8(255, buffer, 512)); in test_negint8() 21 assert_memory_equal(buffer, ((unsigned char[]){0x38, 0xFF}), 2); in test_negint8() 25 assert_size_equal(0, cbor_encode_negint16(1000, buffer, 2)); in test_negint16() 26 assert_size_equal(3, cbor_encode_negint16(1000, buffer, 512)); in test_negint16() 27 assert_memory_equal(buffer, ((unsigned char[]){0x39, 0x03, 0xE8}), 3); in test_negint16() 31 assert_size_equal(0, cbor_encode_negint32(1000000, buffer, 4)); in test_negint32() [all …]
|
H A D | uint_encoders_test.c | 11 unsigned char buffer[512]; variable 14 assert_size_equal(1, cbor_encode_uint8(14, buffer, 512)); in test_embedded_uint8() 15 assert_memory_equal(buffer, (unsigned char[]){0x0E}, 1); in test_embedded_uint8() 19 assert_size_equal(0, cbor_encode_uint8(180, buffer, 1)); in test_uint8() 20 assert_size_equal(2, cbor_encode_uint8(255, buffer, 512)); in test_uint8() 21 assert_memory_equal(buffer, ((unsigned char[]){0x18, 0xFF}), 2); in test_uint8() 25 assert_size_equal(0, cbor_encode_uint16(1000, buffer, 2)); in test_uint16() 26 assert_size_equal(3, cbor_encode_uint16(1000, buffer, 512)); in test_uint16() 27 assert_memory_equal(buffer, ((unsigned char[]){0x19, 0x03, 0xE8}), 3); in test_uint16() 31 assert_size_equal(0, cbor_encode_uint32(1000000, buffer, 4)); in test_uint32() [all …]
|
/freebsd/contrib/libcbor/src/cbor/ |
H A D | encoding.c | 11 size_t cbor_encode_uint8(uint8_t value, unsigned char *buffer, in cbor_encode_uint8() argument 13 return _cbor_encode_uint8(value, buffer, buffer_size, 0x00); in cbor_encode_uint8() 16 size_t cbor_encode_uint16(uint16_t value, unsigned char *buffer, in cbor_encode_uint16() argument 18 return _cbor_encode_uint16(value, buffer, buffer_size, 0x00); in cbor_encode_uint16() 21 size_t cbor_encode_uint32(uint32_t value, unsigned char *buffer, in cbor_encode_uint32() argument 23 return _cbor_encode_uint32(value, buffer, buffer_size, 0x00); in cbor_encode_uint32() 26 size_t cbor_encode_uint64(uint64_t value, unsigned char *buffer, in cbor_encode_uint64() argument 28 return _cbor_encode_uint64(value, buffer, buffer_size, 0x00); in cbor_encode_uint64() 31 size_t cbor_encode_uint(uint64_t value, unsigned char *buffer, in cbor_encode_uint() argument 33 return _cbor_encode_uint(value, buffer, buffer_size, 0x00); in cbor_encode_uint() [all …]
|
H A D | serialization.c | 20 size_t cbor_serialize(const cbor_item_t *item, unsigned char *buffer, in cbor_serialize() argument 25 return cbor_serialize_uint(item, buffer, buffer_size); in cbor_serialize() 27 return cbor_serialize_negint(item, buffer, buffer_size); in cbor_serialize() 29 return cbor_serialize_bytestring(item, buffer, buffer_size); in cbor_serialize() 31 return cbor_serialize_string(item, buffer, buffer_size); in cbor_serialize() 33 return cbor_serialize_array(item, buffer, buffer_size); in cbor_serialize() 35 return cbor_serialize_map(item, buffer, buffer_size); in cbor_serialize() 37 return cbor_serialize_tag(item, buffer, buffer_size); in cbor_serialize() 39 return cbor_serialize_float_ctrl(item, buffer, buffer_size); in cbor_serialize() 154 size_t cbor_serialize_alloc(const cbor_item_t *item, unsigned char **buffer, in cbor_serialize_alloc() argument [all …]
|
/freebsd/contrib/libcbor/src/cbor/internal/ |
H A D | encoders.c | 11 size_t _cbor_encode_uint8(uint8_t value, unsigned char *buffer, in _cbor_encode_uint8() argument 15 buffer[0] = value + offset; in _cbor_encode_uint8() 20 buffer[0] = 0x18 + offset; in _cbor_encode_uint8() 21 buffer[1] = value; in _cbor_encode_uint8() 28 size_t _cbor_encode_uint16(uint16_t value, unsigned char *buffer, in _cbor_encode_uint16() argument 31 buffer[0] = 0x19 + offset; in _cbor_encode_uint16() 34 memcpy(buffer + 1, &value, 2); in _cbor_encode_uint16() 36 buffer[1] = (unsigned char)(value >> 8); in _cbor_encode_uint16() 37 buffer[2] = (unsigned char)value; in _cbor_encode_uint16() 45 size_t _cbor_encode_uint32(uint32_t value, unsigned char *buffer, in _cbor_encode_uint32() argument [all …]
|
/freebsd/usr.sbin/bluetooth/hccontrol/ |
H A D | adv_data.c | 41 static char* const adv_data2str(int len, uint8_t* data, char* buffer, 43 static char* const adv_name2str(int len, uint8_t* advdata, char* buffer, 45 static char* const adv_uuid2str(int datalen, uint8_t* data, char* buffer, 63 char buffer[2048]; in print_adv_data() local 76 buffer, in print_adv_data() 77 sizeof(buffer))); in print_adv_data() 86 buffer, in print_adv_data() 87 sizeof(buffer))); in print_adv_data() 96 buffer, in print_adv_data() 97 sizeof(buffer))); in print_adv_data() [all …]
|
H A D | util.c | 124 hci_hmode2str(int mode, char *buffer, int size) in hci_hmode2str() argument 132 if (buffer != NULL && size > 0) { in hci_hmode2str() 135 memset(buffer, 0, size); in hci_hmode2str() 138 int len = strlen(buffer); in hci_hmode2str() 143 strncat(buffer, t[n], size - len); in hci_hmode2str() 147 return (buffer); in hci_hmode2str() 2432 hci_commands2str(uint8_t *commands, char *buffer, int size) in hci_commands2str() argument 2896 if (buffer != NULL && size > 0) { in hci_commands2str() 2899 memset(buffer, 0, size); in hci_commands2str() 2905 len0 = strlen(buffer); in hci_commands2str() [all …]
|
/freebsd/sys/dev/pms/RefTisa/sallsdk/spc/ |
H A D | sautil.c | 548 bit8 *buffer = (bit8 *)a; in siPrintBuffer() local 561 *(buffer), in siPrintBuffer() 562 *(buffer+1), in siPrintBuffer() 563 *(buffer+2), in siPrintBuffer() 564 *(buffer+3), in siPrintBuffer() 565 *(buffer+4), in siPrintBuffer() 566 *(buffer+5), in siPrintBuffer() 567 *(buffer+6), in siPrintBuffer() 568 *(buffer+7), in siPrintBuffer() 569 *(buffer+8), in siPrintBuffer() [all …]
|
/freebsd/contrib/processor-trace/libipt/test/src/ |
H A D | ptunit-image.c | 300 static int ifix_read(const struct pt_section *section, uint8_t *buffer, in ifix_read() argument 306 if (!section || !buffer) in ifix_read() 330 memcpy(buffer, &mapping->content[begin], size); in ifix_read() 380 int pt_section_read(const struct pt_section *section, uint8_t *buffer, in pt_section_read() argument 389 return section->read(section, buffer, size, offset); in pt_section_read() 393 static int image_readmem_callback(uint8_t *buffer, size_t size, in image_readmem_callback() argument 402 if (!buffer) in image_readmem_callback() 416 buffer[idx] = memory[ip + idx]; in image_readmem_callback() 536 uint8_t buffer[] = { 0xcc, 0xcc }; in read_empty() local 542 status = pt_image_read(&ifix->image, &isid, buffer, sizeof(buffer), in read_empty() [all …]
|
/freebsd/contrib/ncurses/ncurses/tinfo/ |
H A D | comp_expand.c | 63 static char *buffer; in _nc_tic_expand() local 78 if (buffer != 0) { in _nc_tic_expand() 79 FreeAndNull(buffer); in _nc_tic_expand() 85 if (buffer == 0 || need > length) { in _nc_tic_expand() 86 if ((buffer = typeRealloc(char, length = need, buffer)) == 0) in _nc_tic_expand() 97 buffer[bufp++] = *str++; in _nc_tic_expand() 109 _nc_SPRINTF(buffer + bufp, _nc_SLIMIT(P_LIMIT(bufp)) in _nc_tic_expand() 111 bufp += (int) strlen(buffer + bufp); in _nc_tic_expand() 114 buffer[bufp++] = *str; in _nc_tic_expand() 134 buffer[bufp++] = S_QUOTE; in _nc_tic_expand() [all …]
|
/freebsd/contrib/llvm-project/compiler-rt/lib/sanitizer_common/ |
H A D | sanitizer_stacktrace_printer.cpp | 152 InternalScopedString *buffer) { in MaybeBuildIdToBuffer() argument 155 buffer->Append(" "); in MaybeBuildIdToBuffer() 156 buffer->Append("(BuildId: "); in MaybeBuildIdToBuffer() 158 buffer->AppendF("%02x", info.uuid[i]); in MaybeBuildIdToBuffer() 160 buffer->Append(")"); in MaybeBuildIdToBuffer() 166 void FormattedStackTracePrinter::RenderFrame(InternalScopedString *buffer, in RenderFrame() argument 182 buffer->AppendF("%c", *p); in RenderFrame() 188 buffer->Append("%"); in RenderFrame() 192 buffer->AppendF("%u", frame_no); in RenderFrame() 195 buffer->AppendF("%p", (void *)address); in RenderFrame() [all …]
|
/freebsd/contrib/ntp/libparse/ |
H A D | clk_schmid.c | 102 12, /* binary data buffer */ 109 unsigned char *buffer, in cvt_schmid() argument 116 if ((size != 11) || (buffer[10] != (unsigned char)'\375')) in cvt_schmid() 122 if (buffer[0] > 23 || buffer[1] > 59 || buffer[2] > 59 || buffer[3] > 9) /* Time */ in cvt_schmid() 127 if (buffer[4] < 1 || buffer[4] > 31 || buffer[ in cvt_schmid() [all...] |
H A D | clk_wharton.c | 83 unsigned char *buffer, in cvt_wharton_400a() argument 93 if (size != 15 || buffer[0] != STX || buffer[14] != ETX in cvt_wharton_400a() 94 || buffer[13] < '0' || buffer[13] > ('0' + 0xf)) in cvt_wharton_400a() 97 if (buffer[i] < '0' || buffer[i] > '9') in cvt_wharton_400a() 99 clock_time->second = (buffer[2] - '0') * 10 + buffer[1] - '0'; in cvt_wharton_400a() 100 clock_time->minute = (buffer[ in cvt_wharton_400a() [all...] |
/freebsd/contrib/llvm-project/openmp/runtime/src/ |
H A D | kmp_str.cpp | 22 /* String buffer. 26 // Declare buffer and initialize it. 27 kmp_str_buf_t buffer; 28 __kmp_str_buf_init( & buffer ); 30 // Print to buffer. 31 __kmp_str_buf_print(& buffer, "Error in file \"%s\" line %d\n", "foo.c", 12); 32 __kmp_str_buf_print(& buffer, " <%s>\n", line); 34 // Use buffer contents. buffer.str is a pointer to data, buffer 71 __kmp_str_buf_clear(kmp_str_buf_t * buffer) __kmp_str_buf_clear() argument 80 __kmp_str_buf_reserve(kmp_str_buf_t * buffer,size_t size) __kmp_str_buf_reserve() argument 110 __kmp_str_buf_detach(kmp_str_buf_t * buffer) __kmp_str_buf_detach() argument 123 __kmp_str_buf_free(kmp_str_buf_t * buffer) __kmp_str_buf_free() argument 134 __kmp_str_buf_cat(kmp_str_buf_t * buffer,char const * str,size_t len) __kmp_str_buf_cat() argument 161 __kmp_str_buf_vprint(kmp_str_buf_t * buffer,char const * format,va_list args) __kmp_str_buf_vprint() argument 221 __kmp_str_buf_print(kmp_str_buf_t * buffer,char const * format,...) __kmp_str_buf_print() argument 454 char *buffer = NULL; __kmp_str_format() local [all...] |
/freebsd/sys/dev/mlx5/mlx5_en/ |
H A D | mlx5_en_port_buffer.c | 39 void *buffer; in mlx5e_port_query_buffer() local 53 buffer = MLX5_ADDR_OF(pbmc_reg, out, buffer[i]); in mlx5e_port_query_buffer() 54 port_buffer->buffer[i].lossy = in mlx5e_port_query_buffer() 55 MLX5_GET(bufferx_reg, buffer, lossy); in mlx5e_port_query_buffer() 56 port_buffer->buffer[i].epsb = in mlx5e_port_query_buffer() 57 MLX5_GET(bufferx_reg, buffer, epsb); in mlx5e_port_query_buffer() 58 port_buffer->buffer[i].size = in mlx5e_port_query_buffer() 59 MLX5_GET(bufferx_reg, buffer, size) << MLX5E_BUFFER_CELL_SHIFT; in mlx5e_port_query_buffer() 60 port_buffer->buffer[i].xon = in mlx5e_port_query_buffer() 61 MLX5_GET(bufferx_reg, buffer, xon_threshold) << MLX5E_BUFFER_CELL_SHIFT; in mlx5e_port_query_buffer() [all …]
|
/freebsd/contrib/pf/libevent/ |
H A D | buffer.c | 63 struct evbuffer *buffer; in evbuffer_new() local 65 buffer = calloc(1, sizeof(struct evbuffer)); in evbuffer_new() 67 return (buffer); in evbuffer_new() 71 evbuffer_free(struct evbuffer *buffer) in evbuffer_free() argument 73 if (buffer->orig_buffer != NULL) in evbuffer_free() 74 free(buffer->orig_buffer); in evbuffer_free() 75 free(buffer); in evbuffer_free() 84 (x)->buffer = (y)->buffer; \ 119 res = evbuffer_add(outbuf, inbuf->buffer, inbuf->off); in evbuffer_add_buffer() 131 char *buffer; in evbuffer_add_vprintf() local [all …]
|
/freebsd/usr.bin/dtc/ |
H A D | dtb.cc | 45 void write(dtc::byte_buffer &buffer, int fd) in write() argument 47 size_t size = buffer.size(); in write() 48 uint8_t *data = buffer.data(); in write() 82 push_string(buffer, name); in write_string() 84 buffer.push_back(0); in write_string() 90 buffer.push_back(v); in write_data() 96 while (buffer.size() % 4 != 0) in write_data() 98 buffer.push_back(0); in write_data() 100 push_big_endian(buffer, v); in write_data() 106 while (buffer.size() % 8 != 0) in write_data() [all …]
|
/freebsd/sys/dev/cxgbe/cudbg/ |
H A D | fastlz_api.c | 116 unsigned char buffer[CUDBG_CHUNK_BUF_LEN]; in write_chunk_header() local 119 buffer[0] = id & 255; in write_chunk_header() 120 buffer[1] = (unsigned char)(id >> 8); in write_chunk_header() 121 buffer[2] = options & 255; in write_chunk_header() 122 buffer[3] = (unsigned char)(options >> 8); in write_chunk_header() 123 buffer[4] = size & 255; in write_chunk_header() 124 buffer[5] = (size >> 8) & 255; in write_chunk_header() 125 buffer[6] = (size >> 16) & 255; in write_chunk_header() 126 buffer[7] = (size >> 24) & 255; in write_chunk_header() 127 buffer[8] = checksum & 255; in write_chunk_header() [all …]
|
/freebsd/sys/amd64/vmm/ |
H A D | vmm_snapshot.c | 59 struct vm_snapshot_buffer *buffer; in vm_snapshot_buf() local 62 buffer = &meta->buffer; in vm_snapshot_buf() 65 if (buffer->buf_rem < data_size) { in vm_snapshot_buf() 71 error = copyout(data, buffer->buf, data_size); in vm_snapshot_buf() 73 error = copyin(buffer->buf, data, data_size); in vm_snapshot_buf() 80 buffer->buf += data_size; in vm_snapshot_buf() 81 buffer->buf_rem -= data_size; in vm_snapshot_buf() 90 struct vm_snapshot_buffer *buffer; in vm_get_snapshot_size() local 92 buffer = &meta->buffer; in vm_get_snapshot_size() 94 if (buffer->buf_size < buffer->buf_rem) { in vm_get_snapshot_size() [all …]
|