]> git.sur5r.net Git - openldap/blob - include/ac/string.h
Remove extern declarations of library functions from source.c.
[openldap] / include / ac / string.h
1 /* Generic string.h */
2
3 #ifndef _AC_STRING_H
4 #define _AC_STRING_H
5
6 #ifdef STDC_HEADERS
7 #       include <string.h>
8 #else
9 #       ifdef HAVE_STRING_H
10 #               include <string.h>
11 #       elif HAVE_STRINGS_H
12 #               include <strings.h>
13 #       endif
14
15 #       ifndef HAVE_STRCHR
16 #               define strchr index
17 #               define strrchr rindex
18 #       endif
19
20 #       ifndef HAVE_MEMCPY
21 #               define memcpy(d, s, n)                  bcopy ((s), (d), (n))
22 #               define memmove(d, s, n)                 bcopy ((s), (d), (n))
23 #       endif
24
25 #       if !defined(HAVE_STRING_H) && !defined(HAVE_STRINGS_H)
26         /* define prototypes for string functions */
27         /* this could cause problems on some odd ball systems */
28         char    *strchr(), *strrchr();
29         char    *strcpy(), *strncpy();
30         char    *strcat (), *strncat ();
31         int             strcmp(), strncmp();
32         int             strcasecmp(), strncasecmp();
33         char    *strdup();
34         char    *strtok();
35         char    *strpbrk();
36         int             memcmp();
37 #       endif
38
39 #endif
40
41 #ifndef SAFEMEMCPY
42 #       if defined( HAVE_MEMMOVE )
43 #               define SAFEMEMCPY( d, s, n )    memmove((d), (s), (n))
44 #       elif defined( HAVE_BCOPY )
45 #               define SAFEMEMCPY( d, s, n )    bcopy((s), (d), (n))
46 #       elif defined( MACOS )
47 #               define SAFEMEMCPY( d, s, n )    BlockMoveData((Ptr)(s), (Ptr)(d), (n))
48 #       else
49                 /* nothing left but memcpy() */
50 #               define SAFEMEMCPY( d, s, n )    memcpy((d), (s), (n))
51 #       endif
52 #endif
53
54 #endif /* _AC_STRING_H */