[Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.126,1.127
Fred L. Drake
python-dev@python.org
Wed, 16 Aug 2000 07:18:33 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv26902/Modules
Modified Files:
socketmodule.c
Log Message:
Remove a lot of the confusing conditional compilation from the beginning
of the init_socket() function. This module is now *always* _socket.
Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.126
retrieving revision 1.127
diff -C2 -r1.126 -r1.127
*** socketmodule.c 2000/08/03 16:42:13 1.126
--- socketmodule.c 2000/08/16 14:18:30 1.127
***************
*** 2332,2369 ****
static char module_doc[] =
! "This module provides socket operations and some related functions.\n\
! On Unix, it supports IP (Internet Protocol) and Unix domain sockets.\n\
! On other systems, it only supports IP.\n\
! \n\
! Functions:\n\
! \n\
! socket() -- create a new socket object\n\
! fromfd() -- create a socket object from an open file descriptor (*)\n\
! gethostname() -- return the current hostname\n\
! gethostbyname() -- map a hostname to its IP number\n\
! gethostbyaddr() -- map an IP number or hostname to DNS info\n\
! getservbyname() -- map a service name and a protocol name to a port number\n\
! getprotobyname() -- mape a protocol name (e.g. 'tcp') to a number\n\
! ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order\n\
! htons(), htonl() -- convert 16, 32 bit int from host to network byte order\n\
! inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format\n\
! inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89)\n\
! ssl() -- secure socket layer support (only available if configured)\n\
! \n\
! (*) not available on all platforms!)\n\
! \n\
! Special objects:\n\
! \n\
! SocketType -- type object for socket objects\n\
! error -- exception raised for I/O errors\n\
! \n\
! Integer constants:\n\
! \n\
! AF_INET, AF_UNIX -- socket domains (first argument to socket() call)\n\
! SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)\n\
! \n\
! Many other constants may be defined; these may be used in calls to\n\
! the setsockopt() and getsockopt() methods.\n\
! ";
static char sockettype_doc[] =
--- 2332,2337 ----
static char module_doc[] =
! "Implementation module for socket operations. See the socket module\n\
! for documentation.";
static char sockettype_doc[] =
***************
*** 2395,2403 ****
DL_EXPORT(void)
- #if defined(MS_WINDOWS) || defined(PYOS_OS2) || defined(__BEOS__)
init_socket(void)
- #else
- initsocket(void)
- #endif
{
PyObject *m, *d;
--- 2363,2367 ----
***************
*** 2405,2422 ****
if (!NTinit())
return;
- m = Py_InitModule3("_socket", PySocket_methods, module_doc);
#else
#if defined(__TOS_OS2__)
if (!OS2init())
return;
m = Py_InitModule3("_socket", PySocket_methods, module_doc);
- #else
- #if defined(__BEOS__)
- m = Py_InitModule3("_socket", PySocket_methods, module_doc);
- #else
- m = Py_InitModule3("socket", PySocket_methods, module_doc);
- #endif /* __BEOS__ */
- #endif
- #endif
d = PyModule_GetDict(m);
PySocket_Error = PyErr_NewException("socket.error", NULL, NULL);
--- 2369,2379 ----
if (!NTinit())
return;
#else
#if defined(__TOS_OS2__)
if (!OS2init())
return;
+ #endif /* __TOS_OS2__ */
+ #endif /* MS_WINDOWS */
m = Py_InitModule3("_socket", PySocket_methods, module_doc);
d = PyModule_GetDict(m);
PySocket_Error = PyErr_NewException("socket.error", NULL, NULL);