libsheepy
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
libsheepy.c File Reference

This file has basic file, random, string, list functions. More...

#include "libsheepy.h"
#include "printf.h"
#include <sys/stat.h>
#include <ctype.h>
#include <sys/time.h>
#include <stdio.h>
#include <ucontext.h>
#include <libgen.h>
#include <dirent.h>
#include <stdarg.h>
#include <errno.h>
#include <wordexp.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdint.h>
#include <signal.h>
#include "sys/resource.h"
#include "alloca.h"
#include "pwd.h"
#include "limits.h"
#include "execinfo.h"
#include "termios.h"
#include "locale.h"
Include dependency graph for libsheepy.c:

Go to the source code of this file.

Data Structures

struct  decomposition
 

Macros

#define internal   static
 
#define replaceS_max(s, olds, news)   replaceS(s,olds,news, 0)
 
#define iReplaceS_max(s, olds, news)   iReplaceS(s,olds,news, 0)
 
#define bReplaceS_max(s, olds, news)   bReplaceS(s,olds,news, 0)
 
#define icReplaceS_max(s, olds, news)   icReplaceS(s,olds,news, 0)
 
#define iicReplaceS_max(s, olds, news)   iicReplaceS(s,olds,news, 0)
 
#define bicReplaceS_max(s, olds, news)   bicReplaceS(s,olds,news, 0)
 
#define icReplaceUTF8_max(s, olds, news)   icReplaceUTF8(s,olds,news, 0)
 
#define iicReplaceUTF8_max(s, olds, news)   iicReplaceUTF8(s,olds,news, 0)
 
#define bicReplaceUTF8_max(s, olds, news)   bicReplaceUTF8(s,olds,news, 0)
 
#define MALLOC   malloc
 
#define REALLOC   realloc
 
#define __libsheepy   1
 
#define MAX_MSG_LEN   10240
 print logging levels logs messages to all log file More...
 
#define TERMRGB   "\x1b[38;2;"
 printf RGB Colors More...
 
#define BGTERMRGB   "\x1b[48;2;"
 
#define startMax   20
 
#define runeMax   0x10FFFF
 maximum rune value More...
 
#define UTFSEQ(x)
 code point length, 0 when invalid code point, x is first byte in code point More...
 
#define BADRUNE(x)
 
#define UNICODE_LAST_CHAR_PART1   0x2FAFF
 
#define UNICODE_LAST_PAGE_PART1   762
 
#define UNICODE_MAX_TABLE_INDEX   10000
 
#define UNICODE_NOT_PRESENT_OFFSET   65535
 
#define ATTR_TABLE(Page)
 
#define ATTTABLE(Page, Char)   ((ATTR_TABLE(Page) == UNICODE_MAX_TABLE_INDEX) ? 0 : (attr_data[ATTR_TABLE(Page)][Char]))
 
#define TTYPE_PART1(Page, Char)
 
#define TTYPE_PART2(Page, Char)
 
#define RUNETYPE(rn)
 
#define IS(Type, Class)   (((uint32_t)1 << (Type)) & (Class))
 
#define OR(Type, Rest)   (((uint32_t)1 << (Type)) | (Rest))
 
#define ISMARK(Type)
 
#define ISALPHA(Type)
 
#define RUNE_MAX_DECOMPOSITION_LENGTH   18 /* codepoints */
 
#define CC_PART1(Page, Char)
 
#define CC_PART2(Page, Char)
 
#define COMBINING_CLASS(Char)
 
#define SBase   0xAC00
 
#define LBase   0x1100
 
#define VBase   0x1161
 
#define TBase   0x11A7
 
#define LCount   19
 
#define VCount   21
 
#define TCount   28
 
#define NCount   (VCount * TCount)
 
#define SCount   (LCount * NCount)
 

Typedefs

typedef uint64_t(* randomWordFt) (void)
 

Enumerations

enum  localeType { LOCALE_NORMAL, LOCALE_TURKIC, LOCALE_LITHUANIAN }
 
enum  unicodeType {
  UNICODE_CONTROL, UNICODE_FORMAT, UNICODE_UNASSIGNED, UNICODE_PRIVATE_USE,
  UNICODE_SURROGATE, UNICODE_LOWERCASE_LETTER, UNICODE_MODIFIER_LETTER, UNICODE_OTHER_LETTER,
  UNICODE_TITLECASE_LETTER, UNICODE_UPPERCASE_LETTER, UNICODE_SPACING_MARK, UNICODE_ENCLOSING_MARK,
  UNICODE_NON_SPACING_MARK, UNICODE_DECIMAL_NUMBER, UNICODE_LETTER_NUMBER, UNICODE_OTHER_NUMBER,
  UNICODE_CONNECT_PUNCTUATION, UNICODE_DASH_PUNCTUATION, UNICODE_CLOSE_PUNCTUATION, UNICODE_FINAL_PUNCTUATION,
  UNICODE_INITIAL_PUNCTUATION, UNICODE_OTHER_PUNCTUATION, UNICODE_OPEN_PUNCTUATION, UNICODE_CURRENCY_SYMBOL,
  UNICODE_MODIFIER_SYMBOL, UNICODE_MATH_SYMBOL, UNICODE_OTHER_SYMBOL, UNICODE_LINE_SEPARATOR,
  UNICODE_PARAGRAPH_SEPARATOR, UNICODE_SPACE_SEPARATOR
}
 Unicode types: UNICODE_CONTROL: General category "Other, Control" (Cc) UNICODE_FORMAT: General category "Other, Format" (Cf) UNICODE_UNASSIGNED: General category "Other, Not Assigned" (Cn) UNICODE_PRIVATE_USE: General category "Other, Private Use" (Co) UNICODE_SURROGATE: General category "Other, Surrogate" (Cs) UNICODE_LOWERCASE_LETTER: General category "Letter, Lowercase" (Ll) UNICODE_MODIFIER_LETTER: General category "Letter, Modifier" (Lm) UNICODE_OTHER_LETTER: General category "Letter, Other" (Lo) UNICODE_TITLECASE_LETTER: General category "Letter, Titlecase" (Lt) UNICODE_UPPERCASE_LETTER: General category "Letter, Uppercase" (Lu) UNICODE_SPACING_MARK: General category "Mark, Spacing" (Mc) UNICODE_ENCLOSING_MARK: General category "Mark, Enclosing" (Me) UNICODE_NON_SPACING_MARK: General category "Mark, Nonspacing" (Mn) UNICODE_DECIMAL_NUMBER: General category "Number, Decimal Digit" (Nd) UNICODE_LETTER_NUMBER: General category "Number, Letter" (Nl) UNICODE_OTHER_NUMBER: General category "Number, Other" (No) UNICODE_CONNECT_PUNCTUATION: General category "Punctuation, Connector" (Pc) UNICODE_DASH_PUNCTUATION: General category "Punctuation, Dash" (Pd) UNICODE_CLOSE_PUNCTUATION: General category "Punctuation, Close" (Pe) UNICODE_FINAL_PUNCTUATION: General category "Punctuation, Final quote" (Pf) UNICODE_INITIAL_PUNCTUATION: General category "Punctuation, Initial quote" (Pi) UNICODE_OTHER_PUNCTUATION: General category "Punctuation, Other" (Po) UNICODE_OPEN_PUNCTUATION: General category "Punctuation, Open" (Ps) UNICODE_CURRENCY_SYMBOL: General category "Symbol, Currency" (Sc) UNICODE_MODIFIER_SYMBOL: General category "Symbol, Modifier" (Sk) UNICODE_MATH_SYMBOL: General category "Symbol, Math" (Sm) UNICODE_OTHER_SYMBOL: General category "Symbol, Other" (So) UNICODE_LINE_SEPARATOR: General category "Separator, Line" (Zl) UNICODE_PARAGRAPH_SEPARATOR: General category "Separator, Paragraph" (Zp) UNICODE_SPACE_SEPARATOR: General category "Separator, Space" (Zs) More...
 

Functions

internal void segfault_sigaction (int signal, siginfo_t *si, void *arg)
 segmentation fault handler More...
 
internal void segfault_sigaction (int signal UNUSED, siginfo_t *si UNUSED, void *arg UNUSED)
 
void cleanUpCharFree (char **val)
 
void cleanUpListFree (char ***val)
 
void cleanUpFileFree (FILE **val)
 
void cleanUpFd (int *val)
 
uint64_t shStopwatch (uint8_t op)
 nanosecond stopwatch More...
 
int getLogSymbols (void)
 get current log symbols More...
 
void setLogSymbols (int mode)
 set log symbols More...
 
int getMaxLogLevel (void)
 get current max log level More...
 
void setMaxLogLevel (int logLevel)
 set max log level logs above logMaxLevel are skipped More...
 
FILE * setLogFile (char *filename)
 set log file the logs are appended to all log files set with this function More...
 
void closeLogFiles (void)
 close logfiles opened with setLogFile More...
 
int getLogMode (void)
 get current log mode (verbose, concise) More...
 
void setLogMode (int mode)
 set log mode LOG_VERBOSE, LOG_CONCISE, . More...
 
bool getLogShortPath (void)
 get current log long/short path value More...
 
void setLogShortPath (bool shortPath)
 set log long/short file path value for VERBOSE mode More...
 
bool getLogStdout (void)
 get stdout state, when TRUE (default) all logs are printed to stdout More...
 
void setLogStdout (bool state)
 enable/disable printing logs to stdout More...
 
bool openProgLogFile (void)
 log to a file named progName.log Use closeLogFiles when finished logging More...
 
void keepAnsiColorsInLog (bool state)
 enable/disable ansi color codes in logs More...
 
void _pLog (int loglevel, const char *file, const char *func, int line, const char *msg,...)
 
int print_k (FILE *stream, const struct printf_info *info, const void *const *args)
 k printf type specifier, RGB foreground, uint32_t 0x00RRGGBB More...
 
int print_K (FILE *stream, const struct printf_info *info, const void *const *args)
 K printf type specifier, RGB background, uint32_t 0x00RRGGBB More...
 
int print_k_arginfo (const struct printf_info *info UNUSED, size_t n, int *argtypes, int *size)
 procress printf argument More...
 
int print_b (FILE *stream, const struct printf_info *info, const void *const *args)
 b printf type specifier, print bool as FALSE/TRUE More...
 
int print_b_arginfo (const struct printf_info *info UNUSED, size_t n, int *argtypes, int *size)
 procress printf argument More...
 
void finalizeLibsheepyCharAtExit (void)
 finalize libsheepy char at exit More...
 
int64_t getStackLimit (void)
 get current stack limit More...
 
int setStackLimit (int64_t stackSize)
 set stack limit More...
 
int enableCoreDump (void)
 enable core dump More...
 
const char * getProgName (void)
 get program name More...
 
bool setProgName (const char *name)
 set program name More...
 
void setDefaultProgName (void)
 set default program name More...
 
void freeProgName (void)
 free ProgName if set with setProgName More...
 
const char * getProgPath (void)
 get program path When initLibsheepy is called before this function, it returns the given program path. More...
 
const char * getRealProgPath (void)
 get real program path The first call allocates libSheepyRealProgPath, it is freed with freeRealProgPath More...
 
void freeRealProgPath (void)
 free real program path finalizeLibsheepy calls this function More...
 
int systemNFreeF (char *command, int line, const char *thisFunc, const char *thisFileName)
 run system command and free command buffer a message is printed when an error occurs More...
 
time_t getModificationTime (const char *path)
 get modification time for path More...
 
int setModificationTime (const char *path, time_t mtime)
 set modification time for path More...
 
bool isReadable (const char *path)
 is path readable More...
 
bool isWritable (const char *path)
 is path writable More...
 
bool isExecutable (const char *path)
 is path executable More...
 
bool equalModificationTimes (const char *path1, const char *path2)
 compare modification times for path1 and path2 More...
 
time_t getCurrentUnixTime (void)
 get current unix time in seconds More...
 
time_t strToUnixTime (const char *date, const char *format)
 convert date string to unix time More...
 
char * timeToS (const time_t t)
 time To String convert unix time to string (ctime is not used here because it adds
at the end of the string) More...
 
char * bTimeToS (char *dst, const time_t t)
 
char * bLTimeToS (char *dst, size_t dstSize, const time_t t)
 
char * timeToYMDS (const time_t t)
 time To Year-Month-Day Hour:Minute:Second String convert unix time to string More...
 
char * bTimeToYMDS (char *dst, const time_t t)
 
char * bLTimeToYMDS (char *dst, size_t dstSize, const time_t t)
 
char * getCurrentDate (void)
 get current date in ctime format (Wed Dec 12 11:44:08 2018) More...
 
char * bGetCurrentDate (char *dst)
 
char * bLGetCurrentDate (char *dst, size_t dstSize)
 
char * getCurrentDateYMD (void)
 get current date in Y-m-d H:M:S format More...
 
char * bGetCurrentDateYMD (char *dst)
 
char * bLGetCurrentDateYMD (char *dst, size_t dstSize)
 
char * shDirname (const char *path)
 sheepy dirname More...
 
char * bDirname (char *path)
 buffer dirname More...
 
char * bLDirname (char *path, size_t pathSize)
 buffer size dirname More...
 
char * expandHome (const char *path)
 expands ~/ ($HOME) or ~USER
duplicate and expand path. More...
 
char * iExpandHome (char **path)
 expands ~/ ($HOME) or ~USER
More...
 
char * bExpandHome (char *path)
 buffer expands ~/ ($HOME) or ~USER
More...
 
char * bLExpandHome (char *path, size_t pathSize)
 buffer size expands ~/ ($HOME) or ~USER
More...
 
char * normalizePath (const char *path)
 normalize path More...
 
char * iNormalizePath (char **path)
 normalize path More...
 
char * bNormalizePath (char *path)
 buffer normalize path More...
 
char * bLNormalizePath (char *path, size_t pathSize)
 buffer size normalize path More...
 
char * relPath (const char *path, const char *start)
 relative path More...
 
char * iRelPath (char **path, const char *start)
 relative path More...
 
char * bRelPath (char *dest, const char *path, const char *start)
 relative path More...
 
char * bLRelPath (char *dest, size_t destSize, char *path, const char *start)
 relative path More...
 
char * getHomePath (void)
 get home path More...
 
char * bGetHomePath (char *path)
 copy home path to path More...
 
char * bLGetHomePath (char *path, size_t pathSize)
 copy home path to path maximum pathSize More...
 
const char * getCHomePath (void)
 get home path as a const char* More...
 
char * getCwd (void)
 get current working directory More...
 
char * bLGetCwd (char *path, size_t pathSize)
 
int chDir (const char *path)
 change directory More...
 
bool isDir (const char *path)
 is directory More...
 
char * shReadlink (const char *path)
 sheepy read link More...
 
char * endlink (const char *path)
 end link More...
 
bool isLink (const char *path)
 is symbolic link More...
 
bool fileExists (const char *filePath)
 detect files and directories More...
 
bool fileChmod (const char *filePath, mode_t mode)
 like chmod in stdlibc but return true/false More...
 
ssize_t fileSize (const char *filePath)
 get file size More...
 
ssize_t fileSizeFP (FILE *fp)
 get file size from file pointer More...
 
void * readFileToS (const char *filePath)
 read file to string More...
 
void * readStreamToS (FILE *fp)
 read file to string More...
 
void * bReadFileToS (const char *filePath, void *dst)
 buffer read file to string More...
 
void * bReadStreamToS (FILE *fp, void *dst)
 buffer read file to string More...
 
void * bLReadFileToS (const char *filePath, void *dst, size_t dstSize)
 buffer size read file to string More...
 
void * bLReadStreamToS (FILE *fp, void *dst, size_t dstSize)
 buffer size read file to string More...
 
ssize_t readFile (const char *filePath, void **buffer)
 read file to buffer More...
 
ssize_t bReadFile (const char *filePath, void *buffer)
 buffer read file to buffer More...
 
ssize_t bLReadFile (const char *filePath, void *buffer, size_t dstSize)
 buffer size read file to buffer More...
 
int writeFileS (const char *filePath, const char *string)
 write string to file More...
 
int writeFile (const char *filePath, void *buffer, size_t len)
 write buffer to file More...
 
int writeStreamS (FILE *fp, const char *string)
 write string to file More...
 
int writeLStream (FILE *fp, void *buffer, size_t len)
 write buffer to file More...
 
bool appendFileS (const char *filePath, const char *string)
 append string to filePath More...
 
bool appendFile (const char *filePath, void *buffer, size_t len)
 append buffer to file More...
 
char ** walkDir (const char *dirPath)
 list all files in a directory recursively and sort the list More...
 
internal void walkADir (const char *dirPath, char ***list)
 
char ** walkDirDir (const char *dirPath)
 list all directories in a directory recursively and sort the list More...
 
internal void walkADirDir (const char *dirPath, char ***list)
 
char ** readDir (const char *dirPath)
 list files in a directory and sort the list More...
 
char ** readDirDir (const char *dirPath)
 list directories in a directory and sort the list More...
 
char ** walkDirAll (const char *dirPath)
 list all files and directories in a directory recursively and sort the list More...
 
internal void walkADirAll (const char *dirPath, char ***list)
 
char ** readDirAll (const char *dirPath)
 list files in a directory and sort the list More...
 
mode_t getUmask (void)
 get umask More...
 
mode_t getCurrentPermissions (void)
 get current permissions for creating directories More...
 
int mkdirParents (const char *path)
 recursive mkdir More...
 
int rmAll (const char *path)
 remove all delete recursively files and directories More...
 
int rmADir (const char *dirPath)
 
int copy (const char *src, const char *dst)
 copy files recursively This function is equivalent to 'cp -Ra' without wildcards and circular link detection More...
 
int copyFile (const char *src, const char *dst)
 
int copyADir (const char *src, const char *dst, const char *path)
 
int shRename (const char *src, const char *dst)
 rename file More...
 
int shMove (const char *src, const char *dst)
 move files recursively More...
 
void setSoftwareRandom (void)
 use software random numbers works on all cpu architectures the default random function is software More...
 
void setHardwareRandom (void)
 use cpu hardware random number generator More...
 
int randomUrandomOpen (void)
 open /dev/urandom in libsheepy More...
 
void randomUrandomClose (void)
 close /dev/urandom in libsheepy call this function when random are not needed anymore More...
 
uint64_t randomWord (void)
 return random 64 bit unsigned integer call randomUrandomOpen before this calling function More...
 
uint64_t randomWordFromHW (void)
 return random 64 bit unsigned integer from the cpu when the cpu doesn't have the random generator instruction, the program stops with 'Illegal instruction' More...
 
uint64_t randomChoice (uint64_t range)
 return a random value between 0 and range 0<=value<range call randomUrandomOpen before this calling function More...
 
char * randomS (uint64_t length)
 random string More...
 
char * bRandomS (char *dst, size_t dstSize)
 buffer random string More...
 
char * randomAlphaNumS (uint64_t length)
 random alpha numerical string More...
 
char * bRandomAlphaNumS (char *dst, size_t dstSize)
 buffer random alpha numerical string More...
 
char * readS (void)
 read String read user input (one line) as a string More...
 
char * bLReadS (char *dst, size_t dstSize)
 buffer read String read user input (one line) as a string More...
 
UNUSED local char * shGetpass (void)
 sheepy get pass More...
 
char * readPasswordS (void)
 read hidden password string More...
 
bool zeroS (char *string)
 write zero to all bytes in string with memset, for clearing password buffers More...
 
bool zeroBuf (void *buf, size_t len)
 write zero to all bytes in buffer with memset More...
 
void * memdup (const void *buf, size_t size)
 memory duplicate allocate and copy buffer More...
 
void readEnter (void)
 read Enter key wait until press the enter key More...
 
char * readLine (FILE *fp)
 readLine from file stream the fist new line is converted to 0 More...
 
void freeManySF (char *paramType,...)
 free Many String More...
 
char * dupS (const char *string)
 duplicate string More...
 
void shPrintfS (const char *fmt,...)
 sheepy Print String More...
 
void shEPrintfS (const char *fmt,...)
 sheepy Error printf String print with logE More...
 
void logNFree (char *s)
 log and free More...
 
void loghex (const void *buf, size_t len)
 print buffer as hexadecimal string More...
 
char * toHexS (const void *buf, size_t len)
 create a string with bytes in buf converted to hex strings More...
 
char * toHexSepS (const void *buf, size_t len, const char *separator)
 create a string with bytes in buf converted to hex strings separated by separator More...
 
char * toHexHeadSepS (const void *buf, size_t len, const char *head, const char *separator)
 create a string with bytes in buf converted to hex strings separated by separator and with head string in front of earch byte: HEADffSEP More...
 
char * strCpy (char *restrict dst, const char *restrict src)
 strCpy - copy src to dst More...
 
char * strNCpy (char *restrict dst, const char *restrict src, size_t srcSize)
 strNCpy - copy src to dst More...
 
char * strLCpy (char *restrict dst, size_t dstSize, const char *restrict src)
 strLCpy - copy src to dst More...
 
char * strCat (char *restrict dst, const char *restrict src)
 strCat - concatenate two strings More...
 
char * strNCat (char *restrict dst, const char *restrict src, size_t srcLen)
 strNCat - concatenate two strings More...
 
char * strLCat (char *restrict dst, size_t dstSize, const char *restrict src)
 strLCat - concatenate two strings More...
 
char * strLNCat (char *restrict dst, size_t dstSize, const char *restrict src, size_t srcLen)
 strLNCat - concatenate two strings More...
 
char * catSF (const char *paramType,...)
 cat String Function More...
 
char * iCatSF (char *dst, const char *paramType,...)
 cat and copy String Function dst has to be big enough to hold the result More...
 
char * bLCatSF (char *dst, size_t dstSize, const char *paramType,...)
 cat and copy String Function More...
 
char * formatS (const char *fmt,...)
 format string allocate and format string using asprintf More...
 
char * bFormatS (char *string, const char *fmt,...)
 format string More...
 
char * bLFormatS (char *string, size_t stringSize, const char *fmt,...)
 format string More...
 
char * appendS (const char *string1, const char *string2)
 append strings More...
 
char * appendCharS (const char *string1, char c)
 append char to string when c is 0 the result is string1 More...
 
char * appendSChar (char c, const char *string2)
 append string to char More...
 
char * iAppendS (char **string1, const char *string2)
 append strings More...
 
char * iAppendCharS (char **string1, char c)
 append char to string More...
 
char * iAppendNFreeS (char **string1, char *string2)
 append and free strings More...
 
char * iAppendManySF (char **string, const char *paramType,...)
 append many strings More...
 
char * bAppendManySF (char *string, const char *paramType,...)
 buffer append many strings More...
 
char * bLAppendManySF (char *string, size_t stringSize, const char *paramType,...)
 buffer size append many strings More...
 
char * prependS (const char *string1, const char *string2)
 prepend strings More...
 
char * prependCharS (const char *string1, char c)
 prepend char to string More...
 
char * prependSChar (char c, const char *string2)
 prepend string to char More...
 
char * iPrependS (char **string1, const char *string2)
 prepend strings More...
 
char * iPrependCharS (char **string1, char c)
 prepend char to string More...
 
char * iPrependNFreeS (char **string1, char *string2)
 prepend and free strings More...
 
char * bPrependS (char *string1, const char *string2)
 buffer prepend strings More...
 
char * bLPrependS (char *string1, size_t string1Size, const char *string2)
 buffer prepend strings More...
 
char * replaceS (const char *s, const char *olds, const char *news, size_t max)
 replace String the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * replaceCharSS (const char *s, char olds, const char *news, size_t max)
 
char * replaceSCharS (const char *s, const char *olds, char news, size_t max)
 
char * replaceCharCharS (const char *s, char olds, char news, size_t max)
 
size_t replaceSLen (const char *s, const char *olds, const char *news, size_t max)
 replaceSLen returns the length of the resulting string More...
 
char * iReplaceS (char **s, const char *olds, const char *news, size_t max)
 replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * iReplaceCharSS (char **s, char olds, const char *news, size_t max)
 
char * iReplaceSCharS (char **s, const char *olds, char news, size_t max)
 
char * iReplaceCharCharS (char **s, char olds, char news, size_t max)
 
char * bReplaceS (char *s, const char *olds, const char *news, size_t max)
 buffer replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * bLReplaceS (char *s, size_t sSize, const char *olds, const char *news, size_t max)
 buffer size replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * replaceManySF (const char *paramType,...)
 replace Many Strings the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result More...
 
char * iReplaceManySF (char **s, char *paramType,...)
 replace Many Strings the olds string is replaced with the news string max times in the result More...
 
char * bReplaceManySF (char *s, char *paramType,...)
 buffer replace Many Strings the olds string is replaced with the news string max times in the result More...
 
char * bLReplaceManySF (char *s, size_t sSize, char *paramType,...)
 buffer size replace Many Strings the olds string is replaced with the news string max times in the result More...
 
char * icReplaceS (const char *s, const char *olds, const char *news, size_t max)
 ignore case Replace String the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * icReplaceCharSS (const char *s, char olds, const char *news, size_t max)
 
char * icReplaceSCharS (const char *s, const char *olds, char news, size_t max)
 
char * icReplaceCharCharS (const char *s, char olds, char news, size_t max)
 
char * iicReplaceS (char **s, const char *olds, const char *news, size_t max)
 in place ignore case replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * iicReplaceCharSS (char **s, char olds, const char *news, size_t max)
 
char * iicReplaceSCharS (char **s, const char *olds, char news, size_t max)
 
char * iicReplaceCharCharS (char **s, char olds, char news, size_t max)
 
char * bicReplaceS (char *s, const char *olds, const char *news, size_t max)
 buffer ignore case replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * bLicReplaceS (char *s, size_t sSize, const char *olds, const char *news, size_t max)
 buffer size ignore case replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * icReplaceManySF (const char *paramType,...)
 ignore case replace Many Strings the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result More...
 
char * iicReplaceManySF (char **s, char *paramType,...)
 in place ignore case replace Many Strings the olds string is replaced with the news string max times in the result More...
 
char * bicReplaceManySF (char *s, char *paramType,...)
 buffer ignore case replace Many Strings the olds string is replaced with the news string max times in the result More...
 
char * bLicReplaceManySF (char *s, size_t sSize, char *paramType,...)
 buffer size ignore case replace Many Strings the olds string is replaced with the news string max times in the result More...
 
bool eqS (const char *string1, const char *string2)
 string Equal compare string1 to string2 More...
 
bool eqCharS (char c, const char *string2)
 
bool eqSChar (const char *string1, char c)
 
bool eqIS (const char *string1, const char *string2, int64_t index)
 string Index Equal compare string1 at index to string2 when string2 is empty, the result is false More...
 
bool eqICharS (const char *string1, char c, int64_t index)
 
bool startsWithS (const char *string1, const char *string2)
 starts With String compare start of string1 with string2 More...
 
bool startsWithCharS (const char *string1, char c)
 
bool endsWithS (const char *string1, const char *string2)
 ends With String compare end of string1 with string2 More...
 
bool endsWithCharS (const char *string1, char c)
 
ssize_t countS (const char *s, const char *needle)
 count String count number of (non-overlapping) occurrences of a substring More...
 
ssize_t countCharS (const char *s, char c)
 
bool icEqS (const char *string1, const char *string2)
 ignore case string Equal compare string1 to string2 More...
 
bool icEqCharS (char c, const char *string2)
 
bool icEqSChar (const char *string1, char c)
 
bool icEqIS (const char *string1, const char *string2, int64_t index)
 ignore case string Index Equal compare string1 at index to string2 when string2 is empty, the result is false More...
 
bool icEqICharS (const char *string1, char c, int64_t index)
 
bool icStartsWithS (const char *string1, const char *string2)
 ignore case starts With String compare start of string1 with string2 More...
 
bool icStartsWithCharS (const char *string1, char c)
 
bool icEndsWithS (const char *string1, const char *string2)
 ignore case ends With String compare end of string1 with string2 More...
 
bool icEndsWithCharS (const char *string1, char c)
 
ssize_t icCountS (const char *s, const char *needle)
 ignore case count String count number of (non-overlapping) occurrences of a substring More...
 
ssize_t icCountCharS (const char *s, char c)
 
bool hasCtrlChar (const char *string)
 has control char More...
 
char * stripCtrlS (const char *string)
 remove terminal control char from string More...
 
char * iStripCtrlS (char **string)
 remove terminal control char from string More...
 
char * bStripCtrlS (char *string)
 remove terminal control char from string More...
 
char * stripColorsS (const char *string)
 remove ansi colors from string More...
 
char * iStripColorsS (char **string)
 remove ansi colors from string More...
 
char * bStripColorsS (char *string)
 remove terminal control char from string More...
 
char * quoteS (const char *s, char delim)
 add backslash '\' before delim('\'' or '"') and backslash the backslashes in the result avoid splitting the string when it is in a source file or a json string More...
 
char * bQuoteS (char *dest, const char *s, char delim)
 add backslash '\' before delim('\'' or '"') and backslash the backslashes in the result avoid splitting the string when it is in a source file or a json string More...
 
char * bLQuoteS (char *dest, size_t destSize, const char *s, char delim)
 add backslash '\' before delim('\'' or '"') and backslash the backslashes in the result avoid splitting the string when it is in a source file or a json string More...
 
size_t quoteLenS (const char *s, char delim)
 return the length of the escaped string (without the terminating \0) More...
 
char * escapeS (const char *s, char delim)
 escape string according the json specification (RFC 8259) if there is in the string, the backslash is escaped and it will be parsed as the string '' be the json parsers the unicode characters should be converted to UTF8 codepoints instead of using the result can be included in a json string and the parsing will be correct More...
 
char * bEscapeS (char *dest, const char *s, char delim)
 escape string according the json specification (RFC 8259) if there is in the string, the backslash is escaped and it will be parsed as the string '' be the json parsers the unicode characters should be converted to UTF8 codepoints instead of using the result can be included in a json string and the parsing will be correct More...
 
char * bLEscapeS (char *dest, size_t destSize, const char *s, char delim)
 escape string according the json specification (RFC 8259) if there is in the string, the backslash is escaped and it will be parsed as the string '' be the json parsers the unicode characters should be converted to UTF8 codepoints instead of using the result can be included in a json string and the parsing will be correct More...
 
size_t escapeLenS (const char *s, char delim)
 return the length of the escaped string (without the terminating \0) More...
 
char nibbleToHex (u8 n)
 convert number between 0 and 15 to hexadecimal character '0' to 'F' More...
 
char * cEscapeS (const char *S)
 escape string to become a valid C source string control characters, backslash and double quotes are escaped. More...
 
char * bCEscapeS (char *dest, const char *S)
 escape string to become a valid C source string control characters, backslash and double quotes are escaped. More...
 
char * bLCEscapeS (char *dest, size_t destSize, const char *S)
 escape string to become a valid C source string control characters, backslash and double quotes are escaped. More...
 
size_t cEscapeLenS (const char *s)
 return the length of the escaped string (without the terminating \0) More...
 
bool isNumber (const char *string)
 is Number (integer or float) String More...
 
bool isInt (const char *string)
 is Integer String More...
 
int64_t parseInt (const char *string)
 convert string to decimal integer More...
 
int64_t parseIntChar (char c)
 
int64_t parseI64 (const char *string)
 convert string to decimal integer More...
 
int64_t parseI64Char (char c)
 
double parseDouble (const char *string)
 convert string to double More...
 
double parseDoubleChar (char c)
 
uint64_t parseHex (const char *string)
 parse hexadecimal number in a string More...
 
char * intToS (int64_t n)
 int To String More...
 
char * bIntToS (char *s, int64_t n)
 buffer int To String More...
 
char * doubleToS (double n)
 double To String More...
 
char * bDoubleToS (char *s, double n)
 buffer double To String More...
 
size_t lenS (const char *string)
 length string More...
 
size_t sizeS (const char *string)
 string buffer size More...
 
char * upperS (const char *string)
 upper case String duplicate string More...
 
char * iUpperS (char **string)
 upper case String More...
 
char * bUpperS (char *string)
 buffer upper case String More...
 
char * lowerS (const char *string)
 lower case String duplicate string More...
 
char * iLowerS (char **string)
 lower case String More...
 
char * bLowerS (char *string)
 buffer lower case String More...
 
char * trimS (const char *string)
 trim String duplicate string More...
 
char * iTrimS (char **string)
 trim String More...
 
char * bTrimS (char *string)
 buffer trim String More...
 
char * lTrimS (const char *string)
 left trim String duplicate string More...
 
char * iLTrimS (char **string)
 left trim String More...
 
char * bLTrimS (char *string)
 buffer left trim String More...
 
char * rTrimS (const char *string)
 right trim String duplicate string More...
 
char * iRTrimS (char **string)
 right trim String More...
 
char * bRTrimS (char *string)
 buffer right trim String More...
 
char * uniqS (const char *string, char c)
 uniq String duplicate string More...
 
char * iUniqS (char **string, char c)
 uniq String More...
 
char * bUniqS (char *string, char c)
 buffer uniq String More...
 
char * icUniqS (const char *string, char c)
 ignore case uniq String duplicate string More...
 
char * iicUniqS (char **string, char c)
 in place ignore case uniq String More...
 
char * bicUniqS (char *string, char c)
 ignore case buffer uniq String More...
 
char * repeatS (const char *string, size_t count)
 repeat string count times More...
 
char * iRepeatS (char **string, size_t count)
 repeat string count times More...
 
char * bRepeatS (char *dest, const char *string, size_t count)
 repeat string count times More...
 
char * bLRepeatS (char *dest, size_t destSize, const char *string, size_t count)
 repeat string count times More...
 
char * repeatCharS (char c, size_t count)
 repeat char count times More...
 
char * bRepeatCharS (char *dest, char c, size_t count)
 repeat char count times More...
 
char * bLRepeatCharS (char *dest, size_t destSize, char c, size_t count)
 repeat char count times More...
 
ssize_t repeatLenS (const char *string, size_t count)
 length of string repeated count times More...
 
char * ellipsisStartS (const char *string, size_t targetLength, const char *ellipsisString)
 ellipsis start string More...
 
char * iEllipsisStartS (char **string, size_t targetLength, const char *ellipsisString)
 ellipsis start string More...
 
char * bEllipsisStartS (char *dest, const char *string, size_t targetLength, const char *ellipsisString)
 ellipsis start string More...
 
char * bLEllipsisStartS (char *dest, size_t destSize, const char *string, size_t targetLength, const char *ellipsisString)
 ellipsis start string More...
 
char * ellipsisStartCharS (const char *string, size_t targetLength, char ellipsisChar)
 ellipsis start string More...
 
char * iEllipsisStartCharS (char **string, size_t targetLength, char ellipsisChar)
 ellipsis start string More...
 
char * bEllipsisStartCharS (char *dest, const char *string, size_t targetLength, char ellipsisChar)
 ellipsis start string More...
 
char * bLEllipsisStartCharS (char *dest, size_t destSize, const char *string, size_t targetLength, char ellipsisChar)
 ellipsis start string More...
 
ssize_t ellipsisLenS (const char *string, size_t targetLength, const char *ellipsisString)
 length of string after ellipsis More...
 
char * ellipsisEndS (const char *string, size_t targetLength, const char *ellipsisString)
 ellipsis end string More...
 
char * iEllipsisEndS (char **string, size_t targetLength, const char *ellipsisString)
 ellipsis end string More...
 
char * bEllipsisEndS (char *dest, const char *string, size_t targetLength, const char *ellipsisString)
 ellipsis end string More...
 
char * bLEllipsisEndS (char *dest, size_t destSize, const char *string, size_t targetLength, const char *ellipsisString)
 ellipsis end string More...
 
char * ellipsisEndCharS (const char *string, size_t targetLength, char ellipsisChar)
 ellipsis end string More...
 
char * iEllipsisEndCharS (char **string, size_t targetLength, char ellipsisChar)
 ellipsis end string More...
 
char * bEllipsisEndCharS (char *dest, const char *string, size_t targetLength, char ellipsisChar)
 ellipsis end string More...
 
char * bLEllipsisEndCharS (char *dest, size_t destSize, const char *string, size_t targetLength, char ellipsisChar)
 ellipsis end string More...
 
char * padStartS (const char *string, size_t targetLength, const char *padString)
 pad start string More...
 
char * iPadStartS (char **string, size_t targetLength, const char *padString)
 pad start string More...
 
char * bPadStartS (char *dest, const char *string, size_t targetLength, const char *padString)
 pad start string More...
 
char * bLPadStartS (char *dest, size_t destSize, const char *string, size_t targetLength, const char *padString)
 pad start string More...
 
char * padStartCharS (const char *string, size_t targetLength, char padChar)
 pad start string More...
 
char * iPadStartCharS (char **string, size_t targetLength, char padChar)
 pad start string More...
 
char * bPadStartCharS (char *dest, const char *string, size_t targetLength, char padChar)
 pad start string More...
 
char * bLPadStartCharS (char *dest, size_t destSize, const char *string, size_t targetLength, char padChar)
 pad start string More...
 
ssize_t padStartLenS (const char *string, size_t targetLength, const char *padString)
 length of string after padStart More...
 
char * padEndS (const char *string, size_t targetLength, const char *padString)
 pad end string More...
 
char * iPadEndS (char **string, size_t targetLength, const char *padString)
 pad end string More...
 
char * bPadEndS (char *dest, const char *string, size_t targetLength, const char *padString)
 pad end string More...
 
char * bLPadEndS (char *dest, size_t destSize, const char *string, size_t targetLength, const char *padString)
 pad end string More...
 
char * padEndCharS (const char *string, size_t targetLength, char padChar)
 pad end string More...
 
char * iPadEndCharS (char **string, size_t targetLength, char padChar)
 pad end string More...
 
