2014-11-10 16:53:08 -05:00
|
|
|
|
|
|
|
#ifndef __CACHE_H__
|
|
|
|
#define __CACHE_H__
|
|
|
|
|
2015-10-19 15:15:29 -04:00
|
|
|
#include <event2/buffer.h>
|
2014-11-10 16:53:08 -05:00
|
|
|
|
|
|
|
/* ---------------------------- DAAP cache API --------------------------- */
|
|
|
|
|
2015-06-08 17:07:56 -04:00
|
|
|
void
|
|
|
|
cache_daap_suspend(void);
|
|
|
|
|
|
|
|
void
|
|
|
|
cache_daap_resume(void);
|
2014-11-10 16:53:08 -05:00
|
|
|
|
|
|
|
int
|
2017-10-26 17:01:07 -04:00
|
|
|
cache_daap_get(struct evbuffer *evbuf, const char *query);
|
2014-11-10 16:53:08 -05:00
|
|
|
|
|
|
|
void
|
2017-11-07 18:32:03 -05:00
|
|
|
cache_daap_add(const char *query, const char *ua, int is_remote, int msec);
|
2014-11-10 16:53:08 -05:00
|
|
|
|
|
|
|
int
|
|
|
|
cache_daap_threshold(void);
|
|
|
|
|
|
|
|
|
|
|
|
/* ---------------------------- Artwork cache API --------------------------- */
|
|
|
|
|
2014-12-27 10:48:12 -05:00
|
|
|
#define CACHE_ARTWORK_GROUP 0
|
|
|
|
#define CACHE_ARTWORK_INDIVIDUAL 1
|
|
|
|
|
2015-06-08 16:24:33 -04:00
|
|
|
void
|
2017-01-01 05:06:00 -05:00
|
|
|
cache_artwork_ping(const char *path, time_t mtime, int del);
|
2014-11-10 16:53:08 -05:00
|
|
|
|
|
|
|
int
|
2020-02-19 17:01:43 -05:00
|
|
|
cache_artwork_delete_by_path(const char *path);
|
2014-11-10 16:53:08 -05:00
|
|
|
|
|
|
|
int
|
|
|
|
cache_artwork_purge_cruft(time_t ref);
|
|
|
|
|
|
|
|
int
|
2015-01-02 18:31:48 -05:00
|
|
|
cache_artwork_add(int type, int64_t persistentid, int max_w, int max_h, int format, char *filename, struct evbuffer *evbuf);
|
2014-11-10 16:53:08 -05:00
|
|
|
|
|
|
|
int
|
2015-01-02 18:31:48 -05:00
|
|
|
cache_artwork_get(int type, int64_t persistentid, int max_w, int max_h, int *cached, int *format, struct evbuffer *evbuf);
|
2014-11-10 16:53:08 -05:00
|
|
|
|
2015-04-18 16:55:00 -04:00
|
|
|
int
|
2020-02-19 17:01:43 -05:00
|
|
|
cache_artwork_stash(struct evbuffer *evbuf, const char *path, int format);
|
2015-04-18 16:55:00 -04:00
|
|
|
|
|
|
|
int
|
2020-02-19 17:01:43 -05:00
|
|
|
cache_artwork_read(struct evbuffer *evbuf, const char *path, int *format);
|
2014-11-10 16:53:08 -05:00
|
|
|
|
|
|
|
/* ---------------------------- Cache API --------------------------- */
|
|
|
|
|
|
|
|
int
|
|
|
|
cache_init(void);
|
|
|
|
|
|
|
|
void
|
|
|
|
cache_deinit(void);
|
|
|
|
|
|
|
|
#endif /* !__CACHE_H__ */
|