Provide API to enable a handle's callback to be replaced

svn path=/trunk/netsurf/; revision=10376
This commit is contained in:
John Mark Bell 2010-04-11 23:02:49 +00:00
parent 11201a1cd7
commit 18081664eb
2 changed files with 21 additions and 0 deletions

View File

@ -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 *
******************************************************************************/

View File

@ -117,6 +117,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
*