2 * Copyright (C) 1994-1995, Index Data I/S
4 * Sebastian Hammer, Adam Dickmeiss
7 * Revision 1.51 1996-03-19 11:08:42 adam
8 * Bug fix: Log preamble wasn't always turned off after recordExtract.
10 * Revision 1.50 1996/02/12 18:45:36 adam
11 * New fileVerboseFlag in record group control.
13 * Revision 1.49 1996/02/05 12:29:57 adam
14 * Logging reduced a bit.
15 * The remaining running time is estimated during register merge.
17 * Revision 1.48 1996/02/01 20:53:26 adam
18 * The temporary per-record keys are compacted a little, and duplication
19 * of the per-records keys are avoided when they are saved in the record
22 * Revision 1.47 1996/01/17 14:57:48 adam
23 * Prototype changed for reader functions in extract/retrieve. File
24 * is identified by 'void *' instead of 'int.
26 * Revision 1.46 1995/12/15 14:57:16 adam
29 * Revision 1.45 1995/12/15 12:37:41 adam
30 * In addRecordKeyAny: Writes key only when attrSet != -1.
32 * Revision 1.44 1995/12/12 16:00:54 adam
33 * System call sync(2) used after update/commit.
34 * Locking (based on fcntl) uses F_EXLCK and F_SHLCK instead of F_WRLCK
37 * Revision 1.43 1995/12/11 09:12:46 adam
38 * The rec_get function returns NULL if record doesn't exist - will
39 * happen in the server if the result set records have been deleted since
40 * the creation of the set (i.e. the search).
41 * The server saves a result temporarily if it is 'volatile', i.e. the
42 * set is register dependent.
44 * Revision 1.42 1995/12/07 17:38:46 adam
45 * Work locking mechanisms for concurrent updates/commit.
47 * Revision 1.41 1995/12/06 16:06:42 adam
48 * Better diagnostics. Work on 'real' dictionary deletion.
50 * Revision 1.40 1995/12/05 16:57:40 adam
51 * More work on regular patterns.
53 * Revision 1.39 1995/12/05 13:20:18 adam
54 * Bug fix: file_read sometimes returned early EOF.
56 * Revision 1.38 1995/12/04 17:59:21 adam
57 * More work on regular expression conversion.
59 * Revision 1.37 1995/12/04 14:22:27 adam
60 * Extra arg to recType_byName.
61 * Started work on new regular expression parsed input to
64 * Revision 1.36 1995/11/30 08:34:29 adam
65 * Started work on commit facility.
66 * Changed a few malloc/free to xmalloc/xfree.
68 * Revision 1.35 1995/11/28 14:26:21 adam
69 * Bug fix: recordId with constant wasn't right.
70 * Bug fix: recordId dictionary entry wasn't deleted when needed.
72 * Revision 1.34 1995/11/28 09:09:38 adam
73 * Zebra config renamed.
74 * Use setting 'recordId' to identify record now.
75 * Bug fix in recindex.c: rec_release_blocks was invokeded even
76 * though the blocks were already released.
77 * File traversal properly deletes records when needed.
79 * Revision 1.33 1995/11/27 09:56:20 adam
80 * Record info elements better enumerated. Internal store of records.
82 * Revision 1.32 1995/11/25 10:24:05 adam
83 * More record fields - they are enumerated now.
84 * New options: flagStoreData flagStoreKey.
86 * Revision 1.31 1995/11/24 11:31:35 adam
87 * Commands add & del read filenames from stdin if source directory is
89 * Match criteria supports 'constant' strings.
91 * Revision 1.30 1995/11/22 17:19:16 adam
92 * Record management uses the bfile system.
94 * Revision 1.29 1995/11/21 15:01:14 adam
95 * New general match criteria implemented.
96 * New feature: document groups.
98 * Revision 1.28 1995/11/21 09:20:30 adam
99 * Yet more work on record match.
101 * Revision 1.27 1995/11/20 16:59:45 adam
102 * New update method: the 'old' keys are saved for each records.
104 * Revision 1.26 1995/11/20 11:56:24 adam
105 * Work on new traversal.
107 * Revision 1.25 1995/11/16 15:34:54 adam
108 * Uses new record management system in both indexer and server.
110 * Revision 1.24 1995/11/15 19:13:08 adam
111 * Work on record management.
113 * Revision 1.23 1995/10/27 14:00:10 adam
114 * Implemented detection of database availability.
116 * Revision 1.22 1995/10/17 18:02:07 adam
117 * New feature: databases. Implemented as prefix to words in dictionary.
119 * Revision 1.21 1995/10/10 12:24:38 adam
120 * Temporary sort files are compressed.
122 * Revision 1.20 1995/10/06 13:52:05 adam
123 * Bug fixes. Handler may abort further scanning.
125 * Revision 1.19 1995/10/04 12:55:16 adam
126 * Bug fix in ranked search. Use=Any keys inserted.
128 * Revision 1.18 1995/10/04 09:37:08 quinn
131 * Revision 1.17 1995/10/03 14:28:57 adam
132 * Buffered read in extract works.
134 * Revision 1.16 1995/10/03 14:28:45 adam
135 * Work on more effecient read handler in extract.
137 * Revision 1.15 1995/10/02 15:42:53 adam
138 * Extract uses file descriptors instead of FILE pointers.
140 * Revision 1.14 1995/10/02 15:29:13 adam
141 * More logging in file_extract.
143 * Revision 1.13 1995/09/29 14:01:39 adam
146 * Revision 1.12 1995/09/28 14:22:56 adam
147 * Sort uses smaller temporary files.
149 * Revision 1.11 1995/09/28 12:10:31 adam
150 * Bug fixes. Field prefix used in queries.
152 * Revision 1.10 1995/09/28 09:19:41 adam
153 * xfree/xmalloc used everywhere.
154 * Extract/retrieve method seems to work for text records.
156 * Revision 1.9 1995/09/27 12:22:28 adam
157 * More work on extract in record control.
158 * Field name is not in isam keys but in prefix in dictionary words.
160 * Revision 1.8 1995/09/14 07:48:22 adam
161 * Record control management.
163 * Revision 1.7 1995/09/11 13:09:32 adam
164 * More work on relevance feedback.
166 * Revision 1.6 1995/09/08 14:52:27 adam
167 * Minor changes. Dictionary is lower case now.
169 * Revision 1.5 1995/09/06 16:11:16 adam
170 * Option: only one word key per file.
172 * Revision 1.4 1995/09/05 15:28:39 adam
173 * More work on search engine.
175 * Revision 1.3 1995/09/04 12:33:41 adam
176 * Various cleanup. YAZ util used instead.
178 * Revision 1.2 1995/09/04 09:10:34 adam
179 * More work on index add/del/update.
180 * Merge sort implemented.
181 * Initial work on z39 server.
183 * Revision 1.1 1995/09/01 14:06:35 adam
184 * Split of work into more files.
193 #include <alexutil.h>
197 #include "recindex.h"
199 static Dict matchDict;
201 static Records records = NULL;
203 static char **key_buf;
204 static size_t ptr_top;
206 static size_t key_buf_used;
207 static int key_file_no;
209 static int records_inserted = 0;
210 static int records_updated = 0;
211 static int records_deleted = 0;
213 void key_open (int mem)
217 key_buf = xmalloc (mem);
218 ptr_top = mem/sizeof(char*);
224 if (!(matchDict = dict_open (GMATCH_DICT, 50, 1)))
226 logf (LOG_FATAL, "dict_open fail of %s", GMATCH_DICT);
230 records = rec_open (1);
239 void encode_key_init (struct encode_info *i)
245 char *encode_key_int (int d, char *bp)
254 else if (d <= 4194303)
256 *bp++ = 128 + (d>>16);
257 *bp++ = (d>>8) & 255;
262 *bp++ = 192 + (d>>24);
263 *bp++ = (d>>16) & 255;
264 *bp++ = (d>>8) & 255;
270 void encode_key_write (char *k, struct encode_info *i, FILE *outf)
275 while ((*bp++ = *k++))
277 memcpy (&key, k+1, sizeof(struct it_key));
278 bp = encode_key_int ( (key.sysno - i->sysno) * 2 + *k, bp);
279 if (i->sysno != key.sysno)
281 i->sysno = key.sysno;
284 bp = encode_key_int (key.seqno - i->seqno, bp);
285 i->seqno = key.seqno;
286 if (fwrite (i->buf, bp - i->buf, 1, outf) != 1)
288 logf (LOG_FATAL|LOG_ERRNO, "fwrite");
293 void key_flush (void)
298 struct encode_info encode_info;
304 logf (LOG_LOG, "sorting section %d", key_file_no);
305 qsort (key_buf + ptr_top-ptr_i, ptr_i, sizeof(char*), key_qsort_compare);
306 sprintf (out_fname, TEMP_FNAME, key_file_no);
308 if (!(outf = fopen (out_fname, "w")))
310 logf (LOG_FATAL|LOG_ERRNO, "fopen (4) %s", out_fname);
313 logf (LOG_LOG, "writing section %d", key_file_no);
314 prevcp = cp = key_buf[ptr_top-ptr_i];
316 encode_key_init (&encode_info);
317 encode_key_write (cp, &encode_info, outf);
320 cp = key_buf[ptr_top-ptr_i];
321 if (strcmp (cp, prevcp))
323 encode_key_init (&encode_info);
324 encode_key_write (cp, &encode_info, outf);
328 encode_key_write (cp + strlen(cp), &encode_info, outf);
332 logf (LOG_FATAL|LOG_ERRNO, "fclose %s", out_fname);
335 logf (LOG_LOG, "finished section %d", key_file_no);
344 rec_close (&records);
345 dict_close (matchDict);
347 logf (LOG_LOG, "Records inserted %6d", records_inserted);
348 logf (LOG_LOG, "Records updated %6d", records_updated);
349 logf (LOG_LOG, "Records deleted %6d", records_deleted);
353 static void wordInit (RecWord *p)
357 p->which = Word_String;
368 static void addRecordKey (const RecWord *p)
376 if (reckeys.buf_used+1024 > reckeys.buf_max)
380 b = xmalloc (reckeys.buf_max += 128000);
381 if (reckeys.buf_used > 0)
382 memcpy (b, reckeys.buf, reckeys.buf_used);
386 dst = reckeys.buf + reckeys.buf_used;
388 attrSet = p->attrSet;
389 if (reckeys.buf_used > 0 && reckeys.prevAttrSet == attrSet)
392 reckeys.prevAttrSet = attrSet;
393 attrUse = p->attrUse;
394 if (reckeys.buf_used > 0 && reckeys.prevAttrUse == attrUse)
397 reckeys.prevAttrUse = attrUse;
406 memcpy (dst, &attrSet, sizeof(attrSet));
407 dst += sizeof(attrSet);
411 memcpy (dst, &attrUse, sizeof(attrUse));
412 dst += sizeof(attrUse);
414 for (i = 0; p->u.string[i]; i++)
415 *dst++ = p->u.string[i];
418 memcpy (dst, &p->seqno, sizeof(p->seqno));
419 dst += sizeof(p->seqno);
425 reckeys.buf_used = dst - reckeys.buf;
428 static void flushRecordKeys (SYSNO sysno, int cmd, struct recKeys *reckeys,
429 const char *databaseName)
434 while (off < reckeys->buf_used)
436 const char *src = reckeys->buf + off;
444 memcpy (&attrSet, src, sizeof(attrSet));
445 src += sizeof(attrSet);
449 memcpy (&attrUse, src, sizeof(attrUse));
450 src += sizeof(attrUse);
452 if (key_buf_used + 1024 > (ptr_top-ptr_i)*sizeof(char*))
455 key_buf[ptr_top-ptr_i] = (char*)key_buf + key_buf_used;
456 key_buf_used += index_word_prefix ((char*)key_buf + key_buf_used,
457 attrSet, attrUse, databaseName);
459 ((char*)key_buf) [key_buf_used++] = index_char_cvt (*src++);
461 ((char*)key_buf) [key_buf_used++] = '\0';
463 ((char*) key_buf)[key_buf_used++] = cmd;
465 memcpy (&key.seqno, src, sizeof(key.seqno));
466 src += sizeof(key.seqno);
468 memcpy ((char*)key_buf + key_buf_used, &key, sizeof(key));
469 key_buf_used += sizeof(key);
470 off = src - reckeys->buf;
472 assert (off == reckeys->buf_used);
475 static const char **searchRecordKey (struct recKeys *reckeys,
476 int attrSetS, int attrUseS)
478 static const char *ws[32];
483 for (i = 0; i<32; i++)
486 while (off < reckeys->buf_used)
488 const char *src = reckeys->buf + off;
494 memcpy (&attrSet, src, sizeof(attrSet));
495 src += sizeof(attrSet);
497 memcpy (&attrUse, src, sizeof(attrUse));
498 src += sizeof(attrUse);
504 memcpy (&seqno, src, sizeof(seqno));
505 src += sizeof(seqno);
508 logf (LOG_LOG, "(%d,%d) %d %s", attrSet, attrUse, seqno, wstart);
510 if (attrUseS == attrUse && attrSetS == attrSet)
517 woff = seqno - startSeq;
518 if (woff >= 0 && woff < 31)
522 off = src - reckeys->buf;
524 assert (off == reckeys->buf_used);
528 static void addRecordKeyAny (const RecWord *p)
530 if (p->attrSet != 1 || p->attrUse != 1016)
534 memcpy (&w, p, sizeof(w));
539 if (p->attrSet != -1)
543 #define FILE_READ_BUFSIZE 4096
544 struct file_read_info {
547 #if FILE_READ_BUFSIZE
554 static struct file_read_info *file_read_start (int fd)
556 struct file_read_info *fi = xmalloc (sizeof(*fi));
560 #if FILE_READ_BUFSIZE
562 fi->file_buf = xmalloc (FILE_READ_BUFSIZE);
563 fi->file_bufsize = read (fd, fi->file_buf, FILE_READ_BUFSIZE);
568 static void file_read_stop (struct file_read_info *fi)
571 #if FILE_READ_BUFSIZE
572 xfree (fi->file_buf);
578 static int file_read (void *handle, char *buf, size_t count)
580 struct file_read_info *p = handle;
582 #if FILE_READ_BUFSIZE
583 int l = p->file_bufsize - p->file_offset;
589 memcpy (buf, p->file_buf + p->file_offset, l);
591 if (count > FILE_READ_BUFSIZE)
593 if ((r = read (fd, buf + l, count)) == -1)
595 logf (LOG_FATAL|LOG_ERRNO, "read");
600 p->file_noread += l+r;
603 p->file_bufsize = r = read (fd, p->file_buf, FILE_READ_BUFSIZE);
606 logf (LOG_FATAL|LOG_ERRNO, "read");
612 memcpy (buf + l, p->file_buf, r);
613 p->file_noread += l+r;
618 p->file_offset = count;
619 memcpy (buf + l, p->file_buf, count - l);
620 p->file_noread += count;
624 memcpy (buf, p->file_buf + p->file_offset, count);
625 p->file_offset += count;
626 p->file_noread += count;
630 r = read (fd, buf, count);
637 static int atois (const char **s)
640 while ( (c=**s) >= '0' && c <= '9')
642 val = val*10 + c - '0';
648 static char *fileMatchStr (struct recKeys *reckeys, struct recordGroup *rGroup,
652 static char dstBuf[2048];
654 const char *s = spec;
655 static const char **w;
660 while (*s == ' ' || *s == '\t')
667 int attrSet, attrUse;
671 attrSet = atois (&s);
674 logf (LOG_WARN, "Missing , in match criteria %s in group %s",
675 spec, rGroup->groupName ? rGroup->groupName : "none");
679 attrUse = atois (&s);
680 w = searchRecordKey (reckeys, attrSet, attrUse);
685 for (i = 0; i<32; i++)
690 logf (LOG_WARN, "Missing ) in match criteria %s in group %s",
691 spec, rGroup->groupName ? rGroup->groupName : "none");
696 for (i = 0; i<32; i++)
697 if (matchFlag[i] && w[i])
709 logf (LOG_WARN, "Record didn't contain match"
710 " fields in (%d,%d)", attrSet, attrUse);
718 const char *spec_src = NULL;
719 const char *s1 = ++s;
720 while (*s1 && *s1 != ' ' && *s1 != '\t')
726 memcpy (special, s, spec_len);
727 special[spec_len] = '\0';
730 if (!strcmp (special, "group"))
731 spec_src = rGroup->groupName;
732 else if (!strcmp (special, "database"))
733 spec_src = rGroup->databaseName;
734 else if (!strcmp (special, "filename"))
736 else if (!strcmp (special, "type"))
737 spec_src = rGroup->recordType;
742 strcpy (dst, spec_src);
743 dst += strlen (spec_src);
746 else if (*s == '\"' || *s == '\'')
748 int stopMarker = *s++;
752 while (*s && *s != stopMarker)
755 tmpString[i++] = *s++;
760 strcpy (dst, tmpString);
761 dst += strlen (tmpString);
765 logf (LOG_WARN, "Syntax error in match criteria %s in group %s",
766 spec, rGroup->groupName ? rGroup->groupName : "none");
773 logf (LOG_WARN, "No match criteria for record %s in group %s",
774 fname, rGroup->groupName ? rGroup->groupName : "none");
780 struct recordLogInfo {
783 struct recordGroup *rGroup;
786 static void recordLogPreamble (int level, const char *msg, void *info)
788 struct recordLogInfo *p = info;
789 FILE *outf = log_file ();
794 fprintf (outf, "%s of ", p->op);
795 fprintf (outf, "%s type %s\n", p->rGroup->recordType, p->fname);
796 log_event_start (NULL, NULL);
799 static int recordExtract (SYSNO *sysno, const char *fname,
800 struct recordGroup *rGroup, int deleteFlag,
801 struct file_read_info *fi, RecType recType,
804 struct recExtractCtrl extractCtrl;
809 struct recordLogInfo logInfo;
811 logInfo.fname = fname;
813 logInfo.rGroup = rGroup;
814 log_event_start (recordLogPreamble, &logInfo);
820 extractCtrl.subType = subType;
821 extractCtrl.init = wordInit;
822 extractCtrl.add = addRecordKeyAny;
824 reckeys.buf_used = 0;
825 reckeys.prevAttrUse = -1;
826 reckeys.prevAttrSet = -1;
827 extractCtrl.readf = file_read;
828 r = (*recType->extract)(&extractCtrl);
832 logf (LOG_WARN, "Couldn't extract file %s, code %d", fname, r);
837 /* perform match if sysno not known and if match criteria is specified */
844 if (rGroup->recordId && *rGroup->recordId)
848 matchStr = fileMatchStr (&reckeys, rGroup, fname,
852 rinfo = dict_lookup (matchDict, matchStr);
854 memcpy (sysno, rinfo+1, sizeof(*sysno));
858 logf (LOG_WARN, "Bad match criteria");
869 logf (LOG_LOG, "Cannot delete new record");
873 if (rGroup->fileVerboseFlag)
874 logf (LOG_LOG, "add %s %s", rGroup->recordType, fname);
875 rec = rec_new (records);
880 dict_insert (matchDict, matchStr, sizeof(*sysno), sysno);
882 flushRecordKeys (*sysno, 1, &reckeys, rGroup->databaseName);
888 struct recKeys delkeys;
890 rec = rec_get (records, *sysno);
892 delkeys.buf_used = rec->size[recInfo_delKeys];
893 delkeys.buf = rec->info[recInfo_delKeys];
894 flushRecordKeys (*sysno, 0, &delkeys, rec->info[recInfo_databaseName]);
897 logInfo.op = "delete";
898 if (!delkeys.buf_used)
900 logf (LOG_WARN, "cannot delete; storeKeys false");
904 if (rGroup->fileVerboseFlag)
905 logf (LOG_LOG, "delete %s %s", rGroup->recordType, fname);
908 dict_delete (matchDict, matchStr);
909 rec_del (records, &rec);
915 logInfo.op = "update";
916 if (!delkeys.buf_used)
918 logf (LOG_WARN, "cannot update; storeKeys false");
922 if (rGroup->fileVerboseFlag)
923 logf (LOG_LOG, "update %s %s", rGroup->recordType, fname);
924 flushRecordKeys (*sysno, 1, &reckeys, rGroup->databaseName);
929 xfree (rec->info[recInfo_fileType]);
930 rec->info[recInfo_fileType] =
931 rec_strdup (rGroup->recordType, &rec->size[recInfo_fileType]);
933 xfree (rec->info[recInfo_filename]);
934 rec->info[recInfo_filename] =
935 rec_strdup (fname, &rec->size[recInfo_filename]);
937 xfree (rec->info[recInfo_delKeys]);
938 if (reckeys.buf_used > 0 && rGroup->flagStoreKeys == 1)
941 rec->size[recInfo_delKeys] = reckeys.buf_used;
942 rec->info[recInfo_delKeys] = reckeys.buf;
946 rec->info[recInfo_delKeys] = xmalloc (reckeys.buf_used);
947 rec->size[recInfo_delKeys] = reckeys.buf_used;
948 memcpy (rec->info[recInfo_delKeys], reckeys.buf,
949 rec->size[recInfo_delKeys]);
954 rec->info[recInfo_delKeys] = NULL;
955 rec->size[recInfo_delKeys] = 0;
958 xfree (rec->info[recInfo_storeData]);
959 if (rGroup->flagStoreData == 1)
961 rec->size[recInfo_storeData] = fi->file_noread;
962 rec->info[recInfo_storeData] = xmalloc (fi->file_noread);
963 #if FILE_READ_BUFSIZE
964 if (fi->file_noread < FILE_READ_BUFSIZE)
965 memcpy (rec->info[recInfo_storeData], fi->file_buf,
970 if (lseek (fi->fd, 0L, SEEK_SET) < 0)
972 logf (LOG_ERRNO|LOG_FATAL, "seek to 0 in %s", fname);
975 if (read (fi->fd, rec->info[recInfo_storeData], fi->file_noread)
978 logf (LOG_ERRNO|LOG_FATAL, "read %d bytes of %s",
979 fi->file_noread, fname);
986 rec->info[recInfo_storeData] = NULL;
987 rec->size[recInfo_storeData] = 0;
989 xfree (rec->info[recInfo_databaseName]);
990 rec->info[recInfo_databaseName] =
991 rec_strdup (rGroup->databaseName, &rec->size[recInfo_databaseName]);
993 rec_put (records, &rec);
997 int fileExtract (SYSNO *sysno, const char *fname,
998 const struct recordGroup *rGroupP, int deleteFlag)
1006 struct recordGroup rGroupM;
1007 struct recordGroup *rGroup = &rGroupM;
1008 struct file_read_info *fi;
1010 memcpy (rGroup, rGroupP, sizeof(*rGroupP));
1012 if (!rGroup->groupName || !*rGroup->groupName)
1015 sprintf (gprefix, "%s.", rGroup->groupName);
1017 logf (LOG_DEBUG, "fileExtract %s", fname);
1019 /* determine file extension */
1020 for (i = strlen(fname); --i >= 0; )
1021 if (fname[i] == '/')
1026 else if (fname[i] == '.')
1028 strcpy (ext, fname+i+1);
1031 /* determine file type - depending on extension */
1032 if (!rGroup->recordType)
1034 sprintf (ext_res, "%srecordType.%s", gprefix, ext);
1035 if (!(rGroup->recordType = res_get (common_resource, ext_res)))
1037 sprintf (ext_res, "%srecordType", gprefix);
1038 if (!(rGroup->recordType = res_get (common_resource, ext_res)))
1040 if (rGroup->fileVerboseFlag)
1041 logf (LOG_LOG, "? %s", fname);
1046 if (!rGroup->recordType)
1048 if (rGroup->fileVerboseFlag)
1049 logf (LOG_LOG, "? record %s", fname);
1052 if (!(recType = recType_byName (rGroup->recordType, subType)))
1054 logf (LOG_WARN, "No such record type: %s", rGroup->recordType);
1058 /* determine match criteria */
1059 if (!rGroup->recordId)
1061 sprintf (ext_res, "%srecordId.%s", gprefix, ext);
1062 rGroup->recordId = res_get (common_resource, ext_res);
1065 /* determine database name */
1066 if (!rGroup->databaseName)
1068 sprintf (ext_res, "%sdatabase.%s", gprefix, ext);
1069 if (!(rGroup->databaseName = res_get (common_resource, ext_res)))
1071 sprintf (ext_res, "%sdatabase", gprefix);
1072 rGroup->databaseName = res_get (common_resource, ext_res);
1075 if (!rGroup->databaseName)
1076 rGroup->databaseName = "Default";
1078 if (rGroup->flagStoreData == -1)
1081 sprintf (ext_res, "%sstoreData.%s", gprefix, ext);
1082 if (!(sval = res_get (common_resource, ext_res)))
1084 sprintf (ext_res, "%sstoreData", gprefix);
1085 sval = res_get (common_resource, ext_res);
1088 rGroup->flagStoreData = atoi (sval);
1090 if (rGroup->flagStoreData == -1)
1091 rGroup->flagStoreData = 0;
1093 if (rGroup->flagStoreKeys == -1)
1097 sprintf (ext_res, "%sstoreKeys.%s", gprefix, ext);
1098 if (!(sval = res_get (common_resource, ext_res)))
1100 sprintf (ext_res, "%sstoreKeys", gprefix);
1101 sval = res_get (common_resource, ext_res);
1104 rGroup->flagStoreKeys = atoi (sval);
1106 if (rGroup->flagStoreKeys == -1)
1107 rGroup->flagStoreKeys = 0;
1109 if (sysno && deleteFlag)
1113 if ((fd = open (fname, O_RDONLY)) == -1)
1115 logf (LOG_WARN|LOG_ERRNO, "open %s", fname);
1119 fi = file_read_start (fd);
1120 recordExtract (sysno, fname, rGroup, deleteFlag, fi, recType, subType);
1121 log_event_start (NULL, NULL);
1122 file_read_stop (fi);