diff options
author | Sebastian Gerhardt <sebgerhardt@gmx.net> | 2008-08-14 13:00:44 +0000 |
---|---|---|
committer | Sebastian Gerhardt <sebgerhardt@gmx.net> | 2008-08-14 13:00:44 +0000 |
commit | 63f23d21318034a669b1f40954041d3c1bda8ede (patch) | |
tree | e265319c9a5c8697ec678e8b8896f111fe546fd7 /doc/examples/logging.c | |
parent | 28f9d1abbea1c85cd73ad6f4a98545e42756f3bd (diff) | |
download | libmicrohttpd-63f23d21318034a669b1f40954041d3c1bda8ede.tar.gz libmicrohttpd-63f23d21318034a669b1f40954041d3c1bda8ede.zip |
improved adherence to GNU coding standards (logging-example)
Diffstat (limited to 'doc/examples/logging.c')
-rw-r--r-- | doc/examples/logging.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/doc/examples/logging.c b/doc/examples/logging.c index 4fc45d12..503e6087 100644 --- a/doc/examples/logging.c +++ b/doc/examples/logging.c | |||
@@ -6,20 +6,19 @@ | |||
6 | #define PORT 8888 | 6 | #define PORT 8888 |
7 | 7 | ||
8 | 8 | ||
9 | int PrintOutKey(void *cls, enum MHD_ValueKind kind, const char *key, const char *value) | 9 | int print_out_key (void *cls, enum MHD_ValueKind kind, const char *key, const char *value) |
10 | { | 10 | { |
11 | printf("%s = %s\n", key, value); | 11 | printf ("%s = %s\n", key, value); |
12 | return MHD_YES; | 12 | return MHD_YES; |
13 | } | 13 | } |
14 | 14 | ||
15 | int AnswerToConnection(void *cls, struct MHD_Connection *connection, const char *url, | 15 | int answer_to_connection(void *cls, struct MHD_Connection *connection, const char *url, |
16 | const char *method, const char *version, const char *upload_data, | 16 | const char *method, const char *version, const char *upload_data, |
17 | unsigned int *upload_data_size, void **con_cls) | 17 | unsigned int *upload_data_size, void **con_cls) |
18 | { | 18 | { |
19 | 19 | printf ("New request %s for %s using version %s\n", method, url, version); | |
20 | printf("New request %s for %s using version %s\n", method, url, version); | ||
21 | 20 | ||
22 | MHD_get_connection_values(connection, MHD_HEADER_KIND, PrintOutKey, NULL); | 21 | MHD_get_connection_values (connection, MHD_HEADER_KIND, print_out_key, NULL); |
23 | 22 | ||
24 | return MHD_NO; | 23 | return MHD_NO; |
25 | } | 24 | } |
@@ -28,12 +27,12 @@ int main () | |||
28 | { | 27 | { |
29 | struct MHD_Daemon *daemon; | 28 | struct MHD_Daemon *daemon; |
30 | 29 | ||
31 | daemon = MHD_start_daemon(MHD_USE_SELECT_INTERNALLY, PORT, NULL, NULL, | 30 | daemon = MHD_start_daemon (MHD_USE_SELECT_INTERNALLY, PORT, NULL, NULL, |
32 | &AnswerToConnection, NULL, MHD_OPTION_END); | 31 | &answer_to_connection, NULL, MHD_OPTION_END); |
33 | if (daemon == NULL) return 1; | 32 | if (NULL == daemon) return 1; |
34 | 33 | ||
35 | getchar(); | 34 | getchar (); |
36 | 35 | ||
37 | MHD_stop_daemon(daemon); | 36 | MHD_stop_daemon (daemon); |
38 | return 0; | 37 | return 0; |
39 | } | 38 | } |