Commit d7498aeb authored by Per Cederqvist's avatar Per Cederqvist

Added functions wrapper functions around a few stdio functions,

and use them when accessing database files.  This is a preparatory
step for introducing "struct dbfile", which will enable lyskomd to
manipulate more than one database file format at the same time.
That ability is needed for solving bug 1616.
* src/server/ram-io.c, src/server/ram-io.h: New files.
(dbfile_ftell): New function.
(dbfile_getc): New function.
(dbfile_ungetc): New function.
* src/server/Makefile.am (libcheck_a_SOURCES): Added ram-io.c.
(lyskomd_SOURCES): Added ram-io.h and ram-io.c.
(DBCK): Added ram-io.h and ram-io.c.
* src/server/simple-cache.c (read_person): Check the return value
from fparse_set_pos().
(read_conference): Ditto.
(read_text_stat): Ditto.
(write_conf): New static function.
(save_one_conf): Use it to simplify code.
(write_text): New static function.
(save_one_text): Use it to simplify code.
* src/server/ram-parse.h, src/server/ram-parse.c
(fparse_set_pos): New function.
* src/server/ram-output.c: Include ram-io.h.
(foutput_space): New static function.  Use it where appropriate.
(foutput_bool): Ditto.
(foutput_array_start): Ditto.
(foutput_array_end): Ditto.
(foutput_array_nodata): Ditto.
* src/server/ram-output.h, src/server/ram-output.c
(foutput_atsign): New function.
(foutput_newline): New function.
* src/server/dbck-cache.c: Include ram-io.h.  Use dbfile_getc()
instead of getc(), dbfile_ungetc() instead of ungetc(), and
dbfile_ftell() instead of ftell(), when accessing the database
file.  Use foutput_atsign and foutput_newline when appropriate.
* src/server/local-to-global.c: Ditto.
* src/server/ram-parse.c: Ditto.
* src/server/simple-cache.c: Ditto.
parent 4c0b3245
2006-10-17 Per Cederqvist <ceder@lysator.liu.se>
Added functions wrapper functions around a few stdio functions,
and use them when accessing database files. This is a preparatory
step for introducing "struct dbfile", which will enable lyskomd to
manipulate more than one database file format at the same time.
That ability is needed for solving bug 1616.
* src/server/ram-io.c, src/server/ram-io.h: New files.
(dbfile_ftell): New function.
(dbfile_getc): New function.
(dbfile_ungetc): New function.
* src/server/Makefile.am (libcheck_a_SOURCES): Added ram-io.c.
(lyskomd_SOURCES): Added ram-io.h and ram-io.c.
(DBCK): Added ram-io.h and ram-io.c.
* src/server/simple-cache.c (read_person): Check the return value
from fparse_set_pos().
(read_conference): Ditto.
(read_text_stat): Ditto.
(write_conf): New static function.
(save_one_conf): Use it to simplify code.
(write_text): New static function.
(save_one_text): Use it to simplify code.
* src/server/ram-parse.h, src/server/ram-parse.c
(fparse_set_pos): New function.
* src/server/ram-output.c: Include ram-io.h.
(foutput_space): New static function. Use it where appropriate.
(foutput_bool): Ditto.
(foutput_array_start): Ditto.
(foutput_array_end): Ditto.
(foutput_array_nodata): Ditto.
* src/server/ram-output.h, src/server/ram-output.c
(foutput_atsign): New function.
(foutput_newline): New function.
* src/server/dbck-cache.c: Include ram-io.h. Use dbfile_getc()
instead of getc(), dbfile_ungetc() instead of ungetc(), and
dbfile_ftell() instead of ftell(), when accessing the database
file. Use foutput_atsign and foutput_newline when appropriate.
* src/server/local-to-global.c: Ditto.
* src/server/ram-parse.c: Ditto.
* src/server/simple-cache.c: Ditto.
2006-10-01 Per Cederqvist <ceder@lysator.liu.se>
Check that conferences read from the database are the expected
......
......@@ -64,7 +64,7 @@ endif
check_LIBRARIES = libcheck.a
libcheck_a_SOURCES = local-to-global.c ram-parse.c ram-output.c \
log.c ram-smalloc.c memory.c getopt.c getopt1.c \
misc-types.c
misc-types.c ram-io.c
lyskomd_SOURCES = $(DISKOBJS) $(GENOBJS) \
aux-item-def-parse.y \
......@@ -75,7 +75,8 @@ lyskomd_SOURCES = $(DISKOBJS) $(GENOBJS) \
text.h isc-interface.h isc-malloc.h isc-parse.h \
kom-memory.h local-to-global.h log.h lyskomd.h manipulate.h \
minmax.h param.h prot-a-output.h prot-a-parse.h \
prot-a-send-async.h prot-a.h ram-output.h ram-parse.h \
prot-a-send-async.h prot-a.h \
ram-io.h ram-io.c ram-output.h ram-parse.h \
rfc931.h send-async.h server-config.h string-malloc.h \
text-garb.h version-info.h sigflags.h trace-alloc.h \
lockdb.h lockdb.c server-time.h oop-malloc.h oop-malloc.c \
......@@ -153,7 +154,7 @@ DISKOBJS = ramkomd.c ram-smalloc.c simple-cache.c ram-parse.c ram-output.c \
GETOPT = getopt.c getopt1.c
NODIST_DBCK = version-info.c
DBCK = dbck.c dbck-cache.c ram-smalloc.c ram-parse.c server-config.c \
ram-output.c memory.c conf-file.c $(GETOPT) \
ram-io.c ram-output.c memory.c conf-file.c $(GETOPT) \
local-to-global.c lockdb.h lockdb.c
# Files for encrypt (a program to transform the database from unencrypted
......
This diff is collapsed.
......@@ -24,6 +24,7 @@
#include "s-string.h"
#include "kom-types.h"
#include "ram-io.h"
#include "local-to-global.h"
#include "log.h"
#include "ram-parse.h"
......@@ -1182,10 +1183,10 @@ l2g_read(FILE *fp, Local_to_global *l2g)
/* Read past the start marker */
fskipwhite(fp);
if ( (c = getc(fp)) == EOF || c != '[')
if ( (c = dbfile_getc(fp)) == EOF || c != '[')
{
kom_log("l2g_read() failed to find ``['' marker at pos %lu.\n",
(unsigned long) ftell(fp));
kom_log("l2g_read() failed to find ``['' marker at pos %ld.\n",
dbfile_ftell(fp));
return FAILURE;
}
......@@ -1194,10 +1195,10 @@ l2g_read(FILE *fp, Local_to_global *l2g)
/* Read numbers until the EOL (end-of-l2g :-) ) marker is read. */
while (1)
{
if ((c = getc(fp)) == EOF)
if ((c = dbfile_getc(fp)) == EOF)
{
kom_log("l2g_read(): unexpected EOF at pos %lu.\n",
(unsigned long) ftell(fp));
kom_log("l2g_read(): unexpected EOF at pos %ld.\n",
dbfile_ftell(fp));
return FAILURE;
}
......@@ -1207,16 +1208,16 @@ l2g_read(FILE *fp, Local_to_global *l2g)
lno = fparse_long(fp);
if (lno == 0)
{
kom_log("l2g_read(): got local number 0 at pos %lu.\n",
(unsigned long) ftell(fp));
kom_log("l2g_read(): got local number 0 at pos %ld.\n",
dbfile_ftell(fp));
return FAILURE;
}
break;
case ',':
if (lno == 0)
{
kom_log("l2g_read(): missing local number at pos %lu.\n",
(unsigned long)ftell(fp));
kom_log("l2g_read(): missing local number at pos %ld.\n",
dbfile_ftell(fp));
return FAILURE;
}
++lno;
......@@ -1224,8 +1225,8 @@ l2g_read(FILE *fp, Local_to_global *l2g)
case ':':
if (lno == 0)
{
kom_log("l2g_read(): missing local number at pos %lu.\n",
(unsigned long)ftell(fp));
kom_log("l2g_read(): missing local number at pos %ld.\n",
dbfile_ftell(fp));
return FAILURE;
}
tno = fparse_long(fp);
......@@ -1236,8 +1237,8 @@ l2g_read(FILE *fp, Local_to_global *l2g)
l2g->first_unused = first_unused;
return OK;
default:
kom_log("l2g_read(): unexpected character ``%c'' at pos %lu.\n",
c, (unsigned long) ftell(fp));
kom_log("l2g_read(): unexpected character ``%c'' at pos %ld.\n",
c, dbfile_ftell(fp));
return FAILURE;
}
}
......
/* Database file handling.
* Copyright (C) 1991, 1993-1999, 2001-2003 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
*
* LysKOM is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* LysKOM is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with LysKOM; see the file COPYING. If not, write to
* Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
* or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* Please report bugs at http://bugzilla.lysator.liu.se/.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#include <stdio.h>
#include <assert.h>
#include "timewrap.h"
#include "server/smalloc.h"
#include "eintr.h"
#include "kom-types.h"
#include "ram-io.h"
#include "ram-parse.h"
#include "lyskomd.h"
#include "log.h"
long
dbfile_ftell(FILE *fp)
{
return ftell(fp);
}
int
dbfile_getc(FILE *fp)
{
return getc(fp);
}
int
dbfile_ungetc(FILE *fp,
int c)
{
return ungetc(c, fp);
}
/* Store database file state.
* Copyright (C) 2006 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
*
* LysKOM is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* LysKOM is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with LysKOM; see the file COPYING. If not, write to
* Lysator, c/o ISY, Linkoping University, S-581 83 Linkoping, SWEDEN,
* or the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
* Please report bugs at http://bugzilla.lysator.liu.se/.
*/
long
dbfile_ftell(FILE *fp);
int
dbfile_getc(FILE *fp);
int
dbfile_ungetc(FILE *fp, int c);
......@@ -44,6 +44,7 @@
#include "s-string.h"
#include "kom-types.h"
#include "ram-io.h"
#include "ram-output.h"
#include "lyskomd.h"
#include "log.h"
......@@ -64,6 +65,11 @@ static void foutput_string(FILE *, String);
static void foutput_text_list(FILE *, const Local_to_global *);
static void foutput_time(FILE *, time_t);
static void foutput_ulong(unsigned long, FILE *);
static void foutput_space(FILE *fp);
static void foutput_bool(FILE *fp, int val);
static void foutput_array_start(FILE *fp);
static void foutput_array_end(FILE *fp);
static void foutput_array_nodata(FILE *fp);
static int output_format = 2;
......@@ -163,7 +169,7 @@ foutput_person_2(FILE *fp,
foutput_priv_bits (fp, person->privileges);
foutput_personal_flags (fp, person->flags);
putc(' ', fp);
foutput_space(fp);
l2g_write (fp, &person->created_texts);
foutput_mark_list (fp, person->marks);
foutput_membership_list (fp, person->conferences);
......@@ -210,7 +216,7 @@ foutput_conference_2(FILE *fp,
{
foutput_string(fp, conf_c->name);
foutput_member_list(fp, conf_c->members);
putc(' ', fp);
foutput_space(fp);
l2g_write(fp, &conf_c->texts);
foutput_conf_type(fp, conf_c->type);
......@@ -314,13 +320,13 @@ foutput_text_stat_0(FILE *fp,
if ( t_stat->misc_items != NULL && t_stat->no_of_misc > 0 )
{
fputs(" {", fp);
foutput_array_start(fp);
for ( i = 0; i < t_stat->no_of_misc; i++ )
foutput_misc_info(fp, t_stat->misc_items[ i ]);
fputs(" }", fp);
foutput_array_end(fp);
}
else
fputs(" *", fp);
foutput_array_nodata(fp);
}
static void
......@@ -340,13 +346,13 @@ foutput_text_stat_2(FILE *fp,
if ( t_stat->misc_items != NULL && t_stat->no_of_misc > 0 )
{
fputs(" {", fp);
foutput_array_start(fp);
for ( i = 0; i < t_stat->no_of_misc; i++ )
foutput_misc_info(fp, t_stat->misc_items[ i ]);
fputs(" }", fp);
foutput_array_end(fp);
}
else
fputs(" *", fp);
foutput_array_nodata(fp);
foutput_ulong((unsigned long) t_stat->highest_aux, fp);
foutput_aux_item_list(fp, &t_stat->aux_item_list);
......@@ -377,15 +383,15 @@ static void
foutput_aux_flags(FILE *fp,
Aux_item_flags f)
{
putc(' ', fp);
putc(f.deleted + '0', fp);
putc(f.inherit + '0', fp);
putc(f.secret + '0', fp);
putc(f.hide_creator + '0', fp);
putc(f.dont_garb + '0', fp);
putc(f.reserved3 + '0', fp);
putc(f.reserved4 + '0', fp);
putc(f.reserved5 + '0', fp);
foutput_space(fp);
foutput_bool(fp, f.deleted);
foutput_bool(fp, f.inherit);
foutput_bool(fp, f.secret);
foutput_bool(fp, f.hide_creator);
foutput_bool(fp, f.dont_garb);
foutput_bool(fp, f.reserved3);
foutput_bool(fp, f.reserved4);
foutput_bool(fp, f.reserved5);
}
static void
......@@ -430,13 +436,13 @@ foutput_aux_item_list(FILE *fp,
foutput_ulong((unsigned long) aux->length, fp);
if (aux->items && aux->length > 0)
{
fputs(" {", fp);
foutput_array_start(fp);
for (i = 0; i < aux->length; i++)
foutput_aux_item(fp, &aux->items[i]);
fputs(" }", fp);
foutput_array_end(fp);
}
else
fputs(" *", fp);
foutput_array_nodata(fp);
}
......@@ -444,15 +450,15 @@ static void
foutput_membership_type(FILE *fp,
Membership_type type)
{
putc(' ', fp);
putc(type.invitation + '0', fp);
putc(type.passive + '0', fp);
putc(type.secret + '0', fp);
putc(type.passive_message_invert + '0', fp);
putc(type.reserved2 + '0', fp);
putc(type.reserved3 + '0', fp);
putc(type.reserved4 + '0', fp);
putc(type.reserved5 + '0', fp);
foutput_space(fp);
foutput_bool(fp, type.invitation);
foutput_bool(fp, type.passive);
foutput_bool(fp, type.secret);
foutput_bool(fp, type.passive_message_invert);
foutput_bool(fp, type.reserved2);
foutput_bool(fp, type.reserved3);
foutput_bool(fp, type.reserved4);
foutput_bool(fp, type.reserved5);
}
static void
......@@ -573,38 +579,38 @@ static void
foutput_priv_bits(FILE *fp,
Priv_bits bits)
{
putc(' ', fp);
putc(bits.wheel + '0', fp);
putc(bits.admin + '0', fp);
putc(bits.statistic + '0', fp);
putc(bits.create_pers + '0', fp);
putc(bits.create_conf + '0', fp);
putc(bits.change_name + '0', fp);
putc(bits.flg7 + '0', fp);
putc(bits.flg8 + '0', fp);
putc(bits.flg9 + '0', fp);
putc(bits.flg10 + '0', fp);
putc(bits.flg11 + '0', fp);
putc(bits.flg12 + '0', fp);
putc(bits.flg13 + '0', fp);
putc(bits.flg14 + '0', fp);
putc(bits.flg15 + '0', fp);
putc(bits.flg16 + '0', fp);
foutput_space(fp);
foutput_bool(fp, bits.wheel);
foutput_bool(fp, bits.admin);
foutput_bool(fp, bits.statistic);
foutput_bool(fp, bits.create_pers);
foutput_bool(fp, bits.create_conf);
foutput_bool(fp, bits.change_name);
foutput_bool(fp, bits.flg7);
foutput_bool(fp, bits.flg8);
foutput_bool(fp, bits.flg9);
foutput_bool(fp, bits.flg10);
foutput_bool(fp, bits.flg11);
foutput_bool(fp, bits.flg12);
foutput_bool(fp, bits.flg13);
foutput_bool(fp, bits.flg14);
foutput_bool(fp, bits.flg15);
foutput_bool(fp, bits.flg16);
}
static void
foutput_personal_flags(FILE *fp,
Personal_flags flags)
{
putc(' ', fp);
putc(flags.unread_is_secret + '0', fp);
putc(flags.flg2 + '0', fp);
putc(flags.flg3 + '0', fp);
putc(flags.flg4 + '0', fp);
putc(flags.flg5 + '0', fp);
putc(flags.flg6 + '0', fp);
putc(flags.flg7 + '0', fp);
putc(flags.flg8 + '0', fp);
foutput_space(fp);
foutput_bool(fp, flags.unread_is_secret);
foutput_bool(fp, flags.flg2);
foutput_bool(fp, flags.flg3);
foutput_bool(fp, flags.flg4);
foutput_bool(fp, flags.flg5);
foutput_bool(fp, flags.flg6);
foutput_bool(fp, flags.flg7);
foutput_bool(fp, flags.flg8);
}
......@@ -626,13 +632,13 @@ foutput_text_list(FILE *fp,
if (first < end)
{
fputs(" {", fp);
foutput_array_start(fp);
while (first < end)
foutput_ulong((unsigned long)l2g_lookup(text_list, first++), fp);
fputs(" }", fp);
foutput_array_end(fp);
}
else
fprintf(fp, " *");
foutput_array_nodata(fp);
}
......@@ -674,13 +680,13 @@ foutput_membership_list_0 (FILE * fp,
if ( mlist.confs != NULL && mlist.no_of_confs > 0 )
{
fprintf(fp, " {");
foutput_array_start(fp);
for ( i = 0; i < mlist.no_of_confs; i++)
foutput_membership_0(fp, mlist.confs + i);
fprintf(fp, " }");
foutput_array_end(fp);
}
else
fprintf(fp, " *");
foutput_array_nodata(fp);
}
static void
......@@ -693,13 +699,13 @@ foutput_membership_list_2 (FILE * fp,
if ( mlist.confs != NULL && mlist.no_of_confs > 0 )
{
fprintf(fp, " {");
foutput_array_start(fp);
for ( i = 0; i < mlist.no_of_confs; i++)
foutput_membership_2(fp, mlist.confs + i);
fprintf(fp, " }");
foutput_array_end(fp);
}
else
fprintf(fp, " *");
foutput_array_nodata(fp);
}
static void
......@@ -738,13 +744,13 @@ foutput_member_list(FILE *fp,
fprintf(fp, " %lu", (unsigned long)m_list.no_of_members);
if ( m_list.members != NULL && m_list.no_of_members > 0 )
{
fprintf(fp, " {");
foutput_array_start(fp);
for ( i = 0; i < m_list.no_of_members; i++ )
foutput_member(fp, m_list.members[ i ]);
fprintf(fp, " }");
foutput_array_end(fp);
}
else
fprintf(fp, " *");
foutput_array_nodata(fp);
}
......@@ -789,26 +795,26 @@ static void
foutput_conf_type_1(FILE *fp,
Conf_type type)
{
putc(' ', fp);
putc(type.rd_prot + '0', fp);
putc(type.original + '0', fp);
putc(type.secret + '0', fp);
putc(type.letter_box + '0', fp);
putc(type.allow_anon + '0', fp);
putc(type.forbid_secret + '0', fp);
putc(type.reserved2 + '0', fp);
putc(type.reserved3 + '0', fp);
foutput_space(fp);
foutput_bool(fp, type.rd_prot);
foutput_bool(fp, type.original);
foutput_bool(fp, type.secret);
foutput_bool(fp, type.letter_box);
foutput_bool(fp, type.allow_anon);
foutput_bool(fp, type.forbid_secret);
foutput_bool(fp, type.reserved2);
foutput_bool(fp, type.reserved3);
}
static void
foutput_conf_type_0(FILE *fp,
Conf_type type)
{
putc(' ', fp);
putc(type.rd_prot + '0', fp);
putc(type.original + '0', fp);
putc(type.secret + '0', fp);
putc(type.letter_box + '0', fp);
foutput_space(fp);
foutput_bool(fp, type.rd_prot);
foutput_bool(fp, type.original);
foutput_bool(fp, type.secret);
foutput_bool(fp, type.letter_box);
}
static void
......@@ -889,7 +895,7 @@ foutput_ulong (unsigned long l,
static char buf[sizeof(unsigned long) * 3 + 1];
char *cp;
putc(' ', fp);
foutput_space(fp);
if (l < 10)
putc("0123456789"[l], fp);
else
......@@ -903,3 +909,45 @@ foutput_ulong (unsigned long l,
fwrite(cp, buf + sizeof(buf) - cp, 1, fp);
}
}
void
foutput_atsign(FILE *fp)
{
putc('@', fp);
}
void
foutput_newline(FILE *fp)
{
putc('\n', fp);
}
void
foutput_space(FILE *fp)
{
putc(' ', fp);
}
void
foutput_array_start(FILE *fp)
{
fputs(" {", fp);
}
void
foutput_array_end(FILE *fp)
{
fputs(" }", fp);
}
void
foutput_array_nodata(FILE *fp)
{
fputs(" *", fp);
}
void
foutput_bool(FILE *fp, int val)
{
putc(val + '0', fp);
}
......@@ -54,5 +54,11 @@ extern void
foutput_membership(FILE *fp,
Membership *mship);
extern void
foutput_atsign(FILE *fp);
extern void
foutput_newline(FILE *fp);
extern void
set_output_format(int fmt);
This diff is collapsed.
......@@ -136,5 +136,9 @@ extern Success
fparse_misc_info(FILE *fp,
Misc_info *result);
extern Success
fparse_set_pos(FILE *fp,
long offset);
extern void
set_input_format(int fmt);
......@@ -69,6 +69,7 @@
#include "cache-node.h"
#include "cache.h"
#include "parser.h"
#include "ram-io.h"
#include "ram-parse.h"
#include "ram-output.h"
#include "server/smalloc.h"
......@@ -258,8 +259,10 @@ read_person(FILE *fp,
long pers_no;
long new_pos;
if (fparse_set_pos(fp, pos+1) != OK) /* Skip 'P' */
return NULL;
p = alloc_person();
fseek(fp, pos+1, SEEK_SET); /* Skip 'P' */
pers_no = fparse_long(fp);
if ( fparse_person(fp, p) != OK )
{
......@@ -267,7 +270,7 @@ read_person(FILE *fp,
return NULL;
}
new_pos = ftell(fp);
new_pos = dbfile_ftell(fp);
if (new_pos < 0)
{
kom_log("ftell failed: %s. Ignored.\n", strerror(errno));
......@@ -292,8 +295,10 @@ read_conference(FILE *fp,
long conf_no;
long new_pos;
if (fparse_set_pos(fp, pos+1) != OK) /* Skip 'C' */
return NULL;
c = alloc_conference();
fseek(fp, pos+1, SEEK_SET); /* Skip 'C' */
conf_no = fparse_long(fp);
if ( fparse_conference(fp, c) != OK )
{
......@@ -301,7 +306,7 @@ read_conference(FILE *fp,
return NULL;
}
new_pos = ftell(fp);
new_pos = dbfile_ftell(fp);
if (new_pos < 0)
{
kom_log("ftell failed: %s. Ignored.\n", strerror(errno));
......@@ -324,8 +329,10 @@ read_text_stat(FILE *fp,
Text_stat *t;
long dummy;
if (fparse_set_pos(fp, pos+1) != OK) /* Skip 'T' */
return NULL;
t = alloc_text_stat();
fseek(fp, pos+1, SEEK_SET); /* Skip 'T' */
dummy = fparse_long(fp);
if ( fparse_text_stat(fp, t) != OK )
{
......@@ -2085,6 +2092,15 @@ copy_file(FILE *from,
}
}
static void
write_conf(FILE *fp,
Conference *c,
int conf_no)
{
fprintf(fp, "C %d", conf_no);
foutput_conference(fp, c);
}
static void
save_one_conf(void)
{
......@@ -2110,24 +2126,22 @@ save_one_conf(void)
{
#ifdef FASTSAVE
cn->saved_pos = cn->pos;
cn->pos = ftell(file_b);
cn->pos = dbfile_ftell(file_b);