Commit 554e4c59 authored by Per Cederqvist's avatar Per Cederqvist

Wrap all file pointers that refer to the database files inside a

"struct dbfile".  Add a database version field to that struct, and
remove the global database format variables.  This allows lyskomd
to have files in different versions open at the same time, so that
it can convert format X to format X+1 on the fly.  (This is more
preparation for bug 1616.)
* src/server/ram-io.h (struct dbfile): New struct.
(dbfile_delete): New function.
(set_output_format): New function.
(dbfile_open_write): New function.
(dbfile_open_read): New function.
(dump_dbfile_stats): New function.
(dbfile_ftell): The argument is now a struct dbfile*, not FILE*.
(dbfile_getc): Ditto.
(dbfile_ungetc): Ditto.
* src/server/ram-io.c (output_format): Moved from ram-output.c and
made static variable.  This defines the output format of all
struct dbfile objects created after a change to the variable.
(nr_dbfile_objects): New static statistics variable.
(nr_dbfile_files): New static statistics variable.
(dbfile_new): New static function.
(dbfile_delete): New function.
(set_output_format): Moved from ram-output.c.
(get_version): Moved from simple-cache.c.  Changed return type to
int.  The argument is an open dbfile, not a file name.  Use
dbfile_getc() instead of getc().
(dbfile_open_read): New function.
(dbfile_open_write): New function.
(dump_dbfile_stats): New function.
(dbfile_ftell): The argument is now a struct dbfile*, not FILE*.
(dbfile_getc): Ditto.
(dbfile_ungetc): Ditto.
* src/server/conference.c: Include ram-io.h, since
local-to-global.h needs it.
* src/server/memory.c: Ditto.
* src/server/person.c: Ditto.
* src/server/prot-a-output.c: Ditto.
* src/server/text.c: Ditto.
* src/server/membership.c: Include ram-io.h.
(read_ranges_postcondition): Set up a dbfile wrapper around stderr
for the report created if check_membership() fails.
* src/server/local-to-global.h, src/server/local-to-global.c
(l2g_read): The fp argument is now a struct dbfile*, not a FILE*.
* src/server/dbck.c (oformat): Removed.  The format is stored
inside the dbfile struct instead.
(main): Report an error message if an attempt to use an undefined
output format is detected.
* src/server/dbck-cache.c: Change all FILE* that refer to the
status files to struct dbfile* in all functions, and made
appropriate changes.  Use fp->format instead of the global
variable oformat or data_file_version.
(get_version): Moved to ram-io.c.
(sync_output_header): Removed the oformat argument.  Use
fp->format instead.  All callers updated.
(cache_sync_all): Use dbfile_open_write() instead of i_fopen(),
and dbfile_delete() instead of i_fclose().
(init_cache): Removed the data_file_version variable, as the
format is now stored inside the dbfile struct.  Use
dbfile_open_read() instead of i_fopen(), and dbfile_delete()
instead of i_fclose().
* doc/lyskomd.texi (Modifying Stored Types): The default database
format is now defined in ram-io.c, and nowhere else.  It is
preferrable if lyskomd is able to convert an old format to a new
one after an upgrade.
* src/server/testsuite/test-l2g.c (main): Added a dbfile wrapper
around stdin in call to l2g_read(), and another around stderr in
call to l2g_write().
* src/server/testsuite/Makefile.am (test_l2g_LDADD): Include
libeintr.a.
* src/server/simple-cache.c: Change all FILE* that refer to the
status files to struct dbfile* in all functions, and made
appropriate changes.
(pre_sync): Use dbfile_delete() instead of i_fclose(), and
dbfile_open_write() instead of i_fopen().
(post_sync): Use dbfile_delete() instead of i_fclose(), and
dbfile_open_read() instead of i_fopen().
(save_one_text): Use dbfile_delete() instead of i_fclose(), and
dbfile_open_read() instead of i_fopen().
(sync_part): Use dbfile_delete() instead of i_fclose().
(init_cache): Removed local variable datafile_version; use
fp->format instead.  Use dbfile_open_read() instead of i_fopen().
Removed call to set_input_format(), as dbfile_open_read() does
the same thing.
(free_all_cache): Use dbfile_delete() instead of i_fclose().
* src/server/ramkomd.c (dump_exit_statistics): Dump dbfile stats.
* src/server/ram-parse.h, src/server/ram-parse.c: Change all
FILE* that refer to the status files to struct dbfile* in all
functions, and made appropriate changes.
(set_input_format): Removed.
* src/server/ram-parse.c (input_format): Removed.  All users
changed to use fp->format instead, so that lyskomd can read files
with different versions at the same time.
(fparse_text_stat_2): Code cleanup.
(fparse_text_stat_0): Use dbfile_ungetc() instead of ungetc().
* src/server/ram-output.h, src/server/ram-output.c: Change all
FILE* that refer to the status files to struct dbfile* in all
functions, and made appropriate changes.
(output_format): Moved to ram-io.c and made static.
(set_output_format): Moved to ram-io.c.
parent 0a162ece
2006-10-19 Per Cederqvist <ceder@lysator.liu.se>
2006-10-20 Per Cederqvist <ceder@lysator.liu.se>
Wrap all file pointers that refer to the database files inside a
"struct dbfile". Add a database version field to that struct, and
remove the global database format variables. This allows lyskomd
to have files in different versions open at the same time, so that
it can convert format X to format X+1 on the fly. (This is more
preparation for bug 1616.)
* src/server/ram-io.h (struct dbfile): New struct.
(dbfile_delete): New function.
(set_output_format): New function.
(dbfile_open_write): New function.
(dbfile_open_read): New function.
(dump_dbfile_stats): New function.
(dbfile_ftell): The argument is now a struct dbfile*, not FILE*.
(dbfile_getc): Ditto.
(dbfile_ungetc): Ditto.
* src/server/ram-io.c (output_format): Moved from ram-output.c and
made static variable. This defines the output format of all
struct dbfile objects created after a change to the variable.
(nr_dbfile_objects): New static statistics variable.
(nr_dbfile_files): New static statistics variable.
(dbfile_new): New static function.
(dbfile_delete): New function.
(set_output_format): Moved from ram-output.c.
(get_version): Moved from simple-cache.c. Changed return type to
int. The argument is an open dbfile, not a file name. Use
dbfile_getc() instead of getc().
(dbfile_open_read): New function.
(dbfile_open_write): New function.
(dump_dbfile_stats): New function.
(dbfile_ftell): The argument is now a struct dbfile*, not FILE*.
(dbfile_getc): Ditto.
(dbfile_ungetc): Ditto.
* src/server/conference.c: Include ram-io.h, since
local-to-global.h needs it.
* src/server/memory.c: Ditto.
* src/server/person.c: Ditto.
* src/server/prot-a-output.c: Ditto.
* src/server/text.c: Ditto.
* src/server/membership.c: Include ram-io.h.
(read_ranges_postcondition): Set up a dbfile wrapper around stderr
for the report created if check_membership() fails.
* src/server/local-to-global.h, src/server/local-to-global.c
(l2g_read): The fp argument is now a struct dbfile*, not a FILE*.
* src/server/dbck.c (oformat): Removed. The format is stored
inside the dbfile struct instead.
(main): Report an error message if an attempt to use an undefined
output format is detected.
* src/server/dbck-cache.c: Change all FILE* that refer to the
status files to struct dbfile* in all functions, and made
appropriate changes. Use fp->format instead of the global
variable oformat or data_file_version.
(get_version): Moved to ram-io.c.
(sync_output_header): Removed the oformat argument. Use
fp->format instead. All callers updated.
(cache_sync_all): Use dbfile_open_write() instead of i_fopen(),
and dbfile_delete() instead of i_fclose().
(init_cache): Removed the data_file_version variable, as the
format is now stored inside the dbfile struct. Use
dbfile_open_read() instead of i_fopen(), and dbfile_delete()
instead of i_fclose().
* doc/lyskomd.texi (Modifying Stored Types): The default database
format is now defined in ram-io.c, and nowhere else. It is
preferrable if lyskomd is able to convert an old format to a new
one after an upgrade.
* src/server/testsuite/test-l2g.c (main): Added a dbfile wrapper
around stdin in call to l2g_read(), and another around stderr in
call to l2g_write().
* src/server/testsuite/Makefile.am (test_l2g_LDADD): Include
libeintr.a.
* src/server/simple-cache.c: Change all FILE* that refer to the
status files to struct dbfile* in all functions, and made
appropriate changes.
(pre_sync): Use dbfile_delete() instead of i_fclose(), and
dbfile_open_write() instead of i_fopen().
(post_sync): Use dbfile_delete() instead of i_fclose(), and
dbfile_open_read() instead of i_fopen().
(save_one_text): Use dbfile_delete() instead of i_fclose(), and
dbfile_open_read() instead of i_fopen().
(sync_part): Use dbfile_delete() instead of i_fclose().
(init_cache): Removed local variable datafile_version; use
fp->format instead. Use dbfile_open_read() instead of i_fopen().
Removed call to set_input_format(), as dbfile_open_read() does
the same thing.
(free_all_cache): Use dbfile_delete() instead of i_fclose().
* src/server/ramkomd.c (dump_exit_statistics): Dump dbfile stats.
* src/server/ram-parse.h, src/server/ram-parse.c: Change all
FILE* that refer to the status files to struct dbfile* in all
functions, and made appropriate changes.
(set_input_format): Removed.
* src/server/ram-parse.c (input_format): Removed. All users
changed to use fp->format instead, so that lyskomd can read files
with different versions at the same time.
(fparse_text_stat_2): Code cleanup.
(fparse_text_stat_0): Use dbfile_ungetc() instead of ungetc().
* src/server/ram-output.h, src/server/ram-output.c: Change all
FILE* that refer to the status files to struct dbfile* in all
functions, and made appropriate changes.
(output_format): Moved to ram-io.c and made static.
(set_output_format): Moved to ram-io.c.
Fixed more missed opportunities to use fparse_set_pos() and
foutput_newline().
......
......@@ -2445,9 +2445,8 @@ version dependent so that they can deal with the new database format.
Update all old functions in @file{ram-parse.c} that are database version
dependent so that they can deal with the new database format.
@item Set the default database format in @file{ram-parse.c} and
@file{ram-output.c}. The variables to change are @code{input_format} and
@file{output_format}, respectively.
@item Set the default database format in @file{ram-io.c}, by changing
@var{output_format}.
@item Don't forget to update the functions in @file{memory.c}
......@@ -2455,6 +2454,11 @@ dependent so that they can deal with the new database format.
@item Add as many test cases as are needed for the dbck conversion.
@item lyskomd should preferrably be able to convert from the previous
to the current format on-the-fly. Converting older formats on-the-fly
is not necessary. If somebody needs to upgrade several steps, they
can use dbck to perform the conversion.
@end enumerate
@menu
......
......@@ -61,6 +61,7 @@
#include "conf-file.h"
#include "param.h"
#include "aux-items.h"
#include "ram-io.h"
#include "local-to-global.h"
#include "server-time.h"
#include "stats.h"
......
......@@ -502,29 +502,6 @@ cached_unlock_conf(Conf_no UNUSED(conf_no))
{}
static long
get_version(const char *fn)
{
FILE *fp;
char c;
long version;
if ((fp = i_fopen(fn, "rb")) == NULL)
return -1;
fparse_set_pos(fp, 5);
if ( (c = dbfile_getc(fp)) == '\n')
{
i_fclose(fp);
return 0;
}
version = fparse_long(fp);
i_fclose(fp);
return version;
}
static Bool
is_clean(const char *fn)
{
......@@ -550,22 +527,22 @@ is_clean(const char *fn)
}
static void
sync_output_header(FILE* fp, const char *state, int oformat)
sync_output_header(struct dbfile* fp, const char *state)
{
switch (oformat)
switch (fp->format)
{
case 0:
fprintf(fp, "%s\n", state);
fprintf(fp->fp, "%s\n", state);
break;
case 1:
fprintf(fp, "%s:%05ld\n", state, (long)oformat);
fprintf(fp->fp, "%s:%05d\n", state, fp->format);
break;
case 2:
foutput_header(fp, state, 1);
break;
default:
restart_kom("sync_output_header(): Unknown output format %d",
oformat);
fp->format);
}
}
......@@ -584,7 +561,7 @@ timerdiff(struct timeval a,
extern void /* Write out everything. */
cache_sync_all(void)
{
FILE *fp;
struct dbfile *fp;
Conf_no ic;
Text_no it;
......@@ -617,7 +594,7 @@ cache_sync_all(void)
else
kom_log("cache_sync_all: datafile not clean. No backup taken.\n");
if ((fp = i_fopen(param.datafile_name, "w")) == NULL)
if ((fp = dbfile_open_write(param.datafile_name)) == NULL)
{
kom_log("WARNING: cache_sync_all: can't open file to save in.\n");
return;
......@@ -627,35 +604,35 @@ cache_sync_all(void)
* Print file header and other things that go before the conferences.
*/
switch (oformat)
switch (fp->format)
{
case 0:
sync_output_header(fp, "DIRTY", oformat);
fprintf(fp, "%d\n", next_free_num); /* NEXT_FREE_NUM */
sync_output_header(fp, "DIRTY");
fprintf(fp->fp, "%d\n", next_free_num); /* NEXT_FREE_NUM */
break;
case 1:
case 2:
sync_output_header(fp, "DIRTY", oformat);
fprintf(fp, "#C %d\n", next_free_num);
fprintf(fp, "#T %ld\n", next_text_num);
fprintf(fp, "I");
sync_output_header(fp, "DIRTY");
fprintf(fp->fp, "#C %d\n", next_free_num);
fprintf(fp->fp, "#T %ld\n", next_text_num);
fprintf(fp->fp, "I");
foutput_info(fp, &kom_info);
foutput_newline(fp);
break;
default:
restart_kom("Unknown output file format: %ld\n", oformat);
restart_kom("Unknown output file format: %d\n", fp->format);
}
for (ic = 1; ic < next_free_num; ic++) /* CONFS */
{
switch (oformat)
switch (fp->format)
{
case 0:
if (conf_arr[ic] == NULL)
foutput_atsign(fp);
else
{
fprintf(fp, "+ ");
fprintf(fp->fp, "+ ");
foutput_conference(fp, conf_arr[ic]);
}
foutput_newline(fp);
......@@ -664,14 +641,14 @@ cache_sync_all(void)
case 2:
if (conf_arr[ic] != NULL)
{
fprintf(fp, "C %lu", (unsigned long)ic);
fprintf(fp->fp, "C %lu", (unsigned long)ic);
foutput_conference(fp, conf_arr[ic]);
foutput_newline(fp);
}
break;
default:
restart_kom("Bad output file format: %ld\n", oformat);
restart_kom("Bad output file format: %d\n", fp->format);
}
}
#ifdef TIME_SYNC
......@@ -680,16 +657,16 @@ cache_sync_all(void)
#endif
for (ic = 1; ic < next_free_num; ic++) /* PERSONS */
{
switch (oformat)
switch (fp->format)
{
case 0:
if (pers_arr[ic] == NULL)
foutput_atsign(fp);
else
{
fprintf(fp, "+ ");
fprintf(fp, "%dH", PASSWD_LEN);
fwrite(pers_arr[ic]->pwd, PASSWD_LEN, 1, fp);
fprintf(fp->fp, "+ ");
fprintf(fp->fp, "%dH", PASSWD_LEN);
fwrite(pers_arr[ic]->pwd, PASSWD_LEN, 1, fp->fp);
foutput_person(fp, pers_arr[ic]);
}
foutput_newline(fp);
......@@ -698,16 +675,16 @@ cache_sync_all(void)
case 2:
if (pers_arr[ic] != NULL )
{
fprintf(fp, "P %lu", (unsigned long)ic);
fprintf(fp, " %dH", PASSWD_LEN);
fwrite(pers_arr[ic]->pwd, PASSWD_LEN, 1, fp);
fprintf(fp->fp, "P %lu", (unsigned long)ic);
fprintf(fp->fp, " %dH", PASSWD_LEN);
fwrite(pers_arr[ic]->pwd, PASSWD_LEN, 1, fp->fp);
foutput_person(fp, pers_arr[ic]);
foutput_newline(fp);
}
break;
default:
restart_kom("Bad output file format: %ld\n", oformat);
restart_kom("Bad output file format: %d\n", fp->format);
}
}
#ifdef TIME_SYNC
......@@ -719,29 +696,29 @@ cache_sync_all(void)
* Print things that go between persons and texts
*/
switch (oformat)
switch (fp->format)
{
case 0:
fprintf(fp, "%ld\n", next_text_num); /* NEXT_TEXT_NUM */
fprintf(fp->fp, "%ld\n", next_text_num); /* NEXT_TEXT_NUM */
break;
case 1:
case 2:
break;
default:
restart_kom("Unknown output file format: %ld\n", oformat);
restart_kom("Unknown output file format: %d\n", fp->format);
}
for (it = 1; it < next_text_num; it++) /* TEXT_STATS */
{
switch (oformat)
switch (fp->format)
{
case 0:
if (text_arr[it] == NULL)
foutput_atsign(fp);
else
{
fprintf(fp, "+ ");
fprintf(fp->fp, "+ ");
foutput_text_stat(fp, text_arr[it]);
}
foutput_newline(fp);
......@@ -750,13 +727,13 @@ cache_sync_all(void)
case 2:
if (text_arr[it] != NULL)
{
fprintf(fp, "T %lu", it);
fprintf(fp->fp, "T %lu", it);
foutput_text_stat(fp, text_arr[it]);
foutput_newline(fp);
}
break;
default:
restart_kom("Unknown output file format: %ld\n", oformat);
restart_kom("Unknown output file format: %d\n", fp->format);
}
}
......@@ -769,7 +746,7 @@ cache_sync_all(void)
* basically does...absolutely nothing.
*/
switch (oformat)
switch (fp->format)
{
case 0:
break;
......@@ -777,7 +754,7 @@ cache_sync_all(void)
case 2:
break;
default:
restart_kom("Unknown output file format: %ld\n", oformat);
restart_kom("Unknown output file format: %d\n", fp->format);
}
#ifdef TIME_SYNC
......@@ -788,9 +765,10 @@ cache_sync_all(void)
time(&atm);
#endif
rewind(fp);
sync_output_header(fp, "CLEAN", oformat);
i_fclose(fp);
rewind(fp->fp);
sync_output_header(fp, "CLEAN");
dbfile_delete(fp);
fp = NULL;
#ifdef TIME_SYNC
kom_log("Sync ready.\n"
......@@ -836,12 +814,11 @@ cache_open_new_text_file(void)
extern Success
init_cache(void)
{
FILE *fp = NULL;
struct dbfile *fp = NULL;
unsigned long i;
extern int vflag; /* from dbck.c */
extern Bool truncated_texts; /* from dbck.c */
long num;
long data_file_version;
char done, read_text_num, read_conf_num;
int c;
extern int modifications;
......@@ -878,8 +855,7 @@ init_cache(void)
if ( is_clean(param.datafile_name) )
{
data_file_version = get_version(param.datafile_name);
if ((fp = i_fopen(param.datafile_name, "rb")) == NULL)
if ((fp = dbfile_open_read(param.datafile_name)) == NULL)
{
kom_log("WARNING: init_cache: can't open datafile.\n");
return FAILURE;
......@@ -888,8 +864,7 @@ init_cache(void)
}
else if ( is_clean(param.backupfile_name) )
{
data_file_version = get_version(param.backupfile_name);
if ((fp = i_fopen(param.backupfile_name, "rb")) == NULL)
if ((fp = dbfile_open_read(param.backupfile_name)) == NULL)
{
kom_log("WARNING: init_cache: can't open backupfile.\n");
return FAILURE;
......@@ -902,19 +877,11 @@ init_cache(void)
return FAILURE;
}
/*
* If no output format has been selected, use the input format
*/
if (oformat == -1)
oformat = data_file_version;
/*
* Read file header
*/
set_input_format(data_file_version);
switch (data_file_version)
switch (fp->format)
{
case 0:
fparse_set_pos(fp, 6); /* skip clean/dirty flag. */
......@@ -922,7 +889,7 @@ init_cache(void)
read_conf_num = 1;
if (vflag)
{
kom_log("Data file version is '%ld'\n", data_file_version);
kom_log("Data file version is '%d'\n", fp->format);
kom_log("Reading %d conferences, starting at pos %ld.\n",
next_free_num-1, dbfile_ftell(fp));
}
......@@ -930,15 +897,15 @@ init_cache(void)
case 1:
fparse_set_pos(fp, 12);
if (vflag)
kom_log("Data file version is '%ld'\n", data_file_version);
kom_log("Data file version is '%d'\n", fp->format);
break;
case 2:
fparse_set_pos(fp, 33);
if (vflag)
kom_log("Data file version is '%ld'\n", data_file_version);
kom_log("Data file version is '%d'\n", fp->format);
break;
default:
restart_kom("Unknown input file format: %ld\n", data_file_version);
restart_kom("Unknown input file format: %d\n", fp->format);
}
done = 0;
......@@ -950,9 +917,9 @@ init_cache(void)
*/
for ( i = 1;
(data_file_version == 0 && i < next_free_num && !feof(fp)) ||
(data_file_version == 1 && !done) ||
(data_file_version == 2 && !done);
(fp->format == 0 && i < next_free_num && !feof(fp->fp)) ||
(fp->format == 1 && !done) ||
(fp->format == 2 && !done);
i++ )
{
num = i;
......@@ -961,12 +928,12 @@ init_cache(void)
switch(c = dbfile_getc(fp))
{
case EOF:
switch (data_file_version)
switch (fp->format)
{
case 0:
restart_kom("Unexpected end-of-file reading conferences "
"in data file version %ld.",
data_file_version);
"in data file version %d.",
fp->format);
break;
case 1:
......@@ -975,40 +942,40 @@ init_cache(void)
break;
default:
restart_kom("Unknown input file format: %ld\n",
data_file_version);
restart_kom("Unknown input file format: %d\n",
fp->format);
}
break;
case '@':
switch (data_file_version)
switch (fp->format)
{
case 0:
conf_arr[num] = NULL;
break;
case 1:
case 2:
restart_kom("@ record in data file version %ld at %ld.\n",
data_file_version, dbfile_ftell(fp));
restart_kom("@ record in data file version %d at %ld.\n",
fp->format, dbfile_ftell(fp));
break;
default:
restart_kom("Unknown input file format: %ld\n",
data_file_version);
restart_kom("Unknown input file format: %d\n",
fp->format);
}
break;
case 'I':
switch (data_file_version)
switch (fp->format)
{
case 0:
restart_kom("I record in data file version %ld at %ld.\n",
data_file_version, dbfile_ftell(fp));
restart_kom("I record in data file version %d at %ld.\n",
fp->format, dbfile_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 %ld.\n",
data_file_version, dbfile_ftell(fp));
restart_kom("Invalid I record in data file version %d at %ld.\n",
fp->format, dbfile_ftell(fp));
if (pers_pres_conf != -1)
{
......@@ -1042,17 +1009,17 @@ init_cache(void)
}
break;
default:
restart_kom("Unknown input file format: %ld\n",
data_file_version);
restart_kom("Unknown input file format: %d\n",
fp->format);
}
break;
case 'C':
switch (data_file_version)
switch (fp->format)
{
case 0:
restart_kom("C record in data file version %ld at %ld.\n",
data_file_version, dbfile_ftell(fp));
restart_kom("C record in data file version %d at %ld.\n",
fp->format, dbfile_ftell(fp));
break;
case 1:
......@@ -1069,17 +1036,17 @@ init_cache(void)
break;
default:
restart_kom("Unknown input file format: %ld\n",
data_file_version);
restart_kom("Unknown input file format: %d\n",
fp->format);
}
break;
case 'P':
switch (data_file_version)
switch (fp->format)
{
case 0:
restart_kom("P record in data file version %ld at %ld.\n",
data_file_version, dbfile_ftell(fp));
restart_kom("P record in data file version %d at %ld.\n",
fp->format, dbfile_ftell(fp));
break;
case 1:
......@@ -1094,17 +1061,17 @@ init_cache(void)
break;
default:
restart_kom("Unknown input file format: %ld\n",
data_file_version);
restart_kom("Unknown input file format: %d\n",
fp->format);
}
break;
case 'T':
switch (data_file_version)
switch (fp->format)
{
case 0:
restart_kom("T record in data file version %ld at %ld\n",
data_file_version, dbfile_ftell(fp));
restart_kom("T record in data file version %d at %ld\n",
fp->format, dbfile_ftell(fp));
break;
case 1:
......@@ -1129,13 +1096,13 @@ init_cache(void)
break;
default:
restart_kom("Unknown input file format: %ld\n",
data_file_version);
restart_kom("Unknown input file format: %d\n",
fp->format);
}
break;
case '+':
switch (data_file_version)
switch (fp->format)
{
case 0:
conf_arr[ i ] = alloc_conference();
......@@ -1147,21 +1114,21 @@ init_cache(void)
break;
case 1: