File: mystring.h

package info (click to toggle)
afterstep 2.2.12-18.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,184 kB
  • sloc: ansic: 201,695; sh: 5,894; xml: 3,721; makefile: 2,094; perl: 1,558; cpp: 811
file content (32 lines) | stat: -rw-r--r-- 809 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef MYSTRING_H_HEADER_INCLUDED
#define MYSTRING_H_HEADER_INCLUDED

#ifdef __cplusplus
extern "C" {
#endif

int mystrcasecmp (const char *s1, const char *s2);
int mystrncasecmp (const char *s1, const char *s2, size_t n);
int mystrcmp (const char *s1, const char *s2);

#ifndef mystrdup
char *mystrdup (const char *str);
#endif
#ifndef mystrndup
char *mystrndup (const char *str, size_t n);
#endif

/* using macro causes excessive compiler warnings. Stupid GCC 4 !!!!! */
/* #define destroy_string(ps) do{ if(ps && *(ps)){free(*(ps)); *(ps)=NULL;}}while(0) */

void destroy_string(char **ps);

/* use it to set string as well as flags and deallocate memory
   referred to by the pointer */
void set_string (char **target, char *string);

#ifdef __cplusplus
}
#endif

#endif /* MYSTRING_H_HEADER_INCLUDED */