char * bPadEndCharS (char *dest, const char *string, size_t targetLength, char padChar)
 pad end string More...
 
char * bLPadEndCharS (char *dest, size_t destSize, const char *string, size_t targetLength, char padChar)
 pad end string More...
 
ssize_t padEndLenS (const char *string, size_t targetLength, const char *padString)
 length of string after padEnd More...
 
char getS (const char *string, int64_t index)
 get string More...
 
char * setS (char *string, int64_t index, char c)
 set string More...
 
char * swapS (char *string, int64_t index1, int64_t index2)
 swap characters in string More...
 
char * iSwapS (char **string, int64_t index1, int64_t index2)
 swap characters in string More...
 
char * bSwapS (char *string, int64_t index1, int64_t index2)
 swap characters in string More...
 
char * bLSwapS (char *string, size_t size, int64_t index1, int64_t index2)
 swap characters in string More...
 
char * sliceS (const char *string, int64_t start, int64_t end)
 slice String return new string which is the string between start and end negative indexes are allowed More...
 
char * iSliceS (char **string, int64_t start, int64_t end)
 slice String return string which is the string between start and end negative indexes are allowed More...
 
char * bSliceS (char *string, int64_t start, int64_t end)
 buffer slice String return string which is the string between start and end negative indexes are allowed More...
 
char * bLSliceS (char *string, size_t stringSize, int64_t start, int64_t end)
 buffer size slice String return string which is the string between start and end negative indexes are allowed More...
 
char * cropS (char *string, int64_t start, int64_t end)
 Crop String return a new string with characters from start and end in string and delete characters from start to end in the original string negative indexes are allowed. More...
 
char * iCropS (char **string, int64_t start, int64_t end)
 Crop String return a new string with characters from start and end in string and delete characters from start to end in the original string negative indexes are allowed. More...
 
char cropElemS (char *string, int64_t index)
 
char iCropElemS (char **string, int64_t index)
 
char * insertS (const char *string, int64_t index, const char *toInsert)
 insert string in string at index More...
 
char * insertNFreeS (const char *string, int64_t index, char *toInsert)
 insert string in string at index and free toInsert when successful More...
 
char * iInsertS (char **string, int64_t index, const char *toInsert)
 insert string in string at index More...
 
char * iInsertNFreeS (char **string, int64_t index, char *toInsert)
 insert string in string at index and free toInsert More...
 
char * bInsertS (char *string, int64_t index, const char *toInsert)
 buffer insert string in string at index More...
 
char * bLInsertS (char *string, size_t stringSize, int64_t index, const char *toInsert)
 buffer size insert string in string at index More...
 
char * injectS (const char *string, int64_t index, char toInject)
 inject a char in string at index More...
 
char * iInjectS (char **string, int64_t index, char toInject)
 inject a char in string at index More...
 
char * bInjectS (char *string, int64_t index, char toInject)
 buffer inject a char in string at index More...
 
char * bLInjectS (char *string, size_t stringSize, int64_t index, char toInject)
 buffer size inject a char in string at index More...
 
char * delS (const char *string, int64_t start, int64_t end)
 delete string More...
 
char * iDelS (char **string, int64_t start, int64_t end)
 delete string More...
 
char * bDelS (char *string, int64_t start, int64_t end)
 buffer delete string More...
 
char * bLDelS (char *string, size_t stringSize, int64_t start, int64_t end)
 buffer size delete string More...
 
char * delElemS (const char *string, int64_t index)
 delete element/character string More...
 
char * iDelElemS (char **string, int64_t index)
 delete element/character string More...
 
char * bDelElemS (char *string, int64_t index)
 buffer delete element/character string More...
 
char * bLDelElemS (char *string, size_t stringSize, int64_t index)
 buffer size delete element/character string More...
 
char * findS (const char *string, const char *needle)
 find String More...
 
char * findCharS (const char *string, char c)
 
ssize_t indexOfS (const char *string, const char *needle)
 indexOf String relative to start More...
 
ssize_t indexOfCharS (const char *string, char c)
 
bool hasS (const char *string, const char *needle)
 has String More...
 
bool hasCharS (const char *string, char c)
 
char * icFindS (const char *string, const char *needle)
 ignore case Find String More...
 
char * icFindCharS (const char *string, char c)
 
ssize_t icIndexOfS (const char *string, const char *needle)
 ignore case indexOf String relative to start More...
 
ssize_t icIndexOfCharS (const char *string, char c)
 
bool icHasS (const char *string, const char *needle)
 ignore case has String More...
 
bool icHasCharS (const char *string, char c)
 
char * tokS (char *s, const char *delim, char **saveptr)
 token in String More...
 
char * icTokS (char *s, const char *delim, char **saveptr)
 ignore case token in String More...
 
size_t lenUTF8 (const char *s)
 character length of UTF-8 string More...
 
size_t bLLenUTF8 (const char *s, size_t maxSize)
 buffer character length of UTF-8 string More...
 
bool isUTF8 (const char *string)
 is UTF-8 string More...
 
bool bLIsUTF8 (const char *string, size_t stringSize)
 buffer length is UTF-8 string More...
 
bool isCodeUTF8 (const char *code)
 is code point UTF8 encoded string More...
 
const char * nextUTF8 (const char *utf8)
 next UTF-8 code point More...
 
const char * bLNextUTF8 (const char *string, size_t utf8Size, const char *utf8)
 buffer length next UTF-8 code point More...
 
const char * findNextUTF8 (const char *string, size_t utf8Size, const char *utf8)
 find next UTF-8 code point even not at the start of a code point More...
 
const char * prevUTF8 (const char *utf8)
 previous UTF-8 code point More...
 
const char * bPrevUTF8 (const char *string, const char *utf8)
 buffer previous UTF-8 code point More...
 
local const char * bPrevUTF8Tiny (const char *string, const char *utf8)
 
local char * bPrevRWUTF8Tiny (const char *string, char *utf8)
 
const char * idx2PtrUTF8 (const char *utf8, int64_t index)
 index to pointer UTF8 encoded string More...
 
local char * idx2PtrRWUTF8 (char *utf8, int64_t index)
 index to pointer UTF8 encoded string - read write utf8 string (char*) More...
 
const char * bLIdx2PtrUTF8 (const char *utf8, size_t utf8Size, int64_t index)
 
int64_t ptr2IdxUTF8 (const char *utf8, const char *pos)
 pointer to code point index UTF8 encoded string More...
 
int64_t bPtr2IdxUTF8 (const char *start, const char *utf8, const char *pos)
 buffer pointer to code point index UTF8 encoded string More...
 
int64_t bLPtr2IdxUTF8 (const char *utf8, size_t utf8Size, const char *pos)
 buffer size pointer to code point index UTF8 encoded string More...
 
int64_t bLPtr2NegIdxUTF8 (const char *utf8, size_t utf8Size, const char *pos)
 buffer size pointer to negative code point index UTF8 encoded string More...
 
char * makeValidUTF8 (const char *utf8)
 make valid UTF-8 encoded string More...
 
char * bMakeValidUTF8 (char *utf8)
 buffer make valid UTF-8 encoded string More...
 
char * nMakeValidUTF8 (const char *utf8, size_t utf8Len)
 length make valid UTF-8 encoded string More...
 
char * bNMakeValidUTF8 (char *dst, const char *utf8, size_t utf8Len)
 buffer length make valid UTF-8 encoded string More...
 
char * bLMakeValidUTF8 (char *dst, size_t dstSize, const char *utf8)
 buffer destination size make valid UTF-8 encoded string More...
 
char * bLNMakeValidUTF8 (char *dst, size_t dstSize, const char *utf8, size_t utf8Len)
 buffer destination size source length make valid UTF-8 encoded string More...
 
char * strNCpyUTF8 (char *dst, const char *src, size_t srcLen)
 strNCpyUTF8 - copy src to dst with srcLen in code points More...
 
char * strLCpyUTF8 (char *dst, size_t dstSize, const char *src)
 strLCpyUTF8 - copy src to dst More...
 
char * strNCatUTF8 (char *dst, const char *src, size_t srcLen)
 strNCatUTF8 - concatenate two UTF-8 encoded strings More...
 
char * strLCatUTF8 (char *dst, size_t dstSize, const char *src)
 strLCatUTF8 - concatenate two UTF-8 encoded strings More...
 
char * strLNCatUTF8 (char *dst, size_t dstSize, const char *src, size_t srcLen)
 strLNCatUTF8 - concatenate two UTF-8 encoded strings More...
 
char * icReplaceUTF8 (const char UNUSED *s, const char UNUSED *olds, const char UNUSED *news, size_t UNUSED max)
 ignore case Replace UTF8 encoded String the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * icReplaceCharSUTF8 (const char *s UNUSED, char olds UNUSED, const char *news UNUSED, size_t max UNUSED)
 
char * icReplaceSCharUTF8 (const char *s UNUSED, const char *olds UNUSED, char news UNUSED, size_t max UNUSED)
 
char * iicReplaceUTF8 (char UNUSED **s, const char UNUSED *olds, const char UNUSED *news, size_t UNUSED max)
 in place ignore case replace UTF8 encoded String the olds UTF8 encoded string is replaced with the news UTF8 encoded string max times in the result 0 for max means replace all olds strings More...
 
char * iicReplaceCharSUTF8 (char **s UNUSED, char olds UNUSED, const char *news UNUSED, size_t max UNUSED)
 
char * iicReplaceSCharUTF8 (char **s UNUSED, const char *olds UNUSED, char news UNUSED, size_t max UNUSED)
 
char * bicReplaceUTF8 (char UNUSED *s, const char UNUSED *olds, const char UNUSED *news, size_t UNUSED max)
 buffer ignore case replace UTF8 encoded String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * bLicReplaceUTF8 (char UNUSED *s, size_t UNUSED sSize, const char UNUSED *olds, const char UNUSED *news, size_t max UNUSED)
 buffer size ignore case replace UTF8 encoded String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings More...
 
char * icReplaceManyUTF8F (const char *paramType UNUSED,...)
 ignore case replace Many UTF8 encoded Strings the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result More...
 
char * iicReplaceManyUTF8F (char **s UNUSED, char *paramType UNUSED,...)
 in place ignore case replace Many UTF8 encoded Strings the olds string is replaced with the news string max times in the result More...
 
char * bicReplaceManyUTF8F (char *s UNUSED, char *paramType UNUSED,...)
 buffer ignore case replace Many UTF8 encoded Strings the olds string is replaced with the news string max times in the result More...
 
char * bLicReplaceManyUTF8F (char *s UNUSED, size_t sSize UNUSED, char *paramType UNUSED,...)
 buffer size ignore case replace Many UTF8 encoded Strings the olds string is replaced with the news string max times in the result More...
 
bool eqIUTF8 (const char *string1, const char *string2, int64_t index)
 UTF8 encoded string Index Equal compare string1 at character index to string2 when string2 is empty, the result is false. More...
 
bool eqICharUTF8 (const char *string1, char c, int64_t index)
 
bool icEqUTF8 (const char *string1, const char *string2)
 ignore case UTF8 encoded string Equal compare string1 to string2 More...
 
bool icEqCharUTF8 (char c, const char *string2)
 
bool icEqUTF8Char (const char *string1, char c)
 
bool icEqIUTF8 (const char *string1 UNUSED, const char *string2 UNUSED, int64_t index UNUSED)
 ignore case UTF8 encoded string Index Equal compare string1 at character index to string2 when string2 is empty, the result is false More...
 
bool icEqICharUTF8 (const char *string1 UNUSED, char c UNUSED, int64_t index UNUSED)
 
bool icStartsWithUTF8 (const char *string1, const char *string2)
 ignore case starts With UTF8 encoded String compare start of string1 with string2 More...
 
bool icEndsWithUTF8 (const char *string1, const char *string2)
 ignore case ends With UTF8 encoded String compare end of string1 with string2 More...
 
ssize_t icCountUTF8 (const char *s, const char *needle)
 ignore case count UTF8 encoded String count number of (non-overlapping) occurrences of a substring More...
 
internal localeType getLocaleType (void)
 some case convertions depend on the current LOCALE More...
 
rune code2RuneUTF8 (const char *code)
 UTF-8 code point to rune. More...
 
rune code2RuneLUTF8 (const char *code, uint8_t *n)
 UTF-8 code point to rune and length. More...
 
size_t bRune2CodeUTF8 (char *dst, rune c)
 rune to UTF-8 code point More...
 
uint8_t runeLenUTF8 (rune r)
 rune length as UTF-8 code point More...
 
internal size_t decompose_hangul (rune s, rune *r)
 
internal const char * find_decomposition (rune ch)
 
internal size_t runeFullyDecompose (rune ch, rune *result, size_t resultLen)
 
internal size_t output_marks (const char **p_inout, char *dst, bool remove_dot)
 
internal size_t output_special_case (char *dst, int offset, int type, int which)
 
rune toupperUTF8 (rune c)
 rune toupper UTF8 More...
 
internal size_t _upperUTF8 (char *dst, const char *utf8, localeType lcl)
 
char * upperUTF8 (const char *utf8)
 upper case UTF-8 encoded string duplicate string More...
 
char * iUpperUTF8 (char **utf8)
 upper case UTF-8 encoded string More...
 
char * bUpperUTF8 (char *utf8 UNUSED)
 buffer upper case String More...
 
local int runeCombiningClass (rune uc)
 runeCombiningClass: : a Unicode character More...
 
internal bool has_more_above (const char *str)
 
rune tolowerUTF8 (rune c)
 rune tolower UTF8 More...
 
internal size_t _lowerUTF8 (char *dst, const char *utf8, localeType lcl)
 
char * lowerUTF8 (const char *utf8)
 lower case UTF-8 String duplicate string More...
 
char * iLowerUTF8 (char **utf8)
 lower case String More...
 
char * bLowerUTF8 (char *string UNUSED)
 buffer lower case String More...
 
char * casefoldUTF8 (const char *utf8)
 casefold UTF-8 encoded string More...
 
char * uniqUTF8 (const char *string, const char *code)
 uniq UTF-8 String duplicate string More...
 
char * iUniqUTF8 (char **string, const char *code)
 uniq UTF-8 String More...
 
char * bUniqUTF8 (char *string, const char *code)
 buffer uniq String More...
 
char * icUniqUTF8 (const char *string UNUSED, const char *code UNUSED)
 ignore case uniq String duplicate string More...
 
char * iicUniqUTF8 (char **string UNUSED, const char *code UNUSED)
 in place ignore case uniq String More...
 
char * bicUniqUTF8 (char *string UNUSED, char c UNUSED)
 ignore case buffer uniq String More...
 
rune getUTF8 (const char *string, int64_t index)
 get UTF8 encoded string More...
 
char * setUTF8 (char *string, int64_t index, rune c)
 set UTF8 encoded string More...
 
char * sliceUTF8 (const char *string, int64_t start, int64_t end)
 slice UTF8 encoded String return new string which is the string between start and end negative indexes are allowed More...
 
char * iSliceUTF8 (char **string, int64_t start, int64_t end)
 slice UTF8 encoded String return string which is the string between start and end negative indexes are allowed More...
 
char * bSliceUTF8 (char *string, int64_t start, int64_t end)
 buffer slice UTF8 encoded String return string which is the string between start and end negative indexes are allowed More...
 
char * bLSliceUTF8 (char *string, size_t stringSize, int64_t start, int64_t end)
 buffer size slice UTF8 encoded String return string which is the string between start and end negative indexes are allowed More...
 
char * insertUTF8 (const char *string, int64_t index, const char *toInsert)
 insert string in UTF8 encoded string at index More...
 
char * insertNFreeUTF8 (const char *string, int64_t index, char *toInsert)
 insert string in UTF8 encoded string at index and free toInsert More...
 
char * iInsertUTF8 (char **string, int64_t index, const char *toInsert)
 insert string in UTF8 encoded string at index More...
 
char * iInsertNFreeUTF8 (char **string, int64_t index, char *toInsert)
 insert string in UTF8 encoded string at index and free toInsert More...
 
char * bInsertUTF8 (char *string, int64_t index, const char *toInsert)
 buffer insert string in UTF8 encoded string at index More...
 
char * bLInsertUTF8 (char *string, size_t stringSize, int64_t index, const char *toInsert)
 buffer size insert string in UTF8 encoded string at index More...
 
char * delUTF8 (const char *string, int64_t start, int64_t end)
 delete UTF8 encoded string More...
 
char * iDelUTF8 (char **string, int64_t start, int64_t end)
 delete UTF8 encoded string More...
 
char * bDelUTF8 (char *string, int64_t start, int64_t end)
 buffer delete UTF8 encoded string More...
 
char * bLDelUTF8 (char *string, size_t stringSize, int64_t start, int64_t end)
 buffer size delete UTF8 encoded string More...
 
ssize_t indexOfUTF8 (const char *string, const char *needle)
 indexOf UTF8 encoded String relative to start More...
 
ssize_t icIndexOfUTF8 (const char *string UNUSED, const char *needle UNUSED)
 ignore case indexOf UTF8 encoded String relative to start More...
 
bool icHasUTF8 (const char *string, const char *needle)
 ignore case has UTF8 encoded String More...
 
char * icTokUTF8 (const char *s UNUSED, const char *delim UNUSED, char **saveptr UNUSED)
 ignore case token in UTF8 encoded String More...
 
char ** icSplitUTF8 (const char *string UNUSED, const char *delim UNUSED)
 ignore case split UTF8 encoded string with delim string return list More...
 
char ** icExtractUTF8 (const char *string UNUSED, const char *delim1 UNUSED, const char *delim2 UNUSED)
 ignore case extract UTF8 encoded string between delim1 and delim2 strings return list More...
 
char ** icExtractCharSUTF8 (const char *string UNUSED, char delim1 UNUSED, const char *delim2 UNUSED)
 
char ** icExtractSCharUTF8 (const char *string UNUSED, const char *delim1 UNUSED, char delim2 UNUSED)
 
internal int icListSortUTF8Cmp (const void *a, const void *b)
 ignore case list Sort UTF-8 encoded String Compare function More...
 
char ** icListSortUTF8 (char **list)
 ignore case list Sort UTF8 encoded String duplicate list and sort More...
 
char ** iicListSortUTF8 (char ***list)
 ignore case list Sort UTF8 encoded String More...
 
bool icListEqUTF8 (char **list1, char **list2)
 ignore case list Equal UTF8 encoded String compare each element of list1 and list2 More...
 
bool icListHasUTF8 (char **list, const char *string)
 ignore case and return true when list has UTF8 encoded string More...
 
ssize_t icListIndexOfUTF8 (char **list, const char *string)
 ignore case and return index of UTF8 encoded string in list More...
 
ssize_t icListBinarySearchUTF8 (char **list, const char *string)
 ignore case list binary search UTF8 encoded string More...
 
char ** icListUniqUTF8 (char **list)
 ignore case and uniquify UTF8 encoded elements of list duplicate list each elements are unique in the new list More...
 
char ** iicListUniqUTF8 (char ***list)
 ignore case and uniquify UTF8 encoded elements of list each elements are unique in the list More...
 
char * emptySF (void)
 empty String Function More...
 
char * iEmptySF (char **string)
 empty String Function More...
 
bool isEmptyS (const char *string)
 is Empty String More...
 
bool isBlankS (const char *string)
 is Blank String More...
 
ssize_t intIndex (int64_t index, int64_t length)
 int to positive index index can be negative More...
 
char ** listEmptySF (void)
 list Empty String Function More...
 
char ** iListEmptySF (char ***list)
 list Empty String Function More...
 
bool listIsEmptyS (char **list)
 list Is Empty String More...
 
bool listIsBlankS (char **list)
 list Is Empty String More...
 
char ** listCreateSF (const char *paramType,...)
 list Create String Function create a list from the list of parameters used from the listCreateS(...) macro More...
 
char ** listFromArrayS (char **array, size_t size)
 list From Array String More...
 
char ** listFromCArrayS (const char **array, size_t size)
 list From Const Array String More...
 
char ** listPushS (char ***list, const char *s)
 list Push String append s at the end of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, NULL is pushed at the end of the list More...
 
char ** listPushCharS (char ***list, char c)
 
char ** iListPushS (char ***list, char *s)
 list Push String append s pointer at the end of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, NULL is pushed at the end of the list More...
 
char * listPopS (char ***list)
 list Pop String return last string from list and remove last element from the list More...
 
char ** listPrependS (char ***list, const char *s)
 list Prepend String append s at the beginning of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, the operation is canceled More...
 
char ** listPrependCharS (char ***list, char c)
 
char ** iListPrependS (char ***list, char *s)
 list Prepend String append s pointer at the beginning of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, the operation is canceled More...
 
char * listDequeueS (char ***list)
 list Dequeue String return first string from list and remove it from the list More...
 
void listFreeS (char **list)
 list Free String More...
 
void listFreeManySF (char **paramType,...)
 list free many String More...
 
size_t listLengthS (char **list)
 list Length String return number of elements until the first NULL element More...
 
size_t listLengthCS (const char **list)
 const list Length String return number of elements until the first NULL element More...
 
ssize_t listStrLengthS (char **list)
 list String Length String More...
 
ssize_t listIntIndexS (char **list, int64_t index)
 list int to index String index can be negative More...
 
char ** listAddrS (char **list, int64_t index)
 list address String index can be negative More...
 
char * listGetS (char **list, int64_t index)
 list Get String duplicate string at given index index can be negative More...
 
char * iListGetS (char **list, int64_t index)
 list Get String index can be negative More...
 
char * listGetCS (const char **list, int64_t index)
 const list Get String duplicate string at given index index can be negative More...
 
const char * iListGetCS (const char **list, int64_t index)
 const list Get String index can be negative More...
 
char ** listSetS (char **list, int64_t index, const char *s)
 list Set String duplicate string and store at given index, the existing element is freed index can be negative More...
 
char ** listSetCharS (char **list, int64_t index, char c)
 
char ** iListSetS (char **list, int64_t index, char *s)
 list Set String store string at given index index can be negative More...
 
char ** listSwapS (char **list, int64_t index1, int64_t index2)
 swap elements in list More...
 
char ** iListSwapS (char **list, int64_t index1, int64_t index2)
 swap elements in list More...
 
char ** split (const char *string, const char *delim)
 split string with delim string when updating this function, also update splitS (identical to split) return list More...
 
char ** splitS (const char *string, const char *delim)
 
char ** splitChar (const char *string, char delim)
 
char ** icSplit (const char *string, const char *delim)
 ignore case split string with delim string when updating this function, also update icSplitS (identical to icSplit) return list More...
 
char ** icSplitS (const char *string, const char *delim)
 
char ** icSplitChar (const char *string, char delim)
 
ssize_t joinLength (char **list, const char *delim)
 join Length list length after joined with delimiter More...
 
char * join (char **list, const char *delim)
 join list, the elements are seperated with delim in the resulting string when updating this function, also update joinS (identical to join) More...
 
char * joinS (char **list, const char *delim)
 
char * joinCS (const char **list, const char *delim)
 join list, the elements are seperated with delim in the resulting string More...
 
char * joinChar (char **list, char delim)
 
char * bJoin (char *string, char **list, const char *delim)
 buffer join list, the elements are seperated with delim in the resulting string More...
 
char * bJoinChar (char *string, char **list, char delim)
 
char * bLJoin (char *string, size_t stringSize, char **list, const char *delim)
 buffer size join list, the elements are seperated with delim in the resulting string More...
 
char * bLJoinChar (char *string, size_t stringSize, char **list, char delim)
 
char ** extractS (const char *string, const char *delim1, const char *delim2)
 extract string between delim1 and delim2 strings return list More...
 
char ** extractCharSS (const char *string, char delim1, const char *delim2)
 
char ** extractSCharS (const char *string, const char *delim1, char delim2)
 
char ** extractCharCharS (const char *string, char delim1, char delim2)
 
char ** icExtractS (const char *string, const char *delim1, const char *delim2)
 ignore case extract string between delim1 and delim2 strings return list More...
 
char ** icExtractCharSS (const char *string, char delim1, const char *delim2)
 
char ** icExtractSCharS (const char *string, const char *delim1, char delim2)
 
char ** icExtractCharCharS (const char *string, char delim1, char delim2)
 
char ** listDupS (char **list)
 list Duplicate String More...
 
char ** listDupCS (const char **list)
 const list Duplicate String More...
 
char ** iListDupS (char **list)
 list Duplicate String More...
 
char ** listReverseS (char **list)
 list Reverse String duplicate and reverse list, the last element is the first element of the new list More...
 
char ** iListReverseS (char ***list)
 list Reverse String reverse list, the last element is the first element of the list More...
 
char ** listCatSF (char **paramType,...)
 list Cat String More...
 
char ** listAppendS (char ***list1, char **list2)
 list Append String Append list2 at the end of list1 More...
 
char ** iListAppendS (char ***list1, char **list2)
 in place list Append String Append list2 at the end of list1 by copying the pointers from list2 to list1. More...
 
char ** iListAppendNSmashS (char ***list1, char **list2)
 list Append and smash list2 Append list2 at the end of list1 by copying the pointers from list2 to list1. More...
 
char ** listShiftS (char ***list1, char **list2)
 list Shift String Append list2 at the start of list1 More...
 
char ** iListShiftS (char ***list1, char **list2)
 in place list Shift String Append list2 at the start of list1 by copying the pointers from list2 to list1. More...
 
char ** iListShiftNSmashS (char ***list1, char **list2)
 list Append and smash list2 Append list2 at the start of list1 by copying the pointers from list2 to list1. More...
 
char ** listAddS (char **list1, char **list2)
 list Add String add list1 and list2 in a new list More...
 
char ** listAddCS (char **list1, const char **list2)
 const list Add String add list1 and list2 in a new list More...
 
char ** listSliceS (char **list, int64_t start, int64_t end)
 list Slice String return new list with elements from start and end in list negative indexes are allowed More...
 
char ** iListCopyS (char **list, int64_t start, int64_t end)
 list Copy String return new list with element pointers from start and end in list negative indexes are allowed More...
 
char ** iListSliceS (char ***list, int64_t start, int64_t end)
 list Slice String return list with elements from start and end in list negative indexes are allowed More...
 
char ** listCropS (char **list, int64_t start, int64_t end)
 list Crop String return a new list with elements from start and end in list and delete elements from start to end in the original list negative indexes are allowed More...
 
char ** iListCropS (char ***list, int64_t start, int64_t end)
 list Crop String return a new list with elements from start and end in list and delete elements from start to end in the original list negative indexes are allowed More...
 
char * listCropElemS (char **list, int64_t index)
 list Crop Element String return element at index and delete element at index in the original list negative indexes are allowed More...
 
char * iListCropElemS (char ***list, int64_t index)
 list Crop Element String return element at index and delete element at index in the original list negative indexes are allowed More...
 
char ** listInsertS (char **list, int64_t index, char **toInsert)
 list Insert string More...
 
char ** iListInsertS (char ***list, int64_t index, char **toInsert)
 list Insert string More...
 
char ** iListInsertNFreeS (char ***list, int64_t index, char **toInsert)
 list Insert string and free toInsert More...
 
char ** listInjectS (char **list, int64_t index, char *toInject)
 list Inject string More...
 
char ** listInjectCharS (char **list, int64_t index, char toInject)
 
char ** iListInjectS (char ***list, int64_t index, char *toInject)
 list Inject string More...
 
char ** iListInjectCharS (char ***list, int64_t index, char toInject)
 
char ** listDelS (char **list, int64_t start, int64_t end)
 list Delete String return new list without elements from start and end in list negative indexes are allowed More...
 
char ** iListDelS (char ***list, int64_t start, int64_t end)
 list Delete String return list without elements from start and end in list negative indexes are allowed More...
 
char ** iListRemoveS (char ***list, int64_t start, int64_t end)
 list Remove String return list without elements from start and end in list the elements are removed without being freed negative indexes are allowed More...
 
char ** listDelElemS (char **list, int64_t index)
 list Delete Element String return new list without the element at index negative indexes are allowed More...
 
char ** iListDelElemS (char ***list, int64_t index)
 list Delete Element String return list without the element at index negative indexes are allowed More...
 
char ** iListRemoveElemS (char ***list, int64_t index)
 list Remove Element String return list without the element at index the element is removed without being freed negative indexes are allowed More...
 
int listPrintS (char **list)
 print list elements to stdout More...
 
int listPrintCS (const char **list)
 
internal int listSortSCmp (const void *a, const void *b)
 list Sort String Compare function More...
 
char ** listSortS (char **list)
 list Sort String duplicate list and sort More...
 
char ** iListSortS (char ***list)
 list Sort String More...
 
char ** listSortFS (char **list, shCmpt compareFunction)
 list Sort String duplicate list and sort More...
 
char ** iListSortFS (char ***list, shCmpt compareFunction)
 list Sort String More...
 
internal int icListSortSCmp (const void *a, const void *b)
 ignore case list Sort String Compare function More...
 
char ** icListSortS (char **list)
 ignore case list Sort String duplicate list and sort More...
 
char ** iicListSortS (char ***list)
 ignore case list Sort String More...
 
char ** readText (const char *filePath)
 return text from filePath in a list new line characters are removed More...
 
char ** readStream (FILE *fp)
 return text from stream fp in a list new line characters are removed More...
 
bool writeText (const char *filePath, char **list)
 write list to filePath More...
 
bool writeCText (const char *filePath, const char **list)
 write const list to filePath More...
 
bool writeStream (FILE *fp, char **list)
 write list to stream More...
 
bool writeCStream (FILE *fp, const char **list)
 write const list to stream More...
 
bool appendText (const char *filePath, char **list)
 append list to filePath More...
 
bool appendCText (const char *filePath, const char **list)
 append const list to filePath More...
 
char ** execOut (const char *cmd)
 execute command return stdout from cmd More...
 
char ** systemOutf (const char *fmt,...)
 execute system command with formatting More...
 
int systemf (const char *fmt,...)
 execute system command with formatting More...
 
int commandF (const char *cmd, int line, const char *thisFunc, const char *thisFileName)
 run command in default shell More...
 
int commandfF (int line, const char *thisFunc, const char *thisFileName, const char *fmt,...)
 run command with formatting in default shell More...
 
int commandNFreeF (char *cmd, int line, const char *thisFunc, const char *thisFileName)
 run command in default shell and free the cmd parameter More...
 
bool listEqS (char **list1, char **list2)
 list Equal String compare each element of list1 and list2 More...
 
bool listEqCS (char **list1, const char **list2)
 const(list2) list Equal String compare each element of list1 and list2 More...
 
bool listEqC1S (const char **list1, char **list2)
 const(list1) list Equal String compare each element of list1 and list2 More...
 
bool listEqCCS (const char **list1, const char **list2)
 const(list1 and 2) list Equal String compare each element of list1 and list2 More...
 
bool listHasS (char **list, const char *string)
 return true when list has string More...
 
bool listHasCS (const char **list, const char *string)
 return true when const list has string More...
 
bool listHasCharS (char **list, char c)
 
bool listHasCharCS (const char **list, char c)
 
ssize_t listIndexOfS (char **list, const char *string)
 return index of string in list More...
 
ssize_t listIndexOfCS (const char **list, const char *string)
 return index of string in const list More...
 
ssize_t listIndexOfCharS (char **list, char c)
 
ssize_t listIndexOfCharCS (const char **list, char c)
 
ssize_t listBinarySearchS (char **list, const char *string)
 list binary search string More...
 
ssize_t listBinarySearchCharS (char **list, char c)
 
char ** listUniqS (char **list)
 Uniquify elements of list duplicate list each elements are unique in the new list. More...
 
char ** iListUniqS (char ***list)
 Uniquify elements of list each elements are unique in the list. More...
 
bool icListEqS (char **list1, char **list2)
 ignore case list Equal String compare each element of list1 and list2 More...
 
bool icListEqCS (char **list1, const char **list2)
 ignore case const(list2) list Equal String compare each element of list1 and list2 More...
 
bool icListEqC1S (const char **list1, char **list2)
 ignore case const(list1) list Equal String compare each element of list1 and list2 More...
 
bool icListEqCCS (const char **list1, const char **list2)
 ignore case const(list1 and 2) list Equal String compare each element of list1 and list2 More...
 
bool icListHasS (char **list, const char *string)
 ignore case and return true when list has string More...
 
bool icListHasCharS (char **list, char c)
 
bool icListHasCS (const char **list, const char *string)
 ignore case and return true when const list has string More...
 
bool icListHasCharCS (const char **list, char c)
 
ssize_t icListIndexOfS (char **list, const char *string)
 ignore case and return index of string in list More...
 
ssize_t icListIndexOfCS (const char **list, const char *string)
 ignore case and return index of string in const list More...
 
ssize_t icListIndexOfCharS (char **list, char c)
 
ssize_t icListIndexOfCharCS (const char **list, char c)
 
ssize_t icListBinarySearchS (char **list, const char *string)
 ignore case list binary search string More...
 
ssize_t icListBinarySearchCharS (char **list, char c)
 
char ** icListUniqS (char **list)
 ignore case and uniquify elements of list duplicate list each elements are unique in the new list More...
 
char ** iicListUniqS (char ***list)
 ignore case and uniquify elements of list each elements are unique in the list More...
 
char ** listCompactS (char **list)
 remove empty strings from list More...
 
char ** iListCompactS (char ***list)
 remove empty strings from list More...
 
void btraceEnable (void)
 
void btraceDisable (void)
 
bool btraceConfig (void)
 
void ** listEmptyF (void)
 list Empty Function More...
 
void ** iListEmptyF (void ***list)
 list Empty Function More...
 
bool listIsEmpty (void **list)
 list Is Empty More...
 
void ** listCreateF (void *paramType,...)
 list Create Function create a list from the list of parameters used from the listCreate(...) macro More...
 
void ** listFromArray (void **array, size_t size)
 list From Array More...
 
void ** listPush (void ***list, void *s)
 list Push More...
 
void * listPop (void ***list)
 list Pop return last element from list and remove last element from the list More...
 
void ** listPrepend (void ***list, void *s)
 list Prepend More...
 
void * listDequeue (void ***list)
 list Dequeue return first element from list and remove last element from the list More...
 
void listFree (void **list)
 list Free More...
 
void listFreeManyF (void **paramType,...)
 list free many More...
 
size_t listLength (void **list)
 list Length return number of elements until the first NULL element More...
 
void * listGet (void **list, int64_t index)
 list Get More...
 
void ** listSet (void **list, int64_t index, void *s)
 list Set More...
 
void ** listDup (void **list)
 list Duplicate More...
 
void ** listReverse (void **list)
 list Reverse create index list and reverse list, the last element is the first element of the new list More...
 
void ** iListReverse (void ***list)
 list Reverse reverse list, the last element is the first element of the list More...
 
void ** listCatF (void **paramType,...)
 list Cat More...
 
void ** listAppend (void ***list1, void **list2)
 list Append More...
 
void ** listAdd (void **list1, void **list2)
 list Add add list1 and list2 in a new list More...
 
void ** listSlice (void **list, int64_t start, int64_t end)
 list Slice More...
 
void ** iListSlice (void ***list, int64_t start, int64_t end)
 list Slice return list with elements from start and end in list negative indexes are allowed More...
 
void ** listInsert (void **list, int64_t index, void **toInsert)
 list Insert More...
 
void ** iListInsert (void ***list, int64_t index, void **toInsert)
 list Insert More...
 
void ** listDel (void **list, int64_t start, int64_t end)
 list Delete return new list without elements from start and end in list negative indexes are allowed More...
 
void ** iListDel (void ***list, int64_t start, int64_t end)
 list Delete return list without elements from start and end in list negative indexes are allowed More...
 
int ringInit (void *ring, int maxCount)
 list Sort duplicate list and sort More...
 
int ringEmpty (void *ring)
 empty ring Allocated buffers in the list must be freed before running staticArrayEmpty More...
 
int ringIsEmpty (void *ring)
 1 when empty 0 not empty -1 error More...
 
int ringIsFull (void *ring)
 1 when full 0 not full -1 error More...
 
ssize_t ringCount (void *ring)
 return elements count More...
 
i64 ringPush (void *ring)
 push element to ring (only increases last, use ringSend) use ringLast to access the element More...
 
int ringPop (void *ring)
 pop element from ring (only decreases last) More...
 
i64 ringPrepend (void *ring)
 prepend element to ring (only decreases head) use ringFirst to access the element More...
 
int ringDequeue (void *ring)
 dequeue element from ring (only increases head, use ringRecv) More...
 
bool fiberAdd (void *ctx, int thisSlot, fiberFT func)
 add new fiber More...
 
bool fiberPrepend (void *ctx, int thisSlot, fiberFT func)
 add new fiber and start immediately after next yield More...
 
void scheduler (void)
 Schedule fibers. More...
 
uint64_t getMonotonicTime (void)
 end bitfield More...
 
int nanoSleepF (uint64_t time)
 nanosleep More...
 
void initLibsheepyF (const char *progPath, initLibsheepyObjectP initF)
 initialize libsheepy (optional, for debug) More...
 
char ** btrace (void)
 generate backtrace the program has to be linked the -rdynamic option for btrace to work btrace can backtrace 50 functions at most. More...
 

Variables

const bool TRUE = true
 type bool true (glibc true is not bool), for use in generics More...
 
const bool FALSE = false
 type bool false (glibc true is not bool), for use in generics More...
 
bool btraceCfg = true
 backtrace in error messages is enabled by default More...
 
jmp_buf tryJumpBuffers [maxTryThrowCount]
 setjmp buffers for try/throw,throwV macros More...
 
uint64_t logMask = 0xFFFFFFFFFFFFFFFF
 variable to control which group logs to show, all logs are enabled by default (0xFFFFFFFFFFFFFFFF) More...
 
