1998-04-30 20:53:59 +00:00
|
|
|
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
|
|
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
|
|
|
* http://www.mozilla.org/NPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* NPL.
|
|
|
|
*
|
|
|
|
* The Initial Developer of this code under the NPL is Netscape
|
|
|
|
* Communications Corporation. Portions created by Netscape are
|
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
|
|
|
* Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NETCACHE_H
|
|
|
|
#define NETCACHE_H
|
|
|
|
|
1998-05-11 21:41:26 +00:00
|
|
|
#include "mkgeturl.h"
|
|
|
|
|
1998-05-19 00:54:09 +00:00
|
|
|
PR_BEGIN_EXTERN_C
|
1998-05-11 22:04:57 +00:00
|
|
|
|
1998-04-30 20:53:59 +00:00
|
|
|
extern void NET_CleanupCache (char * filename);
|
|
|
|
extern int NET_FindURLInCache(URL_Struct * URL_s, MWContext *ctxt);
|
|
|
|
extern void NET_RefreshCacheFileExpiration(URL_Struct * URL_s);
|
|
|
|
|
|
|
|
extern void NET_CacheInit(void);
|
|
|
|
|
|
|
|
extern void NET_InitMemCacProtocol(void);
|
|
|
|
|
|
|
|
|
1998-05-19 00:54:09 +00:00
|
|
|
extern PRBool NET_IsCacheTraceOn(void);
|
1998-04-30 20:53:59 +00:00
|
|
|
|
|
|
|
/* remove a URL from the cache
|
|
|
|
*/
|
|
|
|
extern void NET_RemoveURLFromCache(URL_Struct *URL_s);
|
|
|
|
|
|
|
|
/* create an HTML stream and push a bunch of HTML about
|
|
|
|
* the cache
|
|
|
|
*/
|
|
|
|
extern void NET_DisplayCacheInfoAsHTML(ActiveEntry * cur_entry);
|
|
|
|
|
|
|
|
/* return TRUE if the URL is in the cache and
|
|
|
|
* is a partial cache file
|
|
|
|
*/
|
1998-05-19 00:54:09 +00:00
|
|
|
extern PRBool NET_IsPartialCacheFile(URL_Struct *URL_s);
|
1998-04-30 20:53:59 +00:00
|
|
|
|
|
|
|
/* encapsulated access to the first object in cache_database */
|
|
|
|
extern int NET_FirstCacheObject(DBT *key, DBT *data);
|
|
|
|
|
|
|
|
/* encapsulated access to the next object in the cache_database */
|
|
|
|
extern int NET_NextCacheObject(DBT *key, DBT *data);
|
|
|
|
|
|
|
|
/* Max size for displaying in the cache browser */
|
|
|
|
extern int32 NET_GetMaxDiskCacheSize();
|
|
|
|
|
|
|
|
extern void
|
|
|
|
NET_OpenExtCacheFAT(MWContext *ctxt, char * cache_name, char * instructions);
|
|
|
|
|
|
|
|
extern void
|
|
|
|
CACHE_CloseAllOpenSARCache();
|
|
|
|
|
|
|
|
extern void
|
|
|
|
CACHE_OpenAllSARCache();
|
|
|
|
|
|
|
|
/* create an HTML stream and push a bunch of HTML about
|
|
|
|
* the memory cache
|
|
|
|
*/
|
|
|
|
extern void
|
|
|
|
NET_DisplayMemCacheInfoAsHTML(ActiveEntry * cur_entry);
|
|
|
|
|
1998-05-01 23:16:57 +00:00
|
|
|
extern int
|
|
|
|
NET_FindURLInMemCache(URL_Struct * URL_s, MWContext *ctxt);
|
|
|
|
|
1998-05-01 23:19:03 +00:00
|
|
|
/* lookup routine
|
|
|
|
*
|
|
|
|
* builds a key and looks for it in
|
|
|
|
* the database. Returns an access
|
|
|
|
* method and sets a filename in the
|
|
|
|
* URL struct if found
|
|
|
|
*/
|
|
|
|
extern int NET_FindURLInExtCache(URL_Struct * URL_s, MWContext *ctxt);
|
|
|
|
|
1998-05-19 00:54:09 +00:00
|
|
|
PR_END_EXTERN_C
|
1998-04-30 20:53:59 +00:00
|
|
|
|
|
|
|
#endif /* NETCACHE_H */
|