29static void *G__memccpy(
void *,
const void *,
int,
size_t);
30static int _strncasecmp(
const char *,
const char *,
int);
49 return _strncasecmp(
x, y, -1);
71 return _strncasecmp(
x, y, n);
215 while (B !=
NULL && *B !=
'\0') {
275 char *buffer =
G_malloc(maxsize *
sizeof(
char));
276 char *end = buffer + maxsize;
278 memset(buffer, 0, maxsize);
281 p = (
char *)G__memccpy(buffer,
src_strings[i],
'\0', maxsize);
284 p = (
char *)G__memccpy(p - 1,
sep,
'\0', end - p);
286 p = (
char *)G__memccpy(p - 1,
src_strings[i],
'\0', end - p);
305 for (a =
b = buf; *a ==
' ' || *a ==
'\t'; a++)
308 while ((*
b++ = *a++))
311 for (a = buf; *a; a++)
314 for (a--; *a ==
' ' || *a ==
'\t'; a--)
334 char *f = line, *
t = line;
417 if (!(*c >=
'A' && *c <=
'Z') && !(*c >=
'a' && *c <=
'z') &&
418 !(*c >=
'0' && *c <=
'9')) {
426 if (!(*c >=
'A' && *c <=
'Z') && !(*c >=
'a' && *c <=
'z')) {
448 char *f = line, *
t = line;
463 if (*(line +
l) ==
'\n')
492 }
while (*q !=
'\0' &&
G_strncasecmp(p, q, length) != 0 && q++);
521static void *G__memccpy(
void *dst,
const void *src,
int c,
size_t n)
526 for (
ret = dst; n; ++
ret, ++s, --n) {
528 if ((
unsigned char)*
ret == (
unsigned char)c)
535static int _strncasecmp(
const char *x,
const char *y,
int n)
548 if (
xx >=
'A' &&
xx <=
'Z')
550 if (
yy >=
'A' &&
yy <=
'Z')
557 if (n > -1 && i >= n)
void G_free(void *)
Free allocated memory.
char * G_store_lower(const char *s)
Copy string to allocated memory and convert copied string to lower case.
int G_str_to_sql(char *str)
Make string SQL compliant.
int G_strncasecmp(const char *x, const char *y, int n)
String compare ignoring case (upper or lower) - limited number of characters.
char * G_str_replace(const char *buffer, const char *old_str, const char *new_str)
Replace all occurrences of old_str in buffer with new_str.
void G_str_to_upper(char *str)
Convert string to upper case.
void G_str_to_lower(char *str)
Convert string to lower case.
char * G_chop(char *line)
Chop leading and trailing white spaces.
char * G_strchg(char *bug, char character, char new)
Replace all occurrences of character in string bug with new.
char * G_strcasestr(const char *str, const char *substr)
Finds the first occurrence of the sub-string in the null-terminated string ignoring case (upper or lo...
int G_strcasecmp(const char *x, const char *y)
String compare ignoring case (upper or lower)
void G_squeeze(char *line)
Remove superfluous white space.
char * G_store(const char *s)
Copy string to allocated memory.
void G_strip(char *buf)
Removes all leading and trailing white space from string.
char * G_str_concat(const char **src_strings, int num_strings, const char *sep, int maxsize)
String concatenation.
char * G_store_upper(const char *s)
Copy string to allocated memory and convert copied string to upper case.