aboutsummaryrefslogtreecommitdiff
path: root/doc/trim.3
diff options
context:
space:
mode:
authoraxtloss <axtlos@getcryst.al>2024-07-13 13:32:53 +0200
committeraxtloss <axtlos@getcryst.al>2024-07-14 16:43:24 +0200
commit1a4696492e3cd478080e438950a7664a68fefcd6 (patch)
tree3b6e6658d5d56d3a28c6c83a8c6b64cffaa27555 /doc/trim.3
parent3e85fcb0270c9224ab95dac02c737e6676974c8e (diff)
downloadextlib-1a4696492e3cd478080e438950a7664a68fefcd6.tar.gz
extlib-1a4696492e3cd478080e438950a7664a68fefcd6.tar.bz2
Add manpages for each extlib function
Diffstat (limited to 'doc/trim.3')
-rw-r--r--doc/trim.340
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/trim.3 b/doc/trim.3
new file mode 100644
index 0000000..fe2f7ab
--- /dev/null
+++ b/doc/trim.3
@@ -0,0 +1,40 @@
+'\" t
+.\" Copyright 2024 axtlos (axtlos@disroot.org)
+.\"
+.\" SPDX-License-Identifier: BSD-3-Clause
+
+.TH trim 3 2024-07-14 "extlib"
+.SH NAME
+trim \- trim leading/trailing whitespace from a string
+.SH LIBRARY
+extlib extended standard library
+.RI ( libextlib ", " \-lextlib )
+.SH SYNOPSIS
+.nf
+.B #include <extlib.h>
+.P
+.BI "char *trim (char *s, int *rem_front, int *rem_back);"
+.P
+.fi
+.SH DESCRIPTION
+The
+.BR trim ()
+function removes leading/trailing newspace from
+.IR *s .
+If
+.I *rem_front
+is not NULL, it is set to the amount of leading whitespace removed from
+.IR *s .
+If
+.I *rem_back
+is not NULL, it is set to the amount of trailing whitespace removed from string
+.IR *s .
+.BR trim ()
+does not consume
+.Ir *s ,
+it needs to be free'd manually.
+.fi
+.SH RETURN VALUE
+.BR trim ()
+returns the trimmed string.
+.\" SRC END