aboutsummaryrefslogtreecommitdiff
path: root/examples/echo.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/echo.c')
-rw-r--r--examples/echo.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/examples/echo.c b/examples/echo.c
index 853e6ce..6901b71 100644
--- a/examples/echo.c
+++ b/examples/echo.c
@@ -6,8 +6,8 @@
#include <stdlib.h>
-void proceed_cookies(
- struct magi_cookie_list * cookies, struct magi_response * response)
+void proceed_cookies(struct magi_cookie_list * cookies,
+ struct magi_response * response)
{
magi_response_content(response, "<h2>Cookies:</h2>");
while (cookies) {
@@ -35,8 +35,8 @@ void proceed_cookies(
magi_response_content(response, "<hr/>");
}
-void proceed_fields(
- struct magi_field_list * fields, struct magi_response * response)
+void proceed_fields(struct magi_field_list * fields,
+ struct magi_response * response)
{
magi_response_content(response, "<h2>Feilds:</h2>");
while (fields) {
@@ -50,8 +50,8 @@ void proceed_fields(
magi_response_content(response, "<hr/>");
}
-void proceed_params(
- struct magi_param_list * params, struct magi_response * response)
+void proceed_params(struct magi_param_list * params,
+ struct magi_response * response)
{
magi_response_content(response, "<h2>HTTP Parameters:</h2>");
while (params) {
@@ -67,9 +67,8 @@ void proceed_params(
void process_meta(struct magi_request * req, struct magi_response * res)
{
- magi_response_content(res,
- "<h1>Echo CGI Script</h1>"
- "I was called with method [");
+ magi_response_content(res, "<h1>Echo CGI Script</h1>"
+ "I was called with method [");
magi_response_content(res, req->method);
if (req->uri) {
magi_response_content(res, "] with URL [");
@@ -97,12 +96,12 @@ void process_meta(struct magi_request * req, struct magi_response * res)
void response_request(struct magi_request * req, struct magi_response * res)
{
magi_response_content_type(res, magi_xhtml);
- magi_response_content(res,
- "<!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>Echo</title></head>"
- "<body>");
+ magi_response_content(
+ res, "<!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>Echo</title></head>"
+ "<body>");
process_meta(req, res);
proceed_cookies(req->cookies, res);
proceed_fields(req->fields, res);