ELinks 0.18.0
xhr.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
#include "elinks.h"
#include "bfu/dialog.h"
#include "cache/cache.h"
#include "cookies/cookies.h"
#include "dialogs/menu.h"
#include "dialogs/status.h"
#include "document/html/frames.h"
#include "document/document.h"
#include "document/forms.h"
#include "document/view.h"
#include "js/ecmascript.h"
#include "js/mujs/mapa.h"
#include "js/mujs.h"
#include "js/mujs/xhr.h"
#include "js/timer.h"
#include "intl/libintl.h"
#include "main/select.h"
#include "main/timer.h"
#include "network/connection.h"
#include "osdep/newwin.h"
#include "osdep/sysname.h"
#include "protocol/http/http.h"
#include "protocol/uri.h"
#include "session/download.h"
#include "session/history.h"
#include "session/location.h"
#include "session/session.h"
#include "session/task.h"
#include "terminal/tab.h"
#include "terminal/terminal.h"
#include "util/conv.h"
#include "util/memory.h"
#include "util/string.h"
#include "viewer/text/draw.h"
#include "viewer/text/form.h"
#include "viewer/text/link.h"
#include "viewer/text/vs.h"
Include dependency graph for xhr.c:

Functions

static void mjs_xhr_get_property_onabort (js_State *J)
static void mjs_xhr_get_property_onerror (js_State *J)
static void mjs_xhr_get_property_onload (js_State *J)
static void mjs_xhr_get_property_onloadend (js_State *J)
static void mjs_xhr_get_property_onloadstart (js_State *J)
static void mjs_xhr_get_property_onprogress (js_State *J)
static void mjs_xhr_get_property_onreadystatechange (js_State *J)
static void mjs_xhr_get_property_ontimeout (js_State *J)
static void mjs_xhr_get_property_readyState (js_State *J)
static void mjs_xhr_get_property_response (js_State *J)
static void mjs_xhr_get_property_responseText (js_State *J)
static void mjs_xhr_get_property_responseType (js_State *J)
static void mjs_xhr_get_property_responseURL (js_State *J)
static void mjs_xhr_get_property_status (js_State *J)
static void mjs_xhr_get_property_statusText (js_State *J)
static void mjs_xhr_get_property_timeout (js_State *J)
static void mjs_xhr_get_property_upload (js_State *J)
static void mjs_xhr_get_property_withCredentials (js_State *J)
static void mjs_xhr_set_property_onabort (js_State *J)
static void mjs_xhr_set_property_onerror (js_State *J)
static void mjs_xhr_set_property_onload (js_State *J)
static void mjs_xhr_set_property_onloadend (js_State *J)
static void mjs_xhr_set_property_onloadstart (js_State *J)
static void mjs_xhr_set_property_onprogress (js_State *J)
static void mjs_xhr_set_property_onreadystatechange (js_State *J)
static void mjs_xhr_set_property_ontimeout (js_State *J)
static void mjs_xhr_set_property_responseType (js_State *J)
static void mjs_xhr_set_property_timeout (js_State *J)
static void mjs_xhr_set_property_withCredentials (js_State *J)
static void onload_run (void *data)
static void onloadend_run (void *data)
static void onreadystatechange_run (void *data)
static void ontimeout_run (void *data)
char * normalize (char *value)
static void mjs_xhr_finalizer (js_State *J, void *data)
static void mjs_xhr_static_get_property_UNSENT (js_State *J)
static void mjs_xhr_static_get_property_OPENED (js_State *J)
static void mjs_xhr_static_get_property_HEADERS_RECEIVED (js_State *J)
static void mjs_xhr_static_get_property_LOADING (js_State *J)
static void mjs_xhr_static_get_property_DONE (js_State *J)
static void mjs_xhr_abort (js_State *J)
static void mjs_xhr_addEventListener (js_State *J)
static void mjs_xhr_getAllResponseHeaders (js_State *J)
static void mjs_xhr_getResponseHeader (js_State *J)
static void mjs_xhr_open (js_State *J)
static void mjs_xhr_overrideMimeType (js_State *J)
static void mjs_xhr_removeEventListener (js_State *J)
static void mjs_xhr_send (js_State *J)
static void mjs_xhr_setRequestHeader (js_State *J)
static void mjs_xhr_loading_callback (struct download *download, struct mjs_xhr *xhr)
static size_t write_data (void *ptr, size_t size, size_t nmemb, void *stream)
static bool valid_header (const char *header)
static bool forbidden_header (const char *header)
static void mjs_xhr_fun (js_State *J)
static void mjs_xhr_constructor (js_State *J)
int mjs_xhr_init (js_State *J)

