diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2019-11-13 19:16:21 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2019-11-13 19:16:21 +0300 |
commit | 23f3f8592c21ee58b0ac040736b5b766d52de193 (patch) | |
tree | 43e41480fab64d68274340f8fd934bd20c5f27b2 /examples/cookie.c | |
parent | b11b1c52280f172ebfa42c3da906ea9aa3ea8799 (diff) | |
download | magi-23f3f8592c21ee58b0ac040736b5b766d52de193.tar magi-23f3f8592c21ee58b0ac040736b5b766d52de193.tar.xz magi-23f3f8592c21ee58b0ac040736b5b766d52de193.zip |
Cosmetical changes.
Diffstat (limited to 'examples/cookie.c')
-rw-r--r-- | examples/cookie.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/examples/cookie.c b/examples/cookie.c index dd18cc6..5ef56ac 100644 --- a/examples/cookie.c +++ b/examples/cookie.c @@ -7,34 +7,26 @@ void print_preamble() { - puts( - "Set-Cookie:cookie=monstre\r\n" /* Important to set cookies before: */ - "Content-Type: application/xhtml+xml\r\n\r\n" - ); + 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( - "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' " - "'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>" - "<html xmlns='http://www.w3.org/1999/xhtml'>" - "<head><title>Cookie Listing and Setting</title></head>" - "<body>" - ); + puts("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' " + "'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>" + "<html xmlns='http://www.w3.org/1999/xhtml'>" + "<head><title>Cookie Listing and Setting</title></head>" + "<body>"); } void read_and_print_cookies() { struct magi_request request; if (magi_cgi(&request, 0, 0)) { - struct magi_cookie_list *cookie; + struct magi_cookie_list * cookie; for (cookie = request.cookies; cookie; cookie = cookie->next) { - printf( - "[%s] = [%s]<br/>", - cookie->item.name, - cookie->item.data - ); + printf("[%s] = [%s]<br/>", cookie->item.name, cookie->item.data); } magi_request_destroy(&request); } @@ -42,13 +34,11 @@ void read_and_print_cookies() void print_webpage_bottom() { - puts( - "</body>" - "</html>" - ); + puts("</body>" + "</html>"); } -int main(int argc, char const *argv[]) +int main(int argc, char const * argv[]) { print_preamble(); /* Following probably will be much more pleasant with use of templates. */ |