Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
capi.h File Reference
#include "cache.h"
#include "web.hh"
Include dependency graph for capi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CAPI_IsCached   (0x1)
 
#define CAPI_IsEmpty   (0x2)
 
#define CAPI_InProgress   (0x4)
 
#define CAPI_Aborted   (0x8)
 
#define CAPI_Completed   (0x10)
 

Functions

void a_Capi_init (void)
 Initialize capi&cache data.
 
int a_Capi_open_url (DilloWeb *web, CA_Callback_t Call, void *CbData)
 Most used function for requesting a URL.
 
int a_Capi_get_buf (const DilloUrl *Url, char **PBuf, int *BufSize)
 Get the cache's buffer for the URL, and its size.
 
void a_Capi_unref_buf (const DilloUrl *Url)
 Unref the cache's buffer when no longer using it.
 
const char * a_Capi_get_content_type (const DilloUrl *url)
 Get the Content-Type associated with the URL.
 
const char * a_Capi_set_content_type (const DilloUrl *url, const char *ctype, const char *from)
 Set the Content-Type for the URL.
 
int a_Capi_get_flags (const DilloUrl *Url)
 Return status information of an URL's content-transfer process.
 
int a_Capi_get_flags_with_redirection (const DilloUrl *Url)
 Same as a_Capi_get_flags() but following redirections.
 
int a_Capi_dpi_verify_request (BrowserWindow *bw, DilloUrl *url)
 Safety test: only allow GET|POST dpi-urls from dpi-generated pages.
 
