#include "W3Util.h"
#include "W3Version.h"
+#ifdef FTP_SUPPORT
#include "W3FTP.h"
+#endif
+
+#ifdef FILE_SUPPORT
#include "W3File.h"
+#endif
+
+#ifdef FINGER_SUPPORT
#include "W3Finger.h"
+#endif
+
+#ifdef GOPHER_SUPPORT
#include "W3Gopher.h"
+#endif
+
+#ifdef HTTP_SUPPORT
#include "W3HTTP.h"
+#endif
+
+#ifdef NNTP_SUPPORT
#include "W3NNTP.h"
+#endif
+
+#ifdef NEX_SUPPORT
#include "W3Nex.h"
+#endif
+
+#ifdef POP3_SUPPORT
#include "W3POP3.h"
-#ifdef SSL_SUPPORT
+#endif
+
+#ifdef GEMINI_SUPPORT
#include "W3Gemini.h"
#endif
if(strcmp(protocol, "file") != 0) {
if(strcmp(protocol, "http") == 0) {
#ifdef SSL_SUPPORT
+#ifdef HTTP_SUPPORT
} else if(strcmp(protocol, "https") == 0) {
+#endif
+#ifdef POP3_SUPPORT
} else if(strcmp(protocol, "pop3s") == 0) {
+#endif
+#ifdef GEMINI_SUPPORT
} else if(strcmp(protocol, "gemini") == 0) {
+#endif
+#ifdef GOPHER_SUPPORT
} else if(strcmp(protocol, "gophers") == 0) {
#endif
+#endif
+#ifdef NEX_SUPPORT
} else if(strcmp(protocol, "nex") == 0) {
+#endif
+#ifdef FINGER_SUPPORT
} else if(strcmp(protocol, "finger") == 0) {
+#endif
+#ifdef GOPHER_SUPPORT
} else if(strcmp(protocol, "gopher") == 0) {
+#endif
+#ifdef POP3_SUPPORT
} else if(strcmp(protocol, "pop3") == 0) {
+#endif
+#ifdef FTP_SUPPORT
} else if(strcmp(protocol, "ftp") == 0) {
+#endif
+#ifdef NNTP_SUPPORT
} else if(strcmp(protocol, "nntp") == 0) {
+#endif
} else {
__W3_Debug("Protocol", "Not suppported");
W3_Free(w3);
w3 = NULL;
}
}
+#ifndef FILE_SUPPORT
+ else {
+ __W3_Debug("Protocol", "Not suppported");
+ W3_Free(w3);
+ w3 = NULL;
+ return w3;
+ }
+#endif
return w3;
}
}
void W3_Send_Request(struct W3* w3) {
- if(strcmp(w3->protocol, "http") == 0
+ if(0){
+#ifdef HTTP_SUPPORT
+ }else if(strcmp(w3->protocol, "http") == 0
#ifdef SSL_SUPPORT
|| strcmp(w3->protocol, "https") == 0
#endif
) {
__W3_HTTP_Request(w3);
+#endif
+#ifdef GOPHER_SUPPORT
} else if(strcmp(w3->protocol, "gopher") == 0
#ifdef SSL_SUPPORT
|| strcmp(w3->protocol, "gophers") == 0
#endif
) {
__W3_Gopher_Request(w3);
+#endif
+#ifdef POP3_SUPPORT
} else if(strcmp(w3->protocol, "pop3") == 0
#ifdef SSL_SUPPORT
|| strcmp(w3->protocol, "pop3s") == 0
#endif
) {
__W3_POP3_Request(w3);
+#endif
+#ifdef GEMINI_SUPPORT
#ifdef SSL_SUPPORT
} else if(strcmp(w3->protocol, "gemini") == 0) {
__W3_Gemini_Request(w3);
#endif
+#endif
+#ifdef FINGER_SUPPORT
} else if(strcmp(w3->protocol, "finger") == 0) {
__W3_Finger_Request(w3);
+#endif
+#ifdef NEX_SUPPORT
} else if(strcmp(w3->protocol, "nex") == 0) {
__W3_Nex_Request(w3);
+#endif
+#ifdef FTP_SUPPORT
} else if(strcmp(w3->protocol, "ftp") == 0) {
__W3_FTP_Request(w3);
+#endif
+#ifdef NNTP_SUPPORT
} else if(strcmp(w3->protocol, "nntp") == 0) {
__W3_NNTP_Request(w3);
+#endif
+#ifdef FILE_SUPPORT
} else if(strcmp(w3->protocol, "file") == 0) {
__W3_File_Request(w3);
+#endif
}
}
# $Id$
.PHONY: clean install
-OBJS = ./Core.o ./Util.o ./DNS.o ./HTTP.o ./Gopher.o ./POP3.o ./Finger.o ./File.o ./Nex.o ./FTP.o ./NNTP.o ./URL.o ./Tag.o
+OBJS = ./Core.o ./Util.o ./DNS.o ./NNTP.o ./URL.o ./Tag.o
+
+include ./protocol.mk
ifeq ($(TCL),YES)
OBJS += ./Tcl.o
endif
ifeq ($(SSL),YES)
+ifneq ($(GEMINI),NO)
OBJS += ./Gemini.o
+FLAGS += -DGEMINI_SUPPORT
+endif
+endif
+
+ifneq ($(HTTP),NO)
+OBJS += ./HTTP.o
+FLAGS += -DHTTP_SUPPORT
+endif
+
+ifneq ($(GOPHER),NO)
+OBJS += ./Gopher.o
+FLAGS += -DGOPHER_SUPPORT
+endif
+
+ifneq ($(POP3),NO)
+OBJS += ./POP3.o
+FLAGS += -DPOP3_SUPPORT
+endif
+
+ifneq ($(FINGER),NO)
+OBJS += ./Finger.o
+FLAGS += -DFINGER_SUPPORT
+endif
+
+ifneq ($(FILE),NO)
+OBJS += ./File.o
+FLAGS += -DFILE_SUPPORT
+endif
+
+ifneq ($(NEX),NO)
+OBJS += ./Nex.o
+FLAGS += -DNEX_SUPPORT
+endif
+
+ifneq ($(FTP),NO)
+OBJS += ./FTP.o
+FLAGS += -DFTP_SUPPORT
endif
ifeq ($(WINDOWS),YES)
endif
./%.o: ./%.c W3%.h
- $(CC) $(CFLAGS) -I../openssl/include -c -o $@ $<
+ $(CC) $(CFLAGS) $(FLAGS) -I../openssl/include -c -o $@ $<
clean:
rm -f *.o *.so *.core *~ *.dll *.lib *.a *.res