00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CACHE_H
00018 #define CACHE_H
00019
00020 #include "mod_musicindex.h"
00021 #include <string.h>
00022
00023 #undef CACHE_SQL
00024 #ifdef CACHE_SQL
00025
00026
00027 #else
00028
00029 #ifdef sun
00030 #warning no flat file cache support on that system.
00031 #define NO_CACHE
00032 #endif
00033
00034 #include <dirent.h>
00035 #include <errno.h>
00036 #include <stdio.h>
00037 #include <sys/file.h>
00038 #include <sys/stat.h>
00039 #include <sys/types.h>
00040 #include <unistd.h>
00041
00042 #endif
00043
00044 #ifndef NO_CACHE
00045
00046 #define CA_FATAL 10
00047 #define CA_MISSARG 20
00048 #define CA_CREATE 30
00049 #define CA_LOCKED 40
00053 typedef struct {
00054 char *name;
00055 void *stream;
00056 } mu_cache_data;
00057
00058 short cache_check_dir(request_rec *, mu_config *, mu_cache_data *);
00059 short cache_check_file(request_rec *, mu_config *, mu_cache_data *);
00060 mu_ent *cache_read_file(request_rec *, mu_ent *, mu_config *, mu_cache_data *);
00061 short cache_write_file(request_rec *, mu_ent *, mu_config *, mu_cache_data *);
00062
00063 #endif
00064 #endif