# $Id$
-.PHONY: clean
+.PHONY: clean examples install
./libw3.res: ./libw3.rc
$(WINDRES) $< -O coff -o $@
+examples:
+ $(MAKE) -C ./fetch CC=$(CC)
+ $(MAKE) -C ./interactive CC=$(CC)
+ $(MAKE) -C ./pop3-list CC=$(CC)
+
+install:
+ $(MAKE) -C ./fetch CC=$(CC) PREFIX=$(PREFIX) install
+ $(MAKE) -C ./interactive CC=$(CC) PREFIX=$(PREFIX) install
+ $(MAKE) -C ./pop3-list CC=$(CC) PREFIX=$(PREFIX) install
+
clean:
rm -f *.o *.so *.core *~ *.exe *.res
+ $(MAKE) -C ./fetch clean
+ $(MAKE) -C ./interactive clean
+ $(MAKE) -C ./pop3-list clean
--- /dev/null
+# $Id$
+.PHONY: clean install
+
+./pop3-list: ./pop3-list.o $(RESFILE)
+ $(CC) -g -o $@ -L ../../Library $^ -lw3
+
+./%.o: ./%.c
+ $(CC) -g -c -o $@ -I ../../Library $<
+
+../libw3.res:
+ $(MAKE) -C .. ./libw3.res WINDRES=$(WINDRES)
+
+clean:
+ rm -f pop3-list *.o *.so *.core *~ *.exe *.res
+
+install: ./pop3-list
+ mkdir -p $(PREFIX)/bin
+ cp ./pop3-list $(PREFIX)/bin/w3-pop3-list
--- /dev/null
+/*
+ * $Id$
+ *
+ * Lists the POP3 mails
+ */
+
+#include <W3Core.h>
+#include <W3POP3.h>
+
+#include <W3URL.h>
+#include <W3Util.h> /* It has some useful functions, you know */
+
+#include <ctype.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+void list_handler(struct W3* w3, char* data, size_t size) {
+}
+
+int main(int argc, char** argv) {
+ W3_Library_Init();
+}
#include "W3File.h"
#include "W3Gopher.h"
#include "W3HTTP.h"
+#include "W3POP3.h"
#include <ctype.h>
#include <stdbool.h>
if(strcmp(protocol, "http") == 0) {
#ifdef SSL_SUPPORT
} else if(strcmp(protocol, "https") == 0) {
+ } else if(strcmp(protocol, "pop3s") == 0){
#endif
} else if(strcmp(protocol, "gopher") == 0) {
+ } else if(strcmp(protocol, "pop3") == 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) {
__W3_Gopher_Request(w3);
+ } else if(strcmp(w3->protocol, "pop3") == 0
+#ifdef SSL_SUPPORT
+ || strcmp(w3->protocol, "pop3s") == 0
+#endif
+ ){
+ __W3_POP3_Request(w3);
} else if(strcmp(w3->protocol, "file") == 0) {
__W3_File_Request(w3);
}
endif
ifeq ($(WINDOWS),YES)
-.PHONY: all clean ./Library/w3.dll ./Example/fetch format
+.PHONY: all clean ./Library/w3.dll ./Example format
ALL := ./Library/w3.dll ./Example
else
-.PHONY: all clean ./Library/libw3.so ./Library/libw3.a ./Example/fetch format
+.PHONY: all clean ./Library/libw3.so ./Library/libw3.a ./Example format
ALL := ./Library/libw3.so ./Library/libw3.a ./Example
$(MAKE) -C ./Library CC=$(CC) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)" ./libw3.a
./Example: ./Library/libw3.so
- $(MAKE) -C ./Example/fetch CC=$(CC)
- $(MAKE) -C ./Example/interactive CC=$(CC)
+ $(MAKE) -C ./Example CC=$(CC) examples
./Library/W3Version.h:
m4 -DSUFFIX=\"\" ./W3Version.h.p > $@
-rm ./w3.pc w3-*.zip w3-*.tar.gz w3-*.lzh ./Library/W3Version.h
$(MAKE) -C ./Library clean
$(MAKE) -C ./Example clean
- $(MAKE) -C ./Example/fetch clean
- $(MAKE) -C ./Example/interactive clean
install: ./w3.pc
- $(MAKE) -C ./Library install PREFIX=$(PREFIX)
- $(MAKE) -C ./Example install PREFIX=$(PREFIX)
+ $(MAKE) -C ./Library install PREFIX=$(PREFIX) CC=$(CC)
+ $(MAKE) -C ./Example install PREFIX=$(PREFIX) CC=$(CC)
mkdir -p $(PREFIX)/lib/pkgconfig
cp ./w3.pc $(PREFIX)/lib/pkgconfig/
archive: all
mkdir -p w3-$(VERSION)/Library
+ mkdir -p w3-$(VERSION)/Example/pop3-list
mkdir -p w3-$(VERSION)/Example/interactive
mkdir -p w3-$(VERSION)/Example/fetch
cp -rf ./Library/*.h w3-$(VERSION)/Library/
cp ./Library/*.dll w3-$(VERSION)/Library/
cp ./Example/fetch/fetch.exe w3-$(VERSION)/Example/fetch/
cp ./Example/interactive/interactive.exe w3-$(VERSION)/Example/interactive/
+ cp ./Example/pop3-list/pop3-list.exe w3-$(VERSION)/Example/pop3-list/
else
cp ./Library/*.so w3-$(VERSION)/Library/
cp ./Example/fetch/fetch w3-$(VERSION)/Example/fetch/
cp ./Example/interactive/interactive w3-$(VERSION)/Example/interactive/
+ cp ./Example/pop3-list/pop3-list w3-$(VERSION)/Example/pop3-list/
endif
-mv w3-$(VERSION)/*.h w3-$(VERSION)/Library/
-mv w3-$(VERSION)/*.so w3-$(VERSION)/Library/