const uint8_t codeSzUTF8 [256] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1}
 
fibersT fibers
 fibers holds the necessary information to schedule fibers More...
 

Detailed Description

This file has basic file, random, string, list functions.

There are 2 types of lists: char** and void**

The *S (not i*S) functions duplicate the parameters and results. You must free the result if result is non-NULL and free the parameters

The functions starting with i*S are in place functions.

In Place functions: iList*S and i*S The iList*S and i*S functions modify the input buffers The input buffers must be allocated with malloc/calloc Returns are pointers to original buffers

For more information, the documentation is located at http://spartatek.se/libsheepy/

Definition in file libsheepy.c.

Macro Definition Documentation

◆ internal

#define internal   static

Definition at line 44 of file libsheepy.c.

◆ replaceS_max

#define replaceS_max (   s,
  olds,
  news 
)    replaceS(s,olds,news, 0)

Definition at line 285 of file libsheepy.c.

◆ iReplaceS_max

#define iReplaceS_max (   s,
  olds,
  news 
)    iReplaceS(s,olds,news, 0)

Definition at line 291 of file libsheepy.c.

◆ bReplaceS_max

#define bReplaceS_max (   s,
  olds,
  news 
)    bReplaceS(s,olds,news, 0)

Definition at line 296 of file libsheepy.c.

◆ icReplaceS_max

#define icReplaceS_max (   s,
  olds,
  news 
)    icReplaceS(s,olds,news, 0)

Definition at line 303 of file libsheepy.c.

◆ iicReplaceS_max

#define iicReplaceS_max (   s,
  olds,
  news 
)    iicReplaceS(s,olds,news, 0)

Definition at line 308 of file libsheepy.c.

◆ bicReplaceS_max

#define bicReplaceS_max (   s,
  olds,
  news 
)    bicReplaceS(s,olds,news, 0)

Definition at line 313 of file libsheepy.c.

◆ icReplaceUTF8_max

#define icReplaceUTF8_max (   s,
  olds,
  news 
)    icReplaceUTF8(s,olds,news, 0)

Definition at line 517 of file libsheepy.c.

◆ iicReplaceUTF8_max

#define iicReplaceUTF8_max (   s,
  olds,
  news 
)    iicReplaceUTF8(s,olds,news, 0)

Definition at line 521 of file libsheepy.c.

◆ bicReplaceUTF8_max

#define bicReplaceUTF8_max (   s,
  olds,
  news 
)    bicReplaceUTF8(s,olds,news, 0)

Definition at line 525 of file libsheepy.c.

◆ MALLOC

#define MALLOC   malloc

Definition at line 853 of file libsheepy.c.

◆ REALLOC

#define REALLOC   realloc

Definition at line 854 of file libsheepy.c.

◆ __libsheepy

#define __libsheepy   1

Definition at line 859 of file libsheepy.c.

◆ MAX_MSG_LEN

#define MAX_MSG_LEN   10240

print logging levels logs messages to all log file

in LOG_VERBOSE mode, logs loglevel, filename, function name, time, line number and msg in LOG_CONCISE mode, logs loglevel and msg

the maximum message length is 10240

Definition at line 1209 of file libsheepy.c.

◆ TERMRGB

#define TERMRGB   "\x1b[38;2;"

printf RGB Colors

k and K type specifier to GNU printf for RBG colors

  • k foreground hex color
  • K background hex color

Example: printf("%k%KRGB color" RST, 0x99EEFF, 0x666666);

Definition at line 1426 of file libsheepy.c.

◆ BGTERMRGB

#define BGTERMRGB   "\x1b[48;2;"

Definition at line 1427 of file libsheepy.c.

◆ startMax

#define startMax   20

Definition at line 6232 of file libsheepy.c.

◆ runeMax

#define runeMax   0x10FFFF

maximum rune value

Definition at line 16283 of file libsheepy.c.

◆ UTFSEQ

#define UTFSEQ (   x)
Value:
((((x) & 0x80) == 0x00) ? 1 /* 0xxxxxxx */ \
: (((x) & 0xC0) == 0x80) ? 0 /* 10xxxxxx */ \
: (((x) & 0xE0) == 0xC0) ? 2 /* 110xxxxx */ \
: (((x) & 0xF0) == 0xE0) ? 3 /* 1110xxxx */ \
: (((x) & 0xF8) == 0xF0) ? 4 /* 11110xxx */ \
: (((x) & 0xFC) == 0xF8) ? 5 /* 111110xx */ \
: (((x) & 0xFE) == 0xFC) ? 6 /* 1111110x */ \
: 0 )

code point length, 0 when invalid code point, x is first byte in code point

Definition at line 16286 of file libsheepy.c.

◆ BADRUNE

#define BADRUNE (   x)
Value:
((x) < 0 || (x) > runeMax \
|| ((x) & 0xFFFE) == 0xFFFE \
|| ((x) >= 0xD800 && (x) <= 0xDFFF) \
|| ((x) >= 0xFDD0 && (x) <= 0xFDEF))
#define runeMax
maximum rune value
Definition: libsheepy.c:16283

Definition at line 16295 of file libsheepy.c.

◆ UNICODE_LAST_CHAR_PART1

#define UNICODE_LAST_CHAR_PART1   0x2FAFF

Definition at line 16300 of file libsheepy.c.

◆ UNICODE_LAST_PAGE_PART1

#define UNICODE_LAST_PAGE_PART1   762

Definition at line 16301 of file libsheepy.c.

◆ UNICODE_MAX_TABLE_INDEX

#define UNICODE_MAX_TABLE_INDEX   10000

Definition at line 16302 of file libsheepy.c.

◆ UNICODE_NOT_PRESENT_OFFSET

#define UNICODE_NOT_PRESENT_OFFSET   65535

Definition at line 16303 of file libsheepy.c.

◆ ATTR_TABLE

#define ATTR_TABLE (   Page)
Value:
? attr_table_part1[Page] \
: attr_table_part2[(Page) - 0xe00])
#define UNICODE_LAST_PAGE_PART1
Definition: libsheepy.c:16301

Definition at line 22236 of file libsheepy.c.

◆ ATTTABLE

#define ATTTABLE (   Page,
  Char 
)    ((ATTR_TABLE(Page) == UNICODE_MAX_TABLE_INDEX) ? 0 : (attr_data[ATTR_TABLE(Page)][Char]))

Definition at line 22240 of file libsheepy.c.

◆ TTYPE_PART1

#define TTYPE_PART1 (   Page,
  Char 
)
Value:
((type_table_part1[Page] >= UNICODE_MAX_TABLE_INDEX) \
? (type_table_part1[Page] - UNICODE_MAX_TABLE_INDEX) \
: (type_data[type_table_part1[Page]][Char]))
#define UNICODE_MAX_TABLE_INDEX
Definition: libsheepy.c:16302

Definition at line 22243 of file libsheepy.c.

◆ TTYPE_PART2

#define TTYPE_PART2 (   Page,
  Char 
)
Value:
((type_table_part2[Page] >= UNICODE_MAX_TABLE_INDEX) \
? (type_table_part2[Page] - UNICODE_MAX_TABLE_INDEX) \
: (type_data[type_table_part2[Page]][Char]))
#define UNICODE_MAX_TABLE_INDEX
Definition: libsheepy.c:16302

Definition at line 22248 of file libsheepy.c.

◆ RUNETYPE

#define RUNETYPE (   rn)
Value:
? TTYPE_PART1 ((rn) >> 8, (rn) & 0xff) \
: (((rn) >= 0xe0000 && (rn) <= runeMax) \
? TTYPE_PART2 (((rn) - 0xe0000) >> 8, (rn) & 0xff) \
#define runeMax
maximum rune value
Definition: libsheepy.c:16283
#define TTYPE_PART2(Page, Char)
Definition: libsheepy.c:22248
#define UNICODE_LAST_CHAR_PART1
Definition: libsheepy.c:16300
#define TTYPE_PART1(Page, Char)
Definition: libsheepy.c:22243

Definition at line 22253 of file libsheepy.c.

◆ IS

#define IS (   Type,
  Class 
)    (((uint32_t)1 << (Type)) & (Class))

Definition at line 22260 of file libsheepy.c.

◆ OR

#define OR (   Type,
  Rest 
)    (((uint32_t)1 << (Type)) | (Rest))

Definition at line 22261 of file libsheepy.c.

◆ ISMARK

#define ISMARK (   Type)
Value:

Definition at line 22263 of file libsheepy.c.

◆ ISALPHA

#define ISALPHA (   Type)

◆ RUNE_MAX_DECOMPOSITION_LENGTH

#define RUNE_MAX_DECOMPOSITION_LENGTH   18 /* codepoints */

Definition at line 22275 of file libsheepy.c.

◆ CC_PART1

#define CC_PART1 (   Page,
  Char 
)
Value:
((combining_class_table_part1[Page] >= UNICODE_MAX_TABLE_INDEX) \
? (combining_class_table_part1[Page] - UNICODE_MAX_TABLE_INDEX) \
: (cclass_data[combining_class_table_part1[Page]][Char]))
#define UNICODE_MAX_TABLE_INDEX
Definition: libsheepy.c:16302

Definition at line 22277 of file libsheepy.c.

◆ CC_PART2

#define CC_PART2 (   Page,
  Char 
)
Value:
((combining_class_table_part2[Page] >= UNICODE_MAX_TABLE_INDEX) \
? (combining_class_table_part2[Page] - UNICODE_MAX_TABLE_INDEX) \
: (cclass_data[combining_class_table_part2[Page]][Char]))
#define UNICODE_MAX_TABLE_INDEX
Definition: libsheepy.c:16302

Definition at line 22282 of file libsheepy.c.

◆ COMBINING_CLASS

#define COMBINING_CLASS (   Char)
Value:
? CC_PART1 ((Char) >> 8, (Char) & 0xff) \
: (((Char) >= 0xe0000 && (Char) <= runeMax) \
? CC_PART2 (((Char) - 0xe0000) >> 8, (Char) & 0xff) \
: 0))
#define runeMax
maximum rune value
Definition: libsheepy.c:16283
#define CC_PART2(Page, Char)
Definition: libsheepy.c:22282
#define UNICODE_LAST_CHAR_PART1
Definition: libsheepy.c:16300
#define CC_PART1(Page, Char)
Definition: libsheepy.c:22277

Definition at line 22287 of file libsheepy.c.

◆ SBase

#define SBase   0xAC00

Definition at line 47697 of file libsheepy.c.

◆ LBase

#define LBase   0x1100

Definition at line 47698 of file libsheepy.c.

◆ VBase

#define VBase   0x1161

Definition at line 47699 of file libsheepy.c.

◆ TBase

#define TBase   0x11A7

Definition at line 47700 of file libsheepy.c.

◆ LCount

#define LCount   19

Definition at line 47701 of file libsheepy.c.

◆ VCount

#define VCount   21

Definition at line 47702 of file libsheepy.c.

◆ TCount

#define TCount   28

Definition at line 47703 of file libsheepy.c.

◆ NCount

#define NCount   (VCount * TCount)

Definition at line 47704 of file libsheepy.c.

◆ SCount

#define SCount   (LCount * NCount)

Definition at line 47705 of file libsheepy.c.

Typedef Documentation

◆ randomWordFt

typedef uint64_t(* randomWordFt) (void)

Definition at line 5861 of file libsheepy.c.

Enumeration Type Documentation

◆ localeType

enum localeType
Enumerator
LOCALE_NORMAL 
LOCALE_TURKIC 
LOCALE_LITHUANIAN 

Definition at line 42 of file libsheepy.c.

◆ unicodeType

Unicode types: UNICODE_CONTROL: General category "Other, Control" (Cc) UNICODE_FORMAT: General category "Other, Format" (Cf) UNICODE_UNASSIGNED: General category "Other, Not Assigned" (Cn) UNICODE_PRIVATE_USE: General category "Other, Private Use" (Co) UNICODE_SURROGATE: General category "Other, Surrogate" (Cs) UNICODE_LOWERCASE_LETTER: General category "Letter, Lowercase" (Ll) UNICODE_MODIFIER_LETTER: General category "Letter, Modifier" (Lm) UNICODE_OTHER_LETTER: General category "Letter, Other" (Lo) UNICODE_TITLECASE_LETTER: General category "Letter, Titlecase" (Lt) UNICODE_UPPERCASE_LETTER: General category "Letter, Uppercase" (Lu) UNICODE_SPACING_MARK: General category "Mark, Spacing" (Mc) UNICODE_ENCLOSING_MARK: General category "Mark, Enclosing" (Me) UNICODE_NON_SPACING_MARK: General category "Mark, Nonspacing" (Mn) UNICODE_DECIMAL_NUMBER: General category "Number, Decimal Digit" (Nd) UNICODE_LETTER_NUMBER: General category "Number, Letter" (Nl) UNICODE_OTHER_NUMBER: General category "Number, Other" (No) UNICODE_CONNECT_PUNCTUATION: General category "Punctuation, Connector" (Pc) UNICODE_DASH_PUNCTUATION: General category "Punctuation, Dash" (Pd) UNICODE_CLOSE_PUNCTUATION: General category "Punctuation, Close" (Pe) UNICODE_FINAL_PUNCTUATION: General category "Punctuation, Final quote" (Pf) UNICODE_INITIAL_PUNCTUATION: General category "Punctuation, Initial quote" (Pi) UNICODE_OTHER_PUNCTUATION: General category "Punctuation, Other" (Po) UNICODE_OPEN_PUNCTUATION: General category "Punctuation, Open" (Ps) UNICODE_CURRENCY_SYMBOL: General category "Symbol, Currency" (Sc) UNICODE_MODIFIER_SYMBOL: General category "Symbol, Modifier" (Sk) UNICODE_MATH_SYMBOL: General category "Symbol, Math" (Sm) UNICODE_OTHER_SYMBOL: General category "Symbol, Other" (So) UNICODE_LINE_SEPARATOR: General category "Separator, Line" (Zl) UNICODE_PARAGRAPH_SEPARATOR: General category "Separator, Paragraph" (Zp) UNICODE_SPACE_SEPARATOR: General category "Separator, Space" (Zs)

These are the possible character classifications from the Unicode specification. See Unicode Character Database.

Enumerator
UNICODE_CONTROL 
UNICODE_FORMAT 
UNICODE_UNASSIGNED 
UNICODE_PRIVATE_USE 
UNICODE_SURROGATE 
UNICODE_LOWERCASE_LETTER 
UNICODE_MODIFIER_LETTER 
UNICODE_OTHER_LETTER 
UNICODE_TITLECASE_LETTER 
UNICODE_UPPERCASE_LETTER 
UNICODE_SPACING_MARK 
UNICODE_ENCLOSING_MARK 
UNICODE_NON_SPACING_MARK 
UNICODE_DECIMAL_NUMBER 
UNICODE_LETTER_NUMBER 
UNICODE_OTHER_NUMBER 
UNICODE_CONNECT_PUNCTUATION 
UNICODE_DASH_PUNCTUATION 
UNICODE_CLOSE_PUNCTUATION 
UNICODE_FINAL_PUNCTUATION 
UNICODE_INITIAL_PUNCTUATION 
UNICODE_OTHER_PUNCTUATION 
UNICODE_OPEN_PUNCTUATION 
UNICODE_CURRENCY_SYMBOL 
UNICODE_MODIFIER_SYMBOL 
UNICODE_MATH_SYMBOL 
UNICODE_OTHER_SYMBOL 
UNICODE_LINE_SEPARATOR 
UNICODE_PARAGRAPH_SEPARATOR 
UNICODE_SPACE_SEPARATOR 

Definition at line 16342 of file libsheepy.c.

Function Documentation

◆ segfault_sigaction() [1/2]

internal void segfault_sigaction ( int signal  ,
siginfo_t *  si,
void *  arg 
)

segmentation fault handler

prints line and file where the segfault crash occured

Definition at line 891 of file libsheepy.c.

◆ segfault_sigaction() [2/2]

internal void segfault_sigaction ( int signal  UNUSED,
siginfo_t *si  UNUSED,
void *arg  UNUSED 
)

◆ cleanUpCharFree()

void cleanUpCharFree ( char **  val)

Definition at line 919 of file libsheepy.c.

Here is the call graph for this function:

◆ cleanUpListFree()

void cleanUpListFree ( char ***  val)

Definition at line 925 of file libsheepy.c.

Here is the call graph for this function:

◆ cleanUpFileFree()

void cleanUpFileFree ( FILE **  val)

Definition at line 931 of file libsheepy.c.

Here is the call graph for this function:

◆ cleanUpFd()

void cleanUpFd ( int *  val)

Definition at line 939 of file libsheepy.c.

◆ shStopwatch()

uint64_t shStopwatch ( uint8_t  op)

nanosecond stopwatch

Parameters
opoperation: 0 start, 1 get stopwatch value
Returns
0 when op is 0 time since last start in ns when op is 1

Definition at line 955 of file libsheepy.c.

Here is the call graph for this function:

◆ getLogSymbols()

int getLogSymbols ( void  )

get current log symbols

Definition at line 996 of file libsheepy.c.

◆ setLogSymbols()

void setLogSymbols ( int  mode)

set log symbols

LOG_VERBOSE for words LOG_UTF8 for emojis LOG_VOID for no symbols LOG_INVALID_MODE (reset log symbols) for default log mode symbols anything else (LOG_CONCISE,...) for symbols (!*+->~)

default is default log mode symbols

Definition at line 1012 of file libsheepy.c.

◆ getMaxLogLevel()

int getMaxLogLevel ( void  )

get current max log level

default is LOG_INVALID, to show all log levels -1 hides all logs

Definition at line 1028 of file libsheepy.c.

◆ setMaxLogLevel()

void setMaxLogLevel ( int  logLevel)

set max log level logs above logMaxLevel are skipped

default is LOG_INVALID, to show all log levels LOG_DISABLE hides all logs

Parameters
logLevelfrom LOG_DISABLE to LOG_INVALID

Definition at line 1043 of file libsheepy.c.

◆ setLogFile()

FILE * setLogFile ( char *  filename)

set log file the logs are appended to all log files set with this function

there is a maximum of 15 log files

Returns
log file handle NULL when filename is NULL or more than 15 log files are set

Definition at line 1058 of file libsheepy.c.

◆ closeLogFiles()

void closeLogFiles ( void  )

close logfiles opened with setLogFile

Definition at line 1081 of file libsheepy.c.

◆ getLogMode()

int getLogMode ( void  )

get current log mode (verbose, concise)

Returns
current mode LOG_VERBOSE, LOG_CONCISE, ...

Definition at line 1097 of file libsheepy.c.

◆ setLogMode()

void setLogMode ( int  mode)

set log mode LOG_VERBOSE, LOG_CONCISE, .

the default log mode is LOG_DATE

Definition at line 1107 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLogShortPath()

bool getLogShortPath ( void  )

get current log long/short path value

The default value is TRUE (short paths) TRUE shows short file paths in logs FALSE shows long file paths in logs

Returns
current long/short file path configuration value for VERBOSE mode

Definition at line 1128 of file libsheepy.c.

◆ setLogShortPath()

void setLogShortPath ( bool  shortPath)

set log long/short file path value for VERBOSE mode

TRUE shows short file paths in logs FALSE shows long file paths in logs

the default long/short path value is TRUE

Definition at line 1141 of file libsheepy.c.

◆ getLogStdout()

bool getLogStdout ( void  )

get stdout state, when TRUE (default) all logs are printed to stdout

Definition at line 1149 of file libsheepy.c.

◆ setLogStdout()

void setLogStdout ( bool  state)

enable/disable printing logs to stdout

TRUE: print logs to stdout FALSE: print logs to files only

Definition at line 1160 of file libsheepy.c.

◆ openProgLogFile()

bool openProgLogFile ( void  )

log to a file named progName.log Use closeLogFiles when finished logging

Definition at line 1169 of file libsheepy.c.

◆ keepAnsiColorsInLog()

void keepAnsiColorsInLog ( bool  state)

enable/disable ansi color codes in logs

TRUE: print colors FALSE: strip colors

Definition at line 1194 of file libsheepy.c.

◆ _pLog()

void _pLog ( int  loglevel,
const char *  file,
const char *  func,
int  line,
const char *  msg,
  ... 
)

Definition at line 1210 of file libsheepy.c.

◆ print_k()

int print_k ( FILE *  stream,
const struct printf_info *  info,
const void *const *  args 
)

k printf type specifier, RGB foreground, uint32_t 0x00RRGGBB

Definition at line 1433 of file libsheepy.c.

◆ print_K()

int print_K ( FILE *  stream,
const struct printf_info *  info,
const void *const *  args 
)

K printf type specifier, RGB background, uint32_t 0x00RRGGBB

Definition at line 1451 of file libsheepy.c.

◆ print_k_arginfo()

int print_k_arginfo ( const struct printf_info *info  UNUSED,
size_t  n,
int *  argtypes,
int *  size 
)

procress printf argument

Definition at line 1468 of file libsheepy.c.

◆ print_b()

int print_b ( FILE *  stream,
const struct printf_info *  info,
const void *const *  args 
)

b printf type specifier, print bool as FALSE/TRUE

Definition at line 1480 of file libsheepy.c.

◆ print_b_arginfo()

int print_b_arginfo ( const struct printf_info *info  UNUSED,
size_t  n,
int *  argtypes,
int *  size 
)

procress printf argument

Definition at line 1495 of file libsheepy.c.

◆ finalizeLibsheepyCharAtExit()

void finalizeLibsheepyCharAtExit ( void  )

finalize libsheepy char at exit

free internal buffers in this file:

realprogpath urandomFp software random file

Definition at line 1652 of file libsheepy.c.

Here is the call graph for this function:

◆ getStackLimit()

int64_t getStackLimit ( void  )

get current stack limit

Returns
current stack limit -1 unlimited 0 when error

Definition at line 1667 of file libsheepy.c.

◆ setStackLimit()

int setStackLimit ( int64_t  stackSize)

set stack limit

Parameters
stackSizestack size in bytes, set -1 for unlimited size
Returns
!0 when ok 0 when it failed

Definition at line 1686 of file libsheepy.c.

◆ enableCoreDump()

int enableCoreDump ( void  )

enable core dump

change core dump size to infinity to enable core dump. After the program receives a signal generating core dump, a core file is written to disk and can be open with gdb

Returns
!0 when ok 0 when it failed

Definition at line 1720 of file libsheepy.c.

◆ getProgName()

const char * getProgName ( void  )

get program name

this program name showing in the logs

Definition at line 1745 of file libsheepy.c.

◆ setProgName()

bool setProgName ( const char *  name)

set program name

this program name showing in the logs

Definition at line 1755 of file libsheepy.c.

Here is the call graph for this function:

◆ setDefaultProgName()

void setDefaultProgName ( void  )

set default program name

this program name showing in the logs

Definition at line 1773 of file libsheepy.c.

◆ freeProgName()

void freeProgName ( void  )

free ProgName if set with setProgName

Definition at line 1782 of file libsheepy.c.

◆ getProgPath()

const char * getProgPath ( void  )

get program path When initLibsheepy is called before this function, it returns the given program path.

When initLibsheepy has not been called before this function, it returns the real program path.

Returns
program path or real program path (do not free this pointer)

Definition at line 1795 of file libsheepy.c.

Here is the caller graph for this function:

◆ getRealProgPath()

const char * getRealProgPath ( void  )

get real program path The first call allocates libSheepyRealProgPath, it is freed with freeRealProgPath

Returns
real program path (do not free this pointer)

Definition at line 1812 of file libsheepy.c.

Here is the caller graph for this function:

◆ freeRealProgPath()

void freeRealProgPath ( void  )

free real program path finalizeLibsheepy calls this function

Definition at line 1826 of file libsheepy.c.

Here is the call graph for this function:

◆ systemNFreeF()

int systemNFreeF ( char *  command,
int  line,
const char *  thisFunc,
const char *  thisFileName 
)

run system command and free command buffer a message is printed when an error occurs

this function is called from the systemNFree macro

Parameters
commandcommand to run in the shell
Returns
0 success command error code

Definition at line 1844 of file libsheepy.c.

Here is the call graph for this function:

◆ getModificationTime()

time_t getModificationTime ( const char *  path)

get modification time for path

Parameters
path
Returns
modification time 0 when an error occured

Definition at line 1864 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setModificationTime()

int setModificationTime ( const char *  path,
time_t  mtime 
)

set modification time for path

Parameters
path
mtime(for example, from the getModificationTime function)
Returns
1 ok 0 when an error occured

Definition at line 1890 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isReadable()

bool isReadable ( const char *  path)

is path readable

Returns
true when path is readable

Definition at line 1914 of file libsheepy.c.

◆ isWritable()

bool isWritable ( const char *  path)

is path writable

Returns
true when path is writable

Definition at line 1934 of file libsheepy.c.

◆ isExecutable()

bool isExecutable ( const char *  path)

is path executable

Returns
true when path is executable

Definition at line 1954 of file libsheepy.c.

◆ equalModificationTimes()

bool equalModificationTimes ( const char *  path1,
const char *  path2 
)

compare modification times for path1 and path2

Parameters
path1
path2
Returns
true when mtime is equal for path1 and path2 false when mtime is different for path1 and path2 or when there is an error

Definition at line 1979 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurrentUnixTime()

time_t getCurrentUnixTime ( void  )

get current unix time in seconds

time_t is either int32_t or int64_t

Definition at line 2001 of file libsheepy.c.

◆ strToUnixTime()

time_t strToUnixTime ( const char *  date,
const char *  format 
)

convert date string to unix time

Parameters
datestring
formatfor strptime
Returns
time -1 error

Definition at line 2018 of file libsheepy.c.

Here is the call graph for this function:

◆ timeToS()

char * timeToS ( const time_t  t)

time To String convert unix time to string (ctime is not used here because it adds
at the end of the string)

Parameters
unixtime to convert
Returns
string representing the unix time in ctime format (Wed Dec 12 11:44:08 2018), you must free the pointer

Definition at line 2048 of file libsheepy.c.

Here is the caller graph for this function:

◆ bTimeToS()

char * bTimeToS ( char *  dst,
const time_t  t 
)

Definition at line 2057 of file libsheepy.c.

◆ bLTimeToS()

char * bLTimeToS ( char *  dst,
size_t  dstSize,
const time_t  t 
)

Definition at line 2065 of file libsheepy.c.

◆ timeToYMDS()

char * timeToYMDS ( const time_t  t)

time To Year-Month-Day Hour:Minute:Second String convert unix time to string

Parameters
unixtime to convert
Returns
string representing the unix time, you must free the pointer

Definition at line 2082 of file libsheepy.c.

◆ bTimeToYMDS()

char * bTimeToYMDS ( char *  dst,
const time_t  t 
)

Definition at line 2091 of file libsheepy.c.

◆ bLTimeToYMDS()

char * bLTimeToYMDS ( char *  dst,
size_t  dstSize,
const time_t  t 
)

Definition at line 2099 of file libsheepy.c.

◆ getCurrentDate()

char * getCurrentDate ( void  )

get current date in ctime format (Wed Dec 12 11:44:08 2018)

you must free the pointer

Definition at line 2112 of file libsheepy.c.

◆ bGetCurrentDate()

char * bGetCurrentDate ( char *  dst)

Definition at line 2121 of file libsheepy.c.

◆ bLGetCurrentDate()

char * bLGetCurrentDate ( char *  dst,
size_t  dstSize 
)

Definition at line 2132 of file libsheepy.c.

◆ getCurrentDateYMD()

char * getCurrentDateYMD ( void  )

get current date in Y-m-d H:M:S format

you must free the pointer

Definition at line 2148 of file libsheepy.c.

◆ bGetCurrentDateYMD()

char * bGetCurrentDateYMD ( char *  dst)

Definition at line 2157 of file libsheepy.c.

◆ bLGetCurrentDateYMD()

char * bLGetCurrentDateYMD ( char *  dst,
size_t  dstSize 
)

Definition at line 2168 of file libsheepy.c.

◆ shDirname()

char * shDirname ( const char *  path)

sheepy dirname

the returned string has to be freed

Parameters
path
Returns
path without basename (last item in the path, you must free the pointer) "./" when path is blank or when there is only one item in the path NULL when path is NULL

Definition at line 2191 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bDirname()

char * bDirname ( char *  path)

buffer dirname

the buffer size (path) must be at least 3 chars

Parameters
path
Returns
path without basename (last item in the path) "./" when path is blank or when there is only one item in the path NULL when path is NULL

Definition at line 2252 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLDirname()

char * bLDirname ( char *  path,
size_t  pathSize 
)

buffer size dirname

the buffer size (path) must be at least 3 chars

Parameters
path
pathSizepath buffer size, the path strlen will be at most pathSize-1
Returns
path without basename (last item in the path) "./" when path is blank or when there is only one item in the path NULL when path is NULL

Definition at line 2306 of file libsheepy.c.

Here is the call graph for this function:

◆ expandHome()

char * expandHome ( const char *  path)

expands ~/ ($HOME) or ~USER
duplicate and expand path.

The original remains unchanged.

Parameters
pathstring
Returns
new string path or NULL (you must free the pointer)

Definition at line 2443 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iExpandHome()

char * iExpandHome ( char **  path)

expands ~/ ($HOME) or ~USER

duplicate and expand path.

Parameters
pathstring (this parameter is reallocated)
Returns
path modified path
NULL error

Definition at line 2638 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bExpandHome()

char * bExpandHome ( char *  path)

buffer expands ~/ ($HOME) or ~USER

expand path

Parameters
pathstring
Returns
path modified path
NULL error

Definition at line 2821 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLExpandHome()

char * bLExpandHome ( char *  path,
size_t  pathSize 
)

buffer size expands ~/ ($HOME) or ~USER

expand path

Parameters
pathstring
pathSizepath buffer size, the path strlen will be at most pathSize-1
Returns
path modified path
NULL error

Definition at line 3001 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalizePath()

char * normalizePath ( const char *  path)

normalize path

remove unecessary /, .. and . leading / is kept leading .. is kept leading . is removed

'/../' becomes '/'

Parameters
path
Returns
new normalized path (you must free the pointer) NULL when path is NULL

Definition at line 3057 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iNormalizePath()

char * iNormalizePath ( char **  path)

normalize path

remove unecessary /, .. and . leading / is kept leading .. is kept leading . is removed

'/../' becomes '/'

Parameters
path(this parameter is reallocated)
Returns
path modified path NULL when path is NULL

Definition at line 3155 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bNormalizePath()

char * bNormalizePath ( char *  path)

buffer normalize path

remove unecessary /, .. and . leading / is kept leading .. is kept leading . is removed

'/../' becomes '/'

Parameters
path
Returns
path modified path NULL when path is NULL

Definition at line 3260 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLNormalizePath()

char * bLNormalizePath ( char *  path,
size_t  pathSize 
)

buffer size normalize path

path must be at least 2 chars

remove unecessary /, .. and . leading / is kept leading .. is kept leading . is removed

'/../' becomes '/'

Parameters
path
pathSizepath buffer size, the path strlen will be at most pathSize-1
Returns
path modified path NULL when path is NULL

Definition at line 3367 of file libsheepy.c.

Here is the call graph for this function:

◆ relPath()

char * relPath ( const char *  path,
const char *  start 
)

relative path

Return a relative filepath to path either from the current directory or from an optional start directory

Parameters
pathpath to convert
startreference path, cwd when NULL
Returns
new relative path (you must free the pointer) NULL when path is NULL

Definition at line 3472 of file libsheepy.c.

Here is the call graph for this function:

◆ iRelPath()

char * iRelPath ( char **  path,
const char *  start 
)

relative path

Return a relative filepath to path either from the current directory or from an optional start directory

Parameters
pathpath to convert (this parameter is reallocated)
startreference path, cwd when NULL
Returns
updated relative path (you must free the pointer) NULL when path is NULL

Definition at line 3599 of file libsheepy.c.

Here is the call graph for this function:

◆ bRelPath()

char * bRelPath ( char *  dest,
const char *  path,
const char *  start 
)

relative path

Return a relative filepath to path either from the current directory or from an optional start directory

Parameters
pathpath to convert
startreference path, cwd when NULL
Returns
relative path in dest NULL when path or dest are NULL

Definition at line 3730 of file libsheepy.c.

Here is the call graph for this function:

◆ bLRelPath()

char * bLRelPath ( char *  dest,
size_t  destSize,
char *  path,
const char *  start 
)

relative path

Return a relative filepath to path either from the current directory or from an optional start directory

Parameters
pathpath to convert
startreference path, cwd when NULL
Returns
relative path in dest NULL when path or dest are NULL

Definition at line 3860 of file libsheepy.c.

Here is the call graph for this function:

◆ getHomePath()

char * getHomePath ( void  )

get home path

Returns
home path (you must free the pointer)

Definition at line 3983 of file libsheepy.c.

◆ bGetHomePath()

char * bGetHomePath ( char *  path)

copy home path to path

Parameters
pathbuffer large enough for home path
Returns
path pointer

Definition at line 4000 of file libsheepy.c.

◆ bLGetHomePath()

char * bLGetHomePath ( char *  path,
size_t  pathSize 
)

copy home path to path maximum pathSize

Parameters
pathbuffer large enough for home path
pathSizesize of path
Returns
path pointer

Definition at line 4020 of file libsheepy.c.

Here is the call graph for this function:

◆ getCHomePath()

const char * getCHomePath ( void  )

get home path as a const char*

Returns
home path

Definition at line 4039 of file libsheepy.c.

◆ getCwd()

char * getCwd ( void  )

get current working directory

Returns
current path (you must free the pointer)

Definition at line 4054 of file libsheepy.c.

Here is the caller graph for this function:

◆ bLGetCwd()

char * bLGetCwd ( char *  path,
size_t  pathSize 
)

Definition at line 4070 of file libsheepy.c.

◆ chDir()

int chDir ( const char *  path)

change directory

Parameters
path
Returns
1 success 0 error

Definition at line 4092 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDir()

bool isDir ( const char *  path)

is directory

Parameters
path
Returns
true when path is a directory false path is not a directory, filePath is NULL or empty string

Definition at line 4119 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shReadlink()

char * shReadlink ( const char *  path)

sheepy read link

read the first target in the link chain

the returned string has to be freed

Parameters
pathsymbolic link path
Returns
path to linked file or directory (you must free the pointer) NULL failed: path is blank or NULL path is not a symlink malloc failed to allocate the result buffer readlink failed

Definition at line 4153 of file libsheepy.c.

Here is the call graph for this function:

◆ endlink()

char * endlink ( const char *  path)

end link

read the link chain of a symbolic link to the end the returned string has to be freed

Parameters
pathsymbolic link path
Returns
path to linked file or directory (you must free the pointer) NULL failed: path is blank or NULL path is not a symlink malloc failed to allocate the result buffer readlink failed

Definition at line 4215 of file libsheepy.c.

Here is the call graph for this function:

◆ isLink()

bool isLink ( const char *  path)

is symbolic link

Parameters
path
Returns
true when path is a symbolic link false path is not a symbolic link, filePath is NULL or empty string

Definition at line 4293 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileExists()

bool fileExists ( const char *  filePath)

detect files and directories

Parameters
filePathpath to file or directory
Returns
true exists false non existant false filePath is NULL or empty string

Definition at line 4321 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileChmod()

bool fileChmod ( const char *  filePath,
mode_t  mode 
)

like chmod in stdlibc but return true/false

Parameters
filePathpath to file or directory mode: permissions
Returns
true success false filePath doesnt exist, not enough permissions... false filePath is NULL or empty string

Definition at line 4345 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileSize()

ssize_t fileSize ( const char *  filePath)

get file size

Parameters
filePathpath to file
Returns
ssize_t >= 0 size -1 an error occured or filePath is NULL or empty string

Definition at line 4369 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileSizeFP()

ssize_t fileSizeFP ( FILE *  fp)

get file size from file pointer

Parameters
fpfile pointer
Returns
ssize_t >= 0 size -1 an error occured or file pointer is NULL

Definition at line 4401 of file libsheepy.c.

Here is the caller graph for this function:

◆ readFileToS()

void * readFileToS ( const char *  filePath)

read file to string

0 is added at the end to terminate the string

Parameters
filePathpath to file
Returns
data in file (you must free the pointer) NULL an error occured

Definition at line 4427 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readStreamToS()

void * readStreamToS ( FILE *  fp)

read file to string

0 is added at the end to terminate the string

Parameters
fpfile pointer
Returns
data in file (you must free the pointer) NULL an error occured

Definition at line 4482 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bReadFileToS()

void * bReadFileToS ( const char *  filePath,
void *  dst 
)

buffer read file to string

0 is added at the end to terminate the string

Parameters
dstdestination buffer
filePathpath to file
Returns
data in file NULL an error occured

Definition at line 4530 of file libsheepy.c.

Here is the call graph for this function:

◆ bReadStreamToS()

void * bReadStreamToS ( FILE *  fp,
void *  dst 
)

buffer read file to string

0 is added at the end to terminate the string

Parameters
dstdestination buffer
fpfile pointer
Returns
data in file NULL an error occured

Definition at line 4579 of file libsheepy.c.

Here is the call graph for this function:

◆ bLReadFileToS()

void * bLReadFileToS ( const char *  filePath,
void *  dst,
size_t  dstSize 
)

buffer size read file to string

0 is added at the end to terminate the string

Parameters
filePathpath to file
dstdestination buffer
dstSizepath buffer size, the path strlen will be at most dstSize-1
Returns
data in file NULL an error occured

Definition at line 4621 of file libsheepy.c.

Here is the call graph for this function:

◆ bLReadStreamToS()

