]> git.sur5r.net Git - openldap/commitdiff
Moved nt_err from liblutil to liblber, renamed WSAGetErrorString to
authorHoward Chu <hyc@openldap.org>
Fri, 12 May 2000 21:16:15 +0000 (21:16 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 12 May 2000 21:16:15 +0000 (21:16 +0000)
ber_pvt_wsa_err2string.

include/ac/socket.h
libraries/liblber/Makefile.in
libraries/liblber/nt_err.c [new file with mode: 0644]
libraries/liblutil/Makefile.in
libraries/liblutil/nt_err.c [deleted file]

index 5e20569f54f6f3bf115464232413577a7857501a..c1a00456bf049e9503562e6999e7ed0e6a99aa24 100644 (file)
@@ -90,9 +90,9 @@
 #undef sock_errno
 #undef sock_errstr
 #define        sock_errno()    WSAGetLastError()
-#define        sock_errstr(e)  WSAGetErrorString(e)
+#define        sock_errstr(e)  ber_pvt_wsa_err2string(e)
 
-LIBLUTIL_F (char *) WSAGetErrorString LDAP_P((int));
+LIBLBER_F (char *) ber_pvt_wsa_err2string LDAP_P((int));
 
 #elif MACOS
 #      define tcp_close( s )           tcpclose( s )
index 227509f974f834ec67c3c0a74fc83ea973db8dee..3c087ae1f568110eb4f02fae9349eba6941bfd03 100644 (file)
@@ -8,10 +8,13 @@
 LIBRARY = liblber.la
 XLIBRARY = ../liblber.a
 
+NT_SRCS = nt_err.c
+NT_OBJS = nt_err.lo
+
 SRCS= assert.c decode.c encode.c io.c bprint.c \
-       memory.c options.c sockbuf.c
+       memory.c options.c sockbuf.c $(@PLAT@_SRCS)
 OBJS= assert.lo decode.lo encode.lo io.lo bprint.lo \
-       memory.lo options.lo sockbuf.lo
+       memory.lo options.lo sockbuf.lo $(@PLAT@_OBJS)
 XSRCS= version.c
 
 PROGRAMS= dtest etest idtest
diff --git a/libraries/liblber/nt_err.c b/libraries/liblber/nt_err.c
new file mode 100644 (file)
index 0000000..adb7b97
--- /dev/null
@@ -0,0 +1,112 @@
+/* $OpenLDAP$ */
+#include "portable.h"
+
+#include <windows.h>
+
+#ifdef HAVE_WINSOCK2
+#include <winsock2.h>
+#elif HAVE_WINSOCK
+#include <winsock.h>
+#endif /* HAVE_WINSOCK(2) */
+
+#define __RETSTR( x ) case x: return #x;
+
+char *ber_pvt_wsa_err2string( int err )
+{
+       switch( err )
+       {
+               __RETSTR( WSAEINTR )
+               __RETSTR( WSAEBADF )
+               __RETSTR( WSAEACCES )
+               __RETSTR( WSAEFAULT )
+               __RETSTR( WSAEINVAL )
+               __RETSTR( WSAEMFILE )
+               __RETSTR( WSAEWOULDBLOCK )
+               __RETSTR( WSAEINPROGRESS )
+               __RETSTR( WSAEALREADY )
+               __RETSTR( WSAENOTSOCK )
+               __RETSTR( WSAEDESTADDRREQ )
+               __RETSTR( WSAEMSGSIZE )
+               __RETSTR( WSAEPROTOTYPE )
+               __RETSTR( WSAENOPROTOOPT )
+               __RETSTR( WSAEPROTONOSUPPORT )
+               __RETSTR( WSAESOCKTNOSUPPORT )
+               __RETSTR( WSAEOPNOTSUPP )
+               __RETSTR( WSAEPFNOSUPPORT )
+               __RETSTR( WSAEAFNOSUPPORT )
+               __RETSTR( WSAEADDRINUSE )
+               __RETSTR( WSAEADDRNOTAVAIL )
+               __RETSTR( WSAENETDOWN )
+               __RETSTR( WSAENETUNREACH )
+               __RETSTR( WSAENETRESET )
+               __RETSTR( WSAECONNABORTED )
+               __RETSTR( WSAECONNRESET )
+               __RETSTR( WSAENOBUFS )
+               __RETSTR( WSAEISCONN )
+               __RETSTR( WSAENOTCONN )
+               __RETSTR( WSAESHUTDOWN )
+               __RETSTR( WSAETOOMANYREFS )
+               __RETSTR( WSAETIMEDOUT )
+               __RETSTR( WSAECONNREFUSED )
+               __RETSTR( WSAELOOP )
+               __RETSTR( WSAENAMETOOLONG )
+               __RETSTR( WSAEHOSTDOWN )
+               __RETSTR( WSAEHOSTUNREACH )
+               __RETSTR( WSAENOTEMPTY )
+               __RETSTR( WSAEPROCLIM )
+               __RETSTR( WSAEUSERS )
+               __RETSTR( WSAEDQUOT )
+               __RETSTR( WSAESTALE )
+               __RETSTR( WSAEREMOTE )
+               __RETSTR( WSASYSNOTREADY )
+               __RETSTR( WSAVERNOTSUPPORTED )
+               __RETSTR( WSANOTINITIALISED )
+               __RETSTR( WSAEDISCON )
+
+#ifdef HAVE_WINSOCK2
+               __RETSTR( WSAENOMORE )
+               __RETSTR( WSAECANCELLED )
+               __RETSTR( WSAEINVALIDPROCTABLE )
+               __RETSTR( WSAEINVALIDPROVIDER )
+               __RETSTR( WSASYSCALLFAILURE )
+               __RETSTR( WSASERVICE_NOT_FOUND )
+               __RETSTR( WSATYPE_NOT_FOUND )
+               __RETSTR( WSA_E_NO_MORE )
+               __RETSTR( WSA_E_CANCELLED )
+               __RETSTR( WSAEREFUSED )
+#endif // HAVE_WINSOCK2        
+
+               __RETSTR( WSAHOST_NOT_FOUND )
+               __RETSTR( WSATRY_AGAIN )
+               __RETSTR( WSANO_RECOVERY )
+               __RETSTR( WSANO_DATA )
+       }
+       return "unknown";
+}
+
+#undef __RETSTR
+
+#if 0  /* No one seems to be using these */
+char *ber_pvt_wsa_last_errstring( void )
+{
+       return ber_pvt_wsa_err2string( WSAGetLastError() );
+}
+
+char *GetErrorString( int err )
+{
+       static char msgBuf[1024];
+
+       FormatMessage(
+               FORMAT_MESSAGE_FROM_SYSTEM,
+               NULL,
+               err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+               msgBuf, 1024, NULL );
+
+       return msgBuf;
+}
+
+char *GetLastErrorString( void )
+{
+       return GetErrorString( GetLastError() );
+}
+#endif
index 8aec16995fea57a9e40d3d173d48f2b851900a95..07cadf5838b3337f7873539812b45427fd585406 100644 (file)
@@ -5,8 +5,8 @@
 
 LIBRARY        = liblutil.a
 
-NT_SRCS = nt_err.c ntservice.c
-NT_OBJS = nt_err.o ntservice.o slapdmsg.res
+NT_SRCS = ntservice.c
+NT_OBJS = ntservice.o slapdmsg.res
 
 UNIX_SRCS = detach.c
 UNIX_OBJS = detach.o
diff --git a/libraries/liblutil/nt_err.c b/libraries/liblutil/nt_err.c
deleted file mode 100644 (file)
index 691c19c..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/* $OpenLDAP$ */
-#include "portable.h"
-
-#include <windows.h>
-
-#ifdef HAVE_WINSOCK2
-#include <winsock2.h>
-#elif HAVE_WINSOCK
-#include <winsock.h>
-#endif /* HAVE_WINSOCK(2) */
-
-#define __RETSTR( x ) case x: return #x;
-
-char *WSAGetErrorString( int err )
-{
-       switch( err )
-       {
-               __RETSTR( WSAEINTR )
-               __RETSTR( WSAEBADF )
-               __RETSTR( WSAEACCES )
-               __RETSTR( WSAEFAULT )
-               __RETSTR( WSAEINVAL )
-               __RETSTR( WSAEMFILE )
-               __RETSTR( WSAEWOULDBLOCK )
-               __RETSTR( WSAEINPROGRESS )
-               __RETSTR( WSAEALREADY )
-               __RETSTR( WSAENOTSOCK )
-               __RETSTR( WSAEDESTADDRREQ )
-               __RETSTR( WSAEMSGSIZE )
-               __RETSTR( WSAEPROTOTYPE )
-               __RETSTR( WSAENOPROTOOPT )
-               __RETSTR( WSAEPROTONOSUPPORT )
-               __RETSTR( WSAESOCKTNOSUPPORT )
-               __RETSTR( WSAEOPNOTSUPP )
-               __RETSTR( WSAEPFNOSUPPORT )
-               __RETSTR( WSAEAFNOSUPPORT )
-               __RETSTR( WSAEADDRINUSE )
-               __RETSTR( WSAEADDRNOTAVAIL )
-               __RETSTR( WSAENETDOWN )
-               __RETSTR( WSAENETUNREACH )
-               __RETSTR( WSAENETRESET )
-               __RETSTR( WSAECONNABORTED )
-               __RETSTR( WSAECONNRESET )
-               __RETSTR( WSAENOBUFS )
-               __RETSTR( WSAEISCONN )
-               __RETSTR( WSAENOTCONN )
-               __RETSTR( WSAESHUTDOWN )
-               __RETSTR( WSAETOOMANYREFS )
-               __RETSTR( WSAETIMEDOUT )
-               __RETSTR( WSAECONNREFUSED )
-               __RETSTR( WSAELOOP )
-               __RETSTR( WSAENAMETOOLONG )
-               __RETSTR( WSAEHOSTDOWN )
-               __RETSTR( WSAEHOSTUNREACH )
-               __RETSTR( WSAENOTEMPTY )
-               __RETSTR( WSAEPROCLIM )
-               __RETSTR( WSAEUSERS )
-               __RETSTR( WSAEDQUOT )
-               __RETSTR( WSAESTALE )
-               __RETSTR( WSAEREMOTE )
-               __RETSTR( WSASYSNOTREADY )
-               __RETSTR( WSAVERNOTSUPPORTED )
-               __RETSTR( WSANOTINITIALISED )
-               __RETSTR( WSAEDISCON )
-
-#ifdef HAVE_WINSOCK2
-               __RETSTR( WSAENOMORE )
-               __RETSTR( WSAECANCELLED )
-               __RETSTR( WSAEINVALIDPROCTABLE )
-               __RETSTR( WSAEINVALIDPROVIDER )
-               __RETSTR( WSASYSCALLFAILURE )
-               __RETSTR( WSASERVICE_NOT_FOUND )
-               __RETSTR( WSATYPE_NOT_FOUND )
-               __RETSTR( WSA_E_NO_MORE )
-               __RETSTR( WSA_E_CANCELLED )
-               __RETSTR( WSAEREFUSED )
-#endif // HAVE_WINSOCK2        
-
-               __RETSTR( WSAHOST_NOT_FOUND )
-               __RETSTR( WSATRY_AGAIN )
-               __RETSTR( WSANO_RECOVERY )
-               __RETSTR( WSANO_DATA )
-       }
-       return "unknown";
-}
-
-char *WSAGetLastErrorString( void )
-{
-       return WSAGetErrorString( WSAGetLastError() );
-}
-
-#undef __RETSTR
-
-char *GetErrorString( int err )
-{
-       static char msgBuf[1024];
-
-       FormatMessage(
-               FORMAT_MESSAGE_FROM_SYSTEM,
-               NULL,
-               err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-               msgBuf, 1024, NULL );
-
-       return msgBuf;
-}
-
-char *GetLastErrorString( void )
-{
-       return GetErrorString( GetLastError() );
-}
-
-
-