Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

cache.h

Go to the documentation of this file.
00001 /*
00002  *  cache.h
00003  *  mod_musicindex
00004  *
00005  *  $Id: cache.h,v 1.11 2003/10/18 00:47:06 varenet Exp $
00006  *
00007  *  Created by Thibaut VARENE on Fri Jul 04 2003.
00008  *  Copyright (c) 2003 Thibaut VARENE
00009  *  
00010  *  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU Lesser General Public License as published by
00012  *  the Free Software Foundation; either version 2.1, or (at your option)
00013  *  any later version.
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 /* to be continued */
00026 
00027 #else /* Flat file cache */
00028 
00029  #ifdef sun     /* have to check that it's only defined for Sun Solaris */
00030   #warning no flat file cache support on that system.
00031   #define NO_CACHE
00032  #endif
00033 
00034  #include <dirent.h>    /* opendir & friends */
00035  #include <errno.h>
00036  #include <stdio.h>     /* fprintf / fscanf / fileno */
00037  #include <sys/file.h>  /* flock */
00038  #include <sys/stat.h>  /* file handling */
00039  #include <sys/types.h> /* file handling */
00040  #include <unistd.h>    /* file handling */
00041 
00042 #endif  /* Cache type */
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 /* NO_CACHE */
00064 #endif /* CACHE_H */

Generated on Thu Oct 30 13:50:28 2003 for mod_musicindex by doxygen 1.3.4