import from HEAD
[freeradius.git] / src / include / missing.h
1 #ifndef _FR_MISSING_H
2 #define _FR_MISSING_H
3
4 /*
5  * missing.h    Replacements for functions that are or can be
6  *              missing on some platforms.
7  *
8  * Version:     $Id$
9  *
10  */
11 #ifndef HAVE_STRNCASECMP
12 extern int strncasecmp(char *s1, char *s2, int n);
13 #endif
14
15 #ifndef HAVE_STRCASECMP
16 extern int strcasecmp(char *s1, char *s2);
17 #endif
18
19 #ifndef HAVE_STRSEP
20 extern char *strsep(char **stringp, const char *delim);
21 #endif
22
23 #ifndef HAVE_LOCALTIME_R
24 struct tm *localtime_r(const time_t *l_clock, struct tm *result);
25 #endif
26
27 #ifndef HAVE_CTIME_R
28 char *ctime_r(const time_t *l_clock, char *l_buf);
29 #endif
30
31 #ifdef NEED_DECLARATION_CRYPT
32 char *crypt(char *key, char *salt);
33 #endif
34
35 #ifdef NEED_DECLARATION_STRNCASECMP
36 int strncasecmp(char *s1, char *s2, int n);
37 #endif
38
39 #ifdef NEED_DECLARATION_STRCASECMP
40 int strcasecmp(char *s1, char *s2);
41 #endif
42
43 #ifdef NEED_DECLARATION_INET_ATON
44 struct in_addr;
45 int inet_aton(char *cp, struct in_addr *inp);
46 #endif
47
48 #ifdef NEED_DECLARATION_GETHOSTNAME
49 int gethostname(char *name, int len);
50 #endif
51
52 #ifndef HAVE_SETLINEBUF
53 #ifdef HAVE_SETVBUF
54 #define setlinebuf(x) setvbuf(x, NULL, _IOLBF, 0)
55 #else
56 #define setlinebuf(x)     0
57 #endif
58 #endif
59
60 #ifdef NEED_DECLARATION_SETLINEBUF
61 #define setlinebuf(x)     0
62 #endif
63
64 #ifdef NEED_DECLARATION_GETUSERSHELL
65 char *getusershell(void);
66 #endif
67
68 #ifdef NEED_DECLARATION_ENDUSERSHELL
69 void endusershell(void);
70 #endif
71
72 #ifndef INADDR_ANY
73 #define INADDR_ANY      ((uint32_t) 0x00000000)
74 #endif
75
76 #ifndef INADDR_LOOPBACK
77 #define INADDR_LOOPBACK ((uint32_t) 0x7f000001) /* Inet 127.0.0.1 */
78 #endif
79
80 #ifndef INADDR_NONE
81 #define INADDR_NONE     ((uint32_t) 0xffffffff)
82 #endif
83
84 #endif /* _FR_MISSING_H */