27#include <libwapcaplet/libwapcaplet.h>
107 const char *post_urlenc,
109 const char **headers)
113 ctx = calloc(1,
sizeof(*ctx));
130 if (c->
url != NULL) {
161 if (
ring == NULL)
return;
194 }
while ( (c = next) !=
ring &&
ring != NULL);
204 lwc_string *scheme = lwc_string_ref(corestring_lwc_javascript);
void fetch_set_http_code(struct fetch *fetch, long http_code)
set the http code of a fetch
nserror fetcher_add(lwc_string *scheme, const struct fetcher_operation_table *ops)
Register a fetcher for a scheme.
void fetch_send_callback(const fetch_msg *msg, struct fetch *fetch)
send message to fetch
void fetch_free(struct fetch *f)
Free a fetch structure and associated resources.
void fetch_remove_from_queues(struct fetch *fetch)
remove a queued fetch
Fetching of data from a URL (interface).
Useful interned string pointers (interface).
nserror
Enumeration of error codes.
static bool fetch_javascript_send_callback(const fetch_msg *msg, struct fetch_javascript_context *ctx)
issue fetch callbacks with locking
static bool fetch_javascript_start(void *ctx)
callback to start a resource fetch
static void fetch_javascript_free(void *ctx)
callback to free a resource fetch
static bool fetch_javascript_can_fetch(const nsurl *url)
static bool fetch_javascript_initialise(lwc_string *scheme)
callback to initialise the resource fetcher.
static bool fetch_javascript_handler(struct fetch_javascript_context *ctx)
called from poll to progress fetch.
nserror fetch_javascript_register(void)
Register javascript scheme fetcher with fetcher factory.
static void fetch_javascript_finalise(lwc_string *scheme)
callback to finalise the resource fetcher.
static void fetch_javascript_poll(lwc_string *scheme)
callback to poll for additional resource fetch contents
static void * fetch_javascript_setup(struct fetch *fetchh, nsurl *url, bool only_2xx, bool downgrade_tls, const char *post_urlenc, const struct fetch_multipart_data *post_multipart, const char **headers)
callback to set up a resource fetch context.
static void fetch_javascript_abort(void *ctx)
callback to abort a resource fetch
static struct fetch_javascript_context * ring
javascript scheme handler
Interface for fetchers factory.
NetSurf URL handling (interface).
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
nsurl * nsurl_ref(nsurl *url)
Increment the reference count to a NetSurf URL object.
struct nsurl nsurl
NetSurf URL object.
#define RING_REMOVE(ring, element)
Remove the given element from the specified ring.
#define RING_INSERT(ring, element)
Insert the given item into the specified ring.
Context for an resource fetch.
struct fetch_javascript_context * r_next
struct fetch_javascript_context * r_prev
bool locked
Flag indicating entry is already entered.
bool aborted
Flag indicating fetch has been aborted.
struct fetch * fetchh
Handle for this fetch.
nsurl * url
The URL being fetched.
Fetch POST multipart data.
Information for a single fetch.
bool(* initialise)(lwc_string *scheme)
The initialiser for the fetcher.