summaryrefslogtreecommitdiff
path: root/include/netsurf
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2023-12-27 19:12:07 +0000
committerJohn-Mark Bell <jmb@netsurf-browser.org>2024-03-13 23:03:34 +0000
commite3a6ad7173d8746af0fde87a1ead69c1c7d61bfa (patch)
tree5fe6098aab43d1f47869d12754c802df1e07320f /include/netsurf
parentf027a8095654e204f608ad9db5c9231646059128 (diff)
downloadnetsurf-e3a6ad7173d8746af0fde87a1ead69c1c7d61bfa.tar.gz
netsurf-e3a6ad7173d8746af0fde87a1ead69c1c7d61bfa.tar.bz2
Fetch/curl: expose socket open/close via fetch vtable
This allows frontends to customise the behaviour of sockets. The default implementation simply maps to socket(2)/close(2).
Diffstat (limited to 'include/netsurf')
-rw-r--r--include/netsurf/fetch.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/netsurf/fetch.h b/include/netsurf/fetch.h
index 30b204868..156f4d1ef 100644
--- a/include/netsurf/fetch.h
+++ b/include/netsurf/fetch.h
@@ -99,6 +99,23 @@ struct gui_fetch_table {
*/
char *(*mimetype)(const char *ro_path);
+ /**
+ * Open a socket
+ *
+ * \param domain Communication domain
+ * \param type Socket type
+ * \param protocol Protocol
+ * \return Socket descriptor on success, -1 on error and errno set
+ */
+ int (*socket_open)(int domain, int type, int protocol);
+
+ /**
+ * Close a socket
+ *
+ * \param socket Socket descriptor
+ * \return 0 on success, -1 on error and errno set
+ */
+ int (*socket_close)(int socket);
};
#endif