/*
- * Copyright (C) 1995, Index Data I/S
+ * Copyright (C) 1994-1995, Index Data I/S
* All rights reserved.
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zserver.c,v $
- * Revision 1.4 1995-09-06 10:33:04 adam
+ * Revision 1.6 1995-09-08 08:53:22 adam
+ * Record buffer maintained in server_info.
+ *
+ * Revision 1.5 1995/09/06 16:11:18 adam
+ * Option: only one word key per file.
+ *
+ * Revision 1.4 1995/09/06 10:33:04 adam
* More work on present. Some log messages removed.
*
* Revision 1.3 1995/09/05 15:28:40 adam
r.errstring = "dict_open fail: filedict";
return &r;
}
- if (!(server_info.fileDict = dict_open (FNAME_FILE_DICT, 5, 0)))
+ if (!(server_info.fileDict = dict_open (FNAME_FILE_DICT, 10, 0)))
{
r.errcode = 1;
r.errstring = "dict_open fail: filedict";
return &r;
}
- if (!(server_info.wordDict = dict_open (FNAME_WORD_DICT, 20, 0)))
+ if (!(server_info.wordDict = dict_open (FNAME_WORD_DICT, 40, 0)))
{
dict_close (server_info.fileDict);
r.errcode = 1;
r.errstring = "dict_open fail: worddict";
return &r;
}
- if (!(server_info.wordIsam = is_open (FNAME_WORD_ISAM, key_compare, 0)))
+ if (!(server_info.wordIsam = is_open (FNAME_WORD_ISAM, key_compare, 0,
+ sizeof (struct it_key))))
{
dict_close (server_info.wordDict);
dict_close (server_info.fileDict);
r.errstring = "is_open fail: wordisam";
return &r;
}
+ server_info.recordBuf = NULL;
return &r;
}
r.last_in_set = 0;
r.basename = "base";
+ xfree (server_info.recordBuf);
+ server_info.recordBuf = NULL;
positions[0] = q->number;
records = resultSetRecordGet (&server_info, q->setname, 1, positions);
if (!records)
return &r;
}
r.len = records[0].size;
- r.record = malloc (r.len+1);
+ server_info.recordBuf = r.record = xmalloc (r.len+1);
strcpy (r.record, records[0].buf);
resultSetRecordDel (&server_info, records, 1);
r.format = VAL_SUTRS;
dict_close (server_info.wordDict);
is_close (server_info.wordIsam);
close (server_info.sys_idx_fd);
+ xfree (server_info.recordBuf);
+ server_info.recordBuf = NULL;
return;
}