Commit fd67e69f authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Include "param.h".

(datafilename):   Removed.  All users modified to use
		  param.datafile_name instead.
(backupfilename): Removed.  All users modified to use
		  param.backupfile_name instead.
(textfilename):   Removed.  All users modified to use
		  param.textfile_name instead.
parent 082dccbd
/*
* $Id: dbck-cache.c,v 0.20 1994/04/05 08:00:49 ceder Exp $
* $Id: dbck-cache.c,v 0.21 1995/10/07 14:27:16 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -32,7 +32,7 @@
* Also save time as a time_t instead of a struct tm.
*/
static char *rcsid = "$Id: dbck-cache.c,v 0.20 1994/04/05 08:00:49 ceder Exp $";
static char *rcsid = "$Id: dbck-cache.c,v 0.21 1995/10/07 14:27:16 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -74,6 +74,7 @@ USE(rcsid);
#include "kom-memory.h"
#include "ram-parse.h"
#include "ram-output.h"
#include "param.h"
/*
* All functions that can fail sets kom_errno to a suitable value
......@@ -91,10 +92,6 @@ Text_stat * text_arr[ MAX_TEXT ];
int next_text_num = 1;
/* Defined in ramkomd.c */
extern char datafilename[];
extern char backupfilename[];
extern char textfilename[];
static FILE *text_file = NULL;
static FILE *new_text_file = NULL; /* Used when garbage collecting. */
......@@ -538,15 +535,15 @@ cache_sync(void)
time(&st);
#endif
if ( is_clean(datafilename) )
if ( is_clean(param.datafile_name) )
{
if ( rename(datafilename, backupfilename) != 0 )
if ( rename(param.datafile_name, param.backupfile_name) != 0 )
log("WARNING: cache_sync: can't backup.\n");
}
else
log("cache_sync: datafile not clean. No backup taken.\n");
if ( (fp=fopen(datafilename, "w") ) == NULL )
if ( (fp=fopen(param.datafile_name, "w") ) == NULL )
{
log("WARNING: cache_sync: can't open file to save in.\n");
return;
......@@ -649,7 +646,7 @@ cache_sync(void)
void
cache_open_new_text_file(void)
{
if ( ( new_text_file = fopen(textfilename, "w")) == NULL )
if ( ( new_text_file = fopen(param.textfile_name, "w")) == NULL )
{
log("Can't open file to save new texts. Goodbye.\n");
exit(1);
......@@ -666,25 +663,25 @@ init_cache(void)
new_text_file = NULL;
if ( (text_file = fopen(textfilename, "rb")) == NULL )
if ( (text_file = fopen(param.textfile_name, "rb")) == NULL )
{
perror(textfilename);
perror(param.textfile_name);
restart_kom("ERROR: init_cache: can't open text file %s.\n",
textfilename);
param.textfile_name);
}
if ( is_clean(datafilename) )
if ( is_clean(param.datafile_name) )
{
if ( (fp = fopen(datafilename, "rb")) == NULL )
if ( (fp = fopen(param.datafile_name, "rb")) == NULL )
{
log("WARNING: init_cache: can't open datafile.\n");
return FAILURE;
}
log("MSG: init_cache: using datafile.\n");
}
else if ( is_clean(backupfilename) )
else if ( is_clean(param.backupfile_name) )
{
if ( (fp = fopen(backupfilename, "rb")) == NULL )
if ( (fp = fopen(param.backupfile_name, "rb")) == NULL )
{
log("WARNING: init_cache: can't open backupfile.\n");
return FAILURE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment