From 415044a6e8dae982926435554a83c50fa23d652e Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Mon, 4 Nov 2013 19:11:00 +0000 Subject: [PATCH] header file to use HTTP library with c-- git-svn-id: svn://kolibrios.org@4163 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/lib/lib.obj/http.h | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 programs/cmm/lib/lib.obj/http.h diff --git a/programs/cmm/lib/lib.obj/http.h b/programs/cmm/lib/lib.obj/http.h new file mode 100644 index 0000000000..7cc223eb43 --- /dev/null +++ b/programs/cmm/lib/lib.obj/http.h @@ -0,0 +1,34 @@ +//HTTP library + +dword http_lib_init = #aLib_init; +dword http_get = #aHTTPget; +dword http_process = #aHTTPprocess; +$DD 2 dup 0 + +char aLib_init[9] = "lib_init\0"; +char aHTTPget[4] = "get\0"; +char aHTTPprocess[8] = "process\0"; + +#define FLAG_HTTP11 1 << 0 +#define FLAG_GOT_HEADER 1 << 1 +#define FLAG_GOT_DATA 1 << 2 +#define FLAG_CONTENT_LENGTH 1 << 3 +#define FLAG_CHUNKED 1 << 4 + +; error flags go into the upper word +#define FLAG_INVALID_HEADER 1 << 16 +#define FLAG_NO_RAM 1 << 17 +#define FLAG_SOCKET_ERROR 1 << 18 + +struct http_msg{ + dword socket; + dword flags; + dword write_ptr; + dword buffer_length; + dword chunk_ptr; + + dword status; + dword header_length; + dword content_length; + char data[]; +}; \ No newline at end of file