From 2fba2249eed773b0092f20f9b71bd5dd19220268 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 7 Apr 2010 18:50:18 +0000 Subject: Add function to test whether hlcache_handle's content is locked. svn path=/trunk/netsurf/; revision=10287 --- content/content.c | 17 +++++++++++++++++ content/content.h | 2 ++ content/content_protected.h | 2 ++ 3 files changed, 21 insertions(+) (limited to 'content') diff --git a/content/content.c b/content/content.c index 9e01171ea..1a1fc9927 100644 --- a/content/content.c +++ b/content/content.c @@ -1301,6 +1301,23 @@ struct bitmap *content__get_bitmap(struct content *c) return c->bitmap; } +/** + * Return whether a content is currently locked + * + * \param c Content to test + * \return true iff locked, else false + */ + +bool content_is_locked(hlcache_handle *h) +{ + return content__is_locked(hlcache_handle_get_content(h)); +} + +bool content__is_locked(struct content *c) +{ + return c->locked; +} + /** * Retrieve the low-level cache handle for a content * diff --git a/content/content.h b/content/content.h index a76783bdf..8a24e712f 100644 --- a/content/content.h +++ b/content/content.h @@ -145,4 +145,6 @@ void content_invalidate_reuse_data(struct hlcache_handle *c); const char *content_get_refresh_url(struct hlcache_handle *c); struct bitmap *content_get_bitmap(struct hlcache_handle *c); +bool content_is_locked(struct hlcache_handle *h); + #endif diff --git a/content/content_protected.h b/content/content_protected.h index 16760180b..3fd6c8329 100644 --- a/content/content_protected.h +++ b/content/content_protected.h @@ -220,4 +220,6 @@ void content__invalidate_reuse_data(struct content *c); const char *content__get_refresh_url(struct content *c); struct bitmap *content__get_bitmap(struct content *c); +bool content__is_locked(struct content *c); + #endif -- cgit v1.2.3