From f3f9c925687d262547d0e203ad3216fa6f46fd5d Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Sun, 22 Sep 2019 11:03:31 +0300 Subject: . --- examples/cookie.c | 58 ------------------------------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 examples/cookie.c (limited to 'examples/cookie.c') diff --git a/examples/cookie.c b/examples/cookie.c deleted file mode 100644 index 8f4018b..0000000 --- a/examples/cookie.c +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include -#include -#include - - -void print_preamble() -{ - puts( - "Set-Cookie:cookie=monstre\r\n" /* Important to set cookies before: */ - "Content-Type: application/xhtml+xml\r\n\r\n" - ); -} - -void print_webpage_top() -{ - puts( - "" - "" - "Cookie Listing and Setting" - "" - ); -} - -void read_and_print_cookies() -{ - struct magi_request request; - if (magi_request_build_cgi(&request, 0, 0)) { - struct magi_cookie_list *cookie; - for (cookie = request.cookies; cookie; cookie = cookie->next) { - printf( - "[%s] = [%s]
", - cookie->item.name, - cookie->item.data - ); - } - magi_request_destroy(&request); - } -} - -void print_webpage_bottom() -{ - puts( - "" - "" - ); -} - -int main(int argc, char const *argv[]) -{ - print_preamble(); - /* Following probably will be much more pleasant with use of templates. */ - print_webpage_top(); - read_and_print_cookies(); - print_webpage_bottom(); - return 0; -} -- cgit v1.2.3