version 1.117, 1998/07/24 18:13:08
|
version 1.118, 1998/08/12 11:17:01
|
Line 1089 static void AHTAlertInit ()
|
Line 1089 static void AHTAlertInit ()
|
#endif /* AMAYA_WWW_CACHE */ |
#endif /* AMAYA_WWW_CACHE */ |
} |
} |
|
|
|
#ifdef AMAYA_WWW_CACHE |
|
/*---------------------------------------------------------------------- |
|
CleanCache |
|
Clears an existing cache directory |
|
----------------------------------------------------------------------*/ |
|
#ifdef __STDC__ |
|
void CleanCache (char *dirname) |
|
#else |
|
void CleanCache (dirname) |
|
char *dirname; |
|
#endif /* __STDC__ */ |
|
{ |
|
DIR *dp; |
|
struct stat st; |
|
#ifdef HAVE_DIRENT_H |
|
struct dirent *d; |
|
#else |
|
struct direct *d; |
|
#endif /* HAVE_DIRENT_H */ |
|
char filename [BUFSIZ+1]; |
|
|
|
if ((dp = opendir (dirname)) == NULL) |
|
{ |
|
/* @@@ we couldn't open the directory ... we need some msg */ |
|
perror (dirname); |
|
exit; |
|
} |
|
|
|
while ((d = readdir (dp)) != NULL) |
|
{ |
|
#ifndef _WINDOWS |
|
/* skip the UNIX . and .. links */ |
|
if (!strcmp (d->d_name, "..") |
|
|| !strcmp (d->d_name, ".")) |
|
continue; |
|
#endif _WINDOWS |
|
|
|
sprintf (filename, "%s%s", dirname, d->d_name); |
|
if (lstat (filename, &st) < 0 ) |
|
{ |
|
/* @@2 need some error message */ |
|
perror (filename); |
|
continue; |
|
} |
|
|
|
switch (st.st_mode & S_IFMT) |
|
{ |
|
case S_IFDIR: |
|
/* if we find a directory, we erase it, recursively */ |
|
strcat (filename, "/"); |
|
CleanCache (filename); |
|
break; |
|
case S_IFLNK: |
|
/* skip any links we find */ |
|
continue; |
|
break; |
|
default: |
|
/* erase the filename */ |
|
TtaFileUnlink (filename); |
|
break; |
|
} |
|
} |
|
closedir (dp); |
|
/* erase the directory */ |
|
rmdir (dirname); |
|
} |
|
#endif /* AMAYA_WWW_CACHE */ |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
CacheInit |
CacheInit |
Reads the cache settings from the thot.ini file. |
Reads the cache settings from the thot.ini file. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
|
#ifdef __STDC__ |
static void CacheInit (void) |
static void CacheInit (void) |
|
#else |
|
static void Cacheinit () |
|
#endif |
|
|
{ |
{ |
#ifndef AMAYA_WWW_CACHE |
#ifndef AMAYA_WWW_CACHE |
HTCacheMode_setEnabled (NO); |
HTCacheMode_setEnabled (NO); |
Line 1150 static void CacheInit (void)
|
Line 1223 static void CacheInit (void)
|
{ |
{ |
/* remove the lock and clean the cache (the clean cache will remove |
/* remove the lock and clean the cache (the clean cache will remove |
all, making the following call unnecessary */ |
all, making the following call unnecessary */ |
TtaFileUnlink (strptr); |
strcpy (strptr, cache_dir); |
/* CleanCache (cache_dir); */ |
/* @@@ add DIRSEP */ |
|
strcat (strptr, "/"); |
|
CleanCache (strptr); |
} |
} |
TtaFreeMemory (strptr); |
TtaFreeMemory (strptr); |
|
|
Line 1172 static void CacheInit (void)
|
Line 1247 static void CacheInit (void)
|
Reads any proxies settings which may be declared as environmental |
Reads any proxies settings which may be declared as environmental |
variables or in the thot.ini file. The former overrides the latter. |
variables or in the thot.ini file. The former overrides the latter. |
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
|
#ifdef __STDC__ |
static void ProxyInit (void) |
static void ProxyInit (void) |
|
#else |
|
static void ProxyInit () |
|
#endif /* __STDC__ */ |
{ |
{ |
char *strptr; |
char *strptr; |
char *str = NULL; |
char *str = NULL; |
Line 1203 static void ProxyInit (void)
|
Line 1282 static void ProxyInit (void)
|
|
|
/* use libw3's routine to get all proxy settings from the environment */ |
/* use libw3's routine to get all proxy settings from the environment */ |
HTProxy_getEnvVar (); |
HTProxy_getEnvVar (); |
|
|
} |
} |
|
|
|
|