1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

[libdom] removed CONFIG_XML in a few places

This commit is contained in:
Witold Filipczyk 2023-05-05 13:55:40 +02:00
parent 8ad10015f2
commit 946c2e11f6
7 changed files with 9 additions and 57 deletions

View File

@ -5,7 +5,6 @@ SUBDIRS-$(CONFIG_CSS) += css
SUBDIRS-$(CONFIG_DOM) += dom
SUBDIRS-$(CONFIG_LIBCSS) += css2
SUBDIRS-$(CONFIG_LIBDOM) += libdom
SUBDIRS-$(CONFIG_XML) += xml
SUBDIRS = gemini html plain

View File

@ -13,7 +13,4 @@ endif
subdir('gemini')
subdir('html')
subdir('plain')
if conf_data.get('CONFIG_XML')
subdir('xml')
endif
srcs += files('docdata.c', 'document.cpp', 'format.c', 'forms.c', 'options.c', 'refresh.c', 'renderer.cpp')

View File

@ -4,11 +4,11 @@ INCLUDES += $(SPIDERMONKEY_CFLAGS) $(MUJS_CFLAGS)
SUBDIRS-$(CONFIG_LIBDOM) += libdom
OBJS-$(CONFIG_ECMASCRIPT_SMJS) += css2xpath.obj ecmascript.obj localstorage-db.obj spidermonkey.obj timer.obj
OBJS-$(CONFIG_ECMASCRIPT_SMJS) += ecmascript.obj localstorage-db.obj spidermonkey.obj timer.obj
OBJS-$(CONFIG_MUJS) += css2xpath.obj ecmascript.obj localstorage-db.obj mujs.obj timer.obj
OBJS-$(CONFIG_MUJS) += ecmascript.obj localstorage-db.obj mujs.obj timer.obj
OBJS-$(CONFIG_QUICKJS) += css2xpath.obj ecmascript.obj localstorage-db.obj quickjs.obj timer.obj
OBJS-$(CONFIG_QUICKJS) += ecmascript.obj localstorage-db.obj quickjs.obj timer.obj
ifeq ($(CONFIG_ECMASCRIPT_SMJS), yes)
CONFIG_ANY_SPIDERMONKEY = yes

View File

@ -50,10 +50,6 @@
#include <curl/curl.h>
#include <libxml/tree.h>
#include <libxml/HTMLparser.h>
#include <libxml++/libxml++.h>
#include <algorithm>
#include <map>
@ -816,48 +812,10 @@ free_document(void *doc)
if (!doc) {
return;
}
xmlpp::Document *docu = static_cast<xmlpp::Document *>(doc);
delete docu;
// xmlpp::Document *docu = static_cast<xmlpp::Document *>(doc);
// delete docu;
}
#ifndef CONFIG_LIBDOM
void *document_parse_text(char *text, size_t length)
{
return NULL;
}
void *
document_parse(struct document *document)
{
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
#endif
struct cache_entry *cached = document->cached;
struct fragment *f = get_cache_fragment(cached);
const char *encoding;
if (!f || !f->length) {
return NULL;
}
struct string str;
if (!init_string(&str)) {
return NULL;
}
add_bytes_to_string(&str, f->data, f->length);
encoding = document->cp > 0 ? get_cp_mime_name(document->cp) : NULL;
// Parse HTML and create a DOM tree
xmlDoc* doc = htmlReadDoc((xmlChar*)str.source, NULL, encoding,
HTML_PARSE_RECOVER | HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING);
// Encapsulate raw libxml document in a libxml++ wrapper
xmlpp::Document *docu = new xmlpp::Document(doc);
done_string(&str);
return (void *)docu;
}
#endif
static void
delayed_goto(void *data)
{

View File

@ -1,4 +1,4 @@
top_builddir=../../..
top_builddir=../../../..
include $(top_builddir)/Makefile.config
INCLUDES += $(SPIDERMONKEY_CFLAGS)

View File

@ -1,6 +1,6 @@
#INCLUDES += $(SPIDERMONKEY_CFLAGS)
if conf_data.get('CONFIG_ECMASCRIPT_SMJS')
srcs += files('css2xpath.cpp', 'ecmascript.cpp', 'localstorage-db.cpp', 'spidermonkey.cpp', 'timer.cpp')
srcs += files('ecmascript.cpp', 'localstorage-db.cpp', 'spidermonkey.cpp', 'timer.cpp')
endif
if conf_data.get('CONFIG_ECMASCRIPT_SMJS')
@ -16,11 +16,11 @@ if CONFIG_ANY_SPIDERMONKEY
endif
if conf_data.get('CONFIG_MUJS')
srcs += files('css2xpath.cpp', 'ecmascript.cpp', 'localstorage-db.cpp', 'mujs.cpp', 'timer.cpp')
srcs += files('ecmascript.cpp', 'localstorage-db.cpp', 'mujs.cpp', 'timer.cpp')
endif
if conf_data.get('CONFIG_QUICKJS')
srcs += files('css2xpath.cpp', 'ecmascript.cpp', 'localstorage-db.cpp', 'quickjs.cpp', 'timer.cpp')
srcs += files('ecmascript.cpp', 'localstorage-db.cpp', 'quickjs.cpp', 'timer.cpp')
endif
if conf_data.get('CONFIG_LIBDOM')

View File

@ -58,8 +58,6 @@
#include "viewer/text/view.h"
#include "viewer/text/vs.h"
#include <libxml++/libxml++.h>
/*** Global methods */
static void