From: Jelte Jansen Date: Thu, 28 Apr 2005 09:01:13 +0000 (+0000) Subject: rest of buffer doxy, grouped functions in separate manpages X-Git-Tag: release-0.50~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9ad13dd11bb8764d988b2b5f97cf9d330c27f54;p=thirdparty%2Fldns.git rest of buffer doxy, grouped functions in separate manpages i think we're gonna need a way to auto-gen "see also" sections --- diff --git a/doc/function_manpages b/doc/function_manpages index 3ba5bc52..a851255d 100644 --- a/doc/function_manpages +++ b/doc/function_manpages @@ -40,11 +40,18 @@ ldns_send_udp, ldns_send_tcp, ldns_send ldns_tcp_send_query, ldns_tcp_read_wire, ldns_tcp_connect # buffer.h -ldns_buffer_new, ldns_buffer_new_frm_data, ldns_buffer_clear, ldns_buffer_flip, ldns_buffer_rewind, ldns_buffer_position, ldns_buffer_set_position, ldns_buffer_skip, ldns_buffer_limit, ldns_buffer_set_limit, ldns_buffer_capacity, ldns_buffer_set_capacity, ldns_buffer_reserve, ldns_buffer_at, ldns_buffer_begin, ldns_buffer_end, ldns_buffer_current, ldns_buffer_remaining_at, ldns_buffer_remaining, ldns_buffer_available_at, ldns_buffer_available, ldns_buffer_write_at, ldns_buffer_write_at, ldns_buffer_write, ldns_buffer_write_string_at, ldns_buffer_write_string, ldns_buffer_write_u8_at, ldns_buffer_write_u8, ldns_buffer_write_u16_at, ldns_buffer_write_u16, ldns_buffer_read_at, ldns_buffer_read, -#ldns_buffer_, -#ldns_buffer_, -#ldns_buffer_, +# general +ldns_buffer_new, ldns_buffer_new_frm_data, ldns_buffer_clear, ldns_buffer_printf, ldns_buffer_free, ldns_buffer_export +# position +ldns_buffer_flip, ldns_buffer_rewind, ldns_buffer_position, ldns_buffer_set_position, ldns_buffer_skip +# values and pointers +ldns_buffer_limit, ldns_buffer_set_limit, ldns_buffer_capacity, ldns_buffer_set_capacity, ldns_buffer_reserve, ldns_buffer_at, ldns_buffer_begin, ldns_buffer_end, ldns_buffer_current +# info +ldns_buffer_remaining_at, ldns_buffer_remaining, ldns_buffer_available_at, ldns_buffer_available, ldns_buffer_status, ldns_buffer_status_ok +# read and write +ldns_buffer_write_at, ldns_buffer_write_at, ldns_buffer_write, ldns_buffer_write_string_at, ldns_buffer_write_string, ldns_buffer_write_u8_at, ldns_buffer_write_u8, ldns_buffer_write_u16_at, ldns_buffer_write_u16, ldns_buffer_read_at, ldns_buffer_read, ldns_buffer_read_u8_at, ldns_buffer_read_u8, ldns_buffer_read_u16_at, ldns_buffer_read_u16, ldns_buffer_read_u32_at, ldns_buffer_read_u32 + # parse.h ldns_bget_token, ldns_bgetc, ldns_bskipcs diff --git a/ldns/buffer.h b/ldns/buffer.h index 33cedc82..85e1905c 100644 --- a/ldns/buffer.h +++ b/ldns/buffer.h @@ -399,6 +399,9 @@ ldns_buffer_read(ldns_buffer *buffer, void *data, size_t count) buffer->_position += count; } +/** + * returns the byte value at the given position in the buffer + */ INLINE uint8_t ldns_buffer_read_u8_at(ldns_buffer *buffer, size_t at) { @@ -406,6 +409,9 @@ ldns_buffer_read_u8_at(ldns_buffer *buffer, size_t at) return buffer->_data[at]; } +/** + * returns the byte value at the current position in the buffer + */ INLINE uint8_t ldns_buffer_read_u8(ldns_buffer *buffer) { @@ -414,6 +420,9 @@ ldns_buffer_read_u8(ldns_buffer *buffer) return result; } +/** + * returns the 2-byte integer value at the given position in the buffer + */ INLINE uint16_t ldns_buffer_read_u16_at(ldns_buffer *buffer, size_t at) { @@ -421,6 +430,9 @@ ldns_buffer_read_u16_at(ldns_buffer *buffer, size_t at) return read_uint16(buffer->_data + at); } +/** + * returns the 2-byte integer value at the current position in the buffer + */ INLINE uint16_t ldns_buffer_read_u16(ldns_buffer *buffer) { @@ -429,6 +441,9 @@ ldns_buffer_read_u16(ldns_buffer *buffer) return result; } +/** + * returns the 4-byte integer value at the given position in the buffer + */ INLINE uint32_t ldns_buffer_read_u32_at(ldns_buffer *buffer, size_t at) { @@ -436,6 +451,9 @@ ldns_buffer_read_u32_at(ldns_buffer *buffer, size_t at) return read_uint32(buffer->_data + at); } +/** + * returns the 4-byte integer value at the current position in the buffer + */ INLINE uint32_t ldns_buffer_read_u32(ldns_buffer *buffer) { @@ -444,12 +462,18 @@ ldns_buffer_read_u32(ldns_buffer *buffer) return result; } +/** + * returns the status of the buffer + */ INLINE ldns_status ldns_buffer_status(ldns_buffer *buffer) { return buffer->_status; } +/** + * returns true if the status of the buffer is LDNS_STATUS_OK, false otherwise + */ INLINE bool ldns_buffer_status_ok(ldns_buffer *buffer) { @@ -460,8 +484,8 @@ ldns_buffer_status_ok(ldns_buffer *buffer) } } -/* - * Print to the buffer, increasing the capacity if required using +/** + * prints to the buffer, increasing the capacity if required using * buffer_reserve(). The buffer's position is set to the terminating * '\0'. Returns the number of characters written (not including the * terminating '\0') or -1 on failure. @@ -470,7 +494,7 @@ int ldns_buffer_printf(ldns_buffer *buffer, const char *format, ...) ATTR_FORMAT(printf, 2, 3); /** - * Frees the buffer. + * frees the buffer. * \param[in] *buffer the buffer to be freed * \return void */