aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsimple/strn.h8
-rw-r--r--man/libsimple_memcaseends.38
-rw-r--r--man/libsimple_memcasestarts.38
-rw-r--r--man/libsimple_memends.38
-rw-r--r--man/libsimple_memstarts.38
-rw-r--r--man/libsimple_strcaseends.34
-rw-r--r--man/libsimple_strcasestarts.34
-rw-r--r--man/libsimple_strends.34
-rw-r--r--man/libsimple_strncaseends.376
-rw-r--r--man/libsimple_strncasestarts.377
-rw-r--r--man/libsimple_strnends.376
-rw-r--r--man/libsimple_strnstarts.377
-rw-r--r--man/libsimple_strstarts.34
13 files changed, 342 insertions, 20 deletions
diff --git a/libsimple/strn.h b/libsimple/strn.h
index 743c739..90017f2 100644
--- a/libsimple/strn.h
+++ b/libsimple/strn.h
@@ -127,7 +127,7 @@ char *libsimple_strnend(const char *, size_t);
* @return 1 if `s` starts with `t`, 0 otherwise
*/
_LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__)))
-int libsimple_strnstarts(const char *, const char *, size_t); /* TODO doc */
+int libsimple_strnstarts(const char *, const char *, size_t);
#ifndef strnstarts
# define strnstarts libsimple_strnstarts
#endif
@@ -142,7 +142,7 @@ int libsimple_strnstarts(const char *, const char *, size_t); /* TODO doc */
* @return 1 if `s` starts with `t`, 0 otherwise
*/
_LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__)))
-int libsimple_strncasestarts(const char *, const char *, size_t); /* TODO doc */
+int libsimple_strncasestarts(const char *, const char *, size_t);
#ifndef strncasestarts
# define strncasestarts libsimple_strncasestarts
#endif
@@ -157,7 +157,7 @@ int libsimple_strncasestarts(const char *, const char *, size_t); /* TODO doc */
* @return 1 if `s` ends with `t`, 0 otherwise
*/
_LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__)))
-int libsimple_strnends(const char *, const char *, size_t); /* TODO doc */
+int libsimple_strnends(const char *, const char *, size_t);
#ifndef strnends
# define strnends libsimple_strnends
#endif
@@ -172,7 +172,7 @@ int libsimple_strnends(const char *, const char *, size_t); /* TODO doc */
* @return 1 if `s` end with `t`, 0 otherwise
*/
_LIBSIMPLE_GCC_ONLY(__attribute__((__pure__, __nonnull__, __warn_unused_result__)))
-int libsimple_strncaseends(const char *, const char *, size_t); /* TODO doc */
+int libsimple_strncaseends(const char *, const char *, size_t);
#ifndef strncaseends
# define strncaseends libsimple_strncaseends
#endif
diff --git a/man/libsimple_memcaseends.3 b/man/libsimple_memcaseends.3
index 1cba467..6605f79 100644
--- a/man/libsimple_memcaseends.3
+++ b/man/libsimple_memcaseends.3
@@ -1,11 +1,11 @@
-.TH LIBSIMPLE_MEMCASEENDS 3 2018-10-21 libsimple
+.TH LIBSIMPLE_MEMCASEENDS 3 2018-10-23 libsimple
.SH NAME
libsimple_memcaseends \- checks end of memory
.SH SYNOPSIS
.nf
#include <libsimple.h>
-void *libsimple_memcaseends(const void *\fIs\fP, size_t \fIn\fP, const void *\fIt\fP, size_t \fIm\fP);
+int libsimple_memcaseends(const void *\fIs\fP, size_t \fIn\fP, const void *\fIt\fP, size_t \fIm\fP);
#ifndef memcaseends
# define memcaseends libsimple_memcaseends
@@ -78,4 +78,6 @@ None.
.SH SEE ALSO
.BR libsimple_memends (3),
.BR libsimple_memcasestarts (3),
-.BR libsimple_memrcasemem (3)
+.BR libsimple_memrcasemem (3),
+.BR libsimple_strncaseends (3),
+.BR libsimple_strcaseends (3)
diff --git a/man/libsimple_memcasestarts.3 b/man/libsimple_memcasestarts.3
index b89c0f3..d8a7259 100644
--- a/man/libsimple_memcasestarts.3
+++ b/man/libsimple_memcasestarts.3
@@ -1,11 +1,11 @@
-.TH LIBSIMPLE_MEMCASESTARTS 3 2018-10-21 libsimple
+.TH LIBSIMPLE_MEMCASESTARTS 3 2018-10-23 libsimple
.SH NAME
libsimple_memcasestarts \- checks beginning of memory
.SH SYNOPSIS
.nf
#include <libsimple.h>
-void *libsimple_memcasestarts(const void *\fIs\fP, size_t \fIn\fP, const void *\fIt\fP, size_t \fIm\fP);
+int libsimple_memcasestarts(const void *\fIs\fP, size_t \fIn\fP, const void *\fIt\fP, size_t \fIm\fP);
#ifndef memcasestarts
# define memcasestarts libsimple_memcasestarts
@@ -76,4 +76,6 @@ None.
.SH SEE ALSO
.BR libsimple_memstarts (3),
.BR libsimple_memcaseends (3),
-.BR libsimple_memcasemem (3)
+.BR libsimple_memcasemem (3),
+.BR libsimple_strncasestarts (3),
+.BR libsimple_strcasestarts (3)
diff --git a/man/libsimple_memends.3 b/man/libsimple_memends.3
index ab0d9c5..34db568 100644
--- a/man/libsimple_memends.3
+++ b/man/libsimple_memends.3
@@ -1,11 +1,11 @@
-.TH LIBSIMPLE_MEMENDS 3 2018-10-21 libsimple
+.TH LIBSIMPLE_MEMENDS 3 2018-10-23 libsimple
.SH NAME
libsimple_memends \- checks end of memory
.SH SYNOPSIS
.nf
#include <libsimple.h>
-void *libsimple_memends(const void *\fIs\fP, size_t \fIn\fP, const void *\fIt\fP, size_t \fIm\fP);
+int libsimple_memends(const void *\fIs\fP, size_t \fIn\fP, const void *\fIt\fP, size_t \fIm\fP);
#ifndef memends
# define memends libsimple_memends
@@ -78,4 +78,6 @@ None.
.SH SEE ALSO
.BR libsimple_memcaseends (3),
.BR libsimple_memstarts (3),
-.BR libsimple_memrmem (3)
+.BR libsimple_memrmem (3),
+.BR libsimple_strnends (3),
+.BR libsimple_strends (3)
diff --git a/man/libsimple_memstarts.3 b/man/libsimple_memstarts.3
index 9cc4cbf..527397b 100644
--- a/man/libsimple_memstarts.3
+++ b/man/libsimple_memstarts.3
@@ -1,11 +1,11 @@
-.TH LIBSIMPLE_MEMSTARTS 3 2018-10-21 libsimple
+.TH LIBSIMPLE_MEMSTARTS 3 2018-10-23 libsimple
.SH NAME
libsimple_memstarts \- checks beginning of memory
.SH SYNOPSIS
.nf
#include <libsimple.h>
-void *libsimple_memstarts(const void *\fIs\fP, size_t \fIn\fP, const void *\fIt\fP, size_t \fIm\fP);
+int libsimple_memstarts(const void *\fIs\fP, size_t \fIn\fP, const void *\fIt\fP, size_t \fIm\fP);
#ifndef memstarts
# define memstarts libsimple_memstarts
@@ -76,4 +76,6 @@ None.
.SH SEE ALSO
.BR libsimple_memcasestarts (3),
.BR libsimple_memends (3),
-.BR libsimple_memmem (3)
+.BR libsimple_memmem (3),
+.BR libsimple_strnstarts (3),
+.BR libsimple_strstarts (3)
diff --git a/man/libsimple_strcaseends.3 b/man/libsimple_strcaseends.3
index ff9a578..f658699 100644
--- a/man/libsimple_strcaseends.3
+++ b/man/libsimple_strcaseends.3
@@ -1,4 +1,4 @@
-.TH LIBSIMPLE_STRCASEENDS 3 2018-10-21 libsimple
+.TH LIBSIMPLE_STRCASEENDS 3 2018-10-23 libsimple
.SH NAME
libsimple_strcaseends \- check the beginning of a string
.SH SYNOPSIS
@@ -69,3 +69,5 @@ None.
.BR libsimple_strends (3),
.BR libsimple_strcasestarts (3),
.BR libsimple_strrcasestr (3),
+.BR libsimple_strncaseends (3),
+.BR libsimple_memcaseends (3)
diff --git a/man/libsimple_strcasestarts.3 b/man/libsimple_strcasestarts.3
index c36ac4a..0f9d689 100644
--- a/man/libsimple_strcasestarts.3
+++ b/man/libsimple_strcasestarts.3
@@ -1,4 +1,4 @@
-.TH LIBSIMPLE_STRCASESTARTS 3 2018-10-21 libsimple
+.TH LIBSIMPLE_STRCASESTARTS 3 2018-10-23 libsimple
.SH NAME
libsimple_strcasestarts \- check the beginning of a string
.SH SYNOPSIS
@@ -69,5 +69,7 @@ None.
.BR libsimple_strstarts (3),
.BR libsimple_strcaseends (3),
.BR libsimple_strcasestr (3),
+.BR libsimple_strncasestarts (3),
+.BR libsimple_memcasestarts (3),
.BR strcasecmp (3),
.BR strncasecmp (3)
diff --git a/man/libsimple_strends.3 b/man/libsimple_strends.3
index e7b9088..9ab8b45 100644
--- a/man/libsimple_strends.3
+++ b/man/libsimple_strends.3
@@ -1,4 +1,4 @@
-.TH LIBSIMPLE_STRENDS 3 2018-10-21 libsimple
+.TH LIBSIMPLE_STRENDS 3 2018-10-23 libsimple
.SH NAME
libsimple_strends \- check the beginning of a string
.SH SYNOPSIS
@@ -69,3 +69,5 @@ None.
.BR libsimple_strcaseends (3),
.BR libsimple_strstarts (3),
.BR libsimple_strrstr (3),
+.BR libsimple_strnends (3),
+.BR libsimple_memends (3)
diff --git a/man/libsimple_strncaseends.3 b/man/libsimple_strncaseends.3
new file mode 100644
index 0000000..5bdc0d9
--- /dev/null
+++ b/man/libsimple_strncaseends.3
@@ -0,0 +1,76 @@
+.TH LIBSIMPLE_STRNCASEENDS 3 2018-10-23 libsimple
+.SH NAME
+libsimple_strncaseends \- check the beginning of a string
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+int libsimple_strncaseends(const char *\fIs\fP, const char *\fIt\fP, size_t \fIn\fP);
+
+#ifndef strncaseends
+# define strncaseends libsimple_strncaseends
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_strncaseends ()
+function checks whether the string
+.IR s ,
+truncated to
+.I n
+bytes unless it is shorter,
+ends with the string
+.IR t .
+.PP
+The comparison is case-insensitive.
+.SH RETURN VALUE
+The
+.BR libsimple_strncaseends ()
+function returns 1 if the string
+.I s
+ends with the string
+.IR t ,
+otherwise it returns 0.
+.SH ERRORS
+The
+.BR libsimple_strncaseends ()
+function cannot fail.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_strncaseends ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_strncaseends ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_strncaseends ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_strnends (3),
+.BR libsimple_strncasestarts (3),
+.BR libsimple_strrncasestr (3),
+.BR libsimple_strcaseends (3),
+.BR libsimple_memcaseends (3)
diff --git a/man/libsimple_strncasestarts.3 b/man/libsimple_strncasestarts.3
new file mode 100644
index 0000000..b1efd80
--- /dev/null
+++ b/man/libsimple_strncasestarts.3
@@ -0,0 +1,77 @@
+.TH LIBSIMPLE_STRNCASESTARTS 3 2018-10-23 libsimple
+.SH NAME
+libsimple_strncasestarts \- check the beginning of a string
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+int libsimple_strncasestarts(const char *\fIs\fP, const char *\fIt\fP, size_t \fIn\fP);
+
+#ifndef strncasestarts
+# define strncasestarts libsimple_strncasestarts
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_strncasestarts ()
+function checks whether the string
+.IR s ,
+truncated to
+.I n
+bytes unless it is shorter,
+starts with the string
+.IR t .
+.PP
+The comparison is case-insensitive.
+.SH RETURN VALUE
+The
+.BR libsimple_strncasestarts ()
+function returns 1 if the string
+.I s
+begins with the string
+.IR t ,
+otherwise it returns 0.
+.SH ERRORS
+The
+.BR libsimple_strncasestarts ()
+function cannot fail.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_strncasestarts ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_strncasestarts ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_strncasestarts ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_strnstarts (3),
+.BR libsimple_strncaseends (3),
+.BR libsimple_strncasestr (3),
+.BR libsimple_strcasestarts (3),
+.BR libsimple_memcasestarts (3),
+.BR strncasecmp (3)
diff --git a/man/libsimple_strnends.3 b/man/libsimple_strnends.3
new file mode 100644
index 0000000..a733b6b
--- /dev/null
+++ b/man/libsimple_strnends.3
@@ -0,0 +1,76 @@
+.TH LIBSIMPLE_STRNENDS 3 2018-10-23 libsimple
+.SH NAME
+libsimple_strnends \- check the beginning of a string
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+int libsimple_strnends(const char *\fIs\fP, const char *\fIt\fP, size_t \fIn\fP);
+
+#ifndef strnends
+# define strnends libsimple_strnends
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_strnends ()
+function checks whether the string
+.IR s ,
+truncated to
+.I n
+bytes unless it is shorter,
+ends with the string
+.IR t .
+.PP
+The comparison is case-sensitive.
+.SH RETURN VALUE
+The
+.BR libsimple_strnends ()
+function returns 1 if the string
+.I s
+ends with the string
+.IR t ,
+otherwise it returns 0.
+.SH ERRORS
+The
+.BR libsimple_strnends ()
+function cannot fail.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_strnends ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_strnends ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_strnends ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_strncaseends (3),
+.BR libsimple_strnstarts (3),
+.BR libsimple_strrnstr (3),
+.BR libsimple_strends (3),
+.BR libsimple_memends (3)
diff --git a/man/libsimple_strnstarts.3 b/man/libsimple_strnstarts.3
new file mode 100644
index 0000000..4f084ea
--- /dev/null
+++ b/man/libsimple_strnstarts.3
@@ -0,0 +1,77 @@
+.TH LIBSIMPLE_STRNSTARTS 3 2018-10-23 libsimple
+.SH NAME
+libsimple_strnstarts \- check the beginning of a string
+.SH SYNOPSIS
+.nf
+#include <libsimple.h>
+
+int libsimple_strnstarts(const char *\fIs\fP, const char *\fIt\fP, size_t \fIn\fP);
+
+#ifndef strnstarts
+# define strnstarts libsimple_strnstarts
+#endif
+.fi
+.PP
+Link with
+.IR \-lsimple .
+.SH DESCRIPTION
+The
+.BR libsimple_strnstarts ()
+function checks whether the string
+.IR s ,
+truncated to
+.I n
+bytes unless it is shorter,
+starts with the string
+.IR t .
+.PP
+The comparison is case-sensitive.
+.SH RETURN VALUE
+The
+.BR libsimple_strnstarts ()
+function returns 1 if the string
+.I s
+begins with the string
+.IR t ,
+otherwise it returns 0.
+.SH ERRORS
+The
+.BR libsimple_strnstarts ()
+function cannot fail.
+.SH ATTRIBUTES
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lb lb lb
+l l l.
+Interface Attribute Value
+T{
+.BR libsimple_strnstarts ()
+T} Thread safety MT-Safe
+T{
+.BR libsimple_strnstarts ()
+T} Async-signal safety AS-Safe
+T{
+.BR libsimple_strnstarts ()
+T} Async-cancel safety AC-Safe
+.TE
+.SH EXAMPLES
+None.
+.SH APPLICATION USAGE
+None.
+.SH RATIONALE
+None.
+.SH FUTURE DIRECTIONS
+None.
+.SH NOTES
+None.
+.SH BUGS
+None.
+.SH SEE ALSO
+.BR libsimple_strncasestarts (3),
+.BR libsimple_strnends (3),
+.BR libsimple_strstarts (3),
+.BR libsimple_memstarts (3),
+.BR strnstr (3),
+.BR strncmp (3)
diff --git a/man/libsimple_strstarts.3 b/man/libsimple_strstarts.3
index c277f11..fbd3412 100644
--- a/man/libsimple_strstarts.3
+++ b/man/libsimple_strstarts.3
@@ -1,4 +1,4 @@
-.TH LIBSIMPLE_STRSTARTS 3 2018-10-21 libsimple
+.TH LIBSIMPLE_STRSTARTS 3 2018-10-23 libsimple
.SH NAME
libsimple_strstarts \- check the beginning of a string
.SH SYNOPSIS
@@ -68,6 +68,8 @@ None.
.SH SEE ALSO
.BR libsimple_strcasestarts (3),
.BR libsimple_strends (3),
+.BR libsimple_strnstarts (3),
+.BR libsimple_memstarts (3),
.BR strstr (3),
.BR strcmp (3),
.BR strncmp (3)