6 /* Copyright (C) 2004 - 2007 by Daniel Stenberg et al
8 * Permission to use, copy, modify, and distribute this software and its
9 * documentation for any purpose and without fee is hereby granted, provided
10 * that the above copyright notice appear in all copies and that both that
11 * copyright notice and this permission notice appear in supporting
12 * documentation, and that the name of M.I.T. not be used in advertising or
13 * publicity pertaining to distribution of the software without specific,
14 * written prior permission. M.I.T. makes no representations about the
15 * suitability of this software for any purpose. It is provided "as is"
16 * without express or implied warranty.
20 /********************************************************************
24 * Content of header files lib/setup_once.h and ares/setup_once.h *
25 * must be kept in sync. Modify the other one if you change this. *
27 ********************************************************************/
31 * If we have the MSG_NOSIGNAL define, make sure we use
32 * it as the fourth argument of function send()
35 #ifdef HAVE_MSG_NOSIGNAL
36 #define SEND_4TH_ARG MSG_NOSIGNAL
38 #define SEND_4TH_ARG 0
43 * The definitions for the return type and arguments types
44 * of functions recv() and send() belong and come from the
45 * configuration file. Do not define them in any other place.
47 * HAVE_RECV is defined if you have a function named recv()
48 * which is used to read incoming data from sockets. If your
49 * function has another name then don't define HAVE_RECV.
51 * If HAVE_RECV is defined then RECV_TYPE_ARG1, RECV_TYPE_ARG2,
52 * RECV_TYPE_ARG3, RECV_TYPE_ARG4 and RECV_TYPE_RETV must also
55 * HAVE_SEND is defined if you have a function named send()
56 * which is used to write outgoing data on a connected socket.
57 * If yours has another name then don't define HAVE_SEND.
59 * If HAVE_SEND is defined then SEND_TYPE_ARG1, SEND_QUAL_ARG2,
60 * SEND_TYPE_ARG2, SEND_TYPE_ARG3, SEND_TYPE_ARG4 and
61 * SEND_TYPE_RETV must also be defined.
65 #if !defined(RECV_TYPE_ARG1) || \
66 !defined(RECV_TYPE_ARG2) || \
67 !defined(RECV_TYPE_ARG3) || \
68 !defined(RECV_TYPE_ARG4) || \
69 !defined(RECV_TYPE_RETV)
71 Error Missing_definition_of_return_and_arguments_types_of_recv
74 #define sread(x,y,z) (ssize_t)recv((RECV_TYPE_ARG1)(x), \
75 (RECV_TYPE_ARG2)(y), \
76 (RECV_TYPE_ARG3)(z), \
82 Error Missing_definition_of_macro_sread
85 #endif /* HAVE_RECV */
88 #if !defined(SEND_TYPE_ARG1) || \
89 !defined(SEND_QUAL_ARG2) || \
90 !defined(SEND_TYPE_ARG2) || \
91 !defined(SEND_TYPE_ARG3) || \
92 !defined(SEND_TYPE_ARG4) || \
93 !defined(SEND_TYPE_RETV)
95 Error Missing_definition_of_return_and_arguments_types_of_send
98 #define swrite(x,y,z) (ssize_t)send((SEND_TYPE_ARG1)(x), \
99 (SEND_TYPE_ARG2)(y), \
100 (SEND_TYPE_ARG3)(z), \
101 (SEND_TYPE_ARG4)(SEND_4TH_ARG))
103 #else /* HAVE_SEND */
106 Error Missing_definition_of_macro_swrite
109 #endif /* HAVE_SEND */
113 * Uppercase macro versions of ANSI/ISO is*() functions/macros which
114 * avoid negative number inputs with argument byte codes > 127.
117 #define ISSPACE(x) (isspace((int) ((unsigned char)x)))
118 #define ISDIGIT(x) (isdigit((int) ((unsigned char)x)))
119 #define ISALNUM(x) (isalnum((int) ((unsigned char)x)))
120 #define ISXDIGIT(x) (isxdigit((int) ((unsigned char)x)))
121 #define ISGRAPH(x) (isgraph((int) ((unsigned char)x)))
122 #define ISALPHA(x) (isalpha((int) ((unsigned char)x)))
123 #define ISPRINT(x) (isprint((int) ((unsigned char)x)))
127 * Typedef to 'int' if sig_atomic_t is not an available 'typedefed' type.
130 #ifndef HAVE_SIG_ATOMIC_T
131 typedef int sig_atomic_t;
132 #define HAVE_SIG_ATOMIC_T
137 * Default return type for signal handlers.
141 #define RETSIGTYPE void
145 #endif /* __SETUP_ONCE_H */