netsurf: branch master updated. release/3.3-37-g8871149
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/88711495858ead8749bfc...
...commit http://git.netsurf-browser.org/netsurf.git/commit/88711495858ead8749bfcf4...
...tree http://git.netsurf-browser.org/netsurf.git/tree/88711495858ead8749bfcf4c0...
The branch, master has been updated
via 88711495858ead8749bfcf4c08e1da49a671dd43 (commit)
from 82c7a7a4baf4a7a15381ee720799dc41c3d54909 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=88711495858ead8749b...
commit 88711495858ead8749bfcf4c08e1da49a671dd43
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Remove inclusion of my async backing store code whilst it's not being used.
diff --git a/amiga/Makefile.defaults b/amiga/Makefile.defaults
index e226889..cfd6a76 100644
--- a/amiga/Makefile.defaults
+++ b/amiga/Makefile.defaults
@@ -36,6 +36,11 @@ NETSURF_USE_NSSVG := YES
# Valid options: NO
NETSURF_USE_JS := NO
+# Enable building the source object cache filesystem based backing store.
+# implementation.
+# Valid options: YES, NO
+NETSURF_FS_BACKING_STORE := YES
+
# Optimisation levels
CFLAGS += -fomit-frame-pointer -gstabs
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index 215ee09..bca0c30 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -74,8 +74,7 @@ S_AMIGA := gui.c tree.c history.c hotlist.c schedule.c file.c \
sslcert.c gui_options.c print.c theme.c drag.c icon.c libs.c \
datatypes.c dt_picture.c dt_anim.c dt_sound.c plugin_hack.c \
stringview/stringview.c stringview/urlhistory.c rtg.c \
- agclass/amigaguide_class.c fs_backing_store.c os3support.c \
- font_bitmap.c
+ agclass/amigaguide_class.c os3support.c font_bitmap.c
S_AMIGA := $(addprefix amiga/,$(S_AMIGA))
# This is the final source build list
diff --git a/amiga/fs_backing_store.h b/amiga/fs_backing_store.h
index 89a67fb..45aa395 100644
--- a/amiga/fs_backing_store.h
+++ b/amiga/fs_backing_store.h
@@ -19,5 +19,6 @@
#ifndef AMIGA_FS_BACKING_STORE_H
#define AMIGA_FS_BACKING_STORE_H
extern struct gui_llcache_table *amiga_filesystem_llcache_table;
+extern struct gui_llcache_table *filesystem_llcache_table;
#endif
diff --git a/amiga/gui.c b/amiga/gui.c
index 7098203..dd06771 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -5409,7 +5409,7 @@ int main(int argc, char** argv)
.utf8 = amiga_utf8_table,
.search = amiga_search_table,
.search_web = &amiga_search_web_table,
- .llcache = amiga_filesystem_llcache_table,
+ .llcache = filesystem_llcache_table,
};
#ifdef __amigaos4__
-----------------------------------------------------------------------
Summary of changes:
amiga/Makefile.defaults | 5 +++++
amiga/Makefile.target | 3 +--
amiga/fs_backing_store.h | 1 +
amiga/gui.c | 2 +-
4 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/amiga/Makefile.defaults b/amiga/Makefile.defaults
index e226889..cfd6a76 100644
--- a/amiga/Makefile.defaults
+++ b/amiga/Makefile.defaults
@@ -36,6 +36,11 @@ NETSURF_USE_NSSVG := YES
# Valid options: NO
NETSURF_USE_JS := NO
+# Enable building the source object cache filesystem based backing store.
+# implementation.
+# Valid options: YES, NO
+NETSURF_FS_BACKING_STORE := YES
+
# Optimisation levels
CFLAGS += -fomit-frame-pointer -gstabs
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index 215ee09..bca0c30 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -74,8 +74,7 @@ S_AMIGA := gui.c tree.c history.c hotlist.c schedule.c file.c \
sslcert.c gui_options.c print.c theme.c drag.c icon.c libs.c \
datatypes.c dt_picture.c dt_anim.c dt_sound.c plugin_hack.c \
stringview/stringview.c stringview/urlhistory.c rtg.c \
- agclass/amigaguide_class.c fs_backing_store.c os3support.c \
- font_bitmap.c
+ agclass/amigaguide_class.c os3support.c font_bitmap.c
S_AMIGA := $(addprefix amiga/,$(S_AMIGA))
# This is the final source build list
diff --git a/amiga/fs_backing_store.h b/amiga/fs_backing_store.h
index 89a67fb..45aa395 100644
--- a/amiga/fs_backing_store.h
+++ b/amiga/fs_backing_store.h
@@ -19,5 +19,6 @@
#ifndef AMIGA_FS_BACKING_STORE_H
#define AMIGA_FS_BACKING_STORE_H
extern struct gui_llcache_table *amiga_filesystem_llcache_table;
+extern struct gui_llcache_table *filesystem_llcache_table;
#endif
diff --git a/amiga/gui.c b/amiga/gui.c
index 7098203..dd06771 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -5409,7 +5409,7 @@ int main(int argc, char** argv)
.utf8 = amiga_utf8_table,
.search = amiga_search_table,
.search_web = &amiga_search_web_table,
- .llcache = amiga_filesystem_llcache_table,
+ .llcache = filesystem_llcache_table,
};
#ifdef __amigaos4__
--
NetSurf Browser
8 years, 5 months
netsurf: branch master updated. release/3.3-36-g82c7a7a
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/82c7a7a4baf4a7a15381e...
...commit http://git.netsurf-browser.org/netsurf.git/commit/82c7a7a4baf4a7a15381ee7...
...tree http://git.netsurf-browser.org/netsurf.git/tree/82c7a7a4baf4a7a15381ee720...
The branch, master has been updated
via 82c7a7a4baf4a7a15381ee720799dc41c3d54909 (commit)
from 87a38ca5c1624cb86d8c031b38166a00494d6be0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=82c7a7a4baf4a7a1538...
commit 82c7a7a4baf4a7a15381ee720799dc41c3d54909
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Fix RISC OS not having a pread/pwrite implementation.
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 963fd54..f2e6a38 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -35,6 +35,8 @@
*
*/
+#include "utils/config.h"
+
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
@@ -1606,7 +1608,7 @@ static nserror store_write_block(struct store_state *state,
wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
offst, bse->elem[elem_idx].block));
- if (wr != bse->elem[elem_idx].size) {
+ if (wr != (ssize_t)bse->elem[elem_idx].size) {
return NSERROR_SAVE_FAILED;
}
@@ -1754,7 +1756,7 @@ static nserror store_read_block(struct store_state *state,
rd, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
offst, bse->elem[elem_idx].block));
- if (rd != bse->elem[elem_idx].size) {
+ if (rd != (ssize_t)bse->elem[elem_idx].size) {
return NSERROR_SAVE_FAILED;
}
diff --git a/utils/config.h b/utils/config.h
index c45b865..cfb9d83 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -39,7 +39,7 @@ char *strcasestr(const char *haystack, const char *needle);
#endif
/* Although these platforms might have strftime or strptime they
- * appear not to support the time_t seconds format specifier.
+ * appear not to support the time_t seconds format specifier.
*/
#if (defined(_WIN32) || defined(riscos) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__))
#undef HAVE_STRPTIME
@@ -49,8 +49,9 @@ char *strcasestr(const char *haystack, const char *needle);
#define HAVE_STRFTIME
#endif
-/* For some reason, UnixLib defines this unconditionally.
- * Assume we're using UnixLib if building for RISC OS. */
+/* For some reason, UnixLib defines this unconditionally. Assume we're using
+ * UnixLib if building for RISC OS.
+ */
#if ((defined(_GNU_SOURCE) && !defined(__APPLE__)) || defined(riscos))
#define HAVE_STRCHRNUL
#else
@@ -58,6 +59,19 @@ char *strcasestr(const char *haystack, const char *needle);
char *strchrnul(const char *s, int c);
#endif
+/* Although these are in POSIX and implemented most places, RISC OS is
+ * missing them.
+ */
+#if (defined(riscos))
+#undef HAVE_PREAD
+#undef HAVE_PWRITE
+ssize_t pread(int fd, void *buf, size_t count, off_t offset);
+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
+#else
+#define HAVE_PREAD
+#define HAVE_PWRITE
+#endif
+
#define HAVE_SYS_SELECT
#define HAVE_INETATON
#if (defined(_WIN32))
diff --git a/utils/utils.c b/utils/utils.c
index 5c8acd6..722e323 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -32,6 +32,7 @@
#include <regex.h>
#include <time.h>
#include <errno.h>
+#include <unistd.h>
#include "utils/config.h"
#include "utils/log.h"
@@ -628,3 +629,34 @@ nserror nsc_snptimet(char *str, size_t size, time_t *timep)
return NSERROR_OK;
}
+
+#ifndef HAVE_PREAD
+
+ssize_t pread(int fd, void *buf, size_t count, off_t offset)
+{
+ off_t sk;
+
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == -1) {
+ return (off_t)-1;
+ }
+ return read(fd, buf, count);
+}
+
+#endif
+
+
+#ifndef HAVE_PWRITE
+
+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+ off_t sk;
+
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == (off_t)-1) {
+ return -1;
+ }
+ return write(fd, buf, count);
+}
+
+#endif
-----------------------------------------------------------------------
Summary of changes:
content/fs_backing_store.c | 6 ++++--
utils/config.h | 20 +++++++++++++++++---
utils/utils.c | 32 ++++++++++++++++++++++++++++++++
3 files changed, 53 insertions(+), 5 deletions(-)
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 963fd54..f2e6a38 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -35,6 +35,8 @@
*
*/
+#include "utils/config.h"
+
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
@@ -1606,7 +1608,7 @@ static nserror store_write_block(struct store_state *state,
wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
offst, bse->elem[elem_idx].block));
- if (wr != bse->elem[elem_idx].size) {
+ if (wr != (ssize_t)bse->elem[elem_idx].size) {
return NSERROR_SAVE_FAILED;
}
@@ -1754,7 +1756,7 @@ static nserror store_read_block(struct store_state *state,
rd, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
offst, bse->elem[elem_idx].block));
- if (rd != bse->elem[elem_idx].size) {
+ if (rd != (ssize_t)bse->elem[elem_idx].size) {
return NSERROR_SAVE_FAILED;
}
diff --git a/utils/config.h b/utils/config.h
index c45b865..cfb9d83 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -39,7 +39,7 @@ char *strcasestr(const char *haystack, const char *needle);
#endif
/* Although these platforms might have strftime or strptime they
- * appear not to support the time_t seconds format specifier.
+ * appear not to support the time_t seconds format specifier.
*/
#if (defined(_WIN32) || defined(riscos) || defined(__HAIKU__) || defined(__BEOS__) || defined(__amigaos4__) || defined(__AMIGA__) || defined(__MINT__))
#undef HAVE_STRPTIME
@@ -49,8 +49,9 @@ char *strcasestr(const char *haystack, const char *needle);
#define HAVE_STRFTIME
#endif
-/* For some reason, UnixLib defines this unconditionally.
- * Assume we're using UnixLib if building for RISC OS. */
+/* For some reason, UnixLib defines this unconditionally. Assume we're using
+ * UnixLib if building for RISC OS.
+ */
#if ((defined(_GNU_SOURCE) && !defined(__APPLE__)) || defined(riscos))
#define HAVE_STRCHRNUL
#else
@@ -58,6 +59,19 @@ char *strcasestr(const char *haystack, const char *needle);
char *strchrnul(const char *s, int c);
#endif
+/* Although these are in POSIX and implemented most places, RISC OS is
+ * missing them.
+ */
+#if (defined(riscos))
+#undef HAVE_PREAD
+#undef HAVE_PWRITE
+ssize_t pread(int fd, void *buf, size_t count, off_t offset);
+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
+#else
+#define HAVE_PREAD
+#define HAVE_PWRITE
+#endif
+
#define HAVE_SYS_SELECT
#define HAVE_INETATON
#if (defined(_WIN32))
diff --git a/utils/utils.c b/utils/utils.c
index 5c8acd6..722e323 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -32,6 +32,7 @@
#include <regex.h>
#include <time.h>
#include <errno.h>
+#include <unistd.h>
#include "utils/config.h"
#include "utils/log.h"
@@ -628,3 +629,34 @@ nserror nsc_snptimet(char *str, size_t size, time_t *timep)
return NSERROR_OK;
}
+
+#ifndef HAVE_PREAD
+
+ssize_t pread(int fd, void *buf, size_t count, off_t offset)
+{
+ off_t sk;
+
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == -1) {
+ return (off_t)-1;
+ }
+ return read(fd, buf, count);
+}
+
+#endif
+
+
+#ifndef HAVE_PWRITE
+
+ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset)
+{
+ off_t sk;
+
+ sk = lseek(fd, offset, SEEK_SET);
+ if (sk == (off_t)-1) {
+ return -1;
+ }
+ return write(fd, buf, count);
+}
+
+#endif
--
NetSurf Browser
8 years, 5 months
netsurf: branch master updated. release/3.3-35-g87a38ca
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/87a38ca5c1624cb86d8c0...
...commit http://git.netsurf-browser.org/netsurf.git/commit/87a38ca5c1624cb86d8c031...
...tree http://git.netsurf-browser.org/netsurf.git/tree/87a38ca5c1624cb86d8c031b3...
The branch, master has been updated
via 87a38ca5c1624cb86d8c031b38166a00494d6be0 (commit)
via 9511e9c4e9e1398e4dde504289556d655ad05fb2 (commit)
via f1d4094566f7ac14b33b39f15407c6659c64ea4f (commit)
via 706a77170df0371ffa6bc97c6c0766e0e3b995ae (commit)
via c965fa87395c0c59afa0690968eb266935e2cec8 (commit)
via a8e501a6637cef13a056d4be5d5a0fdc5ce4fa27 (commit)
via 980e28d916e22d33ec8cea3aa57fdc49d83f1b9e (commit)
via 1d03f34d62ef90fcdd5ddab25547b208fd9ff502 (commit)
via c2eda75710da1e8422de9eaac69735e25d19af75 (commit)
from 6f523a72f12284550bdffa77fff473242382aa27 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=87a38ca5c1624cb86d8...
commit 87a38ca5c1624cb86d8c031b38166a00494d6be0
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
ensure entry invalidation copes with entries in blocks
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 897297e..963fd54 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -448,18 +448,57 @@ store_fname(struct store_state *state,
return fname;
}
+/**
+ * invalidate an element of an entry
+ *
+ * @param state The store state to use.
+ * @param bse The entry to invalidate.
+ * @param elem_idx The element index to invalidate.
+ * @return NSERROR_OK on sucess or error code on failure.
+ */
+static nserror
+invalidate_element(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
+{
+ if (bse->elem[elem_idx].block != 0) {
+ block_index_t bf;
+ block_index_t bi;
+
+ /* block file block resides in */
+ bf = (bse->elem[elem_idx].block >> BLOCK_ENTRY_COUNT) &
+ ((1 << BLOCK_FILE_COUNT) - 1);
+
+ /* block index in file */
+ bi = bse->elem[elem_idx].block & ((1U << BLOCK_ENTRY_COUNT) -1);
+
+ /* clear bit in use map */
+ state->blocks[elem_idx][bf].use_map[bi >> 3] &= ~(1U << (bi & 7));
+ } else {
+ char *fname;
+
+ /* unlink the file from disc */
+ fname = store_fname(state, bse->ident, elem_idx);
+ if (fname == NULL) {
+ return NSERROR_NOMEM;
+ }
+ unlink(fname);
+ free(fname);
+ }
+
+ return NSERROR_OK;
+}
/**
* Remove the entry and files associated with an identifier.
*
* @param state The store state to use.
- * @param ident The identifier to use.
+ * @param bse The entry to invalidate.
* @return NSERROR_OK on sucess or error code on failure.
*/
static nserror
invalidate_entry(struct store_state *state, struct store_entry *bse)
{
- char *fname;
nserror ret;
/* mark entry as invalid */
@@ -486,20 +525,15 @@ invalidate_entry(struct store_state *state, struct store_entry *bse)
return ret;
}
- /* unlink the files from disc */
- fname = store_fname(state, bse->ident, ENTRY_ELEM_META);
- if (fname == NULL) {
- return NSERROR_NOMEM;
+ ret = invalidate_element(state, bse, ENTRY_ELEM_META);
+ if (ret != NSERROR_OK) {
+ LOG(("Error invalidating metadata element"));
}
- unlink(fname);
- free(fname);
- fname = store_fname(state, bse->ident, ENTRY_ELEM_DATA);
- if (fname == NULL) {
- return NSERROR_NOMEM;
+ ret = invalidate_element(state, bse, ENTRY_ELEM_DATA);
+ if (ret != NSERROR_OK) {
+ LOG(("Error invalidating data element"));
}
- unlink(fname);
- free(fname);
return NSERROR_OK;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=9511e9c4e9e1398e4dd...
commit 9511e9c4e9e1398e4dde504289556d655ad05fb2
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Improve file naming inside cache
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 089e1cc..897297e 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -339,13 +339,20 @@ remove_store_entry(struct store_state *state, struct store_entry **bse)
* The short total path lengths mean the encoding must represent as
* much data as possible in the least number of characters.
*
- * To achieve all these goals we use RFC4648 base32 encoding which packs
- * 5bits into each character of the filename.
+ * To achieve all these goals we use RFC4648 base32 encoding which
+ * packs 5bits into each character of the filename. To represent a 32
+ * bit ident this requires a total path length of between 17 and 22
+ * bytes (including directory separators) BA/BB/BC/BD/BE/ABCDEFG
*
* @note Version 1.00 of the cache implementation used base64 to
* encode this, however that did not meet the requirement for only
* using uppercase characters.
*
+ * @note Versions prior to 1.30 only packed 5 bits per directory level
+ * A/B/C/D/E/F/ABCDEFG which only required 19 characters to represent
+ * but resulted in requiring an extra level of directory which is less
+ * desirable than the three extra characters using six bits.
+ *
* @param state The store state to use.
* @param ident The identifier to use.
* @param elem_idx The element index.
@@ -358,94 +365,84 @@ store_fname(struct store_state *state,
{
char *fname = NULL;
uint8_t b32u_i[8]; /* base32 encoded ident */
- uint8_t b32u_d[6][2]; /* base32 ident as separate components */
- const char *dat;
-
- /* RFC4648 base32 encoding table */
- static const uint8_t encoding_table[] = {
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
- 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z', '2', '3', '4', '5', '6', '7'
- };
-
- /* base32 encode ident */
- b32u_i[0] = b32u_d[0][0] = encoding_table[(ident ) & 0x1f];
- b32u_i[1] = b32u_d[1][0] = encoding_table[(ident >> 5) & 0x1f];
- b32u_i[2] = b32u_d[2][0] = encoding_table[(ident >> 10) & 0x1f];
- b32u_i[3] = b32u_d[3][0] = encoding_table[(ident >> 15) & 0x1f];
- b32u_i[4] = b32u_d[4][0] = encoding_table[(ident >> 20) & 0x1f];
- b32u_i[5] = b32u_d[5][0] = encoding_table[(ident >> 25) & 0x1f];
- b32u_i[6] = encoding_table[(ident >> 30) & 0x1f];
-
- /* null terminate strings */
- b32u_i[7] = b32u_d[0][1] = b32u_d[1][1] = b32u_d[2][1] =
- b32u_d[3][1] = b32u_d[4][1] = b32u_d[5][1] = 0;
-
- if (elem_idx == (ENTRY_ELEM_COUNT + ENTRY_ELEM_META)) {
- netsurf_mkpath(&fname, NULL, 3, state->path, "mblk", b32u_d[0]);
-
- } else if (elem_idx == (ENTRY_ELEM_COUNT + ENTRY_ELEM_DATA)) {
- netsurf_mkpath(&fname, NULL, 3, state->path, "dblk", b32u_d[0]);
-
- } else {
- /* Normal file in the backing store */
-
- if (elem_idx == ENTRY_ELEM_META) {
- dat = "m"; /* metadata */
- } else {
- dat = "d"; /* data */
- }
-
- /* number of chars with usefully encoded data in base 32 */
- switch(((state->ident_bits + 4) / 5)) {
- case 1:
- netsurf_mkpath(&fname, NULL, 3, state->path, dat,
- b32u_i);
- break;
+ const uint8_t *b32u_d[6]; /* base32 ident as separate components */
- case 2:
- netsurf_mkpath(&fname, NULL, 4, state->path, dat,
- b32u_d[0],
- b32u_i);
- break;
-
- case 3:
- netsurf_mkpath(&fname, NULL, 5, state->path, dat,
- b32u_d[0], b32u_d[1],
- b32u_i);
- break;
-
- case 4:
- netsurf_mkpath(&fname, NULL, 6, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2],
- b32u_i);
- break;
-
- case 5:
- netsurf_mkpath(&fname, NULL, 7, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2],
- b32u_d[3],
- b32u_i);
- break;
-
- case 6:
- netsurf_mkpath(&fname, NULL, 8, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2],
- b32u_d[3], b32u_d[4],
- b32u_i);
- break;
+ /* directories used to separate elements */
+ const char *base_dir_table[] = {
+ "d", "m", "dblk", "mblk"
+ };
- case 7:
- netsurf_mkpath(&fname, NULL, 9, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2],
- b32u_d[3], b32u_d[4], b32u_d[5],
- b32u_i);
- break;
+ /* RFC4648 base32 encoding table (six bits) */
+ const uint8_t encoding_table[64][3] = {
+ { 'A', 0, 0 }, { 'B', 0, 0 }, /* 0 */
+ { 'C', 0, 0 }, { 'D', 0, 0 }, /* 2 */
+ { 'E', 0, 0 }, { 'F', 0, 0 }, /* 4 */
+ { 'G', 0, 0 }, { 'H', 0, 0 }, /* 6 */
+ { 'I', 0, 0 }, { 'J', 0, 0 }, /* 8 */
+ { 'K', 0, 0 }, { 'L', 0, 0 }, /* 10 */
+ { 'M', 0, 0 }, { 'N', 0, 0 }, /* 12 */
+ { 'O', 0, 0 }, { 'P', 0, 0 }, /* 14 */
+ { 'Q', 0, 0 }, { 'R', 0, 0 }, /* 16 */
+ { 'S', 0, 0 }, { 'T', 0, 0 }, /* 18 */
+ { 'U', 0, 0 }, { 'V', 0, 0 }, /* 20 */
+ { 'W', 0, 0 }, { 'X', 0, 0 }, /* 22 */
+ { 'Y', 0, 0 }, { 'Z', 0, 0 }, /* 24 */
+ { '2', 0, 0 }, { '3', 0, 0 }, /* 26 */
+ { '4', 0, 0 }, { '5', 0, 0 }, /* 28 */
+ { '6', 0, 0 }, { '7', 0, 0 }, /* 30 */
+ { 'B', 'A', 0 }, { 'B', 'B', 0 }, /* 32 */
+ { 'B', 'C', 0 }, { 'B', 'D', 0 }, /* 34 */
+ { 'B', 'E', 0 }, { 'B', 'F', 0 }, /* 36 */
+ { 'B', 'G', 0 }, { 'B', 'H', 0 }, /* 38 */
+ { 'B', 'I', 0 }, { 'B', 'J', 0 }, /* 40 */
+ { 'B', 'K', 0 }, { 'B', 'L', 0 }, /* 42 */
+ { 'B', 'M', 0 }, { 'B', 'N', 0 }, /* 44 */
+ { 'B', 'O', 0 }, { 'B', 'P', 0 }, /* 46 */
+ { 'B', 'Q', 0 }, { 'B', 'R', 0 }, /* 48 */
+ { 'B', 'S', 0 }, { 'B', 'T', 0 }, /* 50 */
+ { 'B', 'U', 0 }, { 'B', 'V', 0 }, /* 52 */
+ { 'B', 'W', 0 }, { 'B', 'X', 0 }, /* 54 */
+ { 'B', 'Y', 0 }, { 'B', 'Z', 0 }, /* 56 */
+ { 'B', '2', 0 }, { 'B', '3', 0 }, /* 58 */
+ { 'B', '4', 0 }, { 'B', '5', 0 }, /* 60 */
+ { 'B', '6', 0 }, { 'B', '7', 0 } /* 62 */
+ };
- default:
- assert("Invalid path depth in store_fname()" == NULL);
- }
+ /* base32 encode ident */
+ b32u_i[0] = encoding_table[(ident ) & 0x1f][0];
+ b32u_i[1] = encoding_table[(ident >> 5) & 0x1f][0];
+ b32u_i[2] = encoding_table[(ident >> 10) & 0x1f][0];
+ b32u_i[3] = encoding_table[(ident >> 15) & 0x1f][0];
+ b32u_i[4] = encoding_table[(ident >> 20) & 0x1f][0];
+ b32u_i[5] = encoding_table[(ident >> 25) & 0x1f][0];
+ b32u_i[6] = encoding_table[(ident >> 30) & 0x1f][0];
+ b32u_i[7] = 0; /* null terminate ident string */
+
+ /* base32 encode directory separators */
+ b32u_d[0] = (uint8_t*)base_dir_table[elem_idx];
+ b32u_d[1] = &encoding_table[(ident ) & 0x3f][0];
+ b32u_d[2] = &encoding_table[(ident >> 6) & 0x3f][0];
+ b32u_d[3] = &encoding_table[(ident >> 12) & 0x3f][0];
+ b32u_d[4] = &encoding_table[(ident >> 18) & 0x3f][0];
+ b32u_d[5] = &encoding_table[(ident >> 24) & 0x3f][0];
+
+ switch (elem_idx) {
+ case ENTRY_ELEM_DATA:
+ case ENTRY_ELEM_META:
+ netsurf_mkpath(&fname, NULL, 8,
+ state->path, b32u_d[0], b32u_d[1], b32u_d[2],
+ b32u_d[3], b32u_d[4], b32u_d[5], b32u_i);
+ break;
+
+ case (ENTRY_ELEM_COUNT + ENTRY_ELEM_META):
+ case (ENTRY_ELEM_COUNT + ENTRY_ELEM_DATA):
+ netsurf_mkpath(&fname, NULL, 3,
+ state->path, b32u_d[0], b32u_d[1]);
+ break;
+
+ default:
+ assert("bad element index" == NULL);
+ break;
}
return fname;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=f1d4094566f7ac14b33...
commit f1d4094566f7ac14b33b39f15407c6659c64ea4f
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
allocate small block using block use bitmaps to find free entries.
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 548a5ef..089e1cc 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -100,7 +100,6 @@
/** length in bytes of a block files use map */
#define BLOCK_USE_MAP_SIZE (1 << (BLOCK_ENTRY_COUNT - 3))
-
/**
* The type used to store index values refering to store entries. Care
* must be taken with this type as it is used to build address to
@@ -205,6 +204,14 @@ struct block_file {
};
/**
+ * log2 of block size.
+ */
+static const unsigned int log2_block_size[ENTRY_ELEM_COUNT] = {
+ BLOCK_DATA_SIZE, /**< Data block size */
+ BLOCK_META_SIZE /**< Metadata block size */
+};
+
+/**
* Parameters controlling the backing store.
*/
struct store_state {
@@ -831,6 +838,36 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
return NSERROR_OK;
}
+/**
+ * Find next available small block.
+ */
+static block_index_t alloc_block(struct store_state *state, int elem_idx)
+{
+ int bf;
+ int idx;
+ int bit;
+ uint8_t *map;
+
+ for (bf = 0; bf < BLOCK_FILE_COUNT; bf++) {
+ map = &state->blocks[elem_idx][bf].use_map[0];
+
+ for (idx = 0; idx < BLOCK_USE_MAP_SIZE; idx++) {
+ if (*(map + idx) != 0xff) {
+ /* located an unused block */
+ for (bit = 0; bit < 8;bit++) {
+ if (((*(map + idx)) & (1U << bit)) == 0) {
+ /* mark block as used */
+ *(map + idx) |= 1U << bit;
+ state->blocks_dirty = true;
+ return (((bf * BLOCK_USE_MAP_SIZE) + idx) * 8) + bit;
+ }
+ }
+ }
+ }
+ }
+
+ return 0;
+}
/**
* Set a backing store entry in the entry table from a url.
@@ -931,6 +968,11 @@ set_store_entry(struct store_state *state,
elem->size = datalen;
state->total_alloc += elem->size;
+ /* if the elemnt will fit in a small block attempt to allocate one */
+ if (elem->size <= (1U << log2_block_size[elem_idx])) {
+ elem->block = alloc_block(state, elem_idx);
+ }
+
/* ensure control maintinance scheduled. */
state->entries_dirty = true;
guit->browser->schedule(CONTROL_MAINT_TIME, control_maintinance, state);
@@ -1134,6 +1176,8 @@ read_blocks(struct store_state *state)
return ret;
}
+ LOG(("Initialising block use map from %s", fname));
+
fd = open(fname, O_RDWR);
free(fname);
if (fd != -1) {
@@ -1153,6 +1197,7 @@ read_blocks(struct store_state *state)
close(fd);
} else {
+ LOG(("Initialising block use map to defaults"));
/* ensure block 0 (invalid sentinal) is skipped */
state->blocks[ENTRY_ELEM_DATA][0].use_map[0] = 1;
state->blocks[ENTRY_ELEM_META][0].use_map[0] = 1;
@@ -1458,11 +1503,23 @@ initialise(const struct llcache_store_parameters *parameters)
static nserror
finalise(void)
{
+ int bf; /* block file index */
+
if (storestate != NULL) {
guit->browser->schedule(-1, control_maintinance, storestate);
write_entries(storestate);
write_blocks(storestate);
+ /* ensure all block files are closed */
+ for (bf = 0; bf < BLOCK_FILE_COUNT; bf++) {
+ if (storestate->blocks[ENTRY_ELEM_DATA][bf].fd != -1) {
+ close(storestate->blocks[ENTRY_ELEM_DATA][bf].fd);
+ }
+ if (storestate->blocks[ENTRY_ELEM_META][bf].fd != -1) {
+ close(storestate->blocks[ENTRY_ELEM_META][bf].fd);
+ }
+ }
+
/* avoid division by zero */
if (storestate->miss_count == 0) {
storestate->miss_count = 1;
@@ -1494,7 +1551,7 @@ static nserror store_write_block(struct store_state *state,
{
block_index_t bf = (bse->elem[elem_idx].block >> BLOCK_ENTRY_COUNT) &
((1 << BLOCK_FILE_COUNT) - 1); /* block file block resides in */
- block_index_t bi = bse->elem[elem_idx].block & ((1 << BLOCK_ENTRY_COUNT) -1); /* block index in file */
+ block_index_t bi = bse->elem[elem_idx].block & ((1U << BLOCK_ENTRY_COUNT) -1); /* block index in file */
ssize_t wr;
off_t offst;
@@ -1507,17 +1564,17 @@ static nserror store_write_block(struct store_state *state,
return NSERROR_SAVE_FAILED;
}
- if (elem_idx == ENTRY_ELEM_META) {
- offst = bi << BLOCK_META_SIZE;
- } else {
- offst = bi << BLOCK_DATA_SIZE;
- }
+ offst = bi << log2_block_size[elem_idx];
wr = pwrite(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
+ LOG(("Wrote %d of %d bytes from %p at 0x%x block %d",
+ wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block));
+
if (wr != bse->elem[elem_idx].size) {
return NSERROR_SAVE_FAILED;
}
@@ -1655,17 +1712,17 @@ static nserror store_read_block(struct store_state *state,
return NSERROR_SAVE_FAILED;
}
- if (elem_idx == ENTRY_ELEM_META) {
- offst = bi << BLOCK_META_SIZE;
- } else {
- offst = bi << BLOCK_DATA_SIZE;
- }
+ offst = bi << log2_block_size[elem_idx];
rd = pread(state->blocks[elem_idx][bf].fd,
bse->elem[elem_idx].data,
bse->elem[elem_idx].size,
offst);
+ LOG(("Read %d of %d bytes into %p from 0x%x block %d",
+ rd, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block));
+
if (rd != bse->elem[elem_idx].size) {
return NSERROR_SAVE_FAILED;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=706a77170df0371ffa6...
commit 706a77170df0371ffa6bc97c6c0766e0e3b995ae
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
implement block read and write operations.
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index c67b89a..548a5ef 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -117,6 +117,14 @@ typedef uint16_t entry_index_t;
typedef uint32_t entry_ident_t;
/**
+ * The type used to store block file index values. If this is changed
+ * it will affect the entry storage/alignment and BLOCK_ADDR_LEN must
+ * also be updated.
+ */
+typedef uint16_t block_index_t;
+
+
+/**
* Entry element index values.
*/
enum store_entry_elem_idx {
@@ -162,7 +170,7 @@ enum store_entry_flags {
struct store_entry_element {
uint8_t* data; /**< data allocated */
uint32_t size; /**< size of entry element on disc */
- uint16_t block; /**< small object data block */
+ block_index_t block; /**< small object data block */
uint8_t ref; /**< element data reference count */
uint8_t flags; /**< entry flags */
};
@@ -319,6 +327,7 @@ remove_store_entry(struct store_state *state, struct store_entry **bse)
* - path elements no longer than 8 characters
* - acceptable characters are A-Z, 0-9
* - short total path lengths (255 or less)
+ * - no more than 77 entries per directory (6bits worth)
*
* The short total path lengths mean the encoding must represent as
* much data as possible in the least number of characters.
@@ -361,63 +370,75 @@ store_fname(struct store_state *state,
b32u_i[4] = b32u_d[4][0] = encoding_table[(ident >> 20) & 0x1f];
b32u_i[5] = b32u_d[5][0] = encoding_table[(ident >> 25) & 0x1f];
b32u_i[6] = encoding_table[(ident >> 30) & 0x1f];
+
/* null terminate strings */
b32u_i[7] = b32u_d[0][1] = b32u_d[1][1] = b32u_d[2][1] =
b32u_d[3][1] = b32u_d[4][1] = b32u_d[5][1] = 0;
- if (elem_idx == ENTRY_ELEM_META) {
- dat = "m"; /* metadata */
+ if (elem_idx == (ENTRY_ELEM_COUNT + ENTRY_ELEM_META)) {
+ netsurf_mkpath(&fname, NULL, 3, state->path, "mblk", b32u_d[0]);
+
+ } else if (elem_idx == (ENTRY_ELEM_COUNT + ENTRY_ELEM_DATA)) {
+ netsurf_mkpath(&fname, NULL, 3, state->path, "dblk", b32u_d[0]);
+
} else {
- dat = "d"; /* data */
- }
-
- /* number of chars with usefully encoded data in base 32 */
- switch(((state->ident_bits + 4) / 5)) {
- case 1:
- netsurf_mkpath(&fname, NULL, 3, state->path, dat,
- b32u_i);
- break;
-
- case 2:
- netsurf_mkpath(&fname, NULL, 4, state->path, dat,
- b32u_d[0],
- b32u_i);
- break;
-
- case 3:
- netsurf_mkpath(&fname, NULL, 5, state->path, dat,
- b32u_d[0], b32u_d[1],
- b32u_i);
- break;
-
- case 4:
- netsurf_mkpath(&fname, NULL, 6, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2],
- b32u_i);
- break;
-
- case 5:
- netsurf_mkpath(&fname, NULL, 7, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2], b32u_d[3],
- b32u_i);
- break;
-
- case 6:
- netsurf_mkpath(&fname, NULL, 8, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2], b32u_d[3],
- b32u_d[4],
- b32u_i);
- break;
-
- case 7:
- netsurf_mkpath(&fname, NULL, 9, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2], b32u_d[3],
- b32u_d[4], b32u_d[5],
- b32u_i);
- break;
-
- default:
- assert("Invalid path depth in store_fname()" == NULL);
+ /* Normal file in the backing store */
+
+ if (elem_idx == ENTRY_ELEM_META) {
+ dat = "m"; /* metadata */
+ } else {
+ dat = "d"; /* data */
+ }
+
+ /* number of chars with usefully encoded data in base 32 */
+ switch(((state->ident_bits + 4) / 5)) {
+ case 1:
+ netsurf_mkpath(&fname, NULL, 3, state->path, dat,
+ b32u_i);
+ break;
+
+ case 2:
+ netsurf_mkpath(&fname, NULL, 4, state->path, dat,
+ b32u_d[0],
+ b32u_i);
+ break;
+
+ case 3:
+ netsurf_mkpath(&fname, NULL, 5, state->path, dat,
+ b32u_d[0], b32u_d[1],
+ b32u_i);
+ break;
+
+ case 4:
+ netsurf_mkpath(&fname, NULL, 6, state->path, dat,
+ b32u_d[0], b32u_d[1], b32u_d[2],
+ b32u_i);
+ break;
+
+ case 5:
+ netsurf_mkpath(&fname, NULL, 7, state->path, dat,
+ b32u_d[0], b32u_d[1], b32u_d[2],
+ b32u_d[3],
+ b32u_i);
+ break;
+
+ case 6:
+ netsurf_mkpath(&fname, NULL, 8, state->path, dat,
+ b32u_d[0], b32u_d[1], b32u_d[2],
+ b32u_d[3], b32u_d[4],
+ b32u_i);
+ break;
+
+ case 7:
+ netsurf_mkpath(&fname, NULL, 9, state->path, dat,
+ b32u_d[0], b32u_d[1], b32u_d[2],
+ b32u_d[3], b32u_d[4], b32u_d[5],
+ b32u_i);
+ break;
+
+ default:
+ assert("Invalid path depth in store_fname()" == NULL);
+ }
}
return fname;
@@ -924,14 +945,18 @@ set_store_entry(struct store_state *state,
* Open a file using a store ident.
*
* @param state The store state to use.
- * @param bse The store entry of the file to open.
- * @param elem_idx The element within the store entry to open.
+ * @param ident The identifier to open file for.
+ * @param elem_idx The element within the store entry to open. The
+ * value should be be one of the values in the
+ * store_entry_elem_idx enum. Additionally it may have
+ * ENTRY_ELEM_COUNT added to it to indicate block file
+ * names.
* @param openflags The flags used with the open call.
* @return An fd from the open call or -1 on error.
*/
static int
store_open(struct store_state *state,
- struct store_entry *bse,
+ entry_ident_t ident,
int elem_idx,
int openflags)
{
@@ -939,7 +964,7 @@ store_open(struct store_state *state,
nserror ret;
int fd;
- fname = store_fname(state, bse->ident, elem_idx);
+ fname = store_fname(state, ident, elem_idx);
if (fname == NULL) {
LOG(("filename error"));
return -1;
@@ -1467,12 +1492,37 @@ static nserror store_write_block(struct store_state *state,
struct store_entry *bse,
int elem_idx)
{
- int bf = (bse->elem[elem_idx].block >> BLOCK_ENTRY_COUNT) &
+ block_index_t bf = (bse->elem[elem_idx].block >> BLOCK_ENTRY_COUNT) &
((1 << BLOCK_FILE_COUNT) - 1); /* block file block resides in */
+ block_index_t bi = bse->elem[elem_idx].block & ((1 << BLOCK_ENTRY_COUNT) -1); /* block index in file */
+ ssize_t wr;
+ off_t offst;
+ /* ensure the block file fd is good */
+ if (state->blocks[elem_idx][bf].fd == -1) {
+ state->blocks[elem_idx][bf].fd = store_open(state, bf,
+ elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
+ }
+ if (state->blocks[elem_idx][bf].fd == -1) {
+ return NSERROR_SAVE_FAILED;
+ }
+
+ if (elem_idx == ENTRY_ELEM_META) {
+ offst = bi << BLOCK_META_SIZE;
+ } else {
+ offst = bi << BLOCK_DATA_SIZE;
+ }
+ wr = pwrite(state->blocks[elem_idx][bf].fd,
+ bse->elem[elem_idx].data,
+ bse->elem[elem_idx].size,
+ offst);
- return NSERROR_SAVE_FAILED;
+ if (wr != bse->elem[elem_idx].size) {
+ return NSERROR_SAVE_FAILED;
+ }
+
+ return NSERROR_OK;
}
/**
@@ -1490,7 +1540,7 @@ static nserror store_write_file(struct store_state *state,
ssize_t written;
int fd;
- fd = store_open(state, bse, elem_idx, O_CREAT | O_WRONLY);
+ fd = store_open(state, bse->ident, elem_idx, O_CREAT | O_WRONLY);
if (fd < 0) {
perror("");
LOG(("Open failed %d", fd));
@@ -1591,7 +1641,36 @@ static nserror store_read_block(struct store_state *state,
struct store_entry *bse,
int elem_idx)
{
- return NSERROR_NOT_FOUND;
+ block_index_t bf = (bse->elem[elem_idx].block >> BLOCK_ENTRY_COUNT) &
+ ((1 << BLOCK_FILE_COUNT) - 1); /* block file block resides in */
+ block_index_t bi = bse->elem[elem_idx].block & ((1 << BLOCK_ENTRY_COUNT) -1); /* block index in file */
+ ssize_t rd;
+ off_t offst;
+
+ /* ensure the block file fd is good */
+ if (state->blocks[elem_idx][bf].fd == -1) {
+ state->blocks[elem_idx][bf].fd = store_open(state, bf, elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
+ }
+ if (state->blocks[elem_idx][bf].fd == -1) {
+ return NSERROR_SAVE_FAILED;
+ }
+
+ if (elem_idx == ENTRY_ELEM_META) {
+ offst = bi << BLOCK_META_SIZE;
+ } else {
+ offst = bi << BLOCK_DATA_SIZE;
+ }
+
+ rd = pread(state->blocks[elem_idx][bf].fd,
+ bse->elem[elem_idx].data,
+ bse->elem[elem_idx].size,
+ offst);
+
+ if (rd != bse->elem[elem_idx].size) {
+ return NSERROR_SAVE_FAILED;
+ }
+
+ return NSERROR_OK;
}
/**
@@ -1612,7 +1691,7 @@ static nserror store_read_file(struct store_state *state,
size_t tot = 0; /* total size */
/* separate file in backing store */
- fd = store_open(storestate, bse, elem_idx, O_RDONLY);
+ fd = store_open(storestate, bse->ident, elem_idx, O_RDONLY);
if (fd < 0) {
LOG(("Open failed"));
/** @todo should this invalidate the entry? */
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c965fa87395c0c59afa...
commit c965fa87395c0c59afa0690968eb266935e2cec8
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Block file usage bitmaps (de)serialising
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 4c8f3fc..c67b89a 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -79,20 +79,27 @@
/** Filename of serialised entries */
#define ENTRIES_FNAME "entries"
+/** Filename of block file index */
+#define BLOCKS_FNAME "blocks"
+
/** log2 block data address length (64k) */
#define BLOCK_ADDR_LEN 16
+/** log2 number of entries per block file(4k) */
+#define BLOCK_ENTRY_COUNT 12
+
+/** log2 number of data block files */
+#define BLOCK_FILE_COUNT (BLOCK_ADDR_LEN - BLOCK_ENTRY_COUNT)
+
/** log2 size of data blocks (8k) */
#define BLOCK_DATA_SIZE 13
/** log2 size of metadata blocks (1k) */
#define BLOCK_META_SIZE 10
-/** log2 number of data block files */
-#define BLOCK_DATA_COUNT (BLOCK_ADDR_LEN - BLOCK_DATA_SIZE)
+/** length in bytes of a block files use map */
+#define BLOCK_USE_MAP_SIZE (1 << (BLOCK_ENTRY_COUNT - 3))
-/** log2 number of metadata block files */
-#define BLOCK_METADATA_COUNT (BLOCK_ADDR_LEN - BLOCK_METADATA_SIZE)
/**
* The type used to store index values refering to store entries. Care
@@ -180,6 +187,16 @@ struct store_entry {
};
/**
+ * Small block file.
+ */
+struct block_file {
+ /** file descriptor of the block file */
+ int fd;
+ /** map of used and unused entries within the block file */
+ uint8_t use_map[BLOCK_USE_MAP_SIZE];
+};
+
+/**
* Parameters controlling the backing store.
*/
struct store_state {
@@ -209,6 +226,14 @@ struct store_state {
*/
entry_index_t *addrmap;
+ /* small block managemet */
+ struct block_file blocks[ENTRY_ELEM_COUNT][BLOCK_FILE_COUNT];
+
+ /** flag indicating if the block file use maps have been made
+ * persistant since they were last changed.
+ */
+ bool blocks_dirty;
+
/* stats */
uint64_t total_alloc; /**< total size of all allocated storage. */
@@ -640,6 +665,85 @@ static nserror write_entries(struct store_state *state)
}
/**
+ * Write block file use map to file.
+ *
+ * Serialise block file use map out to storage.
+ *
+ * @param state The backing store state to serialise.
+ * @return NSERROR_OK on sucess or error code on faliure.
+ */
+static nserror write_blocks(struct store_state *state)
+{
+ int fd;
+ char *tname = NULL; /* temporary file name for atomic replace */
+ char *fname = NULL; /* target filename */
+ size_t blocks_size;
+ size_t written = 0;
+ size_t wr;
+ nserror ret;
+ int bfidx; /* block file index */
+ int elem_idx;
+
+ if (state->blocks_dirty == false) {
+ /* blocks use maps have not been updated since last write */
+ return NSERROR_OK;
+ }
+
+ ret = netsurf_mkpath(&tname, NULL, 2, state->path, "t"BLOCKS_FNAME);
+ if (ret != NSERROR_OK) {
+ return ret;
+ }
+
+ fd = open(tname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ if (fd == -1) {
+ free(tname);
+ return NSERROR_SAVE_FAILED;
+ }
+
+ blocks_size = (BLOCK_FILE_COUNT * ENTRY_ELEM_COUNT) * BLOCK_USE_MAP_SIZE;
+
+ for (elem_idx = 0; elem_idx < ENTRY_ELEM_COUNT; elem_idx++) {
+ for (bfidx = 0; bfidx < BLOCK_FILE_COUNT; bfidx++) {
+ wr = write(fd,
+ &state->blocks[elem_idx][bfidx].use_map[0],
+ BLOCK_USE_MAP_SIZE);
+ if (wr != BLOCK_USE_MAP_SIZE) {
+ LOG(("writing block file %d use index on file number %d failed", elem_idx, bfidx));
+ goto wr_err;
+ }
+ written += wr;
+ }
+ }
+wr_err:
+ close(fd);
+
+ /* check all data was written */
+ if (written != blocks_size) {
+ unlink(tname);
+ free(tname);
+ return NSERROR_SAVE_FAILED;
+ }
+
+ ret = netsurf_mkpath(&fname, NULL, 2, state->path, BLOCKS_FNAME);
+ if (ret != NSERROR_OK) {
+ unlink(tname);
+ free(tname);
+ return ret;
+ }
+
+ /* remove() call is to handle non-POSIX rename() implementations */
+ (void)remove(fname);
+ if (rename(tname, fname) != 0) {
+ unlink(tname);
+ free(tname);
+ free(fname);
+ return NSERROR_SAVE_FAILED;
+ }
+
+ return NSERROR_OK;
+}
+
+/**
* maintinance of control structures.
*
* callback scheduled when control data has been update. Currently
@@ -653,6 +757,7 @@ static void control_maintinance(void *s)
struct store_state *state = s;
write_entries(state);
+ write_blocks(state);
}
@@ -982,6 +1087,61 @@ read_entries(struct store_state *state)
return NSERROR_OK;
}
+
+/**
+ * Read block file usage bitmaps.
+ *
+ * @param state The backing store state to put the loaded entries in.
+ * @return NSERROR_OK on sucess or error code on faliure.
+ */
+static nserror
+read_blocks(struct store_state *state)
+{
+ int bfidx; /* block file index */
+ int elem_idx;
+ int fd;
+ ssize_t rd;
+ char *fname = NULL;
+ nserror ret;
+
+ ret = netsurf_mkpath(&fname, NULL, 2, state->path, BLOCKS_FNAME);
+ if (ret != NSERROR_OK) {
+ return ret;
+ }
+
+ fd = open(fname, O_RDWR);
+ free(fname);
+ if (fd != -1) {
+ /* initialise block file use array */
+ for (elem_idx = 0; elem_idx < ENTRY_ELEM_COUNT; elem_idx++) {
+ for (bfidx = 0; bfidx < BLOCK_FILE_COUNT; bfidx++) {
+ rd = read(fd,
+ &state->blocks[elem_idx][bfidx].use_map[0],
+ BLOCK_USE_MAP_SIZE);
+ if (rd <= 0) {
+ LOG(("reading block file %d use index on file number %d failed", elem_idx, bfidx));
+ goto rd_err;
+ }
+ }
+ }
+ rd_err:
+ close(fd);
+
+ } else {
+ /* ensure block 0 (invalid sentinal) is skipped */
+ state->blocks[ENTRY_ELEM_DATA][0].use_map[0] = 1;
+ state->blocks[ENTRY_ELEM_META][0].use_map[0] = 1;
+ }
+
+ /* initialise block file file descriptors */
+ for (bfidx = 0; bfidx < BLOCK_FILE_COUNT; bfidx++) {
+ state->blocks[ENTRY_ELEM_DATA][bfidx].fd = -1;
+ state->blocks[ENTRY_ELEM_META][bfidx].fd = -1;
+ }
+
+ return NSERROR_OK;
+}
+
/**
* Write the cache tag file.
*
@@ -1235,7 +1395,15 @@ initialise(const struct llcache_store_parameters *parameters)
/* build entry hash map */
ret = build_entrymap(newstate);
if (ret != NSERROR_OK) {
- /* that obviously went well */
+ /* that obviously went well */
+ free(newstate->path);
+ free(newstate);
+ return ret;
+ }
+
+ ret = read_blocks(newstate);
+ if (ret != NSERROR_OK) {
+ /* oh dear */
free(newstate->path);
free(newstate);
return ret;
@@ -1268,6 +1436,7 @@ finalise(void)
if (storestate != NULL) {
guit->browser->schedule(-1, control_maintinance, storestate);
write_entries(storestate);
+ write_blocks(storestate);
/* avoid division by zero */
if (storestate->miss_count == 0) {
@@ -1298,6 +1467,11 @@ static nserror store_write_block(struct store_state *state,
struct store_entry *bse,
int elem_idx)
{
+ int bf = (bse->elem[elem_idx].block >> BLOCK_ENTRY_COUNT) &
+ ((1 << BLOCK_FILE_COUNT) - 1); /* block file block resides in */
+
+
+
return NSERROR_SAVE_FAILED;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a8e501a6637cef13a05...
commit a8e501a6637cef13a056d4be5d5a0fdc5ce4fa27
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
define block store parameters
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 986e0f6..4c8f3fc 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -79,6 +79,21 @@
/** Filename of serialised entries */
#define ENTRIES_FNAME "entries"
+/** log2 block data address length (64k) */
+#define BLOCK_ADDR_LEN 16
+
+/** log2 size of data blocks (8k) */
+#define BLOCK_DATA_SIZE 13
+
+/** log2 size of metadata blocks (1k) */
+#define BLOCK_META_SIZE 10
+
+/** log2 number of data block files */
+#define BLOCK_DATA_COUNT (BLOCK_ADDR_LEN - BLOCK_DATA_SIZE)
+
+/** log2 number of metadata block files */
+#define BLOCK_METADATA_COUNT (BLOCK_ADDR_LEN - BLOCK_METADATA_SIZE)
+
/**
* The type used to store index values refering to store entries. Care
* must be taken with this type as it is used to build address to
@@ -168,12 +183,15 @@ struct store_entry {
* Parameters controlling the backing store.
*/
struct store_state {
+ /* store config */
char *path; /**< The path to the backing store */
size_t limit; /**< The backing store upper bound target size */
size_t hysteresis; /**< The hysteresis around the target size */
unsigned int ident_bits; /**< log2 number of bits to use for address. */
+
+ /* cache entry management */
struct store_entry *entries; /**< store entries. */
unsigned int entry_bits; /**< log2 number of bits in entry index. */
unsigned int last_entry; /**< index of last usable entry. */
@@ -191,6 +209,8 @@ struct store_state {
*/
entry_index_t *addrmap;
+
+ /* stats */
uint64_t total_alloc; /**< total size of all allocated storage. */
size_t hit_count; /**< number of cache hits */
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=980e28d916e22d33ec8...
commit 980e28d916e22d33ec8cea3aa57fdc49d83f1b9e
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Change backing store fetch operation to always perform the allocations
The fetch API previously allowed for the caller to supply the storage,
this was never used and was preventing the refactoring necessary for
small black storage to be available.
diff --git a/content/backing_store.h b/content/backing_store.h
index 312a2b0..4e29511 100644
--- a/content/backing_store.h
+++ b/content/backing_store.h
@@ -83,10 +83,8 @@ struct gui_llcache_table {
/**
* Retrive an object from the backing store.
*
- * The caller may provide a buffer in \a data and a buffer
- * length in \a datalen. Alternatively the backing store will
- * allocate its own buffer if \a data is NULL, this memory is
- * managed by the backing store.
+ * The backing store will manage its own memory and the
+ * allocations returned in \a data *must* not be altered.
*
* The caller must assume nothing about the backing store
* allocated buffers and the storage and *must* be freed by
@@ -94,8 +92,8 @@ struct gui_llcache_table {
*
* @param[in] url The url is used as the unique primary key for the data.
* @param[in] flags The flags to control how the object is retrived.
- * @param[in,out] data The retrived objects data.
- * @param[in,out] datalen The length of the \a data retrieved.
+ * @param[out] data The retrived objects data.
+ * @param[out] datalen The length of the \a data retrieved.
* @return NSERROR_OK on success or error code on faliure.
*/
nserror (*fetch)(struct nsurl *url, enum backing_store_flags flags,
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index eaed6ee..986e0f6 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -1384,6 +1384,67 @@ static nserror entry_release_alloc(struct store_entry_element *elem)
return NSERROR_OK;
}
+
+/**
+ * Read an element of an entry from a small block file in the backing storage.
+ *
+ * \param state The backing store state to use.
+ * \param bse The entry to read.
+ * \param elem_idx The element index within the entry.
+ * \return NSERROR_OK on success or error code.
+ */
+static nserror store_read_block(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
+{
+ return NSERROR_NOT_FOUND;
+}
+
+/**
+ * Read an element of an entry from an individual file in the backing storage.
+ *
+ * \param state The backing store state to use.
+ * \param bse The entry to read.
+ * \param elem_idx The element index within the entry.
+ * \return NSERROR_OK on success or error code.
+ */
+static nserror store_read_file(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
+{
+ int fd;
+ ssize_t rd; /* return from read */
+ int ret = NSERROR_OK;
+ size_t tot = 0; /* total size */
+
+ /* separate file in backing store */
+ fd = store_open(storestate, bse, elem_idx, O_RDONLY);
+ if (fd < 0) {
+ LOG(("Open failed"));
+ /** @todo should this invalidate the entry? */
+ return NSERROR_NOT_FOUND;
+ }
+
+ LOG(("Reading %d bytes into %p from file",
+ bse->elem[elem_idx].size, bse->elem[elem_idx].data));
+
+ while (tot < bse->elem[elem_idx].size) {
+ rd = read(fd,
+ bse->elem[elem_idx].data + tot,
+ bse->elem[elem_idx].size - tot);
+ if (rd <= 0) {
+ LOG(("read error returned %d", rd));
+ ret = NSERROR_NOT_FOUND;
+ break;
+ }
+ tot += rd;
+ }
+
+ close(fd);
+
+ return ret;
+}
+
/**
* Retrive an object from the backing store.
*
@@ -1402,10 +1463,6 @@ fetch(nsurl *url,
nserror ret;
struct store_entry *bse;
struct store_entry_element *elem;
- uint8_t *data;
- size_t datalen;
- int fd;
- ssize_t rd;
int elem_idx;
/* check backing store is initialised */
@@ -1422,7 +1479,7 @@ fetch(nsurl *url,
}
storestate->hit_count++;
- LOG(("retriving cache file for url:%s", nsurl_access(url)));
+ LOG(("retriving cache data for url:%s", nsurl_access(url)));
/* calculate the entry element index */
if ((bsflags & BACKING_STORE_META) != 0) {
@@ -1430,80 +1487,49 @@ fetch(nsurl *url,
} else {
elem_idx = ENTRY_ELEM_DATA;
}
- /* the entry element */
elem = &bse->elem[elem_idx];
- if (elem->block != 0) {
- /* small block storage */
+ /* if an allocation already exists return it */
+ if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) {
+ /* use the existing allocation and bump the ref count. */
+ elem->ref++;
+
+ LOG(("Using existing entry (%p) allocation %p refs:%d",
+ bse, elem->data, elem->ref));
+
} else {
- /* separate file in backing store */
- fd = store_open(storestate, bse, elem_idx, O_RDONLY);
- if (fd < 0) {
- LOG(("Open failed"));
- /** @todo should this invalidate the entry? */
- return NSERROR_NOT_FOUND;
+ /* allocate from the heap */
+ elem->data = malloc(elem->size);
+ if (elem->data == NULL) {
+ LOG(("Failed to create new heap allocation"));
+ return NSERROR_NOMEM;
}
- }
+ LOG(("Created new heap allocation %p", elem->data));
+ /* mark the entry as having a valid heap allocation */
+ elem->flags |= ENTRY_ELEM_FLAG_HEAP;
+ elem->ref = 1;
- data = *data_out;
- datalen = *datalen_out;
- /** @todo should this check datalen is sufficient? */
-
- /* need to deal with buffers */
- if (data == NULL) {
- if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) {
- /* a heap allocation already exists. Return
- * that allocation and bump our ref count.
- */
- data = elem->data;
- elem->ref++;
- datalen = elem->size;
- LOG(("Using existing heap allocation %p", elem->data));
+ /* fill the new block */
+ if (elem->block != 0) {
+ ret = store_read_block(storestate, bse, elem_idx);
} else {
- datalen = elem->size;
- data = malloc(elem->size);
- if (data == NULL) {
- close(fd);
- return NSERROR_NOMEM;
- }
-
- /* store allocated buffer so track ownership */
- elem->flags |= ENTRY_ELEM_FLAG_HEAP;
- elem->data = data;
- elem->ref = 1;
- LOG(("Creating new heap allocation %p", elem->data));
+ ret = store_read_file(storestate, bse, elem_idx);
}
- } else if (datalen == 0) {
- /* caller provided a buffer but no length bad parameter */
- close(fd);
- return NSERROR_BAD_PARAMETER;
}
- if (elem->block != 0) {
+ /* free the allocation if there is a read error */
+ if (ret != NSERROR_OK) {
+ entry_release_alloc(elem);
} else {
- LOG(("Reading %d bytes into %p from file", datalen, data));
+ /* update stats and setup return pointers */
+ storestate->hit_size += elem->size;
- /** @todo this read should be an a loop */
- rd = read(fd, data, datalen);
- if (rd <= 0) {
- LOG(("read returned %d", rd));
- close(fd);
- if ((*data_out) == NULL) {
- entry_release_alloc(elem);
- }
- return NSERROR_NOT_FOUND;
- }
-
- close(fd);
+ *data_out = elem->data;
+ *datalen_out = elem->size;
}
- storestate->hit_size += datalen;
-
- *data_out = data;
- *datalen_out = datalen;
-
- return NSERROR_OK;
+ return ret;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=1d03f34d62ef90fcdd5...
commit 1d03f34d62ef90fcdd5ddab25547b208fd9ff502
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Compute the element index once and use that as a parameter.
Change to computing the element index from the flags passed to store
and fetch methods instead of passing the flags around and calculating
everywhere.
Additionally split out writing element of entry to file into distinct
function to make code clearer.
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index f1b4aa4..eaed6ee 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -95,7 +95,7 @@ typedef uint16_t entry_index_t;
typedef uint32_t entry_ident_t;
/**
- * Entry extension index values.
+ * Entry element index values.
*/
enum store_entry_elem_idx {
ENTRY_ELEM_DATA = 0, /**< entry element is data */
@@ -287,13 +287,13 @@ remove_store_entry(struct store_state *state, struct store_entry **bse)
*
* @param state The store state to use.
* @param ident The identifier to use.
- * @param flags flags to control the filename used.
+ * @param elem_idx The element index.
* @return The filename string or NULL on allocation error.
*/
static char *
store_fname(struct store_state *state,
entry_ident_t ident,
- enum backing_store_flags flags)
+ int elem_idx)
{
char *fname = NULL;
uint8_t b32u_i[8]; /* base32 encoded ident */
@@ -320,7 +320,7 @@ store_fname(struct store_state *state,
b32u_i[7] = b32u_d[0][1] = b32u_d[1][1] = b32u_d[2][1] =
b32u_d[3][1] = b32u_d[4][1] = b32u_d[5][1] = 0;
- if ((flags & BACKING_STORE_META) != 0) {
+ if (elem_idx == ENTRY_ELEM_META) {
dat = "m"; /* metadata */
} else {
dat = "d"; /* data */
@@ -417,14 +417,14 @@ invalidate_entry(struct store_state *state, struct store_entry *bse)
}
/* unlink the files from disc */
- fname = store_fname(state, bse->ident, BACKING_STORE_META);
+ fname = store_fname(state, bse->ident, ENTRY_ELEM_META);
if (fname == NULL) {
return NSERROR_NOMEM;
}
unlink(fname);
free(fname);
- fname = store_fname(state, bse->ident, BACKING_STORE_NONE);
+ fname = store_fname(state, bse->ident, ENTRY_ELEM_DATA);
if (fname == NULL) {
return NSERROR_NOMEM;
}
@@ -693,7 +693,7 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
*
* @param state The store state to use.
* @param url The value used as the unique key to search entries for.
- * @param flags flags affecting how the entry is stored.
+ * @param elem_idx The index of the entry element to use.
* @param data The data to store
* @param datalen The length of data in \a data
* @param bse Pointer used to return value.
@@ -703,7 +703,7 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
static nserror
set_store_entry(struct store_state *state,
nsurl *url,
- enum backing_store_flags flags,
+ int elem_idx,
uint8_t *data,
const size_t datalen,
struct store_entry **bse)
@@ -759,11 +759,7 @@ set_store_entry(struct store_state *state,
}
/* the entry element */
- if ((flags & BACKING_STORE_META) != 0) {
- elem = &se->elem[ENTRY_ELEM_META];
- } else {
- elem = &se->elem[ENTRY_ELEM_DATA];
- }
+ elem = &se->elem[elem_idx];
/* check if the element has storage already allocated */
if ((elem->flags & (ENTRY_ELEM_FLAG_HEAP | ENTRY_ELEM_FLAG_MMAP)) != 0) {
@@ -803,22 +799,22 @@ set_store_entry(struct store_state *state,
* Open a file using a store ident.
*
* @param state The store state to use.
- * @param ident The identifier of the file to open.
- * @param flags The backing store flags.
+ * @param bse The store entry of the file to open.
+ * @param elem_idx The element within the store entry to open.
* @param openflags The flags used with the open call.
* @return An fd from the open call or -1 on error.
*/
static int
store_open(struct store_state *state,
- uint32_t ident,
- enum backing_store_flags flags,
+ struct store_entry *bse,
+ int elem_idx,
int openflags)
{
char *fname;
nserror ret;
int fd;
- fname = store_fname(state, ident, flags);
+ fname = store_fname(state, bse->ident, elem_idx);
if (fname == NULL) {
LOG(("filename error"));
return -1;
@@ -1271,6 +1267,57 @@ finalise(void)
/**
+ * Write an element of an entry to backing storage in a small block file.
+ *
+ * \param state The backing store state to use.
+ * \param bse The entry to store
+ * \param elem_idx The element index within the entry.
+ * \return NSERROR_OK on success or error code.
+ */
+static nserror store_write_block(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
+{
+ return NSERROR_SAVE_FAILED;
+}
+
+/**
+ * Write an element of an entry to backing storage as an individual file.
+ *
+ * \param state The backing store state to use.
+ * \param bse The entry to store
+ * \param elem_idx The element index within the entry.
+ * \return NSERROR_OK on success or error code.
+ */
+static nserror store_write_file(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
+{
+ ssize_t written;
+ int fd;
+
+ fd = store_open(state, bse, elem_idx, O_CREAT | O_WRONLY);
+ if (fd < 0) {
+ perror("");
+ LOG(("Open failed %d", fd));
+ return NSERROR_SAVE_FAILED;
+ }
+
+ written = write(fd, bse->elem[elem_idx].data, bse->elem[elem_idx].size);
+
+ LOG(("Wrote %d of %d bytes from %p",
+ written, bse->elem[elem_idx].size, bse->elem[elem_idx].data));
+
+ close(fd);
+ if (written < 0 || (size_t) written < bse->elem[elem_idx].size) {
+ /** @todo Delete the file? */
+ return NSERROR_SAVE_FAILED;
+ }
+
+ return NSERROR_OK;
+}
+
+/**
* Place an object in the backing store.
*
* takes ownership of the heap block passed in.
@@ -1283,45 +1330,42 @@ finalise(void)
*/
static nserror
store(nsurl *url,
- enum backing_store_flags flags,
+ enum backing_store_flags bsflags,
uint8_t *data,
const size_t datalen)
{
nserror ret;
struct store_entry *bse;
- ssize_t written;
- int fd;
+ int elem_idx;
/* check backing store is initialised */
if (storestate == NULL) {
return NSERROR_INIT_FAILED;
}
+ /* calculate the entry element index */
+ if ((bsflags & BACKING_STORE_META) != 0) {
+ elem_idx = ENTRY_ELEM_META;
+ } else {
+ elem_idx = ENTRY_ELEM_DATA;
+ }
+
/* set the store entry up */
- ret = set_store_entry(storestate, url, flags, data, datalen, &bse);
+ ret = set_store_entry(storestate, url, elem_idx, data, datalen, &bse);
if (ret != NSERROR_OK) {
LOG(("store entry setting failed"));
return ret;
}
- fd = store_open(storestate, bse->ident, flags, O_CREAT | O_WRONLY);
- if (fd < 0) {
- perror("");
- LOG(("Open failed %d",fd));
- return NSERROR_SAVE_FAILED;
- }
-
-
- LOG(("Writing %d bytes from %p", datalen, data));
- written = write(fd, data, datalen);
-
- close(fd);
- if (written < 0 || (size_t) written < datalen) {
- /** @todo Delete the file? */
- return NSERROR_SAVE_FAILED;
+ if (bse->elem[elem_idx].block != 0) {
+ /* small block storage */
+ ret = store_write_block(storestate, bse, elem_idx);
+ } else {
+ /* separate file in backing store */
+ ret = store_write_file(storestate, bse, elem_idx);
}
- return NSERROR_OK;
+ return ret;
}
/**
@@ -1362,12 +1406,14 @@ fetch(nsurl *url,
size_t datalen;
int fd;
ssize_t rd;
+ int elem_idx;
/* check backing store is initialised */
if (storestate == NULL) {
return NSERROR_INIT_FAILED;
}
+ /* fetch store entry */
ret = get_store_entry(storestate, url, &bse);
if (ret != NSERROR_OK) {
LOG(("entry not found"));
@@ -1378,20 +1424,28 @@ fetch(nsurl *url,
LOG(("retriving cache file for url:%s", nsurl_access(url)));
- fd = store_open(storestate, bse->ident, bsflags, O_RDONLY);
- if (fd < 0) {
- LOG(("Open failed"));
- /** @todo should this invalidate the entry? */
- return NSERROR_NOT_FOUND;
+ /* calculate the entry element index */
+ if ((bsflags & BACKING_STORE_META) != 0) {
+ elem_idx = ENTRY_ELEM_META;
+ } else {
+ elem_idx = ENTRY_ELEM_DATA;
}
-
/* the entry element */
- if ((bsflags & BACKING_STORE_META) != 0) {
- elem = &bse->elem[ENTRY_ELEM_META];
+ elem = &bse->elem[elem_idx];
+
+ if (elem->block != 0) {
+ /* small block storage */
} else {
- elem = &bse->elem[ENTRY_ELEM_DATA];
+ /* separate file in backing store */
+ fd = store_open(storestate, bse, elem_idx, O_RDONLY);
+ if (fd < 0) {
+ LOG(("Open failed"));
+ /** @todo should this invalidate the entry? */
+ return NSERROR_NOT_FOUND;
+ }
}
+
data = *data_out;
datalen = *datalen_out;
/** @todo should this check datalen is sufficient? */
@@ -1426,21 +1480,24 @@ fetch(nsurl *url,
return NSERROR_BAD_PARAMETER;
}
- LOG(("Reading %d bytes into %p from file", datalen, data));
+ if (elem->block != 0) {
+ } else {
+ LOG(("Reading %d bytes into %p from file", datalen, data));
+
+ /** @todo this read should be an a loop */
+ rd = read(fd, data, datalen);
+ if (rd <= 0) {
+ LOG(("read returned %d", rd));
+ close(fd);
+ if ((*data_out) == NULL) {
+ entry_release_alloc(elem);
+ }
+ return NSERROR_NOT_FOUND;
+ }
- /** @todo this read should be an a loop */
- rd = read(fd, data, datalen);
- if (rd <= 0) {
- LOG(("read returned %d", rd));
close(fd);
- if ((*data_out) == NULL) {
- entry_release_alloc(elem);
- }
- return NSERROR_NOT_FOUND;
}
- close(fd);
-
storestate->hit_size += datalen;
*data_out = data;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c2eda75710da1e8422d...
commit c2eda75710da1e8422de9eaac69735e25d19af75
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Change element layout and cope with index collisions.
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 4cf0292..f1b4aa4 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -62,7 +62,7 @@
#define DEFAULT_ENTRY_SIZE 16
/** Backing store file format version */
-#define CONTROL_VERSION 120
+#define CONTROL_VERSION 130
/** Number of milliseconds after a update before control data maintinance is performed */
#define CONTROL_MAINT_TIME 10000
@@ -129,24 +129,20 @@ enum store_entry_flags {
/**
* Backing store entry element.
*
+ * An element keeps data about:
+ * - the current memory allocation
+ * - the number of outstanding references to the memory
+ * - the size of the element data
+ * - flags controlling how the memory and element are handled
+ *
* @note Order is important to avoid excessive structure packing overhead.
*/
struct store_entry_element {
- union {
- struct {
- uint8_t* data; /**< data allocated on heap */
- uint8_t ref; /**< reference count */
- } __attribute__((__packed__)) heap;
- struct {
- uint8_t* data; /**< data is from an mmapping */
- uint8_t ref; /**< reference count */
- } __attribute__((__packed__)) map;
- struct {
- uint16_t block; /**< small object data block */
- } __attribute__((__packed__)) sml;
- } u ;
- uint8_t flags; /* extension flags */
+ uint8_t* data; /**< data allocated */
uint32_t size; /**< size of entry element on disc */
+ uint16_t block; /**< small object data block */
+ uint8_t ref; /**< element data reference count */
+ uint8_t flags; /**< entry flags */
};
/**
@@ -739,17 +735,28 @@ set_store_entry(struct store_state *state,
state->last_entry++;
BS_ENTRY_INDEX(ident, state) = sei;
+ /* the entry */
+ se = &state->entries[sei];
+
/* clear the new entry */
- memset(&state->entries[sei], 0, sizeof(struct store_entry));
- }
+ memset(se, 0, sizeof(struct store_entry));
+ } else {
+ /* index found existing entry */
- /** @todo should we be checking the entry ident matches the
- * url. Thats a collision in the address mapping right? and is
- * it important?
- */
+ /* the entry */
+ se = &state->entries[sei];
- /* the entry */
- se = &state->entries[sei];
+ if (se->ident != ident) {
+ /** @todo Is there a better heuristic than
+ * first come, first served? Should we check
+ * to see if the old entry is in use and if
+ * not prefer the newly stored entry instead?
+ */
+ LOG(("Entry index collision trying to replace %x with %x",
+ se->ident, ident));
+ return NSERROR_PERMISSION;
+ }
+ }
/* the entry element */
if ((flags & BACKING_STORE_META) != 0) {
@@ -774,8 +781,8 @@ set_store_entry(struct store_state *state,
/* store the data in the element */
elem->flags |= ENTRY_ELEM_FLAG_HEAP;
- elem->u.heap.data = data;
- elem->u.heap.ref = 1;
+ elem->data = data;
+ elem->ref = 1;
/* account for size of entry element */
state->total_alloc -= elem->size;
@@ -1222,7 +1229,9 @@ initialise(const struct llcache_store_parameters *parameters)
LOG(("FS backing store init successful"));
- LOG(("path:%s limit:%d hyst:%d addr:%d entries:%d", newstate->path, newstate->limit, newstate->hysteresis, newstate->ident_bits, newstate->entry_bits));
+ LOG(("path:%s limit:%d hyst:%d addr:%d entries:%d",
+ newstate->path, newstate->limit, newstate->hysteresis,
+ newstate->ident_bits, newstate->entry_bits));
LOG(("Using %lld/%lld", newstate->total_alloc, newstate->limit));
return NSERROR_OK;
@@ -1321,10 +1330,10 @@ store(nsurl *url,
static nserror entry_release_alloc(struct store_entry_element *elem)
{
if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) {
- elem->u.heap.ref--;
- if (elem->u.heap.ref == 0) {
- LOG(("freeing %p", elem->u.heap.data));
- free(elem->u.heap.data);
+ elem->ref--;
+ if (elem->ref == 0) {
+ LOG(("freeing %p", elem->data));
+ free(elem->data);
elem->flags &= ~ENTRY_ELEM_FLAG_HEAP;
}
}
@@ -1393,10 +1402,10 @@ fetch(nsurl *url,
/* a heap allocation already exists. Return
* that allocation and bump our ref count.
*/
- data = elem->u.heap.data;
- elem->u.heap.ref++;
+ data = elem->data;
+ elem->ref++;
datalen = elem->size;
- LOG(("Using existing heap allocation %p", elem->u.heap.data));
+ LOG(("Using existing heap allocation %p", elem->data));
} else {
datalen = elem->size;
data = malloc(elem->size);
@@ -1407,9 +1416,9 @@ fetch(nsurl *url,
/* store allocated buffer so track ownership */
elem->flags |= ENTRY_ELEM_FLAG_HEAP;
- elem->u.heap.data = data;
- elem->u.heap.ref = 1;
- LOG(("Creating new heap allocation %p", elem->u.heap.data));
+ elem->data = data;
+ elem->ref = 1;
+ LOG(("Creating new heap allocation %p", elem->data));
}
} else if (datalen == 0) {
/* caller provided a buffer but no length bad parameter */
-----------------------------------------------------------------------
Summary of changes:
content/backing_store.h | 10 +-
content/fs_backing_store.c | 861 +++++++++++++++++++++++++++++++++-----------
2 files changed, 661 insertions(+), 210 deletions(-)
diff --git a/content/backing_store.h b/content/backing_store.h
index 312a2b0..4e29511 100644
--- a/content/backing_store.h
+++ b/content/backing_store.h
@@ -83,10 +83,8 @@ struct gui_llcache_table {
/**
* Retrive an object from the backing store.
*
- * The caller may provide a buffer in \a data and a buffer
- * length in \a datalen. Alternatively the backing store will
- * allocate its own buffer if \a data is NULL, this memory is
- * managed by the backing store.
+ * The backing store will manage its own memory and the
+ * allocations returned in \a data *must* not be altered.
*
* The caller must assume nothing about the backing store
* allocated buffers and the storage and *must* be freed by
@@ -94,8 +92,8 @@ struct gui_llcache_table {
*
* @param[in] url The url is used as the unique primary key for the data.
* @param[in] flags The flags to control how the object is retrived.
- * @param[in,out] data The retrived objects data.
- * @param[in,out] datalen The length of the \a data retrieved.
+ * @param[out] data The retrived objects data.
+ * @param[out] datalen The length of the \a data retrieved.
* @return NSERROR_OK on success or error code on faliure.
*/
nserror (*fetch)(struct nsurl *url, enum backing_store_flags flags,
diff --git a/content/fs_backing_store.c b/content/fs_backing_store.c
index 4cf0292..963fd54 100644
--- a/content/fs_backing_store.c
+++ b/content/fs_backing_store.c
@@ -62,7 +62,7 @@
#define DEFAULT_ENTRY_SIZE 16
/** Backing store file format version */
-#define CONTROL_VERSION 120
+#define CONTROL_VERSION 130
/** Number of milliseconds after a update before control data maintinance is performed */
#define CONTROL_MAINT_TIME 10000
@@ -79,6 +79,27 @@
/** Filename of serialised entries */
#define ENTRIES_FNAME "entries"
+/** Filename of block file index */
+#define BLOCKS_FNAME "blocks"
+
+/** log2 block data address length (64k) */
+#define BLOCK_ADDR_LEN 16
+
+/** log2 number of entries per block file(4k) */
+#define BLOCK_ENTRY_COUNT 12
+
+/** log2 number of data block files */
+#define BLOCK_FILE_COUNT (BLOCK_ADDR_LEN - BLOCK_ENTRY_COUNT)
+
+/** log2 size of data blocks (8k) */
+#define BLOCK_DATA_SIZE 13
+
+/** log2 size of metadata blocks (1k) */
+#define BLOCK_META_SIZE 10
+
+/** length in bytes of a block files use map */
+#define BLOCK_USE_MAP_SIZE (1 << (BLOCK_ENTRY_COUNT - 3))
+
/**
* The type used to store index values refering to store entries. Care
* must be taken with this type as it is used to build address to
@@ -95,7 +116,15 @@ typedef uint16_t entry_index_t;
typedef uint32_t entry_ident_t;
/**
- * Entry extension index values.
+ * The type used to store block file index values. If this is changed
+ * it will affect the entry storage/alignment and BLOCK_ADDR_LEN must
+ * also be updated.
+ */
+typedef uint16_t block_index_t;
+
+
+/**
+ * Entry element index values.
*/
enum store_entry_elem_idx {
ENTRY_ELEM_DATA = 0, /**< entry element is data */
@@ -129,24 +158,20 @@ enum store_entry_flags {
/**
* Backing store entry element.
*
+ * An element keeps data about:
+ * - the current memory allocation
+ * - the number of outstanding references to the memory
+ * - the size of the element data
+ * - flags controlling how the memory and element are handled
+ *
* @note Order is important to avoid excessive structure packing overhead.
*/
struct store_entry_element {
- union {
- struct {
- uint8_t* data; /**< data allocated on heap */
- uint8_t ref; /**< reference count */
- } __attribute__((__packed__)) heap;
- struct {
- uint8_t* data; /**< data is from an mmapping */
- uint8_t ref; /**< reference count */
- } __attribute__((__packed__)) map;
- struct {
- uint16_t block; /**< small object data block */
- } __attribute__((__packed__)) sml;
- } u ;
- uint8_t flags; /* extension flags */
+ uint8_t* data; /**< data allocated */
uint32_t size; /**< size of entry element on disc */
+ block_index_t block; /**< small object data block */
+ uint8_t ref; /**< element data reference count */
+ uint8_t flags; /**< entry flags */
};
/**
@@ -169,15 +194,36 @@ struct store_entry {
};
/**
+ * Small block file.
+ */
+struct block_file {
+ /** file descriptor of the block file */
+ int fd;
+ /** map of used and unused entries within the block file */
+ uint8_t use_map[BLOCK_USE_MAP_SIZE];
+};
+
+/**
+ * log2 of block size.
+ */
+static const unsigned int log2_block_size[ENTRY_ELEM_COUNT] = {
+ BLOCK_DATA_SIZE, /**< Data block size */
+ BLOCK_META_SIZE /**< Metadata block size */
+};
+
+/**
* Parameters controlling the backing store.
*/
struct store_state {
+ /* store config */
char *path; /**< The path to the backing store */
size_t limit; /**< The backing store upper bound target size */
size_t hysteresis; /**< The hysteresis around the target size */
unsigned int ident_bits; /**< log2 number of bits to use for address. */
+
+ /* cache entry management */
struct store_entry *entries; /**< store entries. */
unsigned int entry_bits; /**< log2 number of bits in entry index. */
unsigned int last_entry; /**< index of last usable entry. */
@@ -195,6 +241,16 @@ struct store_state {
*/
entry_index_t *addrmap;
+ /* small block managemet */
+ struct block_file blocks[ENTRY_ELEM_COUNT][BLOCK_FILE_COUNT];
+
+ /** flag indicating if the block file use maps have been made
+ * persistant since they were last changed.
+ */
+ bool blocks_dirty;
+
+
+ /* stats */
uint64_t total_alloc; /**< total size of all allocated storage. */
size_t hit_count; /**< number of cache hits */
@@ -278,122 +334,171 @@ remove_store_entry(struct store_state *state, struct store_entry **bse)
* - path elements no longer than 8 characters
* - acceptable characters are A-Z, 0-9
* - short total path lengths (255 or less)
+ * - no more than 77 entries per directory (6bits worth)
*
* The short total path lengths mean the encoding must represent as
* much data as possible in the least number of characters.
*
- * To achieve all these goals we use RFC4648 base32 encoding which packs
- * 5bits into each character of the filename.
+ * To achieve all these goals we use RFC4648 base32 encoding which
+ * packs 5bits into each character of the filename. To represent a 32
+ * bit ident this requires a total path length of between 17 and 22
+ * bytes (including directory separators) BA/BB/BC/BD/BE/ABCDEFG
*
* @note Version 1.00 of the cache implementation used base64 to
* encode this, however that did not meet the requirement for only
* using uppercase characters.
*
+ * @note Versions prior to 1.30 only packed 5 bits per directory level
+ * A/B/C/D/E/F/ABCDEFG which only required 19 characters to represent
+ * but resulted in requiring an extra level of directory which is less
+ * desirable than the three extra characters using six bits.
+ *
* @param state The store state to use.
* @param ident The identifier to use.
- * @param flags flags to control the filename used.
+ * @param elem_idx The element index.
* @return The filename string or NULL on allocation error.
*/
static char *
store_fname(struct store_state *state,
entry_ident_t ident,
- enum backing_store_flags flags)
+ int elem_idx)
{
char *fname = NULL;
uint8_t b32u_i[8]; /* base32 encoded ident */
- uint8_t b32u_d[6][2]; /* base32 ident as separate components */
- const char *dat;
-
- /* RFC4648 base32 encoding table */
- static const uint8_t encoding_table[] = {
- 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
- 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
- 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
- 'Y', 'Z', '2', '3', '4', '5', '6', '7'
+ const uint8_t *b32u_d[6]; /* base32 ident as separate components */
+
+ /* directories used to separate elements */
+ const char *base_dir_table[] = {
+ "d", "m", "dblk", "mblk"
};
- /* base32 encode ident */
- b32u_i[0] = b32u_d[0][0] = encoding_table[(ident ) & 0x1f];
- b32u_i[1] = b32u_d[1][0] = encoding_table[(ident >> 5) & 0x1f];
- b32u_i[2] = b32u_d[2][0] = encoding_table[(ident >> 10) & 0x1f];
- b32u_i[3] = b32u_d[3][0] = encoding_table[(ident >> 15) & 0x1f];
- b32u_i[4] = b32u_d[4][0] = encoding_table[(ident >> 20) & 0x1f];
- b32u_i[5] = b32u_d[5][0] = encoding_table[(ident >> 25) & 0x1f];
- b32u_i[6] = encoding_table[(ident >> 30) & 0x1f];
- /* null terminate strings */
- b32u_i[7] = b32u_d[0][1] = b32u_d[1][1] = b32u_d[2][1] =
- b32u_d[3][1] = b32u_d[4][1] = b32u_d[5][1] = 0;
-
- if ((flags & BACKING_STORE_META) != 0) {
- dat = "m"; /* metadata */
- } else {
- dat = "d"; /* data */
- }
+ /* RFC4648 base32 encoding table (six bits) */
+ const uint8_t encoding_table[64][3] = {
+ { 'A', 0, 0 }, { 'B', 0, 0 }, /* 0 */
+ { 'C', 0, 0 }, { 'D', 0, 0 }, /* 2 */
+ { 'E', 0, 0 }, { 'F', 0, 0 }, /* 4 */
+ { 'G', 0, 0 }, { 'H', 0, 0 }, /* 6 */
+ { 'I', 0, 0 }, { 'J', 0, 0 }, /* 8 */
+ { 'K', 0, 0 }, { 'L', 0, 0 }, /* 10 */
+ { 'M', 0, 0 }, { 'N', 0, 0 }, /* 12 */
+ { 'O', 0, 0 }, { 'P', 0, 0 }, /* 14 */
+ { 'Q', 0, 0 }, { 'R', 0, 0 }, /* 16 */
+ { 'S', 0, 0 }, { 'T', 0, 0 }, /* 18 */
+ { 'U', 0, 0 }, { 'V', 0, 0 }, /* 20 */
+ { 'W', 0, 0 }, { 'X', 0, 0 }, /* 22 */
+ { 'Y', 0, 0 }, { 'Z', 0, 0 }, /* 24 */
+ { '2', 0, 0 }, { '3', 0, 0 }, /* 26 */
+ { '4', 0, 0 }, { '5', 0, 0 }, /* 28 */
+ { '6', 0, 0 }, { '7', 0, 0 }, /* 30 */
+ { 'B', 'A', 0 }, { 'B', 'B', 0 }, /* 32 */
+ { 'B', 'C', 0 }, { 'B', 'D', 0 }, /* 34 */
+ { 'B', 'E', 0 }, { 'B', 'F', 0 }, /* 36 */
+ { 'B', 'G', 0 }, { 'B', 'H', 0 }, /* 38 */
+ { 'B', 'I', 0 }, { 'B', 'J', 0 }, /* 40 */
+ { 'B', 'K', 0 }, { 'B', 'L', 0 }, /* 42 */
+ { 'B', 'M', 0 }, { 'B', 'N', 0 }, /* 44 */
+ { 'B', 'O', 0 }, { 'B', 'P', 0 }, /* 46 */
+ { 'B', 'Q', 0 }, { 'B', 'R', 0 }, /* 48 */
+ { 'B', 'S', 0 }, { 'B', 'T', 0 }, /* 50 */
+ { 'B', 'U', 0 }, { 'B', 'V', 0 }, /* 52 */
+ { 'B', 'W', 0 }, { 'B', 'X', 0 }, /* 54 */
+ { 'B', 'Y', 0 }, { 'B', 'Z', 0 }, /* 56 */
+ { 'B', '2', 0 }, { 'B', '3', 0 }, /* 58 */
+ { 'B', '4', 0 }, { 'B', '5', 0 }, /* 60 */
+ { 'B', '6', 0 }, { 'B', '7', 0 } /* 62 */
+ };
- /* number of chars with usefully encoded data in base 32 */
- switch(((state->ident_bits + 4) / 5)) {
- case 1:
- netsurf_mkpath(&fname, NULL, 3, state->path, dat,
- b32u_i);
+ /* base32 encode ident */
+ b32u_i[0] = encoding_table[(ident ) & 0x1f][0];
+ b32u_i[1] = encoding_table[(ident >> 5) & 0x1f][0];
+ b32u_i[2] = encoding_table[(ident >> 10) & 0x1f][0];
+ b32u_i[3] = encoding_table[(ident >> 15) & 0x1f][0];
+ b32u_i[4] = encoding_table[(ident >> 20) & 0x1f][0];
+ b32u_i[5] = encoding_table[(ident >> 25) & 0x1f][0];
+ b32u_i[6] = encoding_table[(ident >> 30) & 0x1f][0];
+ b32u_i[7] = 0; /* null terminate ident string */
+
+ /* base32 encode directory separators */
+ b32u_d[0] = (uint8_t*)base_dir_table[elem_idx];
+ b32u_d[1] = &encoding_table[(ident ) & 0x3f][0];
+ b32u_d[2] = &encoding_table[(ident >> 6) & 0x3f][0];
+ b32u_d[3] = &encoding_table[(ident >> 12) & 0x3f][0];
+ b32u_d[4] = &encoding_table[(ident >> 18) & 0x3f][0];
+ b32u_d[5] = &encoding_table[(ident >> 24) & 0x3f][0];
+
+ switch (elem_idx) {
+ case ENTRY_ELEM_DATA:
+ case ENTRY_ELEM_META:
+ netsurf_mkpath(&fname, NULL, 8,
+ state->path, b32u_d[0], b32u_d[1], b32u_d[2],
+ b32u_d[3], b32u_d[4], b32u_d[5], b32u_i);
break;
- case 2:
- netsurf_mkpath(&fname, NULL, 4, state->path, dat,
- b32u_d[0],
- b32u_i);
+ case (ENTRY_ELEM_COUNT + ENTRY_ELEM_META):
+ case (ENTRY_ELEM_COUNT + ENTRY_ELEM_DATA):
+ netsurf_mkpath(&fname, NULL, 3,
+ state->path, b32u_d[0], b32u_d[1]);
break;
- case 3:
- netsurf_mkpath(&fname, NULL, 5, state->path, dat,
- b32u_d[0], b32u_d[1],
- b32u_i);
+ default:
+ assert("bad element index" == NULL);
break;
+ }
- case 4:
- netsurf_mkpath(&fname, NULL, 6, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2],
- b32u_i);
- break;
+ return fname;
+}
- case 5:
- netsurf_mkpath(&fname, NULL, 7, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2], b32u_d[3],
- b32u_i);
- break;
+/**
+ * invalidate an element of an entry
+ *
+ * @param state The store state to use.
+ * @param bse The entry to invalidate.
+ * @param elem_idx The element index to invalidate.
+ * @return NSERROR_OK on sucess or error code on failure.
+ */
+static nserror
+invalidate_element(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
+{
+ if (bse->elem[elem_idx].block != 0) {
+ block_index_t bf;
+ block_index_t bi;
- case 6:
- netsurf_mkpath(&fname, NULL, 8, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2], b32u_d[3],
- b32u_d[4],
- b32u_i);
- break;
+ /* block file block resides in */
+ bf = (bse->elem[elem_idx].block >> BLOCK_ENTRY_COUNT) &
+ ((1 << BLOCK_FILE_COUNT) - 1);
- case 7:
- netsurf_mkpath(&fname, NULL, 9, state->path, dat,
- b32u_d[0], b32u_d[1], b32u_d[2], b32u_d[3],
- b32u_d[4], b32u_d[5],
- b32u_i);
- break;
+ /* block index in file */
+ bi = bse->elem[elem_idx].block & ((1U << BLOCK_ENTRY_COUNT) -1);
- default:
- assert("Invalid path depth in store_fname()" == NULL);
+ /* clear bit in use map */
+ state->blocks[elem_idx][bf].use_map[bi >> 3] &= ~(1U << (bi & 7));
+ } else {
+ char *fname;
+
+ /* unlink the file from disc */
+ fname = store_fname(state, bse->ident, elem_idx);
+ if (fname == NULL) {
+ return NSERROR_NOMEM;
+ }
+ unlink(fname);
+ free(fname);
}
- return fname;
+ return NSERROR_OK;
}
-
/**
* Remove the entry and files associated with an identifier.
*
* @param state The store state to use.
- * @param ident The identifier to use.
+ * @param bse The entry to invalidate.
* @return NSERROR_OK on sucess or error code on failure.
*/
static nserror
invalidate_entry(struct store_state *state, struct store_entry *bse)
{
- char *fname;
nserror ret;
/* mark entry as invalid */
@@ -420,20 +525,15 @@ invalidate_entry(struct store_state *state, struct store_entry *bse)
return ret;
}
- /* unlink the files from disc */
- fname = store_fname(state, bse->ident, BACKING_STORE_META);
- if (fname == NULL) {
- return NSERROR_NOMEM;
+ ret = invalidate_element(state, bse, ENTRY_ELEM_META);
+ if (ret != NSERROR_OK) {
+ LOG(("Error invalidating metadata element"));
}
- unlink(fname);
- free(fname);
- fname = store_fname(state, bse->ident, BACKING_STORE_NONE);
- if (fname == NULL) {
- return NSERROR_NOMEM;
+ ret = invalidate_element(state, bse, ENTRY_ELEM_DATA);
+ if (ret != NSERROR_OK) {
+ LOG(("Error invalidating data element"));
}
- unlink(fname);
- free(fname);
return NSERROR_OK;
}
@@ -624,6 +724,85 @@ static nserror write_entries(struct store_state *state)
}
/**
+ * Write block file use map to file.
+ *
+ * Serialise block file use map out to storage.
+ *
+ * @param state The backing store state to serialise.
+ * @return NSERROR_OK on sucess or error code on faliure.
+ */
+static nserror write_blocks(struct store_state *state)
+{
+ int fd;
+ char *tname = NULL; /* temporary file name for atomic replace */
+ char *fname = NULL; /* target filename */
+ size_t blocks_size;
+ size_t written = 0;
+ size_t wr;
+ nserror ret;
+ int bfidx; /* block file index */
+ int elem_idx;
+
+ if (state->blocks_dirty == false) {
+ /* blocks use maps have not been updated since last write */
+ return NSERROR_OK;
+ }
+
+ ret = netsurf_mkpath(&tname, NULL, 2, state->path, "t"BLOCKS_FNAME);
+ if (ret != NSERROR_OK) {
+ return ret;
+ }
+
+ fd = open(tname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ if (fd == -1) {
+ free(tname);
+ return NSERROR_SAVE_FAILED;
+ }
+
+ blocks_size = (BLOCK_FILE_COUNT * ENTRY_ELEM_COUNT) * BLOCK_USE_MAP_SIZE;
+
+ for (elem_idx = 0; elem_idx < ENTRY_ELEM_COUNT; elem_idx++) {
+ for (bfidx = 0; bfidx < BLOCK_FILE_COUNT; bfidx++) {
+ wr = write(fd,
+ &state->blocks[elem_idx][bfidx].use_map[0],
+ BLOCK_USE_MAP_SIZE);
+ if (wr != BLOCK_USE_MAP_SIZE) {
+ LOG(("writing block file %d use index on file number %d failed", elem_idx, bfidx));
+ goto wr_err;
+ }
+ written += wr;
+ }
+ }
+wr_err:
+ close(fd);
+
+ /* check all data was written */
+ if (written != blocks_size) {
+ unlink(tname);
+ free(tname);
+ return NSERROR_SAVE_FAILED;
+ }
+
+ ret = netsurf_mkpath(&fname, NULL, 2, state->path, BLOCKS_FNAME);
+ if (ret != NSERROR_OK) {
+ unlink(tname);
+ free(tname);
+ return ret;
+ }
+
+ /* remove() call is to handle non-POSIX rename() implementations */
+ (void)remove(fname);
+ if (rename(tname, fname) != 0) {
+ unlink(tname);
+ free(tname);
+ free(fname);
+ return NSERROR_SAVE_FAILED;
+ }
+
+ return NSERROR_OK;
+}
+
+/**
* maintinance of control structures.
*
* callback scheduled when control data has been update. Currently
@@ -637,6 +816,7 @@ static void control_maintinance(void *s)
struct store_state *state = s;
write_entries(state);
+ write_blocks(state);
}
@@ -689,6 +869,36 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
return NSERROR_OK;
}
+/**
+ * Find next available small block.
+ */
+static block_index_t alloc_block(struct store_state *state, int elem_idx)
+{
+ int bf;
+ int idx;
+ int bit;
+ uint8_t *map;
+
+ for (bf = 0; bf < BLOCK_FILE_COUNT; bf++) {
+ map = &state->blocks[elem_idx][bf].use_map[0];
+
+ for (idx = 0; idx < BLOCK_USE_MAP_SIZE; idx++) {
+ if (*(map + idx) != 0xff) {
+ /* located an unused block */
+ for (bit = 0; bit < 8;bit++) {
+ if (((*(map + idx)) & (1U << bit)) == 0) {
+ /* mark block as used */
+ *(map + idx) |= 1U << bit;
+ state->blocks_dirty = true;
+ return (((bf * BLOCK_USE_MAP_SIZE) + idx) * 8) + bit;
+ }
+ }
+ }
+ }
+ }
+
+ return 0;
+}
/**
* Set a backing store entry in the entry table from a url.
@@ -697,7 +907,7 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
*
* @param state The store state to use.
* @param url The value used as the unique key to search entries for.
- * @param flags flags affecting how the entry is stored.
+ * @param elem_idx The index of the entry element to use.
* @param data The data to store
* @param datalen The length of data in \a data
* @param bse Pointer used to return value.
@@ -707,7 +917,7 @@ get_store_entry(struct store_state *state, nsurl *url, struct store_entry **bse)
static nserror
set_store_entry(struct store_state *state,
nsurl *url,
- enum backing_store_flags flags,
+ int elem_idx,
uint8_t *data,
const size_t datalen,
struct store_entry **bse)
@@ -739,24 +949,31 @@ set_store_entry(struct store_state *state,
state->last_entry++;
BS_ENTRY_INDEX(ident, state) = sei;
+ /* the entry */
+ se = &state->entries[sei];
+
/* clear the new entry */
- memset(&state->entries[sei], 0, sizeof(struct store_entry));
- }
+ memset(se, 0, sizeof(struct store_entry));
+ } else {
+ /* index found existing entry */
- /** @todo should we be checking the entry ident matches the
- * url. Thats a collision in the address mapping right? and is
- * it important?
- */
+ /* the entry */
+ se = &state->entries[sei];
- /* the entry */
- se = &state->entries[sei];
+ if (se->ident != ident) {
+ /** @todo Is there a better heuristic than
+ * first come, first served? Should we check
+ * to see if the old entry is in use and if
+ * not prefer the newly stored entry instead?
+ */
+ LOG(("Entry index collision trying to replace %x with %x",
+ se->ident, ident));
+ return NSERROR_PERMISSION;
+ }
+ }
/* the entry element */
- if ((flags & BACKING_STORE_META) != 0) {
- elem = &se->elem[ENTRY_ELEM_META];
- } else {
- elem = &se->elem[ENTRY_ELEM_DATA];
- }
+ elem = &se->elem[elem_idx];
/* check if the element has storage already allocated */
if ((elem->flags & (ENTRY_ELEM_FLAG_HEAP | ENTRY_ELEM_FLAG_MMAP)) != 0) {
@@ -774,14 +991,19 @@ set_store_entry(struct store_state *state,
/* store the data in the element */
elem->flags |= ENTRY_ELEM_FLAG_HEAP;
- elem->u.heap.data = data;
- elem->u.heap.ref = 1;
+ elem->data = data;
+ elem->ref = 1;
/* account for size of entry element */
state->total_alloc -= elem->size;
elem->size = datalen;
state->total_alloc += elem->size;
+ /* if the elemnt will fit in a small block attempt to allocate one */
+ if (elem->size <= (1U << log2_block_size[elem_idx])) {
+ elem->block = alloc_block(state, elem_idx);
+ }
+
/* ensure control maintinance scheduled. */
state->entries_dirty = true;
guit->browser->schedule(CONTROL_MAINT_TIME, control_maintinance, state);
@@ -796,22 +1018,26 @@ set_store_entry(struct store_state *state,
* Open a file using a store ident.
*
* @param state The store state to use.
- * @param ident The identifier of the file to open.
- * @param flags The backing store flags.
+ * @param ident The identifier to open file for.
+ * @param elem_idx The element within the store entry to open. The
+ * value should be be one of the values in the
+ * store_entry_elem_idx enum. Additionally it may have
+ * ENTRY_ELEM_COUNT added to it to indicate block file
+ * names.
* @param openflags The flags used with the open call.
* @return An fd from the open call or -1 on error.
*/
static int
store_open(struct store_state *state,
- uint32_t ident,
- enum backing_store_flags flags,
+ entry_ident_t ident,
+ int elem_idx,
int openflags)
{
char *fname;
nserror ret;
int fd;
- fname = store_fname(state, ident, flags);
+ fname = store_fname(state, ident, elem_idx);
if (fname == NULL) {
LOG(("filename error"));
return -1;
@@ -959,6 +1185,64 @@ read_entries(struct store_state *state)
return NSERROR_OK;
}
+
+/**
+ * Read block file usage bitmaps.
+ *
+ * @param state The backing store state to put the loaded entries in.
+ * @return NSERROR_OK on sucess or error code on faliure.
+ */
+static nserror
+read_blocks(struct store_state *state)
+{
+ int bfidx; /* block file index */
+ int elem_idx;
+ int fd;
+ ssize_t rd;
+ char *fname = NULL;
+ nserror ret;
+
+ ret = netsurf_mkpath(&fname, NULL, 2, state->path, BLOCKS_FNAME);
+ if (ret != NSERROR_OK) {
+ return ret;
+ }
+
+ LOG(("Initialising block use map from %s", fname));
+
+ fd = open(fname, O_RDWR);
+ free(fname);
+ if (fd != -1) {
+ /* initialise block file use array */
+ for (elem_idx = 0; elem_idx < ENTRY_ELEM_COUNT; elem_idx++) {
+ for (bfidx = 0; bfidx < BLOCK_FILE_COUNT; bfidx++) {
+ rd = read(fd,
+ &state->blocks[elem_idx][bfidx].use_map[0],
+ BLOCK_USE_MAP_SIZE);
+ if (rd <= 0) {
+ LOG(("reading block file %d use index on file number %d failed", elem_idx, bfidx));
+ goto rd_err;
+ }
+ }
+ }
+ rd_err:
+ close(fd);
+
+ } else {
+ LOG(("Initialising block use map to defaults"));
+ /* ensure block 0 (invalid sentinal) is skipped */
+ state->blocks[ENTRY_ELEM_DATA][0].use_map[0] = 1;
+ state->blocks[ENTRY_ELEM_META][0].use_map[0] = 1;
+ }
+
+ /* initialise block file file descriptors */
+ for (bfidx = 0; bfidx < BLOCK_FILE_COUNT; bfidx++) {
+ state->blocks[ENTRY_ELEM_DATA][bfidx].fd = -1;
+ state->blocks[ENTRY_ELEM_META][bfidx].fd = -1;
+ }
+
+ return NSERROR_OK;
+}
+
/**
* Write the cache tag file.
*
@@ -1212,7 +1496,15 @@ initialise(const struct llcache_store_parameters *parameters)
/* build entry hash map */
ret = build_entrymap(newstate);
if (ret != NSERROR_OK) {
- /* that obviously went well */
+ /* that obviously went well */
+ free(newstate->path);
+ free(newstate);
+ return ret;
+ }
+
+ ret = read_blocks(newstate);
+ if (ret != NSERROR_OK) {
+ /* oh dear */
free(newstate->path);
free(newstate);
return ret;
@@ -1222,7 +1514,9 @@ initialise(const struct llcache_store_parameters *parameters)
LOG(("FS backing store init successful"));
- LOG(("path:%s limit:%d hyst:%d addr:%d entries:%d", newstate->path, newstate->limit, newstate->hysteresis, newstate->ident_bits, newstate->entry_bits));
+ LOG(("path:%s limit:%d hyst:%d addr:%d entries:%d",
+ newstate->path, newstate->limit, newstate->hysteresis,
+ newstate->ident_bits, newstate->entry_bits));
LOG(("Using %lld/%lld", newstate->total_alloc, newstate->limit));
return NSERROR_OK;
@@ -1240,9 +1534,22 @@ initialise(const struct llcache_store_parameters *parameters)
static nserror
finalise(void)
{
+ int bf; /* block file index */
+
if (storestate != NULL) {
guit->browser->schedule(-1, control_maintinance, storestate);
write_entries(storestate);
+ write_blocks(storestate);
+
+ /* ensure all block files are closed */
+ for (bf = 0; bf < BLOCK_FILE_COUNT; bf++) {
+ if (storestate->blocks[ENTRY_ELEM_DATA][bf].fd != -1) {
+ close(storestate->blocks[ENTRY_ELEM_DATA][bf].fd);
+ }
+ if (storestate->blocks[ENTRY_ELEM_META][bf].fd != -1) {
+ close(storestate->blocks[ENTRY_ELEM_META][bf].fd);
+ }
+ }
/* avoid division by zero */
if (storestate->miss_count == 0) {
@@ -1262,6 +1569,87 @@ finalise(void)
/**
+ * Write an element of an entry to backing storage in a small block file.
+ *
+ * \param state The backing store state to use.
+ * \param bse The entry to store
+ * \param elem_idx The element index within the entry.
+ * \return NSERROR_OK on success or error code.
+ */
+static nserror store_write_block(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
+{
+ block_index_t bf = (bse->elem[elem_idx].block >> BLOCK_ENTRY_COUNT) &
+ ((1 << BLOCK_FILE_COUNT) - 1); /* block file block resides in */
+ block_index_t bi = bse->elem[elem_idx].block & ((1U << BLOCK_ENTRY_COUNT) -1); /* block index in file */
+ ssize_t wr;
+ off_t offst;
+
+ /* ensure the block file fd is good */
+ if (state->blocks[elem_idx][bf].fd == -1) {
+ state->blocks[elem_idx][bf].fd = store_open(state, bf,
+ elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
+ }
+ if (state->blocks[elem_idx][bf].fd == -1) {
+ return NSERROR_SAVE_FAILED;
+ }
+
+ offst = bi << log2_block_size[elem_idx];
+
+ wr = pwrite(state->blocks[elem_idx][bf].fd,
+ bse->elem[elem_idx].data,
+ bse->elem[elem_idx].size,
+ offst);
+
+ LOG(("Wrote %d of %d bytes from %p at 0x%x block %d",
+ wr, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block));
+
+ if (wr != bse->elem[elem_idx].size) {
+ return NSERROR_SAVE_FAILED;
+ }
+
+ return NSERROR_OK;
+}
+
+/**
+ * Write an element of an entry to backing storage as an individual file.
+ *
+ * \param state The backing store state to use.
+ * \param bse The entry to store
+ * \param elem_idx The element index within the entry.
+ * \return NSERROR_OK on success or error code.
+ */
+static nserror store_write_file(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
+{
+ ssize_t written;
+ int fd;
+
+ fd = store_open(state, bse->ident, elem_idx, O_CREAT | O_WRONLY);
+ if (fd < 0) {
+ perror("");
+ LOG(("Open failed %d", fd));
+ return NSERROR_SAVE_FAILED;
+ }
+
+ written = write(fd, bse->elem[elem_idx].data, bse->elem[elem_idx].size);
+
+ LOG(("Wrote %d of %d bytes from %p",
+ written, bse->elem[elem_idx].size, bse->elem[elem_idx].data));
+
+ close(fd);
+ if (written < 0 || (size_t) written < bse->elem[elem_idx].size) {
+ /** @todo Delete the file? */
+ return NSERROR_SAVE_FAILED;
+ }
+
+ return NSERROR_OK;
+}
+
+/**
* Place an object in the backing store.
*
* takes ownership of the heap block passed in.
@@ -1274,41 +1662,99 @@ finalise(void)
*/
static nserror
store(nsurl *url,
- enum backing_store_flags flags,
+ enum backing_store_flags bsflags,
uint8_t *data,
const size_t datalen)
{
nserror ret;
struct store_entry *bse;
- ssize_t written;
- int fd;
+ int elem_idx;
/* check backing store is initialised */
if (storestate == NULL) {
return NSERROR_INIT_FAILED;
}
+ /* calculate the entry element index */
+ if ((bsflags & BACKING_STORE_META) != 0) {
+ elem_idx = ENTRY_ELEM_META;
+ } else {
+ elem_idx = ENTRY_ELEM_DATA;
+ }
+
/* set the store entry up */
- ret = set_store_entry(storestate, url, flags, data, datalen, &bse);
+ ret = set_store_entry(storestate, url, elem_idx, data, datalen, &bse);
if (ret != NSERROR_OK) {
LOG(("store entry setting failed"));
return ret;
}
- fd = store_open(storestate, bse->ident, flags, O_CREAT | O_WRONLY);
- if (fd < 0) {
- perror("");
- LOG(("Open failed %d",fd));
+ if (bse->elem[elem_idx].block != 0) {
+ /* small block storage */
+ ret = store_write_block(storestate, bse, elem_idx);
+ } else {
+ /* separate file in backing store */
+ ret = store_write_file(storestate, bse, elem_idx);
+ }
+
+ return ret;
+}
+
+/**
+ * release any allocation for an entry
+ */
+static nserror entry_release_alloc(struct store_entry_element *elem)
+{
+ if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) {
+ elem->ref--;
+ if (elem->ref == 0) {
+ LOG(("freeing %p", elem->data));
+ free(elem->data);
+ elem->flags &= ~ENTRY_ELEM_FLAG_HEAP;
+ }
+ }
+ return NSERROR_OK;
+}
+
+
+/**
+ * Read an element of an entry from a small block file in the backing storage.
+ *
+ * \param state The backing store state to use.
+ * \param bse The entry to read.
+ * \param elem_idx The element index within the entry.
+ * \return NSERROR_OK on success or error code.
+ */
+static nserror store_read_block(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
+{
+ block_index_t bf = (bse->elem[elem_idx].block >> BLOCK_ENTRY_COUNT) &
+ ((1 << BLOCK_FILE_COUNT) - 1); /* block file block resides in */
+ block_index_t bi = bse->elem[elem_idx].block & ((1 << BLOCK_ENTRY_COUNT) -1); /* block index in file */
+ ssize_t rd;
+ off_t offst;
+
+ /* ensure the block file fd is good */
+ if (state->blocks[elem_idx][bf].fd == -1) {
+ state->blocks[elem_idx][bf].fd = store_open(state, bf, elem_idx + ENTRY_ELEM_COUNT, O_CREAT | O_RDWR);
+ }
+ if (state->blocks[elem_idx][bf].fd == -1) {
return NSERROR_SAVE_FAILED;
}
+ offst = bi << log2_block_size[elem_idx];
- LOG(("Writing %d bytes from %p", datalen, data));
- written = write(fd, data, datalen);
+ rd = pread(state->blocks[elem_idx][bf].fd,
+ bse->elem[elem_idx].data,
+ bse->elem[elem_idx].size,
+ offst);
- close(fd);
- if (written < 0 || (size_t) written < datalen) {
- /** @todo Delete the file? */
+ LOG(("Read %d of %d bytes into %p from 0x%x block %d",
+ rd, bse->elem[elem_idx].size, bse->elem[elem_idx].data,
+ offst, bse->elem[elem_idx].block));
+
+ if (rd != bse->elem[elem_idx].size) {
return NSERROR_SAVE_FAILED;
}
@@ -1316,19 +1762,48 @@ store(nsurl *url,
}
/**
- * release any allocation for an entry
+ * Read an element of an entry from an individual file in the backing storage.
+ *
+ * \param state The backing store state to use.
+ * \param bse The entry to read.
+ * \param elem_idx The element index within the entry.
+ * \return NSERROR_OK on success or error code.
*/
-static nserror entry_release_alloc(struct store_entry_element *elem)
+static nserror store_read_file(struct store_state *state,
+ struct store_entry *bse,
+ int elem_idx)
{
- if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) {
- elem->u.heap.ref--;
- if (elem->u.heap.ref == 0) {
- LOG(("freeing %p", elem->u.heap.data));
- free(elem->u.heap.data);
- elem->flags &= ~ENTRY_ELEM_FLAG_HEAP;
+ int fd;
+ ssize_t rd; /* return from read */
+ int ret = NSERROR_OK;
+ size_t tot = 0; /* total size */
+
+ /* separate file in backing store */
+ fd = store_open(storestate, bse->ident, elem_idx, O_RDONLY);
+ if (fd < 0) {
+ LOG(("Open failed"));
+ /** @todo should this invalidate the entry? */
+ return NSERROR_NOT_FOUND;
+ }
+
+ LOG(("Reading %d bytes into %p from file",
+ bse->elem[elem_idx].size, bse->elem[elem_idx].data));
+
+ while (tot < bse->elem[elem_idx].size) {
+ rd = read(fd,
+ bse->elem[elem_idx].data + tot,
+ bse->elem[elem_idx].size - tot);
+ if (rd <= 0) {
+ LOG(("read error returned %d", rd));
+ ret = NSERROR_NOT_FOUND;
+ break;
}
+ tot += rd;
}
- return NSERROR_OK;
+
+ close(fd);
+
+ return ret;
}
/**
@@ -1349,16 +1824,14 @@ fetch(nsurl *url,
nserror ret;
struct store_entry *bse;
struct store_entry_element *elem;
- uint8_t *data;
- size_t datalen;
- int fd;
- ssize_t rd;
+ int elem_idx;
/* check backing store is initialised */
if (storestate == NULL) {
return NSERROR_INIT_FAILED;
}
+ /* fetch store entry */
ret = get_store_entry(storestate, url, &bse);
if (ret != NSERROR_OK) {
LOG(("entry not found"));
@@ -1367,77 +1840,57 @@ fetch(nsurl *url,
}
storestate->hit_count++;
- LOG(("retriving cache file for url:%s", nsurl_access(url)));
-
- fd = store_open(storestate, bse->ident, bsflags, O_RDONLY);
- if (fd < 0) {
- LOG(("Open failed"));
- /** @todo should this invalidate the entry? */
- return NSERROR_NOT_FOUND;
- }
+ LOG(("retriving cache data for url:%s", nsurl_access(url)));
- /* the entry element */
+ /* calculate the entry element index */
if ((bsflags & BACKING_STORE_META) != 0) {
- elem = &bse->elem[ENTRY_ELEM_META];
+ elem_idx = ENTRY_ELEM_META;
} else {
- elem = &bse->elem[ENTRY_ELEM_DATA];
+ elem_idx = ENTRY_ELEM_DATA;
}
+ elem = &bse->elem[elem_idx];
- data = *data_out;
- datalen = *datalen_out;
- /** @todo should this check datalen is sufficient? */
+ /* if an allocation already exists return it */
+ if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) {
+ /* use the existing allocation and bump the ref count. */
+ elem->ref++;
- /* need to deal with buffers */
- if (data == NULL) {
- if ((elem->flags & ENTRY_ELEM_FLAG_HEAP) != 0) {
- /* a heap allocation already exists. Return
- * that allocation and bump our ref count.
- */
- data = elem->u.heap.data;
- elem->u.heap.ref++;
- datalen = elem->size;
- LOG(("Using existing heap allocation %p", elem->u.heap.data));
- } else {
- datalen = elem->size;
- data = malloc(elem->size);
- if (data == NULL) {
- close(fd);
- return NSERROR_NOMEM;
- }
+ LOG(("Using existing entry (%p) allocation %p refs:%d",
+ bse, elem->data, elem->ref));
- /* store allocated buffer so track ownership */
- elem->flags |= ENTRY_ELEM_FLAG_HEAP;
- elem->u.heap.data = data;
- elem->u.heap.ref = 1;
- LOG(("Creating new heap allocation %p", elem->u.heap.data));
+ } else {
+ /* allocate from the heap */
+ elem->data = malloc(elem->size);
+ if (elem->data == NULL) {
+ LOG(("Failed to create new heap allocation"));
+ return NSERROR_NOMEM;
}
- } else if (datalen == 0) {
- /* caller provided a buffer but no length bad parameter */
- close(fd);
- return NSERROR_BAD_PARAMETER;
- }
+ LOG(("Created new heap allocation %p", elem->data));
- LOG(("Reading %d bytes into %p from file", datalen, data));
+ /* mark the entry as having a valid heap allocation */
+ elem->flags |= ENTRY_ELEM_FLAG_HEAP;
+ elem->ref = 1;
- /** @todo this read should be an a loop */
- rd = read(fd, data, datalen);
- if (rd <= 0) {
- LOG(("read returned %d", rd));
- close(fd);
- if ((*data_out) == NULL) {
- entry_release_alloc(elem);
+ /* fill the new block */
+ if (elem->block != 0) {
+ ret = store_read_block(storestate, bse, elem_idx);
+ } else {
+ ret = store_read_file(storestate, bse, elem_idx);
}
- return NSERROR_NOT_FOUND;
}
- close(fd);
-
- storestate->hit_size += datalen;
+ /* free the allocation if there is a read error */
+ if (ret != NSERROR_OK) {
+ entry_release_alloc(elem);
+ } else {
+ /* update stats and setup return pointers */
+ storestate->hit_size += elem->size;
- *data_out = data;
- *datalen_out = datalen;
+ *data_out = elem->data;
+ *datalen_out = elem->size;
+ }
- return NSERROR_OK;
+ return ret;
}
--
NetSurf Browser
8 years, 5 months
toolchains: branch master updated. c13143aa18c21bb913198aab5f9a79130f4b8526
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/toolchains.git/shortlog/c13143aa18c21bb913...
...commit http://git.netsurf-browser.org/toolchains.git/commit/c13143aa18c21bb91319...
...tree http://git.netsurf-browser.org/toolchains.git/tree/c13143aa18c21bb913198a...
The branch, master has been updated
via c13143aa18c21bb913198aab5f9a79130f4b8526 (commit)
from bb8b6345eba7ed075fab7168ce63a71e12aa4086 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/toolchains.git/commit/?id=c13143aa18c21bb9...
commit c13143aa18c21bb913198aab5f9a79130f4b8526
Author: Michael Drake <michael.drake(a)codethink.co.uk>
Commit: Michael Drake <michael.drake(a)codethink.co.uk>
Update to libpng 1.6.17
diff --git a/sdk/Makefile b/sdk/Makefile
index 55018fd..ab04e71 100644
--- a/sdk/Makefile
+++ b/sdk/Makefile
@@ -27,7 +27,7 @@ VERSION_ZLIB := 1.2.8
VERSION_LIBICONV := 1.14
VERSION_LIBTRE := 0.8.0
VERSION_OPENSSL := 1.0.1m
-VERSION_LIBPNG := 1.6.16
+VERSION_LIBPNG := 1.6.17
VERSION_LIBJPEG := 8d
VERSION_LIBCARES := 1.10.0
VERSION_LIBCURL := 7.41.0
-----------------------------------------------------------------------
Summary of changes:
sdk/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdk/Makefile b/sdk/Makefile
index 55018fd..ab04e71 100644
--- a/sdk/Makefile
+++ b/sdk/Makefile
@@ -27,7 +27,7 @@ VERSION_ZLIB := 1.2.8
VERSION_LIBICONV := 1.14
VERSION_LIBTRE := 0.8.0
VERSION_OPENSSL := 1.0.1m
-VERSION_LIBPNG := 1.6.16
+VERSION_LIBPNG := 1.6.17
VERSION_LIBJPEG := 8d
VERSION_LIBCARES := 1.10.0
VERSION_LIBCURL := 7.41.0
--
Cross-compilation toolchains and environments
8 years, 5 months
netsurf: branch master updated. release/3.3-26-g6f523a7
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/6f523a72f12284550bdff...
...commit http://git.netsurf-browser.org/netsurf.git/commit/6f523a72f12284550bdffa7...
...tree http://git.netsurf-browser.org/netsurf.git/tree/6f523a72f12284550bdffa77f...
The branch, master has been updated
via 6f523a72f12284550bdffa77fff473242382aa27 (commit)
from 729cd9134bc3f959a46179f91876894b88bf6819 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=6f523a72f12284550bd...
commit 6f523a72f12284550bdffa77fff473242382aa27
Author: Dick Tanis <dtanis(a)ymail.com>
Commit: Vincent Sanders <vince(a)kyllikki.org>
Updated Dutch resources for NetSurf / interactive Help corrections and additions
diff --git a/!NetSurf/Resources/nl/licence.html,faf b/!NetSurf/Resources/nl/licence.html,faf
index ff4af5d..d0c1650 100644
--- a/!NetSurf/Resources/nl/licence.html,faf
+++ b/!NetSurf/Resources/nl/licence.html,faf
@@ -195,7 +195,7 @@ Graham Shaw, James Bursa and John-Mark Bell.</span>
</dd>
</dl>
-<h2>Licentie-teksten</h2>
+<h2>Licentieteksten</h2>
<p>Waar mogelijk zijn hieronder de algemeen geldende licentieteksten van de
verschillende NetSurf-onderdelen opgenomen. Bij sommige onderdelen kan de
diff --git a/resources/FatMessages b/resources/FatMessages
index f018626..5ecb751 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -911,7 +911,7 @@ en.all.Link:Link
de.all.Link:Link
fr.all.Link:Lien
it.all.Link:Link
-nl.all.Link:Link
+nl.all.Link:Koppeling
en.all.LinkNewTab:Open in new tab
de.all.LinkNewTab:Öffnen in Tab
fr.all.LinkNewTab:Ouvrir dans un nouvel onglet
@@ -4118,6 +4118,16 @@ de.ro.HelpBrowserMenu2-3:Text aus dem Clipboard einfügen.
fr.ro.HelpBrowserMenu2-3:\Spaste text from the clipboard.
it.ro.HelpBrowserMenu2-3:\Sincolla il testo dalla clipboard
nl.ro.HelpBrowserMenu2-3:Klik met KIES om de tekst van het klembord hier in te voegen.
+en.ro.HelpBrowserMenu2-4:\Sdeselect the current selection.
+de.ro.HelpBrowserMenu2-4:\Sdeselect the current selection.
+fr.ro.HelpBrowserMenu2-4:\Sdeselect the current selection.
+it.ro.HelpBrowserMenu2-4:\Sdeselect the current selection.
+nl.ro.HelpBrowserMenu2-4:Klik met KIES om de gekozen selectie te deselecteren.
+en.ro.HelpBrowserMenu2-5:\Sselect all text on the current page, without the contents of text input fields.|MWhen the carret is at a text input field, all text in that field is selected.
+de.ro.HelpBrowserMenu2-5:\Sselect all text on the current page, without the contents of text input fields.|MWhen the carret is at a text input field, all text in that field is selected.
+fr.ro.HelpBrowserMenu2-5:\Sselect all text on the current page, without the contents of text input fields.|MWhen the carret is at a text input field, all text in that field is selected.
+it.ro.HelpBrowserMenu2-5:\Sselect all text on the current page, without the contents of text input fields.|MWhen the carret is at a text input field, all text in that field is selected.
+nl.ro.HelpBrowserMenu2-5:Klik met KIES om alle tekst op de pagina, uitgezonderd de invoervelden te selecteren.|MWanneer het inlasteken in een invoerveld staat, wordt alle tekst in het veld geselecteerd.
en.ro.HelpBrowserMenu3:\Rsee the navigation options.
de.ro.HelpBrowserMenu3:Untermenü Navigieren.
fr.ro.HelpBrowserMenu3:\Rvoir les options de navigation.
@@ -4168,7 +4178,11 @@ de.ro.HelpBrowserMenu4-1:Optionen zur Anzeige von Bildern.
fr.ro.HelpBrowserMenu4-1:\Rdéfinir les options d'images locales.
it.ro.HelpBrowserMenu4-1:\Rimposta le opzioni relative alle immagini locali.
nl.ro.HelpBrowserMenu4-1:Verplaats de muispijl naar rechts om de afbeeldingsmogelijkheden van dit browservenster aan te passen.
-#HelpBrowserMen43-1-0:\Stoggle the display of foreground images.
+en.ro.HelpBrowserMenu4-1-0:\Stoggle the display of foreground images.
+de.ro.HelpBrowserMenu4-1-0:\Stoggle the display of foreground images.
+fr.ro.HelpBrowserMenu4-1-0:\Stoggle the display of foreground images.
+it.ro.HelpBrowserMenu4-1-0:\Stoggle the display of foreground images.
+nl.ro.HelpBrowserMenu4-1-0:Klik met KIES om het tonen van voorgrondafbeeldingen aan of uit te zetten.
en.ro.HelpBrowserMenu4-1-1:\Stoggle the display of background images.
de.ro.HelpBrowserMenu4-1-1:Schaltet Hintergrundbilder ein/aus.
fr.ro.HelpBrowserMenu4-1-1:\Safficher ou pas des images de fond.
@@ -4199,16 +4213,11 @@ de.ro.HelpBrowserMenu4-2-2:Schaltet die Ladeaktivitätsanzeige am oberen Fenster
fr.ro.HelpBrowserMenu4-2-2:\Safficher le pulseur ou pas.|MLa barre d'URL utilise l'espace restant.
it.ro.HelpBrowserMenu4-2-2:\Salterna la visualizzazione del throbber.|MLa barra URL coprirà lo spazio eccedente.
nl.ro.HelpBrowserMenu4-2-2:Klik met KIES om het tonen van de (laad)Activiteitsindicator aan of uit te zetten.|MDe adresbalk gebruikt de overblijvende vrijkomende ruimte.
-en.ro.HelpBrowserMenu4-2-3:\Stoggle the display of the status bar.|MHorizontal scroll bar uses the remaining width.
-de.ro.HelpBrowserMenu4-2-3:Schaltet die Statusanzeige am unteren Fensterrand ein/aus.|MDie Länge des horizontalen Schiebebalkens wird angepaßt.
-fr.ro.HelpBrowserMenu4-2-3:\Safficher la barre d'état ou pas.|MLa barre de défilement horizontal utilise la largeur restante.
-it.ro.HelpBrowserMenu4-2-3:\Salterna la visualizzazione della barra di stato.|MLa barra di scrolling orizzontale coprirà la larghezza eccedente.
+en.ro.HelpBrowserMenu4-2-3:\Stoggle toolbar edit mode.
+de.ro.HelpBrowserMenu4-2-3:Schaltet in den Modus zur Bearbeitung der Iconleiste am oberen Fensterrand.
+fr.ro.HelpBrowserMenu4-2-3:\Schanger le mode d'édition de barre d'outils.
+it.ro.HelpBrowserMenu4-2-3:\Salterna la modalità di modifica della barra strumenti.
nl.ro.HelpBrowserMenu4-2-3:Klik met KIES om de aanpasmodus van de gereedschapbalk in of uit te schakelen. Wanneer ingeschakelt, verschijnt er een balk onder de gereedschapbalk met extra knoppen die van en naar deze balk gesleept kunnen worden om deze aan te passen.
-en.ro.HelpBrowserMenu4-2-4:\Stoggle toolbar edit mode.
-de.ro.HelpBrowserMenu4-2-4:Schaltet in den Modus zur Bearbeitung der Iconleiste am oberen Fensterrand.
-fr.ro.HelpBrowserMenu4-2-4:\Schanger le mode d'édition de barre d'outils.
-it.ro.HelpBrowserMenu4-2-4:\Salterna la modalità di modifica della barra strumenti.
-nl.ro.HelpBrowserMenu4-2-4:\Stoggle toolbar edit mode.
en.ro.HelpBrowserMenu4-3:\Scontrol the manner in which the display is rendered.
de.ro.HelpBrowserMenu4-3:Einstellungen zur Berechnung der Seitendarstellung.
fr.ro.HelpBrowserMenu4-3:\Scontroler la façon d'afficher.
@@ -4299,6 +4308,11 @@ de.ro.HelpBrowserMenu5-2-0:Anklicken um die gespeicherten Cookies anzusehen und
fr.ro.HelpBrowserMenu5-2-0:\Souvrir la fenêtre de gestion des cookies.
it.ro.HelpBrowserMenu5-2-0:\Sapri la finestra del gestore dei cookie
nl.ro.HelpBrowserMenu5-2-0:Klik met KIES om het cookiesbeheervenster te openen.
+en.ro.HelpBrowserMenu5-2-1:\Sdelete all stored cookies.
+de.ro.HelpBrowserMenu5-2-1:\Sdelete all stored cookies.
+fr.ro.HelpBrowserMenu5-2-1:\Sdelete all stored cookies.
+it.ro.HelpBrowserMenu5-2-1:\Sdelete all stored cookies.
+nl.ro.HelpBrowserMenu5-2-1:Klik met KIES om alle opgeslagen cookies te verwijderen.
en.ro.HelpBrowserMenu6:\Rsee the help resources available.
de.ro.HelpBrowserMenu6:Untermenü Hilfe.|MZeigt Informationen zu und über NetSurf.
fr.ro.HelpBrowserMenu6:\Rvoir l'aide disponible.
@@ -4345,7 +4359,7 @@ en.ro.HelpIconbar:\TNetSurf icon.|M\Sopen a new browser \w.|M\Aopen the hotlist
de.ro.HelpIconbar:Das ist das NetSurf Icon.|MKlicken mit AUSWAHL öffnet ein neues Browserfenster.|MKlicken mit SPEZIAL öffnet die Hotlist.
fr.ro.HelpIconbar:\Tl'icône de NetSurf.|M\Souvrir une nouvelle \w de navigateur.|M\Aouvrir la fenêtre de gestion des favoris.
it.ro.HelpIconbar:\TIcona di NetSurf.|M\Sapri una nuova finestra|M\Aapri la finestra del gestore dei segnalibri
-nl.ro.HelpIconbar:Dit is het NetSurf-symbool.|MKlik met KIES om een nieuw browservenster te openen.|MKlik met PASAAN om de favorietenlijst te openen.
+nl.ro.HelpIconbar:Dit is het symbool van het programma NetSurf.|MKlik met KIES om een nieuw browservenster te openen.|MKlik met PASAAN om de favorietenlijst te openen.
en.ro.HelpHistory:Use this \w to navigate around the local history tree.|M\Son a thumbnail to return to that page.
de.ro.HelpHistory:Die History zeigt alle in dieser Sitzung besuchten Seiten.|MKlicken mit AUSWAHL auf eine Symbolgrafik kehrt zurück zur jeweiligen Seite.
fr.ro.HelpHistory:Utiliser cette \w pour naviguer dans l'historique arborescent local.|M\Ssur une vignette pour revenir à cette page.
@@ -4399,37 +4413,21 @@ de.ro.HelpScaleView3:Klicken mit AUSWAHL um die Skalierung um 10% zu erhöhen.
fr.ro.HelpScaleView3:\Saugmenter l'échelle, par pas de 10%.
it.ro.HelpScaleView3:\Sincrementa la scala di un 10% alla volta.
nl.ro.HelpScaleView3:Klik met KIES om de schaal met 10% per keer te vergroten.
-en.ro.HelpScaleView5:\Sautomatically choose a scale of 75%.
-de.ro.HelpScaleView5:Stellt einen Skalierungswert von 75% ein.
-fr.ro.HelpScaleView5:\Sdirectement choisir une échelle de 75%.
-it.ro.HelpScaleView5:\Sscegli una scala automatica del 75%.
+en.ro.HelpScaleView5:Choose whether all frames will also be scaled.
+de.ro.HelpScaleView5:Choose whether all frames will also be scaled.
+fr.ro.HelpScaleView5:Choose whether all frames will also be scaled.
+it.ro.HelpScaleView5:Choose whether all frames will also be scaled.
nl.ro.HelpScaleView5:Selecteer de optie optie om ook de bijbehorende frames mee te schalen.
-en.ro.HelpScaleView6:\Sautomatically choose a scale of 100%.
-de.ro.HelpScaleView6:Stellt einen Skalierungswert von 100% ein.
-fr.ro.HelpScaleView6:\Sdirectement choisir une échelle de 100%.
-it.ro.HelpScaleView6:\Sscegli una scala automatica del 100%.
-nl.ro.HelpScaleView6:\Sautomatically choose a scale of 100%.
-en.ro.HelpScaleView7:\Sautomatically choose a scale of 150%.
-de.ro.HelpScaleView7:Stellt einen Skalierungswert von 150% ein.
-fr.ro.HelpScaleView7:\Sdirectement choisir une échelle de 150%.
-it.ro.HelpScaleView7:\Sscegli una scala automatica del 150%.
+en.ro.HelpScaleView7:\Scancel changes.|MThe current scale will not be changed.
+de.ro.HelpScaleView7:Klicken mit AUSWAHL um die Skalierung nicht durchzuführen.|MDas Dialogfenster wird geschlossen.|MDie Darstellung der Seite wird unverändert beibehalten.
+fr.ro.HelpScaleView7:\Sannuler les changements.|ML'échelle en cours ne sera pas modifiée.
+it.ro.HelpScaleView7:\Sannulla tutte le modifiche.|MLa corrente scala non verrà modificata.
nl.ro.HelpScaleView7:Klik met KIES om dit venster te sluiten zonder dat de gemaakte wijzigingen worden ingesteld.|MDeze schaal wordt niet gewijzigd.
-en.ro.HelpScaleView8:\Sautomatically choose a scale of 200%.
-de.ro.HelpScaleView8:Stellt einen Skalierungswert von 200% ein.
-fr.ro.HelpScaleView8:\Sdirectement choisir une échelle de 200%.
-it.ro.HelpScaleView8:\Sscegli una scala automatica del 200%.
+en.ro.HelpScaleView8:\Schange the view to the scale you have chosen.
+de.ro.HelpScaleView8:Klicken mit AUSWAHL um die Seite skaliert darzustellen.|MDie Seite wird in der gewählten Vergrößerung angezeigt.
+fr.ro.HelpScaleView8:\Svalider le changement d'échelle.
+it.ro.HelpScaleView8:\Smodifica la visualizzazione della scala prescelta.
nl.ro.HelpScaleView8:Klik met KIES om de gekozen schaal in te stellen op deze weergave en het venster sluiten.
-en.ro.HelpScaleView9:\Scancel changes.|MThe current scale will not be changed.
-de.ro.HelpScaleView9:Klicken mit AUSWAHL um die Skalierung nicht durchzuführen.|MDas Dialogfenster wird geschlossen.|MDie Darstellung der Seite wird unverändert beibehalten.
-fr.ro.HelpScaleView9:\Sannuler les changements.|ML'échelle en cours ne sera pas modifiée.
-it.ro.HelpScaleView9:\Sannulla tutte le modifiche.|MLa corrente scala non verrà modificata.
-nl.ro.HelpScaleView9:\Scancel changes.|MThe current scale will not be changed.
-en.ro.HelpScaleView10:\Schange the view to the scale you have chosen.
-de.ro.HelpScaleView10:Klicken mit AUSWAHL um die Seite skaliert darzustellen.|MDie Seite wird in der gewählten Vergrößerung angezeigt.
-fr.ro.HelpScaleView10:\Svalider le changement d'échelle.
-it.ro.HelpScaleView10:\Smodifica la visualizzazione della scala prescelta.
-nl.ro.HelpScaleView10:\Schange the view to the scale you have chosen.
-
en.ro.HelpSearch:Use this \w to search for text within the page.
de.ro.HelpSearch:Dialogfenster zum Suchen von Text innerhalb der dargestellten Seite.
fr.ro.HelpSearch:Utiliser cette fenêtre pour faire une recherche textuelle sur cette page.
@@ -5127,7 +5125,7 @@ en.ro.HelpContentConfig4:This indicates whether NetSurf will allow external plug
de.ro.HelpContentConfig4:Stellt ein, ob externe Pluginroutinen genutzt werden dürfen, um Zusatzinhalte darzustellen (z.B. Flash).
fr.ro.HelpContentConfig4:Ceci indique si Netsurf doit autoriser les plug-ins externes à manipuler des types de contenu supplémentaires, comme le Flash.
it.ro.HelpContentConfig4:This indicates whether NetSurf will allow external plug-ins to handle additional types of content, such as Flash.
-nl.ro.HelpContentConfig4:This indicates whether NetSurf will allow external plug-ins to handle additional types of content, such as Flash.
+nl.ro.HelpContentConfig4:Deze optie geeft aan of NetSurf externe plug-ins, voor aanvullende soorten inhoud zoals Flash toestaat.
en.ro.HelpContentConfig7:This indicates whether NetSurf will allow links to open in new windows.
de.ro.HelpContentConfig7:Stellt ein, ob NetSurf erlaubt, daß Links beim Aufruf neue Browserfenster öffnen dürfen.
fr.ro.HelpContentConfig7:This indicates whether NetSurf will allow links to open in new windows.
@@ -5148,7 +5146,11 @@ de.ro.HelpContentConfig10:Klicken mit AUSWAHL speichert die Einstellungen und sc
fr.ro.HelpContentConfig10:\Ssauver ces réglages et fermer la fenêtre.|M\Asauver ces réglages sans fermer la fenêtre.
it.ro.HelpContentConfig10:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
nl.ro.HelpContentConfig10:Klik met KIES om de gemaakte wijzigingen te bewaren en dit venster te sluiten.|MKlikken met PASAAN heeft hetzelfde effect, alleen wordt het huidige venster dan niet gesloten.
-
+en.ro.HelpContentConfig11:This indicates whether NetSurf will disable executing JavaScript.
+de.ro.HelpContentConfig11:This indicates whether NetSurf will disable executing JavaScript.
+fr.ro.HelpContentConfig11:This indicates whether NetSurf will disable executing JavaScript.
+it.ro.HelpContentConfig11:This indicates whether NetSurf will disable executing JavaScript.
+nl.ro.HelpContentConfig11:Deze optie geeft aan of het uitvoeren van JavaScript-scripts is uitgeschakeld.
en.ro.HelpFontConfig:\Tfont configuration \w
de.ro.HelpFontConfig:Konfigurationsfenster zur Einstellung der verwendeten Schriftarten
fr.ro.HelpFontConfig:\Tla fenêtre de configuration de Fontes
@@ -5820,7 +5822,7 @@ en.all.Fetching:Fetching
de.all.Fetching:Fetching
fr.all.Fetching:Connexion
it.all.Fetching:Ricezione
-nl.all.Fetching:Fetching
+nl.all.Fetching:ophalen
en.all.FetchesMax:Maximum fetches
de.all.FetchesMax:Maximale Anzahl an Ladevorgängen
fr.all.FetchesMax:Maximum de connexions
diff --git a/riscos/templates/nl b/riscos/templates/nl
index ab51d0d..a1474f8 100644
--- a/riscos/templates/nl
+++ b/riscos/templates/nl
@@ -1506,7 +1506,7 @@ wimp_window {
wimp_window {
template_name:"info"
- visible:752,324,1412,700
+ visible:752,332,1412,700
xscroll:0
yscroll:0
next:wimp_TOP
@@ -1519,7 +1519,7 @@ wimp_window {
scroll_inner:wimp_COLOUR_ORANGE
highlight_bg:wimp_COLOUR_LIGHT_GREY
extra_flags:
- extent:0,-376,660,0
+ extent:0,-368,660,0
title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED
work_flags:wimp_BUTTON_CLICK
sprite_area:&1
@@ -1567,7 +1567,7 @@ wimp_window {
text.validation:"R2"
}
wimp_icon {
- extent:168,-368,652,-316
+ extent:168,-360,652,-308
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK_DRAG
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -1601,7 +1601,7 @@ wimp_window {
text_only:"Auteurs"
}
wimp_icon {
- extent:40,-364,164,-320
+ extent:40,-356,164,-312
icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -1609,24 +1609,42 @@ wimp_window {
text_only:"Versie"
}
wimp_icon {
- extent:168,-308,652,-188
+ extent:168,-300,652,-248
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK_DRAG
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"G. van Katwijk & D. Tanis g.vankatwijk(a)freeler.nl"
+ text.text:"g.vankatwijk(a)freeler.nl"
text.size:50
- text.validation:"R2;L"
+ text.validation:"R2"
}
wimp_icon {
- extent:0,-304,164,-192
+ extent:8,-296,164,-252
icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_ICON_RJUSTIFIED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Vertaling & contact"
+ text.text:"Contact"
text.size:20
- text.validation:"L"
+ text.validation:""
+ }
+ wimp_icon {
+ extent:168,-240,652,-188
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK_DRAG
+ icon_esg:0
+ icon_fg:wimp_COLOUR_BLACK
+ icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
+ text.text:"NetSurf-vertalers"
+ text.size:40
+ text.validation:"R2"
+ }
+ wimp_icon {
+ extent:4,-236,164,-192
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
+ icon_esg:0
+ icon_fg:wimp_COLOUR_BLACK
+ icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
+ text_only:"Vertaling"
}
}
@@ -2091,8 +2109,8 @@ wimp_window {
sprite_area:&1
xmin:792
ymin:248
- text.text:"Documentinfo"
- text.size:13
+ text.text:"Documentinformatie"
+ text.size:19
text.validation:""
wimp_icon {
extent:208,-60,784,-8
-----------------------------------------------------------------------
Summary of changes:
!NetSurf/Resources/nl/licence.html,faf | 2 +-
resources/FatMessages | 88 ++++++++++++++++----------------
riscos/templates/nl | 42 ++++++++++-----
3 files changed, 76 insertions(+), 56 deletions(-)
diff --git a/!NetSurf/Resources/nl/licence.html,faf b/!NetSurf/Resources/nl/licence.html,faf
index ff4af5d..d0c1650 100644
--- a/!NetSurf/Resources/nl/licence.html,faf
+++ b/!NetSurf/Resources/nl/licence.html,faf
@@ -195,7 +195,7 @@ Graham Shaw, James Bursa and John-Mark Bell.</span>
</dd>
</dl>
-<h2>Licentie-teksten</h2>
+<h2>Licentieteksten</h2>
<p>Waar mogelijk zijn hieronder de algemeen geldende licentieteksten van de
verschillende NetSurf-onderdelen opgenomen. Bij sommige onderdelen kan de
diff --git a/resources/FatMessages b/resources/FatMessages
index f018626..5ecb751 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -911,7 +911,7 @@ en.all.Link:Link
de.all.Link:Link
fr.all.Link:Lien
it.all.Link:Link
-nl.all.Link:Link
+nl.all.Link:Koppeling
en.all.LinkNewTab:Open in new tab
de.all.LinkNewTab:Öffnen in Tab
fr.all.LinkNewTab:Ouvrir dans un nouvel onglet
@@ -4118,6 +4118,16 @@ de.ro.HelpBrowserMenu2-3:Text aus dem Clipboard einfügen.
fr.ro.HelpBrowserMenu2-3:\Spaste text from the clipboard.
it.ro.HelpBrowserMenu2-3:\Sincolla il testo dalla clipboard
nl.ro.HelpBrowserMenu2-3:Klik met KIES om de tekst van het klembord hier in te voegen.
+en.ro.HelpBrowserMenu2-4:\Sdeselect the current selection.
+de.ro.HelpBrowserMenu2-4:\Sdeselect the current selection.
+fr.ro.HelpBrowserMenu2-4:\Sdeselect the current selection.
+it.ro.HelpBrowserMenu2-4:\Sdeselect the current selection.
+nl.ro.HelpBrowserMenu2-4:Klik met KIES om de gekozen selectie te deselecteren.
+en.ro.HelpBrowserMenu2-5:\Sselect all text on the current page, without the contents of text input fields.|MWhen the carret is at a text input field, all text in that field is selected.
+de.ro.HelpBrowserMenu2-5:\Sselect all text on the current page, without the contents of text input fields.|MWhen the carret is at a text input field, all text in that field is selected.
+fr.ro.HelpBrowserMenu2-5:\Sselect all text on the current page, without the contents of text input fields.|MWhen the carret is at a text input field, all text in that field is selected.
+it.ro.HelpBrowserMenu2-5:\Sselect all text on the current page, without the contents of text input fields.|MWhen the carret is at a text input field, all text in that field is selected.
+nl.ro.HelpBrowserMenu2-5:Klik met KIES om alle tekst op de pagina, uitgezonderd de invoervelden te selecteren.|MWanneer het inlasteken in een invoerveld staat, wordt alle tekst in het veld geselecteerd.
en.ro.HelpBrowserMenu3:\Rsee the navigation options.
de.ro.HelpBrowserMenu3:Untermenü Navigieren.
fr.ro.HelpBrowserMenu3:\Rvoir les options de navigation.
@@ -4168,7 +4178,11 @@ de.ro.HelpBrowserMenu4-1:Optionen zur Anzeige von Bildern.
fr.ro.HelpBrowserMenu4-1:\Rdéfinir les options d'images locales.
it.ro.HelpBrowserMenu4-1:\Rimposta le opzioni relative alle immagini locali.
nl.ro.HelpBrowserMenu4-1:Verplaats de muispijl naar rechts om de afbeeldingsmogelijkheden van dit browservenster aan te passen.
-#HelpBrowserMen43-1-0:\Stoggle the display of foreground images.
+en.ro.HelpBrowserMenu4-1-0:\Stoggle the display of foreground images.
+de.ro.HelpBrowserMenu4-1-0:\Stoggle the display of foreground images.
+fr.ro.HelpBrowserMenu4-1-0:\Stoggle the display of foreground images.
+it.ro.HelpBrowserMenu4-1-0:\Stoggle the display of foreground images.
+nl.ro.HelpBrowserMenu4-1-0:Klik met KIES om het tonen van voorgrondafbeeldingen aan of uit te zetten.
en.ro.HelpBrowserMenu4-1-1:\Stoggle the display of background images.
de.ro.HelpBrowserMenu4-1-1:Schaltet Hintergrundbilder ein/aus.
fr.ro.HelpBrowserMenu4-1-1:\Safficher ou pas des images de fond.
@@ -4199,16 +4213,11 @@ de.ro.HelpBrowserMenu4-2-2:Schaltet die Ladeaktivitätsanzeige am oberen Fenster
fr.ro.HelpBrowserMenu4-2-2:\Safficher le pulseur ou pas.|MLa barre d'URL utilise l'espace restant.
it.ro.HelpBrowserMenu4-2-2:\Salterna la visualizzazione del throbber.|MLa barra URL coprirà lo spazio eccedente.
nl.ro.HelpBrowserMenu4-2-2:Klik met KIES om het tonen van de (laad)Activiteitsindicator aan of uit te zetten.|MDe adresbalk gebruikt de overblijvende vrijkomende ruimte.
-en.ro.HelpBrowserMenu4-2-3:\Stoggle the display of the status bar.|MHorizontal scroll bar uses the remaining width.
-de.ro.HelpBrowserMenu4-2-3:Schaltet die Statusanzeige am unteren Fensterrand ein/aus.|MDie Länge des horizontalen Schiebebalkens wird angepaßt.
-fr.ro.HelpBrowserMenu4-2-3:\Safficher la barre d'état ou pas.|MLa barre de défilement horizontal utilise la largeur restante.
-it.ro.HelpBrowserMenu4-2-3:\Salterna la visualizzazione della barra di stato.|MLa barra di scrolling orizzontale coprirà la larghezza eccedente.
+en.ro.HelpBrowserMenu4-2-3:\Stoggle toolbar edit mode.
+de.ro.HelpBrowserMenu4-2-3:Schaltet in den Modus zur Bearbeitung der Iconleiste am oberen Fensterrand.
+fr.ro.HelpBrowserMenu4-2-3:\Schanger le mode d'édition de barre d'outils.
+it.ro.HelpBrowserMenu4-2-3:\Salterna la modalità di modifica della barra strumenti.
nl.ro.HelpBrowserMenu4-2-3:Klik met KIES om de aanpasmodus van de gereedschapbalk in of uit te schakelen. Wanneer ingeschakelt, verschijnt er een balk onder de gereedschapbalk met extra knoppen die van en naar deze balk gesleept kunnen worden om deze aan te passen.
-en.ro.HelpBrowserMenu4-2-4:\Stoggle toolbar edit mode.
-de.ro.HelpBrowserMenu4-2-4:Schaltet in den Modus zur Bearbeitung der Iconleiste am oberen Fensterrand.
-fr.ro.HelpBrowserMenu4-2-4:\Schanger le mode d'édition de barre d'outils.
-it.ro.HelpBrowserMenu4-2-4:\Salterna la modalità di modifica della barra strumenti.
-nl.ro.HelpBrowserMenu4-2-4:\Stoggle toolbar edit mode.
en.ro.HelpBrowserMenu4-3:\Scontrol the manner in which the display is rendered.
de.ro.HelpBrowserMenu4-3:Einstellungen zur Berechnung der Seitendarstellung.
fr.ro.HelpBrowserMenu4-3:\Scontroler la façon d'afficher.
@@ -4299,6 +4308,11 @@ de.ro.HelpBrowserMenu5-2-0:Anklicken um die gespeicherten Cookies anzusehen und
fr.ro.HelpBrowserMenu5-2-0:\Souvrir la fenêtre de gestion des cookies.
it.ro.HelpBrowserMenu5-2-0:\Sapri la finestra del gestore dei cookie
nl.ro.HelpBrowserMenu5-2-0:Klik met KIES om het cookiesbeheervenster te openen.
+en.ro.HelpBrowserMenu5-2-1:\Sdelete all stored cookies.
+de.ro.HelpBrowserMenu5-2-1:\Sdelete all stored cookies.
+fr.ro.HelpBrowserMenu5-2-1:\Sdelete all stored cookies.
+it.ro.HelpBrowserMenu5-2-1:\Sdelete all stored cookies.
+nl.ro.HelpBrowserMenu5-2-1:Klik met KIES om alle opgeslagen cookies te verwijderen.
en.ro.HelpBrowserMenu6:\Rsee the help resources available.
de.ro.HelpBrowserMenu6:Untermenü Hilfe.|MZeigt Informationen zu und über NetSurf.
fr.ro.HelpBrowserMenu6:\Rvoir l'aide disponible.
@@ -4345,7 +4359,7 @@ en.ro.HelpIconbar:\TNetSurf icon.|M\Sopen a new browser \w.|M\Aopen the hotlist
de.ro.HelpIconbar:Das ist das NetSurf Icon.|MKlicken mit AUSWAHL öffnet ein neues Browserfenster.|MKlicken mit SPEZIAL öffnet die Hotlist.
fr.ro.HelpIconbar:\Tl'icône de NetSurf.|M\Souvrir une nouvelle \w de navigateur.|M\Aouvrir la fenêtre de gestion des favoris.
it.ro.HelpIconbar:\TIcona di NetSurf.|M\Sapri una nuova finestra|M\Aapri la finestra del gestore dei segnalibri
-nl.ro.HelpIconbar:Dit is het NetSurf-symbool.|MKlik met KIES om een nieuw browservenster te openen.|MKlik met PASAAN om de favorietenlijst te openen.
+nl.ro.HelpIconbar:Dit is het symbool van het programma NetSurf.|MKlik met KIES om een nieuw browservenster te openen.|MKlik met PASAAN om de favorietenlijst te openen.
en.ro.HelpHistory:Use this \w to navigate around the local history tree.|M\Son a thumbnail to return to that page.
de.ro.HelpHistory:Die History zeigt alle in dieser Sitzung besuchten Seiten.|MKlicken mit AUSWAHL auf eine Symbolgrafik kehrt zurück zur jeweiligen Seite.
fr.ro.HelpHistory:Utiliser cette \w pour naviguer dans l'historique arborescent local.|M\Ssur une vignette pour revenir à cette page.
@@ -4399,37 +4413,21 @@ de.ro.HelpScaleView3:Klicken mit AUSWAHL um die Skalierung um 10% zu erhöhen.
fr.ro.HelpScaleView3:\Saugmenter l'échelle, par pas de 10%.
it.ro.HelpScaleView3:\Sincrementa la scala di un 10% alla volta.
nl.ro.HelpScaleView3:Klik met KIES om de schaal met 10% per keer te vergroten.
-en.ro.HelpScaleView5:\Sautomatically choose a scale of 75%.
-de.ro.HelpScaleView5:Stellt einen Skalierungswert von 75% ein.
-fr.ro.HelpScaleView5:\Sdirectement choisir une échelle de 75%.
-it.ro.HelpScaleView5:\Sscegli una scala automatica del 75%.
+en.ro.HelpScaleView5:Choose whether all frames will also be scaled.
+de.ro.HelpScaleView5:Choose whether all frames will also be scaled.
+fr.ro.HelpScaleView5:Choose whether all frames will also be scaled.
+it.ro.HelpScaleView5:Choose whether all frames will also be scaled.
nl.ro.HelpScaleView5:Selecteer de optie optie om ook de bijbehorende frames mee te schalen.
-en.ro.HelpScaleView6:\Sautomatically choose a scale of 100%.
-de.ro.HelpScaleView6:Stellt einen Skalierungswert von 100% ein.
-fr.ro.HelpScaleView6:\Sdirectement choisir une échelle de 100%.
-it.ro.HelpScaleView6:\Sscegli una scala automatica del 100%.
-nl.ro.HelpScaleView6:\Sautomatically choose a scale of 100%.
-en.ro.HelpScaleView7:\Sautomatically choose a scale of 150%.
-de.ro.HelpScaleView7:Stellt einen Skalierungswert von 150% ein.
-fr.ro.HelpScaleView7:\Sdirectement choisir une échelle de 150%.
-it.ro.HelpScaleView7:\Sscegli una scala automatica del 150%.
+en.ro.HelpScaleView7:\Scancel changes.|MThe current scale will not be changed.
+de.ro.HelpScaleView7:Klicken mit AUSWAHL um die Skalierung nicht durchzuführen.|MDas Dialogfenster wird geschlossen.|MDie Darstellung der Seite wird unverändert beibehalten.
+fr.ro.HelpScaleView7:\Sannuler les changements.|ML'échelle en cours ne sera pas modifiée.
+it.ro.HelpScaleView7:\Sannulla tutte le modifiche.|MLa corrente scala non verrà modificata.
nl.ro.HelpScaleView7:Klik met KIES om dit venster te sluiten zonder dat de gemaakte wijzigingen worden ingesteld.|MDeze schaal wordt niet gewijzigd.
-en.ro.HelpScaleView8:\Sautomatically choose a scale of 200%.
-de.ro.HelpScaleView8:Stellt einen Skalierungswert von 200% ein.
-fr.ro.HelpScaleView8:\Sdirectement choisir une échelle de 200%.
-it.ro.HelpScaleView8:\Sscegli una scala automatica del 200%.
+en.ro.HelpScaleView8:\Schange the view to the scale you have chosen.
+de.ro.HelpScaleView8:Klicken mit AUSWAHL um die Seite skaliert darzustellen.|MDie Seite wird in der gewählten Vergrößerung angezeigt.
+fr.ro.HelpScaleView8:\Svalider le changement d'échelle.
+it.ro.HelpScaleView8:\Smodifica la visualizzazione della scala prescelta.
nl.ro.HelpScaleView8:Klik met KIES om de gekozen schaal in te stellen op deze weergave en het venster sluiten.
-en.ro.HelpScaleView9:\Scancel changes.|MThe current scale will not be changed.
-de.ro.HelpScaleView9:Klicken mit AUSWAHL um die Skalierung nicht durchzuführen.|MDas Dialogfenster wird geschlossen.|MDie Darstellung der Seite wird unverändert beibehalten.
-fr.ro.HelpScaleView9:\Sannuler les changements.|ML'échelle en cours ne sera pas modifiée.
-it.ro.HelpScaleView9:\Sannulla tutte le modifiche.|MLa corrente scala non verrà modificata.
-nl.ro.HelpScaleView9:\Scancel changes.|MThe current scale will not be changed.
-en.ro.HelpScaleView10:\Schange the view to the scale you have chosen.
-de.ro.HelpScaleView10:Klicken mit AUSWAHL um die Seite skaliert darzustellen.|MDie Seite wird in der gewählten Vergrößerung angezeigt.
-fr.ro.HelpScaleView10:\Svalider le changement d'échelle.
-it.ro.HelpScaleView10:\Smodifica la visualizzazione della scala prescelta.
-nl.ro.HelpScaleView10:\Schange the view to the scale you have chosen.
-
en.ro.HelpSearch:Use this \w to search for text within the page.
de.ro.HelpSearch:Dialogfenster zum Suchen von Text innerhalb der dargestellten Seite.
fr.ro.HelpSearch:Utiliser cette fenêtre pour faire une recherche textuelle sur cette page.
@@ -5127,7 +5125,7 @@ en.ro.HelpContentConfig4:This indicates whether NetSurf will allow external plug
de.ro.HelpContentConfig4:Stellt ein, ob externe Pluginroutinen genutzt werden dürfen, um Zusatzinhalte darzustellen (z.B. Flash).
fr.ro.HelpContentConfig4:Ceci indique si Netsurf doit autoriser les plug-ins externes à manipuler des types de contenu supplémentaires, comme le Flash.
it.ro.HelpContentConfig4:This indicates whether NetSurf will allow external plug-ins to handle additional types of content, such as Flash.
-nl.ro.HelpContentConfig4:This indicates whether NetSurf will allow external plug-ins to handle additional types of content, such as Flash.
+nl.ro.HelpContentConfig4:Deze optie geeft aan of NetSurf externe plug-ins, voor aanvullende soorten inhoud zoals Flash toestaat.
en.ro.HelpContentConfig7:This indicates whether NetSurf will allow links to open in new windows.
de.ro.HelpContentConfig7:Stellt ein, ob NetSurf erlaubt, daß Links beim Aufruf neue Browserfenster öffnen dürfen.
fr.ro.HelpContentConfig7:This indicates whether NetSurf will allow links to open in new windows.
@@ -5148,7 +5146,11 @@ de.ro.HelpContentConfig10:Klicken mit AUSWAHL speichert die Einstellungen und sc
fr.ro.HelpContentConfig10:\Ssauver ces réglages et fermer la fenêtre.|M\Asauver ces réglages sans fermer la fenêtre.
it.ro.HelpContentConfig10:\Ssave these settings and close the \w.|M\Asave these settings without closing the \w.
nl.ro.HelpContentConfig10:Klik met KIES om de gemaakte wijzigingen te bewaren en dit venster te sluiten.|MKlikken met PASAAN heeft hetzelfde effect, alleen wordt het huidige venster dan niet gesloten.
-
+en.ro.HelpContentConfig11:This indicates whether NetSurf will disable executing JavaScript.
+de.ro.HelpContentConfig11:This indicates whether NetSurf will disable executing JavaScript.
+fr.ro.HelpContentConfig11:This indicates whether NetSurf will disable executing JavaScript.
+it.ro.HelpContentConfig11:This indicates whether NetSurf will disable executing JavaScript.
+nl.ro.HelpContentConfig11:Deze optie geeft aan of het uitvoeren van JavaScript-scripts is uitgeschakeld.
en.ro.HelpFontConfig:\Tfont configuration \w
de.ro.HelpFontConfig:Konfigurationsfenster zur Einstellung der verwendeten Schriftarten
fr.ro.HelpFontConfig:\Tla fenêtre de configuration de Fontes
@@ -5820,7 +5822,7 @@ en.all.Fetching:Fetching
de.all.Fetching:Fetching
fr.all.Fetching:Connexion
it.all.Fetching:Ricezione
-nl.all.Fetching:Fetching
+nl.all.Fetching:ophalen
en.all.FetchesMax:Maximum fetches
de.all.FetchesMax:Maximale Anzahl an Ladevorgängen
fr.all.FetchesMax:Maximum de connexions
diff --git a/riscos/templates/nl b/riscos/templates/nl
index ab51d0d..a1474f8 100644
--- a/riscos/templates/nl
+++ b/riscos/templates/nl
@@ -1506,7 +1506,7 @@ wimp_window {
wimp_window {
template_name:"info"
- visible:752,324,1412,700
+ visible:752,332,1412,700
xscroll:0
yscroll:0
next:wimp_TOP
@@ -1519,7 +1519,7 @@ wimp_window {
scroll_inner:wimp_COLOUR_ORANGE
highlight_bg:wimp_COLOUR_LIGHT_GREY
extra_flags:
- extent:0,-376,660,0
+ extent:0,-368,660,0
title_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED
work_flags:wimp_BUTTON_CLICK
sprite_area:&1
@@ -1567,7 +1567,7 @@ wimp_window {
text.validation:"R2"
}
wimp_icon {
- extent:168,-368,652,-316
+ extent:168,-360,652,-308
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK_DRAG
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -1601,7 +1601,7 @@ wimp_window {
text_only:"Auteurs"
}
wimp_icon {
- extent:40,-364,164,-320
+ extent:40,-356,164,-312
icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
@@ -1609,24 +1609,42 @@ wimp_window {
text_only:"Versie"
}
wimp_icon {
- extent:168,-308,652,-188
+ extent:168,-300,652,-248
icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK_DRAG
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"G. van Katwijk & D. Tanis g.vankatwijk(a)freeler.nl"
+ text.text:"g.vankatwijk(a)freeler.nl"
text.size:50
- text.validation:"R2;L"
+ text.validation:"R2"
}
wimp_icon {
- extent:0,-304,164,-192
+ extent:8,-296,164,-252
icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_INDIRECTED | wimp_ICON_RJUSTIFIED
icon_esg:0
icon_fg:wimp_COLOUR_BLACK
icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
- text.text:"Vertaling & contact"
+ text.text:"Contact"
text.size:20
- text.validation:"L"
+ text.validation:""
+ }
+ wimp_icon {
+ extent:168,-240,652,-188
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_BORDER | wimp_ICON_HCENTRED | wimp_ICON_VCENTRED | wimp_ICON_FILLED | wimp_ICON_INDIRECTED | wimp_BUTTON_CLICK_DRAG
+ icon_esg:0
+ icon_fg:wimp_COLOUR_BLACK
+ icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
+ text.text:"NetSurf-vertalers"
+ text.size:40
+ text.validation:"R2"
+ }
+ wimp_icon {
+ extent:4,-236,164,-192
+ icon_flags:wimp_ICON_TEXT | wimp_ICON_VCENTRED | wimp_ICON_RJUSTIFIED
+ icon_esg:0
+ icon_fg:wimp_COLOUR_BLACK
+ icon_bg:wimp_COLOUR_VERY_LIGHT_GREY
+ text_only:"Vertaling"
}
}
@@ -2091,8 +2109,8 @@ wimp_window {
sprite_area:&1
xmin:792
ymin:248
- text.text:"Documentinfo"
- text.size:13
+ text.text:"Documentinformatie"
+ text.size:19
text.validation:""
wimp_icon {
extent:208,-60,784,-8
--
NetSurf Browser
8 years, 5 months
netsurf: branch master updated. release/3.3-25-g729cd91
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/729cd9134bc3f959a4617...
...commit http://git.netsurf-browser.org/netsurf.git/commit/729cd9134bc3f959a46179f...
...tree http://git.netsurf-browser.org/netsurf.git/tree/729cd9134bc3f959a46179f91...
The branch, master has been updated
via 729cd9134bc3f959a46179f91876894b88bf6819 (commit)
from 81f6cd2074f76f3e976537453be18b6f34f1ab7f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=729cd9134bc3f959a46...
commit 729cd9134bc3f959a46179f91876894b88bf6819
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Switch the English and French "fetches per host" text to the correct languages.
diff --git a/resources/FatMessages b/resources/FatMessages
index 5902128..f018626 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -5826,9 +5826,9 @@ de.all.FetchesMax:Maximale Anzahl an Ladevorgängen
fr.all.FetchesMax:Maximum de connexions
it.all.FetchesMax:Massima
nl.all.FetchesMax:Maximaal aantal keer ophalen
-en.all.FetchesHost:Connexions par hôte
+en.all.FetchesHost:Fetches per host
de.all.FetchesHost:Ladevorgänge pro Host
-fr.all.FetchesHost:Fetches per host
+fr.all.FetchesHost:Connexions par hôte
it.all.FetchesHost:Per host
nl.all.FetchesHost:Fetches per host
en.all.FetchesCached:Cached connections
-----------------------------------------------------------------------
Summary of changes:
resources/FatMessages | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/resources/FatMessages b/resources/FatMessages
index 5902128..f018626 100644
--- a/resources/FatMessages
+++ b/resources/FatMessages
@@ -5826,9 +5826,9 @@ de.all.FetchesMax:Maximale Anzahl an Ladevorgängen
fr.all.FetchesMax:Maximum de connexions
it.all.FetchesMax:Massima
nl.all.FetchesMax:Maximaal aantal keer ophalen
-en.all.FetchesHost:Connexions par hôte
+en.all.FetchesHost:Fetches per host
de.all.FetchesHost:Ladevorgänge pro Host
-fr.all.FetchesHost:Fetches per host
+fr.all.FetchesHost:Connexions par hôte
it.all.FetchesHost:Per host
nl.all.FetchesHost:Fetches per host
en.all.FetchesCached:Cached connections
--
NetSurf Browser
8 years, 5 months
netsurf: branch master updated. release/3.3-24-g81f6cd2
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/81f6cd2074f76f3e97653...
...commit http://git.netsurf-browser.org/netsurf.git/commit/81f6cd2074f76f3e9765374...
...tree http://git.netsurf-browser.org/netsurf.git/tree/81f6cd2074f76f3e976537453...
The branch, master has been updated
via 81f6cd2074f76f3e976537453be18b6f34f1ab7f (commit)
from c0469ca905ef699fef36b02c058a21fed821d564 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=81f6cd2074f76f3e976...
commit 81f6cd2074f76f3e976537453be18b6f34f1ab7f
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Correct the screen depth check for setting friend bitmaps.
Add some comments because using friend bitmaps in NetSurf causes problems under OS4.
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 256f477..899ec49 100644
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -121,6 +121,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
gg->tmprasbuf = AllocVecTagList(width * height, NULL);
#ifndef __amigaos4__
+ /* If you're wondering why this is #ifdeffed, see the note about OS4 friend bitmaps below */
friend = scrn->RastPort.BitMap;
#endif
@@ -128,7 +129,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
gg->bm = AllocBitMap(width, height, depth, 0, friend);
} else {
#ifdef __amigaos4__
- if(depth == 32) friend = scrn->RastPort.BitMap;
+ /* Screen depth is reported as 24 even when it's actually 32-bit.
+ * We get freezes and other problems on OS4 if we befriend at any
+ * other depths, hence this check. */
+ if(depth >= 24) friend = scrn->RastPort.BitMap;
#endif
gg->bm = ami_rtg_allocbitmap(width, height, 32, 0, friend, RGBFB_A8R8G8B8);
}
-----------------------------------------------------------------------
Summary of changes:
amiga/plotters.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 256f477..899ec49 100644
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -121,6 +121,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
gg->tmprasbuf = AllocVecTagList(width * height, NULL);
#ifndef __amigaos4__
+ /* If you're wondering why this is #ifdeffed, see the note about OS4 friend bitmaps below */
friend = scrn->RastPort.BitMap;
#endif
@@ -128,7 +129,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
gg->bm = AllocBitMap(width, height, depth, 0, friend);
} else {
#ifdef __amigaos4__
- if(depth == 32) friend = scrn->RastPort.BitMap;
+ /* Screen depth is reported as 24 even when it's actually 32-bit.
+ * We get freezes and other problems on OS4 if we befriend at any
+ * other depths, hence this check. */
+ if(depth >= 24) friend = scrn->RastPort.BitMap;
#endif
gg->bm = ami_rtg_allocbitmap(width, height, 32, 0, friend, RGBFB_A8R8G8B8);
}
--
NetSurf Browser
8 years, 5 months
netsurf: branch master updated. release/3.3-23-gc0469ca
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/c0469ca905ef699fef36b...
...commit http://git.netsurf-browser.org/netsurf.git/commit/c0469ca905ef699fef36b02...
...tree http://git.netsurf-browser.org/netsurf.git/tree/c0469ca905ef699fef36b02c0...
The branch, master has been updated
via c0469ca905ef699fef36b02c058a21fed821d564 (commit)
from e62db5a49cbd7c8786a1b88617e5629ad0d0f64e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c0469ca905ef699fef3...
commit c0469ca905ef699fef36b02c058a21fed821d564
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
pass a url info the RISC OS object info preparation
The target url was previously being passed as a string derived from
nsurl_access which was asserting if the target_url was NULL. The nsurl
is now passed and a null check performed before attempting to access
it.
Closes #2298
diff --git a/riscos/window.c b/riscos/window.c
index 05e9292..fae7566 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -126,7 +126,7 @@ static bool ro_gui_window_content_export_types(hlcache_handle *h,
bool *export_draw, bool *export_sprite);
static void ro_gui_window_prepare_pageinfo(struct gui_window *g);
static void ro_gui_window_prepare_objectinfo(hlcache_handle *object,
- const char *href);
+ nsurl *target_url);
static void ro_gui_window_launch_url(struct gui_window *g, const char *url);
static void ro_gui_window_action_home(struct gui_window *g);
@@ -2443,7 +2443,7 @@ void ro_gui_window_menu_warning(wimp_w w, wimp_i i, wimp_menu *menu,
case BROWSER_OBJECT_INFO:
if (current_menu_object != NULL)
ro_gui_window_prepare_objectinfo(current_menu_object,
- nsurl_access(current_menu_url));
+ current_menu_url);
break;
case BROWSER_OBJECT_SAVE:
@@ -2758,7 +2758,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
case BROWSER_OBJECT_INFO:
if (current_menu_object != NULL) {
ro_gui_window_prepare_objectinfo(current_menu_object,
- nsurl_access(current_menu_url));
+ current_menu_url);
ro_gui_dialog_open_persistent(g->window,
dialog_objinfo, false);
}
@@ -3854,28 +3854,30 @@ void ro_gui_window_prepare_pageinfo(struct gui_window *g)
* Prepare the object info window for use
*
* \param *object the object for which information is to be displayed
- * \param *href corresponding href, if any
+ * \param *target_url corresponding url, if any
*/
-void ro_gui_window_prepare_objectinfo(hlcache_handle *object, const char *href)
+void ro_gui_window_prepare_objectinfo(hlcache_handle *object, nsurl *target_url)
{
char icon_buf[20] = "file_xxx";
const char *url;
lwc_string *mime;
const char *target = "-";
- sprintf(icon_buf, "file_%.3x",
- ro_content_filetype(object));
- if (!ro_gui_wimp_sprite_exists(icon_buf))
+ sprintf(icon_buf, "file_%.3x",ro_content_filetype(object));
+ if (!ro_gui_wimp_sprite_exists(icon_buf)) {
sprintf(icon_buf, "file_xxx");
+ }
url = nsurl_access(hlcache_handle_get_url(object));
- if (url == NULL)
+ if (url == NULL) {
url = "-";
+ }
mime = content_get_mime_type(object);
- if (href)
- target = href;
+ if (target_url != NULL) {
+ target = nsurl_access(target_url);
+ }
ro_gui_set_icon_string(dialog_objinfo, ICON_OBJINFO_ICON,
icon_buf, true);
-----------------------------------------------------------------------
Summary of changes:
riscos/window.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/riscos/window.c b/riscos/window.c
index 05e9292..fae7566 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -126,7 +126,7 @@ static bool ro_gui_window_content_export_types(hlcache_handle *h,
bool *export_draw, bool *export_sprite);
static void ro_gui_window_prepare_pageinfo(struct gui_window *g);
static void ro_gui_window_prepare_objectinfo(hlcache_handle *object,
- const char *href);
+ nsurl *target_url);
static void ro_gui_window_launch_url(struct gui_window *g, const char *url);
static void ro_gui_window_action_home(struct gui_window *g);
@@ -2443,7 +2443,7 @@ void ro_gui_window_menu_warning(wimp_w w, wimp_i i, wimp_menu *menu,
case BROWSER_OBJECT_INFO:
if (current_menu_object != NULL)
ro_gui_window_prepare_objectinfo(current_menu_object,
- nsurl_access(current_menu_url));
+ current_menu_url);
break;
case BROWSER_OBJECT_SAVE:
@@ -2758,7 +2758,7 @@ bool ro_gui_window_menu_select(wimp_w w, wimp_i i, wimp_menu *menu,
case BROWSER_OBJECT_INFO:
if (current_menu_object != NULL) {
ro_gui_window_prepare_objectinfo(current_menu_object,
- nsurl_access(current_menu_url));
+ current_menu_url);
ro_gui_dialog_open_persistent(g->window,
dialog_objinfo, false);
}
@@ -3854,28 +3854,30 @@ void ro_gui_window_prepare_pageinfo(struct gui_window *g)
* Prepare the object info window for use
*
* \param *object the object for which information is to be displayed
- * \param *href corresponding href, if any
+ * \param *target_url corresponding url, if any
*/
-void ro_gui_window_prepare_objectinfo(hlcache_handle *object, const char *href)
+void ro_gui_window_prepare_objectinfo(hlcache_handle *object, nsurl *target_url)
{
char icon_buf[20] = "file_xxx";
const char *url;
lwc_string *mime;
const char *target = "-";
- sprintf(icon_buf, "file_%.3x",
- ro_content_filetype(object));
- if (!ro_gui_wimp_sprite_exists(icon_buf))
+ sprintf(icon_buf, "file_%.3x",ro_content_filetype(object));
+ if (!ro_gui_wimp_sprite_exists(icon_buf)) {
sprintf(icon_buf, "file_xxx");
+ }
url = nsurl_access(hlcache_handle_get_url(object));
- if (url == NULL)
+ if (url == NULL) {
url = "-";
+ }
mime = content_get_mime_type(object);
- if (href)
- target = href;
+ if (target_url != NULL) {
+ target = nsurl_access(target_url);
+ }
ro_gui_set_icon_string(dialog_objinfo, ICON_OBJINFO_ICON,
icon_buf, true);
--
NetSurf Browser
8 years, 5 months
netsurf: branch master updated. release/3.3-22-ge62db5a
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/e62db5a49cbd7c8786a1b...
...commit http://git.netsurf-browser.org/netsurf.git/commit/e62db5a49cbd7c8786a1b88...
...tree http://git.netsurf-browser.org/netsurf.git/tree/e62db5a49cbd7c8786a1b8861...
The branch, master has been updated
via e62db5a49cbd7c8786a1b88617e5629ad0d0f64e (commit)
from 22e0c0536a3f9a881ad9e80a9562580c143b06a9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=e62db5a49cbd7c8786a...
commit e62db5a49cbd7c8786a1b88617e5629ad0d0f64e
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
define _DEFAULT_SOURCE as well as _BSD_SOURCE to supress warnings in glibc 2.12
diff --git a/framebuffer/Makefile.target b/framebuffer/Makefile.target
index 699c8da..edc0591 100644
--- a/framebuffer/Makefile.target
+++ b/framebuffer/Makefile.target
@@ -44,6 +44,7 @@ $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
CFLAGS += -std=c99 -g -Dsmall \
-D_BSD_SOURCE \
+ -D_DEFAULT_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
$(shell $(PKG_CONFIG) --cflags libnsfb libhubbub libcss openssl)
diff --git a/gtk/Makefile.target b/gtk/Makefile.target
index 805488b..e69f6c2 100644
--- a/gtk/Makefile.target
+++ b/gtk/Makefile.target
@@ -49,6 +49,7 @@ GTKDEPFLAGS := -DG_DISABLE_SINGLE_INCLUDES \
GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk -g \
$(GTKDEPFLAGS) \
-D_BSD_SOURCE \
+ -D_DEFAULT_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200809L \
-D_NETBSD_SOURCE \
diff --git a/monkey/Makefile.target b/monkey/Makefile.target
index d3c9747..7517463 100644
--- a/monkey/Makefile.target
+++ b/monkey/Makefile.target
@@ -37,6 +37,7 @@ CWARNFLAGS += -Werror
CFLAGS += -std=c99 -Dmonkey -Dnsmonkey -g \
-D_BSD_SOURCE \
+ -D_DEFAULT_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
-D_NETBSD_SOURCE \
-----------------------------------------------------------------------
Summary of changes:
framebuffer/Makefile.target | 1 +
gtk/Makefile.target | 1 +
monkey/Makefile.target | 1 +
3 files changed, 3 insertions(+)
diff --git a/framebuffer/Makefile.target b/framebuffer/Makefile.target
index 699c8da..edc0591 100644
--- a/framebuffer/Makefile.target
+++ b/framebuffer/Makefile.target
@@ -44,6 +44,7 @@ $(eval $(call pkg_config_find_and_add_enabled,JS,mozilla-js,JavaScript))
CFLAGS += -std=c99 -g -Dsmall \
-D_BSD_SOURCE \
+ -D_DEFAULT_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
$(shell $(PKG_CONFIG) --cflags libnsfb libhubbub libcss openssl)
diff --git a/gtk/Makefile.target b/gtk/Makefile.target
index 805488b..e69f6c2 100644
--- a/gtk/Makefile.target
+++ b/gtk/Makefile.target
@@ -49,6 +49,7 @@ GTKDEPFLAGS := -DG_DISABLE_SINGLE_INCLUDES \
GTKCFLAGS := -std=c99 -Dgtk -Dnsgtk -g \
$(GTKDEPFLAGS) \
-D_BSD_SOURCE \
+ -D_DEFAULT_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200809L \
-D_NETBSD_SOURCE \
diff --git a/monkey/Makefile.target b/monkey/Makefile.target
index d3c9747..7517463 100644
--- a/monkey/Makefile.target
+++ b/monkey/Makefile.target
@@ -37,6 +37,7 @@ CWARNFLAGS += -Werror
CFLAGS += -std=c99 -Dmonkey -Dnsmonkey -g \
-D_BSD_SOURCE \
+ -D_DEFAULT_SOURCE \
-D_XOPEN_SOURCE=600 \
-D_POSIX_C_SOURCE=200112L \
-D_NETBSD_SOURCE \
--
NetSurf Browser
8 years, 5 months
netsurf: branch master updated. release/3.3-21-g22e0c05
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/22e0c0536a3f9a881ad9e...
...commit http://git.netsurf-browser.org/netsurf.git/commit/22e0c0536a3f9a881ad9e80...
...tree http://git.netsurf-browser.org/netsurf.git/tree/22e0c0536a3f9a881ad9e80a9...
The branch, master has been updated
via 22e0c0536a3f9a881ad9e80a9562580c143b06a9 (commit)
via 733400ed38bac9b4153ab125bc585f34c3f268b4 (commit)
via c9e8bd24c893ea0cfb85ab3d33379fb5341ecf92 (commit)
from fcfc9453ecabc017723a3c1523a2f1aa18060fbe (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=22e0c0536a3f9a881ad...
commit 22e0c0536a3f9a881ad9e80a9562580c143b06a9
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Reduce log spam esp. from animated gifs.
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index 6eb33cd..e178d28 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -345,12 +345,6 @@ fb_redraw(fbtk_widget_t *widget,
nsfb_t *nsfb = fbtk_get_nsfb(widget);
float scale = browser_window_get_scale(bw);
- LOG(("%d,%d to %d,%d",
- bwidget->redraw_box.x0,
- bwidget->redraw_box.y0,
- bwidget->redraw_box.x1,
- bwidget->redraw_box.y1));
-
x = fbtk_get_absx(widget);
y = fbtk_get_absy(widget);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=733400ed38bac9b4153...
commit 733400ed38bac9b4153ab125bc585f34c3f268b4
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Reduce log spam from animations.
diff --git a/framebuffer/bitmap.c b/framebuffer/bitmap.c
index 2ef0c4c..fb45d6e 100644
--- a/framebuffer/bitmap.c
+++ b/framebuffer/bitmap.c
@@ -157,8 +157,6 @@ void bitmap_set_opaque(void *bitmap, bool opaque)
assert(bm != NULL);
- LOG(("setting bitmap %p to %s", bm, opaque?"opaque":"transparent"));
-
if (opaque) {
nsfb_set_geometry(bm, 0, 0, NSFB_FMT_XBGR8888);
} else {
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c9e8bd24c893ea0cfb8...
commit c9e8bd24c893ea0cfb85ab3d33379fb5341ecf92
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Remove trailing whitespace.
diff --git a/framebuffer/bitmap.c b/framebuffer/bitmap.c
index ca4be21..2ef0c4c 100644
--- a/framebuffer/bitmap.c
+++ b/framebuffer/bitmap.c
@@ -54,7 +54,7 @@ void *bitmap_create(int width, int height, unsigned int state)
if (nsfb_init(bm) == -1) {
nsfb_free(bm);
- return NULL;
+ return NULL;
}
LOG(("bitmap %p", bm));
@@ -152,7 +152,7 @@ void bitmap_modified(void *bitmap) {
* \param opaque whether the bitmap should be plotted opaque
*/
void bitmap_set_opaque(void *bitmap, bool opaque)
-{
+{
nsfb_t *bm = bitmap;
assert(bm != NULL);
@@ -192,8 +192,8 @@ bool bitmap_test_opaque(void *bitmap)
while (tst-- > 0) {
if (bmpptr[(tst << 2) + 3] != 0xff) {
LOG(("bitmap %p has transparency",bm));
- return false;
- }
+ return false;
+ }
}
LOG(("bitmap %p is opaque", bm));
return true;
-----------------------------------------------------------------------
Summary of changes:
framebuffer/bitmap.c | 10 ++++------
framebuffer/gui.c | 6 ------
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/framebuffer/bitmap.c b/framebuffer/bitmap.c
index ca4be21..fb45d6e 100644
--- a/framebuffer/bitmap.c
+++ b/framebuffer/bitmap.c
@@ -54,7 +54,7 @@ void *bitmap_create(int width, int height, unsigned int state)
if (nsfb_init(bm) == -1) {
nsfb_free(bm);
- return NULL;
+ return NULL;
}
LOG(("bitmap %p", bm));
@@ -152,13 +152,11 @@ void bitmap_modified(void *bitmap) {
* \param opaque whether the bitmap should be plotted opaque
*/
void bitmap_set_opaque(void *bitmap, bool opaque)
-{
+{
nsfb_t *bm = bitmap;
assert(bm != NULL);
- LOG(("setting bitmap %p to %s", bm, opaque?"opaque":"transparent"));
-
if (opaque) {
nsfb_set_geometry(bm, 0, 0, NSFB_FMT_XBGR8888);
} else {
@@ -192,8 +190,8 @@ bool bitmap_test_opaque(void *bitmap)
while (tst-- > 0) {
if (bmpptr[(tst << 2) + 3] != 0xff) {
LOG(("bitmap %p has transparency",bm));
- return false;
- }
+ return false;
+ }
}
LOG(("bitmap %p is opaque", bm));
return true;
diff --git a/framebuffer/gui.c b/framebuffer/gui.c
index 6eb33cd..e178d28 100644
--- a/framebuffer/gui.c
+++ b/framebuffer/gui.c
@@ -345,12 +345,6 @@ fb_redraw(fbtk_widget_t *widget,
nsfb_t *nsfb = fbtk_get_nsfb(widget);
float scale = browser_window_get_scale(bw);
- LOG(("%d,%d to %d,%d",
- bwidget->redraw_box.x0,
- bwidget->redraw_box.y0,
- bwidget->redraw_box.x1,
- bwidget->redraw_box.y1));
-
x = fbtk_get_absx(widget);
y = fbtk_get_absy(widget);
--
NetSurf Browser
8 years, 5 months