mod_musicindex  1.4.1
cache_backend Struct Reference

Cache backend structure, defining a standard set of operations that all cache backends may implement. More...

#include <mod_musicindex.h>

Data Fields

void *(* opendir )(request_rec *r, mu_pack *const pack, const char *const filename, const char *const uri, unsigned long soptions)
 It can be used in many weird ways, but is mostly expected to either return NULL if the directory backend can't provide a full directory listing, and otherwise populate the entries with whatever is in the cache.
const char *(* readdir )(void *dir)
 If the above call provided a dir handler, this function will be used.
void(* closedir )(void *dir)
 At the end of directory processing, this function is called, still mimicing opendir/readdir/closedir.
mu_ent *(* make_entry )(request_rec *r, apr_pool_t *pool, FILE *const in, const char *const filename)
 This call reads cached metadata for a given file.
void(* write )(request_rec *r, const mu_ent *const entry, const char *const name)
 This call tells the cache backend to write metadata for a given file.
void(* prologue )(request_rec *r)
 This call is guaranteed to run before any other cache backend function is called anywhere in the code path.
void(* epilogue )(request_rec *r)
 This call is guaranteed to run after any other cache backend function is called in the current module execution.

Detailed Description

Cache backend structure, defining a standard set of operations that all cache backends may implement.

Definition at line 345 of file mod_musicindex.h.

Field Documentation

void(* cache_backend::closedir)(void *dir)

At the end of directory processing, this function is called, still mimicing opendir/readdir/closedir.

Definition at line 367 of file mod_musicindex.h.

Referenced by musicindex_closedir().

void(* cache_backend::epilogue)(request_rec *r)

This call is guaranteed to run after any other cache backend function is called in the current module execution.

Definition at line 383 of file mod_musicindex.h.

Referenced by handle_musicfile(), and handle_musicindex().

mu_ent*(* cache_backend::make_entry)(request_rec *r, apr_pool_t *pool, FILE *const in, const char *const filename)

This call reads cached metadata for a given file.

Definition at line 370 of file mod_musicindex.h.

Referenced by make_cache_entry().

void*(* cache_backend::opendir)(request_rec *r, mu_pack *const pack, const char *const filename, const char *const uri, unsigned long soptions)

It can be used in many weird ways, but is mostly expected to either return NULL if the directory backend can't provide a full directory listing, and otherwise populate the entries with whatever is in the cache.

If return is !NULL, (cache_backend::readdir()) will be subsequently called on the provided return pointer. See musicindex_opendir() for details.

Definition at line 352 of file mod_musicindex.h.

Referenced by musicindex_opendir().

void(* cache_backend::prologue)(request_rec *r)

This call is guaranteed to run before any other cache backend function is called anywhere in the code path.

Definition at line 379 of file mod_musicindex.h.

Referenced by handle_musicfile(), and handle_musicindex().

const char*(* cache_backend::readdir)(void *dir)

If the above call provided a dir handler, this function will be used.

Its primary intent is to provide a way for the cache backend to let the program know that some files couldn't be processed at cache level, and that they need to be parsed by the standard playlist system. Each consecutive call to this function should return the name of a file in the current directory to be processed, terminating with NULL, a la readdir. The only nitpick here is that files listed here will still hit make_cache_entry(), that is the following cache_backend::make_entry()

Definition at line 363 of file mod_musicindex.h.

Referenced by musicindex_readdir().

void(* cache_backend::write)(request_rec *r, const mu_ent *const entry, const char *const name)

This call tells the cache backend to write metadata for a given file.

Definition at line 374 of file mod_musicindex.h.

Referenced by make_music_entry().


The documentation for this struct was generated from the following file: