9 #ifndef __XTRA_STRING_H__
10 #define __XTRA_STRING_H__
15 #if defined(__APPLE__)
17 #elif defined(__linux__)
22 #define MAX_CHARSET_SIZE 256
29 char *
strdupl(
const char *str);
31 char *
strcov(
char *str,
const char *charset);
32 wchar_t * wcscov(
wchar_t *str,
const wchar_t *charset);
35 const char *
strset(
const char *
string,
const char *charset);
36 const wchar_t * wcsset(
const wchar_t *
string,
const wchar_t *charset);
39 char *
strpcat(
char *dest,
const char *src,
size_t pos);
40 wchar_t * wcspcat(
wchar_t *dest,
const wchar_t *src,
size_t pos);
42 char *
chrcat(
char *dest,
const char src);
43 wchar_t * wccat(
wchar_t *dest,
const wchar_t src);
45 int strchrn(
const char *
string,
char ch);
46 int wcswcn(
const wchar_t *
string,
wchar_t ch);
49 wchar_t *
wcsrev(
wchar_t *str);
50 char * strpre(
char *str,
char chr);
51 wchar_t *
wcspre(
wchar_t *str,
wchar_t chr);
52 char * strpres(
char *str,
char* pre);
53 wchar_t * wcspres(
wchar_t *str,
wchar_t *pre);
58 long hash(
const char* str);
New functions and types related to string and string manipulation.
wchar_t * wcsrev(wchar_t *str)
Reverses the wide character string.
Definition: string.c:196
int wcswcn(const wchar_t *string, wchar_t ch)
(Wide-char variant) Get number of times that ch appears in string.
Definition: string.c:311
char * strcov(char *str, const char *charset)
Checks if string covers all of charset.
Definition: string.c:32
char * strdupl(const char *str)
Implmentation of 'strdup'.
Definition: string.c:19
wchar_t * iswcsdigit(wchar_t *string)
Confirms that wcstring is entirely composed on numbers.
Definition: string.c:326
char * chrcat(char *dest, const char src)
Concatenate a char on to the end of a string.
Definition: string.c:166
int strchrn(const char *string, char ch)
Get number of times that ch appears in string.
Definition: string.c:295
const char * strset(const char *string, const char *charset)
Checks to see if string contains only characters in charset.
Definition: string.c:88
wchar_t * wcspre(wchar_t *str, wchar_t chr)
Prepends a character to a wide character string.
Definition: string.c:219
char * strpcat(char *dest, const char *src, size_t pos)
concatenate but at a give 'p' position.
Definition: string.c:134