#ifndef CACHE_H #define CACHE_H #include #include /** * \file cache.h * \brief cache related structures and functions * \details * Metadata: * - We store the metadata and the actual data separately in two * different folders. * - The metadata file should follow the following format: * - file length (long) * - CURLINFO_FILETIME * - segment count (int) * - individual segments (array of seg) * \note * - We are using 'long' to store file size, because the offset in fseek() is * in long, because the way we use the cache system, you cannot seek past * long. So the biggest file size has to be able to be stored in long. This * makes this program architecturally dependent, i.e. i386 vs amd64 */ /** * \brief Type definition for a cache segment */ typedef uint8_t Seg; /** * \brief cache in-memory data structure */ typedef struct { char *p_url; /**< the filename from the http server */ long time; /**