Commit b114adff authored by Per Cederqvist's avatar Per Cederqvist

(init_cache): Handle database format 2.

parent 9e99c073
/*
* $Id: dbck-cache.c,v 0.31 1998/07/26 16:48:36 ceder Exp $
* $Id: dbck-cache.c,v 0.32 1998/07/26 20:19:19 ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -33,7 +33,7 @@
*/
static const char *
rcsid = "$Id: dbck-cache.c,v 0.31 1998/07/26 16:48:36 ceder Exp $";
rcsid = "$Id: dbck-cache.c,v 0.32 1998/07/26 20:19:19 ceder Exp $";
#include "rcs.h"
USE(rcsid);
......@@ -885,6 +885,7 @@ init_cache(void)
}
break;
case 1:
case 2:
fseek(fp, 12, SEEK_SET);
if (vflag)
log("Data file version is '%ld'\n", data_file_version);
......@@ -903,7 +904,8 @@ init_cache(void)
for ( i = 1;
(data_file_version == 0 && i < next_free_num && !feof(fp)) ||
(data_file_version == 1 && !done);
(data_file_version == 1 && !done) ||
(data_file_version == 2 && !done);
i++ )
{
num = i;
......@@ -921,6 +923,7 @@ init_cache(void)
break;
case 1:
case 2:
done = 1;
break;
......@@ -937,6 +940,7 @@ init_cache(void)
conf_arr[num] = NULL;
break;
case 1:
case 2:
restart_kom("@ record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
break;
......@@ -954,6 +958,7 @@ init_cache(void)
data_file_version, (unsigned long)ftell(fp));
break;
case 1:
case 2:
if (fparse_info(fp, &kom_info) != OK)
restart_kom("Invalid I record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
......@@ -1004,6 +1009,7 @@ init_cache(void)
break;
case 1:
case 2:
num = fparse_long(fp);
if (conf_arr[num])
free_conference(conf_arr[num]);
......@@ -1030,6 +1036,7 @@ init_cache(void)
break;
case 1:
case 2:
num = fparse_long(fp);
if (pers_arr[num])
free_person(pers_arr[num]);
......@@ -1054,6 +1061,7 @@ init_cache(void)
break;
case 1:
case 2:
num = fparse_long(fp);
if (text_arr[num])
free_text_stat(text_arr[num]);
......@@ -1091,6 +1099,7 @@ init_cache(void)
s_strcpy(&name_list[i], conf_arr[ i ]->name);
break;
case 1:
case 2:
restart_kom("+ record in data file version %ld at %lu.\n",
data_file_version, (unsigned long)ftell(fp));
break;
......@@ -1109,6 +1118,7 @@ init_cache(void)
break;
case 1:
case 2:
switch (c = getc(fp))
{
case 'C':
......@@ -1142,6 +1152,7 @@ init_cache(void)
break;
case 1:
case 2:
switch(c = getc(fp))
{
case 'C':
......
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