Add Hubbub support, should work much better when actually initializing it.
svn path=/trunk/netsurf/; revision=5487
This commit is contained in:
parent
022616ce99
commit
b36a6f7734
|
@ -42,6 +42,11 @@
|
|||
#include <String.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
#ifdef WITH_HUBBUB
|
||||
#include <hubbub/hubbub.h>
|
||||
#endif
|
||||
|
||||
#include "content/content.h"
|
||||
#include "content/fetch.h"
|
||||
#include "content/fetchers/fetch_curl.h"
|
||||
|
@ -78,6 +83,11 @@ extern "C" {
|
|||
#include "beos/beos_fetch_rsrc.h"
|
||||
|
||||
|
||||
#ifdef WITH_HUBBUB
|
||||
static void *myrealloc(void *ptr, size_t len, void *pw);
|
||||
#endif
|
||||
|
||||
|
||||
/* Where to search for shared resources. Must have trailing / */
|
||||
#define RESPATH "/boot/apps/netsurf/res/"
|
||||
|
||||
|
@ -520,6 +530,15 @@ void gui_init(int argc, char** argv)
|
|||
#endif
|
||||
LOG(("Using '%s' as AdBlock CSS URL", adblock_stylesheet_url));
|
||||
|
||||
#ifdef WITH_HUBBUB
|
||||
find_resource(buf, "Aliases", "./beos/res/Aliases");
|
||||
LOG(("Using '%s' as aliases file", buf));
|
||||
if(hubbub_initialise(buf,myrealloc,NULL) != HUBBUB_OK)
|
||||
{
|
||||
die(messages_get("NoMemory"));
|
||||
}
|
||||
#endif
|
||||
|
||||
urldb_load(option_url_file);
|
||||
urldb_load_cookies(option_cookie_file);
|
||||
|
||||
|
@ -734,6 +753,11 @@ void gui_quit(void)
|
|||
CALLED();
|
||||
urldb_save_cookies(option_cookie_jar);
|
||||
urldb_save(option_url_file);
|
||||
#ifdef WITH_HUBBUB
|
||||
hubbub_finalise(myrealloc,NULL);
|
||||
#endif
|
||||
//options_save_tree(hotlist,option_hotlist_file,messages_get("TreeHotlist"));
|
||||
|
||||
free(default_stylesheet_url);
|
||||
free(adblock_stylesheet_url);
|
||||
free(option_cookie_file);
|
||||
|
@ -1112,3 +1136,10 @@ bool cookies_update(const char *domain, const struct cookie_data *data)
|
|||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef WITH_HUBBUB
|
||||
static void *myrealloc(void *ptr, size_t len, void *pw)
|
||||
{
|
||||
return realloc(ptr, len);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
../../!NetSurf/Resources/Aliases
|
Loading…
Reference in New Issue