diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-08 23:36:41 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-08 23:36:41 +0200 |
commit | de872dea2d88f183c3f434c694acdcdb373f639c (patch) | |
tree | fb9084eb931c9789060e65ee3be3dc5adcb30e73 /src/examples | |
parent | 6347f514aa2388e774d5bf356df8046864e5f73c (diff) | |
download | libmicrohttpd-de872dea2d88f183c3f434c694acdcdb373f639c.tar.gz libmicrohttpd-de872dea2d88f183c3f434c694acdcdb373f639c.zip |
define and use 'enum MHD_Result'
Diffstat (limited to 'src/examples')
24 files changed, 77 insertions, 77 deletions
diff --git a/src/examples/authorization_example.c b/src/examples/authorization_example.c index 40bffcb7..644b03ef 100644 --- a/src/examples/authorization_example.c +++ b/src/examples/authorization_example.c | |||
@@ -39,7 +39,7 @@ | |||
39 | "<html><head><title>Access denied</title></head><body>Access denied</body></html>" | 39 | "<html><head><title>Access denied</title></head><body>Access denied</body></html>" |
40 | 40 | ||
41 | 41 | ||
42 | static int | 42 | static enum MHD_Result |
43 | ahc_echo (void *cls, | 43 | ahc_echo (void *cls, |
44 | struct MHD_Connection *connection, | 44 | struct MHD_Connection *connection, |
45 | const char *url, | 45 | const char *url, |
@@ -50,7 +50,7 @@ ahc_echo (void *cls, | |||
50 | static int aptr; | 50 | static int aptr; |
51 | const char *me = cls; | 51 | const char *me = cls; |
52 | struct MHD_Response *response; | 52 | struct MHD_Response *response; |
53 | int ret; | 53 | enum MHD_Result ret; |
54 | char *user; | 54 | char *user; |
55 | char *pass; | 55 | char *pass; |
56 | int fail; | 56 | int fail; |
diff --git a/src/examples/benchmark.c b/src/examples/benchmark.c index 9b07e5c8..939995c9 100644 --- a/src/examples/benchmark.c +++ b/src/examples/benchmark.c | |||
@@ -106,7 +106,7 @@ uri_logger_cb (void *cls, | |||
106 | } | 106 | } |
107 | 107 | ||
108 | 108 | ||
109 | static int | 109 | static enum MHD_Result |
110 | ahc_echo (void *cls, | 110 | ahc_echo (void *cls, |
111 | struct MHD_Connection *connection, | 111 | struct MHD_Connection *connection, |
112 | const char *url, | 112 | const char *url, |
diff --git a/src/examples/benchmark_https.c b/src/examples/benchmark_https.c index 53b83e0a..6f0cd478 100644 --- a/src/examples/benchmark_https.c +++ b/src/examples/benchmark_https.c | |||
@@ -106,7 +106,7 @@ uri_logger_cb (void *cls, | |||
106 | } | 106 | } |
107 | 107 | ||
108 | 108 | ||
109 | static int | 109 | static enum MHD_Result |
110 | ahc_echo (void *cls, | 110 | ahc_echo (void *cls, |
111 | struct MHD_Connection *connection, | 111 | struct MHD_Connection *connection, |
112 | const char *url, | 112 | const char *url, |
diff --git a/src/examples/chunked_example.c b/src/examples/chunked_example.c index 9b2cb51c..19a37155 100644 --- a/src/examples/chunked_example.c +++ b/src/examples/chunked_example.c | |||
@@ -86,7 +86,7 @@ static const char simple_response_text[] = | |||
86 | "<body>Simple response text</body></html>"; | 86 | "<body>Simple response text</body></html>"; |
87 | 87 | ||
88 | 88 | ||
89 | static int | 89 | static enum MHD_Result |
90 | ahc_echo (void *cls, | 90 | ahc_echo (void *cls, |
91 | struct MHD_Connection *connection, | 91 | struct MHD_Connection *connection, |
92 | const char *url, | 92 | const char *url, |
@@ -99,7 +99,7 @@ ahc_echo (void *cls, | |||
99 | static int aptr; | 99 | static int aptr; |
100 | struct ResponseContentCallbackParam *callback_param; | 100 | struct ResponseContentCallbackParam *callback_param; |
101 | struct MHD_Response *response; | 101 | struct MHD_Response *response; |
102 | int ret; | 102 | enum MHD_Result ret; |
103 | (void) cls; /* Unused. Silent compiler warning. */ | 103 | (void) cls; /* Unused. Silent compiler warning. */ |
104 | (void) url; /* Unused. Silent compiler warning. */ | 104 | (void) url; /* Unused. Silent compiler warning. */ |
105 | (void) version; /* Unused. Silent compiler warning. */ | 105 | (void) version; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/demo.c b/src/examples/demo.c index c7ad4b30..978bd235 100644 --- a/src/examples/demo.c +++ b/src/examples/demo.c | |||
@@ -264,7 +264,7 @@ struct ResponseDataContext | |||
264 | * @param dirname name of the directory to list | 264 | * @param dirname name of the directory to list |
265 | * @return #MHD_YES on success, #MHD_NO on error | 265 | * @return #MHD_YES on success, #MHD_NO on error |
266 | */ | 266 | */ |
267 | static int | 267 | static enum MHD_Result |
268 | list_directory (struct ResponseDataContext *rdc, | 268 | list_directory (struct ResponseDataContext *rdc, |
269 | const char *dirname) | 269 | const char *dirname) |
270 | { | 270 | { |
@@ -444,7 +444,7 @@ struct UploadContext | |||
444 | * @param size number of bytes in 'data' | 444 | * @param size number of bytes in 'data' |
445 | * @return #MHD_NO on allocation failure, #MHD_YES on success | 445 | * @return #MHD_NO on allocation failure, #MHD_YES on success |
446 | */ | 446 | */ |
447 | static int | 447 | static enum MHD_Result |
448 | do_append (char **ret, | 448 | do_append (char **ret, |
449 | const char *data, | 449 | const char *data, |
450 | size_t size) | 450 | size_t size) |
@@ -493,7 +493,7 @@ do_append (char **ret, | |||
493 | * @return #MHD_YES to continue iterating, | 493 | * @return #MHD_YES to continue iterating, |
494 | * #MHD_NO to abort the iteration | 494 | * #MHD_NO to abort the iteration |
495 | */ | 495 | */ |
496 | static int | 496 | static enum MHD_Result |
497 | process_upload_data (void *cls, | 497 | process_upload_data (void *cls, |
498 | enum MHD_ValueKind kind, | 498 | enum MHD_ValueKind kind, |
499 | const char *key, | 499 | const char *key, |
@@ -662,12 +662,12 @@ response_completed_callback (void *cls, | |||
662 | * Return the current directory listing. | 662 | * Return the current directory listing. |
663 | * | 663 | * |
664 | * @param connection connection to return the directory for | 664 | * @param connection connection to return the directory for |
665 | * @return MHD_YES on success, MHD_NO on error | 665 | * @return #MHD_YES on success, #MHD_NO on error |
666 | */ | 666 | */ |
667 | static int | 667 | static enum MHD_Result |
668 | return_directory_response (struct MHD_Connection *connection) | 668 | return_directory_response (struct MHD_Connection *connection) |
669 | { | 669 | { |
670 | int ret; | 670 | enum MHD_Result ret; |
671 | 671 | ||
672 | (void) pthread_mutex_lock (&mutex); | 672 | (void) pthread_mutex_lock (&mutex); |
673 | if (NULL == cached_directory_response) | 673 | if (NULL == cached_directory_response) |
@@ -696,7 +696,7 @@ return_directory_response (struct MHD_Connection *connection) | |||
696 | * @param ptr our context | 696 | * @param ptr our context |
697 | * @return #MHD_YES on success, #MHD_NO to drop connection | 697 | * @return #MHD_YES on success, #MHD_NO to drop connection |
698 | */ | 698 | */ |
699 | static int | 699 | static enum MHD_Result |
700 | generate_page (void *cls, | 700 | generate_page (void *cls, |
701 | struct MHD_Connection *connection, | 701 | struct MHD_Connection *connection, |
702 | const char *url, | 702 | const char *url, |
@@ -706,7 +706,7 @@ generate_page (void *cls, | |||
706 | size_t *upload_data_size, void **ptr) | 706 | size_t *upload_data_size, void **ptr) |
707 | { | 707 | { |
708 | struct MHD_Response *response; | 708 | struct MHD_Response *response; |
709 | int ret; | 709 | enum MHD_Result ret; |
710 | int fd; | 710 | int fd; |
711 | struct stat buf; | 711 | struct stat buf; |
712 | (void) cls; /* Unused. Silent compiler warning. */ | 712 | (void) cls; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/demo_https.c b/src/examples/demo_https.c index 7cd98b68..2a60fcda 100644 --- a/src/examples/demo_https.c +++ b/src/examples/demo_https.c | |||
@@ -267,7 +267,7 @@ struct ResponseDataContext | |||
267 | * @param dirname name of the directory to list | 267 | * @param dirname name of the directory to list |
268 | * @return MHD_YES on success, MHD_NO on error | 268 | * @return MHD_YES on success, MHD_NO on error |
269 | */ | 269 | */ |
270 | static int | 270 | static enum MHD_Result |
271 | list_directory (struct ResponseDataContext *rdc, | 271 | list_directory (struct ResponseDataContext *rdc, |
272 | const char *dirname) | 272 | const char *dirname) |
273 | { | 273 | { |
@@ -447,7 +447,7 @@ struct UploadContext | |||
447 | * @param size number of bytes in 'data' | 447 | * @param size number of bytes in 'data' |
448 | * @return #MHD_NO on allocation failure, #MHD_YES on success | 448 | * @return #MHD_NO on allocation failure, #MHD_YES on success |
449 | */ | 449 | */ |
450 | static int | 450 | static enum MHD_Result |
451 | do_append (char **ret, | 451 | do_append (char **ret, |
452 | const char *data, | 452 | const char *data, |
453 | size_t size) | 453 | size_t size) |
@@ -493,10 +493,10 @@ do_append (char **ret, | |||
493 | * specified offset | 493 | * specified offset |
494 | * @param off offset of data in the overall value | 494 | * @param off offset of data in the overall value |
495 | * @param size number of bytes in data available | 495 | * @param size number of bytes in data available |
496 | * @return MHD_YES to continue iterating, | 496 | * @return #MHD_YES to continue iterating, |
497 | * MHD_NO to abort the iteration | 497 | * #MHD_NO to abort the iteration |
498 | */ | 498 | */ |
499 | static int | 499 | static enum MHD_Result |
500 | process_upload_data (void *cls, | 500 | process_upload_data (void *cls, |
501 | enum MHD_ValueKind kind, | 501 | enum MHD_ValueKind kind, |
502 | const char *key, | 502 | const char *key, |
@@ -667,10 +667,10 @@ response_completed_callback (void *cls, | |||
667 | * @param connection connection to return the directory for | 667 | * @param connection connection to return the directory for |
668 | * @return MHD_YES on success, MHD_NO on error | 668 | * @return MHD_YES on success, MHD_NO on error |
669 | */ | 669 | */ |
670 | static int | 670 | static enum MHD_Result |
671 | return_directory_response (struct MHD_Connection *connection) | 671 | return_directory_response (struct MHD_Connection *connection) |
672 | { | 672 | { |
673 | int ret; | 673 | enum MHD_Result ret; |
674 | 674 | ||
675 | (void) pthread_mutex_lock (&mutex); | 675 | (void) pthread_mutex_lock (&mutex); |
676 | if (NULL == cached_directory_response) | 676 | if (NULL == cached_directory_response) |
@@ -699,7 +699,7 @@ return_directory_response (struct MHD_Connection *connection) | |||
699 | * @param ptr our context | 699 | * @param ptr our context |
700 | * @return #MHD_YES on success, #MHD_NO to drop connection | 700 | * @return #MHD_YES on success, #MHD_NO to drop connection |
701 | */ | 701 | */ |
702 | static int | 702 | static enum MHD_Result |
703 | generate_page (void *cls, | 703 | generate_page (void *cls, |
704 | struct MHD_Connection *connection, | 704 | struct MHD_Connection *connection, |
705 | const char *url, | 705 | const char *url, |
@@ -709,7 +709,7 @@ generate_page (void *cls, | |||
709 | size_t *upload_data_size, void **ptr) | 709 | size_t *upload_data_size, void **ptr) |
710 | { | 710 | { |
711 | struct MHD_Response *response; | 711 | struct MHD_Response *response; |
712 | int ret; | 712 | enum MHD_Result ret; |
713 | int fd; | 713 | int fd; |
714 | struct stat buf; | 714 | struct stat buf; |
715 | (void) cls; /* Unused. Silent compiler warning. */ | 715 | (void) cls; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/digest_auth_example.c b/src/examples/digest_auth_example.c index 25fb4086..e3edf206 100644 --- a/src/examples/digest_auth_example.c +++ b/src/examples/digest_auth_example.c | |||
@@ -34,7 +34,7 @@ | |||
34 | 34 | ||
35 | #define MY_OPAQUE_STR "11733b200778ce33060f31c9af70a870ba96ddd4" | 35 | #define MY_OPAQUE_STR "11733b200778ce33060f31c9af70a870ba96ddd4" |
36 | 36 | ||
37 | static int | 37 | static enum MHD_Result |
38 | ahc_echo (void *cls, | 38 | ahc_echo (void *cls, |
39 | struct MHD_Connection *connection, | 39 | struct MHD_Connection *connection, |
40 | const char *url, | 40 | const char *url, |
@@ -46,7 +46,7 @@ ahc_echo (void *cls, | |||
46 | char *username; | 46 | char *username; |
47 | const char *password = "testpass"; | 47 | const char *password = "testpass"; |
48 | const char *realm = "test@example.com"; | 48 | const char *realm = "test@example.com"; |
49 | int ret; | 49 | enum MHD_Result ret; |
50 | (void) cls; /* Unused. Silent compiler warning. */ | 50 | (void) cls; /* Unused. Silent compiler warning. */ |
51 | (void) url; /* Unused. Silent compiler warning. */ | 51 | (void) url; /* Unused. Silent compiler warning. */ |
52 | (void) method; /* Unused. Silent compiler warning. */ | 52 | (void) method; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/dual_stack_example.c b/src/examples/dual_stack_example.c index ffacec4a..15bafc44 100644 --- a/src/examples/dual_stack_example.c +++ b/src/examples/dual_stack_example.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #define PAGE \ | 28 | #define PAGE \ |
29 | "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd demo</body></html>" | 29 | "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd demo</body></html>" |
30 | 30 | ||
31 | static int | 31 | static enum MHD_Result |
32 | ahc_echo (void *cls, | 32 | ahc_echo (void *cls, |
33 | struct MHD_Connection *connection, | 33 | struct MHD_Connection *connection, |
34 | const char *url, | 34 | const char *url, |
@@ -39,7 +39,7 @@ ahc_echo (void *cls, | |||
39 | static int aptr; | 39 | static int aptr; |
40 | const char *me = cls; | 40 | const char *me = cls; |
41 | struct MHD_Response *response; | 41 | struct MHD_Response *response; |
42 | int ret; | 42 | enum MHD_Result ret; |
43 | (void) url; /* Unused. Silent compiler warning. */ | 43 | (void) url; /* Unused. Silent compiler warning. */ |
44 | (void) version; /* Unused. Silent compiler warning. */ | 44 | (void) version; /* Unused. Silent compiler warning. */ |
45 | (void) upload_data; /* Unused. Silent compiler warning. */ | 45 | (void) upload_data; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/fileserver_example.c b/src/examples/fileserver_example.c index 46e6aad6..767810f9 100644 --- a/src/examples/fileserver_example.c +++ b/src/examples/fileserver_example.c | |||
@@ -41,7 +41,7 @@ | |||
41 | #define S_ISREG(x) (S_IFREG == (x & S_IFREG)) | 41 | #define S_ISREG(x) (S_IFREG == (x & S_IFREG)) |
42 | #endif /* S_ISREG */ | 42 | #endif /* S_ISREG */ |
43 | 43 | ||
44 | static int | 44 | static enum MHD_Result |
45 | ahc_echo (void *cls, | 45 | ahc_echo (void *cls, |
46 | struct MHD_Connection *connection, | 46 | struct MHD_Connection *connection, |
47 | const char *url, | 47 | const char *url, |
@@ -52,7 +52,7 @@ ahc_echo (void *cls, | |||
52 | { | 52 | { |
53 | static int aptr; | 53 | static int aptr; |
54 | struct MHD_Response *response; | 54 | struct MHD_Response *response; |
55 | int ret; | 55 | enum MHD_Result ret; |
56 | int fd; | 56 | int fd; |
57 | struct stat buf; | 57 | struct stat buf; |
58 | (void) cls; /* Unused. Silent compiler warning. */ | 58 | (void) cls; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/fileserver_example_dirs.c b/src/examples/fileserver_example_dirs.c index 2b544b69..e6c9ed1f 100644 --- a/src/examples/fileserver_example_dirs.c +++ b/src/examples/fileserver_example_dirs.c | |||
@@ -81,7 +81,7 @@ dir_reader (void *cls, uint64_t pos, char *buf, size_t max) | |||
81 | } | 81 | } |
82 | 82 | ||
83 | 83 | ||
84 | static int | 84 | static enum MHD_Result |
85 | ahc_echo (void *cls, | 85 | ahc_echo (void *cls, |
86 | struct MHD_Connection *connection, | 86 | struct MHD_Connection *connection, |
87 | const char *url, | 87 | const char *url, |
@@ -92,7 +92,7 @@ ahc_echo (void *cls, | |||
92 | { | 92 | { |
93 | static int aptr; | 93 | static int aptr; |
94 | struct MHD_Response *response; | 94 | struct MHD_Response *response; |
95 | int ret; | 95 | enum MHD_Result ret; |
96 | FILE *file; | 96 | FILE *file; |
97 | int fd; | 97 | int fd; |
98 | DIR *dir; | 98 | DIR *dir; |
diff --git a/src/examples/fileserver_example_external_select.c b/src/examples/fileserver_example_external_select.c index 187cdf7e..7209751f 100644 --- a/src/examples/fileserver_example_external_select.c +++ b/src/examples/fileserver_example_external_select.c | |||
@@ -48,7 +48,7 @@ free_callback (void *cls) | |||
48 | } | 48 | } |
49 | 49 | ||
50 | 50 | ||
51 | static int | 51 | static enum MHD_Result |
52 | ahc_echo (void *cls, | 52 | ahc_echo (void *cls, |
53 | struct MHD_Connection *connection, | 53 | struct MHD_Connection *connection, |
54 | const char *url, | 54 | const char *url, |
@@ -59,7 +59,7 @@ ahc_echo (void *cls, | |||
59 | { | 59 | { |
60 | static int aptr; | 60 | static int aptr; |
61 | struct MHD_Response *response; | 61 | struct MHD_Response *response; |
62 | int ret; | 62 | enum MHD_Result ret; |
63 | FILE *file; | 63 | FILE *file; |
64 | int fd; | 64 | int fd; |
65 | struct stat buf; | 65 | struct stat buf; |
diff --git a/src/examples/http_chunked_compression.c b/src/examples/http_chunked_compression.c index ba71923b..07fd00ec 100644 --- a/src/examples/http_chunked_compression.c +++ b/src/examples/http_chunked_compression.c | |||
@@ -51,13 +51,13 @@ struct Holder | |||
51 | void *buf; | 51 | void *buf; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | static int | 54 | static enum MHD_Result |
55 | compress_buf (z_stream *strm, const void *src, size_t src_size, size_t *offset, | 55 | compress_buf (z_stream *strm, const void *src, size_t src_size, size_t *offset, |
56 | void **dest, size_t *dest_size, | 56 | void **dest, size_t *dest_size, |
57 | void *tmp) | 57 | void *tmp) |
58 | { | 58 | { |
59 | unsigned int have; | 59 | unsigned int have; |
60 | int ret; | 60 | enum MHD_Result ret; |
61 | int flush; | 61 | int flush; |
62 | void *tmp_dest; | 62 | void *tmp_dest; |
63 | *dest = NULL; | 63 | *dest = NULL; |
@@ -152,14 +152,14 @@ free_cb (void *cls) | |||
152 | } | 152 | } |
153 | 153 | ||
154 | 154 | ||
155 | static int | 155 | static enum MHD_Result |
156 | ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const | 156 | ahc_echo (void *cls, struct MHD_Connection *con, const char *url, const |
157 | char *method, const char *version, | 157 | char *method, const char *version, |
158 | const char *upload_data, size_t *upload_size, void **ptr) | 158 | const char *upload_data, size_t *upload_size, void **ptr) |
159 | { | 159 | { |
160 | struct Holder *holder; | 160 | struct Holder *holder; |
161 | struct MHD_Response *res; | 161 | struct MHD_Response *res; |
162 | int ret; | 162 | enum MHD_Result ret; |
163 | (void) cls; | 163 | (void) cls; |
164 | (void) url; | 164 | (void) url; |
165 | (void) method; | 165 | (void) method; |
diff --git a/src/examples/http_compression.c b/src/examples/http_compression.c index f7d8db21..0419a803 100644 --- a/src/examples/http_compression.c +++ b/src/examples/http_compression.c | |||
@@ -31,7 +31,7 @@ | |||
31 | "hello, hello. This is a 'hello world' message for the world, " \ | 31 | "hello, hello. This is a 'hello world' message for the world, " \ |
32 | "repeat, for the world.</body></html>" | 32 | "repeat, for the world.</body></html>" |
33 | 33 | ||
34 | static int | 34 | static enum MHD_Result |
35 | can_compress (struct MHD_Connection *con) | 35 | can_compress (struct MHD_Connection *con) |
36 | { | 36 | { |
37 | const char *ae; | 37 | const char *ae; |
@@ -60,7 +60,7 @@ can_compress (struct MHD_Connection *con) | |||
60 | } | 60 | } |
61 | 61 | ||
62 | 62 | ||
63 | static int | 63 | static enum MHD_Result |
64 | body_compress (void **buf, | 64 | body_compress (void **buf, |
65 | size_t *buf_size) | 65 | size_t *buf_size) |
66 | { | 66 | { |
@@ -90,7 +90,7 @@ body_compress (void **buf, | |||
90 | } | 90 | } |
91 | 91 | ||
92 | 92 | ||
93 | static int | 93 | static enum MHD_Result |
94 | ahc_echo (void *cls, | 94 | ahc_echo (void *cls, |
95 | struct MHD_Connection *connection, | 95 | struct MHD_Connection *connection, |
96 | const char *url, | 96 | const char *url, |
@@ -99,8 +99,8 @@ ahc_echo (void *cls, | |||
99 | const char *upload_data, size_t *upload_data_size, void **ptr) | 99 | const char *upload_data, size_t *upload_data_size, void **ptr) |
100 | { | 100 | { |
101 | struct MHD_Response *response; | 101 | struct MHD_Response *response; |
102 | int ret; | 102 | enum MHD_Result ret; |
103 | int comp; | 103 | enum MHD_Result comp; |
104 | size_t body_len; | 104 | size_t body_len; |
105 | char *body_str; | 105 | char *body_str; |
106 | (void) cls; /* Unused. Silent compiler warning. */ | 106 | (void) cls; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/https_fileserver_example.c b/src/examples/https_fileserver_example.c index 627bc739..5148c8b6 100644 --- a/src/examples/https_fileserver_example.c +++ b/src/examples/https_fileserver_example.c | |||
@@ -113,7 +113,7 @@ file_free_callback (void *cls) | |||
113 | 113 | ||
114 | 114 | ||
115 | /* HTTP access handler call back */ | 115 | /* HTTP access handler call back */ |
116 | static int | 116 | static enum MHD_Result |
117 | http_ahc (void *cls, | 117 | http_ahc (void *cls, |
118 | struct MHD_Connection *connection, | 118 | struct MHD_Connection *connection, |
119 | const char *url, | 119 | const char *url, |
@@ -124,7 +124,7 @@ http_ahc (void *cls, | |||
124 | { | 124 | { |
125 | static int aptr; | 125 | static int aptr; |
126 | struct MHD_Response *response; | 126 | struct MHD_Response *response; |
127 | int ret; | 127 | enum MHD_Result ret; |
128 | FILE *file; | 128 | FILE *file; |
129 | int fd; | 129 | int fd; |
130 | struct stat buf; | 130 | struct stat buf; |
diff --git a/src/examples/minimal_example.c b/src/examples/minimal_example.c index d6589cf9..a02b5d50 100644 --- a/src/examples/minimal_example.c +++ b/src/examples/minimal_example.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #define PAGE \ | 28 | #define PAGE \ |
29 | "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd demo</body></html>" | 29 | "<html><head><title>libmicrohttpd demo</title></head><body>libmicrohttpd demo</body></html>" |
30 | 30 | ||
31 | static int | 31 | static enum MHD_Result |
32 | ahc_echo (void *cls, | 32 | ahc_echo (void *cls, |
33 | struct MHD_Connection *connection, | 33 | struct MHD_Connection *connection, |
34 | const char *url, | 34 | const char *url, |
@@ -41,7 +41,7 @@ ahc_echo (void *cls, | |||
41 | static int aptr; | 41 | static int aptr; |
42 | const char *me = cls; | 42 | const char *me = cls; |
43 | struct MHD_Response *response; | 43 | struct MHD_Response *response; |
44 | int ret; | 44 | enum MHD_Result ret; |
45 | 45 | ||
46 | (void) url; /* Unused. Silent compiler warning. */ | 46 | (void) url; /* Unused. Silent compiler warning. */ |
47 | (void) version; /* Unused. Silent compiler warning. */ | 47 | (void) version; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/minimal_example_comet.c b/src/examples/minimal_example_comet.c index 80c4258a..c36bf2ce 100644 --- a/src/examples/minimal_example_comet.c +++ b/src/examples/minimal_example_comet.c | |||
@@ -38,7 +38,7 @@ data_generator (void *cls, uint64_t pos, char *buf, size_t max) | |||
38 | } | 38 | } |
39 | 39 | ||
40 | 40 | ||
41 | static int | 41 | static enum MHD_Result |
42 | ahc_echo (void *cls, | 42 | ahc_echo (void *cls, |
43 | struct MHD_Connection *connection, | 43 | struct MHD_Connection *connection, |
44 | const char *url, | 44 | const char *url, |
@@ -48,7 +48,7 @@ ahc_echo (void *cls, | |||
48 | { | 48 | { |
49 | static int aptr; | 49 | static int aptr; |
50 | struct MHD_Response *response; | 50 | struct MHD_Response *response; |
51 | int ret; | 51 | enum MHD_Result ret; |
52 | (void) cls; /* Unused. Silent compiler warning. */ | 52 | (void) cls; /* Unused. Silent compiler warning. */ |
53 | (void) url; /* Unused. Silent compiler warning. */ | 53 | (void) url; /* Unused. Silent compiler warning. */ |
54 | (void) version; /* Unused. Silent compiler warning. */ | 54 | (void) version; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/minimal_example_empty.c b/src/examples/minimal_example_empty.c index 2de1cc8b..986a2504 100644 --- a/src/examples/minimal_example_empty.c +++ b/src/examples/minimal_example_empty.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <microhttpd.h> | 26 | #include <microhttpd.h> |
27 | 27 | ||
28 | 28 | ||
29 | static int | 29 | static enum MHD_Result |
30 | ahc_echo (void *cls, | 30 | ahc_echo (void *cls, |
31 | struct MHD_Connection *connection, | 31 | struct MHD_Connection *connection, |
32 | const char *url, | 32 | const char *url, |
@@ -38,7 +38,7 @@ ahc_echo (void *cls, | |||
38 | { | 38 | { |
39 | static int aptr; | 39 | static int aptr; |
40 | struct MHD_Response *response; | 40 | struct MHD_Response *response; |
41 | int ret; | 41 | enum MHD_Result ret; |
42 | 42 | ||
43 | (void) url; /* Unused. Silent compiler warning. */ | 43 | (void) url; /* Unused. Silent compiler warning. */ |
44 | (void) version; /* Unused. Silent compiler warning. */ | 44 | (void) version; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/minimal_example_empty_tls.c b/src/examples/minimal_example_empty_tls.c index e3daca5f..0b9a0e25 100644 --- a/src/examples/minimal_example_empty_tls.c +++ b/src/examples/minimal_example_empty_tls.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <microhttpd.h> | 26 | #include <microhttpd.h> |
27 | 27 | ||
28 | 28 | ||
29 | static int | 29 | static enum MHD_Result |
30 | ahc_echo (void *cls, | 30 | ahc_echo (void *cls, |
31 | struct MHD_Connection *connection, | 31 | struct MHD_Connection *connection, |
32 | const char *url, | 32 | const char *url, |
@@ -38,7 +38,7 @@ ahc_echo (void *cls, | |||
38 | { | 38 | { |
39 | static int aptr; | 39 | static int aptr; |
40 | struct MHD_Response *response; | 40 | struct MHD_Response *response; |
41 | int ret; | 41 | enum MHD_Result ret; |
42 | 42 | ||
43 | (void) url; /* Unused. Silent compiler warning. */ | 43 | (void) url; /* Unused. Silent compiler warning. */ |
44 | (void) version; /* Unused. Silent compiler warning. */ | 44 | (void) version; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/post_example.c b/src/examples/post_example.c index 885cdb1a..55ca3aa8 100644 --- a/src/examples/post_example.c +++ b/src/examples/post_example.c | |||
@@ -205,10 +205,10 @@ get_session (struct MHD_Connection *connection) | |||
205 | * @param connection connection to process | 205 | * @param connection connection to process |
206 | * @param MHD_YES on success, MHD_NO on failure | 206 | * @param MHD_YES on success, MHD_NO on failure |
207 | */ | 207 | */ |
208 | typedef int (*PageHandler)(const void *cls, | 208 | typedef enum MHD_Result (*PageHandler)(const void *cls, |
209 | const char *mime, | 209 | const char *mime, |
210 | struct Session *session, | 210 | struct Session *session, |
211 | struct MHD_Connection *connection); | 211 | struct MHD_Connection *connection); |
212 | 212 | ||
213 | 213 | ||
214 | /** | 214 | /** |
@@ -274,13 +274,13 @@ add_session_cookie (struct Session *session, | |||
274 | * @param session session handle | 274 | * @param session session handle |
275 | * @param connection connection to use | 275 | * @param connection connection to use |
276 | */ | 276 | */ |
277 | static int | 277 | static enum MHD_Result |
278 | serve_simple_form (const void *cls, | 278 | serve_simple_form (const void *cls, |
279 | const char *mime, | 279 | const char *mime, |
280 | struct Session *session, | 280 | struct Session *session, |
281 | struct MHD_Connection *connection) | 281 | struct MHD_Connection *connection) |
282 | { | 282 | { |
283 | int ret; | 283 | enum MHD_Result ret; |
284 | const char *form = cls; | 284 | const char *form = cls; |
285 | struct MHD_Response *response; | 285 | struct MHD_Response *response; |
286 | 286 | ||
@@ -310,13 +310,13 @@ serve_simple_form (const void *cls, | |||
310 | * @param session session handle | 310 | * @param session session handle |
311 | * @param connection connection to use | 311 | * @param connection connection to use |
312 | */ | 312 | */ |
313 | static int | 313 | static enum MHD_Result |
314 | fill_v1_form (const void *cls, | 314 | fill_v1_form (const void *cls, |
315 | const char *mime, | 315 | const char *mime, |
316 | struct Session *session, | 316 | struct Session *session, |
317 | struct MHD_Connection *connection) | 317 | struct MHD_Connection *connection) |
318 | { | 318 | { |
319 | int ret; | 319 | enum MHD_Result ret; |
320 | size_t slen; | 320 | size_t slen; |
321 | char *reply; | 321 | char *reply; |
322 | struct MHD_Response *response; | 322 | struct MHD_Response *response; |
@@ -359,13 +359,13 @@ fill_v1_form (const void *cls, | |||
359 | * @param session session handle | 359 | * @param session session handle |
360 | * @param connection connection to use | 360 | * @param connection connection to use |
361 | */ | 361 | */ |
362 | static int | 362 | static enum MHD_Result |
363 | fill_v1_v2_form (const void *cls, | 363 | fill_v1_v2_form (const void *cls, |
364 | const char *mime, | 364 | const char *mime, |
365 | struct Session *session, | 365 | struct Session *session, |
366 | struct MHD_Connection *connection) | 366 | struct MHD_Connection *connection) |
367 | { | 367 | { |
368 | int ret; | 368 | enum MHD_Result ret; |
369 | char *reply; | 369 | char *reply; |
370 | struct MHD_Response *response; | 370 | struct MHD_Response *response; |
371 | size_t slen; | 371 | size_t slen; |
@@ -410,13 +410,13 @@ fill_v1_v2_form (const void *cls, | |||
410 | * @param session session handle | 410 | * @param session session handle |
411 | * @param connection connection to use | 411 | * @param connection connection to use |
412 | */ | 412 | */ |
413 | static int | 413 | static enum MHD_Result |
414 | not_found_page (const void *cls, | 414 | not_found_page (const void *cls, |
415 | const char *mime, | 415 | const char *mime, |
416 | struct Session *session, | 416 | struct Session *session, |
417 | struct MHD_Connection *connection) | 417 | struct MHD_Connection *connection) |
418 | { | 418 | { |
419 | int ret; | 419 | enum MHD_Result ret; |
420 | struct MHD_Response *response; | 420 | struct MHD_Response *response; |
421 | (void) cls; /* Unused. Silent compiler warning. */ | 421 | (void) cls; /* Unused. Silent compiler warning. */ |
422 | (void) session; /* Unused. Silent compiler warning. */ | 422 | (void) session; /* Unused. Silent compiler warning. */ |
@@ -469,7 +469,7 @@ static struct Page pages[] = { | |||
469 | * @return MHD_YES to continue iterating, | 469 | * @return MHD_YES to continue iterating, |
470 | * MHD_NO to abort the iteration | 470 | * MHD_NO to abort the iteration |
471 | */ | 471 | */ |
472 | static int | 472 | static enum MHD_Result |
473 | post_iterator (void *cls, | 473 | post_iterator (void *cls, |
474 | enum MHD_ValueKind kind, | 474 | enum MHD_ValueKind kind, |
475 | const char *key, | 475 | const char *key, |
@@ -554,7 +554,7 @@ post_iterator (void *cls, | |||
554 | * MHS_NO if the socket must be closed due to a serios | 554 | * MHS_NO if the socket must be closed due to a serios |
555 | * error while handling the request | 555 | * error while handling the request |
556 | */ | 556 | */ |
557 | static int | 557 | static enum MHD_Result |
558 | create_response (void *cls, | 558 | create_response (void *cls, |
559 | struct MHD_Connection *connection, | 559 | struct MHD_Connection *connection, |
560 | const char *url, | 560 | const char *url, |
@@ -567,7 +567,7 @@ create_response (void *cls, | |||
567 | struct MHD_Response *response; | 567 | struct MHD_Response *response; |
568 | struct Request *request; | 568 | struct Request *request; |
569 | struct Session *session; | 569 | struct Session *session; |
570 | int ret; | 570 | enum MHD_Result ret; |
571 | unsigned int i; | 571 | unsigned int i; |
572 | (void) cls; /* Unused. Silent compiler warning. */ | 572 | (void) cls; /* Unused. Silent compiler warning. */ |
573 | (void) version; /* Unused. Silent compiler warning. */ | 573 | (void) version; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/querystring_example.c b/src/examples/querystring_example.c index 8abd8596..4bff891a 100644 --- a/src/examples/querystring_example.c +++ b/src/examples/querystring_example.c | |||
@@ -29,7 +29,7 @@ | |||
29 | #define PAGE \ | 29 | #define PAGE \ |
30 | "<html><head><title>libmicrohttpd demo</title></head><body>Query string for "%s" was "%s"</body></html>" | 30 | "<html><head><title>libmicrohttpd demo</title></head><body>Query string for "%s" was "%s"</body></html>" |
31 | 31 | ||
32 | static int | 32 | static enum MHD_Result |
33 | ahc_echo (void *cls, | 33 | ahc_echo (void *cls, |
34 | struct MHD_Connection *connection, | 34 | struct MHD_Connection *connection, |
35 | const char *url, | 35 | const char *url, |
@@ -42,7 +42,7 @@ ahc_echo (void *cls, | |||
42 | const char *val; | 42 | const char *val; |
43 | char *me; | 43 | char *me; |
44 | struct MHD_Response *response; | 44 | struct MHD_Response *response; |
45 | int ret; | 45 | enum MHD_Result ret; |
46 | (void) url; /* Unused. Silent compiler warning. */ | 46 | (void) url; /* Unused. Silent compiler warning. */ |
47 | (void) version; /* Unused. Silent compiler warning. */ | 47 | (void) version; /* Unused. Silent compiler warning. */ |
48 | (void) upload_data; /* Unused. Silent compiler warning. */ | 48 | (void) upload_data; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/refuse_post_example.c b/src/examples/refuse_post_example.c index 3a34f36d..7e100d9f 100644 --- a/src/examples/refuse_post_example.c +++ b/src/examples/refuse_post_example.c | |||
@@ -35,7 +35,7 @@ const char *askpage = | |||
35 | #define BUSYPAGE \ | 35 | #define BUSYPAGE \ |
36 | "<html><head><title>Webserver busy</title></head><body>We are too busy to process POSTs right now.</body></html>" | 36 | "<html><head><title>Webserver busy</title></head><body>We are too busy to process POSTs right now.</body></html>" |
37 | 37 | ||
38 | static int | 38 | static enum MHD_Result |
39 | ahc_echo (void *cls, | 39 | ahc_echo (void *cls, |
40 | struct MHD_Connection *connection, | 40 | struct MHD_Connection *connection, |
41 | const char *url, | 41 | const char *url, |
@@ -46,7 +46,7 @@ ahc_echo (void *cls, | |||
46 | static int aptr; | 46 | static int aptr; |
47 | const char *me = cls; | 47 | const char *me = cls; |
48 | struct MHD_Response *response; | 48 | struct MHD_Response *response; |
49 | int ret; | 49 | enum MHD_Result ret; |
50 | (void) cls; /* Unused. Silent compiler warning. */ | 50 | (void) cls; /* Unused. Silent compiler warning. */ |
51 | (void) url; /* Unused. Silent compiler warning. */ | 51 | (void) url; /* Unused. Silent compiler warning. */ |
52 | (void) version; /* Unused. Silent compiler warning. */ | 52 | (void) version; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/suspend_resume_epoll.c b/src/examples/suspend_resume_epoll.c index a69fdc4a..afa1169c 100644 --- a/src/examples/suspend_resume_epoll.c +++ b/src/examples/suspend_resume_epoll.c | |||
@@ -43,7 +43,7 @@ static int epfd; | |||
43 | static struct epoll_event evt; | 43 | static struct epoll_event evt; |
44 | 44 | ||
45 | 45 | ||
46 | static int | 46 | static enum MHD_Result |
47 | ahc_echo (void *cls, | 47 | ahc_echo (void *cls, |
48 | struct MHD_Connection *connection, | 48 | struct MHD_Connection *connection, |
49 | const char *url, | 49 | const char *url, |
@@ -52,7 +52,7 @@ ahc_echo (void *cls, | |||
52 | const char *upload_data, size_t *upload_data_size, void **ptr) | 52 | const char *upload_data, size_t *upload_data_size, void **ptr) |
53 | { | 53 | { |
54 | struct MHD_Response *response; | 54 | struct MHD_Response *response; |
55 | int ret; | 55 | enum MHD_Result ret; |
56 | struct Request*req; | 56 | struct Request*req; |
57 | struct itimerspec ts; | 57 | struct itimerspec ts; |
58 | 58 | ||
diff --git a/src/examples/timeout.c b/src/examples/timeout.c index cfb66950..b31ff21f 100644 --- a/src/examples/timeout.c +++ b/src/examples/timeout.c | |||
@@ -29,7 +29,7 @@ | |||
29 | 29 | ||
30 | #define PORT 8080 | 30 | #define PORT 8080 |
31 | 31 | ||
32 | static int | 32 | static enum MHD_Result |
33 | answer_to_connection (void *cls, | 33 | answer_to_connection (void *cls, |
34 | struct MHD_Connection *connection, | 34 | struct MHD_Connection *connection, |
35 | const char *url, | 35 | const char *url, |
@@ -41,7 +41,7 @@ answer_to_connection (void *cls, | |||
41 | { | 41 | { |
42 | const char *page = "<html><body>Hello timeout!</body></html>"; | 42 | const char *page = "<html><body>Hello timeout!</body></html>"; |
43 | struct MHD_Response *response; | 43 | struct MHD_Response *response; |
44 | int ret; | 44 | enum MHD_Result ret; |
45 | (void) cls; /* Unused. Silent compiler warning. */ | 45 | (void) cls; /* Unused. Silent compiler warning. */ |
46 | (void) url; /* Unused. Silent compiler warning. */ | 46 | (void) url; /* Unused. Silent compiler warning. */ |
47 | (void) version; /* Unused. Silent compiler warning. */ | 47 | (void) version; /* Unused. Silent compiler warning. */ |
diff --git a/src/examples/upgrade_example.c b/src/examples/upgrade_example.c index 98675e09..85a06646 100644 --- a/src/examples/upgrade_example.c +++ b/src/examples/upgrade_example.c | |||
@@ -240,7 +240,7 @@ uh_cb (void *cls, | |||
240 | } | 240 | } |
241 | 241 | ||
242 | 242 | ||
243 | static int | 243 | static enum MHD_Result |
244 | ahc_echo (void *cls, | 244 | ahc_echo (void *cls, |
245 | struct MHD_Connection *connection, | 245 | struct MHD_Connection *connection, |
246 | const char *url, | 246 | const char *url, |
@@ -252,7 +252,7 @@ ahc_echo (void *cls, | |||
252 | { | 252 | { |
253 | static int aptr; | 253 | static int aptr; |
254 | struct MHD_Response *response; | 254 | struct MHD_Response *response; |
255 | int ret; | 255 | enum MHD_Result ret; |
256 | (void) cls; /* Unused. Silent compiler warning. */ | 256 | (void) cls; /* Unused. Silent compiler warning. */ |
257 | (void) url; /* Unused. Silent compiler warning. */ | 257 | (void) url; /* Unused. Silent compiler warning. */ |
258 | (void) version; /* Unused. Silent compiler warning. */ | 258 | (void) version; /* Unused. Silent compiler warning. */ |