diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-11 23:02:49 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2010-04-11 23:02:49 +0000 |
commit | 18081664eb4ccbbaa570399c0c99d33d93a70ca5 (patch) | |
tree | 2e26b67884e44028bcf9f9193d4cae3931c30068 | |
parent | 11201a1cd7672db3d4480d49347b660123e1c033 (diff) | |
download | netsurf-18081664eb4ccbbaa570399c0c99d33d93a70ca5.tar.gz netsurf-18081664eb4ccbbaa570399c0c99d33d93a70ca5.tar.bz2 |
Provide API to enable a handle's callback to be replaced
svn path=/trunk/netsurf/; revision=10376
-rw-r--r-- | content/hlcache.c | 10 | ||||
-rw-r--r-- | content/hlcache.h | 11 |
2 files changed, 21 insertions, 0 deletions
diff --git a/content/hlcache.c b/content/hlcache.c index dd520c8c6..84f391aed 100644 --- a/content/hlcache.c +++ b/content/hlcache.c @@ -274,6 +274,16 @@ nserror hlcache_handle_abort(hlcache_handle *handle) return content_abort(c); } +/* See hlcache.h for documentation */ +nserror hlcache_handle_replace_callback(hlcache_handle *handle, + hlcache_handle_callback cb, void *pw) +{ + handle->cb = cb; + handle->pw = pw; + + return NSERROR_OK; +} + /****************************************************************************** * High-level cache internals * ******************************************************************************/ diff --git a/content/hlcache.h b/content/hlcache.h index 1c4cc7b2f..afc755e42 100644 --- a/content/hlcache.h +++ b/content/hlcache.h @@ -118,6 +118,17 @@ nserror hlcache_handle_release(hlcache_handle *handle); nserror hlcache_handle_abort(hlcache_handle *handle); /** + * Replace a high-level cache handle's callback + * + * \param handle Handle to replace callback of + * \param cb New callback routine + * \param pw Private data for callback + * \return NSERROR_OK on success, appropriate error otherwise + */ +nserror hlcache_handle_replace_callback(hlcache_handle *handle, + hlcache_handle_callback cb, void *pw); + +/** * Retrieve a content object from a cache handle * * \param handle Cache handle to dereference |