mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[mujs] compilation fixes
This commit is contained in:
parent
b2b7b123ec
commit
c3c9041487
@ -31,9 +31,6 @@ mjs_attributes_set_items(js_State *J, void *node)
|
|||||||
#ifdef ECMASCRIPT_DEBUG
|
#ifdef ECMASCRIPT_DEBUG
|
||||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||||
#endif
|
#endif
|
||||||
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)js_getcontext(J);
|
|
||||||
assert(interpreter);
|
|
||||||
|
|
||||||
dom_exception err;
|
dom_exception err;
|
||||||
dom_namednodemap *attrs = (dom_namednodemap *)(node);
|
dom_namednodemap *attrs = (dom_namednodemap *)(node);
|
||||||
unsigned long idx;
|
unsigned long idx;
|
||||||
|
@ -23,10 +23,6 @@ mjs_console_log_common(js_State *J, const char *str, const char *log_filename)
|
|||||||
#ifdef ECMASCRIPT_DEBUG
|
#ifdef ECMASCRIPT_DEBUG
|
||||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||||
#endif
|
#endif
|
||||||
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)js_getcontext(J);
|
|
||||||
|
|
||||||
assert(interpreter);
|
|
||||||
|
|
||||||
if (log_filename && get_opt_bool("ecmascript.enable_console_log", NULL) && str)
|
if (log_filename && get_opt_bool("ecmascript.enable_console_log", NULL) && str)
|
||||||
{
|
{
|
||||||
FILE *f = fopen(log_filename, "a");
|
FILE *f = fopen(log_filename, "a");
|
||||||
|
@ -1901,6 +1901,7 @@ mjs_element_cloneNode(js_State *J)
|
|||||||
mjs_push_element(J, clone);
|
mjs_push_element(J, clone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
static bool
|
static bool
|
||||||
isAncestor(dom_node *el, dom_node *node)
|
isAncestor(dom_node *el, dom_node *node)
|
||||||
{
|
{
|
||||||
@ -1924,6 +1925,7 @@ isAncestor(dom_node *el, dom_node *node)
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mjs_element_closest(js_State *J)
|
mjs_element_closest(js_State *J)
|
||||||
|
@ -335,14 +335,14 @@ set_elstyle(const char *text)
|
|||||||
return (void *)css;
|
return (void *)css;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
char *
|
||||||
get_elstyle(void *m)
|
get_elstyle(void *m)
|
||||||
{
|
{
|
||||||
std::map<std::string, std::string> *css = static_cast<std::map<std::string, std::string> *>(m);
|
std::map<std::string, std::string> *css = static_cast<std::map<std::string, std::string> *>(m);
|
||||||
std::string delimiter("");
|
std::string delimiter("");
|
||||||
std::stringstream output("");
|
std::stringstream output("");
|
||||||
std::map<std::string, std::string>::iterator it;
|
std::map<std::string, std::string>::iterator it;
|
||||||
const char *res = NULL;
|
char *res = NULL;
|
||||||
|
|
||||||
for (it = css->begin(); it != css->end(); it++) {
|
for (it = css->begin(); it != css->end(); it++) {
|
||||||
output << delimiter << it->first << ":" << it->second;
|
output << delimiter << it->first << ":" << it->second;
|
||||||
@ -355,7 +355,7 @@ get_elstyle(void *m)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
char *
|
||||||
get_css_value(const char *text, const char *param)
|
get_css_value(const char *text, const char *param)
|
||||||
{
|
{
|
||||||
void *m = set_elstyle(text);
|
void *m = set_elstyle(text);
|
||||||
@ -378,7 +378,7 @@ get_css_value(const char *text, const char *param)
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *
|
char *
|
||||||
set_css_value(const char *text, const char *param, const char *value)
|
set_css_value(const char *text, const char *param, const char *value)
|
||||||
{
|
{
|
||||||
void *m = set_elstyle(text);
|
void *m = set_elstyle(text);
|
||||||
|
@ -47,10 +47,10 @@ void set_xhr_header(char *normalized_value, const char *h_name, struct mjs_xhr *
|
|||||||
char *get_output_headers(struct mjs_xhr *x);
|
char *get_output_headers(struct mjs_xhr *x);
|
||||||
char *get_output_header(const char *header_name, struct mjs_xhr *x);
|
char *get_output_header(const char *header_name, struct mjs_xhr *x);
|
||||||
|
|
||||||
const char *get_elstyle(void *m);
|
char *get_elstyle(void *m);
|
||||||
void *set_elstyle(const char *text);
|
void *set_elstyle(const char *text);
|
||||||
const char *get_css_value(const char *text, const char *param);
|
char *get_css_value(const char *text, const char *param);
|
||||||
const char *set_css_value(const char *text, const char *param, const char *value);
|
char *set_css_value(const char *text, const char *param, const char *value);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ mjs_style(js_State *J, const char *property)
|
|||||||
dom_exception exc;
|
dom_exception exc;
|
||||||
dom_node *el = (struct dom_node *)js_touserdata(J, 0, "style");
|
dom_node *el = (struct dom_node *)js_touserdata(J, 0, "style");
|
||||||
dom_string *style = NULL;
|
dom_string *style = NULL;
|
||||||
const char *res = NULL;
|
char *res = NULL;
|
||||||
|
|
||||||
if (!el) {
|
if (!el) {
|
||||||
js_pushnull(J);
|
js_pushnull(J);
|
||||||
@ -72,7 +72,7 @@ mjs_set_style(js_State *J, const char *property)
|
|||||||
dom_node *el = (struct dom_node *)js_touserdata(J, 0, "style");
|
dom_node *el = (struct dom_node *)js_touserdata(J, 0, "style");
|
||||||
dom_string *style = NULL;
|
dom_string *style = NULL;
|
||||||
dom_string *stylestr = NULL;
|
dom_string *stylestr = NULL;
|
||||||
const char *res = NULL;
|
char *res = NULL;
|
||||||
const char *value;
|
const char *value;
|
||||||
|
|
||||||
if (!el) {
|
if (!el) {
|
||||||
|
Loading…
Reference in New Issue
Block a user