Retry only for https protocol
[elinks.git] / src / protocol / test / stub.c
blobce47145b204ba14ac0ef20530ef808c3111fd3f9
1 #ifdef HAVE_CONFIG_H
2 #include "config.h"
3 #endif
5 #include <stdarg.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
10 #include "elinks.h"
12 #include "bfu/msgbox.h"
13 #include "main/module.h"
14 #include "protocol/file/mailcap.h"
15 #include "protocol/user.h"
16 #include "session/session.h"
17 #include "util/test.h"
19 #define STUB_MODULE(name) \
20 struct module name = struct_module( \
21 /* name: */ "Stub " #name, \
22 /* options: */ NULL, \
23 /* hooks: */ NULL, \
24 /* submodules: */ NULL, \
25 /* data: */ NULL, \
26 /* init: */ NULL, \
27 /* done: */ NULL \
29 STUB_MODULE(auth_module);
30 STUB_MODULE(bittorrent_protocol_module);
31 STUB_MODULE(cgi_protocol_module);
32 STUB_MODULE(file_protocol_module);
33 STUB_MODULE(finger_protocol_module);
34 STUB_MODULE(fsp_protocol_module);
35 STUB_MODULE(ftp_protocol_module);
36 STUB_MODULE(gopher_protocol_module);
37 STUB_MODULE(http_protocol_module);
38 STUB_MODULE(nntp_protocol_module);
39 STUB_MODULE(smb_protocol_module);
40 STUB_MODULE(uri_rewrite_module);
41 STUB_MODULE(user_protocol_module);
43 static void
44 stub_called(const unsigned char *fun)
46 die("FAIL: stub %s\n", fun);
49 #define STUB_PROTOCOL_HANDLER(name) \
50 void \
51 name(struct connection *conn) \
52 { \
53 stub_called(#name); \
54 } \
55 protocol_handler_T name /* consume semicolon */
56 #define STUB_PROTOCOL_EXTERNAL_HANDLER(name) \
57 void \
58 name(struct session *ses, struct uri *uri) \
59 { \
60 stub_called(#name); \
61 } \
62 protocol_external_handler_T name /* consume semicolon */
63 STUB_PROTOCOL_HANDLER(about_protocol_handler);
64 STUB_PROTOCOL_HANDLER(bittorrent_protocol_handler);
65 STUB_PROTOCOL_HANDLER(bittorrent_peer_protocol_handler);
66 STUB_PROTOCOL_HANDLER(data_protocol_handler);
67 STUB_PROTOCOL_EXTERNAL_HANDLER(ecmascript_protocol_handler);
68 STUB_PROTOCOL_HANDLER(file_protocol_handler);
69 STUB_PROTOCOL_HANDLER(finger_protocol_handler);
70 STUB_PROTOCOL_HANDLER(fsp_protocol_handler);
71 STUB_PROTOCOL_HANDLER(ftp_protocol_handler);
72 STUB_PROTOCOL_HANDLER(gopher_protocol_handler);
73 STUB_PROTOCOL_HANDLER(http_protocol_handler);
74 STUB_PROTOCOL_HANDLER(news_protocol_handler);
75 STUB_PROTOCOL_HANDLER(nntp_protocol_handler);
76 STUB_PROTOCOL_HANDLER(proxy_protocol_handler);
77 STUB_PROTOCOL_HANDLER(smb_protocol_handler);
78 STUB_PROTOCOL_EXTERNAL_HANDLER(user_protocol_handler);
80 /* declared in "protocol/user.h" */
81 unsigned char *
82 get_user_program(struct terminal *term, unsigned char *progid, int progidlen)
84 stub_called("get_user_program");
85 return NULL;
88 /* declared in "session/session.h" */
89 void
90 print_error_dialog(struct session *ses, struct connection_state state,
91 struct uri *uri, enum connection_priority priority)
93 stub_called("print_error_dialog");
96 /* declared in "bfu/msgbox.h" */
97 unsigned char *
98 msg_text(struct terminal *term, unsigned char *format, ...)
100 stub_called("msg_text");
101 return NULL;
104 /* declared in "bfu/msgbox.h" */
105 struct dialog_data *
106 msg_box(struct terminal *term, struct memory_list *mem_list,
107 enum msgbox_flags flags, unsigned char *title, enum format_align align,
108 unsigned char *text, void *udata, int buttons, ...)
110 /* mem_list should be freed here but because this is just a
111 * test program it won't matter. */
112 stub_called("msg_box");
113 return NULL;
116 /* declared in "protocol/file/mailcap.h" */
117 void
118 mailcap_protocol_handler(struct connection *conn)
120 stub_called("mailcap_protocol_handler");