NetSurf
include
netsurf
url_db.h
Go to the documentation of this file.
1
/*
2
* Copyright 2006 John M Bell <jmb202@ecs.soton.ac.uk>
3
*
4
* This file is part of NetSurf, http://www.netsurf-browser.org/
5
*
6
* NetSurf is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
9
*
10
* NetSurf is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
/**
20
* \file
21
* Unified URL information database public interface
22
*/
23
24
#ifndef _NETSURF_URL_DB_H_
25
#define _NETSURF_URL_DB_H_
26
27
#include <stdbool.h>
28
#include <
time.h
>
29
30
#include "
utils/errors.h
"
31
#include "
netsurf/content_type.h
"
32
33
struct
nsurl
;
34
struct
bitmap
;
35
36
struct
url_data
{
37
const
char
*
title
;
/**< Resource title */
38
unsigned
int
visits
;
/**< Visit count */
39
time_t
last_visit
;
/**< Last visit time */
40
content_type
type
;
/**< Type of resource */
41
};
42
43
44
/**
45
* Import an URL database from file, replacing any existing database
46
*
47
* \param filename Name of file containing data
48
*/
49
nserror
urldb_load
(
const
char
*filename);
50
51
52
/**
53
* Export the current database to file
54
*
55
* \param filename Name of file to export to
56
*/
57
nserror
urldb_save
(
const
char
*filename);
58
59
60
/**
61
* Iterate over entries in the database which match the given prefix
62
*
63
* \param prefix Prefix to match
64
* \param callback Callback function
65
*/
66
void
urldb_iterate_partial
(
const
char
*prefix,
bool
(*callback)(
struct
nsurl
*url,
const
struct
url_data
*data));
67
68
69
/**
70
* Iterate over all entries in database
71
*
72
* \param callback Function to callback for each entry
73
*/
74
void
urldb_iterate_entries
(
bool
(*callback)(
struct
nsurl
*url,
const
struct
url_data
*data));
75
76
77
/**
78
* Find data for an URL.
79
*
80
* \param url Absolute URL to look for
81
* \return Pointer to result struct, or NULL
82
*/
83
const
struct
url_data
*
urldb_get_url_data
(
struct
nsurl
*url);
84
85
86
/**
87
* Set certificate verification permissions
88
*
89
* \param url URL to consider
90
* \param permit Set to true to allow invalid certificates
91
*/
92
void
urldb_set_cert_permissions
(
struct
nsurl
*url,
bool
permit);
93
94
95
/**
96
* Dump URL database to stderr
97
*/
98
void
urldb_dump
(
void
);
99
100
#endif
content_type.h
Declaration of content enumerations.
content_type
content_type
The type of a content.
Definition:
content_type.h:53
errors.h
Error codes.
nserror
nserror
Enumeration of error codes.
Definition:
errors.h:29
nsurl
struct nsurl nsurl
NetSurf URL object.
Definition:
nsurl.h:31
bitmap
RISC OS wimp toolkit bitmap.
Definition:
bitmap.c:68
url_data
Definition:
url_db.h:36
url_data::visits
unsigned int visits
Visit count.
Definition:
url_db.h:38
url_data::last_visit
time_t last_visit
Last visit time.
Definition:
url_db.h:39
url_data::type
content_type type
Type of resource.
Definition:
url_db.h:40
url_data::title
const char * title
Resource title.
Definition:
url_db.h:37
time.h
Interface to time operations.
urldb_save
nserror urldb_save(const char *filename)
Export the current database to file.
Definition:
urldb.c:3094
urldb_iterate_partial
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.
urldb_set_cert_permissions
void urldb_set_cert_permissions(struct nsurl *url, bool permit)
Set certificate verification permissions.
Definition:
urldb.c:3455
urldb_dump
void urldb_dump(void)
Dump URL database to stderr.
Definition:
urldb.c:4481
urldb_load
nserror urldb_load(const char *filename)
Import an URL database from file, replacing any existing database.
Definition:
urldb.c:2876
urldb_iterate_entries
void urldb_iterate_entries(bool(*callback)(struct nsurl *url, const struct url_data *data))
Iterate over all entries in database.
urldb_get_url_data
const struct url_data * urldb_get_url_data(struct nsurl *url)
Find data for an URL.
Definition:
urldb.c:3309
Generated on Fri Nov 15 2024 15:34:10 for NetSurf by
1.9.4