]> git.saurik.com Git - wxWidgets.git/commitdiff
Added GSocket_Init and GSocket_Cleanup
authorGuilhem Lavaux <lavaux@easynet.fr>
Sun, 25 Jul 1999 14:26:15 +0000 (14:26 +0000)
committerGuilhem Lavaux <lavaux@easynet.fr>
Sun, 25 Jul 1999 14:26:15 +0000 (14:26 +0000)
Added wxSocketModule to socket.cpp to call GSocket_Init and GSocket_Cleanup

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3133 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gsocket.h
include/wx/protocol/http.h
src/common/socket.cpp
src/unix/gsocket.c

index 1de9fa618978a1a74203c39b0665026cb61a5f71..19e89e34ed8a8a416800f56ec2513e3e839625aa 100644 (file)
@@ -73,6 +73,13 @@ typedef void (*GSocketFallback)(GSocket *socket, GSocketEvent event,
 extern "C" {
 #endif
 
+/* Global initialisers */
+
+/* GSocket_Init() must be called at the beginning */
+void GSocket_Init();
+/* GSocket_Cleanup() must be called at the ending */
+void GSocket_Cleanup();
+
 /* Constructors / Destructors */
 
 GSocket *GSocket_new();
index 82c1365889acfe6c4a71ce95a1de368045a6a366..ff8a2935b58f3ca853f38cdb53e634db8424066e 100644 (file)
@@ -38,7 +38,8 @@ public:
 
 protected:
   typedef enum {
-    wxHTTP_GET
+    wxHTTP_GET,
+    wxHTTP_HEAD
   } wxHTTP_Req;
   bool BuildRequest(const wxString& path, wxHTTP_Req req);
   void SendHeaders();
index e4b086669bb1bc3b730f8cb3a7aea6988c5ba362..df34996012728eb06d49c1b7718944943d79226d 100644 (file)
@@ -905,5 +905,22 @@ void wxSocketEvent::CopyObject(wxObject& obj_d) const
   event->m_socket = m_socket;
 }
 
+// --------------------------------------------------------------------------
+// wxSocketModule
+// --------------------------------------------------------------------------
+class WXDLLEXPORT wxSocketModule: public wxModule {
+  DECLARE_DYNAMIC_CLASS(wxSocketModule)
+ public:
+  bool OnInit() {
+    GSocket_Init();
+    return TRUE;
+  }
+  void OnExit() {
+    GSocket_Done();
+  }
+};
+
+IMPLEMENT_DYNAMIC_CLASS(wxSocketModule, wxModule)
+
 #endif
   // wxUSE_SOCKETS
index 74ac09de4ca6fde89a12fbdedf8eb8546c9a0981..1aba194f6fffca083a522392070549dcbc3bb6b3 100644 (file)
 
 #endif
 
+/* Global initialisers */
+
+void GSocket_Init()
+{
+}
+
+void GSocket_Cleanup()
+{
+}
+
 /* Constructors / Destructors */
 
 GSocket *GSocket_new()