Variables

const unsigned short UNSENT = 0
const unsigned short OPENED = 1
const unsigned short HEADERS_RECEIVED = 2
const unsigned short LOADING = 3
const unsigned short DONE = 4

Function Documentation

◆ forbidden_header()

bool forbidden_header ( const char * header)
static

◆ mjs_xhr_abort()

void mjs_xhr_abort ( js_State * J)
static

◆ mjs_xhr_addEventListener()

void mjs_xhr_addEventListener ( js_State * J)
static

◆ mjs_xhr_constructor()

void mjs_xhr_constructor ( js_State * J)
static

◆ mjs_xhr_finalizer()

void mjs_xhr_finalizer ( js_State * J,
void * data )
static

◆ mjs_xhr_fun()

void mjs_xhr_fun ( js_State * J)
static

◆ mjs_xhr_get_property_onabort()

void mjs_xhr_get_property_onabort ( js_State * J)
static

◆ mjs_xhr_get_property_onerror()

void mjs_xhr_get_property_onerror ( js_State * J)
static

◆ mjs_xhr_get_property_onload()

void mjs_xhr_get_property_onload ( js_State * J)
static

◆ mjs_xhr_get_property_onloadend()

void mjs_xhr_get_property_onloadend ( js_State * J)
static

◆ mjs_xhr_get_property_onloadstart()

void mjs_xhr_get_property_onloadstart ( js_State * J)
static

◆ mjs_xhr_get_property_onprogress()

void mjs_xhr_get_property_onprogress ( js_State * J)
static

◆ mjs_xhr_get_property_onreadystatechange()

void mjs_xhr_get_property_onreadystatechange ( js_State * J)
static

◆ mjs_xhr_get_property_ontimeout()

void mjs_xhr_get_property_ontimeout ( js_State * J)
static

◆ mjs_xhr_get_property_readyState()

void mjs_xhr_get_property_readyState ( js_State * J)
static

◆ mjs_xhr_get_property_response()

void mjs_xhr_get_property_response ( js_State * J)
static

◆ mjs_xhr_get_property_responseText()

void mjs_xhr_get_property_responseText ( js_State * J)
static

◆ mjs_xhr_get_property_responseType()

void mjs_xhr_get_property_responseType ( js_State * J)
static

◆ mjs_xhr_get_property_responseURL()

void mjs_xhr_get_property_responseURL ( js_State * J)
static

◆ mjs_xhr_get_property_status()

void mjs_xhr_get_property_status ( js_State * J)
static

◆ mjs_xhr_get_property_statusText()

void mjs_xhr_get_property_statusText ( js_State * J)
static

◆ mjs_xhr_get_property_timeout()

void mjs_xhr_get_property_timeout ( js_State * J)
static

◆ mjs_xhr_get_property_upload()

void mjs_xhr_get_property_upload ( js_State * J)
static

◆ mjs_xhr_get_property_withCredentials()

void mjs_xhr_get_property_withCredentials ( js_State * J)
static

◆ mjs_xhr_getAllResponseHeaders()

void mjs_xhr_getAllResponseHeaders ( js_State * J)
static

