2 dropin.h -- header file for dropin.c
3 Copyright (C) 2000,2001 Ivo Timmermans <itimmermans@bigfoot.com>,
4 2000,2001 Guus Sliepen <guus@sliepen.warande.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 $Id: dropin.h,v 1.1.2.5 2001/11/16 17:37:08 zarq Exp $
27 extern int daemon(int, int);
30 #ifndef HAVE_GET_CURRENT_DIR_NAME
31 extern char* get_current_dir_name(void);
35 extern int asprintf(char **, const char *, ...);
38 #ifndef HAVE_STRUCT_ADDRINFO
40 int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
41 int ai_family; /* PF_xxx */
42 int ai_socktype; /* SOCK_xxx */
43 int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
44 size_t ai_addrlen; /* length of ai_addr */
45 char *ai_canonname; /* canonical name for hostname */
46 struct sockaddr *ai_addr; /* binary address */
47 struct addrinfo *ai_next; /* next structure in linked list */
49 #endif /* !HAVE_STRUCT_ADDRINFO */
51 #ifndef HAVE_GETADDRINFO
52 int getaddrinfo(const char *hostname, const char *servname,
53 const struct addrinfo *hints, struct addrinfo **res);
54 #endif /* !HAVE_GETADDRINFO */
56 #ifndef HAVE_GAI_STRERROR
57 char *gai_strerror(int ecode);
58 #endif /* !HAVE_GAI_STRERROR */
60 #ifndef HAVE_FREEADDRINFO
61 void freeaddrinfo(struct addrinfo *ai);
62 #endif /* !HAVE_FREEADDRINFO */
64 #ifndef HAVE_GETNAMEINFO
65 int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
66 size_t hostlen, char *serv, size_t servlen, int flags);
67 #endif /* !HAVE_GETNAMEINFO */
70 # define NI_MAXSERV 32
71 #endif /* !NI_MAXSERV */
73 # define NI_MAXHOST 1025
74 #endif /* !NI_MAXHOST */
78 # define AI_CANONNAME 2
81 #ifndef NI_NUMERICHOST
82 # define NI_NUMERICHOST 2
83 # define NI_NAMEREQD 4
84 # define NI_NUMERICSERV 8
87 #endif /* __DROPIN_H__ */