git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] api-strbuf.txt: Add docs for _trim and _ltrim

From
Brian Gesiak <modocache@gmail.com>
Date
Apr 30, 2014, 08:58 UTC
Message-ID
<1398848287-77109-2-git-send-email-modocache@gmail.com>
In-Reply-To
<1398848287-77109-1-git-send-email-modocache@gmail.com>

API documentation for strbuf does not document strbuf_trim or strbuf_ltrim. Add documentation for these two functions.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
---
 Documentation/technical/api-strbuf.txt | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/Documentation/technical/api-strbuf.txt b/Documentation/technical/api-strbuf.txt
index 3350d97..4396be9 100644
--- a/Documentation/technical/api-strbuf.txt
+++ b/Documentation/technical/api-strbuf.txt
@@ -121,10 +121,19 @@ Functions
 
 * Related to the contents of the buffer
 
+`strbuf_trim`::
+
+	Strip whitespace from the beginning and end of a string.
+	Equivalent to performing `strbuf_rtrim()` followed by `strbuf_ltrim()`.
+
 `strbuf_rtrim`::
 
 	Strip whitespace from the end of a string.
 
+`strbuf_ltrim`::
+
+	Strip whitespace from the beginning of a string.
+
 `strbuf_cmp`::
 
 	Compare two buffers. Returns an integer less than, equal to, or greater
-- 
1.9.2.507.g779792a
Previous: Brian GesiakNext: Jeff King
Message 2 of 3 in “strbuf: Use _rtrim and _ltrim in strbuf_trim”
  1. 1/2 strbuf: Use _rtrim and _ltrim in strbuf_trimBrian Gesiak, Apr 30, 2014
  2. 2/2 api-strbuf.txt: Add docs for _trim and _ltrimBrian Gesiak, Apr 30, 2014
  3. Jeff KingApr 30, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.