su  1.12.11devel
 All Data Structures Files Functions Variables Typedefs Enumerator Macros Groups Pages
su_errno.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Sofia-SIP package
3  *
4  * Copyright (C) 2005 Nokia Corporation.
5  *
6  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation; either version 2.1 of
11  * the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21  * 02110-1301 USA
22  *
23  */
24 
25 #ifndef SU_ERRNO_H
26 
27 #define SU_ERRNO_H
28 
39 #ifndef SU_CONFIG_H
40 #include "sofia-sip/su_config.h"
41 #endif
42 
43 #include <errno.h>
44 
45 SOFIA_BEGIN_DECLS
46 
48 SOFIAPUBFUN char const *su_strerror(int e);
49 
51 SOFIAPUBFUN int su_errno(void);
52 
54 SOFIAPUBFUN int su_seterrno(int);
55 
56 #if !SU_HAVE_WINSOCK
57 #define su_errno() (errno)
58 #define su_seterrno(n) ((errno = (n)), -1)
59 #endif
60 
61 #if defined(__APPLE_CC__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
62 #ifndef EBADMSG
63 #define EBADMSG EFAULT
64 #endif
65 #ifndef EPROTO
66 #define EPROTO EPROTOTYPE
67 #endif
68 #ifndef EBADMSG
69 #define EBADMSG EFAULT
70 #endif
71 #endif
72 
73 #if SU_HAVE_WINSOCK
74 /*
75  * Use WinSock errors with Sofia-SIP.
76  *
77  * VC POSIX runtime defines some of these, undef POSIX definitions.
78  */
79 
80 #undef EWOULDBLOCK
81 #define EWOULDBLOCK (10035) /* WSAEWOULDBLOCK */
82 
83 #undef EINPROGRESS
84 #define EINPROGRESS (10036) /* WSAEINPROGRESS */
85 
86 #undef EALREADY
87 #define EALREADY (10037) /* WSAEALREADY */
88 
89 #undef ENOTSOCK
90 #define ENOTSOCK (10038) /* WSAENOTSOCK */
91 
92 #undef EDESTADDRREQ
93 #define EDESTADDRREQ (10039) /* WSAEDESTADDRREQ */
94 
95 #undef EMSGSIZE
96 #define EMSGSIZE (10040) /* WSAEMSGSIZE */
97 
98 #undef EPROTOTYPE
99 #define EPROTOTYPE (10041) /* WSAEPROTOTYPE */
100 
101 #undef ENOPROTOOPT
102 #define ENOPROTOOPT (10042) /* WSAENOPROTOOPT */
103 
104 #undef EPROTONOSUPPORT
105 #define EPROTONOSUPPORT (10043) /* WSAEPROTONOSUPPORT */
106 
107 #undef ESOCKTNOSUPPORT
108 #define ESOCKTNOSUPPORT (10044) /* WSAESOCKTNOSUPPORT */
109 
110 #undef EOPNOTSUPP
111 #define EOPNOTSUPP (10045) /* WSAEOPNOTSUPP */
112 
113 #undef EPFNOSUPPORT
114 #define EPFNOSUPPORT (10046) /* WSAEPFNOSUPPORT */
115 
116 #undef EAFNOSUPPORT
117 #define EAFNOSUPPORT (10047) /* WSAEAFNOSUPPORT */
118 
119 #undef EADDRINUSE
120 #define EADDRINUSE (10048) /* WSAEADDRINUSE */
121 
122 #undef EADDRNOTAVAIL
123 #define EADDRNOTAVAIL (10049) /* WSAEADDRNOTAVAIL */
124 
125 #undef ENETDOWN
126 #define ENETDOWN (10050) /* WSAENETDOWN */
127 
128 #undef ENETUNREACH
129 #define ENETUNREACH (10051) /* WSAENETUNREACH */
130 
131 #undef ENETRESET
132 #define ENETRESET (10052) /* WSAENETRESET */
133 
134 #undef ECONNABORTED
135 #define ECONNABORTED (10053) /* WSAECONNABORTED */
136 
137 #undef ECONNRESET
138 #define ECONNRESET (10054) /* WSAECONNRESET */
139 
140 #undef ENOBUFS
141 #define ENOBUFS (10055) /* WSAENOBUFS */
142 
143 #undef EISCONN
144 #define EISCONN (10056) /* WSAEISCONN */
145 
146 #undef ENOTCONN
147 #define ENOTCONN (10057) /* WSAENOTCONN */
148 
149 #undef ESHUTDOWN
150 #define ESHUTDOWN (10058) /* WSAESHUTDOWN */
151 
152 #undef ETOOMANYREFS
153 #define ETOOMANYREFS (10059) /* WSAETOOMANYREFS */
154 
155 #undef ETIMEDOUT
156 #define ETIMEDOUT (10060) /* WSAETIMEDOUT */
157 
158 #undef ECONNREFUSED
159 #define ECONNREFUSED (10061) /* WSAECONNREFUSED */
160 
161 #undef ELOOP
162 #define ELOOP (10062) /* WSAELOOP */
163 
164 #undef ENAMETOOLONG
165 #define ENAMETOOLONG (10063) /* WSAENAMETOOLONG */
166 
167 #undef EHOSTDOWN
168 #define EHOSTDOWN (10064) /* WSAEHOSTDOWN */
169 
170 #undef EHOSTUNREACH
171 #define EHOSTUNREACH (10065) /* WSAEHOSTUNREACH */
172 
173 #undef ENOTEMPTY
174 #define ENOTEMPTY (10066) /* WSAENOTEMPTY */
175 
176 #undef EPROCLIM
177 #define EPROCLIM (10067) /* WSAEPROCLIM */
178 
179 #undef EUSERS
180 #define EUSERS (10068) /* WSAEUSERS */
181 
182 #undef EDQUOT
183 #define EDQUOT (10069) /* WSAEDQUOT */
184 
185 #undef ESTALE
186 #define ESTALE (10070) /* WSAESTALE */
187 
188 #undef EREMOTE
189 #define EREMOTE (10071) /* WSAEREMOTE */
190 
191 #undef EBADMSG
192 
193 # if defined(WSABADMSG)
194 # define EBADMSG (WSAEBADMSG)
195 # else
196 # define EBADMSG (20005)
197 # endif
198 
199 #undef EPROTO
200 
201 # if defined(WSAEPROTO)
202 # define EPROTO WSAEPROTO
203 # else
204 # define EPROTO (20006)
205 # endif
206 
207 #endif
208 
209 SOFIA_END_DECLS
210 
211 #endif
char const * su_strerror(int e)
Return string describing su error code.
Definition: su_errno.c:155
#define SOFIAPUBFUN
SOFIAPUBFUN declares an exported function.
Definition: su_config.h:66
su library configuration
int su_seterrno(int)
Set the su error.
#define su_errno()
The latest su error.
Definition: su_errno.h:57

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.