◆ mjs_xhr_getResponseHeader()

void mjs_xhr_getResponseHeader ( js_State * J)
static

◆ mjs_xhr_init()

int mjs_xhr_init ( js_State * J)

◆ mjs_xhr_loading_callback()

void mjs_xhr_loading_callback ( struct download * download,
struct mjs_xhr * xhr )
static

◆ mjs_xhr_open()

void mjs_xhr_open ( js_State * J)
static

◆ mjs_xhr_overrideMimeType()

void mjs_xhr_overrideMimeType ( js_State * J)
static

TODO

◆ mjs_xhr_removeEventListener()

void mjs_xhr_removeEventListener ( js_State * J)
static

◆ mjs_xhr_send()

void mjs_xhr_send ( js_State * J)
static

◆ mjs_xhr_set_property_onabort()

void mjs_xhr_set_property_onabort ( js_State * J)
static

◆ mjs_xhr_set_property_onerror()

void mjs_xhr_set_property_onerror ( js_State * J)
static

◆ mjs_xhr_set_property_onload()

void mjs_xhr_set_property_onload ( js_State * J)
static

◆ mjs_xhr_set_property_onloadend()

void mjs_xhr_set_property_onloadend ( js_State * J)
static

◆ mjs_xhr_set_property_onloadstart()

void mjs_xhr_set_property_onloadstart ( js_State * J)
static

◆ mjs_xhr_set_property_onprogress()

void mjs_xhr_set_property_onprogress ( js_State * J)
static

◆ mjs_xhr_set_property_onreadystatechange()

void mjs_xhr_set_property_onreadystatechange ( js_State * J)
static

◆ mjs_xhr_set_property_ontimeout()

void mjs_xhr_set_property_ontimeout ( js_State * J)
static

◆ mjs_xhr_set_property_responseType()

void mjs_xhr_set_property_responseType ( js_State * J)
static

◆ mjs_xhr_set_property_timeout()

void mjs_xhr_set_property_timeout ( js_State * J)
static

◆ mjs_xhr_set_property_withCredentials()

void mjs_xhr_set_property_withCredentials ( js_State * J)
static

TODO Set this’s cross-origin credentials to the given value.

◆ mjs_xhr_setRequestHeader()

void mjs_xhr_setRequestHeader ( js_State * J)
static

◆ mjs_xhr_static_get_property_DONE()

void mjs_xhr_static_get_property_DONE ( js_State * J)
static

◆ mjs_xhr_static_get_property_HEADERS_RECEIVED()

void mjs_xhr_static_get_property_HEADERS_RECEIVED ( js_State * J)
static

◆ mjs_xhr_static_get_property_LOADING()

void mjs_xhr_static_get_property_LOADING ( js_State * J)
static

◆ mjs_xhr_static_get_property_OPENED()

void mjs_xhr_static_get_property_OPENED ( js_State * J)
static

◆ mjs_xhr_static_get_property_UNSENT()

void mjs_xhr_static_get_property_UNSENT ( js_State * J)
static

◆ normalize()

char * normalize ( char * value)

◆ onload_run()

void onload_run ( void * data)
static

◆ onloadend_run()

void onloadend_run ( void * data)
static

◆ onreadystatechange_run()

void onreadystatechange_run ( void * data)
static

◆ ontimeout_run()

void ontimeout_run ( void * data)
static

◆ valid_header()

bool valid_header ( const char * header)
static

◆ write_data()

size_t write_data ( void * ptr,
size_t size,
size_t nmemb,
void * stream )
static

Variable Documentation

◆ DONE

const unsigned short DONE = 4

◆ HEADERS_RECEIVED

const unsigned short HEADERS_RECEIVED = 2

◆ LOADING

const unsigned short LOADING = 3

◆ OPENED

const unsigned short OPENED = 1

◆ UNSENT

const unsigned short UNSENT = 0