Dillo v3.1.1-119-g140d9ebd
|
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. | |
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 200 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().
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 613 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().
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 578 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().
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 233 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().
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 543 of file capi.c.
References a_Cache_get_buf().
Referenced by a_Html_load_stylesheet(), a_Nav_get_buf(), and Capi_dpi_send_source().
const char * a_Capi_get_content_type | ( | const DilloUrl * | url | ) |
Get the Content-Type associated with the URL.
Definition at line 559 of file capi.c.
References a_Cache_get_content_type().
Referenced by a_Nav_get_content_type().
int a_Capi_get_flags | ( | const DilloUrl * | Url | ) |
Return status information of an URL's content-transfer process.
Definition at line 522 of file capi.c.
References a_Cache_get_flags(), and Capi_map_cache_flags().
Referenced by a_Capi_open_url(), and Capi_request_permitted().
int a_Capi_get_flags_with_redirection | ( | const DilloUrl * | Url | ) |
Same as a_Capi_get_flags() but following redirections.
Definition at line 532 of file capi.c.
References a_Cache_get_flags_with_redirection(), and Capi_map_cache_flags().
Referenced by a_Capi_open_url(), a_Html_image_new(), a_Html_load_stylesheet(), Html_tag_open_a(), Html_tag_open_audio(), Html_tag_open_embed(), Html_tag_open_frame(), Html_tag_open_object(), Html_tag_open_source(), and Html_tag_open_video().
void a_Capi_init | ( | void | ) |
Initialize capi&cache data.
Definition at line 81 of file capi.c.
References a_Cache_init(), CapiConns, and dList_new().
Referenced by main().
int a_Capi_open_url | ( | DilloWeb * | web, |
CA_Callback_t | Call, | ||
void * | CbData | ||
) |
Most used function for requesting a URL.
TODO: clean up the ad-hoc bindings with an API that allows dynamic addition of new plugins.
Definition at line 394 of file capi.c.
References _MSG, a_Cache_download_enabled(), a_Cache_open_url(), a_Capi_ccc(), a_Capi_conn_abort_by_url(), a_Capi_dpi_send_cmd(), a_Capi_dpi_verify_request(), a_Capi_get_flags(), a_Capi_get_flags_with_redirection(), a_Chain_new(), a_UIcmd_set_msg(), a_Url_set_flags(), a_Web_free(), BCK, _DilloWeb::bw, Capi_conn_new(), Capi_conn_valid(), Capi_dpi_build_cmd(), Capi_dpi_send_source(), CAPI_IsCached, Capi_request_permitted(), Capi_url_uses_dpi(), dFree(), dStrAsciiCasecmp(), dStrerror, _DilloWeb::filename, _DilloWeb::flags, MSG_WARN, OpStart, _DilloWeb::stream, _DilloWeb::url, URL_E2EQuery, URL_FLAGS, URL_SCHEME, URL_STR, WEB_Download, and WEB_RootUrl.
Referenced by a_Html_load_stylesheet(), a_Nav_save_url(), StyleEngine::apply(), Html_load_image(), and Nav_open_url().
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 567 of file capi.c.
References a_Cache_set_content_type().
Referenced by a_Html_load_stylesheet(), and Html_update_content_type().
void a_Capi_set_vsource_url | ( | const DilloUrl * | url | ) |
Store the last URL requested by "view source".
Definition at line 224 of file capi.c.
References a_Url_dup(), a_Url_free(), and CapiVsUrl.
Referenced by a_Nav_set_vsource_url().
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 623 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().
void a_Capi_unref_buf | ( | const DilloUrl * | Url | ) |
Unref the cache's buffer when no longer using it.
Definition at line 551 of file capi.c.
References a_Cache_unref_buf().
Referenced by a_Html_load_stylesheet(), and a_Nav_unref_buf().