From e8a7e1c358caec60751460d337f634ff6957ff9d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 19 Nov 2018 21:39:11 +0100 Subject: Add a bunch of function and macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- README | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'README') diff --git a/README b/README index 19ba924..0effbc4 100644 --- a/README +++ b/README @@ -10,3 +10,69 @@ have unnamespaced. Programs using this library should define `char *argv0` and set it to the 0:th command line argument. + +libsimple include a number of functions complementing those in +and , the naming scheme of these functions is: + + = str for NUL-terminated byte strings + = strn for byte strings that may not be NUL-terminated + = mem for byte arrays + = wcs for NUL-terminated wide-character strings + = wcsn for wide-character strings that may not be NUL-terminated + = wmem for wide-character arrays + + = str if is str, wsc, strn, or wscn + = mem if is mem or wmem + + = chrnul if is str, wsc, strn, or wscn + = scan if is mem or wmem + + [case] = if case-sensitive + = case if case-insensitive, the name may also end with + _l if there is a locale parameter + + [_inv] = for normal search + = _inv for search of anything else (skipping) + + [r] = for left-to-right search/comparison + = r for right-to-left search/comparison + + [p] = return beginning of destination + = p return end of destination + + [raw] = sought data may not exist + = raw sought data does exist (only = mem, wmem) + + [r] = strrn if is strn + = wcsrn if is wcsn + = r otherwise + + [p] = stp if is str + = stpn if is strn + = wcp if is wcs + = wcpn if is wcsn + = p otherwise + + [raw][r][case]chr[_inv] find character + [case][_inv] find character or end + [r][case] find substring + [case]cmp alphabetically compare, without NULL support + [case]cmpnul alphabetically compare, with NULL support + [case]ends verify end + [case]starts verify beginning + [case]eq ![case]cmp + [case]eqnul ![case]cmpnul + [r][case]eqlen check length of commonality + end find end of string (not = mem, wmem) + [p]cpy copy data (to external array) + [p]move move data (within array or to external array) + [p]set fill data + [p]toupper like [p]move but convert text to upper case + [p]tolower like [p]move but convert text to lower case + [raw]ccpy like pcpy, but stop after a character is found + [raw]cmove like pmove, but stop after a character is found + replace replace all instance of a character, end is returned + mem[p]setelem fill data with elements of custom length + [raw]mem[r]elem[_inv] find element with custom length + memelemscan[_inv] find element with custom length or end + memreplaceelem replace all instance of an element of custom length, end is returned -- cgit v1.2.3-70-g09d2