ELinks 0.18.0
localstorage.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "bfu/leds.h"
#include "document/view.h"
#include "js/ecmascript.h"
#include "js/localstorage-db.h"
#include "js/quickjs.h"
#include "js/quickjs/localstorage.h"
#include "session/session.h"
#include "viewer/text/vs.h"
Include dependency graph for localstorage.c:

Macros

#define countof(x)   (sizeof(x) / sizeof((x)[0]))
 

Functions

static char * readFromStorage (const char *key)
 
static void removeFromStorage (const char *key)
 
static void saveToStorage (const char *key, const char *val)
 
static JSValue js_localstorage_getitem (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_localstorage_removeitem (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_localstorage_setitem (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_localstorage_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
int js_localstorage_init (JSContext *ctx)
 

Variables

static JSClassID js_localstorage_class_id
 
static const JSCFunctionListEntry js_localstorage_proto_funcs []
 
static JSClassDef js_localstorage_class
 

Macro Definition Documentation

◆ countof

#define countof ( x)    (sizeof(x) / sizeof((x)[0]))

Function Documentation

◆ js_localstorage_getitem()

static JSValue js_localstorage_getitem ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )
static

◆ js_localstorage_init()

int js_localstorage_init ( JSContext * ctx)

◆ js_localstorage_removeitem()

static JSValue js_localstorage_removeitem ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )
static

◆ js_localstorage_setitem()

static JSValue js_localstorage_setitem ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )
static

◆ js_localstorage_toString()

static JSValue js_localstorage_toString ( JSContext * ctx,
JSValueConst this_val,
int argc,
JSValueConst * argv )
static

◆ readFromStorage()

static char * readFromStorage ( const char * key)
static

◆ removeFromStorage()

static void removeFromStorage ( const char * key)
static

◆ saveToStorage()

static void saveToStorage ( const char * key,
const char * val )
static

Variable Documentation

◆ js_localstorage_class

JSClassDef js_localstorage_class
static
Initial value:
= {
"localStorage",
}

◆ js_localstorage_class_id

JSClassID js_localstorage_class_id
static

◆ js_localstorage_proto_funcs

const JSCFunctionListEntry js_localstorage_proto_funcs[]
static
Initial value:
= {
JS_CFUNC_DEF("getItem", 1, js_localstorage_getitem),
JS_CFUNC_DEF("removeItem", 1, js_localstorage_removeitem),
JS_CFUNC_DEF("setItem", 2, js_localstorage_setitem),
}
static JSValue js_localstorage_removeitem(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition localstorage.c:112
static JSValue js_localstorage_getitem(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition localstorage.c:78
static JSValue js_localstorage_setitem(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition localstorage.c:141