void * bLReadStreamToS ( FILE *  fp,
void *  dst,
size_t  dstSize 
)

buffer size read file to string

0 is added at the end to terminate the string

Parameters
dstdestination buffer
fpfile pointer
Returns
data in file NULL an error occured

Definition at line 4678 of file libsheepy.c.

Here is the call graph for this function:

◆ readFile()

ssize_t readFile ( const char *  filePath,
void **  buffer 
)

read file to buffer

The function allocates the buffer

Parameters
filePathpath to file
bufferunallocated buffer
Returns
data from file in buffer (you must free the pointer) buffer size -1 error

Definition at line 4726 of file libsheepy.c.

Here is the call graph for this function:

◆ bReadFile()

ssize_t bReadFile ( const char *  filePath,
void *  buffer 
)

buffer read file to buffer

The function allocates the buffer

Parameters
filePathpath to file
bufferalready allocated buffer
Returns
data from file in buffer buffer size -1 error

Definition at line 4782 of file libsheepy.c.

Here is the call graph for this function:

◆ bLReadFile()

ssize_t bLReadFile ( const char *  filePath,
void *  buffer,
size_t  dstSize 
)

buffer size read file to buffer

The function allocates the buffer

Parameters
filePathpath to file
bufferalready allocated buffer
dstSizepath buffer size
Returns
data from file in buffer buffer size -1 error

Definition at line 4832 of file libsheepy.c.

Here is the call graph for this function:

◆ writeFileS()

int writeFileS ( const char *  filePath,
const char *  string 
)

write string to file

Parameters
filePathpath to file string
Returns
1 success 0 error

Definition at line 4883 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeFile()

int writeFile ( const char *  filePath,
void *  buffer,
size_t  len 
)

write buffer to file

Parameters
filePathpath to file buffer len buffer size in bytes
Returns
1 success 0 error

Definition at line 4925 of file libsheepy.c.

Here is the call graph for this function:

◆ writeStreamS()

int writeStreamS ( FILE *  fp,
const char *  string 
)

write string to file

Parameters
fpfile pointer string
Returns
1 success 0 error

Definition at line 4963 of file libsheepy.c.

Here is the caller graph for this function:

◆ writeLStream()

int writeLStream ( FILE *  fp,
void *  buffer,
size_t  len 
)

write buffer to file

Parameters
fpfile pointer buffer len buffer size in bytes
Returns
1 success 0 error

Definition at line 4995 of file libsheepy.c.

◆ appendFileS()

bool appendFileS ( const char *  filePath,
const char *  string 
)

append string to filePath

Parameters
filePathpath to file string
Returns
true success false failed, filePath or list are NULL

Definition at line 5023 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendFile()

bool appendFile ( const char *  filePath,
void *  buffer,
size_t  len 
)

append buffer to file

Parameters
filePathpath to file buffer len buffer size in bytes
Returns
true success false error

Definition at line 5064 of file libsheepy.c.

Here is the call graph for this function:

◆ walkDir()

char ** walkDir ( const char *  dirPath)

list all files in a directory recursively and sort the list

directories are not listed

Parameters
dirPathpath to directory
Returns
list of files (you must free the pointer with listFreeS) empty list when the directory is not found

Definition at line 5103 of file libsheepy.c.

Here is the call graph for this function:

◆ walkADir()

internal void walkADir ( const char *  dirPath,
char ***  list 
)

Definition at line 5118 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ walkDirDir()

char ** walkDirDir ( const char *  dirPath)

list all directories in a directory recursively and sort the list

files are not listed

Parameters
dirPathpath to directory
Returns
list of directories (you must free the pointer with listFreeS) empty list when the directory is not found

Definition at line 5166 of file libsheepy.c.

Here is the call graph for this function:

◆ walkADirDir()

internal void walkADirDir ( const char *  dirPath,
char ***  list 
)

Definition at line 5181 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDir()

char ** readDir ( const char *  dirPath)

list files in a directory and sort the list

directories are not listed

Parameters
dirPathpath to directory
Returns
list of files, dirPath is not prepended to the file names (you must free the pointer with listFreeS) empty list when the directory is not found

Definition at line 5227 of file libsheepy.c.

Here is the call graph for this function:

◆ readDirDir()

char ** readDirDir ( const char *  dirPath)

list directories in a directory and sort the list

files are not listed

Parameters
dirPathpath to directory
Returns
list of directories, dirPath is not prepended to the names (you must free the pointer with listFreeS) empty list when the directory is not found

Definition at line 5279 of file libsheepy.c.

Here is the call graph for this function:

◆ walkDirAll()

char ** walkDirAll ( const char *  dirPath)

list all files and directories in a directory recursively and sort the list

directories are listed

Parameters
dirPathpath to directory
Returns
list of files (you must free the pointer with listFreeS) empty list when the directory is not found

Definition at line 5331 of file libsheepy.c.

Here is the call graph for this function:

◆ walkADirAll()

internal void walkADirAll ( const char *  dirPath,
char ***  list 
)

Definition at line 5346 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readDirAll()

char ** readDirAll ( const char *  dirPath)

list files in a directory and sort the list

directories are listed

Parameters
dirPathpath to directory
Returns
list of files, dirPath is not prepended to the file names (you must free the pointer with listFreeS) empty list when the directory is not found

Definition at line 5392 of file libsheepy.c.

Here is the call graph for this function:

◆ getUmask()

mode_t getUmask ( void  )

get umask

Definition at line 5433 of file libsheepy.c.

Here is the caller graph for this function:

◆ getCurrentPermissions()

mode_t getCurrentPermissions ( void  )

get current permissions for creating directories

Definition at line 5443 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mkdirParents()

int mkdirParents ( const char *  path)

recursive mkdir

Parameters
path
Returns
1 success 0 when path is NULL or empty

Definition at line 5457 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmAll()

int rmAll ( const char *  path)

remove all delete recursively files and directories

Parameters
path
Returns
1 success 0 when path is NULL or empty

Definition at line 5510 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rmADir()

int rmADir ( const char *  dirPath)

Definition at line 5527 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copy()

int copy ( const char *  src,
const char *  dst 
)

copy files recursively This function is equivalent to 'cp -Ra' without wildcards and circular link detection

when src ends with /, the files in src are copied to dst when src does't end with /, the last directory name in src is copied to dst The permissions are copied to the destination

Parameters
srcsource path dst destination path
Returns
1 success 0 when src or dst are NULL or empty

Definition at line 5590 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyFile()

int copyFile ( const char *  src,
const char *  dst 
)

Definition at line 5662 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyADir()

int copyADir ( const char *  src,
const char *  dst,
const char *  path 
)

Definition at line 5712 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shRename()

int shRename ( const char *  src,
const char *  dst 
)

rename file

Parameters
srcsource path dst destination path
Returns
1 success 0 when src or dst are NULL or empty

Definition at line 5808 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ shMove()

int shMove ( const char *  src,
const char *  dst 
)

move files recursively

copy and then delete source

called shMove because it conflicts with move in ncurses

Parameters
srcsource path
dstdestination path
Returns
1 success 0 when src or dst are NULL or empty

Definition at line 5845 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSoftwareRandom()

void setSoftwareRandom ( void  )

use software random numbers works on all cpu architectures the default random function is software

Definition at line 5869 of file libsheepy.c.

◆ setHardwareRandom()

void setHardwareRandom ( void  )

use cpu hardware random number generator

Definition at line 5878 of file libsheepy.c.

◆ randomUrandomOpen()

int randomUrandomOpen ( void  )

open /dev/urandom in libsheepy

call this function before calling randomWord and randomChoice when random are not needed anymore call randomUrandomClose

Returns
1 success 0 error

Definition at line 5895 of file libsheepy.c.

◆ randomUrandomClose()

randomUrandomClose ( void  )

close /dev/urandom in libsheepy call this function when random are not needed anymore

Definition at line 5916 of file libsheepy.c.

◆ randomWord()

uint64_t randomWord ( void  )

return random 64 bit unsigned integer call randomUrandomOpen before this calling function

Returns
random uint64 integer 0 error urandomFp file is NULL or fread failed

Definition at line 5933 of file libsheepy.c.

◆ randomWordFromHW()

uint64_t randomWordFromHW ( void  )

return random 64 bit unsigned integer from the cpu when the cpu doesn't have the random generator instruction, the program stops with 'Illegal instruction'

Definition at line 5959 of file libsheepy.c.

◆ randomChoice()

uint64_t randomChoice ( uint64_t  range)

return a random value between 0 and range 0<=value<range call randomUrandomOpen before this calling function

Parameters
range- must be > 0
Returns
random uint64 0<=value<range range error

Definition at line 5991 of file libsheepy.c.

◆ randomS()

char * randomS ( uint64_t  length)

random string

allocate and generate a random string in charset "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-,"

Parameters
stringlength
Returns
random string (you must free the pointer) NULL error opening /dev/urandom, malloc failed, fread /dev/urandom failed, length is 0

Definition at line 6020 of file libsheepy.c.

Here is the caller graph for this function:

◆ bRandomS()

char * bRandomS ( char *  dst,
size_t  dstSize 
)

buffer random string

allocate and generate a random string in charset "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-,"

Parameters
dstdestination buffer
dstSizedestination buffer size, must be at least 2, to have at least 1 random char in the string
Returns
random string NULL error opening /dev/urandom, malloc failed, fread /dev/urandom failed, length is 0

Definition at line 6080 of file libsheepy.c.

◆ randomAlphaNumS()

char * randomAlphaNumS ( uint64_t  length)

random alpha numerical string

allocate and generate a random string in charset "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

Parameters
stringlength
Returns
random string (you must free the pointer) NULL error opening /dev/urandom, malloc failed, fread /dev/urandom failed, length is 0

Definition at line 6132 of file libsheepy.c.

Here is the caller graph for this function:

◆ bRandomAlphaNumS()

char * bRandomAlphaNumS ( char *  dst,
size_t  dstSize 
)

buffer random alpha numerical string

allocate and generate a random string in charset "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"

Parameters
dstdestination buffer
dstSizedestination buffer size, must be at least 2, to have at least 1 random char in the string
Returns
random string NULL error opening /dev/urandom, malloc failed, fread /dev/urandom failed, length is 0

Definition at line 6192 of file libsheepy.c.

◆ readS()

char * readS ( void  )

read String read user input (one line) as a string

there is no size limit and the buffer expands as needed

Returns
line from the user (you must free the pointer) NULL when buffer allocation failed

Definition at line 6244 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLReadS()

char * bLReadS ( char *  dst,
size_t  dstSize 
)

buffer read String read user input (one line) as a string

Parameters
dstdestination buffer
dstSizedestination buffer size, must be at least 2, to have at least 1 char from the user in the string
Returns
line from the user NULL when buffer allocation failed

Definition at line 6297 of file libsheepy.c.

◆ shGetpass()

UNUSED local char * shGetpass ( void  )

sheepy get pass

like getpass, read password from tty

currently used in Termux because getpass is missging

Definition at line 6333 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readPasswordS()

char * readPasswordS ( void  )

read hidden password string

Returns
newly allocated password string (you must free the pointer)

Definition at line 6377 of file libsheepy.c.

Here is the call graph for this function:

◆ zeroS()

bool zeroS ( char *  string)

write zero to all bytes in string with memset, for clearing password buffers

Parameters
string
Returns
true 0s are written false error string is NULL

Definition at line 6403 of file libsheepy.c.

◆ zeroBuf()

bool zeroBuf ( void *  buf,
size_t  len 
)

write zero to all bytes in buffer with memset

Parameters
bufbuffer
lenlength
Returns
true 0s are written false error string is NULL

Definition at line 6425 of file libsheepy.c.

◆ memdup()

void * memdup ( const void *  buf,
size_t  size 
)

memory duplicate allocate and copy buffer

Parameters
bufbuffer to duplicate
sizebuffer size
Returns
duplicated buffer (you must free the pointer) NULL when there is an error

Definition at line 6448 of file libsheepy.c.

◆ readEnter()

void readEnter ( void  )

read Enter key wait until press the enter key

Definition at line 6468 of file libsheepy.c.

◆ readLine()

char * readLine ( FILE *  fp)

readLine from file stream the fist new line is converted to 0

Parameters
fpfile stream
Returns
one line in a string (you must free the pointer) empty string when stream is empty or when there is an error reading the stream NULL when the stream is NULL

Definition at line 6493 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freeManySF()

void freeManySF ( char *  paramType,
  ... 
)

free Many String

free variable list of pointers freeManyS(s1, s2, ...);

Definition at line 6526 of file libsheepy.c.

Here is the call graph for this function:

◆ dupS()

char * dupS ( const char *  string)

duplicate string

Parameters
string
Returns
new identical string (you must free the pointer) NULL when string is NULL

Definition at line 6548 of file libsheepy.c.

Here is the caller graph for this function:

◆ shPrintfS()

void shPrintfS ( const char *  fmt,
  ... 
)

sheepy Print String

same as printf when the formating string is NULL, "(null)" is printed

Parameters
formatstring - can be NULL data

Definition at line 6566 of file libsheepy.c.

◆ shEPrintfS()

void shEPrintfS ( const char *  fmt,
  ... 
)

sheepy Error printf String print with logE

when the formating string is NULL, "(null)" is printed

Parameters
formatstring like printf
Returns
print with logE

Definition at line 6589 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ logNFree()

void logNFree ( char *  s)

log and free

Parameters
stringto print, can be NULL

Definition at line 6613 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loghex()

void loghex ( const void *  buf,
size_t  len 
)

print buffer as hexadecimal string

Definition at line 6624 of file libsheepy.c.

◆ toHexS()

char * toHexS ( const void *  buf,
size_t  len 
)

create a string with bytes in buf converted to hex strings

Parameters
bufbuffer to convert to hexstring
lenbuffer size in bytes
Returns
string representing the buffer in hexadecimal "0x01, 0x02,..." (you must free the pointer)

Definition at line 6648 of file libsheepy.c.

◆ toHexSepS()

char * toHexSepS ( const void *  buf,
size_t  len,
const char *  separator 
)

create a string with bytes in buf converted to hex strings separated by separator

Parameters
bufbuffer to convert to hexstring
lenbuffer size in bytes
separatorseparator between the hexadecimal numbers
Returns
string representing the buffer in hexadecimal "0x01SEP0x02SEP..." (you must free the pointer)

Definition at line 6686 of file libsheepy.c.

Here is the caller graph for this function:

◆ toHexHeadSepS()

char * toHexHeadSepS ( const void *  buf,
size_t  len,
const char *  head,
const char *  separator 
)

create a string with bytes in buf converted to hex strings separated by separator and with head string in front of earch byte: HEADffSEP

Parameters
bufbuffer to convert to hexstring
lenbuffer size in bytes
headseparator before each hexadecimal numbers
separatorseparator after each hexadecimal numbers
Returns
string representing the buffer in hexadecimal "HEAD0x01SEPHEAD0x02SEP..." (you must free the pointer)

Definition at line 6728 of file libsheepy.c.

◆ strCpy()

char * strCpy ( char *restrict  dst,
const char *restrict  src 
)

strCpy - copy src to dst

like strcpy with sanity checks

Parameters
dstdestination buffer
srcsource string
Returns
dst string NULL error

Definition at line 6771 of file libsheepy.c.

◆ strNCpy()

char * strNCpy ( char *restrict  dst,
const char *restrict  src,
size_t  srcSize 
)

strNCpy - copy src to dst

null safe version of strncpy

Parameters
dstdestination buffer
srcsource string
srcSizesource buffer size
Returns
dst string NULL error

Definition at line 6796 of file libsheepy.c.

◆ strLCpy()

char * strLCpy ( char *restrict  dst,
size_t  dstSize,
const char *restrict  src 
)

strLCpy - copy src to dst

like strncpy and the NUL char is always added at the end of the string

Parameters
dstdestination buffer
dstSizedestination buffer size, result string will be no longer than dstSize-1
srcsource string
Returns
dst string NULL error

Definition at line 6822 of file libsheepy.c.

Here is the caller graph for this function:

◆ strCat()

char * strCat ( char *restrict  dst,
const char *restrict  src 
)

strCat - concatenate two strings

like strcat with sanity checks

Parameters
dstdestination buffer
srcsource string
Returns
string with input strings concatenated NULL error

Definition at line 6848 of file libsheepy.c.

◆ strNCat()

char * strNCat ( char *restrict  dst,
const char *restrict  src,
size_t  srcLen 
)

strNCat - concatenate two strings

like strncat with sanity checks

Parameters
dstdestination buffer
srcsource string
srcLenmax source len
Returns
string with input strings concatenated NULL error

Definition at line 6872 of file libsheepy.c.

◆ strLCat()

char * strLCat ( char *restrict  dst,
size_t  dstSize,
const char *restrict  src 
)

strLCat - concatenate two strings

like strlcat with sanity checks

Parameters
dstdestination buffer
srcsource string
dstSizedestination buffer size, result string will be no longer than dstSize-1
Returns
string with input strings concatenated NULL error

Definition at line 6897 of file libsheepy.c.

Here is the caller graph for this function:

◆ strLNCat()

char * strLNCat ( char *restrict  dst,
size_t  dstSize,
const char *restrict  src,
size_t  srcLen 
)

strLNCat - concatenate two strings

like strlcat with sanity checks

Parameters
dstdestination buffer
srcsource string
dstSizedestination buffer size, result string will be no longer than dstSize-1
srcLenmax source len
Returns
string with input strings concatenated NULL error

Definition at line 6966 of file libsheepy.c.

Here is the caller graph for this function:

◆ catSF()

char * catSF ( const char *  paramType,
  ... 
)

cat String Function

Parameters
arbitrarylist of strings seperated by commas
Returns
string with input strings concatenated (you must free the pointer)

Definition at line 6998 of file libsheepy.c.

Here is the call graph for this function:

◆ iCatSF()

char * iCatSF ( char *  dst,
const char *  paramType,
  ... 
)

cat and copy String Function dst has to be big enough to hold the result

Parameters
dstresult destination buffer arbitrary list of strings seperated by commas
Returns
dst string with input strings concatenated

Definition at line 7027 of file libsheepy.c.

◆ bLCatSF()

char * bLCatSF ( char *  dst,
size_t  dstSize,
const char *  paramType,
  ... 
)

cat and copy String Function

Parameters
dstresult destination buffer arbitrary list of strings seperated by commas
Returns
dst string with input strings concatenated

Definition at line 7057 of file libsheepy.c.

Here is the call graph for this function:

◆ formatS()

char * formatS ( const char *  fmt,
  ... 
)

format string allocate and format string using asprintf

Parameters
formatstring and other parameters
Returns
allocated and formated string (you must free the pointer) NULL when fmt is NULL or asprintf fails

Definition at line 7092 of file libsheepy.c.

Here is the caller graph for this function:

◆ bFormatS()

char * bFormatS ( char *  string,
const char *  fmt,
  ... 
)

format string

format and store in string: bFormatS(string, "Value %d", i);

Parameters
formatstring and other parameters
Returns
formated string NULL when string, fmt are NULL or sprintf fails

Definition at line 7117 of file libsheepy.c.

◆ bLFormatS()

char * bLFormatS ( char *  string,
size_t  stringSize,
const char *  fmt,
  ... 
)

format string

format and store in string: bLFormatS(string, sizeof(string), "Value %d", i);

Parameters
formatstring and other parameters
Returns
formated string NULL when string, fmt is NULL or snprintf fails

Definition at line 7140 of file libsheepy.c.

◆ appendS()

char * appendS ( const char *  string1,
const char *  string2 
)

append strings

Parameters
string1string string2 string to append at the end of string1
Returns
new string string1+string2 (you must free the pointer) dup string1 when string2 is NULL (you must free the pointer) NULL when string1 is NULL

Definition at line 7166 of file libsheepy.c.

Here is the caller graph for this function:

◆ appendCharS()

char * appendCharS ( const char *  string1,
char  c 
)

append char to string when c is 0 the result is string1

Parameters
string1string c char to append
Returns
new string string1+c (you must free the pointer) NULL when string1 is NULL

Definition at line 7209 of file libsheepy.c.

Here is the caller graph for this function:

◆ appendSChar()

char * appendSChar ( char  c,
const char *  string2 
)

append string to char

Parameters
string1string c char to append
Returns
new string string1+c (you must free the pointer) NULL when string1 is NULL

Definition at line 7245 of file libsheepy.c.

Here is the caller graph for this function:

◆ iAppendS()

char * iAppendS ( char **  string1,
const char *  string2 
)

append strings

Parameters
string1string, which is reallocated. string2 string to append at the end of string1
Returns
string1 modified string1 (realloc), string1+string2 (you must free the pointer) string1 no change when string2 is NULL (you must free the pointer) NULL no change when string1 is NULL

Definition at line 7285 of file libsheepy.c.

Here is the caller graph for this function:

◆ iAppendCharS()

char * iAppendCharS ( char **  string1,
char  c 
)

append char to string

Parameters
string1string, which is reallocated. c char to append at the end of string1
Returns
string1 modified string1 (realloc), string1+c (you must free the pointer) NULL no change when string1 is NULL

Definition at line 7329 of file libsheepy.c.

Here is the caller graph for this function:

◆ iAppendNFreeS()

char * iAppendNFreeS ( char **  string1,
char *  string2 
)

append and free strings

string2 is freed (except when there is an error)

Parameters
string1string, which is reallocated. string2 string to append at the end of string1
Returns
string1 modified string1 (realloc), string1+string2 (you must free the pointer) NULL no change when string1 or string2 are NULL

Definition at line 7368 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iAppendManySF()

char * iAppendManySF ( char **  string,
const char *  paramType,
  ... 
)

append many strings

Parameters
string1string, which is reallocated. string2 string to append at the end of string1
Returns
string1 modified string1, string1+string2 (you must free the pointer) NULL no change when string1 or string2 are NULL

Definition at line 7388 of file libsheepy.c.

Here is the call graph for this function:

◆ bAppendManySF()

char * bAppendManySF ( char *  string,
const char *  paramType,
  ... 
)

buffer append many strings

Parameters
string1string string2 string to append at the end of string1
Returns
string1 modified string1, string1+string2 NULL no change when string1 or string2 are NULL

Definition at line 7427 of file libsheepy.c.

Here is the call graph for this function:

◆ bLAppendManySF()

char * bLAppendManySF ( char *  string,
size_t  stringSize,
const char *  paramType,
  ... 
)

buffer size append many strings

Parameters
string1string string2 string to append at the end of string1
Returns
string1 modified string1, string1+string2 NULL no change when string1 or string2 are NULL

Definition at line 7466 of file libsheepy.c.

Here is the call graph for this function:

◆ prependS()

char * prependS ( const char *  string1,
const char *  string2 
)

prepend strings

Parameters
string1string string2 string to prepend at the beginning of string1
Returns
new string string2+string1 (you must free the pointer) dup string2 when string1 is NULL (you must free the pointer) NULL when string2 is NULL

Definition at line 7511 of file libsheepy.c.

Here is the call graph for this function:

◆ prependCharS()

char * prependCharS ( const char *  string1,
char  c 
)

prepend char to string

Parameters
string1string c char to prepend at the beginning of string1
Returns
new string c+string1 (you must free the pointer) NULL when string1 is NULL

Definition at line 7526 of file libsheepy.c.

Here is the call graph for this function:

◆ prependSChar()

char * prependSChar ( char  c,
const char *  string2 
)

prepend string to char

Parameters
cchar string2 string to prepend at the beginning of c
Returns
new string string2+c (you must free the pointer) NULL when string2 is NULL

Definition at line 7541 of file libsheepy.c.

Here is the call graph for this function:

◆ iPrependS()

char * iPrependS ( char **  string1,
const char *  string2 
)

prepend strings

Parameters
string1string, which is reallocated. string2 string to prepend at the beginning of string1
Returns
string1 modified string1, string2+string1 (you must free the pointer) string1 when string2 is NULL (you must free the pointer) NULL no change when string1 is NULL

Definition at line 7557 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iPrependCharS()

char * iPrependCharS ( char **  string1,
char  c 
)

prepend char to string

Parameters
string1string, which is reallocated. c char to prepend at the beginning of string1
Returns
string1 modified string1, c+string1 (you must free the pointer) NULL no change when string1 is NULL

Definition at line 7591 of file libsheepy.c.

◆ iPrependNFreeS()

char * iPrependNFreeS ( char **  string1,
char *  string2 
)

prepend and free strings

string2 is freed

Parameters
string1string, which is reallocated. string2 string to prepend at the beginning of string1
Returns
string1 modified string1, string2+string1 (you must free the pointer) NULL no change when string1 or string2 are NULL

Definition at line 7634 of file libsheepy.c.

Here is the call graph for this function:

◆ bPrependS()

char * bPrependS ( char *  string1,
const char *  string2 
)

buffer prepend strings

Parameters
string1string string2 string to prepend at the beginning of string1
Returns
string1 modified string1, string2+string1 NULL no change when string1 or string2 are NULL

Definition at line 7655 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLPrependS()

char * bLPrependS ( char *  string1,
size_t  string1Size,
const char *  string2 
)

buffer prepend strings

Parameters
string1string string2 string to prepend at the beginning of string1
Returns
string1 modified string1, string2+string1 NULL no change when string1 or string2 are NULL

Definition at line 7687 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceS()

char * replaceS ( const char *  s,
const char *  olds,
const char *  news,
size_t  max 
)

replace String the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring olds: old string to be replaced in s news: new string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
new string (you must free the pointer) "" when s is empty NULL when s is NULL NULL when olds is empty

Definition at line 7731 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceCharSS()

char * replaceCharSS ( const char *  s,
char  olds,
const char *  news,
size_t  max 
)

Definition at line 7805 of file libsheepy.c.

Here is the call graph for this function:

◆ replaceSCharS()

char * replaceSCharS ( const char *  s,
const char *  olds,
char  news,
size_t  max 
)

Definition at line 7811 of file libsheepy.c.

Here is the call graph for this function:

◆ replaceCharCharS()

char * replaceCharCharS ( const char *  s,
char  olds,
char  news,
size_t  max 
)

Definition at line 7817 of file libsheepy.c.

Here is the call graph for this function:

◆ replaceSLen()

size_t replaceSLen ( const char *  s,
const char *  olds,
const char *  news,
size_t  max 
)

replaceSLen returns the length of the resulting string

Definition at line 7827 of file libsheepy.c.

Here is the call graph for this function:

◆ iReplaceS()

char * iReplaceS ( char **  s,
const char *  olds,
const char *  news,
size_t  max 
)

replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring (that is allocated with malloc) olds: old string to be replaced in s news: new string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
modified s string (you must free the pointer) NULL s not modified when s is NULL or empty and when olds is empty

Definition at line 7892 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iReplaceCharSS()

char * iReplaceCharSS ( char **  s,
char  olds,
const char *  news,
size_t  max 
)

Definition at line 7971 of file libsheepy.c.

Here is the call graph for this function:

◆ iReplaceSCharS()

char * iReplaceSCharS ( char **  s,
const char *  olds,
char  news,
size_t  max 
)

Definition at line 7977 of file libsheepy.c.

Here is the call graph for this function:

◆ iReplaceCharCharS()

char * iReplaceCharCharS ( char **  s,
char  olds,
char  news,
size_t  max 
)

Definition at line 7983 of file libsheepy.c.

Here is the call graph for this function:

◆ bReplaceS()

char * bReplaceS ( char *  s,
const char *  olds,
const char *  news,
size_t  max 
)

buffer replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring olds: old string to be replaced in s news: new string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
modified s string NULL s not modified when s is NULL or empty and when olds is empty

Definition at line 8004 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLReplaceS()

char * bLReplaceS ( char *  s,
size_t  sSize,
const char *  olds,
const char *  news,
size_t  max 
)

buffer size replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring olds: old string to be replaced in s news: new string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
modified s string NULL s not modified when s is NULL or empty and when olds is empty

Definition at line 8097 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ replaceManySF()

char * replaceManySF ( const char *  paramType,
  ... 
)

replace Many Strings the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result

