/freebsd/contrib/ldns/ldns/ |
H A D | buffer.h | 2 * buffer.h -- generic memory buffer. 9 * The buffer module implements a generic buffer. The API is based on 10 * the java.nio.Buffer interface. 30 * number of initial bytes in buffer of 36 * \file buffer.h 45 * to the current end of a buffer, read from the current position, and 58 /** The amount of data the buffer can contain */ 61 /** The data contained in the buffer */ 64 /** If the buffer is fixed it cannot be resized */ 67 /** The current state of the buffer. If writing to the buffer fails [all …]
|
H A D | host2str.h | 26 #include <ldns/buffer.h> 181 * to the output buffer 182 * \param[in] *output the buffer to add the data to 184 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error 191 * to the output buffer 192 * \param[in] *output the buffer to add the data to 194 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error 201 * to the output buffer 202 * \param[in] *output the buffer to add the data to 204 * \return LDNS_STATUS_OK on success, or a buffer failure mode on error [all …]
|
/freebsd/contrib/unbound/sldns/ |
H A D | sbuffer.h | 2 * buffer.h -- generic memory buffer. 9 * The buffer module implements a generic buffer. The API is based on 10 * the java.nio.Buffer interface. 113 * to the current end of a buffer, read from the current position, and 124 /** The amount of data the buffer can contain */ 127 /** The data contained in the buffer */ 130 /** If the buffer is fixed it cannot be resized */ 133 /** The current state of the buffer. If writing to the buffer fails 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 [all …]
|
H A D | sbuffer.c | 2 * buffer.c -- generic memory buffer . 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() [all …]
|
H A D | wire2str.h | 94 * @param str: string buffer. Adjusted at end to after the output. 95 * @param slen: length of the string buffer. Adjusted at end. 104 * @param str: string buffer. Adjusted at end to after the output. 105 * @param slen: length of the string buffer. Adjusted at end. 113 * Convert wireformat packet to a string representation with user buffer 118 * @param str: the string buffer for the output. 122 * @param str_len: the size of the string buffer. If more is needed, it'll 123 * silently truncate the output to fit in the buffer. 131 * Scan wireformat packet to a string representation with user buffer 136 * @param str: the string buffer for the output. [all …]
|
H A D | str2wire.h | 29 /** buffer to read an RR, cannot be larger than 64K because of packet size */ 56 * Convert text string into dname wireformat, mallocless, with user buffer. 58 * @param buf: the result buffer, suggested size LDNS_MAX_DOMAINLEN+1 59 * @param len: length of the buffer on input, length of the result on output. 68 * @param buf: the result buffer, suggested size LDNS_MAX_DOMAINLEN+1 69 * @param len: length of the buffer on input, length of the result on output. 86 * Convert text RR to wireformat, with user buffer. 88 * @param rr: the buffer where the result is stored into. This buffer has 92 * buffer size LDNS_RR_BUF_SIZE is suggested. 93 * @param len: on input the length of the buffer, on output the amount of [all …]
|
/freebsd/sys/contrib/edk2/Include/Library/ |
H A D | BaseMemoryLib.h | 17 Copies a source buffer to a destination buffer, and returns the destination buffer. 26 @param DestinationBuffer The pointer to the destination buffer of the memory copy. 27 @param SourceBuffer The pointer to the source buffer of the memory copy. 42 Fills a target buffer with a byte value, and returns the target buffer. 44 This function fills Length bytes of Buffer with Value, and returns Buffer. 46 If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). 48 @param Buffer The memory to set. 50 @param Value The value with which to fill Length bytes of Buffer. 52 @return Buffer. 58 OUT VOID *Buffer, [all …]
|
H A D | MemoryAllocationLib.h | 21 allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL 27 @return A pointer to the allocated buffer or NULL if allocation fails. 40 allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL 46 @return A pointer to the allocated buffer or NULL if allocation fails. 59 allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL 65 @return A pointer to the allocated buffer or NULL if allocation fails. 78 Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer 83 If Buffer was not allocated with a page allocation function in the Memory Allocation Library, 87 @param Buffer Pointer to the buffer of pages to free. 94 IN VOID *Buffer, [all …]
|
H A D | PrintLib.h | 2 Provides services to print a formatted string to a buffer. All combinations of 120 - "Bad Buffer Size" 122 - "Buffer Too Small" 168 - "Warning Buffer Too Small" 201 Produces a Null-terminated Unicode string in an output buffer based on 206 Produces a Null-terminated Unicode string in the output buffer specified by StartOfBuffer 211 The number of Unicode characters in the produced output buffer is returned not including 217 If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT(). Also, the output buffer is 219 If BufferSize > 1 and FormatString is NULL, then ASSERT(). Also, the output buffer is 223 buffer is unmodified and 0 is returned. [all …]
|
/freebsd/contrib/ldns/ |
H A D | buffer.c | 2 * buffer.c -- generic memory buffer . 13 #include <ldns/buffer.h> 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() [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 …]
|
/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.h | 27 * @param buffer Buffer to serialize to 28 * @param buffer_size Size of the \p buffer 32 cbor_mutable_data buffer, 54 * .. warning:: It is the caller's responsibility to free the buffer using an 59 * @param[out] buffer Buffer containing the result 60 * @param[out] buffer_size Size of the \p buffer, or 0 on memory allocation 63 * @return 0 on memory allocation failure, in which case \p buffer is `NULL`. 66 unsigned char **buffer, 72 * @param[out] buffer Buffer to serialize to 73 * @param buffer_size Size of the \p buffer [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/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/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/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 …]
|
/freebsd/contrib/llvm-project/llvm/lib/Support/ |
H A D | SHA1.cpp | 99 r0(A, B, C, D, E, 0, InternalState.Buffer.L); in hashBlock() 100 r0(E, A, B, C, D, 1, InternalState.Buffer.L); in hashBlock() 101 r0(D, E, A, B, C, 2, InternalState.Buffer.L); in hashBlock() 102 r0(C, D, E, A, B, 3, InternalState.Buffer.L); in hashBlock() 103 r0(B, C, D, E, A, 4, InternalState.Buffer.L); in hashBlock() 104 r0(A, B, C, D, E, 5, InternalState.Buffer.L); in hashBlock() 105 r0(E, A, B, C, D, 6, InternalState.Buffer.L); in hashBlock() 106 r0(D, E, A, B, C, 7, InternalState.Buffer.L); in hashBlock() 107 r0(C, D, E, A, B, 8, InternalState.Buffer.L); in hashBlock() 108 r0(B, C, D, E, A, 9, InternalState.Buffer in hashBlock() [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/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() 79 * This is a destructive add. The data from one buffer moves into 80 * the other buffer. 84 (x)->buffer = (y)->buffer; \ [all …]
|
/freebsd/sys/compat/linuxkpi/common/src/ |
H A D | linux_hdmi.c | 49 static void hdmi_infoframe_set_checksum(void *buffer, size_t size) in hdmi_infoframe_set_checksum() argument 51 u8 *ptr = buffer; in hdmi_infoframe_set_checksum() 53 ptr[3] = hdmi_infoframe_checksum(buffer, size); in hdmi_infoframe_set_checksum() 99 * hdmi_avi_infoframe_pack_only() - write HDMI AVI infoframe to binary buffer 101 * @buffer: destination buffer 102 * @size: size of buffer 109 * Returns the number of bytes packed into the binary buffer or a negative 113 void *buffer, size_t size) in hdmi_avi_infoframe_pack_only() argument 115 u8 *ptr = buffer; in hdmi_avi_infoframe_pack_only() 128 memset(buffer, 0, size); in hdmi_avi_infoframe_pack_only() [all …]
|
/freebsd/contrib/llvm-project/llvm/include/llvm/Support/ |
H A D | BinaryByteStream.h | 7 // A BinaryStream which stores data in a single continguous memory buffer. 27 /// in a single contiguous buffer. BinaryByteStream guarantees that no read 29 /// own the underlying buffer. 41 ArrayRef<uint8_t> &Buffer) override { in readBytes() argument 44 Buffer = Data.slice(Offset, Size); in readBytes() 49 ArrayRef<uint8_t> &Buffer) override { in readLongestContiguousChunk() argument 52 Buffer = Data.slice(Offset); in readLongestContiguousChunk() 76 MemoryBufferByteStream(std::unique_ptr<MemoryBuffer> Buffer, in MemoryBufferByteStream() argument 78 : BinaryByteStream(Buffer->getBuffer(), Endian), in MemoryBufferByteStream() 79 MemBuffer(std::move(Buffer)) {} in MemoryBufferByteStream() 100 readBytes(uint64_t Offset,uint64_t Size,ArrayRef<uint8_t> & Buffer) readBytes() argument 105 readLongestContiguousChunk(uint64_t Offset,ArrayRef<uint8_t> & Buffer) readLongestContiguousChunk() argument 111 writeBytes(uint64_t Offset,ArrayRef<uint8_t> Buffer) writeBytes() argument 148 readBytes(uint64_t Offset,uint64_t Size,ArrayRef<uint8_t> & Buffer) readBytes() argument 161 readLongestContiguousChunk(uint64_t Offset,ArrayRef<uint8_t> & Buffer) readLongestContiguousChunk() argument 171 writeBytes(uint64_t Offset,ArrayRef<uint8_t> Buffer) writeBytes() argument 206 StreamImpl(std::unique_ptr<FileOutputBuffer> Buffer,llvm::support::endianness Endian) StreamImpl() argument 232 FileBufferByteStream(std::unique_ptr<FileOutputBuffer> Buffer,llvm::support::endianness Endian) FileBufferByteStream() argument 241 readBytes(uint64_t Offset,uint64_t Size,ArrayRef<uint8_t> & Buffer) readBytes() argument 246 readLongestContiguousChunk(uint64_t Offset,ArrayRef<uint8_t> & Buffer) readLongestContiguousChunk() argument [all...] |
/freebsd/contrib/ntp/sntp/libevent/include/event2/ |
H A D | buffer.h | 29 /** @file event2/buffer.h 51 - evbuffer_add_buffer() adds the contents of one buffer to the other 56 buffer. 61 buffer, and evbuffer_peek() when reading. 106 Used when repeatedly searching through a buffer. Calling any function 107 that modifies or re-packs the buffer contents may invalidate all 108 evbuffer_ptrs for that buffer. Do not modify or contruct these values 111 An evbuffer_ptr can represent any position from the start of a buffer up 112 to a position immediately after the end of a buffer. 193 * from this buffer: we'll only take bytes out of this buffer by [all …]
|