]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
turn this into a macro
authorBenjamin Peterson <benjamin@python.org>
Wed, 6 May 2009 02:43:58 +0000 (02:43 +0000)
committerBenjamin Peterson <benjamin@python.org>
Wed, 6 May 2009 02:43:58 +0000 (02:43 +0000)
Modules/socketmodule.c
Modules/socketmodule.h

index 6ec522011bc77db2eec52292f5f8d25220072c9b..de720e1b74c0646f78f116292990ea62b3f4acf8 100644 (file)
@@ -4146,14 +4146,6 @@ PySocketModule_APIObject PySocketModuleAPI =
         NULL
 };
 
-PySocketModule_APIObject *
-PySocketModule_ImportModuleAndAPI(void)
-{
-       void *api;
-       api = PyCapsule_Import(PySocket_CAPSULE_NAME, 1);;
-       return (PySocketModule_APIObject *)api;
-}
-
 
 /* Initialize the _socket module.
 
index a323409aa2066043140451a656284def92651985..ee525153fb8a7f48482f5755ca3c53f192960dda 100644 (file)
@@ -190,38 +190,9 @@ typedef struct {
         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. 
+#define PySocketModule_ImportModuleAndAPI() PyCapsule_Import(PySocket_CAPSULE_NAME, 1)
 
-   >>> 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:
-
-   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 */