Commit e91a7c95 authored by Marko Mikulicic's avatar Marko Mikulicic Committed by Cesanta Bot

Reamalgam after .h edits

PUBLISHED_FROM=da1faa9b46cd0ff22dcba6d324b5847c4a0d42d8
parent 3054952a
......@@ -14,7 +14,7 @@ items:
---
Mbufs are mutable/growing memory buffers, like C++ strings.
Mbuf can append data to the end of a buffer, or insert data into arbitrary
Mbuf can append data to the end of a buffer or insert data into arbitrary
position in the middle of a buffer. The buffer grows automatically when
needed.
......@@ -8,5 +8,5 @@ signature: |
Appends data to the Mbuf.
Return the number of bytes appended, or 0 if out of memory.
Returns the number of bytes appended or 0 if out of memory.
......@@ -6,5 +6,5 @@ signature: |
void mbuf_free(struct mbuf *);
---
Free the space allocated for the mbuffer and resets the mbuf structure.
Frees the space allocated for the mbuffer and resets the mbuf structure.
......@@ -6,6 +6,6 @@ signature: |
void mbuf_init(struct mbuf *, size_t initial_capacity);
---
Initialize an Mbuf.
Initialises an Mbuf.
`initial_capacity` specifies the initial capacity of the mbuf.
......@@ -6,9 +6,9 @@ signature: |
size_t mbuf_insert(struct mbuf *, size_t, const void *, size_t);
---
Insert data at a specified offset in the Mbuf.
Inserts data at a specified offset in the Mbuf.
Existing data will be shifted forwards and the buffer will
be grown if necessary.
Return the number of bytes inserted.
Returns the number of bytes inserted.
......@@ -6,5 +6,5 @@ signature: |
void mbuf_remove(struct mbuf *, size_t data_size);
---
Remove `data_size` bytes from the beginning of the buffer.
Removes `data_size` bytes from the beginning of the buffer.
......@@ -6,7 +6,7 @@ signature: |
void mbuf_resize(struct mbuf *, size_t new_size);
---
Resize an Mbuf.
Resizes an Mbuf.
If `new_size` is smaller than buffer's `len`, the
resize is not performed.
......
......@@ -6,5 +6,5 @@ signature: |
void mbuf_trim(struct mbuf *);
---
Shrink an Mbuf by resizing its `size` to `len`.
Shrinks an Mbuf by resizing its `size` to `len`.
......@@ -898,7 +898,7 @@ int mg_vcasecmp(const struct mg_str *str2, const char *str1);
* === Memory Buffers
*
* Mbufs are mutable/growing memory buffers, like C++ strings.
* Mbuf can append data to the end of a buffer, or insert data into arbitrary
* Mbuf can append data to the end of a buffer or insert data into arbitrary
* position in the middle of a buffer. The buffer grows automatically when
* needed.
*/
......@@ -924,42 +924,42 @@ struct mbuf {
};
/*
* Initialize an Mbuf.
* Initialises an Mbuf.
* `initial_capacity` specifies the initial capacity of the mbuf.
*/
void mbuf_init(struct mbuf *, size_t initial_capacity);
/* Free the space allocated for the mbuffer and resets the mbuf structure. */
/* Frees the space allocated for the mbuffer and resets the mbuf structure. */
void mbuf_free(struct mbuf *);
/*
* Appends data to the Mbuf.
*
* Return the number of bytes appended, or 0 if out of memory.
* Returns the number of bytes appended or 0 if out of memory.
*/
size_t mbuf_append(struct mbuf *, const void *data, size_t data_size);
/*
* Insert data at a specified offset in the Mbuf.
* Inserts data at a specified offset in the Mbuf.
*
* Existing data will be shifted forwards and the buffer will
* be grown if necessary.
* Return the number of bytes inserted.
* Returns the number of bytes inserted.
*/
size_t mbuf_insert(struct mbuf *, size_t, const void *, size_t);
/* Remove `data_size` bytes from the beginning of the buffer. */
/* Removes `data_size` bytes from the beginning of the buffer. */
void mbuf_remove(struct mbuf *, size_t data_size);
/*
* Resize an Mbuf.
* Resizes an Mbuf.
*
* If `new_size` is smaller than buffer's `len`, the
* resize is not performed.
*/
void mbuf_resize(struct mbuf *, size_t new_size);
/* Shrink an Mbuf by resizing its `size` to `len`. */
/* Shrinks an Mbuf by resizing its `size` to `len`. */
void mbuf_trim(struct mbuf *);
#if defined(__cplusplus)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment