From 1a4696492e3cd478080e438950a7664a68fefcd6 Mon Sep 17 00:00:00 2001 From: axtloss Date: Sat, 13 Jul 2024 13:32:53 +0200 Subject: Add manpages for each extlib function --- doc/trim.3 | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 doc/trim.3 (limited to 'doc/trim.3') 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 +.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 -- cgit v1.2.3