]> Nishi Git Mirror - libw3.git/commitdiff
adding gopher support, wip
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 26 Jan 2024 23:27:18 +0000 (23:27 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Fri, 26 Jan 2024 23:27:18 +0000 (23:27 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@98 d27a3e52-49c5-7645-884c-6793ebffc270

Library/Core.c
W3Version.h.p

index 674c2ff8da1b9cef3d05d817916fa18b14c9e848..2dfac35b42d01581e09f38fe51b7f855d8b0a8d1 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "W3File.h"
 #include "W3HTTP.h"
+#include "W3Gopher.h"
 
 #include <ctype.h>
 #include <stdbool.h>
@@ -70,6 +71,7 @@ struct W3* W3_Create(const char* protocol, const char* hostname, int port) {
 #ifdef SSL_SUPPORT
                } else if(strcmp(protocol, "https") == 0) {
 #endif
+               }else if(strcmp(protocol, "gopher") == 0){
                } else {
                        __W3_Debug("Protocol", "Not suppported");
                        W3_Free(w3);
@@ -105,8 +107,14 @@ void W3_Set_Path(struct W3* w3, const char* path) {
 }
 
 void W3_Send_Request(struct W3* w3) {
-       if(strcmp(w3->protocol, "http") == 0 || strcmp(w3->protocol, "https") == 0) {
+       if(strcmp(w3->protocol, "http") == 0
+#ifdef SSL_SUPPORT
+                       || strcmp(w3->protocol, "https") == 0
+#endif
+       ) {
                __W3_HTTP_Request(w3);
+       }else if(strcmp(w3->protocol, "gopher") == 0){
+               __W3_Gopher_Request(w3);
        } else if(strcmp(w3->protocol, "file") == 0) {
                __W3_File_Request(w3);
        }
index c8f982cc5db83315838db2d7747c6c636abb46e4..ead9e3e9fc1b4a27828d9fc37f17421fb4ce4d2f 100644 (file)
@@ -6,7 +6,7 @@
 extern "C" {
 #endif
 
-#define LIBW3_VERSION "1.6" \
+#define LIBW3_VERSION "1.6A" \
 SUFFIX
 
 #ifdef __cplusplus