Dillo v3.1.1-119-g140d9ebd
|
Go to the source code of this file.
Classes | |
struct | DICacheEntry |
Macros | |
#define | DIC_Last -1 |
Symbolic name to request the last version of an image. | |
#define | DIF_Last 1 |
Flags: Last version, Valid entry. | |
#define | DIF_Valid 2 |
Typedefs | |
typedef struct DICacheEntry | DICacheEntry |
Enumerations | |
enum | DicEntryState { DIC_Empty , DIC_SetParms , DIC_SetCmap , DIC_Write , DIC_Close , DIC_Abort } |
Functions | |
void | a_Dicache_init (void) |
Initialize dicache data. | |
DICacheEntry * | a_Dicache_get_entry (const DilloUrl *Url, int version) |
Search a particular version of a URL in the Dicache. | |
void * | a_Dicache_png_image (const char *Type, void *Ptr, CA_Callback_t *Call, void **Data) |
PNG wrapper for Dicache_image() | |
void * | a_Dicache_gif_image (const char *Type, void *Ptr, CA_Callback_t *Call, void **Data) |
GIF wrapper for Dicache_image() | |
void * | a_Dicache_jpeg_image (const char *Type, void *Ptr, CA_Callback_t *Call, void **Data) |
JPEG wrapper for Dicache_image() | |
void | a_Dicache_callback (int Op, CacheClient_t *Client) |
This function is a cache client; (but feeds its clients from dicache) | |
void | a_Dicache_set_parms (DilloUrl *url, int version, DilloImage *Image, uint_t width, uint_t height, DilloImgType type, double gamma) |
Set image's width, height & type. | |
void | a_Dicache_set_cmap (DilloUrl *url, int version, int bg_color, const uchar_t *cmap, uint_t num_colors, int num_colors_max, int bg_index) |
Implement the set_cmap method for the Image. | |
void | a_Dicache_new_scan (const DilloUrl *url, int version) |
Reset for a new scan from a multiple-scan image. | |
void | a_Dicache_write (DilloUrl *url, int version, const uchar_t *buf, uint_t Y) |
Implement the write method (Write a scan line into the Dicache entry) buf: row buffer Y : row number. | |
void | a_Dicache_close (DilloUrl *url, int version, CacheClient_t *Client) |
Implement the close method of the decoding process. | |
void | a_Dicache_invalidate_entry (const DilloUrl *Url) |
Invalidate this entry. | |
DICacheEntry * | a_Dicache_ref (const DilloUrl *Url, int version) |
Refs the counter of a dicache entry. | |
void | a_Dicache_unref (const DilloUrl *Url, int version) |
Unrefs the counter of a dicache entry (it counts cache clients). | |
void | a_Dicache_cleanup (void) |
Free the imgbuf (RGB data) of unused entries. | |
void | a_Dicache_freeall (void) |
Deallocate memory used by dicache module (Call this one at exit time, with no cache clients queued) | |
#define DIC_Last -1 |
typedef struct DICacheEntry DICacheEntry |
enum DicEntryState |
void a_Dicache_callback | ( | int | Op, |
CacheClient_t * | Client | ||
) |
This function is a cache client; (but feeds its clients from dicache)
Definition at line 492 of file dicache.c.
References a_Bitvec_clear_bit, a_Bitvec_get_bit(), a_Bw_close_client(), a_Dicache_close(), a_Dicache_get_entry(), a_Image_abort(), a_Image_close(), a_Image_set_parms(), a_Image_write(), DICacheEntry::BitVec, _DilloImage::BitVec, CacheClient::BufSize, _DilloWeb::bw, CA_Abort, CA_Close, CA_Send, DICacheEntry::DecodedSize, DICacheEntry::Decoder, DIC_Close, DIC_Last, DIC_SetParms, DIC_Write, dReturn_if_fail, DICacheEntry::height, _DilloImage::height, _DilloWeb::Image, CacheClient::Key, DICacheEntry::ScanNumber, _DilloImage::ScanNumber, DICacheEntry::State, DICacheEntry::type, DICacheEntry::url, _DilloWeb::url, DICacheEntry::v_imgbuf, CacheClient::Version, DICacheEntry::version, CacheClient::Web, and DICacheEntry::width.
Referenced by Dicache_image().
void a_Dicache_cleanup | ( | void | ) |
Free the imgbuf (RGB data) of unused entries.
Definition at line 560 of file dicache.c.
References _MSG, a_Imgbuf_last_reference(), CachedIMGs, Dicache_remove(), dList_length(), dList_nth_data(), DICacheEntry::RefCount, DICacheEntry::SurvCleanup, DICacheEntry::url, DICacheEntry::v_imgbuf, and DICacheEntry::version.
Referenced by Cache_process_queue().
void a_Dicache_close | ( | DilloUrl * | url, |
int | version, | ||
CacheClient_t * | Client | ||
) |
Implement the close method of the decoding process.
Definition at line 349 of file dicache.c.
References _MSG, a_Bw_close_client(), a_Dicache_get_entry(), a_Dicache_unref(), _DilloWeb::bw, DICacheEntry::cmap, DICacheEntry::Decoder, DICacheEntry::DecoderData, dFree(), DIC_Close, dReturn_if_fail, CacheClient::Key, DICacheEntry::RefCount, DICacheEntry::State, DICacheEntry::v_imgbuf, and CacheClient::Web.
Referenced by a_Dicache_callback(), and Png_close().
void a_Dicache_freeall | ( | void | ) |
Deallocate memory used by dicache module (Call this one at exit time, with no cache clients queued)
Definition at line 586 of file dicache.c.
References a_Bitvec_free(), a_Imgbuf_unref(), a_Url_free(), DICacheEntry::BitVec, CachedIMGs, DICacheEntry::cmap, dFree(), dicache_size_total, dList_free(), dList_length(), dList_nth_data(), dList_remove_fast(), DICacheEntry::TotalSize, DICacheEntry::url, and DICacheEntry::v_imgbuf.
Referenced by main().
DICacheEntry * a_Dicache_get_entry | ( | const DilloUrl * | Url, |
int | version | ||
) |
Search a particular version of a URL in the Dicache.
Notes: DIC_Last means last version of the image. version zero is not allowed.
Definition at line 150 of file dicache.c.
References CachedIMGs, DIC_Last, Dicache_entry_cmp(), DIF_Valid, dList_find_sorted(), dReturn_val_if_fail, DICacheEntry::Flags, DICacheEntry::url, and DICacheEntry::version.
Referenced by a_Cache_stop_client(), a_Dicache_callback(), a_Dicache_close(), a_Dicache_invalidate_entry(), a_Dicache_new_scan(), a_Dicache_ref(), a_Dicache_set_cmap(), a_Dicache_set_parms(), a_Dicache_unref(), a_Dicache_write(), and Dicache_image().
void * a_Dicache_gif_image | ( | const char * | Type, |
void * | Ptr, | ||
CA_Callback_t * | Call, | ||
void ** | Data | ||
) |
GIF wrapper for Dicache_image()
void a_Dicache_init | ( | void | ) |
Initialize dicache data.
Definition at line 76 of file dicache.c.
References _MSG, CachedIMGs, DIC_MAX, dicache_size_total, disabled_formats, dList_new(), dStriAsciiStr(), format_name, DilloPrefs::ignore_image_formats, and prefs.
Referenced by main().
void a_Dicache_invalidate_entry | ( | const DilloUrl * | Url | ) |
Invalidate this entry.
This is used for the reloading mechanism. Can't erase current versions, but a_Dicache_get_entry(url, DIC_Last) must return NULL.
Definition at line 232 of file dicache.c.
References a_Dicache_get_entry(), DIC_Last, and DICacheEntry::Flags.
Referenced by Cache_entry_remove().
void * a_Dicache_jpeg_image | ( | const char * | Type, |
void * | Ptr, | ||
CA_Callback_t * | Call, | ||
void ** | Data | ||
) |
JPEG wrapper for Dicache_image()
void a_Dicache_new_scan | ( | const DilloUrl * | url, |
int | version | ||
) |
Reset for a new scan from a multiple-scan image.
Definition at line 306 of file dicache.c.
References _MSG, a_Bitvec_clear(), a_Dicache_get_entry(), a_Imgbuf_new_scan(), DICacheEntry::BitVec, DIC_SetParms, dReturn_if_fail, MSG, DICacheEntry::ScanNumber, DICacheEntry::State, and DICacheEntry::v_imgbuf.
Referenced by Png_datarow_callback().
void * a_Dicache_png_image | ( | const char * | Type, |
void * | Ptr, | ||
CA_Callback_t * | Call, | ||
void ** | Data | ||
) |
PNG wrapper for Dicache_image()
DICacheEntry * a_Dicache_ref | ( | const DilloUrl * | Url, |
int | version | ||
) |
Refs the counter of a dicache entry.
Definition at line 217 of file dicache.c.
References a_Dicache_get_entry(), and DICacheEntry::RefCount.
Referenced by Dicache_image().
void a_Dicache_set_cmap | ( | DilloUrl * | url, |
int | version, | ||
int | bg_color, | ||
const uchar_t * | cmap, | ||
uint_t | num_colors, | ||
int | num_colors_max, | ||
int | bg_index | ||
) |
Implement the set_cmap method for the Image.
Definition at line 282 of file dicache.c.
References _MSG, a_Dicache_get_entry(), DICacheEntry::cmap, dFree(), DIC_SetCmap, dNew0, dReturn_if_fail, and DICacheEntry::State.
void a_Dicache_set_parms | ( | DilloUrl * | url, |
int | version, | ||
DilloImage * | Image, | ||
uint_t | width, | ||
uint_t | height, | ||
DilloImgType | type, | ||
double | gamma | ||
) |
Set image's width, height & type.
Definition at line 248 of file dicache.c.
References _MSG, a_Bitvec_new(), a_Dicache_get_entry(), a_Imgbuf_new(), DICacheEntry::BitVec, DIC_SetParms, dicache_size_total, dReturn_if_fail, DICacheEntry::height, I_RGB, _DilloImage::layout, DICacheEntry::RefCount, DICacheEntry::State, DICacheEntry::TotalSize, DICacheEntry::type, URL_STR, DICacheEntry::v_imgbuf, DICacheEntry::version, and DICacheEntry::width.
Referenced by Png_datainfo_callback().
void a_Dicache_unref | ( | const DilloUrl * | Url, |
int | version | ||
) |
Unrefs the counter of a dicache entry (it counts cache clients).
If there're no clients and no imgbuf, remove the entry. Otherwise, let a_Dicache_cleanup() do the job later (keeping it cached meanwhile for e.g. reload, repush, back/fwd).
Definition at line 200 of file dicache.c.
References _MSG, a_Dicache_get_entry(), a_Imgbuf_last_reference(), Dicache_remove(), DICacheEntry::RefCount, DICacheEntry::State, and DICacheEntry::v_imgbuf.
Referenced by a_Cache_stop_client(), and a_Dicache_close().
Implement the write method (Write a scan line into the Dicache entry) buf: row buffer Y : row number.
Definition at line 329 of file dicache.c.
References _MSG, a_Bitvec_set_bit(), a_Dicache_get_entry(), a_Imgbuf_update(), DICacheEntry::BitVec, DICacheEntry::cmap, DIC_Write, dReturn_if_fail, DICacheEntry::height, DICacheEntry::State, DICacheEntry::type, DICacheEntry::v_imgbuf, and DICacheEntry::width.
Referenced by Png_datarow_callback().