#include "W3Util.h"
#include "W3File.h"
-#include "W3HTTP.h"
#include "W3Gopher.h"
+#include "W3HTTP.h"
#include <ctype.h>
#include <stdbool.h>
#ifdef SSL_SUPPORT
} else if(strcmp(protocol, "https") == 0) {
#endif
- }else if(strcmp(protocol, "gopher") == 0){
+ } else if(strcmp(protocol, "gopher") == 0) {
} else {
__W3_Debug("Protocol", "Not suppported");
W3_Free(w3);
void W3_Send_Request(struct W3* w3) {
if(strcmp(w3->protocol, "http") == 0
#ifdef SSL_SUPPORT
- || strcmp(w3->protocol, "https") == 0
+ || strcmp(w3->protocol, "https") == 0
#endif
) {
__W3_HTTP_Request(w3);
- }else if(strcmp(w3->protocol, "gopher") == 0){
+ } else if(strcmp(w3->protocol, "gopher") == 0) {
__W3_Gopher_Request(w3);
} else if(strcmp(w3->protocol, "file") == 0) {
__W3_File_Request(w3);
#include <string.h>
#ifdef __MINGW32__
-#include <winsock2.h>
#include <windows.h>
+#include <winsock2.h>
#include <ws2tcpip.h>
#else
#include <netdb.h>
#include "W3Core.h"
#include "W3Util.h"
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
void __W3_Gopher_Request(struct W3* w3) {
__W3_Debug("LibW3-Gopher", "Sending the request");
__W3_Auto_Write(w3, w3->path, strlen(w3->path));
__W3_Auto_Write(w3, "\r\n", 2);
char* buf = malloc(w3->readsize);
- while(true){
+ while(true) {
int len = __W3_Auto_Read(w3, buf, w3->readsize);
if(len <= 0) break;
void* funcptr = __W3_Get_Event(w3, "data");
void (*func)(struct W3*, char*, size_t) = (void (*)(struct W3*, char*, size_t))funcptr;
func(w3, buf, len);
}
- }
+ }
free(buf);
}
# $Id$
.PHONY: clean install
-OBJS = ./Core.o ./Util.o ./DNS.o ./HTTP.o ./Gopher.o ./File.o ./URL.o
+OBJS = ./Core.o ./Util.o ./DNS.o ./HTTP.o ./Gopher.o ./POP3.o ./File.o ./URL.o
ifeq ($(WINDOWS),YES)
./w3.dll: $(OBJS)
--- /dev/null
+/* $Id$ */
+#include "W3POP3.h"
+
+#include "W3Core.h"
+#include "W3Util.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+void __W3_POP3_Request(struct W3* w3) {}
r->port = 80;
} else if(strcmp(r->protocol, "https") == 0) {
r->port = 443;
- }else if(strcmp(r->protocol, "gopher") == 0) {
+ } else if(strcmp(r->protocol, "gopher") == 0) {
r->port = 70;
}
-
}
r->host = __W3_Strdup(url + start);
str = malloc(strlen(r->host) + 64);
--- /dev/null
+/* $Id$ */
+#ifndef __W3POP3_H__
+#define __W3POP3_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "W3Core.h"
+
+void __W3_POP3_Request(struct W3* w3);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif