From: Robert K. <may...@us...> - 2001-10-10 23:25:51
|
Update of /cvsroot/bitcollider/bitcollider/include In directory usw-pr-cvs1:/tmp/cvs-serv17734/include Modified Files: bc_version.h bitcollider.h Added Files: cache.h defs.h Log Message: Added support for caching using the Berkeley DB. If the DB is not found, the cache functionality degrades nicely. Linux only so far -- support for windows will be done shortly. --- NEW FILE: cache.h --- /* (PD) 2001 The Bitzi Corporation * Please see file COPYING or http://bitzi.com/publicdomain * for more info. * * $Id: cache.h,v 1.1 2001/10/10 23:25:48 mayhemchaos Exp $ */ #ifndef CACHE_H #define CACHE_H #include <db.h> #include "defs.h" #include "bitprint.h" typedef struct _cache_info { DB *dbp; char *errorString; } cache_info; typedef struct _cache_entry { char fileName[MAX_PATH]; time_t lastModDate; char bitprint[BITPRINT_BASE32_LEN]; } cache_entry; cache_info *init_cache(void); b_bool open_cache(cache_info *info, const char *fileName); void close_cache(cache_info *info); /* Fill out the fileName in the cache entry and get will fill out the other fields. */ b_bool get_cache_entry(cache_info *info, cache_entry *entry); b_bool add_cache_entry(cache_info *info, cache_entry *entry); b_bool remove_cache_entry(cache_info *info, cache_entry *entry); #endif --- NEW FILE: defs.h --- /* (PD) 2001 The Bitzi Corporation * Please see file COPYING or http://bitzi.com/publicdomain * for more info. * * $Id: defs.h,v 1.1 2001/10/10 23:25:48 mayhemchaos Exp $ */ #ifndef DEF_H #define DEF_H #ifdef WIN32 #include <windows.h> #define strcasecmp stricmp #endif #ifdef __cplusplus extern "C" { #endif typedef int b_bool; #ifndef true #define true 1 #endif #ifndef false #define false 0 #endif #ifndef MAX_PATH #define MAX_PATH 1024 #endif #ifdef __cplusplus } #endif #endif Index: bc_version.h =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/include/bc_version.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** bc_version.h 2001/08/23 18:46:26 1.4 --- bc_version.h 2001/10/10 23:25:48 1.5 *************** *** 22,26 **** /* Your agent-version string; should be #[.#[.#[etc]]] format */ ! #define BC_VERSION "0.3.3" #endif --- 22,26 ---- /* Your agent-version string; should be #[.#[.#[etc]]] format */ ! #define BC_VERSION "0.4.0" #endif Index: bitcollider.h =================================================================== RCS file: /cvsroot/bitcollider/bitcollider/include/bitcollider.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** bitcollider.h 2001/07/23 23:13:32 1.9 --- bitcollider.h 2001/10/10 23:25:48 1.10 *************** *** 8,17 **** #define BITCOLLIDER_H ! #ifdef WIN32 ! #include <windows.h> ! #define strcasecmp stricmp ! #endif ! #include "plugin.h" #ifdef __cplusplus --- 8,15 ---- #define BITCOLLIDER_H ! #include "config.h" #include "plugin.h" + #include "cache.h" + #include "defs.h" #ifdef __cplusplus *************** *** 19,35 **** #endif - typedef int b_bool; - #ifndef true - #define true 1 - #endif - #ifndef false - #define false 0 - #endif - #define SUBMIT_URL "http://bitzi.com/lookup/" #define MAX_PLUGINS 256 - #ifndef MAX_PATH - #define MAX_PATH 1024 - #endif typedef struct _PluginInfo --- 17,22 ---- *************** *** 54,57 **** --- 41,47 ---- b_bool preview; b_bool exitNow; + #if USE_BDB + cache_info *cache; + #endif } Bitcollider; |