diff Modules/socketmodule.h @ 53824:b666e72f602f

turn this into a macro
author Benjamin Peterson <benjamin@python.org>
date Wed, 06 May 2009 02:43:58 +0000
parents 911df82bc25d
children 5c8b2238a2f5
line wrap: on
line diff
--- a/Modules/socketmodule.h	Tue May 05 23:23:31 2009 +0000
+++ b/Modules/socketmodule.h	Wed May 06 02:43:58 2009 +0000
@@ -190,38 +190,9 @@
         PyObject *error;
 } PySocketModule_APIObject;
 
-/* XXX The net effect of the following appears to be to define a function
-   XXX named PySocketModule_APIObject in _ssl.c.  It's unclear why it isn't
-   XXX defined there directly. 
-
-   >>> It's defined here because other modules might also want to use
-   >>> the C API.
-
-*/
-#ifndef PySocket_BUILDING_SOCKET
-
-/* --- C API ----------------------------------------------------*/
-
-/* Interfacestructure to C API for other modules.
-   Call PySocketModule_ImportModuleAndAPI() to initialize this
-   structure. After that usage is simple:
+#define PySocketModule_ImportModuleAndAPI() PyCapsule_Import(PySocket_CAPSULE_NAME, 1)
 
-   if (!PyArg_ParseTuple(args, "O!|zz:ssl",
-                         &PySocketModule.Sock_Type, (PyObject*)&Sock,
-	 		 &key_file, &cert_file))
- 	 return NULL;
-   ...
-*/
-
-/* You *must* call this before using any of the functions in
-   PySocketModule and check its outcome; otherwise all accesses will
-   result in a segfault. Returns 0 on success. */
-
-PyAPI_FUNC(PySocketModule_APIObject *) PySocketModule_ImportModuleAndAPI(void);
-
-#endif /* !PySocket_BUILDING_SOCKET */
-
-#ifdef __cplusplus
+#ifdef __cpluplus
 }
 #endif
 #endif /* !Py__SOCKET_H */