diff options
author | Fred Drake <fdrake@acm.org> | 2000-08-16 14:18:30 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2000-08-16 14:18:30 (GMT) |
commit | a136d4970c6a54e8365314238a7ab0a7aa49ad26 (patch) | |
tree | ef2d1513dada1403ba8a6ff1766443f796c74249 /Modules/socketmodule.c | |
parent | a6070f0221c0f4f2bb0fea518ea6e0b5e9497271 (diff) | |
download | cpython-a136d4970c6a54e8365314238a7ab0a7aa49ad26.zip cpython-a136d4970c6a54e8365314238a7ab0a7aa49ad26.tar.gz cpython-a136d4970c6a54e8365314238a7ab0a7aa49ad26.tar.bz2 |
Remove a lot of the confusing conditional compilation from the beginning
of the init_socket() function. This module is now *always* _socket.
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 51 |
1 files changed, 4 insertions, 47 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 418b125..284e5b7 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2331,40 +2331,8 @@ OS2init(void) */ 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\ -"; +"Implementation module for socket operations. See the socket module\n\ +for documentation."; static char sockettype_doc[] = "A socket represents one endpoint of a network connection.\n\ @@ -2394,30 +2362,19 @@ shutdown() -- shut down traffic in one or both directions\n\ (*) not available on all platforms!)"; DL_EXPORT(void) -#if defined(MS_WINDOWS) || defined(PYOS_OS2) || defined(__BEOS__) init_socket(void) -#else -initsocket(void) -#endif { PyObject *m, *d; #ifdef MS_WINDOWS if (!NTinit()) return; - m = Py_InitModule3("_socket", PySocket_methods, module_doc); #else #if defined(__TOS_OS2__) if (!OS2init()) return; +#endif /* __TOS_OS2__ */ +#endif /* MS_WINDOWS */ 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); if (PySocket_Error == NULL) |