From: Adam Dickmeiss Date: Tue, 28 Nov 1995 09:09:38 +0000 (+0000) Subject: Zebra config renamed. X-Git-Tag: ZEBRA.1.0~655 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=162fa86044b5aa303c03fa26f1ecf140b34060d5;p=idzebra-moved-to-github.git Zebra config renamed. Use setting 'recordId' to identify record now. Bug fix in recindex.c: rec_release_blocks was invokeded even though the blocks were already released. File traversal properly deletes records when needed. --- diff --git a/index/extract.c b/index/extract.c index c122198..285003d 100644 --- a/index/extract.c +++ b/index/extract.c @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: extract.c,v $ - * Revision 1.33 1995-11-27 09:56:20 adam + * Revision 1.34 1995-11-28 09:09:38 adam + * Zebra config renamed. + * Use setting 'recordId' to identify record now. + * Bug fix in recindex.c: rec_release_blocks was invokeded even + * though the blocks were already released. + * File traversal properly deletes records when needed. + * + * Revision 1.33 1995/11/27 09:56:20 adam * Record info elements better enumerated. Internal store of records. * * Revision 1.32 1995/11/25 10:24:05 adam @@ -526,7 +533,6 @@ static int atois (const char **s) static char *fileMatchStr (struct recKeys *reckeys, struct recordGroup *rGroup, const char *fname, - const char *recordType, const char *spec) { static char dstBuf[2048]; @@ -614,7 +620,7 @@ static char *fileMatchStr (struct recKeys *reckeys, struct recordGroup *rGroup, else if (strcmp (special, "filename")) spec_src = fname; else if (strcmp (special, "type")) - spec_src = recordType; + spec_src = rGroup->recordType; else spec_src = NULL; if (spec_src) @@ -660,7 +666,6 @@ static char *fileMatchStr (struct recKeys *reckeys, struct recordGroup *rGroup, static int recordExtract (SYSNO *sysno, const char *fname, struct recordGroup *rGroup, int deleteFlag, int fd, - const char *file_type, RecType recType) { struct recExtractCtrl extractCtrl; @@ -669,21 +674,23 @@ static int recordExtract (SYSNO *sysno, const char *fname, SYSNO sysnotmp; Record rec; - extractCtrl.fd = fd; - - /* extract keys */ - extractCtrl.subType = ""; - extractCtrl.init = wordInit; - extractCtrl.add = addRecordKeyAny; - - reckeys.buf_used = 0; - extractCtrl.readf = file_read; - r = (*recType->extract)(&extractCtrl); - - if (r) + if (fd != -1) { - logf (LOG_WARN, "Couldn't extract file %s, code %d", fname, r); - return 0; + extractCtrl.fd = fd; + /* extract keys */ + extractCtrl.subType = ""; + extractCtrl.init = wordInit; + extractCtrl.add = addRecordKeyAny; + + reckeys.buf_used = 0; + extractCtrl.readf = file_read; + r = (*recType->extract)(&extractCtrl); + + if (r) + { + logf (LOG_WARN, "Couldn't extract file %s, code %d", fname, r); + return 0; + } } /* perform match if sysno not known and if match criteria is specified */ @@ -693,12 +700,12 @@ static int recordExtract (SYSNO *sysno, const char *fname, { sysnotmp = 0; sysno = &sysnotmp; - if (rGroup->fileMatch) + if (rGroup->recordId && *rGroup->recordId) { char *rinfo; - matchStr = fileMatchStr(&reckeys, rGroup, fname, file_type, - rGroup->fileMatch); + matchStr = fileMatchStr (&reckeys, rGroup, fname, + rGroup->recordId); if (matchStr) { rinfo = dict_lookup (matchDict, matchStr); @@ -721,7 +728,7 @@ static int recordExtract (SYSNO *sysno, const char *fname, logf (LOG_LOG, "? record %s", fname); return 1; } - logf (LOG_LOG, "add record %s", fname); + logf (LOG_LOG, "add %s record %s", rGroup->recordType, fname); rec = rec_new (records); *sysno = rec->sysno; @@ -748,7 +755,8 @@ static int recordExtract (SYSNO *sysno, const char *fname, fname); } else - logf (LOG_LOG, "delete record %s", fname); + logf (LOG_LOG, "delete %s record %s", rGroup->recordType, + fname); records_deleted++; rec_del (records, &rec); return 1; @@ -762,7 +770,8 @@ static int recordExtract (SYSNO *sysno, const char *fname, } else { - logf (LOG_LOG, "update record %s", fname); + logf (LOG_LOG, "update %s record %s", rGroup->recordType, + fname); flushRecordKeys (*sysno, 1, &reckeys, rGroup->databaseName); records_updated++; } @@ -770,7 +779,7 @@ static int recordExtract (SYSNO *sysno, const char *fname, } free (rec->info[recInfo_fileType]); rec->info[recInfo_fileType] = - rec_strdup (file_type, &rec->size[recInfo_fileType]); + rec_strdup (rGroup->recordType, &rec->size[recInfo_fileType]); free (rec->info[recInfo_filename]); rec->info[recInfo_filename] = @@ -826,16 +835,19 @@ static int recordExtract (SYSNO *sysno, const char *fname, return 1; } -int fileExtract (SYSNO *sysno, const char *fname, struct recordGroup *rGroup, - int deleteFlag) +int fileExtract (SYSNO *sysno, const char *fname, + const struct recordGroup *rGroupP, int deleteFlag) { int i, fd; char gprefix[128]; char ext[128]; char ext_res[128]; - const char *file_type; RecType recType; + struct recordGroup rGroupM; + struct recordGroup *rGroup = &rGroupM; + memcpy (rGroup, rGroupP, sizeof(*rGroupP)); + if (!rGroup->groupName || !*rGroup->groupName) *gprefix = '\0'; else @@ -856,22 +868,35 @@ int fileExtract (SYSNO *sysno, const char *fname, struct recordGroup *rGroup, break; } /* determine file type - depending on extension */ - sprintf (ext_res, "%sfileExtension.%s", gprefix, ext); - if (!(file_type = res_get (common_resource, ext_res))) + if (!rGroup->recordType) + { + sprintf (ext_res, "%srecordType.%s", gprefix, ext); + if (!(rGroup->recordType = res_get (common_resource, ext_res))) + { + sprintf (ext_res, "%srecordType", gprefix); + if (!(rGroup->recordType = res_get (common_resource, ext_res))) + { + logf (LOG_LOG, "? record %s", fname); + return 0; + } + } + } + if (!rGroup->recordType) + { + logf (LOG_LOG, "? record %s", fname); return 0; - if (!(recType = recType_byName (file_type))) + } + if (!(recType = recType_byName (rGroup->recordType))) + { + logf (LOG_WARN, "No such record type: %s", rGroup->recordType); return 0; + } /* determine match criteria */ - if (rGroup->fileMatch) + if (!rGroup->recordId) { - sprintf (ext_res, "%sfileMatch.%s", gprefix, ext); - rGroup->fileMatch = res_get (common_resource, ext_res); - if (!rGroup->fileMatch) - { - sprintf (ext_res, "%sfileMatch", gprefix); - rGroup->fileMatch = res_get (common_resource, ext_res); - } + sprintf (ext_res, "%srecordId.%s", gprefix, ext); + rGroup->recordId = res_get (common_resource, ext_res); } /* determine database name */ @@ -918,17 +943,21 @@ int fileExtract (SYSNO *sysno, const char *fname, struct recordGroup *rGroup, if (rGroup->flagStoreKeys == -1) rGroup->flagStoreKeys = 0; - /* open input file */ - if ((fd = open (fname, O_RDONLY)) == -1) + if (sysno && deleteFlag) + fd = -1; + else { - logf (LOG_WARN|LOG_ERRNO, "open %s", fname); - return 0; + if ((fd = open (fname, O_RDONLY)) == -1) + { + logf (LOG_WARN|LOG_ERRNO, "open %s", fname); + return 0; + } } file_read_start (fd); - recordExtract (sysno, fname, rGroup, deleteFlag, fd, - file_type, recType); + recordExtract (sysno, fname, rGroup, deleteFlag, fd, recType); file_read_stop (fd); - close (fd); + if (fd != -1) + close (fd); return 1; } diff --git a/index/index.h b/index/index.h index 1894cb5..8d6d117 100644 --- a/index/index.h +++ b/index/index.h @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: index.h,v $ - * Revision 1.28 1995-11-27 13:58:53 adam + * Revision 1.29 1995-11-28 09:09:40 adam + * Zebra config renamed. + * Use setting 'recordId' to identify record now. + * Bug fix in recindex.c: rec_release_blocks was invokeded even + * though the blocks were already released. + * File traversal properly deletes records when needed. + * + * Revision 1.28 1995/11/27 13:58:53 adam * New option -t. storeStore data implemented in server. * * Revision 1.27 1995/11/25 10:24:06 adam @@ -127,8 +134,8 @@ struct recordGroup { char *groupName; char *databaseName; char *path; - char *fileMatch; - char *fileType; + char *recordId; + char *recordType; int flagStoreData; int flagStoreKeys; }; @@ -163,6 +170,7 @@ int merge_sort (char **buf, int from, int to); #define TEMP_FNAME "keys%d.tmp" #define FNAME_WORD_DICT "worddict" #define FNAME_WORD_ISAM "wordisam" +#define FNAME_CONFIG "zebra.cfg" struct strtab *strtab_mk (void); int strtab_src (struct strtab *t, const char *name, void ***infop); @@ -174,4 +182,4 @@ int index_word_prefix (char *string, int attset_ordinal, int local_attribute, const char *databaseName); int fileExtract (SYSNO *sysno, const char *fname, - struct recordGroup *rGroup, int deleteFlag); + const struct recordGroup *rGroup, int deleteFlag); diff --git a/index/main.c b/index/main.c index 6347230..140ef98 100644 --- a/index/main.c +++ b/index/main.c @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: main.c,v $ - * Revision 1.21 1995-11-27 14:27:39 adam + * Revision 1.22 1995-11-28 09:09:42 adam + * Zebra config renamed. + * Use setting 'recordId' to identify record now. + * Bug fix in recindex.c: rec_release_blocks was invokeded even + * though the blocks were already released. + * File traversal properly deletes records when needed. + * + * Revision 1.21 1995/11/27 14:27:39 adam * Renamed 'update' command to 'dir'. * * Revision 1.20 1995/11/27 13:58:53 adam @@ -93,21 +100,21 @@ int main (int argc, char **argv) int nsections; int key_open_flag = 0; - struct recordGroup rGroup; + struct recordGroup rGroupDef; - rGroup.groupName = NULL; - rGroup.databaseName = NULL; - rGroup.path = NULL; - rGroup.fileMatch = NULL; - rGroup.flagStoreData = -1; - rGroup.flagStoreKeys = -1; - rGroup.fileType = NULL; + rGroupDef.groupName = NULL; + rGroupDef.databaseName = NULL; + rGroupDef.path = NULL; + rGroupDef.recordId = NULL; + rGroupDef.recordType = NULL; + rGroupDef.flagStoreData = -1; + rGroupDef.flagStoreKeys = -1; prog = *argv; if (argc < 2) { fprintf (stderr, "index [-v log] [-m meg] [-c config] [-d base]" - " [-g group] cmd1 dir1 cmd2 dir2 ...\n"); + " [-g group] [update|del dir] ...\n"); exit (1); } while ((ret = options ("t:c:g:v:m:d:", argv, argc, &arg)) != -2) @@ -116,18 +123,10 @@ int main (int argc, char **argv) { if(cmd == 0) /* command */ { - if (!strcmp (arg, "add")) - { - cmd = 'a'; - } - else if (!strcmp (arg, "del")) - { - cmd = 'd'; - } - else if (!strcmp (arg, "dir")) - { + if (!strcmp (arg, "update")) cmd = 'u'; - } + else if (!strcmp (arg, "del") || !strcmp(arg, "delete")) + cmd = 'd'; else { logf (LOG_FATAL, "Unknown command: %s", arg); @@ -136,17 +135,20 @@ int main (int argc, char **argv) } else { + struct recordGroup rGroup; + + memcpy (&rGroup, &rGroupDef, sizeof(rGroup)); if (!common_resource) { common_resource = res_open (configName ? - configName : "base"); + configName : FNAME_CONFIG); if (!common_resource) { logf (LOG_FATAL, "Cannot open resource `%s'", configName); exit (1); } - data1_tabpath = res_get (common_resource, "data1_tabpath"); + data1_tabpath = res_get (common_resource, "profilePath"); assert (data1_tabpath); } if (!key_open_flag) @@ -157,8 +159,6 @@ int main (int argc, char **argv) rGroup.path = arg; if (cmd == 'u') repositoryUpdate (&rGroup); - else if (cmd == 'a') - repositoryAdd (&rGroup); else if (cmd == 'd') repositoryDelete (&rGroup); cmd = 0; @@ -174,16 +174,16 @@ int main (int argc, char **argv) } else if (ret == 'd') { - rGroup.databaseName = arg; + rGroupDef.databaseName = arg; } else if (ret == 'g') { - rGroup.groupName = arg; + rGroupDef.groupName = arg; } else if (ret == 'c') configName = arg; else if (ret == 't') - rGroup.fileType = arg; + rGroupDef.recordType = arg; else { logf (LOG_FATAL, "Unknown option '-%s'", arg); @@ -195,7 +195,7 @@ int main (int argc, char **argv) nsections = key_close (); if (!nsections) exit (0); - logf (LOG_LOG, "Input"); + logf (LOG_LOG, "Merging with index"); key_input (FNAME_WORD_DICT, FNAME_WORD_ISAM, nsections, 60); exit (0); } diff --git a/index/recindex.c b/index/recindex.c index 3233a3c..e56c0dc 100644 --- a/index/recindex.c +++ b/index/recindex.c @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: recindex.c,v $ - * Revision 1.6 1995-11-25 10:24:06 adam + * Revision 1.7 1995-11-28 09:09:43 adam + * Zebra config renamed. + * Use setting 'recordId' to identify record now. + * Bug fix in recindex.c: rec_release_blocks was invokeded even + * though the blocks were already released. + * File traversal properly deletes records when needed. + * + * Revision 1.6 1995/11/25 10:24:06 adam * More record fields - they are enumerated now. * New options: flagStoreData flagStoreKey. * @@ -75,7 +82,8 @@ struct records_info { } head; }; -enum recordCacheFlag { recordFlagNop, recordFlagWrite, recordFlagDelete }; +enum recordCacheFlag { recordFlagNop, recordFlagWrite, recordFlagNew, + recordFlagDelete }; struct record_cache_entry { Record rec; @@ -161,6 +169,7 @@ static void rec_release_blocks (Records p, int sysno) freeblock = entry.u.used.next; assert (freeblock > 0); dst_type = freeblock & 7; + assert (dst_type < REC_BLOCK_TYPES); freeblock = freeblock / 8; while (freeblock) { @@ -193,6 +202,7 @@ static void rec_delete_single (Records p, Record rec) write_indx (p, rec->sysno, &entry, sizeof(entry)); } + static void rec_write_single (Records p, Record rec) { int i, size = 0; @@ -202,8 +212,6 @@ static void rec_write_single (Records p, Record rec) int block_prev = -1, block_free; struct record_index_entry entry; - rec_release_blocks (p, rec->sysno); - for (i = 0; i < REC_NO_INFO; i++) if (!rec->info[i]) size += sizeof(*rec->size); @@ -269,6 +277,11 @@ static void rec_write_single (Records p, Record rec) sizeof(int) + (p->tmp_buf+size) - cptr, cptr); } +static void rec_update_single (Records p, Record rec) +{ + rec_release_blocks (p, rec->sysno); + rec_write_single (p, rec); +} Records rec_open (int rw) { @@ -331,7 +344,7 @@ Records rec_open (int rw) for (i = 0; idata_fname[i] = malloc (strlen(str)+1); strcpy (p->data_fname[i], str); p->data_BFile[i] = NULL; @@ -366,9 +379,12 @@ static void rec_cache_flush (Records p) { case recordFlagNop: break; - case recordFlagWrite: + case recordFlagNew: rec_write_single (p, e->rec); break; + case recordFlagWrite: + rec_update_single (p, e->rec); + break; case recordFlagDelete: rec_delete_single (p, e->rec); break; @@ -387,7 +403,7 @@ static Record *rec_cache_lookup (Records p, int sysno, struct record_cache_entry *e = p->record_cache + i; if (e->rec->sysno == sysno) { - if (flag != recordFlagNop) + if (flag != recordFlagNop && e->flag == recordFlagNop) e->flag = flag; return &e->rec; } @@ -453,6 +469,7 @@ Record rec_get (Records p, int sysno) read_indx (p, sysno, &entry, sizeof(entry), 0); dst_type = entry.u.used.next & 7; + assert (dst_type < REC_BLOCK_TYPES); freeblock = entry.u.used.next / 8; assert (freeblock > 0); @@ -527,7 +544,7 @@ Record rec_new (Records p) rec->info[i] = NULL; rec->size[i] = 0; } - rec_cache_insert (p, rec, recordFlagWrite); + rec_cache_insert (p, rec, recordFlagNew); return rec; } diff --git a/index/recindex.h b/index/recindex.h index 3f4c182..1ec146a 100644 --- a/index/recindex.h +++ b/index/recindex.h @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: recindex.h,v $ - * Revision 1.6 1995-11-27 09:56:21 adam + * Revision 1.7 1995-11-28 09:09:45 adam + * Zebra config renamed. + * Use setting 'recordId' to identify record now. + * Bug fix in recindex.c: rec_release_blocks was invokeded even + * though the blocks were already released. + * File traversal properly deletes records when needed. + * + * Revision 1.6 1995/11/27 09:56:21 adam * Record info elements better enumerated. Internal store of records. * * Revision 1.5 1995/11/25 10:24:07 adam @@ -31,6 +38,7 @@ typedef struct record_info { int sysno; + int newFlag; char *info[REC_NO_INFO]; size_t size[REC_NO_INFO]; } *Record; diff --git a/index/trav.c b/index/trav.c index 4ac3629..d055ad5 100644 --- a/index/trav.c +++ b/index/trav.c @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: trav.c,v $ - * Revision 1.12 1995-11-24 11:31:37 adam + * Revision 1.13 1995-11-28 09:09:46 adam + * Zebra config renamed. + * Use setting 'recordId' to identify record now. + * Bug fix in recindex.c: rec_release_blocks was invokeded even + * though the blocks were already released. + * File traversal properly deletes records when needed. + * + * Revision 1.12 1995/11/24 11:31:37 adam * Commands add & del read filenames from stdin if source directory is * empty. * Match criteria supports 'constant' strings. @@ -99,10 +106,41 @@ static void stdinExtractR (int deleteFlag, struct recordGroup *rGroup) { char tmppath[256]; + logf (LOG_LOG, "stdinExtractR"); while (scanf ("%s", tmppath) == 1) fileExtract (NULL, tmppath, rGroup, deleteFlag); } +static void repositoryDeleteR (struct dirs_info *di, struct dirs_entry *dst, + const char *base, char *src, + struct recordGroup *rGroup) +{ + char tmppath[256]; + size_t src_len = strlen (src); + + while (dst && !repComp (dst->path, src, src_len+1)) + { + switch (dst->kind) + { + case dirs_file: + sprintf (tmppath, "%s%s", base, dst->path); + fileExtract (&dst->sysno, tmppath, rGroup, 1); + + strcpy (tmppath, dst->path); + dst = dirs_read (di); + dirs_del (di, tmppath); + break; + case dirs_dir: + strcpy (tmppath, dst->path); + dst = dirs_read (di); + dirs_rmdir (di, tmppath); + break; + default: + dst = dirs_read (di); + } + } +} + static void repositoryUpdateR (struct dirs_info *di, struct dirs_entry *dst, const char *base, char *src, struct recordGroup *rGroup) @@ -133,7 +171,8 @@ static void repositoryUpdateR (struct dirs_info *di, struct dirs_entry *dst, } else if (!e_src) { - /* delete tree dst */ + strcpy (src, dst->path); + repositoryDeleteR (di, dst, base, src, rGroup); return; } else @@ -178,7 +217,10 @@ static void repositoryUpdateR (struct dirs_info *di, struct dirs_entry *dst, if (e_src[i_src].ctime > dst->ctime) { if (fileExtract (&dst->sysno, tmppath, rGroup, 0)) + { + logf (LOG_LOG, "dirs_add"); dirs_add (di, src, dst->sysno, e_src[i_src].ctime); + } } dst = dirs_read (di); break; @@ -214,27 +256,66 @@ static void repositoryUpdateR (struct dirs_info *di, struct dirs_entry *dst, } else /* sd < 0 */ { - assert (0); + strcpy (src, dst->path); + sprintf (tmppath, "%s%s", base, dst->path); + + switch (dst->kind) + { + case dirs_file: + fileExtract (&dst->sysno, tmppath, rGroup, 1); + dirs_del (di, dst->path); + dst = dirs_read (di); + break; + case dirs_dir: + repositoryDeleteR (di, dst, base, src, rGroup); + dst = dirs_last (di); + } } } dir_free (&e_src); } +static void groupRes (struct recordGroup *rGroup) +{ + char resStr[256]; + char gPrefix[256]; + + if (!rGroup->groupName || !*rGroup->groupName) + *gPrefix = '\0'; + else + sprintf (gPrefix, "%s.", rGroup->groupName); + + sprintf (resStr, "%srecordId", gPrefix); + rGroup->recordId = res_get (common_resource, resStr); +} + void repositoryUpdate (struct recordGroup *rGroup) { - struct dirs_info *di; char src[256]; - Dict dict; - dict = dict_open ("repdict", 40, 1); + groupRes (rGroup); + if (rGroup->recordId && !strcmp (rGroup->recordId, "file")) + { + Dict dict; + struct dirs_info *di; - assert (rGroup->path); - di = dirs_open (dict, rGroup->path); - strcpy (src, ""); - repositoryUpdateR (di, dirs_read (di), rGroup->path, src, rGroup); - dirs_free (&di); + dict = dict_open ("repdict", 40, 1); - dict_close (dict); + assert (rGroup->path); + di = dirs_open (dict, rGroup->path); + strcpy (src, ""); + repositoryUpdateR (di, dirs_read (di), rGroup->path, src, rGroup); + dirs_free (&di); + dict_close (dict); + } + else + { + strcpy (src, rGroup->path); + if (*src == '\0') + stdinExtractR (0, rGroup); + else + repositoryExtractR (0, src, rGroup); + } } void repositoryDelete (struct recordGroup *rGroup) @@ -242,6 +323,7 @@ void repositoryDelete (struct recordGroup *rGroup) char src[256]; assert (rGroup->path); + groupRes (rGroup); strcpy (src, rGroup->path); if (*src == '\0') stdinExtractR (1, rGroup); @@ -249,15 +331,3 @@ void repositoryDelete (struct recordGroup *rGroup) repositoryExtractR (1, src, rGroup); } -void repositoryAdd (struct recordGroup *rGroup) -{ - char src[256]; - - assert (rGroup->path); - strcpy (src, rGroup->path); - if (*src == '\0') - stdinExtractR (0, rGroup); - else - repositoryExtractR (0, src, rGroup); -} - diff --git a/index/zebra.cfg b/index/zebra.cfg new file mode 100644 index 0000000..1cf8a41 --- /dev/null +++ b/index/zebra.cfg @@ -0,0 +1,22 @@ +# Zebra configuration file +# $Id: zebra.cfg,v 1.1 1995-11-28 09:09:47 adam Exp $ +# +#register: dir1:100M + +# News group. Indexed as normal text +news.recordType.: text +news.database: news + +# Grs group. Indexed as GRS. +grs.recordType.grs: grs +grs.recordId: $database (1,12) +grs.database: esdd + +profilePath: /usr/local/yaz + +attset: bib1.att +attset: gils.att + +wordisam.blocktypes: 64 1K 4K +wordisam.maxkeys: 160 750 +wordisam.nicefill: 80 80 80 diff --git a/index/zserver.c b/index/zserver.c index 3251127..2bfe9c8 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -4,7 +4,14 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: zserver.c,v $ - * Revision 1.27 1995-11-27 13:58:54 adam + * Revision 1.28 1995-11-28 09:09:48 adam + * Zebra config renamed. + * Use setting 'recordId' to identify record now. + * Bug fix in recindex.c: rec_release_blocks was invokeded even + * though the blocks were already released. + * File traversal properly deletes records when needed. + * + * Revision 1.27 1995/11/27 13:58:54 adam * New option -t. storeStore data implemented in server. * * Revision 1.26 1995/11/25 10:24:07 adam @@ -128,7 +135,7 @@ bend_initresult *bend_init (bend_initrequest *q) } } - data1_tabpath = res_get(common_resource, "data1_tabpath"); + data1_tabpath = res_get(common_resource, "profilePath"); server_info.sets = NULL; server_info.records = rec_open (0); @@ -196,7 +203,7 @@ static int record_int_read (int fd, char *buf, size_t count) return 0; l = (l < count) ? l : count; memcpy (buf, record_int_buf + record_int_pos, l); - record_int_buf += l; + record_int_pos += l; return l; } @@ -227,6 +234,7 @@ static int record_fetch (ZServerInfo *zi, int sysno, int score, ODR stream, record_int_len = rec->size[recInfo_storeData]; record_int_buf = rec->info[recInfo_storeData]; record_int_pos = 0; + logf (LOG_DEBUG, "Internal retrieve. %d bytes", record_int_len); } else { @@ -330,7 +338,7 @@ int main (int argc, char **argv) struct statserv_options_block *sob; sob = statserv_getcontrol (); - strcpy (sob->configname, "base"); + strcpy (sob->configname, FNAME_CONFIG); statserv_setcontrol (sob); return statserv_main (argc, argv);