From ab5eac798c9df1749a063c32db5096ccfca2e25c Mon Sep 17 00:00:00 2001 From: nishi Date: Tue, 13 Feb 2024 15:34:50 +0000 Subject: [PATCH] nex support git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@209 d27a3e52-49c5-7645-884c-6793ebffc270 --- Library/Core.c | 4 ++++ Library/Makefile | 2 +- Library/URL.c | 3 +++ W3Version.h.p | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Library/Core.c b/Library/Core.c index d020285..e11e851 100644 --- a/Library/Core.c +++ b/Library/Core.c @@ -10,6 +10,7 @@ #include "W3Gopher.h" #include "W3HTTP.h" #include "W3POP3.h" +#include "W3Nex.h" #ifdef SSL_SUPPORT #include "W3Gemini.h" #endif @@ -87,6 +88,7 @@ struct W3* W3_Create(const char* protocol, const char* hostname, int port) { } else if(strcmp(protocol, "gemini") == 0) { } else if(strcmp(protocol, "gophers") == 0) { #endif + } else if(strcmp(protocol, "nex") == 0) { } else if(strcmp(protocol, "finger") == 0) { } else if(strcmp(protocol, "gopher") == 0) { } else if(strcmp(protocol, "pop3") == 0) { @@ -157,6 +159,8 @@ void W3_Send_Request(struct W3* w3) { #endif } else if(strcmp(w3->protocol, "finger") == 0) { __W3_Finger_Request(w3); + } else if(strcmp(w3->protocol, "nex") == 0) { + __W3_Nex_Request(w3); } else if(strcmp(w3->protocol, "file") == 0) { __W3_File_Request(w3); } diff --git a/Library/Makefile b/Library/Makefile index 5672b01..732e56b 100644 --- a/Library/Makefile +++ b/Library/Makefile @@ -1,7 +1,7 @@ # $Id$ .PHONY: clean install -OBJS = ./Core.o ./Util.o ./DNS.o ./HTTP.o ./Gopher.o ./POP3.o ./Finger.o ./File.o ./URL.o ./Tag.o +OBJS = ./Core.o ./Util.o ./DNS.o ./HTTP.o ./Gopher.o ./POP3.o ./Finger.o ./File.o ./Nex.o ./URL.o ./Tag.o ifeq ($(TCL),YES) OBJS += ./Tcl.o diff --git a/Library/URL.c b/Library/URL.c index c80566e..2763719 100644 --- a/Library/URL.c +++ b/Library/URL.c @@ -124,7 +124,10 @@ struct W3URL* W3_Parse_URL(const char* _url) { r->port = 1965; } else if(strcmp(r->protocol, "finger") == 0) { r->port = 79; + }else if(strcmp(r->protocol, "nex") == 0) { + r->port = 1900; } + } r->host = __W3_Strdup(url + start + (atmark == 0 ? 0 : (atmark - 1))); char* str = malloc(strlen(r->host) + 64); diff --git a/W3Version.h.p b/W3Version.h.p index 0f2e398..184456f 100644 --- a/W3Version.h.p +++ b/W3Version.h.p @@ -6,7 +6,7 @@ extern "C" { #endif -#define LIBW3_VERSION "2.9" \ +#define LIBW3_VERSION "2.10" \ SUFFIX #ifdef __cplusplus -- 2.43.0