From 9fe00ac7638477a1d71ce2e6e3561e43b36ea427 Mon Sep 17 00:00:00 2001 From: nishi Date: Tue, 13 Feb 2024 15:37:05 +0000 Subject: [PATCH] forgot to add git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@210 d27a3e52-49c5-7645-884c-6793ebffc270 --- Library/Nex.c | 25 +++++++++++++++++++++++++ Library/W3Nex.h | 17 +++++++++++++++++ W3Version.h.p | 2 +- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Library/Nex.c create mode 100644 Library/W3Nex.h diff --git a/Library/Nex.c b/Library/Nex.c new file mode 100644 index 0000000..e28c8db --- /dev/null +++ b/Library/Nex.c @@ -0,0 +1,25 @@ +/* $Id$ */ +#include "W3Nex.h" + +#include "W3Core.h" +#include "W3Util.h" + +#include +#include + +void __W3_Nex_Request(struct W3* w3) { + __W3_Debug("LibW3-Nex", "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) { + int len = __W3_Auto_Read(w3, buf, w3->readsize); + if(len <= 0) break; + void* funcptr = __W3_Get_Event(w3, "data"); + if(funcptr != NULL) { + void (*func)(struct W3*, char*, size_t) = (void (*)(struct W3*, char*, size_t))funcptr; + func(w3, buf, len); + } + } + free(buf); +} diff --git a/Library/W3Nex.h b/Library/W3Nex.h new file mode 100644 index 0000000..99c38d5 --- /dev/null +++ b/Library/W3Nex.h @@ -0,0 +1,17 @@ +/* $Id$ */ +#ifndef __W3NEX_H__ +#define __W3NEX_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "W3Core.h" + +void __W3_Nex_Request(struct W3* w3); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/W3Version.h.p b/W3Version.h.p index 184456f..be27e13 100644 --- a/W3Version.h.p +++ b/W3Version.h.p @@ -6,7 +6,7 @@ extern "C" { #endif -#define LIBW3_VERSION "2.10" \ +#define LIBW3_VERSION "2.10A" \ SUFFIX #ifdef __cplusplus -- 2.43.0