NetSurf
Data Structures | Functions
url_db.h File Reference

Unified URL information database public interface. More...

#include <stdbool.h>
#include <time.h>
#include "utils/errors.h"
#include "netsurf/content_type.h"
Include dependency graph for url_db.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  url_data
 

Functions

nserror urldb_load (const char *filename)
 Import an URL database from file, replacing any existing database. More...
 
nserror urldb_save (const char *filename)
 Export the current database to file. More...
 
void urldb_iterate_partial (const char *prefix, bool(*callback)(struct nsurl *url, const struct url_data *data))
 Iterate over entries in the database which match the given prefix. More...
 
void urldb_iterate_entries (bool(*callback)(struct nsurl *url, const struct url_data *data))
 Iterate over all entries in database. More...
 
const struct url_dataurldb_get_url_data (struct nsurl *url)
 Find data for an URL. More...
 
void urldb_set_cert_permissions (struct nsurl *url, bool permit)
 Set certificate verification permissions. More...
 
void urldb_dump (void)
 Dump URL database to stderr. More...
 

Detailed Description

Unified URL information database public interface.

Definition in file url_db.h.

Function Documentation

◆ urldb_dump()

void urldb_dump ( void  )

Dump URL database to stderr.

Definition at line 4481 of file urldb.c.

References db_root, NUM_SEARCH_TREES, search_trees, urldb_dump_hosts(), and urldb_dump_search().

Referenced by ro_gui_window_handle_local_keypress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ urldb_get_url_data()

const struct url_data * urldb_get_url_data ( struct nsurl url)

Find data for an URL.

Parameters
urlAbsolute URL to look for
Returns
Pointer to result struct, or NULL

Definition at line 3309 of file urldb.c.

References path_data::urld, and urldb_find_url().

Referenced by global_history_add(), hotlist_create_entry(), hotlist_update_url_walk_cb(), node_is_visited(), ro_gui_hotlist_add_page(), and ro_gui_url_complete_redraw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ urldb_iterate_entries()

void urldb_iterate_entries ( bool(*)(struct nsurl *url, const struct url_data *data)  callback)

Iterate over all entries in database.

Parameters
callbackFunction to callback for each entry

Referenced by global_history_init(), ro_gui_url_complete_keypress(), and ro_gui_url_suggest_prepare_menu().

Here is the caller graph for this function:

◆ urldb_iterate_partial()

void urldb_iterate_partial ( const char *  prefix,
bool(*)(struct nsurl *url, const struct url_data *data)  callback 
)

Iterate over entries in the database which match the given prefix.

Parameters
prefixPrefix to match
callbackCallback function

Referenced by nsgtk_completion_update(), and ro_gui_url_complete_keypress().

Here is the caller graph for this function:

◆ urldb_load()

nserror urldb_load ( const char *  filename)

Import an URL database from file, replacing any existing database.

Parameters
filenameName of file containing data

Definition at line 2876 of file urldb.c.

References bloom_create(), bloom_insert_hash(), BLOOM_SIZE, hsts_data::expires, host_part::hsts, hsts_data::include_sub_domains, url_internal_data::last_visit, MAXIMUM_URL_LENGTH, MIN_URL_FILE_VERSION, nsc_snptimet(), NSERROR_INVALID, NSERROR_NEED_DATA, NSERROR_NOMEM, NSERROR_NOT_FOUND, NSERROR_OK, NSLOG, nsurl_create(), NSURL_FRAGMENT, nsurl_get(), nsurl_get_component(), nsurl_hash(), NSURL_PATH, NSURL_QUERY, NSURL_SCHEME, nsurl_unref(), path_data::port, path_data::scheme, url_internal_data::title, url_internal_data::type, path_data::url, url_bloom, URL_FILE_VERSION, path_data::urld, urldb_add_host(), urldb_add_path(), version, and url_internal_data::visits.

Referenced by gui_init(), main(), nsgtk_setup(), and WinMain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ urldb_save()

nserror urldb_save ( const char *  filename)

Export the current database to file.

Parameters
filenameName of file to export to

Definition at line 3094 of file urldb.c.

References NSERROR_OK, NSERROR_SAVE_FAILED, NSLOG, NUM_SEARCH_TREES, search_trees, URL_FILE_VERSION, and urldb_save_search_tree().

Referenced by gui_quit(), monkey_quit(), nsgtk_finalise(), and WinMain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ urldb_set_cert_permissions()

void urldb_set_cert_permissions ( struct nsurl url,
bool  permit 
)

Set certificate verification permissions.

Parameters
urlURL to consider
permitSet to true to allow invalid certificates

Definition at line 3455 of file urldb.c.

References path_data::parent, host_part::permit_invalid_certs, urldb_add_url(), and urldb_find_url().

Referenced by browser_window__handle_ssl_query_response().

Here is the call graph for this function:
Here is the caller graph for this function: