summaryrefslogtreecommitdiff
path: root/src/IO
diff options
context:
space:
mode:
Diffstat (limited to 'src/IO')
-rw-r--r--src/IO/IO.c32
-rw-r--r--src/IO/about.c2
-rw-r--r--src/IO/dpi.c46
-rw-r--r--src/IO/http.c60
-rw-r--r--src/IO/iowatch.cc16
-rw-r--r--src/IO/mime.c20
-rw-r--r--src/IO/mime.h6
-rw-r--r--src/IO/tls.c15
8 files changed, 101 insertions, 96 deletions
diff --git a/src/IO/IO.c b/src/IO/IO.c
index 706b4ecd..2864ddb7 100644
--- a/src/IO/IO.c
+++ b/src/IO/IO.c
@@ -9,7 +9,7 @@
* (at your option) any later version.
*/
-/*
+/** @file
* Dillo's event driven IO engine
*/
@@ -58,7 +58,7 @@ void a_IO_ccc(int Op, int Branch, int Dir, ChainLink *Info,
/* IO API - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/*
+/**
* Return a new, initialized, 'io' struct
*/
static IOData_t *IO_new(int op)
@@ -74,7 +74,7 @@ static IOData_t *IO_new(int op)
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/*
+/**
* Register an IO in ValidIOs
*/
static void IO_ins(IOData_t *io)
@@ -86,7 +86,7 @@ static void IO_ins(IOData_t *io)
io->Key, a_Klist_length(ValidIOs));
}
-/*
+/**
* Remove an IO from ValidIOs
*/
static void IO_del(IOData_t *io)
@@ -98,7 +98,7 @@ static void IO_del(IOData_t *io)
_MSG(" -->ValidIOs: %d\n", a_Klist_length(ValidIOs));
}
-/*
+/**
* Return a io by its Key (NULL if not found)
*/
static IOData_t *IO_get(int Key)
@@ -106,7 +106,7 @@ static IOData_t *IO_get(int Key)
return (IOData_t *)a_Klist_get_data(ValidIOs, Key);
}
-/*
+/**
* Free an 'io' struct
*/
static void IO_free(IOData_t *io)
@@ -115,7 +115,7 @@ static void IO_free(IOData_t *io)
dFree(io);
}
-/*
+/**
* Close an open FD, and remove io controls.
* (This function can be used for Close and Abort operations)
* BUG: there's a race condition for Abort. The file descriptor is closed
@@ -151,7 +151,7 @@ static void IO_close_fd(IOData_t *io, int CloseCode)
_MSG(" end IO close (%d) <=====\n", io->FD);
}
-/*
+/**
* Read data from a file descriptor into a specific buffer
*/
static bool_t IO_read(IOData_t *io)
@@ -213,7 +213,7 @@ static bool_t IO_read(IOData_t *io)
return ret;
}
-/*
+/**
* Write data, from a specific buffer, into a file descriptor
*/
static bool_t IO_write(IOData_t *io)
@@ -258,8 +258,8 @@ static bool_t IO_write(IOData_t *io)
return ret;
}
-/*
- * Handle background IO for a given FD (reads | writes)
+/**
+ * Handle background IO for a given FD (reads | writes).
* (This function gets called when there's activity in the FD)
*/
static int IO_callback(IOData_t *io)
@@ -277,7 +277,7 @@ static int IO_callback(IOData_t *io)
return (ret) ? 1 : 0;
}
-/*
+/**
* Handle the READ event of a FD.
*/
static void IO_fd_read_cb(int fd, void *data)
@@ -300,7 +300,7 @@ static void IO_fd_read_cb(int fd, void *data)
}
}
-/*
+/**
* Handle the WRITE event of a FD.
*/
static void IO_fd_write_cb(int fd, void *data)
@@ -321,7 +321,7 @@ static void IO_fd_write_cb(int fd, void *data)
}
}
-/*
+/**
* Receive an IO request (IORead | IOWrite),
* Set a watch for it, and let it flow!
*/
@@ -352,8 +352,8 @@ static void IO_submit(IOData_t *r_io)
}
}
-/*
- * CCC function for the IO module
+/**
+ * CCC function for the IO module.
* ( Data1 = IOData_t* ; Data2 = NULL )
*/
void a_IO_ccc(int Op, int Branch, int Dir, ChainLink *Info,
diff --git a/src/IO/about.c b/src/IO/about.c
index a8585dce..2df93291 100644
--- a/src/IO/about.c
+++ b/src/IO/about.c
@@ -12,7 +12,7 @@
#include <config.h>
-/*
+/**
* HTML text for startup screen
*/
const char *const AboutSplash=
diff --git a/src/IO/dpi.c b/src/IO/dpi.c
index 1948b0ee..d7dd7d0b 100644
--- a/src/IO/dpi.c
+++ b/src/IO/dpi.c
@@ -9,8 +9,8 @@
* (at your option) any later version.
*/
-/*
- * Dillo plugins (small programs that interact with dillo)
+/** @file
+ * Dillo plugins (small programs that interact with dillo).
*
* Dillo plugins are designed to handle:
* bookmarks, cookies, FTP, downloads, files, preferences, https,
@@ -85,7 +85,7 @@ void a_Dpi_init(void)
/* empty */
}
-/*
+/**
* Create a new connection data structure
*/
static dpi_conn_t *Dpi_conn_new(ChainLink *Info)
@@ -99,7 +99,7 @@ static dpi_conn_t *Dpi_conn_new(ChainLink *Info)
return conn;
}
-/*
+/**
* Free a connection data structure
*/
static void Dpi_conn_free(dpi_conn_t *conn)
@@ -109,7 +109,7 @@ static void Dpi_conn_free(dpi_conn_t *conn)
dFree(conn);
}
-/*
+/**
* Check whether a conn is still valid.
* Return: 1 if found, 0 otherwise
*/
@@ -118,7 +118,7 @@ static int Dpi_conn_valid(int key)
return (a_Klist_get_data(ValidConns, key)) ? 1 : 0;
}
-/*
+/**
* Append the new buffer in 'dbuf' to Buf in 'conn'
*/
static void Dpi_append_dbuf(dpi_conn_t *conn, DataBuf *dbuf)
@@ -128,7 +128,7 @@ static void Dpi_append_dbuf(dpi_conn_t *conn, DataBuf *dbuf)
}
}
-/*
+/**
* Split the data stream into tokens.
* Here, a token is either:
* a) a dpi tag
@@ -192,7 +192,7 @@ static int Dpi_get_token(dpi_conn_t *conn)
return resp;
}
-/*
+/**
* Parse a dpi tag and take the appropriate actions
*/
static void Dpi_parse_token(dpi_conn_t *conn)
@@ -247,7 +247,7 @@ static void Dpi_parse_token(dpi_conn_t *conn)
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/*
+/**
* Write data into a file descriptor taking care of EINTR
* and possible data splits.
* Return value: 1 on success, -1 on error.
@@ -272,7 +272,7 @@ static int Dpi_blocking_write(int fd, const char *msg, int msg_len)
return (sent == msg_len) ? 1 : -1;
}
-/*
+/**
* Read all the available data from a filedescriptor.
* This is intended for short answers, i.e. when we know the server
* will write it all before being preempted. For answers that may come
@@ -307,7 +307,7 @@ static char *Dpi_blocking_read(int fd)
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/*
+/**
* Get a new data buffer (within a 'dbuf'), save it into local data,
* split in tokens and parse the contents.
*/
@@ -331,7 +331,7 @@ static void Dpi_process_dbuf(int Op, void *Data1, dpi_conn_t *conn)
}
}
-/*
+/**
* Start dpid.
* Return: 0 starting now, 1 Error.
*/
@@ -386,7 +386,7 @@ static int Dpi_start_dpid(void)
return ret;
}
-/*
+/**
* Read dpid's communication keys from its saved file.
* Return value: 1 on success, -1 on error.
*/
@@ -416,7 +416,7 @@ static int Dpi_read_comm_keys(int *port)
return ret;
}
-/*
+/**
* Return a socket file descriptor
*/
static int Dpi_make_socket_fd()
@@ -431,7 +431,7 @@ static int Dpi_make_socket_fd()
return ret;
}
-/*
+/**
* Make a connection test for a IDS.
* Return: 1 OK, -1 Not working.
*/
@@ -460,7 +460,7 @@ static int Dpi_check_dpid_ids()
return ret;
}
-/*
+/**
* Confirm that the dpid is running. If not, start it.
* Return: 0 running OK, 1 starting (EAGAIN), 2 Error.
*/
@@ -497,7 +497,7 @@ static int Dpi_check_dpid(int num_tries)
return ret;
}
-/*
+/**
* Confirm that the dpid is running. If not, start it.
* Return: 0 running OK, 2 Error.
*/
@@ -514,7 +514,7 @@ static int Dpi_blocking_start_dpid(void)
return cst;
}
-/*
+/**
* Return the dpi server's port number, or -1 on error.
* (A query is sent to dpid and then its answer parsed)
* note: as the available servers and/or the dpi socket directory can
@@ -595,7 +595,7 @@ static int Dpi_get_server_port(const char *server_name)
}
-/*
+/**
* Connect a socket to a dpi server and return the socket's FD.
* We have to ask 'dpid' (dpi daemon) for the port of the target dpi server.
* Once we have it, then the proper file descriptor is returned (-1 on error).
@@ -639,8 +639,8 @@ static int Dpi_connect_socket(const char *server_name)
return ret;
}
-/*
- * CCC function for the Dpi module
+/**
+ * CCC function for the Dpi module.
*/
void a_Dpi_ccc(int Op, int Branch, int Dir, ChainLink *Info,
void *Data1, void *Data2)
@@ -753,7 +753,7 @@ void a_Dpi_ccc(int Op, int Branch, int Dir, ChainLink *Info,
}
}
-/*! Let dpid know dillo is no longer running.
+/** Let dpid know dillo is no longer running.
* Note: currently disabled. It may serve to let the cookies dpi know
* when to expire session cookies.
*/
@@ -762,7 +762,7 @@ void a_Dpi_dillo_exit()
}
-/*
+/**
* Send a command to a dpi server, and block until the answer is got.
* Return value: the dpip tag answer as an string, NULL on error.
*/
diff --git a/src/IO/http.c b/src/IO/http.c
index 5e00b6f6..4c4618c5 100644
--- a/src/IO/http.c
+++ b/src/IO/http.c
@@ -10,7 +10,7 @@
* (at your option) any later version.
*/
-/*
+/** @file
* HTTP connect functions
*/
@@ -112,7 +112,7 @@ static Dlist *servers;
*/
static Dlist *fd_map;
-/*
+/**
* Initialize proxy vars and Accept-Language header
*/
int a_Http_init(void)
@@ -141,8 +141,8 @@ int a_Http_init(void)
return 0;
}
-/*
- * Tell whether the proxy auth is already set (user:password)
+/**
+ * Tell whether the proxy auth is already set (user:password).
* Return: 1 Yes, 0 No
*/
int a_Http_proxy_auth(void)
@@ -150,7 +150,7 @@ int a_Http_proxy_auth(void)
return (HTTP_Proxy_Auth_base64 ? 1 : 0);
}
-/*
+/**
* Activate entered proxy password for HTTP.
*/
void a_Http_set_proxy_passwd(const char *str)
@@ -160,7 +160,7 @@ void a_Http_set_proxy_passwd(const char *str)
dFree(http_proxyauth);
}
-/*
+/**
* Create and init a new SocketData_t struct, insert into ValidSocks,
* and return a primary key for it.
*/
@@ -171,7 +171,7 @@ static int Http_sock_new(void)
return a_Klist_insert(&ValidSocks, S);
}
-/*
+/**
* Compare by FD.
*/
static int Http_fd_map_cmp(const void *v1, const void *v2)
@@ -196,7 +196,7 @@ static void Http_fd_map_add_entry(SocketData_t *sd)
dList_append(fd_map, e);
}
-/*
+/**
* Remove and free entry from fd_map.
*/
static void Http_fd_map_remove_entry(int fd)
@@ -290,7 +290,7 @@ static void Http_connect_queued_sockets(Server_t *srv)
}
}
-/*
+/**
* Free SocketData_t struct
*/
static void Http_socket_free(int SKey)
@@ -328,9 +328,9 @@ static void Http_socket_free(int SKey)
}
}
-/*
+/**
* Make the HTTP header's Referer line according to preferences
- * (default is "host" i.e. "scheme://hostname/" )
+ * (default is "host" i.e. "scheme://hostname/" ).
*/
static char *Http_get_referer(const DilloUrl *url)
{
@@ -350,7 +350,7 @@ static char *Http_get_referer(const DilloUrl *url)
return referer;
}
-/*
+/**
* Generate Content-Type header value for a POST query.
*/
static Dstr *Http_make_content_type(const DilloUrl *url)
@@ -377,7 +377,7 @@ static Dstr *Http_make_content_type(const DilloUrl *url)
return dstr;
}
-/*
+/**
* Make the http query string
*/
static Dstr *Http_make_query_str(DilloWeb *web, bool_t use_proxy)
@@ -476,7 +476,7 @@ static Dstr *Http_make_query_str(DilloWeb *web, bool_t use_proxy)
return query;
}
-/*
+/**
* Create and submit the HTTP query to the IO engine
*/
static void Http_send_query(SocketData_t *S)
@@ -497,7 +497,7 @@ static void Http_send_query(SocketData_t *S)
dStr_free(query, 1);
}
-/*
+/**
* Prepare an HTTPS connection. If necessary, tunnel through a proxy first.
*/
static void Http_connect_tls(ChainLink *info)
@@ -522,7 +522,7 @@ static void Http_connect_tls(ChainLink *info)
}
}
-/*
+/**
* connect() couldn't complete before, but now it's ready, so let's try again.
*/
static void Http_connect_socket_cb(int fd, void *data)
@@ -559,7 +559,7 @@ static void Http_connect_socket_cb(int fd, void *data)
}
}
-/*
+/**
* This function is called after the DNS succeeds in solving a hostname.
* Task: Finish socket setup and start connecting the socket.
*/
@@ -654,8 +654,8 @@ static void Http_connect_socket(ChainLink *Info)
}
}
-/*
- * Test proxy settings and check the no_proxy domains list
+/**
+ * Test proxy settings and check the no_proxy domains list.
* Return value: whether to use proxy or not.
*/
static int Http_must_use_proxy(const char *hostname)
@@ -685,7 +685,7 @@ static int Http_must_use_proxy(const char *hostname)
return ret;
}
-/*
+/**
* Return a new string for the request used to tunnel HTTPS through a proxy.
*/
static char *Http_get_connect_str(const DilloUrl *url)
@@ -726,7 +726,7 @@ static char *Http_get_connect_str(const DilloUrl *url)
return retstr;
}
-/*
+/**
* Callback function for the DNS resolver.
* Continue connecting the socket, or abort upon error condition.
* S->web is checked to assert the operation wasn't aborted while waiting.
@@ -768,8 +768,8 @@ static void Http_dns_cb(int Status, Dlist *addr_list, void *data)
}
}
-/*
- * Asynchronously create a new http connection for 'Url'
+/**
+ * Asynchronously create a new http connection for 'Url'.
* We'll set some socket parameters; the rest will be set later
* when the IP is known.
* ( Data1 = Web structure )
@@ -811,8 +811,8 @@ static int Http_get(ChainLink *Info, void *Data1)
return 0;
}
-/*
- * Can the old socket's fd be reused for the new socket?
+/**
+ * Can the old socket's fd be reused for the new socket?.
*
* NOTE: old and new must come from the same Server_t.
* This is not built to accept arbitrary sockets.
@@ -833,7 +833,7 @@ static bool_t Http_socket_reuse_compatible(SocketData_t *old,
return FALSE;
}
-/*
+/**
* If any entry in the socket data queue can reuse our connection, set it up
* and send off a new query.
*/
@@ -875,7 +875,7 @@ static void Http_socket_reuse(int SKey)
}
}
-/*
+/**
* CCC function for the HTTP module
*/
void a_Http_ccc(int Op, int Branch, int Dir, ChainLink *Info,
@@ -1030,7 +1030,7 @@ void a_Http_ccc(int Op, int Branch, int Dir, ChainLink *Info,
}
}
-/*
+/**
* Add socket data to the queue. Pages/stylesheets/etc. have higher priority
* than images.
*/
@@ -1119,8 +1119,8 @@ static void Http_fd_map_remove_all()
dList_free(fd_map);
}
-/*
- * Deallocate memory used by http module
+/**
+ * Deallocate memory used by http module.
* (Call this one at exit time)
*/
void a_Http_freeall(void)
diff --git a/src/IO/iowatch.cc b/src/IO/iowatch.cc
index f5243934..13c537fe 100644
--- a/src/IO/iowatch.cc
+++ b/src/IO/iowatch.cc
@@ -9,14 +9,16 @@
* (at your option) any later version.
*/
-// Simple ADT for watching file descriptor activity
+/** @file
+ * Simple ADT for watching file descriptor activity
+ */
#include <FL/Fl.H>
#include "iowatch.hh"
-//
-// Hook a Callback for a certain activities in a FD
-//
+/**
+ * Hook a Callback for a certain activities in a FD
+ */
void a_IOwatch_add_fd(int fd, int when, Fl_FD_Handler Callback,
void *usr_data = 0)
{
@@ -24,9 +26,9 @@ void a_IOwatch_add_fd(int fd, int when, Fl_FD_Handler Callback,
Fl::add_fd(fd, when, Callback, usr_data);
}
-//
-// Remove a Callback for a given FD (or just remove some events)
-//
+/**
+ * Remove a Callback for a given FD (or just remove some events)
+ */
void a_IOwatch_remove_fd(int fd, int when)
{
if (fd >= 0)
diff --git a/src/IO/mime.c b/src/IO/mime.c
index 19311b06..9d5e6738 100644
--- a/src/IO/mime.c
+++ b/src/IO/mime.c
@@ -29,8 +29,8 @@ static int MimeMajItemsSize = 0, MimeMajItemsMax = 8;
static MimeItem_t *MimeMajItems = NULL;
-/*
- * Add a specific MIME type (as "image/png") to our viewer list
+/**
+ * Add a specific MIME type (as "image/png") to our viewer list.
* 'Key' is the content-type string that identifies the MIME type
* 'Method' is the function that handles it
*/
@@ -43,8 +43,8 @@ static int Mime_add_minor_type(const char *Key, Viewer_t Method)
return 0;
}
-/*
- * Add a major MIME type (as "text") to our viewer list
+/**
+ * Add a major MIME type (as "text") to our viewer list.
* 'Key' is the content-type string that identifies the MIME type
* 'Method' is the function that handles it
*/
@@ -57,8 +57,8 @@ static int Mime_add_major_type(const char *Key, Viewer_t Method)
return 0;
}
-/*
- * Search the list of specific MIME viewers, for a Method that matches 'Key'
+/**
+ * Search the list of specific MIME viewers for a Method that matches 'Key'.
* 'Key' is the content-type string that identifies the MIME type
*/
static Viewer_t Mime_minor_type_fetch(const char *Key, uint_t Size)
@@ -73,8 +73,8 @@ static Viewer_t Mime_minor_type_fetch(const char *Key, uint_t Size)
return NULL;
}
-/*
- * Search the list of major MIME viewers, for a Method that matches 'Key'
+/**
+ * Search the list of major MIME viewers for a Method that matches 'Key'.
* 'Key' is the content-type string that identifies the MIME type
*/
static Viewer_t Mime_major_type_fetch(const char *Key, uint_t Size)
@@ -90,7 +90,7 @@ static Viewer_t Mime_major_type_fetch(const char *Key, uint_t Size)
}
-/*
+/**
* Initializes Mime module and, sets the supported Mime types.
*/
void a_Mime_init()
@@ -115,7 +115,7 @@ void a_Mime_init()
}
-/*
+/**
* Get the handler for the MIME type.
*
* Return Value:
diff --git a/src/IO/mime.h b/src/IO/mime.h
index 1f3b1ce5..011df4f0 100644
--- a/src/IO/mime.h
+++ b/src/IO/mime.h
@@ -23,8 +23,8 @@ extern "C" {
typedef void* (*Viewer_t) (const char*, void*, CA_Callback_t*, void**);
-/*
- * Function prototypes defined elsewhere
+/**
+ * Function prototypes defined elsewhere.
*/
void *a_Html_text (const char *Type,void *web, CA_Callback_t *Call,
void **Data);
@@ -37,7 +37,7 @@ void *a_Dicache_gif_image(const char *Type, void *Ptr, CA_Callback_t *Call,
void *a_Dicache_jpeg_image(const char *Type, void *Ptr, CA_Callback_t *Call,
void **Data);
-/*
+/**
* Functions defined inside Mime module
*/
void a_Mime_init(void);
diff --git a/src/IO/tls.c b/src/IO/tls.c
index 2a27c1a6..05ae2514 100644
--- a/src/IO/tls.c
+++ b/src/IO/tls.c
@@ -25,6 +25,9 @@
#include "tls_openssl.h"
#include "tls_mbedtls.h"
+/**
+ * Initialize TLS library.
+ */
void a_Tls_init()
{
#if ! defined(ENABLE_TLS)
@@ -38,7 +41,7 @@ void a_Tls_init()
#endif
}
-/*
+/**
* Return TLS connection information for a given file
* descriptor, or NULL if no TLS connection was found.
*/
@@ -55,7 +58,7 @@ void *a_Tls_connection(int fd)
#endif
}
-/*
+/**
* The purpose here is to permit a single initial connection to a server.
* Once we have the certificate, know whether we like it -- and whether the
* user accepts it -- HTTP can run through queued sockets as normal.
@@ -75,9 +78,9 @@ int a_Tls_connect_ready(const DilloUrl *url)
#endif
}
-/*
+/**
* Did everything seem proper with the certificate -- no warnings to
- * click through?
+ * click through?.
*/
int a_Tls_certificate_is_clean(const DilloUrl *url)
{
@@ -92,8 +95,8 @@ int a_Tls_certificate_is_clean(const DilloUrl *url)
#endif
}
-/*
- * Clean up the OpenSSL library
+/**
+ * Clean up the TLS library.
*/
void a_Tls_freeall(void)
{