summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.h
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-05-06 02:43:58 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-05-06 02:43:58 (GMT)
commit81c447f4d89273e629f42238d7714b7547aa21de (patch)
tree5a504ad30929358b35943a254614e3a9ace26dd1 /Modules/socketmodule.h
parent608d8bcdfc1762cde31efdf02a6379a06d7964b1 (diff)
downloadcpython-81c447f4d89273e629f42238d7714b7547aa21de.zip
cpython-81c447f4d89273e629f42238d7714b7547aa21de.tar.gz
cpython-81c447f4d89273e629f42238d7714b7547aa21de.tar.bz2
turn this into a macro
Diffstat (limited to 'Modules/socketmodule.h')
-rw-r--r--Modules/socketmodule.h33
1 files changed, 2 insertions, 31 deletions
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index a323409..ee52515 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -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 */