diff --git a/docs/c-api/mbuf.h/intro.md b/docs/c-api/mbuf.h/intro.md index 4c366d00..2fa91c3d 100644 --- a/docs/c-api/mbuf.h/intro.md +++ b/docs/c-api/mbuf.h/intro.md @@ -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. diff --git a/docs/c-api/mbuf.h/mbuf_append.md b/docs/c-api/mbuf.h/mbuf_append.md index ea803926..af0de26e 100644 --- a/docs/c-api/mbuf.h/mbuf_append.md +++ b/docs/c-api/mbuf.h/mbuf_append.md @@ -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. diff --git a/docs/c-api/mbuf.h/mbuf_free.md b/docs/c-api/mbuf.h/mbuf_free.md index 273d24b9..6b5e455b 100644 --- a/docs/c-api/mbuf.h/mbuf_free.md +++ b/docs/c-api/mbuf.h/mbuf_free.md @@ -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. diff --git a/docs/c-api/mbuf.h/mbuf_init.md b/docs/c-api/mbuf.h/mbuf_init.md index 960f92b8..bc61ca0e 100644 --- a/docs/c-api/mbuf.h/mbuf_init.md +++ b/docs/c-api/mbuf.h/mbuf_init.md @@ -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. diff --git a/docs/c-api/mbuf.h/mbuf_insert.md b/docs/c-api/mbuf.h/mbuf_insert.md index b9e84a71..a38137a9 100644 --- a/docs/c-api/mbuf.h/mbuf_insert.md +++ b/docs/c-api/mbuf.h/mbuf_insert.md @@ -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. diff --git a/docs/c-api/mbuf.h/mbuf_remove.md b/docs/c-api/mbuf.h/mbuf_remove.md index b4ce18c9..cf3e502d 100644 --- a/docs/c-api/mbuf.h/mbuf_remove.md +++ b/docs/c-api/mbuf.h/mbuf_remove.md @@ -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. diff --git a/docs/c-api/mbuf.h/mbuf_resize.md b/docs/c-api/mbuf.h/mbuf_resize.md index 92f8b302..0814383f 100644 --- a/docs/c-api/mbuf.h/mbuf_resize.md +++ b/docs/c-api/mbuf.h/mbuf_resize.md @@ -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. diff --git a/docs/c-api/mbuf.h/mbuf_trim.md b/docs/c-api/mbuf.h/mbuf_trim.md index d1878b03..743b25f9 100644 --- a/docs/c-api/mbuf.h/mbuf_trim.md +++ b/docs/c-api/mbuf.h/mbuf_trim.md @@ -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`. diff --git a/mongoose.h b/mongoose.h index 73e5e3b5..ea912c43 100644 --- a/mongoose.h +++ b/mongoose.h @@ -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)