summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2002-02-17 03:58:51 (GMT)
committerTim Peters <tim.peters@gmail.com>2002-02-17 03:58:51 (GMT)
commit6f5505aaf9451685336acaba2abff319252f210e (patch)
tree309f18bd49cd017d00536d0669ba10a71eec9883
parenta5854c24a2319a599e57e40cd759b421f781fccd (diff)
downloadcpython-6f5505aaf9451685336acaba2abff319252f210e.zip
cpython-6f5505aaf9451685336acaba2abff319252f210e.tar.gz
cpython-6f5505aaf9451685336acaba2abff319252f210e.tar.bz2
For readability, switch to tab indents; was using a mix of tab indents,
4-space indents, and ambiguous space+tab indents. Added an XXX comment about a confusing part. Still doesn't build on Windows.
-rw-r--r--Modules/socketmodule.h70
1 files changed, 35 insertions, 35 deletions
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
index 606db3d..a1a2122 100644
--- a/Modules/socketmodule.h
+++ b/Modules/socketmodule.h
@@ -70,7 +70,7 @@ typedef struct {
struct sockaddr_ll ll;
#endif
} sock_addr;
- PyObject *(*errorhandler)(void); /* Error handler; checks
+ PyObject *(*errorhandler)(void); /* Error handler; checks
errno, returns NULL and
sets a Python exception */
} PySocketSockObject;
@@ -86,11 +86,12 @@ extern DL_IMPORT(PyTypeObject) PySocketSock_Type;
/* C API for usage by other Python modules */
typedef struct {
-
- PyTypeObject *Sock_Type;
-
+ PyTypeObject *Sock_Type;
} 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. */
#ifndef PySocket_BUILDING_SOCKET
/* --- C API ----------------------------------------------------*/
@@ -104,10 +105,9 @@ typedef struct {
&key_file, &cert_file))
return NULL;
...
-
*/
-static
+static
PySocketModule_APIObject PySocketModule;
/* You *must* call this before using any of the functions in
@@ -121,37 +121,37 @@ PySocketModule_APIObject PySocketModule;
static
int PySocketModule_ImportModuleAndAPI(void)
{
- PyObject *mod = 0, *v = 0;
- char *apimodule = PySocket_MODULE_NAME;
- char *apiname = PySocket_CAPI_NAME;
- void *api;
-
- DPRINTF("Importing the %s C API...\n",apimodule);
- mod = PyImport_ImportModule(apimodule);
- if (mod == NULL)
- goto onError;
- DPRINTF(" %s package found\n",apimodule);
- v = PyObject_GetAttrString(mod,apiname);
- if (v == NULL)
- goto onError;
- Py_DECREF(mod);
- DPRINTF(" API object %s found\n",apiname);
- api = PyCObject_AsVoidPtr(v);
- if (api == NULL)
- goto onError;
- Py_DECREF(v);
- memcpy(&PySocketModule, api, sizeof(PySocketModule));
- DPRINTF(" API object loaded and initialized.\n");
- return 0;
-
+ PyObject *mod = 0, *v = 0;
+ char *apimodule = PySocket_MODULE_NAME;
+ char *apiname = PySocket_CAPI_NAME;
+ void *api;
+
+ DPRINTF("Importing the %s C API...\n", apimodule);
+ mod = PyImport_ImportModule(apimodule);
+ if (mod == NULL)
+ goto onError;
+ DPRINTF(" %s package found\n", apimodule);
+ v = PyObject_GetAttrString(mod, apiname);
+ if (v == NULL)
+ goto onError;
+ Py_DECREF(mod);
+ DPRINTF(" API object %s found\n", apiname);
+ api = PyCObject_AsVoidPtr(v);
+ if (api == NULL)
+ goto onError;
+ Py_DECREF(v);
+ memcpy(&PySocketModule, api, sizeof(PySocketModule));
+ DPRINTF(" API object loaded and initialized.\n");
+ return 0;
+
onError:
- DPRINTF(" not found.\n");
- Py_XDECREF(mod);
- Py_XDECREF(v);
- return -1;
+ DPRINTF(" not found.\n");
+ Py_XDECREF(mod);
+ Py_XDECREF(v);
+ return -1;
}
-#endif
+#endif /* !PySocket_BUILDING_SOCKET */
#ifdef __cplusplus
}