]> granicus.if.org Git - python/commitdiff
For readability, switch to tab indents; was using a mix of tab indents,
authorTim Peters <tim.peters@gmail.com>
Sun, 17 Feb 2002 03:58:51 +0000 (03:58 +0000)
committerTim Peters <tim.peters@gmail.com>
Sun, 17 Feb 2002 03:58:51 +0000 (03:58 +0000)
4-space indents, and ambiguous space+tab indents.  Added an XXX comment
about a confusing part.  Still doesn't build on Windows.

Modules/socketmodule.h

index 606db3d827eb8eaf898a1837048d3aae4324fe7a..a1a212262a4fc0ac05e35b6fd47c458c02ffe1bc 100644 (file)
@@ -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
 }