Example: r = replaceManyS("asd", "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
sstring olds: old string to be replaced in s news: new string replacing olds in s ...
Returns
new string (you must free the pointer) "" when s is empty NULL when s is NULL NULL when only 2 parameters are given NULL when any olds is empty

Definition at line 8202 of file libsheepy.c.

Here is the call graph for this function:

◆ iReplaceManySF()

char * iReplaceManySF ( char **  s,
char *  paramType,
  ... 
)

replace Many Strings the olds string is replaced with the news string max times in the result

Example: iReplaceManyS(s, "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
string(this parameter is reallocated) olds: old string to be replaced in s news: new string replacing olds in s ...
Returns
modified string (you must free the pointer) NULL not modified when s is empty, when s is NULL, when only 2 parameters are given, when any olds is empty

Definition at line 8263 of file libsheepy.c.

Here is the call graph for this function:

◆ bReplaceManySF()

char * bReplaceManySF ( char *  s,
char *  paramType,
  ... 
)

buffer replace Many Strings the olds string is replaced with the news string max times in the result

Example: bReplaceManyS(s, "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
stringolds: old string to be replaced in s news: new string replacing olds in s ...
Returns
modified string NULL not modified when s is empty, when s is NULL, when only 2 parameters are given, when any olds is empty

Definition at line 8317 of file libsheepy.c.

Here is the call graph for this function:

◆ bLReplaceManySF()

char * bLReplaceManySF ( char *  s,
size_t  sSize,
char *  paramType,
  ... 
)

buffer size replace Many Strings the olds string is replaced with the news string max times in the result

Example: bReplaceManyS(s, "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
stringolds: old string to be replaced in s news: new string replacing olds in s ...
Returns
modified string NULL not modified when s is empty, when s is NULL, when only 2 parameters are given, when any olds is empty

Definition at line 8371 of file libsheepy.c.

Here is the call graph for this function:

◆ icReplaceS()

char * icReplaceS ( const char *  s,
const char *  olds,
const char *  news,
size_t  max 
)

ignore case Replace String the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring olds: old string to be replaced in s news: new string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
new string (you must free the pointer) "" when s is empty NULL when s is NULL NULL when olds is empty

Definition at line 8429 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icReplaceCharSS()

char * icReplaceCharSS ( const char *  s,
char  olds,
const char *  news,
size_t  max 
)

Definition at line 8503 of file libsheepy.c.

Here is the call graph for this function:

◆ icReplaceSCharS()

char * icReplaceSCharS ( const char *  s,
const char *  olds,
char  news,
size_t  max 
)

Definition at line 8509 of file libsheepy.c.

Here is the call graph for this function:

◆ icReplaceCharCharS()

char * icReplaceCharCharS ( const char *  s,
char  olds,
char  news,
size_t  max 
)

Definition at line 8515 of file libsheepy.c.

Here is the call graph for this function:

◆ iicReplaceS()

char * iicReplaceS ( char **  s,
const char *  olds,
const char *  news,
size_t  max 
)

in place ignore case replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring (this parameter is reallocated) olds: old string to be replaced in s news: new string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
modified s string (you must free the pointer) NULL s not modified when s is NULL or empty and when olds is empty

Definition at line 8537 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iicReplaceCharSS()

char * iicReplaceCharSS ( char **  s,
char  olds,
const char *  news,
size_t  max 
)

Definition at line 8616 of file libsheepy.c.

Here is the call graph for this function:

◆ iicReplaceSCharS()

char * iicReplaceSCharS ( char **  s,
const char *  olds,
char  news,
size_t  max 
)

Definition at line 8622 of file libsheepy.c.

Here is the call graph for this function:

◆ iicReplaceCharCharS()

char * iicReplaceCharCharS ( char **  s,
char  olds,
char  news,
size_t  max 
)

Definition at line 8628 of file libsheepy.c.

Here is the call graph for this function:

◆ bicReplaceS()

char * bicReplaceS ( char *  s,
const char *  olds,
const char *  news,
size_t  max 
)

buffer ignore case replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring olds: old string to be replaced in s news: new string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
modified s string NULL s not modified when s is NULL or empty and when olds is empty

Definition at line 8649 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLicReplaceS()

char * bLicReplaceS ( char *  s,
size_t  sSize,
const char *  olds,
const char *  news,
size_t  max 
)

buffer size ignore case replace String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring olds: old string to be replaced in s news: new string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
modified s string NULL s not modified when s is NULL or empty and when olds is empty

Definition at line 8742 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icReplaceManySF()

char * icReplaceManySF ( const char *  paramType,
  ... 
)

ignore case replace Many Strings the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result

Example: r = icReplaceManyS("asd", "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
sstring olds: old string to be replaced in s news: new string replacing olds in s ...
Returns
new string (you must free the pointer) "" when s is empty NULL when s is NULL NULL when only 2 parameters are given NULL when any olds is empty

Definition at line 8847 of file libsheepy.c.

Here is the call graph for this function:

◆ iicReplaceManySF()

char * iicReplaceManySF ( char **  s,
char *  paramType,
  ... 
)

in place ignore case replace Many Strings the olds string is replaced with the news string max times in the result

Example: iicReplaceManyS(s, "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
string(this parameter is reallocated) olds: old string to be replaced in s news: new string replacing olds in s ...
Returns
modified string (you must free the pointer) NULL not modified when s is empty, when s is NULL, when only 2 parameters are given, when any olds is empty

Definition at line 8908 of file libsheepy.c.

Here is the call graph for this function:

◆ bicReplaceManySF()

char * bicReplaceManySF ( char *  s,
char *  paramType,
  ... 
)

buffer ignore case replace Many Strings the olds string is replaced with the news string max times in the result

Example: bReplaceManyS(s, "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
stringolds: old string to be replaced in s news: new string replacing olds in s ...
Returns
modified string NULL not modified when s is empty, when s is NULL, when only 2 parameters are given, when any olds is empty

Definition at line 8962 of file libsheepy.c.

Here is the call graph for this function:

◆ bLicReplaceManySF()

char * bLicReplaceManySF ( char *  s,
size_t  sSize,
char *  paramType,
  ... 
)

buffer size ignore case replace Many Strings the olds string is replaced with the news string max times in the result

Example: bReplaceManyS(s, "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
stringolds: old string to be replaced in s news: new string replacing olds in s ...
Returns
modified string NULL not modified when s is empty, when s is NULL, when only 2 parameters are given, when any olds is empty

Definition at line 9016 of file libsheepy.c.

Here is the call graph for this function:

◆ eqS()

bool eqS ( const char *  string1,
const char *  string2 
)

string Equal compare string1 to string2

Parameters
2strings
Returns
true the strings have identical content false they differ

Definition at line 9067 of file libsheepy.c.

Here is the caller graph for this function:

◆ eqCharS()

bool eqCharS ( char  c,
const char *  string2 
)

Definition at line 9076 of file libsheepy.c.

◆ eqSChar()

bool eqSChar ( const char *  string1,
char  c 
)

Definition at line 9086 of file libsheepy.c.

◆ eqIS()

bool eqIS ( const char *  string1,
const char *  string2,
int64_t  index 
)

string Index Equal compare string1 at index to string2 when string2 is empty, the result is false

Parameters
2strings
Returns
true string1 at index is equal to string2 false they differ

Definition at line 9107 of file libsheepy.c.

Here is the caller graph for this function:

◆ eqICharS()

bool eqICharS ( const char *  string1,
char  c,
int64_t  index 
)

Definition at line 9142 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ startsWithS()

bool startsWithS ( const char *  string1,
const char *  string2 
)

starts With String compare start of string1 with string2

Parameters
2strings
Returns
true when string1 starts with string2 false for other cases

Definition at line 9158 of file libsheepy.c.

Here is the caller graph for this function:

◆ startsWithCharS()

bool startsWithCharS ( const char *  string1,
char  c 
)

Definition at line 9167 of file libsheepy.c.

◆ endsWithS()

bool endsWithS ( const char *  string1,
const char *  string2 
)

ends With String compare end of string1 with string2

Parameters
2strings
Returns
true when string1 ends with string2 false for other cases

Definition at line 9185 of file libsheepy.c.

Here is the caller graph for this function:

◆ endsWithCharS()

bool endsWithCharS ( const char *  string1,
char  c 
)

Definition at line 9198 of file libsheepy.c.

◆ countS()

ssize_t countS ( const char *  s,
const char *  needle 
)

count String count number of (non-overlapping) occurrences of a substring

Example: assert(countS("aaa aaa", "a") == 6); assert(countS("aaa aaa", "ab") == 0); assert(countS("aaa aaa", "aa") == 2);

Parameters
2strings
Returns
string count -1 when there is an error

Definition at line 9230 of file libsheepy.c.

◆ countCharS()

ssize_t countCharS ( const char *  s,
char  c 
)

Definition at line 9254 of file libsheepy.c.

◆ icEqS()

bool icEqS ( const char *  string1,
const char *  string2 
)

ignore case string Equal compare string1 to string2

Parameters
2strings
Returns
true the strings have identical content false they differ

Definition at line 9283 of file libsheepy.c.

Here is the caller graph for this function:

◆ icEqCharS()

bool icEqCharS ( char  c,
const char *  string2 
)

Definition at line 9292 of file libsheepy.c.

◆ icEqSChar()

bool icEqSChar ( const char *  string1,
char  c 
)

Definition at line 9302 of file libsheepy.c.

◆ icEqIS()

bool icEqIS ( const char *  string1,
const char *  string2,
int64_t  index 
)

ignore case string Index Equal compare string1 at index to string2 when string2 is empty, the result is false

Parameters
2strings
Returns
true string1 at index is equal to string2 false they differ

Definition at line 9323 of file libsheepy.c.

Here is the caller graph for this function:

◆ icEqICharS()

bool icEqICharS ( const char *  string1,
char  c,
int64_t  index 
)

Definition at line 9358 of file libsheepy.c.

Here is the call graph for this function:

◆ icStartsWithS()

bool icStartsWithS ( const char *  string1,
const char *  string2 
)

ignore case starts With String compare start of string1 with string2

Parameters
2strings
Returns
true when string1 starts with string2 false for other cases

Definition at line 9374 of file libsheepy.c.

◆ icStartsWithCharS()

bool icStartsWithCharS ( const char *  string1,
char  c 
)

Definition at line 9383 of file libsheepy.c.

◆ icEndsWithS()

bool icEndsWithS ( const char *  string1,
const char *  string2 
)

ignore case ends With String compare end of string1 with string2

Parameters
2strings
Returns
true when string1 ends with string2 false for other cases

Definition at line 9401 of file libsheepy.c.

◆ icEndsWithCharS()

bool icEndsWithCharS ( const char *  string1,
char  c 
)

Definition at line 9414 of file libsheepy.c.

◆ icCountS()

ssize_t icCountS ( const char *  s,
const char *  needle 
)

ignore case count String count number of (non-overlapping) occurrences of a substring

Example: assert(countS("aaa aaa", "a") == 6); assert(countS("aaa aaa", "ab") == 0); assert(countS("aaa aaa", "aa") == 2);

Parameters
2strings
Returns
string count -1 when there is an error

Definition at line 9446 of file libsheepy.c.

◆ icCountCharS()

ssize_t icCountCharS ( const char *  s,
char  c 
)

Definition at line 9470 of file libsheepy.c.

◆ hasCtrlChar()

bool hasCtrlChar ( const char *  string)

has control char

Returns
true when there is a terminal control in string

Definition at line 9497 of file libsheepy.c.

◆ stripCtrlS()

char * stripCtrlS ( const char *  string)

remove terminal control char from string

Parameters
string
Returns
new string without the control chars NULL when string is NULL

Definition at line 9521 of file libsheepy.c.

◆ iStripCtrlS()

char * iStripCtrlS ( char **  string)

remove terminal control char from string

Parameters
stringpointer to a string
Returns
string without the control chars NULL when string is NULL

Definition at line 9553 of file libsheepy.c.

◆ bStripCtrlS()

char * bStripCtrlS ( char *  string)

remove terminal control char from string

Parameters
string
Returns
string without the control chars NULL when string is NULL

Definition at line 9581 of file libsheepy.c.

◆ stripColorsS()

char * stripColorsS ( const char *  string)

remove ansi colors from string

Parameters
string
Returns
new string without colors NULL when string is NULL

Definition at line 9609 of file libsheepy.c.

◆ iStripColorsS()

char * iStripColorsS ( char **  string)

remove ansi colors from string

Parameters
stringpointer to a string
Returns
string without the control chars NULL when string is NULL

Definition at line 9690 of file libsheepy.c.

◆ bStripColorsS()

char * bStripColorsS ( char *  string)

remove terminal control char from string

Parameters
string
Returns
string without the control chars NULL when string is NULL

Definition at line 9768 of file libsheepy.c.

◆ quoteS()

char * quoteS ( const char *  s,
char  delim 
)

add backslash '\' before delim('\'' or '"') and backslash the backslashes in the result avoid splitting the string when it is in a source file or a json string

Parameters
sstring to escape
delimstring delimiter ' or "
Returns
new string with escape backslash (free this buffer) null when s is null

Definition at line 9850 of file libsheepy.c.

◆ bQuoteS()

char * bQuoteS ( char *  dest,
const char *  s,
char  delim 
)

add backslash '\' before delim('\'' or '"') and backslash the backslashes in the result avoid splitting the string when it is in a source file or a json string

Parameters
destdestination buffer, it should be big enough
sstring to escape
delimstring delimiter ' or "
Returns
new string with escape backslash (free this buffer) null when s is null

Definition at line 9914 of file libsheepy.c.

◆ bLQuoteS()

char * bLQuoteS ( char *  dest,
size_t  destSize,
const char *  s,
char  delim 
)

add backslash '\' before delim('\'' or '"') and backslash the backslashes in the result avoid splitting the string when it is in a source file or a json string

Parameters
destdestination buffer
destSizedestination buffer size
sstring to escape
delimstring delimiter ' or "
Returns
new string with escape backslash (free this buffer) null when s is null

Definition at line 9959 of file libsheepy.c.

◆ quoteLenS()

size_t quoteLenS ( const char *  s,
char  delim 
)

return the length of the escaped string (without the terminating \0)

Definition at line 10007 of file libsheepy.c.

◆ escapeS()

char * escapeS ( const char *  s,
char  delim 
)

escape string according the json specification (RFC 8259) if there is in the string, the backslash is escaped and it will be parsed as the string '' be the json parsers the unicode characters should be converted to UTF8 codepoints instead of using the result can be included in a json string and the parsing will be correct

Parameters
sstring to escape
delimstring delimiter ' or "
Returns
new string with escape backslash (free this buffer) null when s is null

Definition at line 10045 of file libsheepy.c.

Here is the caller graph for this function:

◆ bEscapeS()

char * bEscapeS ( char *  dest,
const char *  s,
char  delim 
)

escape string according the json specification (RFC 8259) if there is in the string, the backslash is escaped and it will be parsed as the string '' be the json parsers the unicode characters should be converted to UTF8 codepoints instead of using the result can be included in a json string and the parsing will be correct

Parameters
destdestination buffer
sstring to escape
delimstring delimiter ' or "
Returns
new string with escape backslash (free this buffer) null when s is null

Definition at line 10134 of file libsheepy.c.

◆ bLEscapeS()

char * bLEscapeS ( char *  dest,
size_t  destSize,
const char *  s,
char  delim 
)

escape string according the json specification (RFC 8259) if there is in the string, the backslash is escaped and it will be parsed as the string '' be the json parsers the unicode characters should be converted to UTF8 codepoints instead of using the result can be included in a json string and the parsing will be correct

Parameters
destdestination buffer
destSizedestination buffer size
sstring to escape
delimstring delimiter ' or "
Returns
new string with escape backslash (free this buffer) null when s is null

Definition at line 10205 of file libsheepy.c.

◆ escapeLenS()

size_t escapeLenS ( const char *  s,
char  delim 
)

return the length of the escaped string (without the terminating \0)

Definition at line 10276 of file libsheepy.c.

◆ nibbleToHex()

char nibbleToHex ( u8  n)

convert number between 0 and 15 to hexadecimal character '0' to 'F'

Definition at line 10301 of file libsheepy.c.

Here is the caller graph for this function:

◆ cEscapeS()

char * cEscapeS ( const char *  S)

escape string to become a valid C source string control characters, backslash and double quotes are escaped.

control characters without an escaped representation () are represented as hexidecimal literal '' the result can be included in C source code and the parsing will be correct

Parameters
Sstring to escape
Returns
new escaped string (free this buffer) null when S is null

Definition at line 10328 of file libsheepy.c.

Here is the call graph for this function:

◆ bCEscapeS()

char * bCEscapeS ( char *  dest,
const char *  S 
)

escape string to become a valid C source string control characters, backslash and double quotes are escaped.

control characters without an escaped representation () are represented as hexidecimal literal '' the result can be included in C source code and the parsing will be correct

Parameters
destdestination buffer
Sstring to escape
Returns
new escaped string (free this buffer) null when S is null

Definition at line 10459 of file libsheepy.c.

Here is the call graph for this function:

◆ bLCEscapeS()

char * bLCEscapeS ( char *  dest,
size_t  destSize,
const char *  S 
)

escape string to become a valid C source string control characters, backslash and double quotes are escaped.

control characters without an escaped representation () are represented as hexidecimal literal '' the result can be included in C source code and the parsing will be correct

Parameters
destdestination buffer
destSizedestination buffer size
Sstring to escape
Returns
new escaped string (free this buffer) null when S is null

Definition at line 10549 of file libsheepy.c.

Here is the call graph for this function:

◆ cEscapeLenS()

size_t cEscapeLenS ( const char *  s)

return the length of the escaped string (without the terminating \0)

Definition at line 10693 of file libsheepy.c.

◆ isNumber()

bool isNumber ( const char *  string)

is Number (integer or float) String

1, -12 1e+4, -1.44E-1

Parameters
string
Returns
true when string is a number false when string is not a number or string is empty or NULL

Definition at line 10749 of file libsheepy.c.

Here is the caller graph for this function:

◆ isInt()

bool isInt ( const char *  string)

is Integer String

Parameters
string
Returns
true when string is an integer false when string is not an integer or string is empty or NULL

Definition at line 10811 of file libsheepy.c.

Here is the caller graph for this function:

◆ parseInt()

int64_t parseInt ( const char *  string)

convert string to decimal integer

Parameters
string
Returns
int64_t 0 when string represents 0 or doesnt represent a number or the input is NULL

Definition at line 10846 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parseIntChar()

int64_t parseIntChar ( char  c)

Definition at line 10863 of file libsheepy.c.

◆ parseI64()

int64_t parseI64 ( const char *  string)

convert string to decimal integer

Parameters
string
Returns
int64_t 0 when string represents 0 or doesnt represent a number or the input is NULL

Definition at line 10880 of file libsheepy.c.

Here is the call graph for this function:

◆ parseI64Char()

int64_t parseI64Char ( char  c)

Definition at line 10897 of file libsheepy.c.

◆ parseDouble()

double parseDouble ( const char *  string)

convert string to double

Parameters
string
Returns
double 0 when string represents 0 or doesnt represent a number or the input is NULL

Definition at line 10914 of file libsheepy.c.

Here is the caller graph for this function:

◆ parseDoubleChar()

double parseDoubleChar ( char  c)

Definition at line 10927 of file libsheepy.c.

◆ parseHex()

uint64_t parseHex ( const char *  string)

parse hexadecimal number in a string

Parameters
stringhexadecimal string starting with 0x
Returns
integer value 0 failed or the value is 0

Definition at line 10944 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intToS()

char * intToS ( int64_t  n)

int To String

convert int to string

Parameters
int64number
Returns
string representing the number (you must free the pointer)

Definition at line 10970 of file libsheepy.c.

Here is the caller graph for this function:

◆ bIntToS()

char * bIntToS ( char *  s,
int64_t  n 
)

buffer int To String

convert int to string

Parameters
int64number
Returns
string representing the number

Definition at line 10989 of file libsheepy.c.

◆ doubleToS()

char * doubleToS ( double  n)

double To String

convert int to string

Parameters
doublenumber
Returns
string representing the number (you must free the pointer)

Definition at line 11008 of file libsheepy.c.

Here is the caller graph for this function:

◆ bDoubleToS()

char * bDoubleToS ( char *  s,
double  n 
)

buffer double To String

convert int to string

Parameters
doublenumber
Returns
string representing the number

Definition at line 11027 of file libsheepy.c.

◆ lenS()

size_t lenS ( const char *  string)

length string

return strlen when possible

Parameters
string
Returns
strlen value 0 when string is NULL

Definition at line 11047 of file libsheepy.c.

Here is the caller graph for this function:

◆ sizeS()

size_t sizeS ( const char *  string)

string buffer size

return strlen+1 when possible

Parameters
string
Returns
strlen+1 value 0 when string is NULL

Definition at line 11066 of file libsheepy.c.

◆ upperS()

char * upperS ( const char *  string)

upper case String duplicate string

Parameters
string
Returns
new upper case string (you must free the pointer)

Definition at line 11083 of file libsheepy.c.

◆ iUpperS()

char * iUpperS ( char **  string)

upper case String

Parameters
string
Returns
upper case string NULL error

Definition at line 11114 of file libsheepy.c.

◆ bUpperS()

char * bUpperS ( char *  string)

buffer upper case String

Parameters
string
Returns
upper case string NULL error

Definition at line 11139 of file libsheepy.c.

◆ lowerS()

char * lowerS ( const char *  string)

lower case String duplicate string

Parameters
string
Returns
new lower case string (you must free the pointer)

Definition at line 11164 of file libsheepy.c.

◆ iLowerS()

char * iLowerS ( char **  string)

lower case String

Parameters
string
Returns
lower case string NULL error

Definition at line 11195 of file libsheepy.c.

Here is the caller graph for this function:

◆ bLowerS()

char * bLowerS ( char *  string)

buffer lower case String

Parameters
string
Returns
lower case string NULL error

Definition at line 11220 of file libsheepy.c.

◆ trimS()

char * trimS ( const char *  string)

trim String duplicate string

Parameters
string
Returns
new string without leading or trailing spaces (you must free the pointer)

Definition at line 11245 of file libsheepy.c.

Here is the caller graph for this function:

◆ iTrimS()

char * iTrimS ( char **  string)

trim String

Parameters
string(this parameter is reallocated)
Returns
string without leading or trailing spaces NULL error

Definition at line 11292 of file libsheepy.c.

Here is the call graph for this function:

◆ bTrimS()

char * bTrimS ( char *  string)

buffer trim String

Parameters
string
Returns
string without leading or trailing spaces NULL error

Definition at line 11345 of file libsheepy.c.

Here is the call graph for this function:

◆ lTrimS()

char * lTrimS ( const char *  string)

left trim String duplicate string

Parameters
string
Returns
new string without leading spaces (you must free the pointer)

Definition at line 11397 of file libsheepy.c.

◆ iLTrimS()

char * iLTrimS ( char **  string)

left trim String

Parameters
string(this parameter is reallocated)
Returns
string without leading spaces (you must free the pointer) NULL error

Definition at line 11430 of file libsheepy.c.

Here is the call graph for this function:

◆ bLTrimS()

char * bLTrimS ( char *  string)

buffer left trim String

Parameters
string
Returns
string without leading spaces NULL error

Definition at line 11464 of file libsheepy.c.

◆ rTrimS()

char * rTrimS ( const char *  string)

right trim String duplicate string

Parameters
string
Returns
new string without trailing spaces (you must free the pointer)

Definition at line 11492 of file libsheepy.c.

◆ iRTrimS()

char * iRTrimS ( char **  string)

right trim String

Parameters
string
Returns
string without trailing spaces NULL error

Definition at line 11529 of file libsheepy.c.

◆ bRTrimS()

char * bRTrimS ( char *  string)

buffer right trim String

Parameters
string
Returns
string without trailing spaces NULL error

Definition at line 11559 of file libsheepy.c.

◆ uniqS()

char * uniqS ( const char *  string,
char  c 
)

uniq String duplicate string

remove successive repetitions of char c

Parameters
stringc character to remove
Returns
new string without successive repetitions of char c (you must free the pointer)

Definition at line 11592 of file libsheepy.c.

◆ iUniqS()

char * iUniqS ( char **  string,
char  c 
)

uniq String

remove successive repetitions of char c

Parameters
stringc character to remove
Returns
string without successive repetitions of char c NULL error

Definition at line 11638 of file libsheepy.c.

Here is the caller graph for this function:

◆ bUniqS()

char * bUniqS ( char *  string,
char  c 
)

buffer uniq String

remove successive repetitions of char c

Parameters
stringc character to remove
Returns
string without successive repetitions of char c NULL error

Definition at line 11682 of file libsheepy.c.

◆ icUniqS()

char * icUniqS ( const char *  string,
char  c 
)

ignore case uniq String duplicate string

remove successive repetitions of char c

Parameters
stringc character to remove
Returns
new string without successive repetitions of char c (you must free the pointer)

Definition at line 11726 of file libsheepy.c.

◆ iicUniqS()

char * iicUniqS ( char **  string,
char  c 
)

in place ignore case uniq String

remove successive repetitions of char c

Parameters
stringc character to remove
Returns
string without successive repetitions of char c NULL error

Definition at line 11774 of file libsheepy.c.

◆ bicUniqS()

char * bicUniqS ( char *  string,
char  c 
)

ignore case buffer uniq String

remove successive repetitions of char c

Parameters
stringc character to remove
Returns
string without successive repetitions of char c NULL error

Definition at line 11820 of file libsheepy.c.

◆ repeatS()

char * repeatS ( const char *  string,
size_t  count 
)

repeat string count times

Parameters
string
countnumber of times string is repeated
Returns
new string with string repeated count times (you must free the pointer) NULL when string is NULL

Definition at line 11865 of file libsheepy.c.

Here is the caller graph for this function:

◆ iRepeatS()

char * iRepeatS ( char **  string,
size_t  count 
)

repeat string count times

Parameters
string(this parameter is reallocated)
countnumber of times string is repeated
Returns
string with string repeated count times NULL when string is NULL

Definition at line 11908 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bRepeatS()

char * bRepeatS ( char *  dest,
const char *  string,
size_t  count 
)

repeat string count times

Parameters
destbuffer big enough to hold count times string
string
countnumber of times string is repeated
Returns
dest with string repeated count times NULL when dest or string are NULL

Definition at line 11956 of file libsheepy.c.

Here is the caller graph for this function:

◆ bLRepeatS()

char * bLRepeatS ( char *  dest,
size_t  destSize,
const char *  string,
size_t  count 
)

repeat string count times

Parameters
destbuffer big enough to hold count times string
destSizedest buffer size (sizeof(dest))
string
countnumber of times string is repeated
Returns
dest with string repeated count times NULL when dest or string are NULL

Definition at line 11996 of file libsheepy.c.

Here is the caller graph for this function:

◆ repeatCharS()

char * repeatCharS ( char  c,
size_t  count 
)

repeat char count times

Parameters
cchar to repeat
countnumber of times c is repeated
Returns
new string with c repeated count times (you must free the pointer)

Definition at line 12036 of file libsheepy.c.

Here is the call graph for this function:

◆ bRepeatCharS()

char * bRepeatCharS ( char *  dest,
char  c,
size_t  count 
)

repeat char count times

Parameters
destbuffer big enough to hold count times c
cchar to repeat
countnumber of times c is repeated
Returns
dest with c repeated count times NULL when dest is NULL

Definition at line 12055 of file libsheepy.c.

Here is the call graph for this function:

◆ bLRepeatCharS()

char * bLRepeatCharS ( char *  dest,
size_t  destSize,
char  c,
size_t  count 
)

repeat char count times

Parameters
destbuffer big enough to hold count times c
destSizedest buffer size (sizeof(dest))
cchar to repeat
countnumber of times c is repeated
Returns
dest with c repeated count times NULL when dest is NULL

Definition at line 12076 of file libsheepy.c.

Here is the call graph for this function:

◆ repeatLenS()

ssize_t repeatLenS ( const char *  string,
size_t  count 
)

length of string repeated count times

Parameters
string
countnumber of times string is repeated
Returns
length of string repeated count times -1 when string is NULL

Definition at line 12093 of file libsheepy.c.

◆ ellipsisStartS()

char * ellipsisStartS ( const char *  string,
size_t  targetLength,
const char *  ellipsisString 
)

ellipsis start string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the right and the pad is applied once
ellipsisStringThe string to pad the current string with.
Returns
new string of the specified length with the pad string applied from the start (you must free the pointer) NULL when string or ellipsisString are NULL

Definition at line 12126 of file libsheepy.c.

Here is the call graph for this function:

◆ iEllipsisStartS()

char * iEllipsisStartS ( char **  string,
size_t  targetLength,
const char *  ellipsisString 
)

ellipsis start string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string(this parameter is reallocated)
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the right and the pad is applied once
ellipsisStringThe string to pad the current string with.
Returns
updated string of the specified length with the pad string applied from the start NULL when string or ellipsisString are NULL

Definition at line 12172 of file libsheepy.c.

Here is the call graph for this function:

◆ bEllipsisStartS()

char * bEllipsisStartS ( char *  dest,
const char *  string,
size_t  targetLength,
const char *  ellipsisString 
)

ellipsis start string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the right and the pad is applied once
ellipsisStringThe string to pad the current string with.
Returns
string in dest of the specified length with the pad string applied from the start NULL when dest, string or ellipsisString are NULL

Definition at line 12217 of file libsheepy.c.

Here is the call graph for this function:

◆ bLEllipsisStartS()

char * bLEllipsisStartS ( char *  dest,
size_t  destSize,
const char *  string,
size_t  targetLength,
const char *  ellipsisString 
)

ellipsis start string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the right and the pad is applied once
ellipsisStringThe string to pad the current string with.
Returns
string in dest of the specified length with the pad string applied from the start NULL when dest, string or ellipsisString are NULL

Definition at line 12265 of file libsheepy.c.

Here is the call graph for this function:

◆ ellipsisStartCharS()

char * ellipsisStartCharS ( const char *  string,
size_t  targetLength,
char  ellipsisChar 
)

ellipsis start string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the right and the pad is applied once
ellipsisCharThe char to pad the current string with.
Returns
new string of the specified length with the pad string applied from the start (you must free the pointer) NULL when string or ellipsisString are NULL

Definition at line 12319 of file libsheepy.c.

Here is the call graph for this function:

◆ iEllipsisStartCharS()

char * iEllipsisStartCharS ( char **  string,
size_t  targetLength,
char  ellipsisChar 
)

ellipsis start string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string(this parameter is reallocated)
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the right and the pad is applied once
ellipsisCharThe char to pad the current string with.
Returns
updated string of the specified length with the pad string applied from the start NULL when string or ellipsisString are NULL

Definition at line 12366 of file libsheepy.c.

Here is the call graph for this function:

◆ bEllipsisStartCharS()

char * bEllipsisStartCharS ( char *  dest,
const char *  string,
size_t  targetLength,
char  ellipsisChar 
)

ellipsis start string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the right and the pad is applied once
ellipsisCharThe char to pad the current string with.
Returns
string in dest of the specified length with the pad string applied from the start NULL when dest, string or ellipsisString are NULL

Definition at line 12413 of file libsheepy.c.

Here is the call graph for this function:

◆ bLEllipsisStartCharS()

char * bLEllipsisStartCharS ( char *  dest,
size_t  destSize,
const char *  string,
size_t  targetLength,
char  ellipsisChar 
)

ellipsis start string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the right and the pad is applied once
ellipsisCharThe char to pad the current string with.
Returns
string in dest of the specified length with the pad string applied from the start NULL when dest, string or ellipsisString are NULL

Definition at line 12463 of file libsheepy.c.

Here is the call graph for this function:

◆ ellipsisLenS()

ssize_t ellipsisLenS ( const char *  string,
size_t  targetLength,
const char *  ellipsisString 
)

length of string after ellipsis

Parameters
string
Returns
length of string after ellipsis -1 when string is NULL

Definition at line 12511 of file libsheepy.c.

◆ ellipsisEndS()

char * ellipsisEndS ( const char *  string,
size_t  targetLength,
const char *  ellipsisString 
)

ellipsis end string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the left and the pad is applied once
ellipsisStringThe string to pad the current string with.
Returns
new string of the specified length with the pad string applied from the end (you must free the pointer) NULL when string or ellipsisString are NULL

Definition at line 12546 of file libsheepy.c.

Here is the call graph for this function:

◆ iEllipsisEndS()

char * iEllipsisEndS ( char **  string,
size_t  targetLength,
const char *  ellipsisString 
)

ellipsis end string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string(this parameter is reallocated)
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the left and the pad is applied once
ellipsisStringThe string to pad the current string with.
Returns
updated string of the specified length with the pad string applied from the end NULL when string or ellipsisString are NULL

Definition at line 12595 of file libsheepy.c.

Here is the call graph for this function:

◆ bEllipsisEndS()

char * bEllipsisEndS ( char *  dest,
const char *  string,
size_t  targetLength,
const char *  ellipsisString 
)

ellipsis end string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the left and the pad is applied once
ellipsisStringThe string to pad the current string with.
Returns
string in dest of the specified length with the pad string applied from the end NULL when dest, string or ellipsisString are NULL

Definition at line 12644 of file libsheepy.c.

Here is the call graph for this function:

◆ bLEllipsisEndS()

char * bLEllipsisEndS ( char *  dest,
size_t  destSize,
const char *  string,
size_t  targetLength,
const char *  ellipsisString 
)

ellipsis end string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the left and the pad is applied once
ellipsisStringThe string to pad the current string with.
Returns
string in dest of the specified length with the pad string applied from the end NULL when dest, string or ellipsisString are NULL

Definition at line 12699 of file libsheepy.c.

Here is the call graph for this function:

◆ ellipsisEndCharS()

char * ellipsisEndCharS ( const char *  string,
size_t  targetLength,
char  ellipsisChar 
)

ellipsis end string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the left and the pad is applied once
ellipsisCharThe char to pad the current string with.
Returns
new string of the specified length with the pad string applied from the end (you must free the pointer) NULL when string or ellipsisString are NULL

Definition at line 12757 of file libsheepy.c.

Here is the call graph for this function:

◆ iEllipsisEndCharS()

char * iEllipsisEndCharS ( char **  string,
size_t  targetLength,
char  ellipsisChar 
)

ellipsis end string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string(this parameter is reallocated)
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the left and the pad is applied once
ellipsisCharThe char to pad the current string with.
Returns
updated string of the specified length with the pad string applied from the end NULL when string or ellipsisString are NULL

Definition at line 12802 of file libsheepy.c.

Here is the call graph for this function:

◆ bEllipsisEndCharS()

char * bEllipsisEndCharS ( char *  dest,
const char *  string,
size_t  targetLength,
char  ellipsisChar 
)

ellipsis end string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the left and the pad is applied once
ellipsisCharThe char to pad the current string with.
Returns
string in dest of the specified length with the pad string applied from the end NULL when dest, string or ellipsisString are NULL

Definition at line 12847 of file libsheepy.c.

Here is the call graph for this function:

◆ bLEllipsisEndCharS()

char * bLEllipsisEndCharS ( char *  dest,
size_t  destSize,
const char *  string,
size_t  targetLength,
char  ellipsisChar 
)

ellipsis end string

This function pads the current string with a given string if current string is longer than target length If target length is more than current string's length, the current string is returned as is

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is truncated from the left and the pad is applied once
ellipsisStringThe string to pad the current string with.
Returns
string in dest of the specified length with the pad string applied from the end NULL when dest, string or ellipsisString are NULL

Definition at line 12898 of file libsheepy.c.

Here is the call graph for this function:

◆ padStartS()

char * padStartS ( const char *  string,
size_t  targetLength,
const char *  padString 
)

pad start string

This function pads the current string with a given string (repeated, if needed) until the resulting string reaches a given length. The padding is applied from the start (left) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is returned as is
padStringThe string to pad the current string with. If this string is too long to stay within the target length, it will be truncated from the right. The current string is returned as is when an empty string is supplied
Returns
new string of the specified length with the pad string applied from the start (you must free the pointer) NULL when string or padString are NULL

Definition at line 12955 of file libsheepy.c.

Here is the call graph for this function:

◆ iPadStartS()

char * iPadStartS ( char **  string,
size_t  targetLength,
const char *  padString 
)

pad start string

This function pads the current string with a given string (repeated, if needed) until the resulting string reaches a given length. The padding is applied from the start (left) of the current string

Parameters
string(this parameter is reallocated)
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is returned as is
padStringThe string to pad the current string with. If this string is too long to stay within the target length, it will be truncated from the right. The current string is returned as is when an empty string is supplied
Returns
updated string of the specified length with the pad string applied from the start NULL when string or padString are NULL

Definition at line 13009 of file libsheepy.c.

Here is the call graph for this function:

◆ bPadStartS()

char * bPadStartS ( char *  dest,
const char *  string,
size_t  targetLength,
const char *  padString 
)

pad start string

This function pads the current string with a given string (repeated, if needed) until the resulting string reaches a given length. The padding is applied from the start (left) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is returned as is
padStringThe string to pad the current string with. If this string is too long to stay within the target length, it will be truncated from the right. The current string is returned as is when an empty string is supplied
Returns
new string of the specified length with the pad string applied from the start NULL when dest, string or padString are NULL

Definition at line 13061 of file libsheepy.c.

Here is the call graph for this function:

◆ bLPadStartS()

char * bLPadStartS ( char *  dest,
size_t  destSize,
const char *  string,
size_t  targetLength,
const char *  padString 
)

pad start string

This function pads the current string with a given string (repeated, if needed) until the resulting string reaches a given length. The padding is applied from the start (left) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is returned as is
padStringThe string to pad the current string with. If this string is too long to stay within the target length, it will be truncated from the right. The current string is returned as is when an empty string is supplied
Returns
new string of the specified length with the pad string applied from the start NULL when dest, string or padString are NULL

Definition at line 13123 of file libsheepy.c.

Here is the call graph for this function:

◆ padStartCharS()

char * padStartCharS ( const char *  string,
size_t  targetLength,
char  padChar 
)

pad start string

This function pads the current string with a given character (repeated, if needed) until the resulting string reaches a given length. The padding is applied from the start (left) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is returned as is
padCharThe character to pad the current string with
Returns
new string of the specified length with the pad character applied from the start (you must free the pointer) NULL when string is NULL

Definition at line 13183 of file libsheepy.c.

Here is the call graph for this function:

◆ iPadStartCharS()

char * iPadStartCharS ( char **  string,
size_t  targetLength,
char  padChar 
)

pad start string

This function pads the current string with a given character (repeated, if needed) until the resulting string reaches a given length. The padding is applied from the start (left) of the current string

Parameters
string(this parameter is reallocated)
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is returned as is
padCharThe character to pad the current string with
Returns
new string of the specified length with the pad character applied from the start NULL when string is NULL

Definition at line 13231 of file libsheepy.c.

Here is the call graph for this function:

◆ bPadStartCharS()

char * bPadStartCharS ( char *  dest,
const char *  string,
size_t  targetLength,
char  padChar 
)

pad start string

This function pads the current string with a given character (repeated, if needed) until the resulting string reaches a given length. The padding is applied from the start (left) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is returned as is
padCharThe character to pad the current string with
Returns
new string of the specified length with the pad character applied from the start NULL when dest or string are NULL

Definition at line 13277 of file libsheepy.c.

Here is the call graph for this function:

◆ bLPadStartCharS()

char * bLPadStartCharS ( char *  dest,
size_t  destSize,
const char *  string,
size_t  targetLength,
char  padChar 
)

pad start string

This function pads the current string with a given character (repeated, if needed) until the resulting string reaches a given length. The padding is applied from the start (left) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is less than the current string's length, the current string is returned as is
padCharThe character to pad the current string with
Returns
new string of the specified length with the pad character applied from the start NULL when dest or string are NULL

Definition at line 13332 of file libsheepy.c.

Here is the call graph for this function:

◆ padStartLenS()

ssize_t padStartLenS ( const char *  string,
size_t  targetLength,
const char *  padString 
)

length of string after padStart

Parameters
string
Returns
length of string after padStart -1 when string is NULL

Definition at line 13378 of file libsheepy.c.

◆ padEndS()

char * padEndS ( const char *  string,
size_t  targetLength,
const char *  padString 
)

pad end string

This function pads the current string with a given string (repeated, if needed) until the resulting string reaches a given length. The padding is applied from the end (right) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is lower than the current string's length, the current string is returned as is
padStringThe string to pad the current string with. If this string is too long to stay within the target length, it will be truncated and the left-most part will be applied. The current string is returned as is when an empty string is supplied
Returns
new string of the specified length with the pad string applied at the end of the current string (you must free the pointer) NULL when string or padString are NULL

Definition at line 13417 of file libsheepy.c.

Here is the call graph for this function:

◆ iPadEndS()

char * iPadEndS ( char **  string,
size_t  targetLength,
const char *  padString 
)

pad end string

This function pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string

Parameters
string(this parameter is reallocated)
targetLengthThe length of the resulting string once the current string has been padded. If the value is lower than the current string's length, the current string will be returned as is
padStringThe string to pad the current string with. If this string is too long to stay within the target length, it will be truncated and the left-most part will be applied. The current string is returned as is when an empty string is supplied
Returns
updated string of the specified length with the pad string applied at the end of the current string NULL when string or padString are NULL

Definition at line 13473 of file libsheepy.c.

Here is the call graph for this function:

◆ bPadEndS()

char * bPadEndS ( char *  dest,
const char *  string,
size_t  targetLength,
const char *  padString 
)

pad end string

This function pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is lower than the current string's length, the current string will be returned as is
padStringThe string to pad the current string with. If this string is too long to stay within the target length, it will be truncated and the left-most part will be applied. The current string is returned as is when an empty string is supplied
Returns
new string of the specified length with the pad string applied at the end of the current string NULL when dest, string or padString are NULL

Definition at line 13527 of file libsheepy.c.

Here is the call graph for this function:

◆ bLPadEndS()

char * bLPadEndS ( char *  dest,
size_t  destSize,
const char *  string,
size_t  targetLength,
const char *  padString 
)

pad end string

This function pads the current string with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is lower than the current string's length, the current string will be returned as is
padStringThe string to pad the current string with. If this string is too long to stay within the target length, it will be truncated and the left-most part will be applied. The current string is returned as is when an empty string is supplied
Returns
new string of the specified length with the pad string applied at the end of the current string NULL when dest, string or padString are NULL

Definition at line 13589 of file libsheepy.c.

Here is the call graph for this function:

◆ padEndCharS()

char * padEndCharS ( const char *  string,
size_t  targetLength,
char  padChar 
)

pad end string

This function pads the current string with a given character (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is lower than the current string's length, the current string will be returned as is
padCharThe character to pad the current string with
Returns
new string of the specified length with the pad character applied at the end of the current string (you must free the pointer) NULL when string is NULL

Definition at line 13649 of file libsheepy.c.

Here is the call graph for this function:

◆ iPadEndCharS()

char * iPadEndCharS ( char **  string,
size_t  targetLength,
char  padChar 
)

pad end string

This function pads the current string with a given character (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string

Parameters
string(this parameter is reallocated)
targetLengthThe length of the resulting string once the current string has been padded. If the value is lower than the current string's length, the current string will be returned as is
padCharThe character to pad the current string with
Returns
updated string of the specified length with the pad character applied at the end of the current string NULL when string is NULL

Definition at line 13697 of file libsheepy.c.

Here is the call graph for this function:

◆ bPadEndCharS()

char * bPadEndCharS ( char *  dest,
const char *  string,
size_t  targetLength,
char  padChar 
)

pad end string

This function pads the current string with a given character (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is lower than the current string's length, the current string will be returned as is
padCharThe character to pad the current string with
Returns
new string of the specified length with the pad character applied at the end of the current string NULL when dest or string are NULL

Definition at line 13745 of file libsheepy.c.

Here is the call graph for this function:

◆ bLPadEndCharS()

char * bLPadEndCharS ( char *  dest,
size_t  destSize,
const char *  string,
size_t  targetLength,
char  padChar 
)

pad end string

This function pads the current string with a given character (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end (right) of the current string

Parameters
string
targetLengthThe length of the resulting string once the current string has been padded. If the value is lower than the current string's length, the current string will be returned as is
padCharThe string to pad the current string with
Returns
new string of the specified length with the pad character applied at the end of the current string NULL when dest, string or padString are NULL

Definition at line 13800 of file libsheepy.c.

Here is the call graph for this function:

◆ padEndLenS()

ssize_t padEndLenS ( const char *  string,
size_t  targetLength,
const char *  padString 
)

length of string after padEnd

Parameters
string
Returns
length of string after padEnd -1 when string is NULL

Definition at line 13847 of file libsheepy.c.

◆ getS()

char getS ( const char *  string,
int64_t  index 
)

get string

get char at python index

Definition at line 13872 of file libsheepy.c.

Here is the caller graph for this function:

◆ setS()

char * setS ( char *  string,
int64_t  index,
char  c 
)

set string

set char at python index

Definition at line 13898 of file libsheepy.c.

Here is the caller graph for this function:

◆ swapS()

char * swapS ( char *  string,
int64_t  index1,
int64_t  index2 
)

swap characters in string

Parameters
string
index1index of character to swap
index2index of second character to swap
Returns
new string with characters swapped at index1 and index2 (you must free this pointer) NULL when string is NULL or when index1 or index2 are outside the string

Definition at line 13933 of file libsheepy.c.

◆ iSwapS()

char * iSwapS ( char **  string,
int64_t  index1,
int64_t  index2 
)

swap characters in string

Parameters
string
index1index of character to swap
index2index of second character to swap
Returns
updated string with characters swapped at index1 and index2 (you must free this pointer) NULL when string is NULL or when index1 or index2 are outside the string

Definition at line 13986 of file libsheepy.c.

◆ bSwapS()

char * bSwapS ( char *  string,
int64_t  index1,
int64_t  index2 
)

swap characters in string

Parameters
string
index1index of character to swap
index2index of second character to swap
Returns
string with characters swapped at index1 and index2 NULL when string is NULL or when index1 or index2 are outside the string

Definition at line 14034 of file libsheepy.c.

◆ bLSwapS()

char * bLSwapS ( char *  string,
size_t  size,
int64_t  index1,
int64_t  index2 
)

swap characters in string

if string's length is more than size then size is the end of string and the indexes are computed relative to size

Parameters
string
sizestring buffer size
index1index of character to swap
index2index of second character to swap
Returns
string with characters swapped at index1 and index2 NULL when string is NULL or when index1 or index2 are outside the string

Definition at line 14087 of file libsheepy.c.

◆ sliceS()

char * sliceS ( const char *  string,
int64_t  start,
int64_t  end 
)

slice String return new string which is the string between start and end negative indexes are allowed

(copy substring from start to end)

Parameters
stringto slice start: start index, must be in the string end: end index, must be in the string after start
Returns
new sliced string (you must free the pointer) "" when start=end NULL when start and end are not set correctly

Definition at line 14148 of file libsheepy.c.

Here is the caller graph for this function:

◆ iSliceS()

char * iSliceS ( char **  string,
int64_t  start,
int64_t  end 
)

slice String return string which is the string between start and end negative indexes are allowed

Parameters
stringto slice (this parameter is reallocated) start: start index, must be in the string end: end index, must be in the string after start
Returns
sliced string (you must free the pointer) "" when start=end NULL unchanged string when start and end are not set correctly

Definition at line 14213 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bSliceS()

char * bSliceS ( char *  string,
int64_t  start,
int64_t  end 
)

buffer slice String return string which is the string between start and end negative indexes are allowed

Parameters
stringto slice start: start index, must be in the string end: end index, must be in the string after start
Returns
sliced string "" when start=end NULL unchanged string when start and end are not set correctly

Definition at line 14286 of file libsheepy.c.

◆ bLSliceS()

char * bLSliceS ( char *  string,
size_t  stringSize,
int64_t  start,
int64_t  end 
)

buffer size slice String return string which is the string between start and end negative indexes are allowed

Parameters
stringto slice
stringSizestring buffer size
startstart index, must be in the string
endend index, must be in the string after start
Returns
sliced string "" when start=end NULL unchanged string when start and end are not set correctly

Definition at line 14355 of file libsheepy.c.

◆ cropS()

char * cropS ( char *  string,
int64_t  start,
int64_t  end 
)

Crop String return a new string with characters from start and end in string and delete characters from start to end in the original string negative indexes are allowed.

Parameters
string
startindex, must be in the list
endindex, must be in the list
Returns
new sliced string (you must free the pointer with free) empty list when start=end unchanged when list is empty unchanged when list is NULL or when start and end are not set correctly NULL error

Definition at line 14430 of file libsheepy.c.

Here is the call graph for this function:

◆ iCropS()

char * iCropS ( char **  string,
int64_t  start,
int64_t  end 
)

Crop String return a new string with characters from start and end in string and delete characters from start to end in the original string negative indexes are allowed.

Parameters
string
startindex, must be in the list
endindex, must be in the list
Returns
new sliced string (you must free the pointer with free) empty list when start=end unchanged when list is empty unchanged when list is NULL or when start and end are not set correctly NULL error

Definition at line 14501 of file libsheepy.c.

Here is the call graph for this function:

◆ cropElemS()

char cropElemS ( char *  string,
int64_t  index 
)

Definition at line 14553 of file libsheepy.c.

Here is the caller graph for this function:

◆ iCropElemS()

char iCropElemS ( char **  string,
int64_t  index 
)

Definition at line 14583 of file libsheepy.c.

Here is the call graph for this function:

◆ insertS()

char * insertS ( const char *  string,
int64_t  index,
const char *  toInsert 
)

insert string in string at index

return new string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string
indexin string
toInsertstring
Returns
new string (you must free the pointer) NULL when string is NULL or invalid index

Definition at line 14609 of file libsheepy.c.

Here is the call graph for this function:

◆ insertNFreeS()

char * insertNFreeS ( const char *  string,
int64_t  index,
char *  toInsert 
)

insert string in string at index and free toInsert when successful

return new string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string
indexin string
toInsertstring
Returns
new string (you must free the pointer) NULL when string is NULL or invalid index

Definition at line 14678 of file libsheepy.c.

Here is the call graph for this function:

◆ iInsertS()

char * iInsertS ( char **  string,
int64_t  index,
const char *  toInsert 
)

insert string in string at index

return string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string(this parameter is reallocated)
indexin string
toInsertstring
Returns
modified string (you must free the pointer) NULL unchanged string when string is NULL or invalid index

Definition at line 14756 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iInsertNFreeS()

char * iInsertNFreeS ( char **  string,
int64_t  index,
char *  toInsert 
)

insert string in string at index and free toInsert

return string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string(this parameter is reallocated)
indexin string
toInsertstring
Returns
modified string (you must free the pointer) NULL unchanged string when string is NULL or invalid index

Definition at line 14835 of file libsheepy.c.

Here is the call graph for this function:

◆ bInsertS()

char * bInsertS ( char *  string,
int64_t  index,
const char *  toInsert 
)

buffer insert string in string at index

return string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string
indexin string
toInsertstring
Returns
modified string NULL unchanged string when string is NULL or invalid index

Definition at line 14917 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLInsertS()

char * bLInsertS ( char *  string,
size_t  stringSize,
int64_t  index,
const char *  toInsert 
)

buffer size insert string in string at index

return string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string
indexin string
toInsertstring
Returns
modified string NULL unchanged string when string is NULL or invalid index

Definition at line 14986 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ injectS()

char * injectS ( const char *  string,
int64_t  index,
char  toInject 
)

inject a char in string at index

return new string with toInject at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string
indexin string
toInjectchar
Returns
new string (you must free the pointer) NULL when string is NULL or invalid index

Definition at line 15061 of file libsheepy.c.

Here is the call graph for this function:

◆ iInjectS()

char * iInjectS ( char **  string,
int64_t  index,
char  toInject 
)

inject a char in string at index

return string with toInject at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string(this parameter is reallocated)
indexin string
toInjectchar
Returns
modified string (you must free the pointer) NULL unchanged string when string is NULL or invalid index

Definition at line 15131 of file libsheepy.c.

Here is the call graph for this function:

◆ bInjectS()

char * bInjectS ( char *  string,
int64_t  index,
char  toInject 
)

buffer inject a char in string at index

return string with toInject at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string
indexin string
toInjectchar
Returns
modified string NULL unchanged string when string is NULL or invalid index

Definition at line 15208 of file libsheepy.c.

Here is the call graph for this function:

◆ bLInjectS()

char * bLInjectS ( char *  string,
size_t  stringSize,
int64_t  index,
char  toInject 
)

buffer size inject a char in string at index

return string with toInject at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
string
indexin string
toInjectchar
Returns
modified string NULL unchanged string when string is NULL or invalid index

Definition at line 15274 of file libsheepy.c.

Here is the call graph for this function:

◆ delS()

char * delS ( const char *  string,
int64_t  start,
int64_t  end 
)

delete string

return new string without the string between start and end negative indexes are allowed

Parameters
stringto delete
startstart index, must be in the string
endend index, must be in the string after start
Returns
new sliced string (you must free the pointer) new identical string when start=end or when start and end are not set correctly NULL when input string is NULL or when malloc failed or when end is under start

Definition at line 15345 of file libsheepy.c.

◆ iDelS()

char * iDelS ( char **  string,
int64_t  start,
int64_t  end 
)

delete string

return string without the string between start and end negative indexes are allowed

Parameters
stringto delete (this parameter is reallocated)
startstart index, must be in the string
endend index, must be in the string after start
Returns
sliced string (you must free the pointer) unchanged string when start=end NULL when start and end are not set correctly or when input string is NULL or when malloc failed or when end is under start

Definition at line 15415 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bDelS()

char * bDelS ( char *  string,
int64_t  start,
int64_t  end 
)

buffer delete string

return string without the string between start and end negative indexes are allowed

Parameters
stringto delete
startstart index, must be in the string
endend index, must be in the string after start
Returns
sliced string unchanged string when start=end NULL when start and end are not set correctly or when input string is NULL or when malloc failed or when end is under start

Definition at line 15487 of file libsheepy.c.

◆ bLDelS()

char * bLDelS ( char *  string,
size_t  stringSize,
int64_t  start,
int64_t  end 
)

buffer size delete string

return string without the string between start and end negative indexes are allowed

Parameters
stringto delete
stringSizestring buffer size
startstart index, must be in the string
endend index, must be in the string after start
Returns
sliced string unchanged string when start=end NULL when start and end are not set correctly or when input string is NULL or when malloc failed or when end is under start

Definition at line 15553 of file libsheepy.c.

◆ delElemS()

char * delElemS ( const char *  string,
int64_t  index 
)

delete element/character string

return new string without the character at given index negative indexes are allowed

Parameters
stringto delete
indexmust be in the string, -1 is the last character in the string
Returns
new string (you must free the pointer) NULL when input string is NULL or when malloc failed

Definition at line 15617 of file libsheepy.c.

◆ iDelElemS()

char * iDelElemS ( char **  string,
int64_t  index 
)

delete element/character string

return string without the character at given index negative indexes are allowed

Parameters
stringto delete (this parameter is reallocated)
indexmust be in the string, -1 is the last character in the string
Returns
new string (you must free the pointer) NULL when input string is NULL or when malloc failed

Definition at line 15660 of file libsheepy.c.

Here is the call graph for this function:

◆ bDelElemS()

char * bDelElemS ( char *  string,
int64_t  index 
)

buffer delete element/character string

return string without the character at given index negative indexes are allowed

Parameters
stringto delete
indexmust be in the string, -1 is the last character in the string
Returns
string with one less character NULL when input string is NULL or when malloc failed

Definition at line 15707 of file libsheepy.c.

◆ bLDelElemS()

char * bLDelElemS ( char *  string,
size_t  stringSize,
int64_t  index 
)

buffer size delete element/character string

return string without the character at given index negative indexes are allowed

Parameters
stringto delete
stringSizestring buffer size
indexmust be in the string, -1 is the last character in the string
Returns
string with one less character NULL when input string is NULL or when malloc failed

Definition at line 15748 of file libsheepy.c.

◆ findS()

char * findS ( const char *  string,
const char *  needle 
)

find String

Parameters
string
needlestring to find
Returns
pointer to first occurence of needle in string NULL when needle is not found NULL when string or needle are NULL

Definition at line 15790 of file libsheepy.c.

Here is the caller graph for this function:

◆ findCharS()

char * findCharS ( const char *  string,
char  c 
)

Definition at line 15799 of file libsheepy.c.

Here is the caller graph for this function:

◆ indexOfS()

ssize_t indexOfS ( const char *  string,
const char *  needle 
)

indexOf String relative to start

Parameters
string
needlestring to find
Returns
index of first occurence of needle in string -1 when needle is not found -1 when string or needle are NULL

Definition at line 15821 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ indexOfCharS()

ssize_t indexOfCharS ( const char *  string,
char  c 
)

Definition at line 15830 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasS()

bool hasS ( const char *  string,
const char *  needle 
)

has String

Parameters
string
needlestring to find
Returns
true when needle is in string false when needle is not found false when string or needle are NULL

Definition at line 15851 of file libsheepy.c.

Here is the caller graph for this function:

◆ hasCharS()

bool hasCharS ( const char *  string,
char  c 
)

Definition at line 15864 of file libsheepy.c.

◆ icFindS()

char * icFindS ( const char *  string,
const char *  needle 
)

ignore case Find String

Parameters
string
needlestring to find
Returns
pointer to first occurence of needle in string NULL when needle is not found NULL when string or needle are NULL

Definition at line 15888 of file libsheepy.c.

Here is the caller graph for this function:

◆ icFindCharS()

char * icFindCharS ( const char *  string,
char  c 
)

Definition at line 15897 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icIndexOfS()

ssize_t icIndexOfS ( const char *  string,
const char *  needle 
)

ignore case indexOf String relative to start

Parameters
string
needlestring to find
Returns
index of first occurence of needle in string -1 when needle is not found -1 when string or needle are NULL

Definition at line 15925 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icIndexOfCharS()

ssize_t icIndexOfCharS ( const char *  string,
char  c 
)

Definition at line 15934 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icHasS()

bool icHasS ( const char *  string,
const char *  needle 
)

ignore case has String

Parameters
string
needlestring to find
Returns
true when needle is in string false when needle is not found false when string or needle are NULL

Definition at line 15955 of file libsheepy.c.

Here is the caller graph for this function:

◆ icHasCharS()

bool icHasCharS ( const char *  string,
char  c 
)

Definition at line 15968 of file libsheepy.c.

Here is the call graph for this function:

◆ tokS()

char * tokS ( char *  s,
const char *  delim,
char **  saveptr 
)

token in String

parse string into a sequence of tokens delimited by the ENTIRE DELIM string work like strtok_r from c stdlib (for strtok_r, when delim has multiple characters, each character is a delimiter)

on first call s is the string to parse, optionally initialize *saveptr to NULL on next calls, s should be NULL

Parameters
sstring to parse, the s string is modified
delimstring
Returns
token *saveptr is set to NULL when the last token is found

Definition at line 15996 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icTokS()

char * icTokS ( char *  s,
const char *  delim,
char **  saveptr 
)

ignore case token in String

parse string into a sequence of tokens delimited by the ENTIRE DELIM string work like strtok_r from c stdlib (for strtok_r, when delim has multiple characters, each character is a delimiter)

on first call s is the string to parse, optionally initialize *saveptr to NULL on next calls, s should be NULL

Parameters
sstring to parse, the s string is modified
delimstring
Returns
token *saveptr is set to NULL when the last token is found

Definition at line 16038 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lenUTF8()

size_t lenUTF8 ( const char *  s)

character length of UTF-8 string

string is not checked for validity

Definition at line 16076 of file libsheepy.c.

Here is the caller graph for this function:

◆ bLLenUTF8()

size_t bLLenUTF8 ( const char *  s,
size_t  maxSize 
)

buffer character length of UTF-8 string

string is not checked for validity

bLLenUTF8 checks at most maxSize bytes

Definition at line 16095 of file libsheepy.c.

Here is the caller graph for this function:

◆ isUTF8()

bool isUTF8 ( const char *  string)

is UTF-8 string

check if string is a valid UTF-8 string

Parameters
stringUTF-8 encoded string
Returns
true string is valid UTF-8 false string is invalid UTF-8

Definition at line 16124 of file libsheepy.c.

◆ bLIsUTF8()

bool bLIsUTF8 ( const char *  string,
size_t  stringSize 
)

buffer length is UTF-8 string

check if string is a valid UTF-8 string

Parameters
stringUTF-8 encoded string
Returns
true string is valid UTF-8 false string is invalid UTF-8

Definition at line 16178 of file libsheepy.c.

◆ isCodeUTF8()

bool isCodeUTF8 ( const char *  code)

is code point UTF8 encoded string

Check if a UTF8 code point is valid

This function checks only the first code point

Parameters
bytesstring, NUL-terminated or not, bytes can be a pointer inside a UTF8 encoded string
Returns
true bytes is a valid UTF-8 code point false bytes is invalid code point

Definition at line 16247 of file libsheepy.c.

Here is the caller graph for this function:

◆ nextUTF8()

const char * nextUTF8 ( const char *  utf8)

next UTF-8 code point

find the next UTF-8 code point in the string

the validity of the found UTF-8 code point is not checked

nextUTF8 gives wrong result when utf8 is not on the first byte of a code point use findNextUTF8 to find next code point when utf8 is not at the start of a code point

Parameters
utf8UTF-8 encoded string
Returns
pointer to next UTF-8 code point NULL when the end string is reached or utf8 is NULL

Definition at line 46037 of file libsheepy.c.

◆ bLNextUTF8()

const char * bLNextUTF8 ( const char *  string,
size_t  utf8Size,
const char *  utf8 
)

buffer length next UTF-8 code point

find the next UTF-8 code point in the string

the validity of the found UTF-8 code point is not checked

bLNextUTF8 gives wrong result when utf8 is not on the first byte of a code point use findNextUTF8 to find next code point when utf8 is not at the start of a code point

Parameters
stringstart of the UTF-8 encoded string
utf8pointer to a code point in string
utf8Sizestring buffer size (including NUL, strlen(string) +1 when the buffer is full)
Returns
pointer to next UTF-8 code point NULL when the end string is reached or utf8 is NULL or the start of the next code point is outside the string

Definition at line 46067 of file libsheepy.c.

◆ findNextUTF8()

const char * findNextUTF8 ( const char *  string,
size_t  utf8Size,
const char *  utf8 
)

find next UTF-8 code point even not at the start of a code point

find the next UTF-8 code point in the string

the validity of the found UTF-8 code point is not checked

Parameters
stringstart of the UTF-8 encoded string
utf8pointer in string
ut8Sizestring buffer size (including NUL, strlen(string) +1 when the buffer is full)
Returns
pointer to next UTF-8 code point NULL when the end string is reached or utf8 is NULL or the start of the next code point is outside the string

Definition at line 46099 of file libsheepy.c.

◆ prevUTF8()

const char * prevUTF8 ( const char *  utf8)

previous UTF-8 code point

find the previous UTF-8 code point in the string

the validity of the found UTF-8 code point is not checked

the behavior is undefined when utf8 is the start of the string, use instead findPrevUTF8 for safe handling

Parameters
utf8UTF-8 encoded string
Returns
pointer to previous UTF-8 code point NULL when utf8 is NULL

Definition at line 46132 of file libsheepy.c.

◆ bPrevUTF8()

const char * bPrevUTF8 ( const char *  string,
const char *  utf8 
)

buffer previous UTF-8 code point

find the previous UTF-8 code point in the string

the validity of the found UTF-8 code point is not checked

Parameters
stringUTF-8 encoded string
utf8pointer in UTF-8 encoded string
Returns
pointer to previous UTF-8 code point NULL when utf8 is NULL

Definition at line 46161 of file libsheepy.c.

Here is the call graph for this function:

◆ bPrevUTF8Tiny()

local const char * bPrevUTF8Tiny ( const char *  string,
const char *  utf8 
)

Definition at line 46170 of file libsheepy.c.

Here is the caller graph for this function:

◆ bPrevRWUTF8Tiny()

local char * bPrevRWUTF8Tiny ( const char *  string,
char *  utf8 
)

Definition at line 46182 of file libsheepy.c.

Here is the caller graph for this function:

◆ idx2PtrUTF8()

const char * idx2PtrUTF8 ( const char *  utf8,
int64_t  index 
)

index to pointer UTF8 encoded string

Converts character index to pointer in utf8

Parameters
utf8UTF8 encoded string
indexcharacter index in utf8, positive or negative. -1 is the last character in the string
Returns
pointer to character at index NULL when index is outside the string

Definition at line 46207 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ idx2PtrRWUTF8()

local char * idx2PtrRWUTF8 ( char *  utf8,
int64_t  index 
)

index to pointer UTF8 encoded string - read write utf8 string (char*)

Converts character index to pointer in utf8

Parameters
utf8UTF8 encoded string
indexcharacter index in utf8, positive or negative. -1 is the last character in the string
Returns
pointer to character at index NULL when index is outside the string

Definition at line 46263 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLIdx2PtrUTF8()

const char * bLIdx2PtrUTF8 ( const char *  utf8,
size_t  utf8Size,
int64_t  index 
)

Definition at line 46306 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ptr2IdxUTF8()

int64_t ptr2IdxUTF8 ( const char *  utf8,
const char *  pos 
)

pointer to code point index UTF8 encoded string

Converts pointer to character index

This function works when utf8 and pos point inside code points

Parameters
utf8pointer to a code point in a UTF8 encoded string
pospointer to a code point in a UTF8 encoded string
Returns
Number of code points from utf8 to pos, positive or negative When utf8 < pos, the result is positive When pos < utf8, the result is negative 0 failed or index 0

Definition at line 46371 of file libsheepy.c.

Here is the caller graph for this function:

◆ bPtr2IdxUTF8()

int64_t bPtr2IdxUTF8 ( const char *  start,
const char *  utf8,
const char *  pos 
)

buffer pointer to code point index UTF8 encoded string

Converts pointer to character index

Safe function for negative index

This function works when utf8 and pos point inside code points

Parameters
startstart of the UTF8 encoded string
utf8pointer to a code point in a UTF8 encoded string
pospointer to a code point in a UTF8 encoded string
Returns
Number of code points from utf8 to pos, positive or negative When utf8 < pos, the result is positive When pos < utf8, the result is negative 0 failed or index 0

Definition at line 46444 of file libsheepy.c.

◆ bLPtr2IdxUTF8()

int64_t bLPtr2IdxUTF8 ( const char *  utf8,
size_t  utf8Size,
const char *  pos 
)

buffer size pointer to code point index UTF8 encoded string

Converts pointer to character index

This function works when utf8 and pos point inside code points

Parameters
utf8pointer to a code point in a UTF8 encoded string
utf8Sizeutf8 buffer size including NUL
pospointer to a code point in a UTF8 encoded string
Returns
Number of code points from utf8 to pos, positive -1 failed

Definition at line 46505 of file libsheepy.c.

◆ bLPtr2NegIdxUTF8()

int64_t bLPtr2NegIdxUTF8 ( const char *  utf8,
size_t  utf8Size,
const char *  pos 
)

buffer size pointer to negative code point index UTF8 encoded string

Converts pointer to negative character index (from the end of the string)

This function works when utf8 and pos point inside code points

Parameters
utf8pointer to a code point in a UTF8 encoded string
utf8Sizeutf8 buffer size including NUL
pospointer to a code point in a UTF8 encoded string
Returns
Number of code points from utf8 end to pos, negative 0 failed

Definition at line 46556 of file libsheepy.c.

◆ makeValidUTF8()

char * makeValidUTF8 ( const char *  utf8)

make valid UTF-8 encoded string

copy utf8 to newly allocated buffer, the invalid code points are replaced with '?'

The result buffer size is the same as utf8 size

Parameters
utf8valid or invalid UTF-8 encoded string
Returns
new valid UTF-8 encoded string (you must free the pointer) NULL failed

Definition at line 46593 of file libsheepy.c.

Here is the call graph for this function:

◆ bMakeValidUTF8()

char * bMakeValidUTF8 ( char *  utf8)

buffer make valid UTF-8 encoded string

replace the invalid code points with '?' in utf8

Parameters
utf8valid or invalid UTF-8 encoded string
Returns
valid UTF-8 encoded string in utf8 buffer NULL failed

Definition at line 46635 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nMakeValidUTF8()

char * nMakeValidUTF8 ( const char *  utf8,
size_t  utf8Len 
)

length make valid UTF-8 encoded string

copy utf8 to newly allocated buffer, the invalid code points are replaced with '?'

The result buffer size is utf8Len+1

Parameters
utf8valid or invalid UTF-8 encoded string
utf8Lenutf8 length
Returns
new valid UTF-8 encoded string (you must free the pointer) NULL failed

Definition at line 46672 of file libsheepy.c.

Here is the call graph for this function:

◆ bNMakeValidUTF8()

char * bNMakeValidUTF8 ( char *  dst,
const char *  utf8,
size_t  utf8Len 
)

buffer length make valid UTF-8 encoded string

copy utf8 to the dst buffer, the invalid code points are replaced with '?'

The result buffer size is utf8Len+1

Parameters
utf8valid or invalid UTF-8 encoded string
utf8Lenutf8 length
Returns
new valid UTF-8 encoded string NULL failed

Definition at line 46724 of file libsheepy.c.

Here is the call graph for this function:

◆ bLMakeValidUTF8()

char * bLMakeValidUTF8 ( char *  dst,
size_t  dstSize,
const char *  utf8 
)

buffer destination size make valid UTF-8 encoded string

copy utf8 to the dst buffer, the invalid code points are replaced with '?'

The result buffer size is dstSize

Parameters
dstdestination buffer
dstSizesize of dst
utf8valid or invalid UTF-8 encoded string
Returns
new valid UTF-8 encoded string NULL failed

Definition at line 46773 of file libsheepy.c.

Here is the call graph for this function:

◆ bLNMakeValidUTF8()

char * bLNMakeValidUTF8 ( char *  dst,
size_t  dstSize,
const char *  utf8,
size_t  utf8Len 
)

buffer destination size source length make valid UTF-8 encoded string

copy utf8 to the dst buffer, the invalid code points are replaced with '?'

This function always reads less than utf8Len+1 bytes in utf8 buffer The result buffer size is dstSize

Parameters
dstdestination buffer
dstSizesize of dst
utf8valid or invalid UTF-8 encoded string
utf8Lenutf8 length
Returns
new valid UTF-8 encoded string NULL failed

Definition at line 46825 of file libsheepy.c.

Here is the call graph for this function:

◆ strNCpyUTF8()

char * strNCpyUTF8 ( char *  dst,
const char *  src,
size_t  srcLen 
)

strNCpyUTF8 - copy src to dst with srcLen in code points

copy srcLen code points from src (UTF-8 encoded string) to dst and add one NUL character when src end is not reached (unlike strncpy).

Parameters
dstdestination buffer
srcsource string
srcLensource buffer size in code points
Returns
dst string NULL error

Definition at line 46875 of file libsheepy.c.

◆ strLCpyUTF8()

char * strLCpyUTF8 ( char *  dst,
size_t  dstSize,
const char *  src 
)

strLCpyUTF8 - copy src to dst

like strncpy and the NUL char is always added at the end of the string and the result string is always a valid UTF-8 encoded string

Parameters
dstdestination buffer
dstSizedestination buffer size, result string will be no longer than dstSize-1
srcsource string
Returns
dst string NULL error

Definition at line 46912 of file libsheepy.c.

Here is the call graph for this function:

◆ strNCatUTF8()

char * strNCatUTF8 ( char *  dst,
const char *  src,
size_t  srcLen 
)

strNCatUTF8 - concatenate two UTF-8 encoded strings

like strncat with sanity checks and srcLen is the number of code points

Parameters
dstdestination buffer
srcsource string
srcLenmax source len in code points
Returns
string with input strings concatenated NULL error

Definition at line 46941 of file libsheepy.c.

◆ strLCatUTF8()

char * strLCatUTF8 ( char *  dst,
size_t  dstSize,
const char *  src 
)

strLCatUTF8 - concatenate two UTF-8 encoded strings

like strlcat with sanity checks the result string is always a valid UTF-8 encoded string

Parameters
dstdestination buffer
srcsource string
dstSizedestination buffer size, result string will be no longer than dstSize-1
Returns
string with input strings concatenated NULL error

Definition at line 46978 of file libsheepy.c.

Here is the call graph for this function:

◆ strLNCatUTF8()

char * strLNCatUTF8 ( char *  dst,
size_t  dstSize,
const char *  src,
size_t  srcLen 
)

strLNCatUTF8 - concatenate two UTF-8 encoded strings

like strlcat with sanity checks and srcLen is the number of code points the result string is always a valid UTF-8 encoded string

Parameters
dstdestination buffer
srcsource string
dstSizedestination buffer size, result string will be no longer than dstSize-1
srcLenmax source len in code points
Returns
string with input strings concatenated NULL error

Definition at line 47023 of file libsheepy.c.

Here is the call graph for this function:

◆ icReplaceUTF8()

char * icReplaceUTF8 ( const char UNUSED s,
const char UNUSED olds,
const char UNUSED news,
size_t UNUSED  max 
)

ignore case Replace UTF8 encoded String the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sUTF8 encoded string olds: old UTF8 encoded string to be replaced in s news: new UTF8 encoded string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
new string (you must free the pointer) "" when s is empty NULL when s is NULL NULL when olds is empty

Definition at line 47080 of file libsheepy.c.

◆ icReplaceCharSUTF8()

char * icReplaceCharSUTF8 ( const char *s  UNUSED,
char olds  UNUSED,
const char *news  UNUSED,
size_t max  UNUSED 
)

Definition at line 47087 of file libsheepy.c.

◆ icReplaceSCharUTF8()

char * icReplaceSCharUTF8 ( const char *s  UNUSED,
const char *olds  UNUSED,
char news  UNUSED,
size_t max  UNUSED 
)

Definition at line 47094 of file libsheepy.c.

◆ iicReplaceUTF8()

char * iicReplaceUTF8 ( char UNUSED **  s,
const char UNUSED olds,
const char UNUSED news,
size_t UNUSED  max 
)

in place ignore case replace UTF8 encoded String the olds UTF8 encoded string is replaced with the news UTF8 encoded string max times in the result 0 for max means replace all olds strings

Parameters
sUTF8 encoded string olds: old UTF8 encoded string to be replaced in s news: new UTF8 encoded string replacing olds in s max: number of times to replace olds, 0 to replace all found olds
Returns
modified s string NULL s not modified when s is NULL or empty and when olds is empty

Definition at line 47116 of file libsheepy.c.

◆ iicReplaceCharSUTF8()

char * iicReplaceCharSUTF8 ( char **s  UNUSED,
char olds  UNUSED,
const char *news  UNUSED,
size_t max  UNUSED 
)

Definition at line 47123 of file libsheepy.c.

◆ iicReplaceSCharUTF8()

char * iicReplaceSCharUTF8 ( char **s  UNUSED,
const char *olds  UNUSED,
char news  UNUSED,
size_t max  UNUSED 
)

Definition at line 47130 of file libsheepy.c.

◆ bicReplaceUTF8()

char * bicReplaceUTF8 ( char UNUSED s,
const char UNUSED olds,
const char UNUSED news,
size_t UNUSED  max 
)

buffer ignore case replace UTF8 encoded String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring
oldsold string to be replaced in s
newsnew string replacing olds in s
maxnumber of times to replace olds, 0 to replace all found olds
Returns
modified s string NULL s not modified when s is NULL or empty and when olds is empty

Definition at line 47155 of file libsheepy.c.

◆ bLicReplaceUTF8()

char * bLicReplaceUTF8 ( char UNUSED s,
size_t UNUSED  sSize,
const char UNUSED olds,
const char UNUSED news,
size_t max  UNUSED 
)

buffer size ignore case replace UTF8 encoded String the olds string is replaced with the news string max times in the result 0 for max means replace all olds strings

Parameters
sstring
oldsold string to be replaced in s
newsnew string replacing olds in s
maxnumber of times to replace olds, 0 to replace all found olds
Returns
modified s string NULL s not modified when s is NULL or empty and when olds is empty

Definition at line 47180 of file libsheepy.c.

◆ icReplaceManyUTF8F()

char * icReplaceManyUTF8F ( const char *paramType  UNUSED,
  ... 
)

ignore case replace Many UTF8 encoded Strings the original remains unchanged duplicate s the olds string is replaced with the news string max times in the result

Example: r = replaceManyUTF8("asd", "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
sstring
oldsold string to be replaced in s
newsnew string replacing olds in s ...
Returns
new string "" when s is empty NULL when s is NULL NULL when only 2 parameters are given NULL when any olds is empty

Definition at line 47212 of file libsheepy.c.

◆ iicReplaceManyUTF8F()

char * iicReplaceManyUTF8F ( char **s  UNUSED,
char *paramType  UNUSED,
  ... 
)

in place ignore case replace Many UTF8 encoded Strings the olds string is replaced with the news string max times in the result

Example: iicReplaceManyUTF8(s, "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
string
oldsold string to be replaced in s
newsnew string replacing olds in s ...
Returns
modified string NULL not modified when s is empty, when s is NULL, when only 2 parameters are given, when any olds is empty

Definition at line 47239 of file libsheepy.c.

◆ bicReplaceManyUTF8F()

char * bicReplaceManyUTF8F ( char *s  UNUSED,
char *paramType  UNUSED,
  ... 
)

buffer ignore case replace Many UTF8 encoded Strings the olds string is replaced with the news string max times in the result

Example: bReplaceManyUTF8(s, "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
string
oldsold string to be replaced in s
newsnew string replacing olds in s ...
Returns
modified string NULL not modified when s is empty, when s is NULL, when only 2 parameters are given, when any olds is empty

Definition at line 47266 of file libsheepy.c.

◆ bLicReplaceManyUTF8F()

char * bLicReplaceManyUTF8F ( char *s  UNUSED,
size_t sSize  UNUSED,
char *paramType  UNUSED,
  ... 
)

buffer size ignore case replace Many UTF8 encoded Strings the olds string is replaced with the news string max times in the result

Example: bReplaceManyUTF8(s, "s", "BNM", "a", "AAA") ^olds ^news ^olds ^news

Parameters
string
oldsold string to be replaced in s
newsnew string replacing olds in s ...
Returns
modified string NULL not modified when s is empty, when s is NULL, when only 2 parameters are given, when any olds is empty

Definition at line 47293 of file libsheepy.c.

◆ eqIUTF8()

bool eqIUTF8 ( const char *  string1,
const char *  string2,
int64_t  index 
)

UTF8 encoded string Index Equal compare string1 at character index to string2 when string2 is empty, the result is false.

Parameters
2strings
Returns
true string1 at index is equal to string2 false they differ

Definition at line 47312 of file libsheepy.c.

Here is the call graph for this function:

◆ eqICharUTF8()

bool eqICharUTF8 ( const char *  string1,
char  c,
int64_t  index 
)

Definition at line 47322 of file libsheepy.c.

Here is the call graph for this function:

◆ icEqUTF8()

bool icEqUTF8 ( const char *  string1,
const char *  string2 
)

ignore case UTF8 encoded string Equal compare string1 to string2

Parameters
2strings
Returns
true the strings have identical content false they differ

Definition at line 47343 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icEqCharUTF8()

bool icEqCharUTF8 ( char  c,
const char *  string2 
)

Definition at line 47357 of file libsheepy.c.

Here is the call graph for this function:

◆ icEqUTF8Char()

bool icEqUTF8Char ( const char *  string1,
char  c 
)

Definition at line 47371 of file libsheepy.c.

Here is the call graph for this function:

◆ icEqIUTF8()

bool icEqIUTF8 ( const char *string1  UNUSED,
const char *string2  UNUSED,
int64_t index  UNUSED 
)

ignore case UTF8 encoded string Index Equal compare string1 at character index to string2 when string2 is empty, the result is false

Parameters
2strings
Returns
true string1 at index is equal to string2 false they differ

Definition at line 47396 of file libsheepy.c.

◆ icEqICharUTF8()

bool icEqICharUTF8 ( const char *string1  UNUSED,
char c  UNUSED,
int64_t index  UNUSED 
)

Definition at line 47402 of file libsheepy.c.

◆ icStartsWithUTF8()

bool icStartsWithUTF8 ( const char *  string1,
const char *  string2 
)

ignore case starts With UTF8 encoded String compare start of string1 with string2

Parameters
2strings
Returns
true when string1 starts with string2 false for other cases

Definition at line 47419 of file libsheepy.c.

Here is the call graph for this function:

◆ icEndsWithUTF8()

bool icEndsWithUTF8 ( const char *  string1,
const char *  string2 
)

ignore case ends With UTF8 encoded String compare end of string1 with string2

Parameters
2strings
Returns
true when string1 ends with string2 false for other cases

Definition at line 47444 of file libsheepy.c.

Here is the call graph for this function:

◆ icCountUTF8()

ssize_t icCountUTF8 ( const char *  s,
const char *  needle 
)

ignore case count UTF8 encoded String count number of (non-overlapping) occurrences of a substring

Example: assert(countUTF8("aaa aaa", "a") == 6); assert(countUTF8("aaa aaa", "ab") == 0); assert(countUTF8("aaa aaa", "aa") == 2);

Parameters
2strings
Returns
string count -1 when there is an error

Definition at line 47480 of file libsheepy.c.

Here is the call graph for this function:

◆ getLocaleType()

internal localeType getLocaleType ( void  )

some case convertions depend on the current LOCALE

Definition at line 47510 of file libsheepy.c.

Here is the caller graph for this function:

◆ code2RuneUTF8()

rune code2RuneUTF8 ( const char *  code)

UTF-8 code point to rune.

Parameters
codeUTF-8 code point
Returns
Rune 0 failed

Definition at line 47550 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ code2RuneLUTF8()

rune code2RuneLUTF8 ( const char *  code,
uint8_t *  n 
)

UTF-8 code point to rune and length.

the code point length is returned in *n

Parameters
codeUTF-8 code point
npointer to returned code point length
Returns
Rune 0 failed

Definition at line 47569 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bRune2CodeUTF8()

size_t bRune2CodeUTF8 ( char *  dst,
rune  c 
)

rune to UTF-8 code point

Parameters
dstdestination buffer at least 6 bytes or if NULL, the code point length is computed
cUNICODE rune
Returns
code point length and code point in dst when dst is NULL, return code point length only 0 bad rune, dst becomes an empty string

Definition at line 47635 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ runeLenUTF8()

uint8_t runeLenUTF8 ( rune  r)

rune length as UTF-8 code point

Parameters
rUNICODE rune
Returns
code point length 0 bad rune

Definition at line 47670 of file libsheepy.c.

Here is the caller graph for this function:

◆ decompose_hangul()

internal size_t decompose_hangul ( rune  s,
rune r 
)

Definition at line 47711 of file libsheepy.c.

Here is the caller graph for this function:

◆ find_decomposition()

internal const char * find_decomposition ( rune  ch)

Definition at line 47732 of file libsheepy.c.

Here is the caller graph for this function:

◆ runeFullyDecompose()

internal size_t runeFullyDecompose ( rune  ch,
rune result,
size_t  resultLen 
)

Definition at line 47763 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ output_marks()

internal size_t output_marks ( const char **  p_inout,
char *  dst,
bool  remove_dot 
)

Definition at line 47796 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ output_special_case()

internal size_t output_special_case ( char *  dst,
int  offset,
int  type,
int  which 
)

Definition at line 47821 of file libsheepy.c.

Here is the caller graph for this function:

◆ toupperUTF8()

rune toupperUTF8 ( rune  c)

rune toupper UTF8

Converts a character to uppercase.

Parameters
crune
Returns
c converted to uppercase c unchanged if c has no upper case or is not lowercase or titlecase

Definition at line 47854 of file libsheepy.c.

Here is the caller graph for this function:

◆ _upperUTF8()

internal size_t _upperUTF8 ( char *  dst,
const char *  utf8,
localeType  lcl 
)

Definition at line 47878 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ upperUTF8()

char * upperUTF8 ( const char *  utf8)

upper case UTF-8 encoded string duplicate string

Parameters
stringUTF-8 encoded string
Returns
new upper case string (you must free the pointer)

Definition at line 47975 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iUpperUTF8()

char * iUpperUTF8 ( char **  utf8)

upper case UTF-8 encoded string

Parameters
string(this parameter is reallocated)
Returns
upper case string (you must free the pointer) NULL error

Definition at line 48003 of file libsheepy.c.

Here is the call graph for this function:

◆ bUpperUTF8()

char * bUpperUTF8 ( char *utf8  UNUSED)

buffer upper case String

Parameters
string
Returns
upper case string NULL error

Definition at line 48026 of file libsheepy.c.

◆ runeCombiningClass()

local int runeCombiningClass ( rune  uc)

runeCombiningClass: : a Unicode character

Determines the canonical combining class of a Unicode character.

Returns: the combining class of the character

Definition at line 48040 of file libsheepy.c.

Here is the caller graph for this function:

◆ has_more_above()

internal bool has_more_above ( const char *  str)

Definition at line 48047 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tolowerUTF8()

rune tolowerUTF8 ( rune  c)

rune tolower UTF8

Converts a character to lower case.

Parameters
cUNICODE rune
Returns
lowercase c c unchanged if c has lowercase or is not an uppercase or titlecase character

Definition at line 48078 of file libsheepy.c.

Here is the caller graph for this function:

◆ _lowerUTF8()

internal size_t _lowerUTF8 ( char *  dst,
const char *  utf8,
localeType  lcl 
)

Definition at line 48103 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lowerUTF8()

char * lowerUTF8 ( const char *  utf8)

lower case UTF-8 String duplicate string

Parameters
string
Returns
new lower case string (you must free the pointer)

Definition at line 48228 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iLowerUTF8()

char * iLowerUTF8 ( char **  utf8)

lower case String

Parameters
string(this parameter is reallocated)
Returns
lower case string (you must free the pointer) NULL error

Definition at line 48256 of file libsheepy.c.

Here is the call graph for this function:

◆ bLowerUTF8()

char * bLowerUTF8 ( char *string  UNUSED)

buffer lower case String

Parameters
string
Returns
lower case string NULL error

Definition at line 48279 of file libsheepy.c.

◆ casefoldUTF8()

char * casefoldUTF8 ( const char *  utf8)

casefold UTF-8 encoded string

Parameters
utf8UTF-8 encoded string
Returns
new string (you must free the pointer) NULL when utf8 is NULL

Definition at line 48294 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uniqUTF8()

char * uniqUTF8 ( const char *  string,
const char *  code 
)

uniq UTF-8 String duplicate string

remove successive repetitions of UTF-8 code point code

Parameters
string
ccharacter to remove
Returns
new string without successive repetitions of char c (you must free the pointer)

Definition at line 48352 of file libsheepy.c.

Here is the call graph for this function:

◆ iUniqUTF8()

char * iUniqUTF8 ( char **  string,
const char *  code 
)

uniq UTF-8 String

remove successive repetitions of char c

Parameters
string
ccharacter to remove
Returns
string without successive repetitions of char c NULL error

Definition at line 48409 of file libsheepy.c.

Here is the call graph for this function:

◆ bUniqUTF8()

char * bUniqUTF8 ( char *  string,
const char *  code 
)

buffer uniq String

remove successive repetitions of char c

Parameters
string
ccharacter to remove
Returns
string without successive repetitions of char c NULL error

Definition at line 48463 of file libsheepy.c.

Here is the call graph for this function:

◆ icUniqUTF8()

char * icUniqUTF8 ( const char *string  UNUSED,
const char *code  UNUSED 
)

ignore case uniq String duplicate string

remove successive repetitions of char c

Parameters
string
ccharacter to remove
Returns
new string without successive repetitions of char c (you must free the pointer)

Definition at line 48516 of file libsheepy.c.

◆ iicUniqUTF8()

char * iicUniqUTF8 ( char **string  UNUSED,
const char *code  UNUSED 
)

in place ignore case uniq String

remove successive repetitions of char c

Parameters
string
ccharacter to remove
Returns
string without successive repetitions of char c NULL error

Definition at line 48535 of file libsheepy.c.

◆ bicUniqUTF8()

char * bicUniqUTF8 ( char *string  UNUSED,
char c  UNUSED 
)

ignore case buffer uniq String

remove successive repetitions of char c

Parameters
string
ccharacter to remove
Returns
string without successive repetitions of char c NULL error

Definition at line 48554 of file libsheepy.c.

◆ getUTF8()

rune getUTF8 ( const char *  string,
int64_t  index 
)

get UTF8 encoded string

get char at python index

Definition at line 48567 of file libsheepy.c.

Here is the call graph for this function:

◆ setUTF8()

char * setUTF8 ( char *  string,
int64_t  index,
rune  c 
)

set UTF8 encoded string

set char at python index

TODO this function might make the string invalid UTF8 check codeSizeUTF8 and adjust the buffer

Definition at line 48598 of file libsheepy.c.

Here is the call graph for this function:

◆ sliceUTF8()

char * sliceUTF8 ( const char *  string,
int64_t  start,
int64_t  end 
)

slice UTF8 encoded String return new string which is the string between start and end negative indexes are allowed

(copy substring from start to end)

Parameters
stringto slice
startstart character index, must be in the string
endend character index, must be in the string after start
Returns
new sliced string (you must free the pointer) "" when start=end NULL when start and end are not set correctly

Definition at line 48641 of file libsheepy.c.

Here is the call graph for this function:

◆ iSliceUTF8()

char * iSliceUTF8 ( char **  string,
int64_t  start,
int64_t  end 
)

slice UTF8 encoded String return string which is the string between start and end negative indexes are allowed

Parameters
stringto slice (this parameter is reallocated)
startstart character index, must be in the string
endend character index, must be in the string after start
Returns
sliced string (you must free the pointer) "" when start=end NULL unchanged string when start and end are not set correctly

Definition at line 48712 of file libsheepy.c.

Here is the call graph for this function:

◆ bSliceUTF8()

char * bSliceUTF8 ( char *  string,
int64_t  start,
int64_t  end 
)

buffer slice UTF8 encoded String return string which is the string between start and end negative indexes are allowed

Parameters
stringto slice
startstart index, must be in the string
endend index, must be in the string after start
Returns
sliced string "" when start=end NULL unchanged string when start and end are not set correctly

Definition at line 48791 of file libsheepy.c.

Here is the call graph for this function:

◆ bLSliceUTF8()

char * bLSliceUTF8 ( char *  string,
size_t  stringSize,
int64_t  start,
int64_t  end 
)

buffer size slice UTF8 encoded String return string which is the string between start and end negative indexes are allowed

Parameters
stringto slice
stringSizestring buffer size
startstart character index, must be in the string
endend character index, must be in the string after start
Returns
sliced string "" when start=end NULL unchanged string when start and end are not set correctly

Definition at line 48862 of file libsheepy.c.

Here is the call graph for this function:

◆ insertUTF8()

char * insertUTF8 ( const char *  string,
int64_t  index,
const char *  toInsert 
)

insert string in UTF8 encoded string at index

return new string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
stringUTF8 encoded string
indexcharacter index in string
toInsertUTF8 encoded string
Returns
new string (you must free the pointer) NULL when string is NULL or invalid index

Definition at line 48956 of file libsheepy.c.

Here is the call graph for this function:

◆ insertNFreeUTF8()

char * insertNFreeUTF8 ( const char *  string,
int64_t  index,
char *  toInsert 
)

insert string in UTF8 encoded string at index and free toInsert

return new string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
stringUTF8 encoded string
indexcharacter index in string
toInsertUTF8 encoded string
Returns
new string (you must free the pointer) NULL when string is NULL or invalid index

Definition at line 49029 of file libsheepy.c.

Here is the call graph for this function:

◆ iInsertUTF8()

char * iInsertUTF8 ( char **  string,
int64_t  index,
const char *  toInsert 
)

insert string in UTF8 encoded string at index

return string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
stringUTF8 encoded string (this parameter is reallocated)
indexcharacter index in string
toInsertUTF8 encoded string
Returns
modified string (you must free the pointer) NULL unchanged string when string is NULL or invalid index

Definition at line 49110 of file libsheepy.c.

Here is the call graph for this function:

◆ iInsertNFreeUTF8()

char * iInsertNFreeUTF8 ( char **  string,
int64_t  index,
char *  toInsert 
)

insert string in UTF8 encoded string at index and free toInsert

return string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
stringUTF8 encoded string (this parameter is reallocated)
indexcharacter index in string
toInsertUTF8 encoded string
Returns
modified string (you must free the pointer) NULL unchanged string when string is NULL or invalid index

Definition at line 49191 of file libsheepy.c.

Here is the call graph for this function:

◆ bInsertUTF8()

char * bInsertUTF8 ( char *  string,
int64_t  index,
const char *  toInsert 
)

buffer insert string in UTF8 encoded string at index

return string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
stringUTF8 encoded string
indexcharacter index in string
toInsertUTF8 encoded string
Returns
modified string NULL unchanged string when string is NULL or invalid index

Definition at line 49275 of file libsheepy.c.

Here is the call graph for this function:

◆ bLInsertUTF8()

char * bLInsertUTF8 ( char *  string,
size_t  stringSize,
int64_t  index,
const char *  toInsert 
)

buffer size insert string in UTF8 encoded string at index

return string with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
stringUTF8 encoded string
indexcharacter index in string
toInsertUTF8 encoded string
Returns
modified string NULL unchanged string when string is NULL or invalid index

Definition at line 49347 of file libsheepy.c.

Here is the call graph for this function:

◆ delUTF8()

char * delUTF8 ( const char *  string,
int64_t  start,
int64_t  end 
)

delete UTF8 encoded string

return new string without the string between start and end negative indexes are allowed

Parameters
stringto delete
startstart character index, must be in the string
endend character index, must be in the string after start
Returns
new sliced string (you must free the pointer) new identical string when start=end or when start and end are not set correctly NULL when input string is NULL or when malloc failed or when end is under start

Definition at line 49424 of file libsheepy.c.

Here is the call graph for this function:

◆ iDelUTF8()

char * iDelUTF8 ( char **  string,
int64_t  start,
int64_t  end 
)

delete UTF8 encoded string

return string without the string between start and end negative indexes are allowed

Parameters
stringto delete (this parameter is reallocated)
startstart character index, must be in the string
endend character index, must be in the string after start
Returns
sliced string (you must free the pointer) unchanged string when start=end NULL when start and end are not set correctly or when input string is NULL or when malloc failed or when end is under start

Definition at line 49499 of file libsheepy.c.

Here is the call graph for this function:

◆ bDelUTF8()

char * bDelUTF8 ( char *  string,
int64_t  start,
int64_t  end 
)

buffer delete UTF8 encoded string

return string without the string between start and end negative indexes are allowed

Parameters
stringto delete
startstart character index, must be in the string
endend character index, must be in the string after start
Returns
sliced string unchanged string when start=end NULL when start and end are not set correctly or when input string is NULL or when malloc failed or when end is under start

Definition at line 49576 of file libsheepy.c.

Here is the call graph for this function:

◆ bLDelUTF8()

char * bLDelUTF8 ( char *  string,
size_t  stringSize,
int64_t  start,
int64_t  end 
)

buffer size delete UTF8 encoded string

return string without the string between start and end negative indexes are allowed

Parameters
stringto delete
stringSizestring buffer size
startstart character index, must be in the string
endend character index, must be in the string after start
Returns
sliced string unchanged string when start=end NULL when start and end are not set correctly or when input string is NULL or when malloc failed or when end is under start

Definition at line 49647 of file libsheepy.c.

Here is the call graph for this function:

◆ indexOfUTF8()

ssize_t indexOfUTF8 ( const char *  string,
const char *  needle 
)

indexOf UTF8 encoded String relative to start

Parameters
string
needlestring to find
Returns
character index of first occurence of needle in string -1 when needle is not found -1 when string or needle are NULL

Definition at line 49726 of file libsheepy.c.

Here is the call graph for this function:

◆ icIndexOfUTF8()

ssize_t icIndexOfUTF8 ( const char *string  UNUSED,
const char *needle  UNUSED 
)

ignore case indexOf UTF8 encoded String relative to start

Parameters
string
needlestring to find
Returns
character index of first occurence of needle in string -1 when needle is not found -1 when string or needle are NULL

Definition at line 49749 of file libsheepy.c.

◆ icHasUTF8()

bool icHasUTF8 ( const char *  string,
const char *  needle 
)

ignore case has UTF8 encoded String

Parameters
string
needlestring to find
Returns
true when needle is in string false when needle is not found false when string or needle are NULL

Definition at line 49768 of file libsheepy.c.

Here is the call graph for this function:

◆ icTokUTF8()

char * icTokUTF8 ( const char *s  UNUSED,
const char *delim  UNUSED,
char **saveptr  UNUSED 
)

ignore case token in UTF8 encoded String

parse string into a sequence of tokens delimited by the ENTIRE DELIM string work like strtok_r from c stdlib (for strtok_r, when delim has multiple characters, each character is a delimiter)

on first call s is the string to parse, optionally initialize *saveptr to NULL on next calls, s should be NULL

Parameters
sstring to parse, the s string is modified
delimstring
Returns
token *saveptr is set to NULL when the last token is found

Definition at line 49804 of file libsheepy.c.

◆ icSplitUTF8()

char ** icSplitUTF8 ( const char *string  UNUSED,
const char *delim  UNUSED 
)

ignore case split UTF8 encoded string with delim string return list

Parameters
stringto split
delimdelimiter
Returns
list of tokens NULL when list or delim are NULL

Definition at line 49823 of file libsheepy.c.

◆ icExtractUTF8()

char ** icExtractUTF8 ( const char *string  UNUSED,
const char *delim1  UNUSED,
const char *delim2  UNUSED 
)

ignore case extract UTF8 encoded string between delim1 and delim2 strings return list

Parameters
stringto split
delim1first delimiter
delim2second delimiter, has to different from delim1
Returns
list of tokens NULL when list or delim are NULL

Definition at line 49843 of file libsheepy.c.

◆ icExtractCharSUTF8()

char ** icExtractCharSUTF8 ( const char *string  UNUSED,
char delim1  UNUSED,
const char *delim2  UNUSED 
)

Definition at line 49849 of file libsheepy.c.

◆ icExtractSCharUTF8()

char ** icExtractSCharUTF8 ( const char *string  UNUSED,
const char *delim1  UNUSED,
char delim2  UNUSED 
)

Definition at line 49855 of file libsheepy.c.

◆ icListSortUTF8Cmp()

internal int icListSortUTF8Cmp ( const void *  a,
const void *  b 
)

ignore case list Sort UTF-8 encoded String Compare function

in: a b out: test result

Definition at line 49871 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListSortUTF8()

char ** icListSortUTF8 ( char **  list)

ignore case list Sort UTF8 encoded String duplicate list and sort

Parameters
list
Returns
new sorted list (you must free the pointer with listFreeS) empty list when list is empty NULL when list is NULL

Definition at line 49903 of file libsheepy.c.

Here is the call graph for this function:

◆ iicListSortUTF8()

char ** iicListSortUTF8 ( char ***  list)

ignore case list Sort UTF8 encoded String

Parameters
list
Returns
sorted list empty list when list is empty unchanged list when list is NULL NULL error

Definition at line 49934 of file libsheepy.c.

Here is the call graph for this function:

◆ icListEqUTF8()

bool icListEqUTF8 ( char **  list1,
char **  list2 
)

ignore case list Equal UTF8 encoded String compare each element of list1 and list2

Parameters
2lists
Returns
true the lists have identical elements false they differ

Definition at line 49961 of file libsheepy.c.

Here is the call graph for this function:

◆ icListHasUTF8()

bool icListHasUTF8 ( char **  list,
const char *  string 
)

ignore case and return true when list has UTF8 encoded string

Parameters
list
string
Returns
true when list has string false when the string is not found false when list or string are NULL

Definition at line 49994 of file libsheepy.c.

Here is the call graph for this function:

◆ icListIndexOfUTF8()

ssize_t icListIndexOfUTF8 ( char **  list,
const char *  string 
)

ignore case and return index of UTF8 encoded string in list

Parameters
list
string
Returns
index -1 when the string is not found -1 when list or string are NULL

Definition at line 50018 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListBinarySearchUTF8()

ssize_t icListBinarySearchUTF8 ( char **  list,
const char *  string 
)

ignore case list binary search UTF8 encoded string

efficiently finds the index of string in list the list has be sorted with for example listSortS

Parameters
list
stringto search
Returns
index of string -1 string not found or NULL input pointers

Definition at line 50055 of file libsheepy.c.

Here is the call graph for this function:

◆ icListUniqUTF8()

char ** icListUniqUTF8 ( char **  list)

ignore case and uniquify UTF8 encoded elements of list duplicate list each elements are unique in the new list

Parameters
list
Returns
new list with unique elements (you must free the pointer with listFreeS) empty list when list is empty NULL when list is NULL

Definition at line 50098 of file libsheepy.c.

Here is the call graph for this function:

◆ iicListUniqUTF8()

char ** iicListUniqUTF8 ( char ***  list)

ignore case and uniquify UTF8 encoded elements of list each elements are unique in the list

Parameters
list
Returns
list with unique elements empty list when list is empty unchanged list when list is NULL NULL error

Definition at line 50139 of file libsheepy.c.

Here is the call graph for this function:

◆ emptySF()

char * emptySF ( void  )

empty String Function

Returns
new empty string (you must free the pointer)

Definition at line 50188 of file libsheepy.c.

Here is the caller graph for this function:

◆ iEmptySF()

char * iEmptySF ( char **  string)

empty String Function

when *string is NULL, it is freed

Returns
empty string (you must free the pointer) NULL nothing when string is NULL

Definition at line 50202 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isEmptyS()

bool isEmptyS ( const char *  string)

is Empty String

Parameters
string
Returns
false when there are characters in the string true when string is empty true when string is NULL

Definition at line 50226 of file libsheepy.c.

Here is the caller graph for this function:

◆ isBlankS()

bool isBlankS ( const char *  string)

is Blank String

Parameters
string
Returns
false when there are non white space characters in the string true when there are only white spaces in the string true when string is empty true when string is NULL

Definition at line 50246 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ intIndex()

ssize_t intIndex ( int64_t  index,
int64_t  length 
)

int to positive index index can be negative

Parameters
indexindex in list, must be inside the list
lengthlist length
Returns
positive index -1 when length is 0 or index is not set correctly

Definition at line 50275 of file libsheepy.c.

◆ listEmptySF()

char ** listEmptySF ( void  )

list Empty String Function

Returns
new empty list (you must free the pointer with listFreeS)

Definition at line 50305 of file libsheepy.c.

◆ iListEmptySF()

char ** iListEmptySF ( char ***  list)

list Empty String Function

Returns
empty list (you must free the pointer with listFreeS) NULL error

Definition at line 50322 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listIsEmptyS()

bool listIsEmptyS ( char **  list)

list Is Empty String

Parameters
list
Returns
false when there are elements in the list true when list is empty true when list is NULL

Definition at line 50351 of file libsheepy.c.

Here is the caller graph for this function:

◆ listIsBlankS()

bool listIsBlankS ( char **  list)

list Is Empty String

Parameters
list
Returns
false when there are non blank elements in the list true when all elements are blank true when list is NULL

Definition at line 50370 of file libsheepy.c.

Here is the call graph for this function:

◆ listCreateSF()

char ** listCreateSF ( const char *  paramType,
  ... 
)

list Create String Function create a list from the list of parameters used from the listCreateS(...) macro

Parameters
listof strings seperated with commas
Returns
list NULL when first element if NULL

Definition at line 50395 of file libsheepy.c.

Here is the call graph for this function:

◆ listFromArrayS()

char ** listFromArrayS ( char **  array,
size_t  size 
)

list From Array String

copy array of 'size' strings to a new list NULL strings are not copied to the list

Parameters
arrayof strings
size- number of strings in the array
Returns
list empty list when size is 0 NULL when array is NULL

Definition at line 50427 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listFromCArrayS()

char ** listFromCArrayS ( const char **  array,
size_t  size 
)

list From Const Array String

copy array of 'size' strings to a new list NULL strings are not copied to the list

Parameters
arrayof strings
size- number of strings in the array
Returns
list empty list when size is 0 NULL when array is NULL

Definition at line 50465 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listPushS()

char ** listPushS ( char ***  list,
const char *  s 
)

list Push String append s at the end of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, NULL is pushed at the end of the list

the list is reallocated to add extra space

Parameters
pointerto list - becomes NULL when realloc fails (this parameter is reallocated)
sstring to push
Returns
list success (you must free the pointer with listFreeS) NULL error

Definition at line 50504 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listPushCharS()

char ** listPushCharS ( char ***  list,
char  c 
)

Definition at line 50536 of file libsheepy.c.

Here is the call graph for this function:

◆ iListPushS()

char ** iListPushS ( char ***  list,
char *  s 
)

list Push String append s pointer at the end of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, NULL is pushed at the end of the list

the list is reallocated to add extra space

Parameters
pointerto list - becomes NULL when realloc fails (this parameter is reallocated)
sstring to push
Returns
list success NULL error

Definition at line 50559 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listPopS()

char * listPopS ( char ***  list)

list Pop String return last string from list and remove last element from the list

Parameters
pointerto list
Returns
duplicated last string (you must free the pointer) NULL when the list is NULL or empty (first element is NULL)

Definition at line 50602 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listPrependS()

char ** listPrependS ( char ***  list,
const char *  s 
)

list Prepend String append s at the beginning of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, the operation is canceled

the list is reallocated to add extra space

Parameters
pointerto list - becomes NULL when realloc fails (this parameter is reallocated)
sstring to prepend
Returns
list success (you must free the pointer with listFreeS) NULL error

Definition at line 50641 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listPrependCharS()

char ** listPrependCharS ( char ***  list,
char  c 
)

Definition at line 50677 of file libsheepy.c.

Here is the call graph for this function:

◆ iListPrependS()

char ** iListPrependS ( char ***  list,
char *  s 
)

list Prepend String append s pointer at the beginning of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, the operation is canceled

the list is reallocated to add extra space

Parameters
pointerto list - becomes NULL when realloc fails (this parameter is reallocated)
sstring to prepend
Returns
list success NULL error

Definition at line 50700 of file libsheepy.c.

Here is the call graph for this function:

◆ listDequeueS()

char * listDequeueS ( char ***  list)

list Dequeue String return first string from list and remove it from the list

Parameters
pointerto list
Returns
first string (you must free the pointer) NULL when the list is NULL or empty (first element is NULL)

Definition at line 50746 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listFreeS()

void listFreeS ( char **  list)

list Free String

Parameters
list
Returns
nothing

Definition at line 50780 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listFreeManySF()

void listFreeManySF ( char **  paramType,
  ... 
)

list free many String

free variable list of pointers listFreeManyS(l1, l2, ...);

Definition at line 50797 of file libsheepy.c.

Here is the call graph for this function:

◆ listLengthS()

size_t listLengthS ( char **  list)

list Length String return number of elements until the first NULL element

Parameters
list
Returns
number of element until first NULL element 0 when list is NULL

Definition at line 50820 of file libsheepy.c.

Here is the caller graph for this function:

◆ listLengthCS()

size_t listLengthCS ( const char **  list)

const list Length String return number of elements until the first NULL element

Parameters
list
Returns
number of element until first NULL element 0 when list is NULL

Definition at line 50843 of file libsheepy.c.

Here is the caller graph for this function:

◆ listStrLengthS()

ssize_t listStrLengthS ( char **  list)

list String Length String

Parameters
list
Returns
list length as a single string -1 when list is NULL

Definition at line 50865 of file libsheepy.c.

◆ listIntIndexS()

ssize_t listIntIndexS ( char **  list,
int64_t  index 
)

list int to index String index can be negative

Parameters
list
indexindex in list, must be inside the list
Returns
positive index -1 when list is NULL or index is not set correctly

Definition at line 50892 of file libsheepy.c.

Here is the call graph for this function:

◆ listAddrS()

char ** listAddrS ( char **  list,
int64_t  index 
)

list address String index can be negative

Parameters
list
indexindex in list, must be inside the list
Returns
pointer to char* at index NULL when list is NULL or index is not set correctly

Definition at line 50929 of file libsheepy.c.

Here is the call graph for this function:

◆ listGetS()

char * listGetS ( char **  list,
int64_t  index 
)

list Get String duplicate string at given index index can be negative

Parameters
list
indexindex in list, must be inside the list
Returns
duplicated string (you must free the pointer) NULL when list is NULL or index is not set correctly

Definition at line 50967 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListGetS()

char * iListGetS ( char **  list,
int64_t  index 
)

list Get String index can be negative

Parameters
list
indexindex in list, must be inside the list
Returns
string NULL when list is NULL or index is not set correctly

Definition at line 51001 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listGetCS()

char * listGetCS ( const char **  list,
int64_t  index 
)

const list Get String duplicate string at given index index can be negative

Parameters
list
indexindex in list, must be inside the list
Returns
duplicated string (you must free the pointer) NULL when list is NULL or index is not set correctly

Definition at line 51036 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListGetCS()

const char * iListGetCS ( const char **  list,
int64_t  index 
)

const list Get String index can be negative

Parameters
list
indexindex in list, must be inside the list
Returns
string NULL when list is NULL or index is not set correctly

Definition at line 51070 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listSetS()

char ** listSetS ( char **  list,
int64_t  index,
const char *  s 
)

list Set String duplicate string and store at given index, the existing element is freed index can be negative

Parameters
list
indexindex in list, must be inside the list
string
Returns
list success (you must free the pointer with listFreeS) NULL error

Does nothing when: when list is NULL, index is not set correctly or s is NULL

Definition at line 51110 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listSetCharS()

char ** listSetCharS ( char **  list,
int64_t  index,
char  c 
)

Definition at line 51134 of file libsheepy.c.

Here is the call graph for this function:

◆ iListSetS()

char ** iListSetS ( char **  list,
int64_t  index,
char *  s 
)

list Set String store string at given index index can be negative

Parameters
list
indexindex in list, must be inside the list
string
Returns
list success NULL error

Does nothing when: when list is NULL, index is not set correctly or s is NULL

Definition at line 51158 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listSwapS()

char ** listSwapS ( char **  list,
int64_t  index1,
int64_t  index2 
)

swap elements in list

Parameters
list
index1index of character to swap
index2index of second character to swap
Returns
new list with elements swapped at index1 and index2 (you must free this pointer) NULL when list is NULL or when index1 or index2 are outside the list

Definition at line 51195 of file libsheepy.c.

Here is the call graph for this function:

◆ iListSwapS()

char ** iListSwapS ( char **  list,
int64_t  index1,
int64_t  index2 
)

swap elements in list

Parameters
list
index1index of character to swap
index2index of second character to swap
Returns
updated list with characters swapped at index1 and index2 (you must free this pointer) NULL when list is NULL or when index1 or index2 are outside the list

Definition at line 51245 of file libsheepy.c.

Here is the call graph for this function:

◆ split()

char ** split ( const char *  string,
const char *  delim 
)

split string with delim string when updating this function, also update splitS (identical to split) return list

Parameters
stringto split
delimdelimiter
Returns
list of tokens (you must free the pointer with listFreeS) NULL when list or delim are NULL

Definition at line 51294 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splitS()

char ** splitS ( const char *  string,
const char *  delim 
)

Definition at line 51342 of file libsheepy.c.

Here is the call graph for this function:

◆ splitChar()

char ** splitChar ( const char *  string,
char  delim 
)

Definition at line 51388 of file libsheepy.c.

Here is the call graph for this function:

◆ icSplit()

char ** icSplit ( const char *  string,
const char *  delim 
)

ignore case split string with delim string when updating this function, also update icSplitS (identical to icSplit) return list

Parameters
stringto split
delimdelimiter
Returns
list of tokens (you must free the pointer with listFreeS) NULL when list or delim are NULL

Definition at line 51407 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icSplitS()

char ** icSplitS ( const char *  string,
const char *  delim 
)

Definition at line 51455 of file libsheepy.c.

Here is the call graph for this function:

◆ icSplitChar()

char ** icSplitChar ( const char *  string,
char  delim 
)

Definition at line 51501 of file libsheepy.c.

Here is the call graph for this function:

◆ joinLength()

ssize_t joinLength ( char **  list,
const char *  delim 
)

join Length list length after joined with delimiter

Parameters
list
delimstring seperator
Returns
list length as a single string -1 when list is NULL

Definition at line 51519 of file libsheepy.c.

◆ join()

char * join ( char **  list,
const char *  delim 
)

join list, the elements are seperated with delim in the resulting string when updating this function, also update joinS (identical to join)

Parameters
list
delimstring seperator
Returns
joined string (you must free the pointer) NULL when list or delim are NULL

Definition at line 51554 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ joinS()

char * joinS ( char **  list,
const char *  delim 
)

Definition at line 51589 of file libsheepy.c.

Here is the call graph for this function:

◆ joinCS()

char * joinCS ( const char **  list,
const char *  delim 
)

join list, the elements are seperated with delim in the resulting string

Parameters
list
delimstring seperator
Returns
joined string (you must free the pointer) NULL when list or delim are NULL

Definition at line 51633 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ joinChar()

char * joinChar ( char **  list,
char  delim 
)

Definition at line 51666 of file libsheepy.c.

Here is the call graph for this function:

◆ bJoin()

char * bJoin ( char *  string,
char **  list,
const char *  delim 
)

buffer join list, the elements are seperated with delim in the resulting string

Parameters
list
delimstring seperator
Returns
joined string NULL when list or delim are NULL

Definition at line 51683 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bJoinChar()

char * bJoinChar ( char *  string,
char **  list,
char  delim 
)

Definition at line 51703 of file libsheepy.c.

Here is the call graph for this function:

◆ bLJoin()

char * bLJoin ( char *  string,
size_t  stringSize,
char **  list,
const char *  delim 
)

buffer size join list, the elements are seperated with delim in the resulting string

Parameters
list
delimstring seperator
Returns
joined string NULL when list or delim are NULL

Definition at line 51720 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bLJoinChar()

char * bLJoinChar ( char *  string,
size_t  stringSize,
char **  list,
char  delim 
)

Definition at line 51745 of file libsheepy.c.

Here is the call graph for this function:

◆ extractS()

char ** extractS ( const char *  string,
const char *  delim1,
const char *  delim2 
)

extract string between delim1 and delim2 strings return list

Parameters
stringto split
delim1first delimiter
delim2second delimiter, has to be different from delim1
Returns
list of tokens (you must free the pointer with listFreeS) NULL when list or delim are NULL

Definition at line 51765 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ extractCharSS()

char ** extractCharSS ( const char *  string,
char  delim1,
const char *  delim2 
)

Definition at line 51805 of file libsheepy.c.

Here is the call graph for this function:

◆ extractSCharS()

char ** extractSCharS ( const char *  string,
const char *  delim1,
char  delim2 
)

Definition at line 51811 of file libsheepy.c.

Here is the call graph for this function:

◆ extractCharCharS()

char ** extractCharCharS ( const char *  string,
char  delim1,
char  delim2 
)

Definition at line 51817 of file libsheepy.c.

Here is the call graph for this function:

◆ icExtractS()

char ** icExtractS ( const char *  string,
const char *  delim1,
const char *  delim2 
)

ignore case extract string between delim1 and delim2 strings return list

Parameters
stringto split
delim1first delimiter
delim2second delimiter, has to different from delim1
Returns
list of tokens (you must free the pointer with listFreeS) NULL when list or delim are NULL

Definition at line 51838 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icExtractCharSS()

char ** icExtractCharSS ( const char *  string,
char  delim1,
const char *  delim2 
)

Definition at line 51878 of file libsheepy.c.

Here is the call graph for this function:

◆ icExtractSCharS()

char ** icExtractSCharS ( const char *  string,
const char *  delim1,
char  delim2 
)

Definition at line 51884 of file libsheepy.c.

Here is the call graph for this function:

◆ icExtractCharCharS()

char ** icExtractCharCharS ( const char *  string,
char  delim1,
char  delim2 
)

Definition at line 51890 of file libsheepy.c.

Here is the call graph for this function:

◆ listDupS()

char ** listDupS ( char **  list)

list Duplicate String

Parameters
list
Returns
duplicated list (you must free the pointer with listFreeS) NULL when list is NULL

Definition at line 51906 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listDupCS()

char ** listDupCS ( const char **  list)

const list Duplicate String

Parameters
list
Returns
duplicated list (you must free the pointer with listFreeS) NULL when list is NULL

Definition at line 51940 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListDupS()

char ** iListDupS ( char **  list)

list Duplicate String

copy pointers to new list After this function, free list with free instead of listFreeS

Note: this function creates a new list, so char *** is not needed. Unlike iList functions.

Parameters
list
Returns
new list pointing to the same string as list (you should free the pointer with free) NULL when list is NULL

Definition at line 51980 of file libsheepy.c.

Here is the call graph for this function:

◆ listReverseS()

char ** listReverseS ( char **  list)

list Reverse String duplicate and reverse list, the last element is the first element of the new list

Parameters
list
Returns
reversed list (you must free the pointer with listFreeS) NULL when list is NULL

Definition at line 52015 of file libsheepy.c.

Here is the call graph for this function:

◆ iListReverseS()

char ** iListReverseS ( char ***  list)

list Reverse String reverse list, the last element is the first element of the list

Parameters
list(this parameter is reallocated)
Returns
reversed list (you must free the pointer with listFreeS or free) nothing when list is NULL NULL error

Definition at line 52051 of file libsheepy.c.

Here is the call graph for this function:

◆ listCatSF()

char ** listCatSF ( char **  paramType,
  ... 
)

list Cat String

Parameters
arbitrarylist of lists seperated by commas
Returns
new list with input lists concatenated (you must free the pointer with listFreeS)

Definition at line 52086 of file libsheepy.c.

Here is the call graph for this function:

◆ listAppendS()

char ** listAppendS ( char ***  list1,
char **  list2 
)

list Append String Append list2 at the end of list1

list1 is reallocated to add extra space

Parameters
list1(this parameter is reallocated)
list2
Returns
list1 and list2 (you must free the pointer with listFreeS) list1 not modified when list1 and list2 are NULL NULL error

Definition at line 52116 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListAppendS()

char ** iListAppendS ( char ***  list1,
char **  list2 
)

in place list Append String Append list2 at the end of list1 by copying the pointers from list2 to list1.

After this function, free list2 with free instead of listFreeS

list1 is reallocated to add extra space

Parameters
list1(this parameter is reallocated)
list2
Returns
list1 and list2 (you must free the pointer with listFreeS or free) list1 not modified when list1 and list2 are NULL or when list1 is identical to list2 (same pointers) NULL error

Definition at line 52199 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListAppendNSmashS()

char ** iListAppendNSmashS ( char ***  list1,
char **  list2 
)

list Append and smash list2 Append list2 at the end of list1 by copying the pointers from list2 to list1.

list2 is freed (except when there is an error)

list1 is reallocated to add extra space

Parameters
list1(this parameter is reallocated)
list2
Returns
list1 and list2 (you must free the pointer with listFreeS or free) list1 not modified when list1 and list2 are NULL or when list1 is identical to list2 (same pointers) NULL error

Definition at line 52273 of file libsheepy.c.

Here is the call graph for this function:

◆ listShiftS()

char ** listShiftS ( char ***  list1,
char **  list2 
)

list Shift String Append list2 at the start of list1

list1 is reallocated to add extra space

Parameters
list1(this parameter is reallocated)
list2
Returns
list1 and list2 (you must free the pointer with listFreeS) list1 not modified when list1 and list2 are NULL NULL error

Definition at line 52298 of file libsheepy.c.

Here is the call graph for this function:

◆ iListShiftS()

char ** iListShiftS ( char ***  list1,
char **  list2 
)

in place list Shift String Append list2 at the start of list1 by copying the pointers from list2 to list1.

After this function, free list2 with free instead of listFreeS

list1 is reallocated to add extra space

Parameters
list1(this parameter is reallocated)
list2
Returns
list1 and list2 (you must free the pointer with listFreeS or free) list1 not modified when list1 and list2 are NULL or when list1 is identical to list2 (same pointers) NULL error

Definition at line 52330 of file libsheepy.c.

Here is the call graph for this function:

◆ iListShiftNSmashS()

char ** iListShiftNSmashS ( char ***  list1,
char **  list2 
)

list Append and smash list2 Append list2 at the start of list1 by copying the pointers from list2 to list1.

list2 is freed (except when there is an error)

list1 is reallocated to add extra space

Parameters
list1(this parameter is reallocated)
list2
Returns
list1 and list2 (you must free the pointer with listFreeS or free) list1 not modified when list1 and list2 are NULL or when list1 is identical to list2 (same pointers) NULL error

Definition at line 52354 of file libsheepy.c.

Here is the call graph for this function:

◆ listAddS()

char ** listAddS ( char **  list1,
char **  list2 
)

list Add String add list1 and list2 in a new list

Parameters
list1
list2
Returns
new list with list1 and list2 (you must free the pointer with listFreeS) NULL when list1 and list2 are NULL

Definition at line 52372 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listAddCS()

char ** listAddCS ( char **  list1,
const char **  list2 
)

const list Add String add list1 and list2 in a new list

Parameters
list1
list2
Returns
new list with list1 and list2 (you must free the pointer with listFreeS) NULL when list1 and list2 are NULL

Definition at line 52423 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listSliceS()

char ** listSliceS ( char **  list,
int64_t  start,
int64_t  end 
)

list Slice String return new list with elements from start and end in list negative indexes are allowed

Parameters
list
startindex, must be in the list
endindex, must be in the list
Returns
sliced list (you must free the pointer with listFreeS) empty list when start=end NULL when list is empty NULL when list is NULL or when start and end are not set correctly

Definition at line 52479 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListCopyS()

char ** iListCopyS ( char **  list,
int64_t  start,
int64_t  end 
)

list Copy String return new list with element pointers from start and end in list negative indexes are allowed

Note: this function creates a new list, so char *** is not needed. Unlike iList functions.

Parameters
list
startindex, must be in the list
endindex, must be in the list
Returns
new list pointing to the same string as list (you must free the pointer with free) empty list when start=end NULL when list is empty NULL when list is NULL or when start and end are not set correctly

Definition at line 52552 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListSliceS()

char ** iListSliceS ( char ***  list,
int64_t  start,
int64_t  end 
)

list Slice String return list with elements from start and end in list negative indexes are allowed

Parameters
list(this parameter is reallocated)
startindex, must be in the list
endindex, must be in the list
Returns
sliced list (you must free the pointer with listFreeS or free) empty list when start=end unchanged when list is empty unchanged when list is NULL or when start and end are not set correctly NULL error

Definition at line 52623 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listCropS()

char ** listCropS ( char **  list,
int64_t  start,
int64_t  end 
)

list Crop String return a new list with elements from start and end in list and delete elements from start to end in the original list negative indexes are allowed

iListCropS is faster than listSliceS+iListDelS because only the string pointers are copied to the sliced list

Parameters
list
startindex, must be in the list
endindex, must be in the list
Returns
new sliced list (you must free the pointer with listFreeS or free) empty list when start=end unchanged when list is empty unchanged when list is NULL or when start and end are not set correctly NULL error

Definition at line 52717 of file libsheepy.c.

Here is the call graph for this function:

◆ iListCropS()

char ** iListCropS ( char ***  list,
int64_t  start,
int64_t  end 
)

list Crop String return a new list with elements from start and end in list and delete elements from start to end in the original list negative indexes are allowed

iListCropS is faster than listSliceS+iListDelS because only the string pointers are copied to the sliced list

Parameters
list
startindex, must be in the list
endindex, must be in the list
Returns
new sliced list (you must free the pointer with listFreeS or free) empty list when start=end unchanged when list is empty unchanged when list is NULL or when start and end are not set correctly NULL error

Definition at line 52799 of file libsheepy.c.

Here is the call graph for this function:

◆ listCropElemS()

char * listCropElemS ( char **  list,
int64_t  index 
)

list Crop Element String return element at index and delete element at index in the original list negative indexes are allowed

iListCropS is faster than listSliceS+iListDelElemS because only the string pointer is returned directly

Parameters
list
indexmust be in the list
Returns
element at index (you must free the pointer with free) empty list when start=end unchanged when list is empty unchanged when list is NULL or when start and end are not set correctly NULL error

Definition at line 52879 of file libsheepy.c.

Here is the call graph for this function:

◆ iListCropElemS()

char * iListCropElemS ( char ***  list,
int64_t  index 
)

list Crop Element String return element at index and delete element at index in the original list negative indexes are allowed

iListCropS is faster than listSliceS+iListDelElemS because only the string pointer is returned directly

Parameters
list
indexmust be in the list
Returns
element at index (you must free the pointer with free) empty list when start=end unchanged when list is empty unchanged when list is NULL or when start and end are not set correctly NULL error

Definition at line 52933 of file libsheepy.c.

Here is the call graph for this function:

◆ listInsertS()

char ** listInsertS ( char **  list,
int64_t  index,
char **  toInsert 
)

list Insert string

insert list in list at index

return new list with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
list
indexin list
toInsertlist
Returns
new list (you must free the pointer with listFreeS) NULL when list is NULL or invalid index

Definition at line 52986 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListInsertS()

char ** iListInsertS ( char ***  list,
int64_t  index,
char **  toInsert 
)

list Insert string

insert list in list at index After this function, free toInsert with free instead of listFreeS

return list with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
list(this parameter is reallocated)
indexin list
toInsertlist
Returns
list (you must free the pointer with listFreeS or free) unchanged list when list is NULL or invalid index NULL error

Definition at line 53060 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListInsertNFreeS()

char ** iListInsertNFreeS ( char ***  list,
int64_t  index,
char **  toInsert 
)

list Insert string and free toInsert

insert list in list at index

return list with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
list(this parameter is reallocated)
indexin list
toInsertlist
Returns
list (you must free the pointer with listFreeS or free) unchanged list when list is NULL or invalid index NULL error

Definition at line 53161 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listInjectS()

char ** listInjectS ( char **  list,
int64_t  index,
char *  toInject 
)

list Inject string

Inject string in list at index

return new list with toInject at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
list
indexin list
toInjectstring
Returns
new list (you must free the pointer with listFreeS) NULL when list is NULL or invalid index

Definition at line 53254 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listInjectCharS()

char ** listInjectCharS ( char **  list,
int64_t  index,
char  toInject 
)

Definition at line 53313 of file libsheepy.c.

Here is the call graph for this function:

◆ iListInjectS()

char ** iListInjectS ( char ***  list,
int64_t  index,
char *  toInject 
)

list Inject string

Inject string pointer in list at index

return list with toInject at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
list(this parameter is reallocated)
indexin list
toInjectstring
Returns
list (you must free the pointer with listFreeS or free) unchanged list when list is NULL or invalid index NULL error

Definition at line 53339 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListInjectCharS()

char ** iListInjectCharS ( char ***  list,
int64_t  index,
char  toInject 
)

Definition at line 53403 of file libsheepy.c.

Here is the call graph for this function:

◆ listDelS()

char ** listDelS ( char **  list,
int64_t  start,
int64_t  end 
)

list Delete String return new list without elements from start and end in list negative indexes are allowed

Parameters
list
startindex, must be in the list
endindex, must be in the list
Returns
sliced list (you must free the pointer with listFreeS) list copy when start=end or when start and end are not set correctly NULL when list is empty NULL when list is NULL or when end is under start

Definition at line 53435 of file libsheepy.c.

Here is the call graph for this function:

◆ iListDelS()

char ** iListDelS ( char ***  list,
int64_t  start,
int64_t  end 
)

list Delete String return list without elements from start and end in list negative indexes are allowed

Parameters
list(this parameter is reallocated)
startindex, must be in the list
endindex, must be in the list
Returns
sliced list (you must free the pointer with listFreeS or free) list copy when start=end or when start and end are not set correctly NULL when list is empty NULL when list is NULL or when end is under start NULL error

Definition at line 53512 of file libsheepy.c.

Here is the call graph for this function:

◆ iListRemoveS()

char ** iListRemoveS ( char ***  list,
int64_t  start,
int64_t  end 
)

list Remove String return list without elements from start and end in list the elements are removed without being freed negative indexes are allowed

Parameters
list(this parameter is reallocated)
startindex, must be in the list
endindex, must be in the list
Returns
sliced list (you must free the pointer with listFreeS or free) list copy when start=end or when start and end are not set correctly NULL when list is empty NULL when list is NULL or when end is under start NULL error

Definition at line 53595 of file libsheepy.c.

Here is the call graph for this function:

◆ listDelElemS()

char ** listDelElemS ( char **  list,
int64_t  index 
)

list Delete Element String return new list without the element at index negative indexes are allowed

Parameters
list
indexmust be in the list
Returns
new list without the element at index (you must free the pointer with listFreeS) NULL when list is empty NULL when list is NULL

Definition at line 53670 of file libsheepy.c.

Here is the call graph for this function:

◆ iListDelElemS()

char ** iListDelElemS ( char ***  list,
int64_t  index 
)

list Delete Element String return list without the element at index negative indexes are allowed

Parameters
list(this parameter is reallocated)
indexmust be in the list
Returns
new list without the element at index (you must free the pointer with listFreeS) NULL when list is empty NULL when list is NULL NULL error

Definition at line 53725 of file libsheepy.c.

Here is the call graph for this function:

◆ iListRemoveElemS()

char ** iListRemoveElemS ( char ***  list,
int64_t  index 
)

list Remove Element String return list without the element at index the element is removed without being freed negative indexes are allowed

Parameters
list(this parameter is reallocated)
indexmust be in the list
Returns
new list without the element at index (you must free the pointer with listFreeS) NULL when list is empty NULL when list is NULL NULL error

Definition at line 53785 of file libsheepy.c.

Here is the call graph for this function:

◆ listPrintS()

int listPrintS ( char **  list)

print list elements to stdout

when list is NULL, returns directly without doing anything

Parameters
list
Returns
nothing 1 success 0 error

Definition at line 53841 of file libsheepy.c.

Here is the caller graph for this function:

◆ listPrintCS()

int listPrintCS ( const char **  list)

Definition at line 53852 of file libsheepy.c.

Here is the caller graph for this function:

◆ listSortSCmp()

internal int listSortSCmp ( const void *  a,
const void *  b 
)

list Sort String Compare function

in: a b out: test result

Definition at line 53872 of file libsheepy.c.

Here is the caller graph for this function:

◆ listSortS()

char ** listSortS ( char **  list)

list Sort String duplicate list and sort

Parameters
list
Returns
new sorted list (you must free the pointer with listFreeS) empty list when list is empty NULL when list is NULL

Definition at line 53898 of file libsheepy.c.

Here is the call graph for this function:

◆ iListSortS()

char ** iListSortS ( char ***  list)

list Sort String

Parameters
list
Returns
sorted list empty list when list is empty unchanged list when list is NULL NULL error

Definition at line 53928 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listSortFS()

char ** listSortFS ( char **  list,
shCmpt  compareFunction 
)

list Sort String duplicate list and sort

Parameters
listcompareFunction
Returns
new sorted list (you must free the pointer with listFreeS) empty list when list is empty NULL when list is NULL

Definition at line 53956 of file libsheepy.c.

Here is the call graph for this function:

◆ iListSortFS()

char ** iListSortFS ( char ***  list,
shCmpt  compareFunction 
)

list Sort String

Parameters
listcompareFunction
Returns
sorted list empty list when list is empty unchanged list when list is NULL NULL error

Definition at line 53987 of file libsheepy.c.

Here is the call graph for this function:

◆ icListSortSCmp()

internal int icListSortSCmp ( const void *  a,
const void *  b 
)

ignore case list Sort String Compare function

in: a b out: test result

Definition at line 54013 of file libsheepy.c.

Here is the caller graph for this function:

◆ icListSortS()

char ** icListSortS ( char **  list)

ignore case list Sort String duplicate list and sort

Parameters
list
Returns
new sorted list (you must free the pointer with listFreeS) empty list when list is empty NULL when list is NULL

Definition at line 54039 of file libsheepy.c.

Here is the call graph for this function:

◆ iicListSortS()

char ** iicListSortS ( char ***  list)

ignore case list Sort String

Parameters
list
Returns
sorted list empty list when list is empty unchanged list when list is NULL NULL error

Definition at line 54069 of file libsheepy.c.

Here is the call graph for this function:

◆ readText()

char ** readText ( const char *  filePath)

return text from filePath in a list new line characters are removed

Parameters
filePathfile path
Returns
lines in list (you must free the pointer with listFreeS) empty list when the file is empty NULL on failure

Definition at line 54122 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readStream()

char ** readStream ( FILE *  fp)

return text from stream fp in a list new line characters are removed

Parameters
fpfile stream
Returns
lines in list (you must free the pointer with listFreeS) empty list when there is no data in the stream NULL on failure

Definition at line 54187 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeText()

bool writeText ( const char *  filePath,
char **  list 
)

write list to filePath

Parameters
filePath
list
Returns
true success false failed, filePath or list are NULL

Definition at line 54230 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeCText()

bool writeCText ( const char *  filePath,
const char **  list 
)

write const list to filePath

Parameters
filePath
list
Returns
true success false failed, filePath or list are NULL

Definition at line 54267 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeStream()

bool writeStream ( FILE *  fp,
char **  list 
)

write list to stream

Parameters
fpfile stream
list
Returns
true success false failed, fp or list are NULL

Definition at line 54304 of file libsheepy.c.

Here is the caller graph for this function:

◆ writeCStream()

bool writeCStream ( FILE *  fp,
const char **  list 
)

write const list to stream

Parameters
fpfile stream
list
Returns
true success false failed, fp or list are NULL

Definition at line 54328 of file libsheepy.c.

Here is the caller graph for this function:

◆ appendText()

bool appendText ( const char *  filePath,
char **  list 
)

append list to filePath

Parameters
filePath
list
Returns
true success false failed, filePath or list are NULL

Definition at line 54352 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendCText()

bool appendCText ( const char *  filePath,
const char **  list 
)

append const list to filePath

Parameters
filePath
list
Returns
true success false failed, filePath or list are NULL

Definition at line 54389 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execOut()

char ** execOut ( const char *  cmd)

execute command return stdout from cmd

Parameters
cmdcommand
Returns
stdout from command in a list (you must free the pointer with listFreeS) empty list when command didnt produce any output NULL when cmd is NULL

Definition at line 54426 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ systemOutf()

char ** systemOutf ( const char *  fmt,
  ... 
)

execute system command with formatting

Parameters
formatting
Returns
stdout from command in a list (you must free the pointer with listFreeS) empty list when command didnt produce any output NULL when cmd is NULL

Definition at line 54458 of file libsheepy.c.

Here is the call graph for this function:

◆ systemf()

int systemf ( const char *  fmt,
  ... 
)

execute system command with formatting

Parameters
formatting
Returns
system return code

Definition at line 54484 of file libsheepy.c.

◆ commandF()

int commandF ( const char *  cmd,
int  line,
const char *  thisFunc,
const char *  thisFileName 
)

run command in default shell

Exit value equals to 127 is considered an error because if a shell could not be executed in the child process, then the return value from system() is 127 (man 3 system).

Parameters
cmdcommand string
Returns
command exit code -1 when cmd is NULL or system exited with errors

Definition at line 54514 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ commandfF()

int commandfF ( int  line,
const char *  thisFunc,
const char *  thisFileName,
const char *  fmt,
  ... 
)

run command with formatting in default shell

Exit value equals to 127 is considered an error because if a shell could not be executed in the child process, then the return value from system() is 127 (man 3 system).

Parameters
formatting
Returns
command exit code -1 when cmd is NULL or system exited with errors

Definition at line 54551 of file libsheepy.c.

Here is the call graph for this function:

◆ commandNFreeF()

int commandNFreeF ( char *  cmd,
int  line,
const char *  thisFunc,
const char *  thisFileName 
)

run command in default shell and free the cmd parameter

Exit value equals to 127 is considered an error because if a shell could not be executed in the child process, then the return value from system() is 127 (man 3 system).

Parameters
cmdcommand string
Returns
command exit code -1 when cmd is NULL or system exited with errors

Definition at line 54581 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listEqS()

bool listEqS ( char **  list1,
char **  list2 
)

list Equal String compare each element of list1 and list2

Parameters
2lists
Returns
true the lists have identical elements false they differ

Definition at line 54599 of file libsheepy.c.

Here is the call graph for this function:

◆ listEqCS()

bool listEqCS ( char **  list1,
const char **  list2 
)

const(list2) list Equal String compare each element of list1 and list2

Parameters
2lists
Returns
true the lists have identical elements false they differ

Definition at line 54629 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listEqC1S()

bool listEqC1S ( const char **  list1,
char **  list2 
)

const(list1) list Equal String compare each element of list1 and list2

Parameters
2lists
Returns
true the lists have identical elements false they differ

Definition at line 54659 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listEqCCS()

bool listEqCCS ( const char **  list1,
const char **  list2 
)

const(list1 and 2) list Equal String compare each element of list1 and list2

Parameters
2lists
Returns
true the lists have identical elements false they differ

Definition at line 54689 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listHasS()

bool listHasS ( char **  list,
const char *  string 
)

return true when list has string

Parameters
list
string
Returns
true when list has string false when the string is not found false when list or string are NULL

Definition at line 54721 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listHasCS()

bool listHasCS ( const char **  list,
const char *  string 
)

return true when const list has string

Parameters
list
string
Returns
true when list has string false when the string is not found false when list or string are NULL

Definition at line 54744 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listHasCharS()

bool listHasCharS ( char **  list,
char  c 
)

Definition at line 54755 of file libsheepy.c.

Here is the call graph for this function:

◆ listHasCharCS()

bool listHasCharCS ( const char **  list,
char  c 
)

Definition at line 54761 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listIndexOfS()

ssize_t listIndexOfS ( char **  list,
const char *  string 
)

return index of string in list

Parameters
list
string
Returns
index -1 when the string is not found -1 when list or string are NULL

Definition at line 54779 of file libsheepy.c.

Here is the caller graph for this function:

◆ listIndexOfCS()

ssize_t listIndexOfCS ( const char **  list,
const char *  string 
)

return index of string in const list

Parameters
list
string
Returns
index -1 when the string is not found -1 when list or string are NULL

Definition at line 54813 of file libsheepy.c.

Here is the caller graph for this function:

◆ listIndexOfCharS()

ssize_t listIndexOfCharS ( char **  list,
char  c 
)

Definition at line 54835 of file libsheepy.c.

Here is the call graph for this function:

◆ listIndexOfCharCS()

ssize_t listIndexOfCharCS ( const char **  list,
char  c 
)

Definition at line 54841 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listBinarySearchS()

ssize_t listBinarySearchS ( char **  list,
const char *  string 
)

list binary search string

efficiently finds the index of string in list the list has to be sorted with for example listSortS

Parameters
list
stringto search
Returns
index of string -1 string not found or NULL input pointers

Definition at line 54861 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listBinarySearchCharS()

ssize_t listBinarySearchCharS ( char **  list,
char  c 
)

Definition at line 54884 of file libsheepy.c.

Here is the call graph for this function:

◆ listUniqS()

char ** listUniqS ( char **  list)

Uniquify elements of list duplicate list each elements are unique in the new list.

Parameters
list
Returns
new list with unique elements (you must free the pointer with listFreeS) empty list when list is empty NULL when list is NULL

Definition at line 54902 of file libsheepy.c.

Here is the call graph for this function:

◆ iListUniqS()

char ** iListUniqS ( char ***  list)

Uniquify elements of list each elements are unique in the list.

Parameters
list(this parameter is reallocated)
Returns
list with unique elements (you must free the pointer with listFreeS) empty list when list is empty unchanged list when list is NULL NULL error

Definition at line 54942 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListEqS()

bool icListEqS ( char **  list1,
char **  list2 
)

ignore case list Equal String compare each element of list1 and list2

Parameters
2lists
Returns
true the lists have identical elements false they differ

Definition at line 54986 of file libsheepy.c.

Here is the call graph for this function:

◆ icListEqCS()

bool icListEqCS ( char **  list1,
const char **  list2 
)

ignore case const(list2) list Equal String compare each element of list1 and list2

Parameters
2lists
Returns
true the lists have identical elements false they differ

Definition at line 55016 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListEqC1S()

bool icListEqC1S ( const char **  list1,
char **  list2 
)

ignore case const(list1) list Equal String compare each element of list1 and list2

Parameters
2lists
Returns
true the lists have identical elements false they differ

Definition at line 55046 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListEqCCS()

bool icListEqCCS ( const char **  list1,
const char **  list2 
)

ignore case const(list1 and 2) list Equal String compare each element of list1 and list2

Parameters
2lists
Returns
true the lists have identical elements false they differ

Definition at line 55076 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListHasS()

bool icListHasS ( char **  list,
const char *  string 
)

ignore case and return true when list has string

Parameters
list
string
Returns
true when list has string false when the string is not found false when list or string are NULL

Definition at line 55108 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListHasCharS()

bool icListHasCharS ( char **  list,
char  c 
)

Definition at line 55119 of file libsheepy.c.

Here is the call graph for this function:

◆ icListHasCS()

bool icListHasCS ( const char **  list,
const char *  string 
)

ignore case and return true when const list has string

Parameters
list
string
Returns
true when list has string false when the string is not found false when list or string are NULL

Definition at line 55137 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListHasCharCS()

bool icListHasCharCS ( const char **  list,
char  c 
)

Definition at line 55148 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListIndexOfS()

ssize_t icListIndexOfS ( char **  list,
const char *  string 
)

ignore case and return index of string in list

Parameters
list
string
Returns
index -1 when the string is not found -1 when list or string are NULL

Definition at line 55166 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListIndexOfCS()

ssize_t icListIndexOfCS ( const char **  list,
const char *  string 
)

ignore case and return index of string in const list

Parameters
list
string
Returns
index -1 when the string is not found -1 when list or string are NULL

Definition at line 55200 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListIndexOfCharS()

ssize_t icListIndexOfCharS ( char **  list,
char  c 
)

Definition at line 55222 of file libsheepy.c.

Here is the call graph for this function:

◆ icListIndexOfCharCS()

ssize_t icListIndexOfCharCS ( const char **  list,
char  c 
)

Definition at line 55228 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListBinarySearchS()

ssize_t icListBinarySearchS ( char **  list,
const char *  string 
)

ignore case list binary search string

efficiently finds the index of string in list the list has be sorted with for example listSortS

Parameters
list
stringto search
Returns
index of string -1 string not found or NULL input pointers

Definition at line 55248 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ icListBinarySearchCharS()

ssize_t icListBinarySearchCharS ( char **  list,
char  c 
)

Definition at line 55271 of file libsheepy.c.

Here is the call graph for this function:

◆ icListUniqS()

char ** icListUniqS ( char **  list)

ignore case and uniquify elements of list duplicate list each elements are unique in the new list

Parameters
list
Returns
new list with unique elements (you must free the pointer with listFreeS) empty list when list is empty NULL when list is NULL

Definition at line 55289 of file libsheepy.c.

Here is the call graph for this function:

◆ iicListUniqS()

char ** iicListUniqS ( char ***  list)

ignore case and uniquify elements of list each elements are unique in the list

Parameters
list(this parameter is reallocated)
Returns
list with unique elements (you must free the pointer with listFreeS) empty list when list is empty unchanged list when list is NULL NULL error

Definition at line 55329 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listCompactS()

char ** listCompactS ( char **  list)

remove empty strings from list

Parameters
list
Returns
list without empty strings (you must free the pointer with listFreeS) empty list when list is empty NULL when list is NULL

Definition at line 55373 of file libsheepy.c.

Here is the call graph for this function:

◆ iListCompactS()

char ** iListCompactS ( char ***  list)

remove empty strings from list

Parameters
list(this parameter is reallocated)
Returns
list without empty strings (you must free the pointer with listFreeS) empty list when list is empty unchanged list when list is NULL NULL error

Definition at line 55407 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ btraceEnable()

void btraceEnable ( void  )

Definition at line 55441 of file libsheepy.c.

◆ btraceDisable()

void btraceDisable ( void  )

Definition at line 55446 of file libsheepy.c.

Here is the caller graph for this function:

◆ btraceConfig()

bool btraceConfig ( void  )

Definition at line 55451 of file libsheepy.c.

Here is the call graph for this function:

◆ listEmptyF()

void ** listEmptyF ( void  )

list Empty Function

Returns
new empty list (you must free the pointer with listFreeS)

Definition at line 55649 of file libsheepy.c.

◆ iListEmptyF()

void ** iListEmptyF ( void ***  list)

list Empty Function

Parameters
listlist to empty (this parameter is reallocated)
Returns
empty list (you must free the pointer with listFreeS) NULL error

Definition at line 55668 of file libsheepy.c.

Here is the call graph for this function:

◆ listIsEmpty()

bool listIsEmpty ( void **  list)

list Is Empty

Parameters
list
Returns
false when there are elements in the list true when list is empty true when list is NULL

Definition at line 55696 of file libsheepy.c.

Here is the caller graph for this function:

◆ listCreateF()

void ** listCreateF ( void *  paramType,
  ... 
)

list Create Function create a list from the list of parameters used from the listCreate(...) macro

Parameters
listof elements seperated with commas
Returns
list (you must free the pointer with listFreeS) NULL when first element if NULL

Definition at line 55716 of file libsheepy.c.

Here is the call graph for this function:

◆ listFromArray()

void ** listFromArray ( void **  array,
size_t  size 
)

list From Array

copy array of 'size' to a new list NULL elements are not copied to the list

Parameters
array
size- number of elements in the array
Returns
list (you must free the pointer with listFreeS) empty list when size is 0 NULL when array is NULL

Definition at line 55748 of file libsheepy.c.

Here is the call graph for this function:

◆ listPush()

void ** listPush ( void ***  list,
void *  s 
)

list Push

(like iListPushS)

append s pointer at the end of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, NULL is pushed at the end of the list

the list is reallocated to add extra space

Parameters
pointerto list - becomes NULL when realloc fails (this parameter is reallocated)
selement to push
Returns
list success (you must free the pointer) NULL error

Definition at line 55790 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listPop()

void * listPop ( void ***  list)

list Pop return last element from list and remove last element from the list

Parameters
pointerto list (this parameter is reallocated)
Returns
last element NULL when the list is NULL or empty (first element is NULL)

Definition at line 55832 of file libsheepy.c.

Here is the call graph for this function:

◆ listPrepend()

void ** listPrepend ( void ***  list,
void *  s 
)

list Prepend

(like iListPrependS)

append s pointer at the beginning of the list when list is NULL, a new list with one element is returned when list and s are NULL return list with 2 NULL elements when s is NULL, NULL is pushed at the end of the list

the list is reallocated to add extra space

Parameters
pointerto list - becomes NULL when realloc fails (this parameter is reallocated)
selement to prepend
Returns
list success (you must free the pointer) NULL error

Definition at line 55874 of file libsheepy.c.

Here is the call graph for this function:

◆ listDequeue()

void * listDequeue ( void ***  list)

list Dequeue return first element from list and remove last element from the list

Parameters
pointerto list
Returns
first element NULL when the list is NULL or empty (first element is NULL)

Definition at line 55920 of file libsheepy.c.

Here is the call graph for this function:

◆ listFree()

void listFree ( void **  list)

list Free

Parameters
list
Returns
nothing

Definition at line 55954 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listFreeManyF()

void listFreeManyF ( void **  paramType,
  ... 
)

list free many

free variable list of pointers listFreeManyS(l1, l2, ...);

Definition at line 55971 of file libsheepy.c.

Here is the call graph for this function:

◆ listLength()

size_t listLength ( void **  list)

list Length return number of elements until the first NULL element

Parameters
list
Returns
number of element until first NULL element 0 when list is NULL

Definition at line 55994 of file libsheepy.c.

Here is the caller graph for this function:

◆ listGet()

void * listGet ( void **  list,
int64_t  index 
)

list Get

(like iListGetS)

index can be negative

Parameters
list
indexindex in list, must be inside the list
Returns
element NULL when list is NULL or index is not set correctly

Definition at line 56022 of file libsheepy.c.

Here is the call graph for this function:

◆ listSet()

void ** listSet ( void **  list,
int64_t  index,
void *  s 
)

list Set

(like iListSetS)

store element at given index previous element at index has to be freed before hand index can be negative

Parameters
list
indexindex in list, must be inside the list
element
Returns
list success NULL error

Does nothing when: when list is NULL, index is not set correctly or s is NULL

Definition at line 56066 of file libsheepy.c.

Here is the call graph for this function:

◆ listDup()

void ** listDup ( void **  list)

list Duplicate

(like iListDupS)

copy pointers to new list After this function, free list with free instead of listFreeS

Note: this function creates a new list, so void *** is not needed. Unlike iList functions.

Parameters
list
Returns
new list pointing to the same elements as list (you must free the pointer) NULL when list is NULL

Definition at line 56110 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listReverse()

void ** listReverse ( void **  list)

list Reverse create index list and reverse list, the last element is the first element of the new list

Parameters
list
Returns
reversed list (you must free the pointer) NULL when list is NULL

Definition at line 56145 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListReverse()

void ** iListReverse ( void ***  list)

list Reverse reverse list, the last element is the first element of the list

Parameters
list(this parameter is reallocated)
Returns
reversed list (you must free the pointer) nothing when list is NULL NULL error

Definition at line 56182 of file libsheepy.c.

Here is the call graph for this function:

◆ listCatF()

void ** listCatF ( void **  paramType,
  ... 
)

list Cat

Parameters
arbitrarylist of lists seperated by commas
Returns
new list with input lists concatenated (you must free the pointer)

Definition at line 56203 of file libsheepy.c.

Here is the call graph for this function:

◆ listAppend()

void ** listAppend ( void ***  list1,
void **  list2 
)

list Append

(like iListAppendS)

Append list2 at the end of list1 by copying the pointers from list2 to list1. After this function, free list2 with free instead of listFreeS

list1 is reallocated to add extra space

Parameters
list1(this parameter is reallocated)
list2
Returns
list1 and list2 (you must free the pointer) list1 not modified when list1 and list2 are NULL or when list1 is identical to list2 (same pointers) NULL error

Definition at line 56240 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listAdd()

void ** listAdd ( void **  list1,
void **  list2 
)

list Add add list1 and list2 in a new list

Parameters
list1
list2
Returns
new list with list1 and list2 (you must free the pointer) NULL when list1 and list2 are NULL

Definition at line 56308 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ listSlice()

void ** listSlice ( void **  list,
int64_t  start,
int64_t  end 
)

list Slice

(like iListCopyS)

return new list with element pointers from start and end in list negative indexes are allowed

Note: this function creates a new list, so void *** is not needed. Unlike iList functions.

Parameters
list
startindex, must be in the list
endindex, must be in the list
Returns
new list pointing to the same elements as list (you must free the pointer) empty list when start=end NULL when list is empty NULL when list is NULL or when start and end are not set correctly

Definition at line 56370 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ iListSlice()

void ** iListSlice ( void ***  list,
int64_t  start,
int64_t  end 
)

list Slice return list with elements from start and end in list negative indexes are allowed

Parameters
list(this parameter is reallocated)
startindex, must be in the list
endindex, must be in the list
Returns
sliced list (you must free the pointer) empty list when start=end unchanged when list is empty unchanged when list is NULL or when start and end are not set correctly NULL error

Definition at line 56441 of file libsheepy.c.

Here is the call graph for this function:

◆ listInsert()

void ** listInsert ( void **  list,
int64_t  index,
void **  toInsert 
)

list Insert

insert list in list at index

return new list with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
list
indexin list
toInsertlist
Returns
new list (you must free the pointer) NULL when list is NULL or invalid index

Definition at line 56522 of file libsheepy.c.

Here is the call graph for this function:

◆ iListInsert()

void ** iListInsert ( void ***  list,
int64_t  index,
void **  toInsert 
)

list Insert

insert list in list at index After this function, free toInsert with free instead of listFreeS

return list with toInsert at index negative indexes are allowed index -1 is the end of the array and is equivalent to index len

Parameters
list(this parameter is reallocated)
indexin list
toInsertlist
Returns
list (you must free the pointer) unchanged list when list is NULL or invalid index NULL error

Definition at line 56602 of file libsheepy.c.

Here is the call graph for this function:

◆ listDel()

void ** listDel ( void **  list,
int64_t  start,
int64_t  end 
)

list Delete return new list without elements from start and end in list negative indexes are allowed

Parameters
list
startindex, must be in the list
endindex, must be in the list
Returns
sliced list (you must free the pointer) list copy when start=end or when start and end are not set correctly NULL when list is empty NULL when list is NULL or when end is under start

Definition at line 56684 of file libsheepy.c.

Here is the call graph for this function:

◆ iListDel()

void ** iListDel ( void ***  list,
int64_t  start,
int64_t  end 
)

list Delete return list without elements from start and end in list negative indexes are allowed

Parameters
list(this parameter is reallocated)
startindex, must be in the list
endindex, must be in the list
Returns
sliced list (you must free the pointer) list copy when start=end or when start and end are not set correctly NULL when list is empty NULL when list is NULL or when end is under start NULL error

Definition at line 56761 of file libsheepy.c.

Here is the call graph for this function:

◆ ringInit()

int ringInit ( void *  ring,
int  maxCount 
)

list Sort duplicate list and sort

Parameters
list
Returns
new sorted list empty list when list is empty NULL when list is NULL list Sort
Parameters
list
Returns
sorted list empty list when list is empty unchanged list when list is NULL list Equal compare each element of list1 and list2
Parameters
2lists
Returns
true the lists have identical elements false they differ return index of element in list
Parameters
listelement
Returns
index -1 when the element is not found -1 when list or element are NULL list binary search

efficiently finds the index of element in list the list has be sorted with for example listSortS

Parameters
listelement to search
Returns
index of element -1 element not found or NULL input pointers Uniquify elements of list duplicate list each elements are unique in the new list
Parameters
list
Returns
new list with unique elements empty list when list is empty NULL when list is NULL Uniquify elements of list each elements are unique in the list
Parameters
list
Returns
list with unique elements empty list when list is empty unchanged list when list is NULL remove empty element from list
Parameters
list
Returns
list without empty element empty list when list is empty NULL when list is NULL remove empty elements from list
Parameters
list
Returns
list without empty elements empty list when list is empty unchanged list when list is NULL initialize ring/pointer to staticArray sets count and head to 0 sets maxCount

the ring is empty after this function

a pointer to staticArray is also valid the array is empty after this function

Parameters
ringpointer to initialize
maxCountfor this ring type
Returns
1 success 0 error

Definition at line 57082 of file libsheepy.c.

◆ ringEmpty()

int ringEmpty ( void *  ring)

empty ring Allocated buffers in the list must be freed before running staticArrayEmpty

Returns
1 success 0 error

Definition at line 57104 of file libsheepy.c.

◆ ringIsEmpty()

int ringIsEmpty ( void *  ring)

1 when empty 0 not empty -1 error

Definition at line 57121 of file libsheepy.c.

Here is the caller graph for this function:

◆ ringIsFull()

int ringIsFull ( void *  ring)

1 when full 0 not full -1 error

Definition at line 57137 of file libsheepy.c.

Here is the caller graph for this function:

◆ ringCount()

ssize_t ringCount ( void *  ring)

return elements count

Returns
message count -1 error

Definition at line 57159 of file libsheepy.c.

◆ ringPush()

i64 ringPush ( void *  ring)

push element to ring (only increases last, use ringSend) use ringLast to access the element

Returns
position of the element -1 ring is full -2 error

Definition at line 57186 of file libsheepy.c.

Here is the call graph for this function:

◆ ringPop()

int ringPop ( void *  ring)

pop element from ring (only decreases last)

Returns
1 element is removed 0 ring is empty -1 error

Definition at line 57215 of file libsheepy.c.

Here is the call graph for this function:

◆ ringPrepend()

i64 ringPrepend ( void *  ring)

prepend element to ring (only decreases head) use ringFirst to access the element

Returns
position of the element -1 ring is full -2 error

Definition at line 57249 of file libsheepy.c.

Here is the call graph for this function:

◆ ringDequeue()

int ringDequeue ( void *  ring)

dequeue element from ring (only increases head, use ringRecv)

Returns
1 element is removed 0 ring is empty -1 error

Definition at line 57282 of file libsheepy.c.

Here is the call graph for this function:

◆ fiberAdd()

bool fiberAdd ( void *  ctx,
int  thisSlot,
fiberFT  func 
)

add new fiber

Parameters
ctxcontext for the fiber at thisSlot
thisSlotreserved slot for this fiber
funcfiber function
Returns
true

Definition at line 57321 of file libsheepy.c.

◆ fiberPrepend()

bool fiberPrepend ( void *  ctx,
int  thisSlot,
fiberFT  func 
)

add new fiber and start immediately after next yield

Parameters
ctxcontext for the fiber at thisSlot
thisSlotreserved slot for this fiber
funcfiber function
Returns
true

Definition at line 57344 of file libsheepy.c.

◆ scheduler()

void scheduler ( void  )

Schedule fibers.

fiber usage

Definition at line 57358 of file libsheepy.c.

Here is the call graph for this function:

◆ getMonotonicTime()

uint64_t getMonotonicTime ( void  )

end bitfield

Definition at line 57411 of file libsheepy.c.

Here is the caller graph for this function:

◆ nanoSleepF()

int nanoSleepF ( uint64_t  time)

nanosleep

sleep nanoseconds

Parameters
timein nanosceonds
Returns
1 ok 0 error

Definition at line 57427 of file libsheepy.c.

◆ initLibsheepyF()

void initLibsheepyF ( const char *  progPath,
initLibsheepyObjectP  initF 
)

initialize libsheepy (optional, for debug)

initialize segfault handler for crash debug the segfault handler prints the line and file where the segfault occured

initialize the fibers initialize libsheepyObject

Definition at line 1579 of file libsheepy.c.

◆ btrace()

char** btrace ( void  )

generate backtrace the program has to be linked the -rdynamic option for btrace to work btrace can backtrace 50 functions at most.

Returns
list of functions in the backtrace, the line format is: function name: source path:line number (you must free the pointer with listFreeS)

Definition at line 55472 of file libsheepy.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ TRUE

const bool TRUE = true

type bool true (glibc true is not bool), for use in generics

Definition at line 862 of file libsheepy.c.

◆ FALSE

const bool FALSE = false

type bool false (glibc true is not bool), for use in generics

Definition at line 864 of file libsheepy.c.

◆ btraceCfg

bool btraceCfg = true

backtrace in error messages is enabled by default

Definition at line 867 of file libsheepy.c.

◆ tryJumpBuffers

jmp_buf tryJumpBuffers[maxTryThrowCount]

setjmp buffers for try/throw,throwV macros

Definition at line 872 of file libsheepy.c.

◆ logMask

uint64_t logMask = 0xFFFFFFFFFFFFFFFF

variable to control which group logs to show, all logs are enabled by default (0xFFFFFFFFFFFFFFFF)

Definition at line 974 of file libsheepy.c.

◆ ch

uint16_t ch

Definition at line 19689 of file libsheepy.c.

◆ data

smallt * data = o->top->elements.data

Definition at line 19690 of file libsheepy.c.

◆ codeSzUTF8

const uint8_t codeSzUTF8[256] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1}

Definition at line 31675 of file libsheepy.c.

◆ fibers

fibersT fibers

fibers holds the necessary information to schedule fibers

data for fiber system

Definition at line 57307 of file libsheepy.c.