]> Nishi Git Mirror - libw3.git/commitdiff
tag parsing
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Mon, 29 Jan 2024 00:24:52 +0000 (00:24 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Mon, 29 Jan 2024 00:24:52 +0000 (00:24 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@127 d27a3e52-49c5-7645-884c-6793ebffc270

Example/w3b/w3b.c
Library/Makefile
Library/Tag.c [new file with mode: 0644]
Library/W3Tag.h [new file with mode: 0644]
W3Version.h.p

index 6efda10973b9e14761fbcd26d518574e8ec7be39..07f7c87f2c9585cd97f7038e7b001acf98988705 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <W3Core.h>
 #include <W3HTTP.h>
+#include <W3Tag.h>
 
 #include <W3URL.h>
 #include <W3Util.h> /* It has some useful functions, you know */
@@ -93,7 +94,13 @@ void access_site(const char* url) {
        }
 }
 
+void html_handler(char* tagname, char** attr){
+}
+
 void render_site(){
+       if(databuf != NULL){
+               W3_Tag_Parse(databuf, datalen, html_handler);
+       }
 }
 
 int main(int argc, char** argv) {
index 19b112b4b34335730a17cef022e1cc28d178ee3a..0465473bc3d81f99475361044d216f533cd23d71 100644 (file)
@@ -1,7 +1,7 @@
 # $Id$
 .PHONY: clean install
 
-OBJS = ./Core.o ./Util.o ./DNS.o ./HTTP.o ./Gopher.o ./POP3.o ./File.o ./URL.o
+OBJS = ./Core.o ./Util.o ./DNS.o ./HTTP.o ./Gopher.o ./POP3.o ./File.o ./URL.o ./Tag.o
 
 ifeq ($(WINDOWS),YES)
 ./w3.dll: $(OBJS)
diff --git a/Library/Tag.c b/Library/Tag.c
new file mode 100644 (file)
index 0000000..948a2b6
--- /dev/null
@@ -0,0 +1,7 @@
+/* $Id$ */
+#include "W3Tag.h"
+
+#include <stddef.h>
+
+void W3_Tag_Parse(char* data, size_t size, void(*func)(char* tagname, char** attr)){
+}
diff --git a/Library/W3Tag.h b/Library/W3Tag.h
new file mode 100644 (file)
index 0000000..61fb34d
--- /dev/null
@@ -0,0 +1,9 @@
+/* $Id$ */
+#ifndef __W3TAG_H__
+#define __W3TAG_H__
+
+#include <stddef.h>
+
+void W3_Tag_Parse(char* data, size_t size, void(*func)(char* tagname, char** attr));
+
+#endif
index 3e628ac238950d22b38ebe5a8953518a33b7ab18..8f9b50ecec0d1105883d61e038e4b041609996e4 100644 (file)
@@ -6,7 +6,7 @@
 extern "C" {
 #endif
 
-#define LIBW3_VERSION "2.0D" \
+#define LIBW3_VERSION "2.1" \
 SUFFIX
 
 #ifdef __cplusplus