

#ifndef _EXPIRE_H
#define _EXPIRE_H 1

typedef struct channel_s {
	struct channel_s *next;
	char *datadir;
	dirstat_t *dirstat;
	bookkeeper_t *books;
	int books_stat;
	int do_rescan;
	int status;
	FTS *fts;
	FTSENT *ftsent;
} channel_t;

enum { OK = 0, NOFILES };

uint64_t ParseSizeDef (char *s, uint64_t *value);

uint64_t ParseTimeDef (char *s, uint64_t *value);

void RescanDir (char *dir, dirstat_t *dirstat);

void ExpireDir (char *dir, dirstat_t *dirstat, uint64_t maxsize, uint64_t maxlife, uint32_t runtime);

void ExpireProfile (channel_t *channel, dirstat_t *current_stat, uint64_t maxsize, uint64_t maxlife, uint32_t runtime);

void UpdateBookStat (dirstat_t *dirstat, bookkeeper_t *books);

#endif //_EXPIRE_H
