big dialogs: set_curosr2 -> set_dlg_cursor.
[elinks.git] / src / protocol / protocol.h
blobc02e6716642d7b00bc80c41825e1535b4e73909a
1 #ifndef EL__PROTOCOL_PROTOCOL_H
2 #define EL__PROTOCOL_PROTOCOL_H
4 #include "main/module.h"
6 struct connection;
7 struct session;
8 struct terminal;
9 struct uri;
11 enum protocol {
12 PROTOCOL_ABOUT,
13 PROTOCOL_BITTORRENT,
14 PROTOCOL_DATA,
15 PROTOCOL_FILE,
16 PROTOCOL_FINGER,
17 PROTOCOL_FSP,
18 PROTOCOL_FTP,
19 PROTOCOL_GOPHER,
20 PROTOCOL_HTTP,
21 PROTOCOL_HTTPS,
22 PROTOCOL_JAVASCRIPT,
23 PROTOCOL_NEWS,
24 PROTOCOL_NNTP,
25 PROTOCOL_NNTPS,
26 PROTOCOL_PROXY,
27 PROTOCOL_SMB,
28 PROTOCOL_SNEWS,
30 /* Keep these last! */
31 PROTOCOL_UNKNOWN,
32 PROTOCOL_USER,
33 PROTOCOL_LUA,
35 /* For protocol backend index checking */
36 PROTOCOL_BACKENDS,
39 /* Besides the session an external handler also takes the url as an argument */
40 typedef void (protocol_handler_T)(struct connection *);
41 typedef void (protocol_external_handler_T)(struct session *, struct uri *);
43 /* Accessors for the protocol backends. */
45 int get_protocol_port(enum protocol protocol);
46 int get_protocol_need_slashes(enum protocol protocol);
47 int get_protocol_keep_double_slashes(enum protocol protocol);
48 int get_protocol_need_slash_after_host(enum protocol protocol);
49 int get_protocol_free_syntax(enum protocol protocol);
50 int get_protocol_need_ssl(enum protocol protocol);
52 protocol_handler_T *get_protocol_handler(enum protocol protocol);
53 protocol_external_handler_T *get_protocol_external_handler(struct terminal *, struct uri *);
55 /* Resolves the given protocol @name with length @namelen to a known protocol,
56 * PROTOCOL_UNKOWN or PROTOCOL_INVALID if no protocol part could be identified.
57 * User defined protocols (configurable via protocol.user) takes precedence. */
58 enum protocol get_protocol(unsigned char *name, int namelen);
60 extern struct module protocol_module;
62 #endif