ELinks 0.18.0
collection.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "document/libdom/corestrings.h"
#include "js/ecmascript.h"
#include "js/ecmascript-c.h"
#include "js/quickjs/mapa.h"
#include "js/quickjs.h"
#include "js/quickjs/collection.h"
#include "js/quickjs/element.h"
#include "js/quickjs/node.h"
Include dependency graph for collection.c:

Data Structures

struct  js_col
 

Macros

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

Functions

static void * js_htmlCollection_GetOpaque (JSValueConst this_val)
 
static void js_htmlColection_finalizer (JSRuntime *rt, JSValue val)
 
static void js_htmlCollection_mark (JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
 
static JSValue js_htmlCollection_get_property_length (JSContext *ctx, JSValueConst this_val)
 
static JSValue js_htmlCollection_item2 (JSContext *ctx, JSValueConst this_val, int idx)
 
static JSValue js_htmlCollection_item (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static JSValue js_htmlCollection_namedItem2 (JSContext *ctx, JSValueConst this_val, const char *str)
 
static JSValue js_htmlCollection_namedItem (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static void js_htmlCollection_set_items (JSContext *ctx, JSValue this_val, void *node)
 
static JSValue js_htmlCollection_toString (JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
 
static int js_obj_delete_property (JSContext *ctx, JSValueConst obj, JSAtom prop)
 
static JSValue js_obj_get_property (JSContext *ctx, JSValueConst obj, JSAtom prop, JSValueConst receiver)
 
static int js_obj_set_property (JSContext *ctx, JSValueConst obj, JSAtom prop, JSValueConst val, JSValueConst receiver, int flags)
 
static JSValue getCollection_common (JSContext *ctx, void *node, bool was_class_name)
 
JSValue getCollection (JSContext *ctx, void *node)
 
JSValue getCollection2 (JSContext *ctx, void *node)
 

Variables

JSClassID js_htmlCollection_class_id
 
static const JSCFunctionListEntry js_htmlCollection_proto_funcs []
 
static JSClassExoticMethods exo
 
static JSClassDef js_htmlCollection_class
 

Macro Definition Documentation

◆ countof

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

Function Documentation

◆ getCollection()

JSValue getCollection ( JSContext * ctx,
void * node )

◆ getCollection2()

JSValue getCollection2 ( JSContext * ctx,
void * node )

◆ getCollection_common()

static JSValue getCollection_common ( JSContext * ctx,
void * node,
bool was_class_name )
static

◆ js_htmlColection_finalizer()

static void js_htmlColection_finalizer ( JSRuntime * rt,
JSValue val )
static

◆ js_htmlCollection_get_property_length()

static JSValue js_htmlCollection_get_property_length ( JSContext * ctx,
JSValueConst this_val )
static

◆ js_htmlCollection_GetOpaque()

static void * js_htmlCollection_GetOpaque ( JSValueConst this_val)
static

◆ js_htmlCollection_item()

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

◆ js_htmlCollection_item2()

static JSValue js_htmlCollection_item2 ( JSContext * ctx,
JSValueConst this_val,
int idx )
static

◆ js_htmlCollection_mark()

static void js_htmlCollection_mark ( JSRuntime * rt,
JSValueConst val,
JS_MarkFunc * mark_func )
static

◆ js_htmlCollection_namedItem()

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

◆ js_htmlCollection_namedItem2()

static JSValue js_htmlCollection_namedItem2 ( JSContext * ctx,
JSValueConst this_val,
const char * str )
static

◆ js_htmlCollection_set_items()

static void js_htmlCollection_set_items ( JSContext * ctx,
JSValue this_val,
void * node )
static

◆ js_htmlCollection_toString()

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

◆ js_obj_delete_property()

static int js_obj_delete_property ( JSContext * ctx,
JSValueConst obj,
JSAtom prop )
static

◆ js_obj_get_property()

static JSValue js_obj_get_property ( JSContext * ctx,
JSValueConst obj,
JSAtom prop,
JSValueConst receiver )
static

◆ js_obj_set_property()

static int js_obj_set_property ( JSContext * ctx,
JSValueConst obj,
JSAtom prop,
JSValueConst val,
JSValueConst receiver,
int flags )
static

Variable Documentation

◆ exo

JSClassExoticMethods exo
static
Initial value:
= {
.delete_property = js_obj_delete_property,
.get_property = js_obj_get_property,
.set_property = js_obj_set_property
}
static int js_obj_set_property(JSContext *ctx, JSValueConst obj, JSAtom prop, JSValueConst val, JSValueConst receiver, int flags)
Definition collection.c:416
static JSValue js_obj_get_property(JSContext *ctx, JSValueConst obj, JSAtom prop, JSValueConst receiver)
Definition collection.c:401
static int js_obj_delete_property(JSContext *ctx, JSValueConst obj, JSAtom prop)
Definition collection.c:387

◆ js_htmlCollection_class

JSClassDef js_htmlCollection_class
static
Initial value:
= {
"htmlCollection",
.exotic = &exo
}
static void js_htmlCollection_mark(JSRuntime *rt, JSValueConst val, JS_MarkFunc *mark_func)
Definition collection.c:95
static void js_htmlColection_finalizer(JSRuntime *rt, JSValue val)
Definition collection.c:63
static JSClassExoticMethods exo
Definition collection.c:429

◆ js_htmlCollection_class_id

JSClassID js_htmlCollection_class_id

◆ js_htmlCollection_proto_funcs

const JSCFunctionListEntry js_htmlCollection_proto_funcs[]
static
Initial value:
= {
JS_CGETSET_DEF("length", js_htmlCollection_get_property_length, NULL),
JS_CFUNC_DEF("item", 1, js_htmlCollection_item),
JS_CFUNC_DEF("namedItem", 1, js_htmlCollection_namedItem),
}
#define NULL
Definition explodename.c:35
static JSValue js_htmlCollection_item(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition collection.c:177
static JSValue js_htmlCollection_get_property_length(JSContext *ctx, JSValueConst this_val)
Definition collection.c:111
static JSValue js_htmlCollection_namedItem(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
Definition collection.c:282