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