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/append.c | |
parent | b11b1c52280f172ebfa42c3da906ea9aa3ea8799 (diff) | |
download | magi-23f3f8592c21ee58b0ac040736b5b766d52de193.tar magi-23f3f8592c21ee58b0ac040736b5b766d52de193.tar.xz magi-23f3f8592c21ee58b0ac040736b5b766d52de193.zip |
Cosmetical changes.
Diffstat (limited to 'examples/append.c')
-rw-r--r-- | examples/append.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/examples/append.c b/examples/append.c index b8aa1cf..b6ee217 100644 --- a/examples/append.c +++ b/examples/append.c @@ -8,9 +8,9 @@ void handle_request() { struct magi_request request; if (magi_cgi(&request, 0, 0)) { - struct magi_field *a = magi_field_list_get(request.fields, "addon"); + struct magi_field * a = magi_field_list_get(request.fields, "addon"); if (a && a->data) { - FILE *file = fopen("file_to_append", "a"); + FILE * file = fopen("file_to_append", "a"); fputs(a->data, file); fclose(file); } @@ -25,22 +25,20 @@ void print_preamble() void print_webpage() { - 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>Append to File</title></head>" - "<body>" - "<form action='/cgi-bin/append' method='get'><fieldset>" - "<input type='text' name='addon' value='Whatever you want to add.'/>" - "<input type='submit' value='Append'/>" - "</fieldset></form>" - "</body>" - "</html>" - ); + 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>Append to File</title></head>" + "<body>" + "<form action='/cgi-bin/append' method='get'><fieldset>" + "<input type='text' name='addon' value='Whatever you want to add.'/>" + "<input type='submit' value='Append'/>" + "</fieldset></form>" + "</body>" + "</html>"); } -int main(int argc, char const *argv[]) +int main(int argc, char const * argv[]) { handle_request(); print_preamble(); |