su
1.12.11
|
00001 /* 00002 * This file is part of the Sofia-SIP package 00003 * 00004 * Copyright (C) 2005 Nokia Corporation. 00005 * 00006 * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden> 00007 * 00008 * This library is free software; you can redistribute it and/or 00009 * modify it under the terms of the GNU Lesser General Public License 00010 * as published by the Free Software Foundation; either version 2.1 of 00011 * the License, or (at your option) any later version. 00012 * 00013 * This library is distributed in the hope that it will be useful, but 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 * Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public 00019 * License along with this library; if not, write to the Free Software 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00021 * 02110-1301 USA 00022 * 00023 */ 00024 00025 #ifndef SU_ERRNO_H 00026 00027 #define SU_ERRNO_H 00028 00039 #ifndef SU_CONFIG_H 00040 #include "sofia-sip/su_config.h" 00041 #endif 00042 00043 #include <errno.h> 00044 00045 SOFIA_BEGIN_DECLS 00046 00048 SOFIAPUBFUN char const *su_strerror(int e); 00049 00051 SOFIAPUBFUN int su_errno(void); 00052 00054 SOFIAPUBFUN int su_seterrno(int); 00055 00056 #if !SU_HAVE_WINSOCK 00057 #define su_errno() (errno) 00058 #define su_seterrno(n) ((errno = (n)), -1) 00059 #endif 00060 00061 #if defined(__APPLE_CC__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) 00062 #ifndef EBADMSG 00063 #define EBADMSG EFAULT 00064 #endif 00065 #ifndef EPROTO 00066 #define EPROTO EPROTOTYPE 00067 #endif 00068 #ifndef EBADMSG 00069 #define EBADMSG EFAULT 00070 #endif 00071 #endif 00072 00073 #if SU_HAVE_WINSOCK 00074 /* 00075 * Use WinSock errors with Sofia-SIP. 00076 * 00077 * VC POSIX runtime defines some of these, undef POSIX definitions. 00078 */ 00079 00080 #undef EWOULDBLOCK 00081 #define EWOULDBLOCK (10035) /* WSAEWOULDBLOCK */ 00082 00083 #undef EINPROGRESS 00084 #define EINPROGRESS (10036) /* WSAEINPROGRESS */ 00085 00086 #undef EALREADY 00087 #define EALREADY (10037) /* WSAEALREADY */ 00088 00089 #undef ENOTSOCK 00090 #define ENOTSOCK (10038) /* WSAENOTSOCK */ 00091 00092 #undef EDESTADDRREQ 00093 #define EDESTADDRREQ (10039) /* WSAEDESTADDRREQ */ 00094 00095 #undef EMSGSIZE 00096 #define EMSGSIZE (10040) /* WSAEMSGSIZE */ 00097 00098 #undef EPROTOTYPE 00099 #define EPROTOTYPE (10041) /* WSAEPROTOTYPE */ 00100 00101 #undef ENOPROTOOPT 00102 #define ENOPROTOOPT (10042) /* WSAENOPROTOOPT */ 00103 00104 #undef EPROTONOSUPPORT 00105 #define EPROTONOSUPPORT (10043) /* WSAEPROTONOSUPPORT */ 00106 00107 #undef ESOCKTNOSUPPORT 00108 #define ESOCKTNOSUPPORT (10044) /* WSAESOCKTNOSUPPORT */ 00109 00110 #undef EOPNOTSUPP 00111 #define EOPNOTSUPP (10045) /* WSAEOPNOTSUPP */ 00112 00113 #undef EPFNOSUPPORT 00114 #define EPFNOSUPPORT (10046) /* WSAEPFNOSUPPORT */ 00115 00116 #undef EAFNOSUPPORT 00117 #define EAFNOSUPPORT (10047) /* WSAEAFNOSUPPORT */ 00118 00119 #undef EADDRINUSE 00120 #define EADDRINUSE (10048) /* WSAEADDRINUSE */ 00121 00122 #undef EADDRNOTAVAIL 00123 #define EADDRNOTAVAIL (10049) /* WSAEADDRNOTAVAIL */ 00124 00125 #undef ENETDOWN 00126 #define ENETDOWN (10050) /* WSAENETDOWN */ 00127 00128 #undef ENETUNREACH 00129 #define ENETUNREACH (10051) /* WSAENETUNREACH */ 00130 00131 #undef ENETRESET 00132 #define ENETRESET (10052) /* WSAENETRESET */ 00133 00134 #undef ECONNABORTED 00135 #define ECONNABORTED (10053) /* WSAECONNABORTED */ 00136 00137 #undef ECONNRESET 00138 #define ECONNRESET (10054) /* WSAECONNRESET */ 00139 00140 #undef ENOBUFS 00141 #define ENOBUFS (10055) /* WSAENOBUFS */ 00142 00143 #undef EISCONN 00144 #define EISCONN (10056) /* WSAEISCONN */ 00145 00146 #undef ENOTCONN 00147 #define ENOTCONN (10057) /* WSAENOTCONN */ 00148 00149 #undef ESHUTDOWN 00150 #define ESHUTDOWN (10058) /* WSAESHUTDOWN */ 00151 00152 #undef ETOOMANYREFS 00153 #define ETOOMANYREFS (10059) /* WSAETOOMANYREFS */ 00154 00155 #undef ETIMEDOUT 00156 #define ETIMEDOUT (10060) /* WSAETIMEDOUT */ 00157 00158 #undef ECONNREFUSED 00159 #define ECONNREFUSED (10061) /* WSAECONNREFUSED */ 00160 00161 #undef ELOOP 00162 #define ELOOP (10062) /* WSAELOOP */ 00163 00164 #undef ENAMETOOLONG 00165 #define ENAMETOOLONG (10063) /* WSAENAMETOOLONG */ 00166 00167 #undef EHOSTDOWN 00168 #define EHOSTDOWN (10064) /* WSAEHOSTDOWN */ 00169 00170 #undef EHOSTUNREACH 00171 #define EHOSTUNREACH (10065) /* WSAEHOSTUNREACH */ 00172 00173 #undef ENOTEMPTY 00174 #define ENOTEMPTY (10066) /* WSAENOTEMPTY */ 00175 00176 #undef EPROCLIM 00177 #define EPROCLIM (10067) /* WSAEPROCLIM */ 00178 00179 #undef EUSERS 00180 #define EUSERS (10068) /* WSAEUSERS */ 00181 00182 #undef EDQUOT 00183 #define EDQUOT (10069) /* WSAEDQUOT */ 00184 00185 #undef ESTALE 00186 #define ESTALE (10070) /* WSAESTALE */ 00187 00188 #undef EREMOTE 00189 #define EREMOTE (10071) /* WSAEREMOTE */ 00190 00191 #undef EBADMSG 00192 00193 # if defined(WSABADMSG) 00194 # define EBADMSG (WSAEBADMSG) 00195 # else 00196 # define EBADMSG (20005) 00197 # endif 00198 00199 #undef EPROTO 00200 00201 # if defined(WSAEPROTO) 00202 # define EPROTO WSAEPROTO 00203 # else 00204 # define EPROTO (20006) 00205 # endif 00206 00207 #endif 00208 00209 SOFIA_END_DECLS 00210 00211 #endif