mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[quickjs] Shorter function declarations
This commit is contained in:
parent
adbdf68bda
commit
d274eef77f
@ -56,7 +56,7 @@
|
||||
static JSClassID js_attr_class_id;
|
||||
|
||||
static JSValue
|
||||
js_attr_get_property_name(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_attr_get_property_name(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -83,7 +83,7 @@ js_attr_get_property_name(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_attr_get_property_value(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_attr_get_property_value(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -110,8 +110,8 @@ js_attr_get_property_value(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
}
|
||||
|
||||
static const JSCFunctionListEntry js_attr_proto_funcs[] = {
|
||||
JS_CGETSET_MAGIC_DEF("name", js_attr_get_property_name, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("value", js_attr_get_property_value, nullptr, 0),
|
||||
JS_CGETSET_DEF("name", js_attr_get_property_name, nullptr),
|
||||
JS_CGETSET_DEF("value", js_attr_get_property_value, nullptr),
|
||||
};
|
||||
|
||||
static JSClassDef js_attr_class = {
|
||||
|
@ -49,7 +49,7 @@
|
||||
static JSClassID js_location_class_id;
|
||||
|
||||
static JSValue
|
||||
js_location_get_property_hash(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_location_get_property_hash(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -78,7 +78,7 @@ js_location_get_property_hash(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_get_property_host(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_location_get_property_host(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -109,7 +109,7 @@ js_location_get_property_host(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_get_property_hostname(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_location_get_property_hostname(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -140,7 +140,7 @@ js_location_get_property_hostname(JSContext *ctx, JSValueConst this_val, int mag
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_get_property_href(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_location_get_property_href(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -171,7 +171,7 @@ js_location_get_property_href(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_get_property_origin(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_location_get_property_origin(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -202,7 +202,7 @@ js_location_get_property_origin(JSContext *ctx, JSValueConst this_val, int magic
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_get_property_pathname(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_location_get_property_pathname(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -232,7 +232,7 @@ js_location_get_property_pathname(JSContext *ctx, JSValueConst this_val, int mag
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_get_property_port(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_location_get_property_port(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -260,7 +260,7 @@ js_location_get_property_port(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_get_property_protocol(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_location_get_property_protocol(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -293,7 +293,7 @@ js_location_get_property_protocol(JSContext *ctx, JSValueConst this_val, int mag
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_get_property_search(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_location_get_property_search(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -324,7 +324,7 @@ js_location_get_property_search(JSContext *ctx, JSValueConst this_val, int magic
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_set_property_hash(JSContext *ctx, JSValueConst this_val, JSValue val, int magic)
|
||||
js_location_set_property_hash(JSContext *ctx, JSValueConst this_val, JSValue val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -353,7 +353,7 @@ js_location_set_property_hash(JSContext *ctx, JSValueConst this_val, JSValue val
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_set_property_host(JSContext *ctx, JSValueConst this_val, JSValue val, int magic)
|
||||
js_location_set_property_host(JSContext *ctx, JSValueConst this_val, JSValue val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -381,7 +381,7 @@ js_location_set_property_host(JSContext *ctx, JSValueConst this_val, JSValue val
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_set_property_hostname(JSContext *ctx, JSValueConst this_val, JSValue val, int magic)
|
||||
js_location_set_property_hostname(JSContext *ctx, JSValueConst this_val, JSValue val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -409,7 +409,7 @@ js_location_set_property_hostname(JSContext *ctx, JSValueConst this_val, JSValue
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_set_property_href(JSContext *ctx, JSValueConst this_val, JSValue val, int magic)
|
||||
js_location_set_property_href(JSContext *ctx, JSValueConst this_val, JSValue val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -437,7 +437,7 @@ js_location_set_property_href(JSContext *ctx, JSValueConst this_val, JSValue val
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_set_property_pathname(JSContext *ctx, JSValueConst this_val, JSValue val, int magic)
|
||||
js_location_set_property_pathname(JSContext *ctx, JSValueConst this_val, JSValue val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -465,7 +465,7 @@ js_location_set_property_pathname(JSContext *ctx, JSValueConst this_val, JSValue
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_set_property_port(JSContext *ctx, JSValueConst this_val, JSValue val, int magic)
|
||||
js_location_set_property_port(JSContext *ctx, JSValueConst this_val, JSValue val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -493,7 +493,7 @@ js_location_set_property_port(JSContext *ctx, JSValueConst this_val, JSValue val
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_set_property_protocol(JSContext *ctx, JSValueConst this_val, JSValue val, int magic)
|
||||
js_location_set_property_protocol(JSContext *ctx, JSValueConst this_val, JSValue val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -521,7 +521,7 @@ js_location_set_property_protocol(JSContext *ctx, JSValueConst this_val, JSValue
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_location_set_property_search(JSContext *ctx, JSValueConst this_val, JSValue val, int magic)
|
||||
js_location_set_property_search(JSContext *ctx, JSValueConst this_val, JSValue val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -575,19 +575,19 @@ js_location_toString(JSContext *ctx, JSValueConst this_val, int argc, JSValueCon
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
#endif
|
||||
return js_location_get_property_href(ctx, this_val, 0);
|
||||
return js_location_get_property_href(ctx, this_val);
|
||||
}
|
||||
|
||||
static const JSCFunctionListEntry js_location_proto_funcs[] = {
|
||||
JS_CGETSET_MAGIC_DEF("hash", js_location_get_property_hash, js_location_set_property_hash, 0),
|
||||
JS_CGETSET_MAGIC_DEF("host", js_location_get_property_host, js_location_set_property_host, 0),
|
||||
JS_CGETSET_MAGIC_DEF("hostname", js_location_get_property_hostname, js_location_set_property_hostname, 0),
|
||||
JS_CGETSET_MAGIC_DEF("href", js_location_get_property_href, js_location_set_property_href, 0),
|
||||
JS_CGETSET_MAGIC_DEF("origin", js_location_get_property_origin, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("pathname", js_location_get_property_pathname, js_location_set_property_pathname, 0),
|
||||
JS_CGETSET_MAGIC_DEF("port", js_location_get_property_port, js_location_set_property_port, 0),
|
||||
JS_CGETSET_MAGIC_DEF("protocol", js_location_get_property_protocol, js_location_set_property_protocol, 0),
|
||||
JS_CGETSET_MAGIC_DEF("search", js_location_get_property_search, js_location_set_property_search, 0),
|
||||
JS_CGETSET_DEF("hash", js_location_get_property_hash, js_location_set_property_hash),
|
||||
JS_CGETSET_DEF("host", js_location_get_property_host, js_location_set_property_host),
|
||||
JS_CGETSET_DEF("hostname", js_location_get_property_hostname, js_location_set_property_hostname),
|
||||
JS_CGETSET_DEF("href", js_location_get_property_href, js_location_set_property_href),
|
||||
JS_CGETSET_DEF("origin", js_location_get_property_origin, nullptr),
|
||||
JS_CGETSET_DEF("pathname", js_location_get_property_pathname, js_location_set_property_pathname),
|
||||
JS_CGETSET_DEF("port", js_location_get_property_port, js_location_set_property_port),
|
||||
JS_CGETSET_DEF("protocol", js_location_get_property_protocol, js_location_set_property_protocol),
|
||||
JS_CGETSET_DEF("search", js_location_get_property_search, js_location_set_property_search),
|
||||
JS_CFUNC_DEF("reload", 0, js_location_reload),
|
||||
JS_CFUNC_DEF("toString", 0, js_location_toString),
|
||||
JS_CFUNC_DEF("toLocaleString", 0, js_location_toString),
|
||||
|
@ -48,7 +48,7 @@ static JSClassID js_navigator_class_id;
|
||||
/* @navigator_class.getProperty */
|
||||
|
||||
static JSValue
|
||||
js_navigator_get_property_appCodeName(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_navigator_get_property_appCodeName(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -57,7 +57,7 @@ js_navigator_get_property_appCodeName(JSContext *ctx, JSValueConst this_val, int
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_navigator_get_property_appName(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_navigator_get_property_appName(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -66,7 +66,7 @@ js_navigator_get_property_appName(JSContext *ctx, JSValueConst this_val, int mag
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_navigator_get_property_appVersion(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_navigator_get_property_appVersion(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -75,7 +75,7 @@ js_navigator_get_property_appVersion(JSContext *ctx, JSValueConst this_val, int
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_navigator_get_property_language(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_navigator_get_property_language(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -89,7 +89,7 @@ js_navigator_get_property_language(JSContext *ctx, JSValueConst this_val, int ma
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_navigator_get_property_platform(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_navigator_get_property_platform(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -98,7 +98,7 @@ js_navigator_get_property_platform(JSContext *ctx, JSValueConst this_val, int ma
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_navigator_get_property_userAgent(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_navigator_get_property_userAgent(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -134,12 +134,12 @@ js_navigator_get_property_userAgent(JSContext *ctx, JSValueConst this_val, int m
|
||||
}
|
||||
|
||||
static const JSCFunctionListEntry js_navigator_proto_funcs[] = {
|
||||
JS_CGETSET_MAGIC_DEF("appCodeName", js_navigator_get_property_appCodeName, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("appName", js_navigator_get_property_appName, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("appVersion", js_navigator_get_property_appVersion, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("language", js_navigator_get_property_language, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("platform", js_navigator_get_property_platform, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("userAgent", js_navigator_get_property_userAgent, nullptr, 0),
|
||||
JS_CGETSET_DEF("appCodeName", js_navigator_get_property_appCodeName, nullptr),
|
||||
JS_CGETSET_DEF("appName", js_navigator_get_property_appName, nullptr),
|
||||
JS_CGETSET_DEF("appVersion", js_navigator_get_property_appVersion, nullptr),
|
||||
JS_CGETSET_DEF("language", js_navigator_get_property_language, nullptr),
|
||||
JS_CGETSET_DEF("platform", js_navigator_get_property_platform, nullptr),
|
||||
JS_CGETSET_DEF("userAgent", js_navigator_get_property_userAgent, nullptr),
|
||||
};
|
||||
|
||||
static JSClassDef js_navigator_class = {
|
||||
|
@ -47,7 +47,7 @@
|
||||
static JSClassID js_screen_class_id;
|
||||
|
||||
static JSValue
|
||||
js_screen_get_property_availHeight(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_screen_get_property_availHeight(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -64,7 +64,7 @@ js_screen_get_property_availHeight(JSContext *ctx, JSValueConst this_val, int ma
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_screen_get_property_availWidth(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_screen_get_property_availWidth(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -81,7 +81,7 @@ js_screen_get_property_availWidth(JSContext *ctx, JSValueConst this_val, int mag
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_screen_get_property_height(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_screen_get_property_height(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -107,7 +107,7 @@ js_screen_get_property_height(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
}
|
||||
|
||||
static JSValue
|
||||
js_screen_get_property_width(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
js_screen_get_property_width(JSContext *ctx, JSValueConst this_val)
|
||||
{
|
||||
#ifdef ECMASCRIPT_DEBUG
|
||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||
@ -133,10 +133,10 @@ js_screen_get_property_width(JSContext *ctx, JSValueConst this_val, int magic)
|
||||
}
|
||||
|
||||
static const JSCFunctionListEntry js_screen_proto_funcs[] = {
|
||||
JS_CGETSET_MAGIC_DEF("availHeight", js_screen_get_property_availHeight, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("availWidth", js_screen_get_property_availWidth, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("height", js_screen_get_property_height, nullptr, 0),
|
||||
JS_CGETSET_MAGIC_DEF("width", js_screen_get_property_width, nullptr, 0),
|
||||
JS_CGETSET_DEF("availHeight", js_screen_get_property_availHeight, nullptr),
|
||||
JS_CGETSET_DEF("availWidth", js_screen_get_property_availWidth, nullptr),
|
||||
JS_CGETSET_DEF("height", js_screen_get_property_height, nullptr),
|
||||
JS_CGETSET_DEF("width", js_screen_get_property_width, nullptr),
|
||||
};
|
||||
|
||||
static JSClassDef js_screen_class = {
|
||||
|
Loading…
Reference in New Issue
Block a user