int a_Capi_dpi_send_data (const DilloUrl *url, void *bw, char *data, int data_sz, char *server, int flags)
 Send data to a dpi (e.g.
 
int a_Capi_dpi_send_cmd (DilloUrl *url, void *bw, char *cmd, char *server, int flags)
 Send a dpi cmd.
 
void a_Capi_set_vsource_url (const DilloUrl *url)
 Store the last URL requested by "view source".
 
void a_Capi_stop_client (int Key, int force)
 Remove a client from the cache client queue.
 
void a_Capi_conn_abort_by_url (const DilloUrl *url)
 Abort the connection for a given url, using its CCC.
 

Macro Definition Documentation

◆ CAPI_Aborted

#define CAPI_Aborted   (0x8)

Definition at line 18 of file capi.h.

◆ CAPI_Completed

#define CAPI_Completed   (0x10)

Definition at line 19 of file capi.h.

◆ CAPI_InProgress

#define CAPI_InProgress   (0x4)

Definition at line 17 of file capi.h.

◆ CAPI_IsCached

#define CAPI_IsCached   (0x1)

Definition at line 15 of file capi.h.

◆ CAPI_IsEmpty

#define CAPI_IsEmpty   (0x2)

Definition at line 16 of file capi.h.

Function Documentation

◆ a_Capi_conn_abort_by_url()

void a_Capi_conn_abort_by_url ( const DilloUrl url)

Abort the connection for a given url, using its CCC.

(OpAbort 2,BCK removes the cache entry) TODO: when conn is already done, the cache entry isn't removed. This may be wrong and needs a revision.

Definition at line 199 of file capi.c.

References a_Capi_ccc(), a_Url_cmp(), BCK, CapiConns, dList_length(), dList_nth_data(), and OpAbort.

Referenced by a_Capi_open_url(), a_Capi_stop_client(), and Cache_process_queue().

◆ a_Capi_dpi_send_cmd()

int a_Capi_dpi_send_cmd ( DilloUrl url,
void *  bw,
char *  cmd,
char *  server,
int  flags 
)

Send a dpi cmd.

(For instance: add_bookmark, open_url, send_preferences, ...)

Definition at line 611 of file capi.c.

References a_Capi_dpi_send_data().

Referenced by a_Bookmarks_chat_add(), a_Capi_open_url(), Capi_dpi_send_source(), and Dpiapi_dialog_answer_cb().

◆ a_Capi_dpi_send_data()

int a_Capi_dpi_send_data ( const DilloUrl url,
void *  bw,
char *  data,
int  data_sz,
char *  server,
int  flags 
)

Send data to a dpi (e.g.

add_bookmark, open_url, send_preferences, ...). Most of the time we send dpi commands, but it also serves for raw data as with "view source".

Definition at line 576 of file capi.c.

References a_Capi_ccc(), a_Chain_dbuf_new(), a_Chain_new(), BCK, Capi_conn_find(), Capi_conn_new(), dFree(), MSG, OpSend, and OpStart.

Referenced by a_Capi_dpi_send_cmd(), and Capi_dpi_send_source().

◆ a_Capi_dpi_verify_request()

int a_Capi_dpi_verify_request ( BrowserWindow bw,
DilloUrl url 
)

Safety test: only allow GET|POST dpi-urls from dpi-generated pages.

Definition at line 232 of file capi.c.

References a_History_get_url(), a_Nav_stack_size(), dStr_printable(), dStrAsciiCasecmp(), FALSE, MSG, NAV_TOP_UIDX, TRUE, URL_DATA, URL_FLAGS, URL_Get, URL_PATH, URL_Post, URL_SCHEME, and URL_STR.

Referenced by a_Capi_open_url(), and Html_tag_open_meta().

◆ a_Capi_get_buf()

int a_Capi_get_buf ( const DilloUrl Url,
char **  PBuf,
int *  BufSize 
)

Get the cache's buffer for the URL, and its size.

Return: 1 cached, 0 not cached.

Definition at line 541 of file capi.c.

References a_Cache_get_buf().

Referenced by a_Html_load_stylesheet(), a_Nav_get_buf(), and Capi_dpi_send_source().

◆ a_Capi_get_content_type()

const char * a_Capi_get_content_type ( const DilloUrl url)

Get the Content-Type associated with the URL.

Definition at line 557 of file capi.c.

References a_Cache_get_content_type().

Referenced by a_Nav_get_content_type().

◆ a_Capi_get_flags()

int a_Capi_get_flags ( const DilloUrl Url)

Return status information of an URL's content-transfer process.

Definition at line 520 of file capi.c.

References a_Cache_get_flags(), and Capi_map_cache_flags().

Referenced by a_Capi_open_url(), and Capi_request_permitted().

◆ a_Capi_get_flags_with_redirection()

◆ a_Capi_init()

void a_Capi_init ( void  )

Initialize capi&cache data.

Definition at line 80 of file capi.c.

References a_Cache_init(), CapiConns, and dList_new().

Referenced by main().

◆ a_Capi_open_url()

◆ a_Capi_set_content_type()

const char * a_Capi_set_content_type ( const DilloUrl url,
const char *  ctype,
const char *  from 
)

Set the Content-Type for the URL.

Definition at line 565 of file capi.c.

References a_Cache_set_content_type().

Referenced by a_Html_load_stylesheet(), and Html_update_content_type().

◆ a_Capi_set_vsource_url()

void a_Capi_set_vsource_url ( const DilloUrl url)

Store the last URL requested by "view source".

Definition at line 223 of file capi.c.

References a_Url_dup(), a_Url_free(), and CapiVsUrl.

Referenced by a_Nav_set_vsource_url().

◆ a_Capi_stop_client()

void a_Capi_stop_client ( int  Key,
int  force 
)

Remove a client from the cache client queue.

force = also abort the CCC if this is the last client.

Definition at line 621 of file capi.c.

References _MSG, a_Cache_client_get_if_unique(), a_Cache_stop_client(), a_Capi_conn_abort_by_url(), CacheClient::BufSize, and CacheClient::Url.

Referenced by a_Bw_stop_clients().

◆ a_Capi_unref_buf()

void a_Capi_unref_buf ( const DilloUrl Url)

Unref the cache's buffer when no longer using it.

Definition at line 549 of file capi.c.

References a_Cache_unref_buf().

Referenced by a_Html_load_stylesheet(), and a_Nav_unref_buf().