LAL  7.5.0.1-08ee4f4
LALString.c File Reference

Prototypes

int XLALStringPrint (char *s, size_t n, const char *fmt,...)
 Like snprintf but doesn't print format truncation warnings with GCC. More...
 
char * XLALStringAppend (char *s, const char *append)
 Like strcat but dynamically reallocates string with LALRealloc. More...
 
char * XLALStringAppendFmt (char *s, const char *fmt,...)
 Append the formatted string 'fmt' to the string 's', which is reallocated with XLALRealloc() to the required size. More...
 
char * XLALStringDuplicate (const char *s)
 Like strdup but uses LAL allocation routines (free with LALFree). More...
 
size_t XLALStringCopy (char *dst, const char *src, size_t size)
 Copy sources string src to destination string dst. More...
 
size_t XLALStringConcatenate (char *dst, const char *src, size_t size)
 Concatenate sources string src to the end of destination string dst. More...
 
int XLALStringToLowerCase (char *string)
 Turn a string in-place into lowercase without using locale-dependent functions. More...
 
int XLALStringToUpperCase (char *string)
 Turn a string in-place into uppercase without using locale-dependent functions. More...
 
int XLALStringCaseCompare (const char *s1, const char *s2)
 Compare two strings, ignoring case and without using locale-dependent functions. More...
 
int XLALStringNCaseCompare (const char *s1, const char *s2, size_t n)
 Compare the first N characters of two strings, ignoring case and without using locale-dependent functions. More...
 
char * XLALStringCaseSubstring (const char *haystack, const char *needle)
 Locates substring needle in string haystack, ignoring case and without using locale-dependent functions. More...
 
char * XLALStringToken (char **s, const char *delim, int empty)
 Return the next token delimited by any character in 'delim' from the string 's', which is updated to point just pass the returned token. More...
 
char * XLALStringTranslate (char *s, int(*f)(int, void *), void *param)
 Return the string 's' applying the function 'f(c, param)' to all characters 'c'. More...
 
static int strip_chars (int c, void *param)
 
char * XLALStringStripChars (char *s, int(*f)(int))
 Return the string 's' with all characters for which 'f()' is true removed. More...
 
static int keep_chars (int c, void *param)
 
char * XLALStringKeepChars (char *s, int(*f)(int))
 Return the string 's' with all characters for which 'f()' is false removed. More...
 
static int replace (int c, void *param)
 
char * XLALStringReplaceChar (char *s, const int from, const int to)
 Return the string 's' with all characters 'from' replaced with 'to'. More...
 

Go to the source code of this file.

Function Documentation

◆ XLALStringPrint()

int XLALStringPrint ( char *  s,
size_t  n,
const char *  fmt,
  ... 
)

Like snprintf but doesn't print format truncation warnings with GCC.

Definition at line 28 of file LALString.c.

◆ XLALStringAppendFmt()

char* XLALStringAppendFmt ( char *  s,
const char *  fmt,
  ... 
)

Append the formatted string 'fmt' to the string 's', which is reallocated with XLALRealloc() to the required size.

Definition at line 69 of file LALString.c.

◆ strip_chars()

static int strip_chars ( int  c,
void *  param 
)
static

Definition at line 345 of file LALString.c.

◆ keep_chars()

static int keep_chars ( int  c,
void *  param 
)
static

Definition at line 359 of file LALString.c.

◆ replace()

static int replace ( int  c,
void *  param 
)
static

Definition at line 373 of file LALString.c.