+Update code to use new YAZ log functions/defines.
+
--- 1.3.46 2006/10/31
Fixed several compilation warnings. (gcc 4.1.2, -O3 -g -Wall)
-/* $Id: bfile.c,v 1.35.2.3 2006-10-27 11:06:45 adam Exp $
+/* $Id: bfile.c,v 1.35.2.4 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
{
if (spec)
{
- yaz_log (LOG_LOG, "enabling cache spec=%s", spec);
+ yaz_log(YLOG_LOG, "enabling cache spec=%s", spec);
if (!bfs->commit_area)
bfs->commit_area = mf_init ("shadow", spec, bfs->base);
if (bfs->commit_area)
8);
strcpy (bfs->cache_fname, bfs->commit_area->dirs->name);
strcat (bfs->cache_fname, "/cache");
- yaz_log (LOG_LOG, "cache_fname = %s", bfs->cache_fname);
+ yaz_log(YLOG_LOG, "cache_fname = %s", bfs->cache_fname);
}
}
else
outf = open_cache (bfs, "ab");
if (!outf)
{
- logf (LOG_FATAL|LOG_ERRNO, "open %s", bfs->cache_fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "open %s", bfs->cache_fname);
exit (1);
}
fprintf (outf, "%s %d\n", name, block_size);
}
if (!tmp->mf)
{
- logf (LOG_FATAL, "mf_open failed for %s", name);
+ yaz_log(YLOG_FATAL, "mf_open failed for %s", name);
xfree (tmp);
return 0;
}
assert (bfs->commit_area);
if (!(inf = open_cache (bfs, "rb")))
{
- logf (LOG_LOG, "No commit file");
+ yaz_log(YLOG_LOG, "No commit file");
return ;
}
while (fscanf (inf, "%s %d", path, &block_size) == 2)
-/* $Id: cfile.c,v 1.27.2.1 2006-08-14 10:38:50 adam Exp $
+/* $Id: cfile.c,v 1.27.2.2 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
int hash_bytes;
cf->rmf = mf;
- logf (LOG_DEBUG, "cf: open %s %s", cf->rmf->name, wflag ? "rdwr" : "rd");
+ yaz_log(YLOG_DEBUG, "cf: open %s %s", cf->rmf->name, wflag ? "rdwr" : "rd");
sprintf (path, "%s-b", fname);
if (!(cf->block_mf = mf_open (area, path, block_size, wflag)))
{
- logf (LOG_FATAL|LOG_ERRNO, "Failed to open %s", path);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "Failed to open %s", path);
exit (1);
}
sprintf (path, "%s-i", fname);
if (!(cf->hash_mf = mf_open (area, path, HASH_BSIZE, wflag)))
{
- logf (LOG_FATAL|LOG_ERRNO, "Failed to open %s", path);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "Failed to open %s", path);
exit (1);
}
assert (firstp);
p = alloc_bucket (cf, block_no, hno);
if (!mf_read (cf->hash_mf, block_no, 0, 0, &p->ph))
{
- logf (LOG_FATAL|LOG_ERRNO, "read get_bucket");
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "read get_bucket");
exit (1);
}
assert (p->ph.this_bucket == block_no);
{
if (hb->ph.this_bucket == block_no)
{
- logf (LOG_FATAL, "Found hash bucket on other chain (1)");
+ yaz_log(YLOG_FATAL, "Found hash bucket on other chain (1)");
abort ();
}
for (i = 0; i<HASH_BUCKET && hb->ph.vno[i]; i++)
if (hb->ph.no[i] == no)
{
- logf (LOG_FATAL, "Found hash bucket on other chain (2)");
+ yaz_log(YLOG_FATAL, "Found hash bucket on other chain (2)");
abort ();
}
}
struct CFile_hash_bucket *p;
int i, j;
- logf (LOG_DEBUG, "cf: Moving to flat shadow: %s", cf->rmf->name);
- logf (LOG_DEBUG, "cf: hits=%d miss=%d bucket_in_memory=%d total=%d",
+ yaz_log(YLOG_DEBUG, "cf: Moving to flat shadow: %s", cf->rmf->name);
+ yaz_log(YLOG_DEBUG, "cf: hits=%d miss=%d bucket_in_memory=%d total=%d",
cf->no_hits, cf->no_miss, cf->bucket_in_memory,
cf->head.next_bucket - cf->head.first_bucket);
assert (cf->head.state == 1);
{
if (!mf_read (cf->hash_mf, i, 0, 0, &p->ph))
{
- logf (LOG_FATAL|LOG_ERRNO, "read bucket moveto flat");
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "read bucket moveto flat");
exit (1);
}
for (j = 0; j < HASH_BUCKET && p->ph.vno[j]; j++)
{
if (hb->ph.this_bucket == *bucketpp)
{
- logf (LOG_FATAL, "Found hash bucket on other chain");
+ yaz_log(YLOG_FATAL, "Found hash bucket on other chain");
abort ();
}
}
zebra_mutex_unlock (&cf->mutex);
if (!mf_read (cf->block_mf, block, offset, nbytes, buf))
{
- logf (LOG_FATAL|LOG_ERRNO, "cf_read no=%d, block=%d", no, block);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "cf_read no=%d, block=%d", no, block);
exit (1);
}
return 1;
zebra_mutex_unlock (&cf->mutex);
if (mf_write (cf->block_mf, block, offset, nbytes, buf))
{
- logf (LOG_FATAL|LOG_ERRNO, "cf_write no=%d, block=%d", no, block);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "cf_write no=%d, block=%d", no, block);
exit (1);
}
return 0;
int cf_close (CFile cf)
{
- logf (LOG_DEBUG, "cf: close hits=%d miss=%d bucket_in_memory=%d total=%d",
+ yaz_log(YLOG_DEBUG, "cf: close hits=%d miss=%d bucket_in_memory=%d total=%d",
cf->no_hits, cf->no_miss, cf->bucket_in_memory,
cf->head.next_bucket - cf->head.first_bucket);
flush_bucket (cf, -1);
-/* $Id: commit.c,v 1.16.2.2 2006-10-04 09:07:19 adam Exp $
+/* $Id: commit.c,v 1.16.2.3 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
if (!mf_read (m_p->cf->block_mf, m_p->map[i].from, 0, 0,
m_p->buf + i * m_p->cf->head.block_size))
{
- logf (LOG_FATAL, "read commit block at position %d",
+ yaz_log(YLOG_FATAL, "read commit block at position %d",
m_p->map[i].from);
exit (1);
}
{
if (!mf_read (cf->hash_mf, bucket_no, 0, 0, p))
{
- logf (LOG_FATAL, "read commit hash");
+ yaz_log(YLOG_FATAL, "read commit hash");
exit (1);
}
for (i = 0; i<HASH_BUCKET && p->vno[i]; i++)
#else
if (!mf_read (cf->block_mf, p->vno[i], 0, 0, cf->iobuf))
{
- logf (LOG_FATAL, "read commit block");
+ yaz_log(YLOG_FATAL, "read commit block");
exit (1);
}
mf_write (cf->rmf, p->no[i], 0, 0, cf->iobuf);
if (!mf_read (cf->hash_mf, hno, 0, 0, fp) &&
hno != cf->head.flat_bucket-1)
{
- logf (LOG_FATAL, "read index block hno=%d (%d-%d) commit",
+ yaz_log(YLOG_FATAL, "read index block hno=%d (%d-%d) commit",
hno, cf->head.next_bucket, cf->head.flat_bucket-1);
}
for (i = 0; i < (int) (HASH_BSIZE/sizeof(int)); i++)
#else
if (!mf_read (cf->block_mf, fp[i], 0, 0, cf->iobuf))
{
- logf (LOG_FATAL, "read data block hno=%d (%d-%d) "
+ yaz_log(YLOG_FATAL, "read data block hno=%d (%d-%d) "
"i=%d commit block at %d (->%d)",
hno, cf->head.next_bucket, cf->head.flat_bucket-1,
i, fp[i], vno);
if (cf->bucket_in_memory)
{
- logf (LOG_FATAL, "Cannot commit potential dirty cache");
+ yaz_log(YLOG_FATAL, "Cannot commit potential dirty cache");
exit (1);
}
if (cf->head.state == 1)
-/* $Id: mfile.c,v 1.52.2.3 2006-10-27 11:06:45 adam Exp $
+/* $Id: mfile.c,v 1.52.2.4 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
dirname[i] = '\0';
if (*ad++ != ':')
{
- logf (LOG_WARN, "Missing colon after path: %s", ad0);
+ yaz_log(YLOG_WARN, "Missing colon after path: %s", ad0);
return -1;
}
if (i == 0)
{
- logf (LOG_WARN, "Empty path: %s", ad0);
+ yaz_log(YLOG_WARN, "Empty path: %s", ad0);
return -1;
}
while (*ad == ' ' || *ad == '\t')
size = 0;
if (*ad < '0' || *ad > '9')
{
- logf (LOG_FATAL, "Missing size after path: %s", ad0);
+ yaz_log(YLOG_FATAL, "Missing size after path: %s", ad0);
return -1;
}
size = 0;
case 'M': case 'm': multi = 1048576; break;
case 'G': case 'g': multi = 1073741824; break;
case '\0':
- logf (LOG_FATAL, "Missing unit: %s", ad0);
+ yaz_log(YLOG_FATAL, "Missing unit: %s", ad0);
return -1;
default:
- logf (LOG_FATAL, "Illegal unit: %c in %s", *ad, ad0);
+ yaz_log(YLOG_FATAL, "Illegal unit: %c in %s", *ad, ad0);
return -1;
}
ad++;
{
if (!mf->wr && errno == ENOENT && off == 0)
return -2;
- logf (LOG_WARN|LOG_ERRNO, "Failed to open %s", mf->files[c].path);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Failed to open %s", mf->files[c].path);
return -1;
}
}
if (mfile_seek(mf->files[c].fd, ps * (mfile_off_t) mf->blocksize + offset,
SEEK_SET) < 0)
{
- logf (LOG_WARN|LOG_ERRNO, "Failed to seek in %s", mf->files[c].path);
- logf(LOG_WARN, "pos=%d off=%d blocksize=%d offset=%d",
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Failed to seek in %s", mf->files[c].path);
+ yaz_log(YLOG_WARN, "pos=%d off=%d blocksize=%d offset=%d",
pos, off, mf->blocksize, offset);
return -1;
}
int fd, number;
char metaname[FILENAME_MAX+1], tmpnam[FILENAME_MAX+1];
- logf (LOG_DEBUG, "mf_init(%s)", name);
+ yaz_log(YLOG_DEBUG, "mf_init(%s)", name);
strcpy(ma->name, name);
ma->mfiles = 0;
ma->dirs = 0;
if (scan_areadef(ma, spec, base) < 0)
{
- logf (LOG_WARN, "Failed to access description of '%s'", name);
+ yaz_log(YLOG_WARN, "Failed to access description of '%s'", name);
return 0;
}
/* look at each directory */
{
if (!(dd = opendir(dirp->name)))
{
- logf (LOG_WARN|LOG_ERRNO, "Failed to open directory %s",
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Failed to open directory %s",
dirp->name);
return 0;
}
/* get size */
if ((fd = open(part_f->path, O_BINARY|O_RDONLY)) < 0)
{
- logf (LOG_FATAL|LOG_ERRNO, "Failed to access %s",
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "Failed to access %s",
dent->d_name);
return 0;
}
if ((part_f->bytes = mfile_seek(fd, 0, SEEK_END)) < 0)
{
- logf (LOG_FATAL|LOG_ERRNO, "Failed to seek in %s",
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "Failed to seek in %s",
dent->d_name);
return 0;
}
}
for (meta_f = ma->mfiles; meta_f; meta_f = meta_f->next)
{
- logf (LOG_DEBUG, "mf_init: %s consists of %d part(s)", meta_f->name,
+ yaz_log(YLOG_DEBUG, "mf_init: %s consists of %d part(s)", meta_f->name,
meta_f->no_files);
qsort(meta_f->files, meta_f->no_files, sizeof(part_file),
cmp_part_file);
char tmp[FILENAME_MAX+1];
mf_dir *dp;
- logf(LOG_DEBUG, "mf_open(%s bs=%d, %s)", name, block_size,
+ yaz_log(YLOG_DEBUG, "mf_open(%s bs=%d, %s)", name, block_size,
wflag ? "RW" : "RDONLY");
assert (ma);
for (mnew = ma->mfiles; mnew; mnew = mnew->next)
mnew->min_bytes_creat; dp = dp->next);
if (!dp)
{
- logf (LOG_FATAL, "Insufficient space for new mfile.");
+ yaz_log(YLOG_FATAL, "Insufficient space for new mfile.");
return 0;
}
mnew->files[0].dir = dp;
{
int i;
- logf (LOG_DEBUG, "mf_close(%s)", mf->name);
+ yaz_log(YLOG_DEBUG, "mf_close(%s)", mf->name);
assert(mf->open);
for (i = 0; i < mf->no_files; i++)
{
}
else
{
- yaz_log (LOG_FATAL, "mf_read %s internal error", mf->name);
+ yaz_log(YLOG_FATAL, "mf_read %s internal error", mf->name);
exit(1);
}
}
toread = nbytes ? nbytes : mf->blocksize;
if ((rd = read(mf->files[mf->cur_file].fd, buf, toread)) < 0)
{
- logf (LOG_FATAL|LOG_ERRNO, "mf_read: Read failed (%s)",
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "mf_read: Read failed (%s)",
mf->files[mf->cur_file].path);
exit(1);
}
zebra_mutex_lock (&mf->mutex);
if ((ps = file_position(mf, no, offset)) < 0)
{
- yaz_log (LOG_FATAL, "mf_write %s internal error (1)", mf->name);
+ yaz_log(YLOG_FATAL, "mf_write %s internal error (1)", mf->name);
exit(1);
}
/* file needs to grow */
if ((nblocks = (int) (mf->files[mf->cur_file].dir->avail_bytes /
mf->blocksize)) > 0)
{
- logf (LOG_DEBUG, "Capping off file %s at pos %d",
+ yaz_log(YLOG_DEBUG, "Capping off file %s at pos %d",
mf->files[mf->cur_file].path, nblocks);
if ((ps = file_position(mf,
(mf->cur_file ? mf->files[mf->cur_file-1].top : 0) +
mf->files[mf->cur_file].blocks + nblocks - 1, 0)) < 0)
{
- yaz_log (LOG_FATAL, "mf_write %s internal error (2)",
+ yaz_log(YLOG_FATAL, "mf_write %s internal error (2)",
mf->name);
exit(1);
}
- logf (LOG_DEBUG, "ps = %d", ps);
+ yaz_log(YLOG_DEBUG, "ps = %d", ps);
if (write(mf->files[mf->cur_file].fd, &dummych, 1) < 1)
{
- logf (LOG_ERRNO|LOG_FATAL, "mf_write %s internal error (3)",
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "mf_write %s internal error (3)",
mf->name);
exit(1);
}
mf->blocksize;
}
/* get other bit */
- logf (LOG_DEBUG, "Creating new file.");
+ yaz_log(YLOG_DEBUG, "Creating new file.");
for (dp = mf->ma->dirs; dp && dp->max_bytes >= 0 &&
dp->avail_bytes < needed; dp = dp->next);
if (!dp)
{
- logf (LOG_FATAL, "Cannot allocate more space for %s",
+ yaz_log(YLOG_FATAL, "Cannot allocate more space for %s",
mf->name);
exit(1);
}
/* open new file and position at beginning */
if ((ps = file_position(mf, no, offset)) < 0)
{
- yaz_log (LOG_FATAL, "mf_write %s internal error (4)",
+ yaz_log(YLOG_FATAL, "mf_write %s internal error (4)",
mf->name);
exit(1);
}
towrite = nbytes ? nbytes : mf->blocksize;
if (write(mf->files[mf->cur_file].fd, buf, towrite) < towrite)
{
- logf (LOG_FATAL|LOG_ERRNO, "Write failed for file %s part %d",
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "Write failed for file %s part %d",
mf->name, mf->cur_file);
exit(1);
}
-/* $Id: d1_absyn.c,v 1.9.2.11 2006-10-26 23:46:48 adam Exp $
+/* $Id: d1_absyn.c,v 1.9.2.12 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
{
data1_xpelement *xpe = abs->xp_elements;
while (xpe) {
- logf (LOG_DEBUG,"Destroy xp element %s",xpe->xpath_expr);
+ yaz_log(YLOG_DEBUG,"Destroy xp element %s",xpe->xpath_expr);
if (xpe->dfa) { dfa_delete (&xpe->dfa); }
xpe = xpe->next;
}
*cp = '\0';
}
if (!attset)
- yaz_log (LOG_WARN|LOG_ERRNO, "Couldn't load attribute set %s", name);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Couldn't load attribute set %s", name);
else
{
data1_attset_cache p = (data1_attset_cache)
if (sub_e)
e->children = sub_e->elements;
else
- yaz_log (LOG_WARN, "Unresolved reference to sub-elements %s",
+ yaz_log(YLOG_WARN, "Unresolved reference to sub-elements %s",
e->sub_name);
}
}
}
sprintf (res_p, "$");
res_p++;
- yaz_log(LOG_DEBUG, "Got regexp: %s", res);
+ yaz_log(YLOG_DEBUG, "Got regexp: %s", res);
return res;
}
if (i == 0)
{
if (*cp)
- yaz_log(LOG_WARN,
+ yaz_log(YLOG_WARN,
"%s:%d: Syntax error in termlistspec '%s'",
file, lineno, cp);
break;
if (!((*tp)->att = data1_getattbyname(dh, res->attset,
attname))) {
if ((!xpelement) || (*attname != '!')) {
- yaz_log(LOG_WARN,
+ yaz_log(YLOG_WARN,
"%s:%d: Couldn't find att '%s' in attset",
file, lineno, attname);
return -1;
sprintf(buf + strlen(buf), "/subfield[@code=\"%s\"]", subfield);
else if (field[0] != '0' || field[1] != '0')
strcat(buf, "/subfield");
- yaz_log(LOG_DEBUG, "Created xpath: '%s'", buf);
+ yaz_log(YLOG_DEBUG, "Created xpath: '%s'", buf);
return 0;
}
if (!(f = data1_path_fopen(dh, file, "r")))
{
- yaz_log(LOG_WARN|LOG_ERRNO, "Couldn't open %s", file);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Couldn't open %s", file);
if (file_must_exist)
return 0;
}
if (argc < 4)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to elm", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to elm", file, lineno);
continue;
}
path = argv[1];
}
if (i > level+1)
{
- yaz_log(LOG_WARN, "%s:%d: Bad level increase", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad level increase", file, lineno);
fclose(f);
return 0;
}
{
if (!res->tagset)
{
- yaz_log(LOG_WARN, "%s:%d: No tagset loaded", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: No tagset loaded", file, lineno);
fclose(f);
return 0;
}
if (!(new_element->tag = data1_gettagbynum (dh, res->tagset,
type, value)))
{
- yaz_log(LOG_WARN, "%s:%d: Couldn't find tag %s in tagset",
+ yaz_log(YLOG_WARN, "%s:%d: Couldn't find tag %s in tagset",
file, lineno, p);
fclose(f);
return 0;
}
else
{
- yaz_log(LOG_WARN, "%s:%d: Bad element", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad element", file, lineno);
fclose(f);
return 0;
}
if (argc < 3)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to xelm", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to xelm", file, lineno);
continue;
}
if (argc < 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to section",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to section",
file, lineno);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to 'xpath' directive",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to 'xpath' directive",
file, lineno);
continue;
}
res->enable_xpath_indexing = 0;
else
{
- yaz_log(LOG_WARN, "%s:%d: Expecting disable/enable "
+ yaz_log(YLOG_WARN, "%s:%d: Expecting disable/enable "
"after 'xpath' directive", file, lineno);
}
}
data1_termlist **tp = &all;
if (all)
{
- yaz_log(LOG_WARN, "%s:%d: Too many 'all' directives - ignored",
+ yaz_log(YLOG_WARN, "%s:%d: Too many 'all' directives - ignored",
file, lineno);
continue;
}
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to 'all' directive",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to 'all' directive",
file, lineno);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to name directive",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to name directive",
file, lineno);
continue;
}
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to reference",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to reference",
file, lineno);
continue;
}
name = argv[1];
if ((res->reference = oid_getvalbyname(name)) == VAL_NONE)
{
- yaz_log(LOG_WARN, "%s:%d: Unknown tagset ref '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown tagset ref '%s'",
file, lineno, name);
continue;
}
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to attset",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to attset",
file, lineno);
continue;
}
name = argv[1];
if (!(attset = data1_get_attset (dh, name)))
{
- yaz_log(LOG_WARN, "%s:%d: Couldn't find attset %s",
+ yaz_log(YLOG_WARN, "%s:%d: Couldn't find attset %s",
file, lineno, name);
continue;
}
int type = 0;
if (argc < 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to tagset",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to tagset",
file, lineno);
continue;
}
*tagset_childp = data1_read_tagset (dh, name, type);
if (!(*tagset_childp))
{
- yaz_log(LOG_WARN, "%s:%d: Couldn't load tagset %s",
+ yaz_log(YLOG_WARN, "%s:%d: Couldn't load tagset %s",
file, lineno, name);
continue;
}
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args in varset",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args in varset",
file, lineno);
continue;
}
name = argv[1];
if (!(res->varset = data1_read_varset (dh, name)))
{
- yaz_log(LOG_WARN, "%s:%d: Couldn't load Varset %s",
+ yaz_log(YLOG_WARN, "%s:%d: Couldn't load Varset %s",
file, lineno, name);
continue;
}
if (argc != 3)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args in esetname",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args in esetname",
file, lineno);
continue;
}
(*esetpp)->spec = 0;
else if (!((*esetpp)->spec = data1_read_espec1 (dh, fname)))
{
- yaz_log(LOG_WARN, "%s:%d: Espec-1 read failed for %s",
+ yaz_log(YLOG_WARN, "%s:%d: Espec-1 read failed for %s",
file, lineno, fname);
continue;
}
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args for maptab",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args for maptab",
file, lineno);
continue;
}
name = argv[1];
if (!(*maptabp = data1_read_maptab (dh, name)))
{
- yaz_log(LOG_WARN, "%s:%d: Couldn't load maptab %s",
+ yaz_log(YLOG_WARN, "%s:%d: Couldn't load maptab %s",
file, lineno, name);
continue;
}
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # or args for marc",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # or args for marc",
file, lineno);
continue;
}
name = argv[1];
if (!(*marcp = data1_read_marctab (dh, name)))
{
- yaz_log(LOG_WARN, "%s:%d: Couldn't read marctab %s",
+ yaz_log(YLOG_WARN, "%s:%d: Couldn't read marctab %s",
file, lineno, name);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # or args for encoding",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # or args for encoding",
file, lineno);
continue;
}
{
if (argc != 3)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # or args for systag",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # or args for systag",
file, lineno);
continue;
}
}
else
{
- yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'", file,
+ yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file,
lineno, cmd);
continue;
}
fix_element_ref (dh, res, cur_elements->elements);
}
*systagsp = 0;
- yaz_log (LOG_DEBUG, "%s: data1_read_absyn end", file);
+ yaz_log(YLOG_DEBUG, "%s: data1_read_absyn end", file);
return res;
}
-/* $Id: d1_attset.c,v 1.2.2.1 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_attset.c,v 1.2.2.2 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
if (argc < 3)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to att", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to att", file, lineno);
continue;
}
num = atoi (argv[1]);
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to name", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to name", file, lineno);
continue;
}
}
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to reference",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to reference",
file, lineno);
continue;
}
name = argv[1];
if ((res->reference = oid_getvalbyname(name)) == VAL_NONE)
{
- yaz_log(LOG_WARN, "%s:%d: Unknown reference oid '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown reference oid '%s'",
file, lineno, name);
fclose(f);
return 0;
}
else if (!strcmp(cmd, "ordinal"))
{
- yaz_log (LOG_WARN, "%s:%d: Directive ordinal ignored",
+ yaz_log(YLOG_WARN, "%s:%d: Directive ordinal ignored",
file, lineno);
}
else if (!strcmp(cmd, "include"))
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args to include",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args to include",
file, lineno);
continue;
}
if (!(attset = data1_get_attset (dh, name)))
{
- yaz_log(LOG_WARN, "%s:%d: Include of attset %s failed",
+ yaz_log(YLOG_WARN, "%s:%d: Include of attset %s failed",
file, lineno, name);
continue;
}
else
{
- yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'",
file, lineno, cmd);
}
}
-/* $Id: d1_doespec.c,v 1.2.2.3 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_doespec.c,v 1.2.2.4 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
}
else
{
- yaz_log(LOG_WARN, "Bad simpleelement component: '%s'", spec);
+ yaz_log(YLOG_WARN, "Bad simpleelement component: '%s'", spec);
}
return 0;
}
}
else
{
- yaz_log(LOG_WARN, "Bad SpecificTag type: %d",
+ yaz_log(YLOG_WARN, "Bad SpecificTag type: %d",
want->tagValue->which);
continue;
}
counter++;
if (occur && occur->which == Z_Occurrences_last)
{
- yaz_log(LOG_WARN, "Can't do occurrences=last (yet)");
+ yaz_log(YLOG_WARN, "Can't do occurrences=last (yet)");
return 0;
}
if (!occur || occur->which == Z_Occurrences_all ||
-/* $Id: d1_espec.c,v 1.2.2.4 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_espec.c,v 1.2.2.5 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
if (sscanf(argv[i], "(%d,%d,%511[^)])", &zclass, &type, value) < 3)
{
- yaz_log(LOG_WARN, "%s:%d: Syntax error in variant component '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Syntax error in variant component '%s'",
file, lineno, argv[i]);
return 0;
}
if (!d1_isdigit(*occ))
{
- yaz_log(LOG_WARN, "%s:%d: Bad occurrences-spec %s",
+ yaz_log(YLOG_WARN, "%s:%d: Bad occurrences-spec %s",
file, lineno, occ);
return 0;
}
if (!(f = data1_path_fopen(dh, file, "r")))
{
- yaz_log(LOG_WARN|LOG_ERRNO, "%s", file);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "%s", file);
return 0;
}
if (!nnames)
{
- yaz_log(LOG_WARN, "%s:%d: Empty elementsetnames directive",
+ yaz_log(YLOG_WARN, "%s:%d: Empty elementsetnames directive",
file, lineno);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args for %s",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args for %s",
file, lineno, argv[0]);
continue;
}
if (!(res->defaultVariantSetId =
odr_getoidbystr_nmem(nmem, argv[1])))
{
- yaz_log(LOG_WARN, "%s:%d: Bad defaultvariantsetid",
+ yaz_log(YLOG_WARN, "%s:%d: Bad defaultvariantsetid",
file, lineno);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args for %s",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args for %s",
file, lineno, argv[0]);
continue;
}
if (!(res->defaultVariantRequest =
read_variant(argc-1, argv+1, nmem, file, lineno)))
{
- yaz_log(LOG_WARN, "%s:%d: Bad defaultvariantrequest",
+ yaz_log(YLOG_WARN, "%s:%d: Bad defaultvariantrequest",
file, lineno);
continue;
}
}
if (argc < 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args for %s",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args for %s",
file, lineno, argv[0]);
continue;
}
tagunit = read_tagunit(path, nmem, file, lineno);
if (!tagunit)
{
- yaz_log (LOG_WARN, "%s%d: Bad tag unit at %s",
+ yaz_log(YLOG_WARN, "%s%d: Bad tag unit at %s",
file, lineno, path);
break;
}
read_variant(argc-3, argv+3, nmem, file, lineno);
}
else
- yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'",
file, lineno, argv[0]);
fclose (f);
return res;
-/* $Id: d1_expout.c,v 1.2.2.1 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_expout.c,v 1.2.2.2 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
return 0;
if (!c->u.tag.element)
{
- yaz_log(LOG_WARN, "Tag %s is local", c->u.tag.tag);
+ yaz_log(YLOG_WARN, "Tag %s is local", c->u.tag.tag);
return 0;
}
if (c->u.tag.element->tag->which != DATA1T_numeric)
{
- yaz_log(LOG_WARN, "Tag %s is not numeric", c->u.tag.tag);
+ yaz_log(YLOG_WARN, "Tag %s is not numeric", c->u.tag.tag);
return 0;
}
if (eh->select && !c->u.tag.node_selected)
assert(n->which == DATA1N_root);
if (strcmp(n->u.root.type, "explain"))
{
- yaz_log(LOG_WARN, "Attempt to convert a non-Explain record");
+ yaz_log(YLOG_WARN, "Attempt to convert a non-Explain record");
return 0;
}
for (n = n->child; n; n = n->next)
return res;
}
}
- yaz_log(LOG_WARN, "No category in Explain record");
+ yaz_log(YLOG_WARN, "No category in Explain record");
return 0;
}
-/* $Id: d1_grs.c,v 1.3.2.1 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_grs.c,v 1.3.2.2 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
odr_strdup(o, p->u.variant.value);
break;
default:
- yaz_log(LOG_WARN, "Unable to handle value for variant %s",
+ yaz_log(YLOG_WARN, "Unable to handle value for variant %s",
p->u.variant.type->name);
return 0;
}
D1_VARIANTARRAY);
else if (m->num_supportedVariants >= D1_VARIANTARRAY)
{
- yaz_log(LOG_WARN, "Too many variants (D1_VARIANTARRAY==%d)",
+ yaz_log(YLOG_WARN, "Too many variants (D1_VARIANTARRAY==%d)",
D1_VARIANTARRAY);
return -1;
}
*len += oid_oidlen(res->u.oid) * sizeof(int);
break;
default:
- yaz_log(LOG_WARN, "Can't handle datatype.");
+ yaz_log(YLOG_WARN, "Can't handle datatype.");
return 0;
}
}
}
else
{
- yaz_log(LOG_WARN, "Bad data.");
+ yaz_log(YLOG_WARN, "Bad data.");
return 0;
}
data1_gettagbyname (dh, n->root->u.root.absyn->tagset,
"wellKnown")))
{
- yaz_log(LOG_WARN, "Unable to locate tag for 'wellKnown'");
+ yaz_log(YLOG_WARN, "Unable to locate tag for 'wellKnown'");
wellknown_tag = odr_malloc(o, sizeof(*wellknown_tag));
wellknown_tag->which = DATA1T_numeric;
wellknown_tag->value.numeric = 19;
-/* $Id: d1_handle.c,v 1.3.2.1 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_handle.c,v 1.3.2.2 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
char **data1_get_read_buf (data1_handle dp, int **lenp)
{
*lenp = &dp->read_len;
- yaz_log (LOG_DEBUG, "data1_get_read_buf lenp=%u", **lenp);
+ yaz_log(YLOG_DEBUG, "data1_get_read_buf lenp=%u", **lenp);
return &dp->read_buf;
}
char **data1_get_map_buf (data1_handle dp, int **lenp)
{
*lenp = &dp->map_len;
- yaz_log (LOG_DEBUG, "data1_get_map_buf lenp=%u", **lenp);
+ yaz_log(YLOG_DEBUG, "data1_get_map_buf lenp=%u", **lenp);
return &dp->map_buf;
}
-/* $Id: d1_if.c,v 1.2.2.1 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_if.c,v 1.2.2.2 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
}
else
{
- yaz_log(LOG_WARN,"Attempting to lookup data for tagpath: Child node is not a data node");
+ yaz_log(YLOG_WARN,"Attempting to lookup data for tagpath: Child node is not a data node");
}
}
else
{
- yaz_log(LOG_WARN,"Found a node matching the tagpath, but it has no child data nodes");
+ yaz_log(YLOG_WARN,"Found a node matching the tagpath, but it has no child data nodes");
}
}
else
{
- yaz_log(LOG_WARN,"Unable to lookup a node on the specified tag path");
+ yaz_log(YLOG_WARN,"Unable to lookup a node on the specified tag path");
}
return "";
}
else
{
- yaz_log(LOG_FATAL,"Node does not end with a ]");
+ yaz_log(YLOG_FATAL,"Node does not end with a ]");
/* Fatal Error */
return(NULL);
}
}
- yaz_log(LOG_DEBUG,"search node for child like [%d,%d,%s,%d]",iTagType,iTagValue,StringTagVal,iOccurences);
+ yaz_log(YLOG_DEBUG,"search node for child like [%d,%d,%s,%d]",iTagType,iTagValue,StringTagVal,iOccurences);
/* OK.. We have extracted tagtype, Value and Occurence, see if we can find a node */
}
else /* Attempt to match real element */
{
- yaz_log(LOG_WARN,"Non string tag matching not yet implemented");
+ yaz_log(YLOG_WARN,"Non string tag matching not yet implemented");
}
}
current_child = current_child->next;
-/* $Id: d1_map.c,v 1.3.2.2 2006-08-22 11:34:36 adam Exp $
+/* $Id: d1_map.c,v 1.3.2.3 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
if (!(f = data1_path_fopen(dh, file, "r")))
{
- yaz_log(LOG_WARN|LOG_ERRNO, "%s", file);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "%s", file);
return 0;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # args for targetref",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args for targetref",
file, lineno);
continue;
}
if ((res->target_absyn_ref = oid_getvalbyname(argv[1]))
== VAL_NONE)
{
- yaz_log(LOG_WARN, "%s:%d: Unknown reference '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown reference '%s'",
file, lineno, argv[1]);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # args for targetname",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args for targetname",
file, lineno);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # args for name", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args for name", file, lineno);
continue;
}
res->name = (char *)nmem_malloc(mem, strlen(argv[1])+1);
if (argc < 3)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # of args for map",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # of args for map",
file, lineno);
continue;
}
if ((np = sscanf(path, "(%d,%511[^)]):%511[^/]", &type, valstr,
parm)) < 2)
{
- yaz_log(LOG_WARN, "%s:%d: Syntax error in map "
+ yaz_log(YLOG_WARN, "%s:%d: Syntax error in map "
"directive: %s", file, lineno, argv[2]);
fclose(f);
return 0;
mapp = &(*mapp)->next;
}
else
- yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'",
file, lineno, argv[0]);
fclose(f);
res->u.root.type = map->target_absyn_name;
if (!(res->u.root.absyn = data1_get_absyn(dh, map->target_absyn_name)))
{
- yaz_log(LOG_WARN, "%s: Failed to load target absyn '%s'",
+ yaz_log(YLOG_WARN, "%s: Failed to load target absyn '%s'",
map->name, map->target_absyn_name);
}
if (data1_is_xmlmode(dh))
-/* $Id: d1_marc.c,v 1.6.2.6 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_marc.c,v 1.6.2.7 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
if (!(f = data1_path_fopen(dh, file, "r")))
{
- yaz_log(LOG_WARN|LOG_ERRNO, "%s", file);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "%s", file);
return 0;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d:Missing arg for %s", file, lineno,
+ yaz_log(YLOG_WARN, "%s:%d:Missing arg for %s", file, lineno,
*argv);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
+ yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
*argv);
continue;
}
if ((res->reference = oid_getvalbyname(argv[1])) == VAL_NONE)
{
- yaz_log(LOG_WARN, "%s:%d: Unknown tagset reference '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown tagset reference '%s'",
file, lineno, argv[1]);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
+ yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
*argv);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
+ yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
*argv);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
+ yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
*argv);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
+ yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
*argv);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
+ yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
*argv);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
+ yaz_log(YLOG_WARN, "%s:%d: Missing arg for %s", file, lineno,
*argv);
continue;
}
res->force_identifier_length = atoi(argv[1]);
}
else
- yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno,
+ yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno,
*argv);
fclose(f);
#if 0
data1_pr_tree(dh, n, stdout);
#endif
- yaz_log (LOG_DEBUG, "nodetomarc");
+ yaz_log(YLOG_DEBUG, "nodetomarc");
memcpy (leader+5, p->record_status, 1);
memcpy (leader+6, p->implementation_codes, 4);
if (subf->which != DATA1N_tag)
continue;
if (strcmp(subf->u.tag.tag, "subfield"))
- yaz_log(LOG_WARN, "Unhandled tag %s", subf->u.tag.tag);
+ yaz_log(YLOG_WARN, "Unhandled tag %s", subf->u.tag.tag);
for (xa = subf->u.tag.attributes; xa; xa = xa->next)
if (!strcmp(xa->name, "code"))
identifier = xa->value;
}
else if (subf->which != DATA1N_tag)
- yaz_log(LOG_WARN, "Malformed fields for marc output.");
+ yaz_log(YLOG_WARN, "Malformed fields for marc output.");
else
identifier = subf->u.tag.tag;
op[data_p] = ISO2709_IDFS;
-/* $Id: d1_read.c,v 1.8.2.4 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_read.c,v 1.8.2.5 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
r->u.preprocess.attributes = 0;
break;
default:
- logf (LOG_WARN, "data_mk_node_type. bad type = %d\n", type);
+ yaz_log(YLOG_WARN, "data_mk_node_type. bad type = %d\n", type);
}
}
data1_node *res;
if (!absyn)
{
- yaz_log(LOG_WARN, "Unable to acquire abstract syntax " "for '%s'",
+ yaz_log(YLOG_WARN, "Unable to acquire abstract syntax " "for '%s'",
name);
/* It's now OK for a record not to have an absyn */
}
}
if (amp || c != '>')
{
- yaz_log(LOG_WARN, "d1: %d: Malformed tag", line);
+ yaz_log(YLOG_WARN, "d1: %d: Malformed tag", line);
return 0;
}
else
}
if (i != level)
{
- yaz_log (LOG_WARN, "%d: no begin tag for %s",
+ yaz_log(YLOG_WARN, "%d: no begin tag for %s",
line, tag);
break;
}
const char *tocode,
const char *fromcode)
{
- yaz_log(LOG_DEBUG, "data1_iconv tocode=%s fromcode=%s", tocode, fromcode);
+ yaz_log(YLOG_DEBUG, "data1_iconv tocode=%s fromcode=%s", tocode, fromcode);
if (yaz_matchstr (tocode, fromcode))
{
WRBUF wrbuf = wrbuf_alloc();
-/* $Id: d1_sumout.c,v 1.2.2.1 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_sumout.c,v 1.2.2.2 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
assert(n->which == DATA1N_root);
if (strcmp(n->u.root.type, "summary"))
{
- yaz_log(LOG_WARN, "Attempt to convert a non-summary record");
+ yaz_log(YLOG_WARN, "Attempt to convert a non-summary record");
return 0;
}
{
if (c->which != DATA1N_tag || !c->u.tag.element)
{
- yaz_log(LOG_WARN, "Malformed element in Summary record");
+ yaz_log(YLOG_WARN, "Malformed element in Summary record");
return 0;
}
if (select && !c->u.tag.node_selected)
case 16: res->abstract = f_string(c, o); break;
case 17: abort(); /* TODO */
default:
- yaz_log(LOG_WARN, "Unknown element in Summary record.");
+ yaz_log(YLOG_WARN, "Unknown element in Summary record.");
}
}
return res;
-/* $Id: d1_tagset.c,v 1.2.2.1 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_tagset.c,v 1.2.2.2 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
if (!(f = data1_path_fopen(dh, file, "r")))
{
- yaz_log(LOG_WARN|LOG_ERRNO, "%s", file);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "%s", file);
return 0;
}
res = data1_empty_tagset (dh);
if (argc != 4)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # args to tag", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args to tag", file, lineno);
continue;
}
value = atoi(argv[1]);
if (!(rr->kind = data1_maptype(dh, type)))
{
- yaz_log(LOG_WARN, "%s:%d: Unknown datatype %s",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown datatype %s",
file, lineno, type);
fclose(f);
return 0;
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # args to name", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args to name", file, lineno);
continue;
}
res->name = nmem_strdup(mem, argv[1]);
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # args to reference",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args to reference",
file, lineno);
continue;
}
name = argv[1];
if ((res->reference = oid_getvalbyname(name)) == VAL_NONE)
{
- yaz_log(LOG_WARN, "%s:%d: Unknown tagset ref '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown tagset ref '%s'",
file, lineno, name);
continue;
}
{
if (argc != 2)
{
- yaz_log (LOG_WARN, "%s:%d: Bad # args to type", file, lineno);
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args to type", file, lineno);
continue;
}
if (!res->type)
if (argc < 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # args to include",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args to include",
file, lineno);
continue;
}
*childp = data1_read_tagset (dh, name, type);
if (!(*childp))
{
- yaz_log(LOG_WARN, "%s:%d: Inclusion failed for tagset %s",
+ yaz_log(YLOG_WARN, "%s:%d: Inclusion failed for tagset %s",
file, lineno, name);
continue;
}
}
else
{
- yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'",
file, lineno, cmd);
}
}
-/* $Id: d1_varset.c,v 1.2.2.2 2006-08-14 10:38:51 adam Exp $
+/* $Id: d1_varset.c,v 1.2.2.3 2006-12-05 21:14:38 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
for (t = c->types; t; t = t->next)
if (!data1_matchstr(t->name, type))
return t;
- yaz_log(LOG_WARN, "Unknown variant type %s in class %s",
+ yaz_log(YLOG_WARN, "Unknown variant type %s in class %s",
type, zclass);
return 0;
}
- yaz_log(LOG_WARN, "Unknown variant class %s", zclass);
+ yaz_log(YLOG_WARN, "Unknown variant class %s", zclass);
return 0;
}
if (!(f = data1_path_fopen(dh, file, "r")))
{
- yaz_log(LOG_WARN|LOG_ERRNO, "%s", file);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "%s", file);
return 0;
}
while ((argc = readconf_line(f, &lineno, line, 512, argv, 50)))
if (argc != 3)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # or args to class",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # or args to class",
file, lineno);
continue;
}
if (!typep)
{
- yaz_log(LOG_WARN, "%s:%d: Directive class must precede type",
+ yaz_log(YLOG_WARN, "%s:%d: Directive class must precede type",
file, lineno);
continue;
}
if (argc != 4)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # or args to type",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # or args to type",
file, lineno);
continue;
}
r->type = atoi(argv[1]);
if (!(r->datatype = data1_maptype (dh, argv[3])))
{
- yaz_log(LOG_WARN, "%s:%d: Unknown datatype '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown datatype '%s'",
file, lineno, argv[3]);
fclose(f);
return 0;
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # args for name",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args for name",
file, lineno);
continue;
}
{
if (argc != 2)
{
- yaz_log(LOG_WARN, "%s:%d: Bad # args for reference",
+ yaz_log(YLOG_WARN, "%s:%d: Bad # args for reference",
file, lineno);
continue;
}
if ((res->reference = oid_getvalbyname(argv[1])) == VAL_NONE)
{
- yaz_log(LOG_WARN, "%s:%d: Unknown reference '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown reference '%s'",
file, lineno, argv[1]);
continue;
}
}
else
- yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'",
+ yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'",
file, lineno, argv[0]);
fclose(f);
-/* $Id: dfa.c,v 1.30.2.1 2006-08-14 10:38:53 adam Exp $
+/* $Id: dfa.c,v 1.30.2.2 2006-12-05 21:14:39 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
parse_info->expr_ptr = (const unsigned char *) cp0;
parse_info->look_ch = ((unsigned char **) mapto)[i][0];
- logf (LOG_DEBUG, "map from %c to %d", parse_info->expr_ptr[-1], parse_info->look_ch);
+ yaz_log(YLOG_DEBUG, "map from %c to %d", parse_info->expr_ptr[-1], parse_info->look_ch);
return L_CHAR;
}
-/* $Id: grepper.c,v 1.10.2.1 2006-08-14 10:38:53 adam Exp $
+/* $Id: grepper.c,v 1.10.2.2 2006-12-05 21:14:39 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
inf = fopen (fname, "r");
if (!inf)
{
- logf (LOG_FATAL|LOG_ERRNO, "cannot open `%s'", fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "cannot open `%s'", fname);
exit (1);
}
}
}
else
{
- logf (LOG_FATAL, "Unknown option '-%s'", arg);
+ yaz_log(YLOG_FATAL, "Unknown option '-%s'", arg);
exit (1);
}
}
-/* $Id: imalloc.c,v 1.9.2.1 2006-08-14 10:38:53 adam Exp $
+/* $Id: imalloc.c,v 1.9.2.2 2006-12-05 21:14:39 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
size_t words = (4*sizeof(unsigned) -1 + size)/sizeof(unsigned);
char *p = (char *)xmalloc( words*sizeof(unsigned) );
if( !p )
- logf (LOG_FATAL, "No memory: imalloc(%u); c/f %d/%d; %ld/%ld",
+ yaz_log(YLOG_FATAL, "No memory: imalloc(%u); c/f %d/%d; %ld/%ld",
size, alloc_calls, free_calls, alloc, max_alloc );
*((unsigned *)p) = size;
((unsigned *)p)[1] = MAG1;
#else
void *p = (void *)xmalloc( size );
if( !p )
- logf (LOG_FATAL, "Out of memory (imalloc)" );
+ yaz_log(YLOG_FATAL, "Out of memory (imalloc)" );
return p;
#endif
}
unsigned words = (4*sizeof(unsigned) -1 + size)/sizeof(unsigned);
char *p = (char *) xcalloc( words*sizeof(unsigned), 1 );
if( !p )
- logf (LOG_FATAL, "No memory: icalloc(%u); c/f %d/%d; %ld/%ld",
+ yaz_log(YLOG_FATAL, "No memory: icalloc(%u); c/f %d/%d; %ld/%ld",
size, alloc_calls, free_calls, alloc, max_alloc );
((unsigned *)p)[0] = size;
((unsigned *)p)[1] = MAG1;
#else
void *p = (void *) xcalloc( size, 1 );
if( !p )
- logf (LOG_FATAL, "Out of memory (icalloc)" );
+ yaz_log(YLOG_FATAL, "Out of memory (icalloc)" );
return p;
#endif
}
++free_calls;
size = (-2)[(unsigned *) p];
if( (-1)[(unsigned *) p] != MAG1 )
- logf (LOG_FATAL,"Internal: ifree(%u) magic 1 corrupted", size );
+ yaz_log(YLOG_FATAL,"Internal: ifree(%u) magic 1 corrupted", size );
if( size[(unsigned char *) p] != MAG2 )
- logf (LOG_FATAL,"Internal: ifree(%u) magic 2 corrupted", size );
+ yaz_log(YLOG_FATAL,"Internal: ifree(%u) magic 2 corrupted", size );
if( (size+1)[(unsigned char *) p] != MAG3 )
- logf (LOG_FATAL,"Internal: ifree(%u) magic 3 corrupted", size );
+ yaz_log(YLOG_FATAL,"Internal: ifree(%u) magic 3 corrupted", size );
alloc -= size;
if( alloc < 0L )
- logf (LOG_FATAL,"Internal: ifree(%u) negative alloc.", size );
+ yaz_log(YLOG_FATAL,"Internal: ifree(%u) negative alloc.", size );
xfree( (unsigned *) p-2 );
#else
xfree (p);
-/* $Id: close.c,v 1.7.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: close.c,v 1.7.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*/
-
-
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
+#include <yaz/xmalloc.h>
#include <dict.h>
int dict_close (Dict dict)
-/* $Id: dclose.c,v 1.6.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: dclose.c,v 1.6.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*/
-
-
#include <sys/types.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
+#include <yaz/xmalloc.h>
#include <dict.h>
int dict_bf_close (Dict_BFile dbf)
-/* $Id: dcompact.c,v 1.8.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: dcompact.c,v 1.8.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*/
-
-
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <yaz/xmalloc.h>
#include <yaz/log.h>
#include <dict.h>
void *buf;
int size;
#if 0
- logf (LOG_LOG, "map[%d] = %d", i, map[i]);
+ yaz_log(YLOG_LOG, "map[%d] = %d", i, map[i]);
#endif
dict_bf_readp (dict_from->dbf, i, &buf);
size = ((DICT_size(buf)+sizeof(short)-1)/sizeof(short) +
no_dir += DICT_nodir(buf);
}
#if 0
- logf (LOG_LOG, "map[%d] = %d", i, map[i]);
- logf (LOG_LOG, "nodir = %d", no_dir);
+ yaz_log(YLOG_LOG, "map[%d] = %d", i, map[i]);
+ yaz_log(YLOG_LOG, "nodir = %d", no_dir);
#endif
dict_to->head.root = map[1];
dict_to->head.last = map[i];
void *old_p, *new_p;
dict_bf_readp (dict_from->dbf, i, &old_p);
- logf (LOG_LOG, "dict_bf_newp no=%d size=%d", map[i],
+ yaz_log(YLOG_LOG, "dict_bf_newp no=%d size=%d", map[i],
map[i+1] - map[i]);
dict_bf_newp (dict_to->dbf, map[i], &new_p, map[i+1] - map[i]);
-/* $Id: dictext.c,v 1.9.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: dictext.c,v 1.9.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
inputfile = arg;
else
{
- logf (LOG_FATAL, "too many files specified\n");
+ yaz_log(YLOG_FATAL, "too many files specified\n");
exit (1);
}
}
use8 = 1;
else
{
- logf (LOG_FATAL, "Unknown option '-%s'", arg);
+ yaz_log(YLOG_FATAL, "Unknown option '-%s'", arg);
exit (1);
}
}
ipf = fopen (inputfile, "r");
if (!ipf)
{
- logf (LOG_FATAL|LOG_ERRNO, "cannot open '%s'", inputfile);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "cannot open '%s'", inputfile);
exit (1);
}
}
-/* $Id: dicttest.c,v 1.28.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: dicttest.c,v 1.28.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
name = arg;
else
{
- logf (LOG_FATAL, "too many files specified\n");
+ yaz_log(YLOG_FATAL, "too many files specified\n");
exit (1);
}
}
}
else
{
- logf (LOG_FATAL, "Unknown option '-%s'", arg);
+ yaz_log(YLOG_FATAL, "Unknown option '-%s'", arg);
exit (1);
}
}
if (!config || !name)
{
- logf (LOG_FATAL, "no config and/or dictionary specified");
+ yaz_log(YLOG_FATAL, "no config and/or dictionary specified");
exit (1);
}
my_resource = res_open (config, 0, 0);
if (!my_resource)
{
- logf (LOG_FATAL, "cannot open resource `%s'", config);
+ yaz_log(YLOG_FATAL, "cannot open resource `%s'", config);
exit (1);
}
bfs = bfs_create (res_get(my_resource, "register"), 0);
if (!bfs)
{
- logf (LOG_FATAL, "bfs_create fail");
+ yaz_log(YLOG_FATAL, "bfs_create fail");
exit (1);
}
dict = dict_open (bfs, name, cache, rw, 0);
if (!dict)
{
- logf (LOG_FATAL, "dict_open fail of `%s'", name);
+ yaz_log(YLOG_FATAL, "dict_open fail of `%s'", name);
exit (1);
}
if (inputfile)
if (!(ipf = fopen(inputfile, "r")))
{
- logf (LOG_FATAL|LOG_ERRNO, "cannot open %s", inputfile);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "cannot open %s", inputfile);
exit (1);
}
case 1:
no_of_change++;
if (unique)
- logf (LOG_LOG, "%s change\n", ipf_ptr);
+ yaz_log(YLOG_LOG, "%s change\n", ipf_ptr);
break;
case 2:
if (unique)
- logf (LOG_LOG, "%s duplicate\n", ipf_ptr);
+ yaz_log(YLOG_LOG, "%s duplicate\n", ipf_ptr);
no_of_same++;
break;
}
}
if (rw && delete_term)
{
- logf (LOG_LOG, "dict_delete_subtree %s", delete_term);
+ yaz_log(YLOG_LOG, "dict_delete_subtree %s", delete_term);
dict_delete_subtree (dict, delete_term, 0, 0);
}
if (grep_pattern)
{
if (range < 0)
range = 0;
- logf (LOG_LOG, "Grepping '%s'", grep_pattern);
+ yaz_log(YLOG_LOG, "Grepping '%s'", grep_pattern);
dict_lookup_grep (dict, grep_pattern, range, NULL, &max_pos,
srange, grep_handler);
}
if (rw)
{
- logf (LOG_LOG, "Iterations.... %d", no_of_iterations);
+ yaz_log(YLOG_LOG, "Iterations.... %d", no_of_iterations);
if (do_delete)
{
- logf (LOG_LOG, "No of deleted. %d", no_of_deleted);
- logf (LOG_LOG, "No not found.. %d", no_not_found);
+ yaz_log(YLOG_LOG, "No of deleted. %d", no_of_deleted);
+ yaz_log(YLOG_LOG, "No not found.. %d", no_not_found);
}
else
{
- logf (LOG_LOG, "No of new..... %d", no_of_new);
- logf (LOG_LOG, "No of change.. %d", no_of_change);
+ yaz_log(YLOG_LOG, "No of new..... %d", no_of_new);
+ yaz_log(YLOG_LOG, "No of change.. %d", no_of_change);
}
}
else
{
- logf (LOG_LOG, "Lookups....... %d", no_of_iterations);
- logf (LOG_LOG, "No of hits.... %d", no_of_hits);
- logf (LOG_LOG, "No of misses.. %d", no_of_misses);
+ yaz_log(YLOG_LOG, "Lookups....... %d", no_of_iterations);
+ yaz_log(YLOG_LOG, "No of hits.... %d", no_of_hits);
+ yaz_log(YLOG_LOG, "No of misses.. %d", no_of_misses);
}
if (scan_the_thing)
{
int before = 1000000;
int after = 1000000;
- logf (LOG_LOG, "dict_scan");
+ yaz_log(YLOG_LOG, "dict_scan");
term_dict[0] = 1;
term_dict[1] = 0;
dict_scan (dict, term_dict, &before, &after, 0, scan_handler);
-/* $Id: dopen.c,v 1.9.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: dopen.c,v 1.9.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*/
-
-
#include <sys/types.h>
#include <fcntl.h>
#ifndef WIN32
#include <stdio.h>
#include <stdlib.h>
+#include <yaz/xmalloc.h>
#include <dict.h>
static void common_init (Dict_BFile bf, int block_size, int cache)
-/* $Id: drdwr.c,v 1.13.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: drdwr.c,v 1.13.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
bf_write (bf->bf, effective_block, effective_offset,
p->nbytes, p->data);
#if 0
- logf (LOG_LOG, "bf_write no=%d offset=%d size=%d",
+ yaz_log(YLOG_LOG, "bf_write no=%d offset=%d size=%d",
effective_block, effective_offset,
p->nbytes);
#endif
else
{
#if 0
- logf (LOG_LOG, "bf_write1 no=%d offset=%d size=%d",
+ yaz_log(YLOG_LOG, "bf_write1 no=%d offset=%d size=%d",
effective_block, effective_offset,
remain);
#endif
bf_write (bf->bf, effective_block, effective_offset,
remain, p->data);
#if 0
- logf (LOG_LOG, "bf_write2 no=%d offset=%d size=%d",
+ yaz_log(YLOG_LOG, "bf_write2 no=%d offset=%d size=%d",
effective_block+1, 0, p->nbytes - remain);
#endif
bf_write (bf->bf, effective_block+1, 0,
-/* $Id: insert.c,v 1.22.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: insert.c,v 1.22.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*/
-
-
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
+#include <yaz/xmalloc.h>
#include <dict.h>
#define CHECK 0
}
if (split_page (dict, ptr, p))
{
- logf (LOG_FATAL, "Unable to split page %d\n", ptr);
+ yaz_log(YLOG_FATAL, "Unable to split page %d\n", ptr);
abort ();
}
return dict_ins (dict, str-1, ptr, userlen, userinfo);
-/* $Id: lookgrep.c,v 1.26.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: lookgrep.c,v 1.26.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*/
-
-
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
+#include <yaz/xmalloc.h>
#include <dfa.h>
#include <dict.h>
dfa_verbose = 1;
#endif
- logf (LOG_DEBUG, "dict_lookup_grep range=%d", range);
+ yaz_log(YLOG_DEBUG, "dict_lookup_grep range=%d", range);
for (i = 0; pattern[i]; i++)
{
- logf (LOG_DEBUG, " %3d %c", pattern[i],
+ yaz_log(YLOG_DEBUG, " %3d %c", pattern[i],
(pattern[i] > ' ' && pattern[i] < 127) ? pattern[i] : '?');
}
i = dfa_parse (dfa, &this_pattern);
if (i || *this_pattern)
{
- yaz_log (LOG_WARN, "dfa_parse fail=%d", i);
+ yaz_log(YLOG_WARN, "dfa_parse fail=%d", i);
dfa_delete (&dfa);
return -1;
}
dfa, max_pos, init_pos);
else
i = 0;
- logf (LOG_DEBUG, "max_pos = %d", *max_pos);
+ yaz_log(YLOG_DEBUG, "max_pos = %d", *max_pos);
dfa_delete (&dfa);
xfree (Rj);
rm_MatchContext (&mc);
-/* $Id: open.c,v 1.19.2.1 2006-08-14 10:38:54 adam Exp $
+/* $Id: open.c,v 1.19.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*/
-
-
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-
+#include <yaz/xmalloc.h>
#include <dict.h>
Dict dict_open (BFiles bfs, const char *name, int cache, int rw,
page_size = DICT_DEFAULT_PAGESIZE;
if (page_size < 2048)
{
- logf (LOG_WARN, "Resource %s was too small. Set to 2048",
+ yaz_log(YLOG_WARN, "Resource %s was too small. Set to 2048",
resource_str);
page_size = 2048;
}
if(!dict->dbf)
{
- logf (LOG_WARN, "Cannot open `%s'", name);
+ yaz_log(YLOG_WARN, "Cannot open `%s'", name);
xfree (dict);
return NULL;
}
memcpy (&dict->head, head_buf, sizeof(dict->head));
if (strcmp (dict->head.magic_str, DICT_MAGIC))
{
- logf (LOG_WARN, "Bad magic of `%s'", name);
+ yaz_log(YLOG_WARN, "Bad magic of `%s'", name);
exit (1);
}
if (dict->head.page_size != page_size)
{
- logf (LOG_WARN, "Resource %s is %d and pagesize of `%s' is %d",
+ yaz_log(YLOG_WARN, "Resource %s is %d and pagesize of `%s' is %d",
resource_str, page_size, name, dict->head.page_size);
return 0;
}
-/* $Id: scan.c,v 1.15.2.2 2006-08-14 10:38:54 adam Exp $
+/* $Id: scan.c,v 1.15.2.3 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
{
int i;
- logf (LOG_DEBUG, "dict_scan");
+ yaz_log(YLOG_DEBUG, "dict_scan");
for (i = 0; str[i]; i++)
{
- logf (LOG_DEBUG, " %3d %c", str[i],
+ yaz_log(YLOG_DEBUG, " %3d %c", str[i],
(str[i] > ' ' && str[i] < 127) ? str[i] : '?');
}
if (!dict->head.root)
-/* $Id: apitest.c,v 1.16.2.2 2006-08-14 10:38:57 adam Exp $
+/* $Id: apitest.c,v 1.16.2.3 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
/* bad query? */
if (!query)
{
- logf (LOG_WARN, "bad query %s\n", argv[argno]);
+ yaz_log(YLOG_WARN, "bad query %s\n", argv[argno]);
odr_reset (odr_input);
continue;
}
-/* $Id: dir.c,v 1.28.2.1 2006-08-14 10:38:57 adam Exp $
+/* $Id: dir.c,v 1.28.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*full_rep = '\0';
strcat (full_rep, rep);
- logf (LOG_DEBUG, "dir_open %s", full_rep);
+ yaz_log(YLOG_DEBUG, "dir_open %s", full_rep);
if (!(dir = opendir(full_rep)))
{
- logf (LOG_WARN|LOG_ERRNO, "opendir %s", rep);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "opendir %s", rep);
if (errno != ENOENT && errno != EACCES)
exit (1);
return NULL;
}
entry[idx].name = NULL;
closedir (dir);
- logf (LOG_DEBUG, "dir_close");
+ yaz_log(YLOG_DEBUG, "dir_close");
return entry;
}
-/* $Id: dirs.c,v 1.19.2.2 2006-08-14 10:38:57 adam Exp $
+/* $Id: dirs.c,v 1.19.2.3 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
struct dirs_info *p;
int before = 0, after;
- logf (LOG_DEBUG, "dirs_open %s", rep);
+ yaz_log(YLOG_DEBUG, "dirs_open %s", rep);
p = (struct dirs_info *) xmalloc (sizeof (*p));
p->dict = dict;
p->rw = rw;
after = p->no_max = 100;
p->entries = (struct dirs_entry *)
xmalloc (sizeof(*p->entries) * (p->no_max));
- logf (LOG_DEBUG, "dirs_open first scan");
+ yaz_log(YLOG_DEBUG, "dirs_open first scan");
dict_scan (p->dict, p->nextpath, &before, &after, p, dirs_client_proc);
return p;
}
if (p->no_read < p->no_cur)
{
- logf (LOG_DEBUG, "dirs_read %d. returns %s", p->no_read,
+ yaz_log(YLOG_DEBUG, "dirs_read %d. returns %s", p->no_read,
(p->entries + p->no_read)->path);
return p->last_entry = p->entries + (p->no_read++);
}
}
p->no_read = 1;
p->nextpath_deleted = 0;
- logf (LOG_DEBUG, "dirs_read rescan %s", p->nextpath);
+ yaz_log(YLOG_DEBUG, "dirs_read rescan %s", p->nextpath);
dict_scan (p->dict, p->nextpath, &before, &after, p, dirs_client_proc);
if (p->no_read <= p->no_cur)
return p->last_entry = p->entries;
char path[DIRS_MAX_PATH];
sprintf (path, "%s%s", p->prefix, src);
- logf (LOG_DEBUG, "dirs_mkdir %s", path);
+ yaz_log(YLOG_DEBUG, "dirs_mkdir %s", path);
if (p->rw)
dict_insert (p->dict, path, sizeof(mtime), &mtime);
}
char path[DIRS_MAX_PATH];
sprintf (path, "%s%s", p->prefix, src);
- logf (LOG_DEBUG, "dirs_rmdir %s", path);
+ yaz_log(YLOG_DEBUG, "dirs_rmdir %s", path);
if (p->rw)
dict_delete (p->dict, path);
}
char info[16];
sprintf (path, "%s%s", p->prefix, src);
- logf (LOG_DEBUG, "dirs_add %s", path);
+ yaz_log(YLOG_DEBUG, "dirs_add %s", path);
memcpy (info, &sysno, sizeof(sysno));
memcpy (info+sizeof(sysno), &mtime, sizeof(mtime));
if (p->rw)
char path[DIRS_MAX_PATH];
sprintf (path, "%s%s", p->prefix, src);
- logf (LOG_DEBUG, "dirs_del %s", path);
+ yaz_log(YLOG_DEBUG, "dirs_del %s", path);
if (p->rw)
{
if (!strcmp(path, p->nextpath))
-/* $Id: extract.c,v 1.157.2.5 2006-10-27 11:06:46 adam Exp $
+/* $Id: extract.c,v 1.157.2.6 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
++zh->records_processed;
if (!(zh->records_processed % 1000))
{
- logf (LOG_LOG, "Records: %7d i/u/d %d/%d/%d",
+ yaz_log(YLOG_LOG, "Records: %7d i/u/d %d/%d/%d",
zh->records_processed, zh->records_inserted, zh->records_updated,
zh->records_deleted);
}
;
if (*s != ')')
{
- logf (LOG_WARN, "Missing ) in match criteria %s in group %s",
+ yaz_log(YLOG_WARN, "Missing ) in match criteria %s in group %s",
spec, zh->m_group ? zh->m_group : "none");
return NULL;
}
}
if (first)
{
- logf (LOG_WARN, "Record didn't contain match"
+ yaz_log(YLOG_WARN, "Record didn't contain match"
" fields in (%s,%s)", attset_str, attname_str);
return NULL;
}
}
else
{
- logf (LOG_WARN, "Syntax error in match criteria %s in group %s",
+ yaz_log(YLOG_WARN, "Syntax error in match criteria %s in group %s",
spec, zh->m_group ? zh->m_group : "none");
return NULL;
}
}
if (dst == dstBuf)
{
- logf (LOG_WARN, "No match criteria for record %s in group %s",
+ yaz_log(YLOG_WARN, "No match criteria for record %s in group %s",
fname, zh->m_group ? zh->m_group : "none");
return NULL;
}
recType_byName (zh->reg->recTypes, zh->m_record_type, subType,
&clientData)))
{
- logf (LOG_WARN, "No such record type: %s", zh->m_record_type);
+ yaz_log(YLOG_WARN, "No such record type: %s", zh->m_record_type);
return 0;
}
if (zh->m_flag_rw &&
zh->records_processed < zh->m_file_verbose_limit)
{
- logf (LOG_WARN, "fail %s %s " PRINTF_OFF_T, zh->m_record_type,
+ yaz_log(YLOG_WARN, "fail %s %s " PRINTF_OFF_T, zh->m_record_type,
fname, recordOffset);
}
return 0;
if (zh->m_flag_rw &&
zh->records_processed < zh->m_file_verbose_limit)
{
- logf (LOG_WARN, "no filter for %s %s "
+ yaz_log(YLOG_WARN, "no filter for %s %s "
PRINTF_OFF_T, zh->m_record_type,
fname, recordOffset);
}
if (!zh->m_flag_rw)
return 1;
- logf (LOG_WARN, "empty %s %s " PRINTF_OFF_T, zh->m_record_type,
+ yaz_log(YLOG_WARN, "empty %s %s " PRINTF_OFF_T, zh->m_record_type,
fname, recordOffset);
return 1;
}
}
else
{
- logf (LOG_WARN, "Bad match criteria");
+ yaz_log(YLOG_WARN, "Bad match criteria");
return 0;
}
}
/* new record */
if (deleteFlag)
{
- logf (LOG_LOG, "delete %s %s " PRINTF_OFF_T, zh->m_record_type,
+ yaz_log(YLOG_LOG, "delete %s %s " PRINTF_OFF_T, zh->m_record_type,
fname, recordOffset);
- logf (LOG_WARN, "cannot delete record above (seems new)");
+ yaz_log(YLOG_WARN, "cannot delete record above (seems new)");
return 1;
}
if (zh->records_processed < zh->m_file_verbose_limit)
- logf (LOG_LOG, "add %s %s " PRINTF_OFF_T, zh->m_record_type,
+ yaz_log(YLOG_LOG, "add %s %s " PRINTF_OFF_T, zh->m_record_type,
fname, recordOffset);
rec = rec_new (zh->reg->records);
if (!force_update && recordAttr->runNumber ==
zebraExplain_runNumberIncrement (zh->reg->zei, 0))
{
- yaz_log (LOG_LOG, "run number = %d", recordAttr->runNumber);
- yaz_log (LOG_LOG, "skipped %s %s " PRINTF_OFF_T,
+ yaz_log(YLOG_LOG, "run number = %d", recordAttr->runNumber);
+ yaz_log(YLOG_LOG, "skipped %s %s " PRINTF_OFF_T,
zh->m_record_type, fname, recordOffset);
extract_flushSortKeys (zh, *sysno, -1, &zh->reg->sortKeys);
rec_rm (&rec);
/* record going to be deleted */
if (!delkeys.buf_used)
{
- logf (LOG_LOG, "delete %s %s " PRINTF_OFF_T,
+ yaz_log(YLOG_LOG, "delete %s %s " PRINTF_OFF_T,
zh->m_record_type, fname, recordOffset);
- logf (LOG_WARN, "cannot delete file above, storeKeys false");
+ yaz_log(YLOG_WARN, "cannot delete file above, storeKeys false");
}
else
{
if (zh->records_processed < zh->m_file_verbose_limit)
- logf (LOG_LOG, "delete %s %s " PRINTF_OFF_T,
+ yaz_log(YLOG_LOG, "delete %s %s " PRINTF_OFF_T,
zh->m_record_type, fname, recordOffset);
zh->records_deleted++;
if (matchStr)
/* record going to be updated */
if (!delkeys.buf_used)
{
- logf (LOG_LOG, "update %s %s " PRINTF_OFF_T,
+ yaz_log(YLOG_LOG, "update %s %s " PRINTF_OFF_T,
zh->m_record_type, fname, recordOffset);
- logf (LOG_WARN, "cannot update file above, storeKeys false");
+ yaz_log(YLOG_WARN, "cannot update file above, storeKeys false");
}
else
{
if (zh->records_processed < zh->m_file_verbose_limit)
- logf (LOG_LOG, "update %s %s " PRINTF_OFF_T,
+ yaz_log(YLOG_LOG, "update %s %s " PRINTF_OFF_T,
zh->m_record_type, fname, recordOffset);
extract_flushSortKeys (zh, *sysno, 1, &zh->reg->sortKeys);
extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys);
xmalloc (recordAttr->recordSize);
if (lseek (fi->fd, recordOffset, SEEK_SET) < 0)
{
- logf (LOG_ERRNO|LOG_FATAL, "seek to " PRINTF_OFF_T " in %s",
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "seek to " PRINTF_OFF_T " in %s",
recordOffset, fname);
exit (1);
}
if (read (fi->fd, rec->info[recInfo_storeData], recordAttr->recordSize)
< recordAttr->recordSize)
{
- logf (LOG_ERRNO|LOG_FATAL, "read %d bytes of %s",
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "read %d bytes of %s",
recordAttr->recordSize, fname);
exit (1);
}
else
sprintf (gprefix, "%s.", zh->m_group);
- logf (LOG_DEBUG, "fileExtract %s", fname);
+ yaz_log(YLOG_DEBUG, "fileExtract %s", fname);
/* determine file extension */
*ext = '\0';
if (!zh->m_record_type)
{
if (zh->records_processed < zh->m_file_verbose_limit)
- logf (LOG_LOG, "? %s", fname);
+ yaz_log(YLOG_LOG, "? %s", fname);
return 0;
}
/* determine match criteria */
if ((fd = open (full_rep, O_BINARY|O_RDONLY)) == -1)
{
- logf (LOG_WARN|LOG_ERRNO, "open %s", full_rep);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "open %s", full_rep);
zh->m_record_type = original_record_type;
return 0;
}
}
if (recordType && *recordType) {
- logf (LOG_DEBUG, "Record type explicitly specified: %s", recordType);
+ yaz_log(YLOG_DEBUG, "Record type explicitly specified: %s", recordType);
recType = recType_byName (zh->reg->recTypes, recordType, subType,
&clientData);
} else {
if (!(zh->m_record_type)) {
- logf (LOG_WARN, "No such record type defined");
+ yaz_log(YLOG_WARN, "No such record type defined");
return 0;
}
- logf (LOG_DEBUG, "Get record type from rgroup: %s",zh->m_record_type);
+ yaz_log(YLOG_DEBUG, "Get record type from rgroup: %s",zh->m_record_type);
recType = recType_byName (zh->reg->recTypes, zh->m_record_type, subType,
&clientData);
recordType = zh->m_record_type;
}
if (!recType) {
- logf (LOG_WARN, "No such record type: %s", zh->m_record_type);
+ yaz_log(YLOG_WARN, "No such record type: %s", zh->m_record_type);
return 0;
}
else if (r == RECCTRL_EXTRACT_ERROR_GENERIC)
{
/* error occured during extraction ... */
- yaz_log (LOG_WARN, "extract error: generic");
+ yaz_log(YLOG_WARN, "extract error: generic");
return 0;
}
else if (r == RECCTRL_EXTRACT_ERROR_NO_SUCH_FILTER)
{
/* error occured during extraction ... */
- yaz_log (LOG_WARN, "extract error: no such filter");
+ yaz_log(YLOG_WARN, "extract error: no such filter");
return 0;
}
if (zh->reg->keys.buf_used == 0)
is probably empty - unless flagShowRecords is in use */
if (test_mode)
return 1;
- logf (LOG_WARN, "No keys generated for record");
- logf (LOG_WARN, " The file is probably empty");
+ yaz_log(YLOG_WARN, "No keys generated for record");
+ yaz_log(YLOG_WARN, " The file is probably empty");
return 1;
}
/* match criteria */
zh->m_record_id);
if (!matchStr)
{
- logf (LOG_WARN, "Bad match criteria (recordID)");
+ yaz_log(YLOG_WARN, "Bad match criteria (recordID)");
return 1;
}
}
/* new record */
if (delete_flag)
{
- logf (LOG_LOG, "delete %s %s %ld", recordType,
+ yaz_log(YLOG_LOG, "delete %s %s %ld", recordType,
pr_fname, (long) recordOffset);
- logf (LOG_WARN, "cannot delete record above (seems new)");
+ yaz_log(YLOG_WARN, "cannot delete record above (seems new)");
return 1;
}
- logf (LOG_LOG, "add %s %s %ld", recordType, pr_fname,
+ yaz_log(YLOG_LOG, "add %s %s %ld", recordType, pr_fname,
(long) recordOffset);
rec = rec_new (zh->reg->records);
struct sortKeys sortKeys;
if (!allow_update) {
- logf (LOG_LOG, "skipped %s %s %ld",
+ yaz_log(YLOG_LOG, "skipped %s %s %ld",
recordType, pr_fname, (long) recordOffset);
logRecord(zh);
return -1;
if (recordAttr->runNumber ==
zebraExplain_runNumberIncrement (zh->reg->zei, 0))
{
- logf (LOG_LOG, "skipped %s %s %ld", recordType,
+ yaz_log(YLOG_LOG, "skipped %s %s %ld", recordType,
pr_fname, (long) recordOffset);
extract_flushSortKeys (zh, *sysno, -1, &zh->reg->sortKeys);
rec_rm (&rec);
/* record going to be deleted */
if (!delkeys.buf_used)
{
- logf (LOG_LOG, "delete %s %s %ld", recordType,
+ yaz_log(YLOG_LOG, "delete %s %s %ld", recordType,
pr_fname, (long) recordOffset);
- logf (LOG_WARN, "cannot delete file above, storeKeys false");
+ yaz_log(YLOG_WARN, "cannot delete file above, storeKeys false");
}
else
{
- logf (LOG_LOG, "delete %s %s %ld", recordType,
+ yaz_log(YLOG_LOG, "delete %s %s %ld", recordType,
pr_fname, (long) recordOffset);
zh->records_deleted++;
if (matchStr)
/* record going to be updated */
if (!delkeys.buf_used)
{
- logf (LOG_LOG, "update %s %s %ld", recordType,
+ yaz_log(YLOG_LOG, "update %s %s %ld", recordType,
pr_fname, (long) recordOffset);
- logf (LOG_WARN, "cannot update file above, storeKeys false");
+ yaz_log(YLOG_WARN, "cannot update file above, storeKeys false");
}
else
{
- logf (LOG_LOG, "update %s %s %ld", recordType,
+ yaz_log(YLOG_LOG, "update %s %s %ld", recordType,
pr_fname, (long) recordOffset);
extract_flushSortKeys (zh, *sysno, 1, &zh->reg->sortKeys);
extract_flushRecordKeys (zh, *sysno, 1, &zh->reg->keys);
int mem= 1024*1024* atoi( res_get_def( zh->res, "memmax", "8"));
if (mem <= 0)
{
- logf(LOG_WARN, "Invalid memory setting, using default 8 MB");
+ yaz_log(YLOG_WARN, "Invalid memory setting, using default 8 MB");
mem= 1024*1024*8;
}
/* FIXME: That "8" should be in a default settings include */
#endif
if (!zh->reg->key_buf || ptr_i <= 0)
{
- logf (LOG_DEBUG, " nothing to flush section=%d buf=%p i=%d",
+ yaz_log(YLOG_DEBUG, " nothing to flush section=%d buf=%p i=%d",
zh->reg->key_file_no, zh->reg->key_buf, ptr_i);
- logf (LOG_DEBUG, " buf=%p ",
+ yaz_log(YLOG_DEBUG, " buf=%p ",
zh->reg->key_buf);
- logf (LOG_DEBUG, " ptr=%d ",zh->reg->ptr_i);
- logf (LOG_DEBUG, " reg=%p ",zh->reg);
+ yaz_log(YLOG_DEBUG, " ptr=%d ",zh->reg->ptr_i);
+ yaz_log(YLOG_DEBUG, " reg=%p ",zh->reg);
return;
}
(zh->reg->key_file_no)++;
- logf (LOG_LOG, "sorting section %d", (zh->reg->key_file_no));
- logf (LOG_DEBUG, " sort_buff at %p n=%d",
+ yaz_log(YLOG_LOG, "sorting section %d", (zh->reg->key_file_no));
+ yaz_log(YLOG_DEBUG, " sort_buff at %p n=%d",
zh->reg->key_buf + zh->reg->ptr_top - ptr_i,ptr_i);
#if !SORT_EXTRA
qsort (zh->reg->key_buf + zh->reg->ptr_top - ptr_i, ptr_i,
temp_policy=toupper(res_get_def(zh->res,"tempfiles","auto")[0]);
if (temp_policy != 'Y' && temp_policy != 'N' && temp_policy != 'A') {
- logf (LOG_WARN, "Illegal tempfiles setting '%c'. using 'Auto' ",
+ yaz_log(YLOG_WARN, "Illegal tempfiles setting '%c'. using 'Auto' ",
temp_policy);
temp_policy='A';
}
if (!(outf = fopen (out_fname, "wb")))
{
- logf (LOG_FATAL|LOG_ERRNO, "fopen %s", out_fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "fopen %s", out_fname);
exit (1);
}
- logf (LOG_LOG, "writing section %d", zh->reg->key_file_no);
+ yaz_log(YLOG_LOG, "writing section %d", zh->reg->key_file_no);
prevcp = cp = (zh->reg->key_buf)[zh->reg->ptr_top - ptr_i];
encode_key_init (&encode_info);
if (!(outf = fopen (out_fname, "wb")))
{
- logf (LOG_FATAL|LOG_ERRNO, "fopen %s", out_fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "fopen %s", out_fname);
exit (1);
}
- logf (LOG_LOG, "writing section %d", key_file_no);
+ yaz_log(YLOG_LOG, "writing section %d", key_file_no);
i = ptr_i;
prevcp = key_buf[ptr_top-i];
while (1)
{
key_y_len = strlen(prevcp)+1;
#if 0
- logf (LOG_LOG, "key_y_len: %2d %02x %02x %s",
+ yaz_log(YLOG_LOG, "key_y_len: %2d %02x %02x %s",
key_y_len, prevcp[0], prevcp[1], 2+prevcp);
#endif
qsort (key_buf + ptr_top-ptr_i, ptr_i - i,
#endif
if (fclose (outf))
{
- logf (LOG_FATAL|LOG_ERRNO, "fclose %s", out_fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "fclose %s", out_fname);
exit (1);
}
- logf (LOG_LOG, "finished section %d", zh->reg->key_file_no);
+ yaz_log(YLOG_LOG, "finished section %d", zh->reg->key_file_no);
zh->reg->ptr_i = 0;
zh->reg->key_buf_used = 0;
}
if (ch < 0)
{
ch = zebraExplain_addSU (zei, attrSet, attrUse);
- yaz_log (LOG_DEBUG, "addSU set=%d use=%d SU=%d",
+ yaz_log(YLOG_DEBUG, "addSU set=%d use=%d SU=%d",
attrSet, attrUse, ch);
}
assert (ch > 0);
{
WRBUF wrbuf;
#if 0
- yaz_log (LOG_LOG, "token_add "
+ yaz_log(YLOG_LOG, "token_add "
"reg_type=%c attrSet=%d attrUse=%d seqno=%d s=%.*s",
p->reg_type, p->attrSet, p->attrUse, p->seqno, p->length,
p->string);
i->cmd = *k;
if (fwrite (i->buf, bp - i->buf, 1, outf) != 1)
{
- logf (LOG_FATAL|LOG_ERRNO, "fwrite");
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "fwrite");
exit (1);
}
}
i->cmd = i->prevcmd;
if (fwrite (i->buf, bp - i->buf, 1, outf) != 1)
{
- logf (LOG_FATAL|LOG_ERRNO, "fwrite");
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "fwrite");
exit (1);
}
i->keylen=0; /* ok, it's written, forget it */
i->cmd = i->prevcmd;
if (fwrite (i->buf, bp - i->buf, 1, outf) != 1)
{
- logf (LOG_FATAL|LOG_ERRNO, "fwrite");
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "fwrite");
exit (1);
}
i->keylen=0; /* ok, it's written, forget it */
-/* $Id: invstat.c,v 1.35.2.1 2006-08-14 10:38:58 adam Exp $
+/* $Id: invstat.c,v 1.35.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*to++ = *res++;
}
*to = '\0';
- /* yaz_log (LOG_LOG, "%s", keybuf); */
+ /* yaz_log(YLOG_LOG, "%s", keybuf); */
printf("%10d %s %d.%d - %d.%d\n",count, keybuf,
firstsys,firstseq, lastsys,lastseq);
}
lastsys=key.sysno;
lastseq=key.seqno;
if ( pp->is->method->debug >8 )
- logf (LOG_LOG,"sysno=%d seqno=%d (%x/%x) oc=%d/%d ofs=%d ",
+ yaz_log(YLOG_LOG,"sysno=%d seqno=%d (%x/%x) oc=%d/%d ofs=%d ",
key.sysno, key.seqno,
key.sysno, key.seqno,
occur,occurx, pp->offset);
/* printf("\n"); */ /*!*/
#ifdef SKIPTHIS
if ( pp->is->method->debug >7 )
- logf(LOG_LOG,"item %d=%d:%d says %d keys, counted %d",
+ yaz_log(YLOG_LOG,"item %d=%d:%d says %d keys, counted %d",
isam_p, isamd_type(isam_p), isamd_block(isam_p),
occur, occurx);
#endif
if (occurx != occur)
- logf(LOG_LOG,"Count error!!! read %d, counted %d", occur, occurx);
+ yaz_log(YLOG_LOG,"Count error!!! read %d, counted %d", occur, occurx);
assert (occurx == occur);
i = pp->cat;
if (info[1])
{
fprintf (stdout, " Blocks Occur KB Bytes/Entry\n");
if (zh->reg->isamd->method->debug >0)
- logf(LOG_LOG," Blocks Occur KB Bytes/Entry");
+ yaz_log(YLOG_LOG," Blocks Occur KB Bytes/Entry");
for (i = 0; i<=SINGLETON_TYPE; i++)
{
blocks= isamd_block_used(zh->reg->isamd,i);
(int) ((1023.0 + (double) blocks * size)/1024),
((double) blocks * size)/count);
if (zh->reg->isamd->method->debug >0)
- logf(LOG_LOG, "%c %7d %7d %7d %5.2f",
+ yaz_log(YLOG_LOG, "%c %7d %7d %7d %5.2f",
(i==SINGLETON_TYPE)?('z'):('A'+i),
blocks,
count,
-/* $Id: kcompare.c,v 1.46.2.3 2006-08-14 10:38:58 adam Exp $
+/* $Id: kcompare.c,v 1.46.2.4 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
if (p)
{
memcpy (&key, p, sizeof(key));
- logf (logmask, "%7d:%-4d %s", key.sysno, key.seqno,txt);
+ yaz_log(logmask, "%7d:%-4d %s", key.sysno, key.seqno,txt);
}
else
- logf(logmask, " (null) %s",txt);
+ yaz_log(logmask, " (null) %s",txt);
}
void key_logdump (int logmask, const void *p)
-/* $Id: kdump.c,v 1.24.2.1 2006-08-14 10:38:58 adam Exp $
+/* $Id: kdump.c,v 1.24.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
{
if (!(res = res_open (arg, 0, 0)))
{
- logf(LOG_FATAL, "Failed to open resource file %s", arg);
+ yaz_log(YLOG_FATAL, "Failed to open resource file %s", arg);
exit (1);
}
}
else
{
- logf (LOG_FATAL, "Unknown option '-%s'", arg);
+ yaz_log(YLOG_FATAL, "Unknown option '-%s'", arg);
exit (1);
}
}
zm = zebra_maps_open (res, 0);
if (!(inf = fopen (key_fname, "r")))
{
- logf (LOG_FATAL|LOG_ERRNO, "fopen %s", key_fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "fopen %s", key_fname);
exit (1);
}
printf ("t rg op sysno seqno txt\n");
zebra_maps_close (zm);
if (fclose (inf))
{
- logf (LOG_FATAL|LOG_ERRNO, "fclose %s", key_fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "fclose %s", key_fname);
exit (1);
}
-/* $Id: kinput.c,v 1.59.2.2 2006-08-14 10:38:58 adam Exp $
+/* $Id: kinput.c,v 1.59.2.3 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
f->buf_size = 0;
if (fd == -1)
{
- logf (LOG_WARN|LOG_ERRNO, "cannot open %s", fname);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "cannot open %s", fname);
return ;
}
if (!f->length)
{
if ((f->length = lseek (fd, 0L, SEEK_END)) == (off_t) -1)
{
- logf (LOG_WARN|LOG_ERRNO, "cannot seek %s", fname);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "cannot seek %s", fname);
close (fd);
return ;
}
}
if (lseek (fd, f->offset, SEEK_SET) == -1)
{
- logf (LOG_WARN|LOG_ERRNO, "cannot seek %s", fname);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "cannot seek %s", fname);
close(fd);
return ;
}
}
if (r == -1)
{
- logf (LOG_WARN|LOG_ERRNO, "read of %s", fname);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "read of %s", fname);
close (fd);
return;
}
sprintf(s+strlen(s), "%02X", key[j]&0xff);
if (j == 20)
sprintf(s+strlen(s), " ..");
- yaz_log(LOG_LOG, "key hex=%s", s);
+ yaz_log(YLOG_LOG, "key hex=%s", s);
}
}
d = key_file_decode (f);
d = key_file_decode (f);
itkey.seqno = d + f->seqno;
#if 0
- yaz_log(LOG_LOG, "key sysno=%d seqno=%d cmd=%d", itkey.sysno, itkey.seqno,
+ yaz_log(YLOG_LOG, "key sysno=%d seqno=%d cmd=%d", itkey.sysno, itkey.seqno,
key[i-1]);
#endif
f->seqno = itkey.seqno;
void key_heap_destroy (struct heap_info *hi, int nkeys)
{
int i;
- yaz_log (LOG_DEBUG, "key_heap_destroy");
- yaz_log (LOG_DEBUG, "key_heap_destroy nk=%d",nkeys);
+ yaz_log(YLOG_DEBUG, "key_heap_destroy");
+ yaz_log(YLOG_DEBUG, "key_heap_destroy nk=%d",nkeys);
if (!hi->zh)
for (i = 0; i<=nkeys; i++)
xfree (hi->info.buf[i]);
return 0;
--(zh->reg->ptr_i);
cp=(zh->reg->key_buf)[zh->reg->ptr_top - ptr_i];
- logf (LOG_DEBUG, " raw: i=%ld top=%ld cp=%p", (long) ptr_i,
+ yaz_log(YLOG_DEBUG, " raw: i=%ld top=%ld cp=%p", (long) ptr_i,
(long) zh->reg->ptr_top, cp);
strcpy(name, cp);
memcpy(key, cp+strlen(name)+1, KEY_SIZE);
*to++ = *res++;
}
*to = '\0';
- yaz_log (LOG_LOG, "%s", keybuf);
+ yaz_log(YLOG_LOG, "%s", keybuf);
}
#endif
dictlen=dict_info[0];
memcpy (dictentry, dict_info+1, dictlen );
#ifdef SKIPTHIS
- logf(LOG_LOG,"dictentry before. len=%d: %d %d %d %d %d %d %d %d %d",
+ yaz_log(YLOG_LOG,"dictentry before. len=%d: %d %d %d %d %d %d %d %d %d",
dictlen,dictentry[0], dictentry[1], dictentry[2],
dictentry[3], dictentry[4], dictentry[5],
dictentry[6], dictentry[7], dictentry[8]); /*!*/
hi->no_deletions++;
if (!dict_delete (hi->reg->dict, this_name))
{
- logf (LOG_FATAL, "dict_delete failed");
+ yaz_log(YLOG_FATAL, "dict_delete failed");
abort();
}
}
}
else
{
- logf (LOG_FATAL, "isams doesn't support this kind of update");
+ yaz_log(YLOG_FATAL, "isams doesn't support this kind of update");
break;
}
}
remaining = (time_t) ((now - p->startTime)*
((double) p->totalBytes/p->totalOffset - 1.0));
if (remaining <= 130)
- logf (LOG_LOG, "Merge %2.1f%% completed; %ld seconds remaining",
+ yaz_log(YLOG_LOG, "Merge %2.1f%% completed; %ld seconds remaining",
(100.0*p->totalOffset) / p->totalBytes, (long) remaining);
else
- logf (LOG_LOG, "Merge %2.1f%% completed; %ld minutes remaining",
+ yaz_log(YLOG_LOG, "Merge %2.1f%% completed; %ld minutes remaining",
(100.0*p->totalOffset) / p->totalBytes, (long) remaining/60);
}
p->totalOffset += keyp->buf_size;
int nkeys = zh->reg->key_file_no;
int usefile;
- logf (LOG_DEBUG, " index_merge called with nk=%d b=%p",
+ yaz_log(YLOG_DEBUG, " index_merge called with nk=%d b=%p",
nkeys, zh->reg->key_buf);
if ( (nkeys==0) && (zh->reg->key_buf==0) )
return; /* nothing to merge - probably flush after end-trans */
}
if (hi->no_iterations)
{ /* do not log if nothing happened */
- logf (LOG_LOG, "Iterations . . .%7d", hi->no_iterations);
- logf (LOG_LOG, "Distinct words .%7d", hi->no_diffs);
- logf (LOG_LOG, "Updates. . . . .%7d", hi->no_updates);
- logf (LOG_LOG, "Deletions. . . .%7d", hi->no_deletions);
- logf (LOG_LOG, "Insertions . . .%7d", hi->no_insertions);
+ yaz_log(YLOG_LOG, "Iterations . . .%7d", hi->no_iterations);
+ yaz_log(YLOG_LOG, "Distinct words .%7d", hi->no_diffs);
+ yaz_log(YLOG_LOG, "Updates. . . . .%7d", hi->no_updates);
+ yaz_log(YLOG_LOG, "Deletions. . . .%7d", hi->no_deletions);
+ yaz_log(YLOG_LOG, "Insertions . . .%7d", hi->no_insertions);
}
zh->reg->key_file_no = 0;
Licensed under the Academic Free License version 1.1.
http://opensource.org/licenses/academic.php
-$Id: livcode.c,v 1.1.2.1 2006-10-27 11:06:46 adam Exp $
+$Id: livcode.c,v 1.1.2.2 2006-12-05 21:14:40 adam Exp $
*/
if (!rankfile)
{
- yaz_log(LOG_LOG, "rankfile entry not found in config file" ) ;
+ yaz_log(YLOG_LOG, "rankfile entry not found in config file" ) ;
return 0 ;
}
ifd = yaz_path_fopen(profilePath, rankfile, "r" ) ;
{
if ( !(ifd = fopen( rankfile, "r" )) )
{
- logf( LOG_LOG, "unable to open rankfile %s",rankfile ) ;
+ yaz_log(YLOG_LOG, "unable to open rankfile %s",rankfile ) ;
return 0;
}
}
else
{
- yaz_log(LOG_WARN|LOG_ERRNO, "unable to open config file (%s)",
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "unable to open config file (%s)",
rankfile);
}
}
struct rank_class_info *ci = (struct rank_class_info *)
xmalloc (sizeof(*ci));
- logf (LOG_DEBUG, "livrank create");
+ yaz_log(YLOG_DEBUG, "livrank create");
read_zrank_file(zh) ;
{
struct rank_class_info *ci = (struct rank_class_info *) class_handle;
- logf (LOG_DEBUG, "livrank destroy");
+ yaz_log(YLOG_DEBUG, "livrank destroy");
xfree (ci);
}
struct rank_set_info *si = (struct rank_set_info *) xmalloc (sizeof(*si));
int i;
- logf (LOG_DEBUG, "livrank begin");
+ yaz_log(YLOG_DEBUG, "livrank begin");
si->no_entries = rset->no_rset_terms;
si->no_rank_entries = 0;
si->entries = (struct rank_term_info *)
si->entries[i].local_occur = 0;
si->entries[i].global_occur = g;
si->entries[i].global_inv = 32 - log2_int (g);
- logf (LOG_DEBUG, "-------- %d ------", 32 - log2_int (g));
+ yaz_log(YLOG_DEBUG, "-------- %d ------", 32 - log2_int (g));
}
return si;
}
static void end (struct zebra_register *reg, void *set_handle)
{
struct rank_set_info *si = (struct rank_set_info *) set_handle;
- logf (LOG_DEBUG, "livrank end");
+ yaz_log(YLOG_DEBUG, "livrank end");
xfree (si->entries);
xfree (si);
}
static void add (void *set_handle, int seqno, int term_index)
{
struct rank_set_info *si = (struct rank_set_info *) set_handle;
- logf (LOG_DEBUG, "rank-1 add seqno=%d term_index=%d", seqno, term_index);
+ yaz_log(YLOG_DEBUG, "rank-1 add seqno=%d term_index=%d", seqno, term_index);
si->last_pos = seqno;
si->entries[term_index].local_occur++;
}
int i, lo, divisor, score = 0;
struct rank_set_info *si = (struct rank_set_info *) set_handle;
- logf (LOG_DEBUG, "livrank calc sysno=%d", sysno);
+ yaz_log(YLOG_DEBUG, "livrank calc sysno=%d", sysno);
if (!si->no_rank_entries)
return -1;
-/* $Id: locksrv.c,v 1.17.2.1 2006-08-14 10:38:58 adam Exp $
+/* $Id: locksrv.c,v 1.17.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
zi->server_path_prefix = (char *) xmalloc (strlen(path_prefix)+1);
strcpy (zi->server_path_prefix, path_prefix);
- logf (LOG_DEBUG, "Locking system initialized");
+ yaz_log(YLOG_DEBUG, "Locking system initialized");
return 0;
}
xfree (zi->server_path_prefix);
zebra_lock_destroy (zi->server_lock_cmt);
zebra_lock_destroy (zi->server_lock_org);
- logf (LOG_DEBUG, "Locking system destroyed");
+ yaz_log(YLOG_DEBUG, "Locking system destroyed");
return 0;
}
strcat (path, FNAME_COMMIT_LOCK);
if (!(zi->server_lock_cmt = zebra_lock_create (path, 0)))
{
- logf (LOG_FATAL|LOG_ERRNO, "create %s", path);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "create %s", path);
return -1;
}
assert (zi->server_lock_org == NULL);
strcat (path, FNAME_ORG_LOCK);
if (!(zi->server_lock_org = zebra_lock_create (path, 0)))
{
- logf (LOG_FATAL|LOG_ERRNO, "create %s", path);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "create %s", path);
return -1;
}
}
if (commitPhase)
{
- logf (LOG_DEBUG, "Server locks org");
+ yaz_log(YLOG_DEBUG, "Server locks org");
zebra_lock (zi->server_lock_org);
}
else
{
- logf (LOG_DEBUG, "Server locks cmt");
+ yaz_log(YLOG_DEBUG, "Server locks cmt");
zebra_lock (zi->server_lock_cmt);
}
return 0;
{
if (zi->server_lock_org == NULL)
return;
- logf (LOG_DEBUG, "Server unlocks org");
+ yaz_log(YLOG_DEBUG, "Server unlocks org");
zebra_unlock (zi->server_lock_org);
- logf (LOG_DEBUG, "Server unlocks cmt");
+ yaz_log(YLOG_DEBUG, "Server unlocks cmt");
zebra_unlock (zi->server_lock_cmt);
}
-/* $Id: main.c,v 1.112.2.7 2006-10-27 11:06:46 adam Exp $
+/* $Id: main.c,v 1.112.2.8 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995-2005
Index Data Aps
zs = zebra_start_res (config, 0, res);
if (!zs)
{
- yaz_log (LOG_FATAL, "Cannot read config %s", config);
+ yaz_log(YLOG_FATAL, "Cannot read config %s", config);
exit (1);
}
zh = zebra_open (zs);
if (database && zebra_select_database (zh, database))
{
- logf(LOG_FATAL, "Could not select database %s errCode=%d",
+ yaz_log(YLOG_FATAL, "Could not select database %s errCode=%d",
database, zebra_errCode(zh) );
exit (1);
}
}
else
{
- logf (LOG_FATAL, "unknown command: %s", arg);
+ yaz_log(YLOG_FATAL, "unknown command: %s", arg);
exit (1);
}
}
else if (ret == 'L')
res_set(res, "followLinks", "0");
else
- logf (LOG_WARN, "unknown option '-%s'", arg);
+ yaz_log(YLOG_WARN, "unknown option '-%s'", arg);
} /* while arg */
if (trans_started)
usec = (end_time.tv_sec - start_time.tv_sec) * 1000000.0 +
end_time.tv_usec - start_time.tv_usec;
times(&tms2);
- yaz_log (LOG_LOG, "zebraidx times: %5.2f %5.2f %5.2f",
+ yaz_log(YLOG_LOG, "zebraidx times: %5.2f %5.2f %5.2f",
usec / 1000000,
(double) (tms2.tms_utime - tms1.tms_utime)/100,
(double) (tms2.tms_stime - tms1.tms_stime)/100);
-/* $Id: rank1.c,v 1.14.2.1 2006-08-14 10:38:59 adam Exp $
+/* $Id: rank1.c,v 1.14.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
struct rank_class_info *ci = (struct rank_class_info *)
xmalloc (sizeof(*ci));
- yaz_log (LOG_DEBUG, "rank-1 create");
+ yaz_log(YLOG_DEBUG, "rank-1 create");
return ci;
}
{
struct rank_class_info *ci = (struct rank_class_info *) class_handle;
- yaz_log (LOG_DEBUG, "rank-1 destroy");
+ yaz_log(YLOG_DEBUG, "rank-1 destroy");
xfree (ci);
}
int i;
#if DEBUG_RANK
- yaz_log (LOG_LOG, "rank-1 begin");
+ yaz_log(YLOG_LOG, "rank-1 begin");
#endif
si->no_entries = rset->no_rset_terms;
si->no_rank_entries = 0;
{
int g = rset->rset_terms[i]->nn;
#if DEBUG_RANK
- yaz_log(LOG_LOG, "i=%d flags=%s", i, rset->rset_terms[i]->flags);
+ yaz_log(YLOG_LOG, "i=%d flags=%s", i, rset->rset_terms[i]->flags);
#endif
if (!strncmp (rset->rset_terms[i]->flags, "rank,", 5))
{
else
si->entries[i].rank_weight = 34;
#if DEBUG_RANK
- yaz_log (LOG_LOG, " i=%d weight=%d", i,
+ yaz_log(YLOG_LOG, " i=%d weight=%d", i,
si->entries[i].rank_weight);
#endif
(si->no_rank_entries)++;
si->entries[i].local_occur = 0;
si->entries[i].global_occur = g;
si->entries[i].global_inv = 32 - log2_int (g);
- yaz_log (LOG_DEBUG, " global_inv = %d g = %d", 32 - log2_int (g), g);
+ yaz_log(YLOG_DEBUG, " global_inv = %d g = %d", 32 - log2_int (g), g);
}
return si;
}
static void end (struct zebra_register *reg, void *set_handle)
{
struct rank_set_info *si = (struct rank_set_info *) set_handle;
- yaz_log (LOG_DEBUG, "rank-1 end");
+ yaz_log(YLOG_DEBUG, "rank-1 end");
xfree (si->entries);
xfree (si);
}
{
struct rank_set_info *si = (struct rank_set_info *) set_handle;
#if DEBUG_RANK
- yaz_log (LOG_LOG, "rank-1 add seqno=%d term_index=%d", seqno, term_index);
+ yaz_log(YLOG_LOG, "rank-1 add seqno=%d term_index=%d", seqno, term_index);
#endif
si->last_pos = seqno;
si->entries[term_index].local_occur++;
return -1;
#if DEBUG_RANK
- yaz_log(LOG_LOG, "calc");
+ yaz_log(YLOG_LOG, "calc");
#endif
for (i = 0; i < si->no_entries; i++)
{
#if DEBUG_RANK
- yaz_log(LOG_LOG, "i=%d rank_flag=%d lo=%d",
+ yaz_log(YLOG_LOG, "i=%d rank_flag=%d lo=%d",
i, si->entries[i].rank_flag, si->entries[i].local_occur);
#endif
if (si->entries[i].rank_flag && (lo = si->entries[i].local_occur))
divisor = si->no_rank_entries * (8+log2_int (si->last_pos/si->no_entries));
score = score / divisor;
#if DEBUG_RANK
- yaz_log (LOG_LOG, "sysno=%d score=%d", sysno, score);
+ yaz_log(YLOG_LOG, "sysno=%d score=%d", sysno, score);
#endif
if (score > 1000)
score = 1000;
-/* $Id: recindex.c,v 1.34.2.4 2006-10-27 11:06:46 adam Exp $
+/* $Id: recindex.c,v 1.34.2.5 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
r = bf_write (p->index_BFile, 0, 0, sizeof(p->head), &p->head);
if (r)
{
- logf (LOG_FATAL|LOG_ERRNO, "write head of %s", p->index_fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "write head of %s", p->index_fname);
exit (1);
}
}
r = bf_read (p->index_BFile, 1+pos/128, pos%128, itemsize, buf);
if (r != 1 && !ignoreError)
{
- logf (LOG_FATAL|LOG_ERRNO, "read in %s at pos %ld",
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "read in %s at pos %ld",
p->index_fname, (long) pos);
exit (1);
}
first ? sizeof(block_and_ref) : sizeof(int),
block_and_ref) != 1)
{
- logf (LOG_FATAL|LOG_ERRNO, "read in rec_del_single");
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "read in rec_del_single");
exit (1);
}
if (first)
if (bf_write (p->data_BFile[dst_type], freeblock, 0,
sizeof(block_and_ref), block_and_ref))
{
- logf (LOG_FATAL|LOG_ERRNO, "write in rec_del_single");
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "write in rec_del_single");
exit (1);
}
return;
if (bf_write (p->data_BFile[dst_type], freeblock, 0, sizeof(freeblock),
&p->head.block_free[dst_type]))
{
- logf (LOG_FATAL|LOG_ERRNO, "write in rec_del_single");
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "write in rec_del_single");
exit (1);
}
p->head.block_free[dst_type] = freeblock;
block_free, 0, sizeof(*p->head.block_free),
&p->head.block_free[dst_type]) != 1)
{
- logf (LOG_FATAL|LOG_ERRNO, "read in %s at free block %d",
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "read in %s at free block %d",
p->data_fname[dst_type], block_free);
exit (1);
}
p->index_BFile = bf_open (bfs, p->index_fname, 128, rw);
if (p->index_BFile == NULL)
{
- logf (LOG_FATAL|LOG_ERRNO, "open %s", p->index_fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "open %s", p->index_fname);
exit (1);
}
r = bf_read (p->index_BFile, 0, 0, 0, p->tmp_buf);
memcpy (&p->head, p->tmp_buf, sizeof(p->head));
if (memcmp (p->head.magic, REC_HEAD_MAGIC, sizeof(p->head.magic)))
{
- logf (LOG_FATAL, "file %s has bad format", p->index_fname);
+ yaz_log(YLOG_FATAL, "file %s has bad format", p->index_fname);
exit (1);
}
version = atoi (p->head.version);
if (version != REC_VERSION)
{
- logf (LOG_FATAL, "file %s is version %d, but version"
+ yaz_log(YLOG_FATAL, "file %s is version %d, but version"
" %d is required", p->index_fname, version, REC_VERSION);
exit (1);
}
p->head.block_size[i],
rw)))
{
- logf (LOG_FATAL|LOG_ERRNO, "bf_open %s", p->data_fname[i]);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "bf_open %s", p->data_fname[i]);
exit (1);
}
}
&csize, out_buf, out_offset, 1, 0, 30);
if (i != BZ_OK)
{
- logf (LOG_WARN, "bzBuffToBuffCompress error code=%d", i);
+ yaz_log(YLOG_WARN, "bzBuffToBuffCompress error code=%d", i);
csize = 0;
}
- logf (LOG_LOG, "compress %4d %5d %5d", ref_count, out_offset,
+ yaz_log(YLOG_LOG, "compress %4d %5d %5d", ref_count, out_offset,
csize);
#endif
break;
i = bzBuffToBuffDecompress
#endif
(bz_buf, &bz_size, in_buf, in_size, 0, 0);
- logf (LOG_LOG, "decompress %5d %5d", in_size, bz_size);
+ yaz_log(YLOG_LOG, "decompress %5d %5d", in_size, bz_size);
if (i == BZ_OK)
break;
- logf (LOG_LOG, "failed");
+ yaz_log(YLOG_LOG, "failed");
xfree (bz_buf);
bz_size *= 2;
}
in_buf = bz_buf;
in_size = bz_size;
#else
- logf (LOG_FATAL, "cannot decompress record(s) in BZIP2 format");
+ yaz_log(YLOG_FATAL, "cannot decompress record(s) in BZIP2 format");
exit (1);
#endif
break;
-/* $Id: recstat.c,v 1.8.2.1 2006-08-14 10:38:59 adam Exp $
+/* $Id: recstat.c,v 1.8.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
int i;
int total_bytes = 0;
- logf (LOG_LOG,
+ yaz_log(YLOG_LOG,
"Total records %8d",
records->head.no_records);
for (i = 0; i< REC_BLOCK_TYPES; i++)
{
- logf (LOG_LOG, "Record blocks of size %d",
+ yaz_log(YLOG_LOG, "Record blocks of size %d",
records->head.block_size[i]);
- logf (LOG_LOG,
+ yaz_log(YLOG_LOG,
" Used/Total/Bytes used %d/%d/%d",
records->head.block_used[i], records->head.block_last[i]-1,
records->head.block_used[i] * records->head.block_size[i]);
total_bytes +=
records->head.block_used[i] * records->head.block_size[i];
}
- logf (LOG_LOG,
+ yaz_log(YLOG_LOG,
"Total size of record index in bytes %8d",
records->head.total_bytes);
- logf (LOG_LOG,
+ yaz_log(YLOG_LOG,
"Total size with overhead %8d", total_bytes);
}
-/* $Id: retrieve.c,v 1.21.2.2 2006-08-14 10:38:59 adam Exp $
+/* $Id: retrieve.c,v 1.21.2.3 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
rec = rec_get (zh->reg->records, sysno);
if (!rec)
{
- logf (LOG_DEBUG, "rec_get fail on sysno=%d", sysno);
+ yaz_log(YLOG_DEBUG, "rec_get fail on sysno=%d", sysno);
*basenamep = 0;
return 14;
}
if (!(rt = recType_byName (zh->reg->recTypes,
file_type, subType, &clientData)))
{
- logf (LOG_WARN, "Retrieve: Cannot handle type %s", file_type);
+ yaz_log(YLOG_WARN, "Retrieve: Cannot handle type %s", file_type);
return 14;
}
- logf (LOG_DEBUG, "retrieve localno=%d score=%d", sysno, score);
+ yaz_log(YLOG_DEBUG, "retrieve localno=%d score=%d", sysno, score);
retrieveCtrl.fh = &fc;
fc.fd = -1;
retrieveCtrl.fname = fname;
fc.record_int_len = rec->size[recInfo_storeData];
fc.record_int_buf = rec->info[recInfo_storeData];
fc.record_int_pos = 0;
- logf (LOG_DEBUG, "Internal retrieve. %d bytes", fc.record_int_len);
+ yaz_log(YLOG_DEBUG, "Internal retrieve. %d bytes", fc.record_int_len);
if (raw_mode)
{
*output_format = VAL_SUTRS;
if ((fc.fd = open (full_rep, O_BINARY|O_RDONLY)) == -1)
{
- logf (LOG_WARN|LOG_ERRNO, "Retrieve fail; missing file: %s",
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Retrieve fail; missing file: %s",
full_rep);
rec_rm (&rec);
return 14;
-/* $Id: sortidx.c,v 1.8.2.1 2006-08-14 10:38:59 adam Exp $
+/* $Id: sortidx.c,v 1.8.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
*/
-
-
#include <string.h>
+#include <yaz/xmalloc.h>
#include <yaz/log.h>
#include <bfile.h>
#include <sortidx.h>
sf->type = type;
sf->bf = NULL;
sprintf (fname, "sort%d", type);
- logf (LOG_DEBUG, "sort idx %s wr=%d", fname, si->write_flag);
+ yaz_log(YLOG_DEBUG, "sort idx %s wr=%d", fname, si->write_flag);
sf->bf = bf_open (si->bfs, fname, SORT_IDX_BLOCKSIZE, si->write_flag);
if (!sf->bf)
{
-/* $Id: trav.c,v 1.44.2.2 2006-08-14 10:38:59 adam Exp $
+/* $Id: trav.c,v 1.44.2.3 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
e = dir_open (rep, zh->path_reg, zh->m_follow_links);
if (!e)
return;
- yaz_log (LOG_LOG, "dir %s", rep);
+ yaz_log(YLOG_LOG, "dir %s", rep);
if (rep[rep_len-1] != '/')
rep[rep_len] = '/';
else
sprintf (tmppath, "%s%s", base, src);
e_src = dir_open (tmppath, zh->path_reg, zh->m_follow_links);
- yaz_log (LOG_LOG, "dir %s", tmppath);
+ yaz_log(YLOG_LOG, "dir %s", tmppath);
#if 0
if (!dst || repComp (dst->path, src, src_len))
{
if (e_src[i_src].name)
{
- yaz_log (LOG_DEBUG, "dst=%s src=%s", dst->path + src_len,
+ yaz_log(YLOG_DEBUG, "dst=%s src=%s", dst->path + src_len,
e_src[i_src].name);
sd = strcmp (dst->path + src_len, e_src[i_src].name);
}
sd = 1;
else
break;
- yaz_log (LOG_DEBUG, "trav sd=%d", sd);
+ yaz_log(YLOG_DEBUG, "trav sd=%d", sd);
if (sd == 0)
{
{
dirs_add (di, src, dst->sysno, e_src[i_src].mtime);
}
- yaz_log (LOG_DEBUG, "old: %s", ctime (&dst->mtime));
- yaz_log (LOG_DEBUG, "new: %s", ctime (&e_src[i_src].mtime));
+ yaz_log(YLOG_DEBUG, "old: %s", ctime (&dst->mtime));
+ yaz_log(YLOG_DEBUG, "new: %s", ctime (&e_src[i_src].mtime));
}
dst = dirs_read (di);
break;
case dirs_dir:
fileUpdateR (zh, di, dst, base, src, level+1);
dst = dirs_last (di);
- yaz_log (LOG_DEBUG, "last is %s", dst ? dst->path : "null");
+ yaz_log(YLOG_DEBUG, "last is %s", dst ? dst->path : "null");
break;
default:
dst = dirs_read (di);
if (!(dict = dict_open (zh->reg->bfs, FMATCH_DICT, 50, 0, 0)))
{
- yaz_log (LOG_FATAL, "dict_open fail of %s", FMATCH_DICT);
+ yaz_log(YLOG_FATAL, "dict_open fail of %s", FMATCH_DICT);
return;
}
di = dirs_open (dict, src, zh->m_flag_rw);
while ( (dst = dirs_read (di)) )
- yaz_log (LOG_LOG, "%s", dst->path);
+ yaz_log(YLOG_LOG, "%s", dst->path);
dirs_free (&di);
dict_close (dict);
}
if (ret == -1)
{
- yaz_log (LOG_WARN|LOG_ERRNO, "Cannot access path %s", src);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Cannot access path %s", src);
}
else if (S_ISREG(sbuf.st_mode))
{
}
else
{
- yaz_log (LOG_WARN, "Skipping path %s", src);
+ yaz_log(YLOG_WARN, "Skipping path %s", src);
}
}
strcpy (src, path);
if (ret == -1)
- yaz_log (LOG_WARN|LOG_ERRNO, "Cannot access path %s", src);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Cannot access path %s", src);
else if (S_ISREG(sbuf.st_mode))
fileExtract (zh, NULL, src, deleteFlag);
else if (S_ISDIR(sbuf.st_mode))
repositoryExtractR (zh, deleteFlag, src, 0);
else
- yaz_log (LOG_WARN, "Skipping path %s", src);
+ yaz_log(YLOG_WARN, "Skipping path %s", src);
}
static void repositoryExtractG (ZebraHandle zh, const char *path,
if (!(dict = dict_open (zh->reg->bfs, FMATCH_DICT, 50,
zh->m_flag_rw, 0)))
{
- yaz_log (LOG_FATAL, "dict_open fail of %s", FMATCH_DICT);
+ yaz_log(YLOG_FATAL, "dict_open fail of %s", FMATCH_DICT);
return ;
}
if (!strcmp(path, "") || !strcmp(path, "-"))
-/* $Id: trunc.c,v 1.28.2.5 2006-08-14 10:39:00 adam Exp $
+/* $Id: trunc.c,v 1.28.2.6 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995-2005
Index Data Aps
key_compare_it);
for (i = to-from; --i >= 0; )
{
- logf(LOG_FATAL, "isam_d does not (currently) support truncs");
+ yaz_log(YLOG_FATAL, "isam_d does not (currently) support truncs");
abort();
/*ispt[i] = isamd_pp_open (zi->reg->isamd, isam_p[from+i]); */
if (isamd_pp_read (ispt[i], ti->tmpbuf))
xfree (ispt);
}
else
- logf (LOG_WARN, "Unknown isam set in rset_trunc_r");
+ yaz_log(YLOG_WARN, "Unknown isam set in rset_trunc_r");
parms.rset_term->nn = nn;
rset_close (result, result_rsfd);
const char *term, int length, const char *flags,
int preserve_position, int term_type)
{
- logf (LOG_DEBUG, "rset_trunc no=%d", no);
+ yaz_log(YLOG_DEBUG, "rset_trunc no=%d", no);
if (no < 1)
{
rset_null_parms parms;
{
rset_isamd_parms parms;
- logf(LOG_FATAL, "isam_d does not (currently) support truncs");
+ yaz_log(YLOG_FATAL, "isam_d does not (currently) support truncs");
abort();
/* parms.pos = *isam_p; */
parms.is = zi->reg->isamd;
}
else
{
- logf (LOG_WARN, "Unknown isam set in rset_trunc");
+ yaz_log(YLOG_WARN, "Unknown isam set in rset_trunc");
return rset_create (rset_kind_null, NULL);
}
return rset_trunc_r (zi, term, length, flags, isam_p, 0, no, 100,
-/* $Id: zebraapi.c,v 1.120.2.19 2006-10-27 11:06:46 adam Exp $
+/* $Id: zebraapi.c,v 1.120.2.20 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
{
const char *dir ;
ASSERTZS;
- yaz_log(LOG_API,"zebra_chdir");
+ yaz_log(YLOG_DEBUG, "zebra_chdir");
dir = res_get (zs->global_res, "chdir");
if (!dir)
return;
- logf (LOG_DEBUG, "chdir %s", dir);
+ yaz_log(YLOG_DEBUG, "chdir %s", dir);
#ifdef WIN32
_chdir(dir);
#else
static void zebra_flush_reg (ZebraHandle zh)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_flush_reg");
+ yaz_log(YLOG_DEBUG, "zebra_flush_reg");
zh->errCode=0;
zebraExplain_flush (zh->reg->zei, zh);
return 0;
zh = (ZebraHandle) xmalloc (sizeof(*zh));
- yaz_log (LOG_DEBUG, "zebra_open zs=%p returns %p", zs, zh);
+ yaz_log(YLOG_DEBUG, "zebra_open zs=%p returns %p", zs, zh);
zh->service = zs;
zh->reg = 0; /* no register attached yet */
zh->iconv_to_utf8 =
yaz_iconv_open ("UTF-8", default_encoding);
if (zh->iconv_to_utf8 == 0)
- yaz_log (LOG_WARN, "iconv: %s to UTF-8 unsupported",
+ yaz_log(YLOG_WARN, "iconv: %s to UTF-8 unsupported",
default_encoding);
zh->iconv_from_utf8 =
yaz_iconv_open (default_encoding, "UTF-8");
if (zh->iconv_to_utf8 == 0)
- yaz_log (LOG_WARN, "iconv: UTF-8 to %s unsupported",
+ yaz_log(YLOG_WARN, "iconv: UTF-8 to %s unsupported",
default_encoding);
zebra_mutex_cond_lock (&zs->session_lock);
{
Res res;
- yaz_log(LOG_LOG,"zebra_start %s %s", configName, ZEBRAVER);
+ yaz_log(YLOG_LOG, "zebra_start %s %s", configName, ZEBRAVER);
zebra_flock_init();
const char *passwd_encrypt = 0;
ZebraService zh = xmalloc (sizeof(*zh));
- yaz_log (LOG_DEBUG, "Read resources `%s'", configName);
+ yaz_log(YLOG_DEBUG, "Read resources `%s'", configName);
zh->global_res = res;
zh->configName = xstrdup(configName);
{
zh->passwd_db = passwd_db_open();
if (!zh->passwd_db)
- logf (LOG_WARN|LOG_ERRNO, "passwd_db_open failed");
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "passwd_db_open failed");
else
{
if (passwd_plain)
if (passwd_db_file_plain(zh->passwd_db, passwd_plain))
{
- logf(LOG_WARN,
+ yaz_log(YLOG_WARN,
"Failed to read passwords %s (or unsupported)",
passwd_plain);
}
{
if (passwd_db_file_crypt(zh->passwd_db, passwd_encrypt))
{
- logf(LOG_WARN,
+ yaz_log(YLOG_WARN,
"Failed to read encrypted pwds %s "
"(or unsupported)", passwd_encrypt);
}
assert (res);
- yaz_log (LOG_LOG|LOG_API, "zebra_register_open rw = %d useshadow=%d p=%p,n=%s,rp=%s",
+ yaz_log(YLOG_LOG|YLOG_DEBUG, "zebra_register_open rw = %d useshadow=%d p=%p,n=%s,rp=%s",
rw, useshadow, reg, name, reg_path ? reg_path : "(none)");
reg->dh = data1_createx (DATA1_FLAG_XML);
getcwd(cwd, sizeof(cwd)-1);
profilePath = res_get_def(res, "profilePath", DEFAULT_PROFILE_PATH);
- yaz_log(LOG_LOG, "profilePath=%s cwd=%s", profilePath, cwd);
+ yaz_log(YLOG_LOG, "profilePath=%s cwd=%s", profilePath, cwd);
data1_set_tabpath (reg->dh, profilePath);
data1_set_tabroot (reg->dh, reg_path);
if (!(reg->records = rec_open (reg->bfs, rw, record_compression)))
{
- logf (LOG_WARN, "rec_open");
+ yaz_log(YLOG_WARN, "rec_open");
return 0;
}
if (rw)
}
if (!(reg->dict = dict_open (reg->bfs, FNAME_DICT, 40, rw, 0)))
{
- logf (LOG_WARN, "dict_open");
+ yaz_log(YLOG_WARN, "dict_open");
return 0;
}
if (!(reg->sortIdx = sortIdx_open (reg->bfs, rw)))
{
- logf (LOG_WARN, "sortIdx_open");
+ yaz_log(YLOG_WARN, "sortIdx_open");
return 0;
}
if (res_get_match (res, "isam", "s", ISAM_DEFAULT))
if (!(reg->isams = isams_open (reg->bfs, FNAME_ISAMS, rw,
key_isams_m(res, &isams_m))))
{
- logf (LOG_WARN, "isams_open");
+ yaz_log(YLOG_WARN, "isams_open");
return 0;
}
}
if (!(reg->isam = is_open (reg->bfs, FNAME_ISAM, key_compare, rw,
sizeof (struct it_key), res)))
{
- logf (LOG_WARN, "is_open");
+ yaz_log(YLOG_WARN, "is_open");
return 0;
}
}
if (!(reg->isamc = isc_open (reg->bfs, FNAME_ISAMC,
rw, key_isamc_m(res, &isamc_m))))
{
- logf (LOG_WARN, "isc_open");
+ yaz_log(YLOG_WARN, "isc_open");
return 0;
}
}
if (!(reg->isamd = isamd_open (reg->bfs, FNAME_ISAMD,
rw, key_isamd_m(res, &isamd_m))))
{
- logf (LOG_WARN, "isamd_open");
+ yaz_log(YLOG_WARN, "isamd_open");
return 0;
}
}
if (!(reg->isamb = isamb_open (reg->bfs, "isamb",
rw, key_isamc_m(res, &isamc_m), 0)))
{
- logf (LOG_WARN, "isamb_open");
+ yaz_log(YLOG_WARN, "isamb_open");
return 0;
}
}
if (!(reg->isamb = isamb_open (reg->bfs, "isamb",
rw, key_isamc_m(res, &isamc_m), 1)))
{
- logf (LOG_WARN, "isamb_open");
+ yaz_log(YLOG_WARN, "isamb_open");
return 0;
}
}
if (!(reg->isamb = isamb_open (reg->bfs, "isamb",
rw, key_isamc_m(res, &isamc_m), -1)))
{
- logf (LOG_WARN, "isamb_open");
+ yaz_log(YLOG_WARN, "isamb_open");
return 0;
}
}
explain_extract);
if (!reg->zei)
{
- logf (LOG_WARN, "Cannot obtain EXPLAIN information");
+ yaz_log(YLOG_WARN, "Cannot obtain EXPLAIN information");
return 0;
}
reg->active = 2;
- yaz_log (LOG_DEBUG, "zebra_register_open ok p=%p", reg);
+ yaz_log(YLOG_DEBUG, "zebra_register_open ok p=%p", reg);
return reg;
}
int zebra_admin_shutdown (ZebraHandle zh)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_admin_shutdown");
+ yaz_log(YLOG_DEBUG, "zebra_admin_shutdown");
zh->errCode=0;
zebra_mutex_cond_lock (&zh->service->session_lock);
{
ZebraService zs;
ASSERTZH;
- yaz_log(LOG_API,"zebra_admin_start");
+ yaz_log(YLOG_DEBUG, "zebra_admin_start");
zh->errCode=0;
zs = zh->service;
zebra_mutex_cond_lock (&zs->session_lock);
static void zebra_register_close (ZebraService zs, struct zebra_register *reg)
{
ASSERTZS;
- yaz_log(LOG_LOG|LOG_API, "zebra_register_close p=%p", reg);
+ yaz_log(YLOG_LOG|YLOG_DEBUG, "zebra_register_close p=%p", reg);
reg->stop_flag = 0;
zebra_chdir (zs);
if (reg->records)
{
if (!zs)
return 0;
- yaz_log (LOG_LOG|LOG_API, "zebra_stop");
+ yaz_log(YLOG_LOG|YLOG_DEBUG, "zebra_stop");
while (zs->sessions)
{
struct zebra_session **sp;
int i;
- yaz_log(LOG_API,"zebra_close");
+ yaz_log(YLOG_DEBUG, "zebra_close");
if (!zh)
return 0;
ASSERTZH;
zh->errCode=0;
zs = zh->service;
- yaz_log (LOG_DEBUG, "zebra_close zh=%p", zh);
+ yaz_log(YLOG_DEBUG, "zebra_close zh=%p", zh);
resultSetDestroy (zh, -1, 0, 0);
if (zh->reg)
}
else
{
- yaz_log (LOG_WARN, "no register root specified");
+ yaz_log(YLOG_WARN, "no register root specified");
return 0; /* no path for register - fail! */
}
return res;
struct map_baseinfo *p = &info;
int i;
ASSERTZH;
- yaz_log(LOG_API,"map_basenames ");
+ yaz_log(YLOG_DEBUG, "map_basenames ");
zh->errCode=0;
info.zh = zh;
*num_bases = info.new_num_bases;
*basenames = info.new_basenames;
for (i = 0; i<*num_bases; i++)
- logf (LOG_LOG, "base %s", (*basenames)[i]);
+ yaz_log(YLOG_LOG, "base %s", (*basenames)[i]);
}
int zebra_select_default_database(ZebraHandle zh)
int zebra_select_database (ZebraHandle zh, const char *basename)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_select_database %s",basename);
+ yaz_log(YLOG_DEBUG, "zebra_select_database %s",basename);
return zebra_select_databases (zh, 1, &basename);
}
int len = 0;
char *new_reg = 0;
ASSERTZH;
- yaz_log(LOG_API,"zebra_select_databases n=%d [0]=%s",
+ yaz_log(YLOG_DEBUG, "zebra_select_databases n=%d [0]=%s",
num_bases,basenames[0]);
zebra_clearError(zh);
Z_RPNQuery *query, const char *setname, int *hits)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_search_rpn");
+ yaz_log(YLOG_DEBUG, "zebra_search_rpn");
zebra_clearError(zh);
zh->hits = 0;
ZebraPosSet poset;
int i, *pos_array, ret = 0;
ASSERTZH;
- yaz_log(LOG_API,"zebra_records_retrieve n=%d",num_recs);
+ yaz_log(YLOG_DEBUG, "zebra_records_retrieve n=%d",num_recs);
zebra_clearError(zh);
poset = zebraPosSetCreate (zh, setname, num_recs, pos_array);
if (!poset)
{
- logf (LOG_DEBUG, "zebraPosSetCreate error");
+ yaz_log(YLOG_DEBUG, "zebraPosSetCreate error");
zh->errCode = 30;
zh->errString = nmem_strdup (stream->mem, setname);
ret = -1;
int *is_partial)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_scan");
+ yaz_log(YLOG_DEBUG, "zebra_scan");
zh->errCode=0;
if (zebra_begin_read (zh))
{
int *sort_status)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_sort");
+ yaz_log(YLOG_DEBUG, "zebra_sort");
zh->errCode=0;
if (zebra_begin_read (zh))
return 1;
{
int i, status;
ASSERTZH;
- yaz_log(LOG_API,"zebra_deleleResultSet n=%d",num_setnames);
+ yaz_log(YLOG_DEBUG, "zebra_deleleResultSet n=%d",num_setnames);
zh->errCode=0;
if (zebra_begin_read(zh))
return Z_DeleteStatus_systemProblemAtTarget;
{
if (zh)
{
- yaz_log(LOG_API,"zebra_errCode: %d",zh->errCode);
+ yaz_log(YLOG_DEBUG, "zebra_errCode: %d",zh->errCode);
return zh->errCode;
}
- yaz_log(LOG_API,"zebra_errCode: o");
+ yaz_log(YLOG_DEBUG, "zebra_errCode: o");
return 0;
}
const char *e="";
if (zh)
e= diagbib1_str (zh->errCode);
- yaz_log(LOG_API,"zebra_errString: %s",e);
+ yaz_log(YLOG_DEBUG, "zebra_errString: %s",e);
return e;
}
char *a="";
if (zh)
a= zh->errString;
- yaz_log(LOG_API,"zebra_errAdd: %s",a);
+ yaz_log(YLOG_DEBUG, "zebra_errAdd: %s",a);
return a;
}
xfree (zh->user_perm);
zh->user_perm = xstrdup(p ? p : "r");
- yaz_log(LOG_LOG, "User perm for %s: %s", u, zh->user_perm);
+ yaz_log(YLOG_LOG, "User perm for %s: %s", u, zh->user_perm);
/* users that don't require a password .. */
if (zh->user_perm && strchr(zh->user_perm, 'a'))
const char *record_type)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_admin_import_begin db=%s rt=%s",
+ yaz_log(YLOG_DEBUG, "zebra_admin_import_begin db=%s rt=%s",
database, record_type);
zh->errCode=0;
if (zebra_select_database(zh, database))
int zebra_admin_import_end (ZebraHandle zh)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_admin_import_end");
+ yaz_log(YLOG_DEBUG, "zebra_admin_import_end");
zh->errCode=0;
zebra_end_trans (zh);
return 0;
int sysno;
int i;
ASSERTZH;
- yaz_log(LOG_API,"zebra_admin_import_segment");
+ yaz_log(YLOG_DEBUG, "zebra_admin_import_segment");
zh->errCode=0;
for (i = 0; i<segment->num_segmentRecords; i++)
{
char *rinfo = 0;
char recid_z[256];
ASSERTZH;
- yaz_log(LOG_API,"zebra_admin_exchange_record ac=%d", action);
+ yaz_log(YLOG_DEBUG, "zebra_admin_exchange_record ac=%d", action);
zh->errCode=0;
if (!recid_buf || recid_len <= 0 || recid_len >= sizeof(recid_z))
{
int ret = 0;
ASSERTZH;
- yaz_log(LOG_API,"zebra_drop_database");
+ yaz_log(YLOG_DEBUG, "zebra_drop_database");
zebra_clearError(zh);
}
else
{
- yaz_log(LOG_WARN, "drop database only supported for isam:b");
+ yaz_log(YLOG_WARN, "drop database only supported for isam:b");
ret = -1;
}
zebra_end_trans (zh);
int zebra_create_database (ZebraHandle zh, const char *database)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_create_database");
+ yaz_log(YLOG_DEBUG, "zebra_create_database");
zh->errCode=0;
if (zebra_select_database (zh, database))
{
WRBUF wrbuf;
ASSERTZH;
- yaz_log(LOG_API,"zebra_string_norm ");
+ yaz_log(YLOG_DEBUG, "zebra_string_norm ");
zh->errCode=0;
if (!zh->reg->zebra_maps)
return -1;
long p = getpid();
FILE *f;
ASSERTZH;
- yaz_log(LOG_API,"zebra_set_state v=%d seq=%d", val, seqno);
+ yaz_log(YLOG_DEBUG, "zebra_set_state v=%d seq=%d", val, seqno);
zh->errCode=0;
sprintf (state_fname, "state.%s.LCK", zh->reg_name);
fname = zebra_mk_fname (res_get(zh->res, "lockDir"), state_fname);
f = fopen (fname, "w");
- yaz_log (LOG_DEBUG, "%c %d %ld", val, seqno, p);
+ yaz_log(YLOG_DEBUG, "%c %d %ld", val, seqno, p);
fprintf (f, "%c %d %ld\n", val, seqno, p);
fclose (f);
xfree (fname);
FILE *f;
ASSERTZH;
- yaz_log(LOG_API,"zebra_get_state ");
+ yaz_log(YLOG_DEBUG, "zebra_get_state ");
zh->errCode=0;
sprintf (state_fname, "state.%s.LCK", zh->reg_name);
fname = zebra_mk_fname (res_get(zh->res, "lockDir"), state_fname);
return -1;
}
ASSERTZHRES;
- yaz_log(LOG_API,"zebra_begin_trans rw=%d",rw);
+ yaz_log(YLOG_DEBUG, "zebra_begin_trans rw=%d",rw);
if (zh->user_perm)
{
zebra_get_state (zh, &val, &seqno);
if (val == 'c')
{
- yaz_log (LOG_LOG, "previous transaction didn't finish commit");
+ yaz_log(YLOG_LOG, "previous transaction didn't finish commit");
zebra_unlock (zh->lock_shadow);
zebra_unlock (zh->lock_normal);
zebra_commit (zh);
{
BFiles bfs = bfs_create (res_get (zh->res, "shadow"),
zh->path_reg);
- yaz_log (LOG_LOG, "previous transaction didn't reach commit");
+ yaz_log(YLOG_LOG, "previous transaction didn't reach commit");
bf_commitClean (bfs, rval);
bfs_destroy (bfs);
}
else
{
- yaz_log (LOG_WARN, "your previous transaction didn't finish");
+ yaz_log(YLOG_WARN, "your previous transaction didn't finish");
}
}
break;
}
if (pass == 2)
{
- yaz_log (LOG_FATAL, "zebra_begin_trans couldn't finish commit");
+ yaz_log(YLOG_FATAL, "zebra_begin_trans couldn't finish commit");
abort();
return -1;
}
zh->errCode = 2;
zh->errString = "zebra_begin_trans: cannot open register";
- yaz_log(LOG_FATAL, zh->errString);
+ yaz_log(YLOG_FATAL, zh->errString);
return -1;
}
}
dirty = 1;
else if (seqno != zh->reg->seqno)
{
- yaz_log (LOG_LOG, "reopen seqno cur/old %d/%d",
+ yaz_log(YLOG_LOG, "reopen seqno cur/old %d/%d",
seqno, zh->reg->seqno);
dirty = 1;
}
else if (zh->reg->last_val != val)
{
- yaz_log (LOG_LOG, "reopen last cur/old %d/%d",
+ yaz_log(YLOG_LOG, "reopen last cur/old %d/%d",
val, zh->reg->last_val);
dirty = 1;
}
int zebra_end_trans (ZebraHandle zh)
{
ZebraTransactionStatus dummy;
- yaz_log(LOG_API,"zebra_end_trans");
+ yaz_log(YLOG_DEBUG, "zebra_end_trans");
return zebra_end_transaction(zh, &dummy);
}
const char *rval;
ASSERTZH;
- yaz_log(LOG_API,"zebra_end_transaction");
+ yaz_log(YLOG_DEBUG, "zebra_end_transaction");
status->processed = 0;
status->inserted = 0;
zh->trans_no--;
zh->trans_w_no = 0;
- yaz_log (LOG_LOG, "zebra_end_trans");
+ yaz_log(YLOG_LOG, "zebra_end_trans");
rval = res_get (zh->res, "shadow");
zebraExplain_runNumberIncrement (zh->reg->zei, 1);
zebra_register_close (zh->service, zh->reg);
zh->reg = 0;
- yaz_log (LOG_LOG, "Records: %7d i/u/d %d/%d/%d",
+ yaz_log(YLOG_LOG, "Records: %7d i/u/d %d/%d/%d",
zh->records_processed, zh->records_inserted,
zh->records_updated, zh->records_deleted);
if (val != 'd')
{
BFiles bfs = bfs_create (rval, zh->path_reg);
- yaz_log (LOG_LOG, "deleting shadow stuff val=%c", val);
+ yaz_log(YLOG_LOG, "deleting shadow stuff val=%c", val);
bf_commitClean (bfs, rval);
bfs_destroy (bfs);
}
}
#if HAVE_SYS_TIMES_H
times (&zh->tms2);
- logf (LOG_LOG, "user/system: %ld/%ld",
+ yaz_log(YLOG_LOG, "user/system: %ld/%ld",
(long) (zh->tms2.tms_utime - zh->tms1.tms_utime),
(long) (zh->tms2.tms_stime - zh->tms1.tms_stime));
rval = res_get (zh->res, "shadow");
if (!rval)
{
- logf (LOG_WARN, "Cannot perform commit");
- logf (LOG_WARN, "No shadow area defined");
+ yaz_log(YLOG_WARN, "Cannot perform commit");
+ yaz_log(YLOG_WARN, "No shadow area defined");
return 0;
}
if (val == 'd')
{
- logf(LOG_WARN, "previous transaction didn't reach commit");
+ yaz_log(YLOG_WARN, "previous transaction didn't reach commit");
clean_only = 1;
}
{
zebra_set_state (zh, 'c', seqno);
- logf (LOG_LOG, "commit start");
+ yaz_log(YLOG_LOG, "commit start");
bf_commitExec (bfs);
}
seqno++;
{
zebra_unlock (zh->lock_shadow);
zebra_unlock (zh->lock_normal);
- logf (LOG_LOG, "nothing to commit");
+ yaz_log(YLOG_LOG, "nothing to commit");
}
bfs_destroy (bfs);
int zebra_clean (ZebraHandle zh)
{
- yaz_log(LOG_API,"zebra_clean");
+ yaz_log(YLOG_DEBUG, "zebra_clean");
return zebra_commit_ex(zh, 1);
}
int zebra_commit (ZebraHandle zh)
{
- yaz_log(LOG_API,"zebra_commit");
+ yaz_log(YLOG_DEBUG, "zebra_commit");
return zebra_commit_ex(zh, 0);
}
const char *rval;
BFiles bfs = 0;
ASSERTZH;
- yaz_log(LOG_API,"zebra_init");
+ yaz_log(YLOG_DEBUG, "zebra_init");
zh->errCode=0;
zebra_select_default_database(zh);
{
BFiles bfs;
ASSERTZH;
- yaz_log(LOG_API,"zebra_compact");
+ yaz_log(YLOG_DEBUG, "zebra_compact");
zh->errCode=0;
if (!zh->res)
{
int zebra_result (ZebraHandle zh, int *code, char **addinfo)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_result");
+ yaz_log(YLOG_DEBUG, "zebra_result");
*code = zh->errCode;
*addinfo = zh->errString;
return 0;
int zebra_shadow_enable (ZebraHandle zh, int value)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_shadow_enable");
+ yaz_log(YLOG_DEBUG, "zebra_shadow_enable");
zh->errCode=0;
zh->shadow_enable = value;
return 0;
int zebra_record_encoding (ZebraHandle zh, const char *encoding)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_record_encoding");
+ yaz_log(YLOG_DEBUG, "zebra_record_encoding");
zh->errCode=0;
xfree (zh->record_encoding);
zh->record_encoding = xstrdup (encoding);
- logf(LOG_DEBUG, "Reset record encoding: %s", encoding);
+ yaz_log(YLOG_DEBUG, "Reset record encoding: %s", encoding);
zh->iconv_to_utf8 =
yaz_iconv_open ("UTF-8", encoding);
if (zh->iconv_to_utf8 == 0)
- yaz_log (LOG_WARN, "iconv: %s to UTF-8 unsupported", encoding);
+ yaz_log(YLOG_WARN, "iconv: %s to UTF-8 unsupported", encoding);
zh->iconv_from_utf8 =
yaz_iconv_open (encoding, "UTF-8");
if (zh->iconv_to_utf8 == 0)
- yaz_log (LOG_WARN, "iconv: UTF-8 to %s unsupported", encoding);
+ yaz_log(YLOG_WARN, "iconv: UTF-8 to %s unsupported", encoding);
return 0;
}
int zebra_set_resource(ZebraHandle zh, const char *name, const char *value)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_set_resource %s:%s",name,value);
+ yaz_log(YLOG_DEBUG, "zebra_set_resource %s:%s",name,value);
zh->errCode=0;
res_set(zh->res, name, value);
return 0;
ASSERTZH;
v= res_get_def( zh->res, name, (char *)defaultvalue);
zh->errCode=0;
- yaz_log(LOG_API,"zebra_get_resource %s:%s",name,v);
+ yaz_log(YLOG_DEBUG, "zebra_get_resource %s:%s",name,v);
return v;
}
int zebra_trans_no (ZebraHandle zh)
{
ASSERTZH;
- yaz_log(LOG_API,"zebra_trans_no");
+ yaz_log(YLOG_DEBUG, "zebra_trans_no");
return zh->trans_no;
}
int zebra_get_shadow_enable (ZebraHandle zh)
{
- yaz_log(LOG_API,"zebra_get_shadow_enable");
+ yaz_log(YLOG_DEBUG, "zebra_get_shadow_enable");
return (zh->shadow_enable);
}
int zebra_set_shadow_enable (ZebraHandle zh, int value)
{
- yaz_log(LOG_API,"zebra_set_shadow_enable %d",value);
+ yaz_log(YLOG_DEBUG, "zebra_set_shadow_enable %d",value);
zh->shadow_enable = value;
return 0;
}
{
ZebraPosSet poset;
int i, *pos_array;
- yaz_log(LOG_API,"api_records_retrieve s=%s n=%d",setname,num_recs);
+ yaz_log(YLOG_DEBUG, "api_records_retrieve s=%s n=%d",setname,num_recs);
if (!zh->res)
{
poset = zebraPosSetCreate (zh, setname, num_recs, pos_array);
if (!poset)
{
- logf (LOG_DEBUG, "zebraPosSetCreate error");
+ yaz_log(YLOG_DEBUG, "zebraPosSetCreate error");
zh->errCode = 30;
zh->errString = nmem_strdup (stream->mem, setname);
}
const char *buf, int buf_size, int force_update)
{
int res;
- yaz_log(LOG_API,"zebra_insert_record sysno=%d", *sysno);
+ yaz_log(YLOG_DEBUG, "zebra_insert_record sysno=%d", *sysno);
if (buf_size < 1) buf_size = strlen(buf);
{
int res;
- yaz_log(LOG_API,"zebra_update_record sysno=%d", *sysno);
+ yaz_log(YLOG_DEBUG, "zebra_update_record sysno=%d", *sysno);
if (buf_size < 1) buf_size = strlen(buf);
match, fname,
force_update,
1); /* allow_update */
- yaz_log(LOG_LOG, "zebra_update_record returned res=%d", res);
+ yaz_log(YLOG_LOG, "zebra_update_record returned res=%d", res);
zebra_end_trans(zh);
return res;
}
int force_update)
{
int res;
- yaz_log(LOG_API,"zebra_delete_record sysno=%d", *sysno);
+ yaz_log(YLOG_DEBUG, "zebra_delete_record sysno=%d", *sysno);
if (buf_size < 1) buf_size = strlen(buf);
Z_RPNQuery *query;
ODR odr = odr_createmem(ODR_ENCODE);
- yaz_log(LOG_API,"zebra_search_PQF s=%s q=%s",setname, pqf_query);
+ yaz_log(YLOG_DEBUG, "zebra_search_PQF s=%s q=%s",setname, pqf_query);
query = p_query_rpn (odr, PROTO_Z3950, pqf_query);
if (!query)
- yaz_log (LOG_WARN, "bad query %s\n", pqf_query);
+ yaz_log(YLOG_WARN, "bad query %s\n", pqf_query);
else
res=zebra_search_RPN (zh, odr, query, setname, &hits);
odr_destroy(odr);
- yaz_log(LOG_API,"Hits: %d",hits);
+ yaz_log(YLOG_DEBUG, "Hits: %d",hits);
if (numhits)
*numhits=hits;
int num_input_setnames = 0;
int sort_status = 0;
Z_SortKeySpecList *sort_sequence = yaz_sort_spec (stream, sort_spec);
- yaz_log(LOG_API,"sort (FIXME) ");
+ yaz_log(YLOG_DEBUG, "sort (FIXME) ");
if (!sort_sequence)
{
- logf(LOG_WARN,"invalid sort specs '%s'", sort_spec);
+ yaz_log(YLOG_WARN, "invalid sort specs '%s'", sort_spec);
zh->errCode = 207;
return -1;
}
-/* $Id: zebrash.c,v 1.27.2.1 2006-08-14 10:39:00 adam Exp $
+/* $Id: zebrash.c,v 1.27.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 2002,2003,2004
Index Data Aps
rc=onecommand("yaz_log_file zebrash.log",outbuff,"");
if (!rc)
rc=onecommand("yaz_log_prefix ZebraSh", outbuff,"");
- sprintf(tmp, "yaz_log_level 0x%x", LOG_DEFAULT_LEVEL | LOG_APP);
+ sprintf(tmp, "yaz_log_level 0x%x", YLOG_DEFAULT_LEVEL);
if (!rc)
rc=onecommand(tmp,outbuff,"");
- logf(LOG_APP,"quickstart");
+ yaz_log(YLOG_APP,"quickstart");
if (!zs)
if (!rc)
rc=onecommand("zebra_start",outbuff,"");
static int cmd_yaz_log_level( char *args[], WRBUF outbuff)
{
- int lev = defargint(args[1],LOG_DEFAULT_LEVEL);
+ int lev = defargint(args[1], YLOG_DEFAULT_LEVEL);
wrbuf_printf(outbuff, "setting yaz-log to level %d (ox%x)\n",lev,lev);
yaz_log_init_level(lev);
return 0; /* ok */
return 0; /* ok */
}
-static int cmd_logf( char *args[], WRBUF outbuff)
+static int cmd_yaz_log( char *args[], WRBUF outbuff)
{
int lev = defargint(args[1],0);
int i=1;
if (lev)
i=2;
else
- lev=LOG_LOG; /* this is in the default set!*/
- logf( lev, restargs(args,i));
+ lev=YLOG_LOG; /* this is in the default set!*/
+ yaz_log( lev, restargs(args,i));
return 0; /* ok */
}
{ "logf",
"[level] text...",
"writes an entry in the log",
- cmd_logf},
+ cmd_yaz_log},
{ "", "Error handling:","", 0},
{ "err", "",
char *args[MAX_NO_ARGS];
int nargs;
char argbuf[MAX_ARG_LEN];
- logf(LOG_APP,"%s",line);
+ yaz_log(YLOG_APP,"%s",line);
strncpy(argbuf,line, MAX_ARG_LEN-1);
argbuf[MAX_ARG_LEN-1]='\0'; /* just to be sure */
/*memset(args,'\0',MAX_NO_ARGS*sizeof(char *));*/
return ((cmds[i].testfunc)(args,outbuff));
}
wrbuf_printf(outbuff, "Unknown command '%s'. Try help\n",args[0]);
- logf(LOG_APP,"Unknown command");
+ yaz_log(YLOG_APP,"Unknown command");
return -90;
}
ec=zebra_errCode (zh);
if (ec)
{
- logf(LOG_APP, " Zebra error %d: %s, (%s)",
+ yaz_log(YLOG_APP, " Zebra error %d: %s, (%s)",
ec, zebra_errString (zh),
zebra_errAdd (zh) );
wrbuf_printf(outbuff, " Zebra error %d: %s, (%s)\n",
if (rc==0)
{
wrbuf_puts(outbuff, " OK\n");
- logf(LOG_APP, "OK");
+ yaz_log(YLOG_APP, "OK");
}
else if (rc>-90)
{
-/* $Id: zinfo.c,v 1.37.2.4 2006-08-14 10:39:00 adam Exp $
+/* $Id: zinfo.c,v 1.37.2.5 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
void zebraExplain_close (ZebraExplainInfo zei)
{
#if ZINFO_DEBUG
- yaz_log (LOG_LOG, "zebraExplain_close");
+ yaz_log(YLOG_LOG, "zebraExplain_close");
#endif
if (!zei)
return;
NMEM nmem = nmem_create ();
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_open wr=%d", writeFlag);
+ yaz_log(YLOG_LOG, "zebraExplain_open wr=%d", writeFlag);
#endif
zei = (ZebraExplainInfo) nmem_malloc (nmem, sizeof(*zei));
zei->databaseInfo = 0;
if (!zei->data1_target)
#endif
{
- logf (LOG_FATAL, "Explain schema missing. Check profilePath");
+ yaz_log(YLOG_FATAL, "Explain schema missing. Check profilePath");
nmem_destroy (zei->nmem);
return 0;
}
np = np->child;
assert (np && np->which == DATA1N_data);
zei->runNumber = atoi_n (np->u.data.data, np->u.data.len);
- yaz_log (LOG_DEBUG, "read runnumber = %d", zei->runNumber);
+ yaz_log(YLOG_DEBUG, "read runnumber = %d", zei->runNumber);
*zdip = NULL;
}
rec_rm (&trec);
"</></>\n" );
if (!zei->data1_target)
{
- logf (LOG_FATAL, "Explain schema missing. Check profilePath");
+ yaz_log(YLOG_FATAL, "Explain schema missing. Check profilePath");
nmem_destroy (zei->nmem);
return 0;
}
node_use->u.data.len);
(*zsuip)->info.ordinal = atoi_n (node_ordinal->u.data.data,
node_ordinal->u.data.len);
- logf (LOG_DEBUG, "set=%d use=%d ordinal=%d",
+ yaz_log(YLOG_DEBUG, "set=%d use=%d ordinal=%d",
(*zsuip)->info.set, (*zsuip)->info.use, (*zsuip)->info.ordinal);
zsuip = &(*zsuip)->next;
}
if (!zdi)
return -1;
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_curDatabase: %s", database);
+ yaz_log(YLOG_LOG, "zebraExplain_curDatabase: %s", database);
#endif
if (zdi->readFlag)
{
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_readDatabase: %s", database);
+ yaz_log(YLOG_LOG, "zebraExplain_readDatabase: %s", database);
#endif
zebraExplain_readDatabase (zei, zdi);
}
if (zdi->attributeDetails->readFlag)
{
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_readAttributeDetails: %s", database);
+ yaz_log(YLOG_LOG, "zebraExplain_readAttributeDetails: %s", database);
#endif
zebraExplain_readAttributeDetails (zei, zdi->attributeDetails);
}
database_n = database;
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_newDatabase: %s", database);
+ yaz_log(YLOG_LOG, "zebraExplain_newDatabase: %s", database);
#endif
assert (zei);
for (zdi = zei->databaseInfo; zdi; zdi=zdi->next)
node_categoryList = zcl->data1_categoryList;
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_writeCategoryList");
+ yaz_log(YLOG_LOG, "zebraExplain_writeCategoryList");
#endif
drec = createRecord (zei->records, &sysno);
zad->dirty = 0;
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_writeAttributeDetails");
+ yaz_log(YLOG_LOG, "zebraExplain_writeAttributeDetails");
#endif
drec = createRecord (zei->records, &zad->sysno);
zdi->dirty = 0;
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_writeDatabase %s", zdi->databaseName);
+ yaz_log(YLOG_LOG, "zebraExplain_writeDatabase %s", zdi->databaseName);
#endif
drec = createRecord (zei->records, &zdi->sysno);
assert (zdi->data1_database);
attset = data1_attset_search_id (zei->dh, entp->value);
#if ZINFO_DEBUG
- logf (LOG_LOG, "zebraExplain_writeAttributeSet %s",
+ yaz_log(YLOG_LOG, "zebraExplain_writeAttributeSet %s",
attset ? attset->name : "<unknown>");
#endif
{
data1_handle dh = (data1_handle) p;
if (!data1_get_attset (dh, name))
- logf (LOG_WARN, "Directive attset failed for %s", name);
+ yaz_log(YLOG_WARN, "Directive attset failed for %s", name);
}
void zebraExplain_loadAttsets (data1_handle dh, Res res)
-/* $Id: zrpn.c,v 1.141.2.16 2006-10-27 11:06:46 adam Exp $
+/* $Id: zrpn.c,v 1.141.2.17 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995-2005
Index Data Aps
if (out && *out)
{
const char *outp = *out;
- yaz_log(LOG_LOG, "---");
+ yaz_log(YLOG_LOG, "---");
while (*outp)
{
- yaz_log(LOG_LOG, "%02X", *outp);
+ yaz_log(YLOG_LOG, "%02X", *outp);
outp++;
}
}
int len = key_SU_decode(&su_code, (const unsigned char *) name);
term_untrans(p->zh, p->reg_type, term_tmp, name+len+1);
- yaz_log(LOG_LOG, "grep: %d %c %s", su_code, name[len], term_tmp);
+ yaz_log(YLOG_LOG, "grep: %d %c %s", su_code, name[len], term_tmp);
zebraExplain_lookup_ord(p->zh->reg->zei,
su_code, &db, &set, &use);
- yaz_log(LOG_LOG, "grep: set=%d use=%d db=%s", set, use, db);
+ yaz_log(YLOG_LOG, "grep: set=%d use=%d db=%s", set, use, db);
resultSetAddTerm(p->zh, p->termset, name[len], db,
set, use, term_tmp);
int pos = 0;
char numstr[20];
- yaz_log(LOG_DEBUG, "gen_regular_rel. val=%d, islt=%d", val, islt);
+ yaz_log(YLOG_DEBUG, "gen_regular_rel. val=%d, islt=%d", val, islt);
if (val >= 0)
{
if (islt)
attr_init(&relation, zapt, 2);
relation_value = attr_find(&relation, NULL);
- yaz_log(LOG_DEBUG, "string relation value=%d", relation_value);
+ yaz_log(YLOG_DEBUG, "string relation value=%d", relation_value);
switch (relation_value)
{
case 1:
term_sub, term_component,
space_split, term_dst))
return 0;
- yaz_log(LOG_DEBUG, "Relation <");
+ yaz_log(YLOG_DEBUG, "Relation <");
*term_tmp++ = '(';
for (i = 0; term_component[i]; )
term_sub, term_component,
space_split, term_dst))
return 0;
- yaz_log(LOG_DEBUG, "Relation <=");
+ yaz_log(YLOG_DEBUG, "Relation <=");
*term_tmp++ = '(';
for (i = 0; term_component[i]; )
if (!term_100 (zh->reg->zebra_maps, reg_type,
term_sub, term_component, space_split, term_dst))
return 0;
- yaz_log(LOG_DEBUG, "Relation >");
+ yaz_log(YLOG_DEBUG, "Relation >");
*term_tmp++ = '(';
for (i = 0; term_component[i];)
if (!term_100 (zh->reg->zebra_maps, reg_type, term_sub,
term_component, space_split, term_dst))
return 0;
- yaz_log(LOG_DEBUG, "Relation >=");
+ yaz_log(YLOG_DEBUG, "Relation >=");
*term_tmp++ = '(';
for (i = 0; term_component[i];)
break;
case 3:
default:
- yaz_log(LOG_DEBUG, "Relation =");
+ yaz_log(YLOG_DEBUG, "Relation =");
if (!term_100 (zh->reg->zebra_maps, reg_type, term_sub,
term_component, space_split, term_dst))
return 0;
term_dst, xpath_use);
if (r < 1)
return 0;
- yaz_log(LOG_DEBUG, "term: %s", term_dst);
+ yaz_log(YLOG_DEBUG, "term: %s", term_dst);
return rset_trunc (zh, grep_info->isam_p_buf,
grep_info->isam_p_indx, term_dst,
strlen(term_dst), rank_type, 1 /* preserve pos */,
rpn_char_map_prepare (zh->reg, reg_type, &rcmi);
attr_init (&use, zapt, 1);
use_value = attr_find_ex (&use, &curAttributeSet, &use_string);
- yaz_log(LOG_DEBUG, "string_term, use value %d", use_value);
+ yaz_log(YLOG_DEBUG, "string_term, use value %d", use_value);
attr_init (&truncation, zapt, 5);
truncation_value = attr_find (&truncation, NULL);
- yaz_log(LOG_DEBUG, "truncation value %d", truncation_value);
+ yaz_log(YLOG_DEBUG, "truncation value %d", truncation_value);
if (use_value == -1) /* no attribute - assumy "any" */
use_value = 1016;
if ((r=att_getentbyatt (zh, &attp, curAttributeSet, use_value,
use_string)))
{
- yaz_log(LOG_DEBUG, "att_getentbyatt fail. set=%d use=%d r=%d",
+ yaz_log(YLOG_DEBUG, "att_getentbyatt fail. set=%d use=%d r=%d",
curAttributeSet, use_value, r);
if (r == -1)
{
term_dict[prefix_len++] = ')';
term_dict[prefix_len++] = 1;
term_dict[prefix_len++] = reg_type;
- yaz_log(LOG_DEBUG, "reg_type = %d", term_dict[prefix_len-1]);
+ yaz_log(YLOG_DEBUG, "reg_type = %d", term_dict[prefix_len-1]);
term_dict[prefix_len] = '\0';
j = prefix_len;
switch (truncation_value)
}
if (attr_ok)
{
- yaz_log(LOG_DEBUG, "dict_lookup_grep: %s", term_dict+prefix_len);
+ yaz_log(YLOG_DEBUG, "dict_lookup_grep: %s", term_dict+prefix_len);
r = dict_lookup_grep (zh->reg->dict, term_dict, regex_range,
grep_info, &max_pos, init_pos,
grep_handle);
if (r)
- yaz_log(LOG_WARN, "dict_lookup_grep fail %d", r);
+ yaz_log(YLOG_WARN, "dict_lookup_grep fail %d", r);
}
}
if (!bases_ok)
return -1;
}
*term_sub = termp;
- yaz_log(LOG_DEBUG, "%d positions", grep_info->isam_p_indx);
+ yaz_log(YLOG_DEBUG, "%d positions", grep_info->isam_p_indx);
return 1;
}
}
else
termset_name = termset_value_string;
- yaz_log(LOG_LOG, "creating termset set %s", termset_name);
+ yaz_log(YLOG_LOG, "creating termset set %s", termset_name);
grep_info->termset = resultSetAdd (zh, termset_name, 1);
if (!grep_info->termset)
{
return 0;
while (1)
{
- yaz_log(LOG_DEBUG, "APT_phrase termp=%s", termp);
+ yaz_log(YLOG_DEBUG, "APT_phrase termp=%s", termp);
rset[rset_no] = term_trunc (zh, zapt, &termp, attributeSet,
stream, &grep_info,
reg_type, complete_flag,
return 0;
while (1)
{
- yaz_log(LOG_DEBUG, "APT_or_list termp=%s", termp);
+ yaz_log(YLOG_DEBUG, "APT_or_list termp=%s", termp);
rset[rset_no] = term_trunc (zh, zapt, &termp, attributeSet,
stream, &grep_info,
reg_type, complete_flag,
return 0;
while (1)
{
- yaz_log(LOG_DEBUG, "APT_and_list termp=%s", termp);
+ yaz_log(YLOG_DEBUG, "APT_and_list termp=%s", termp);
rset[rset_no] = term_trunc (zh, zapt, &termp, attributeSet,
stream, &grep_info,
reg_type, complete_flag,
attr_init (&relation, zapt, 2);
relation_value = attr_find (&relation, NULL);
- yaz_log(LOG_DEBUG, "numeric relation value=%d", relation_value);
+ yaz_log(YLOG_DEBUG, "numeric relation value=%d", relation_value);
if (!term_100 (zh->reg->zebra_maps, reg_type, term_sub, term_tmp, 1,
term_dst))
switch (relation_value)
{
case 1:
- yaz_log(LOG_DEBUG, "Relation <");
+ yaz_log(YLOG_DEBUG, "Relation <");
gen_regular_rel (term_tmp, term_value-1, 1);
break;
case 2:
- yaz_log(LOG_DEBUG, "Relation <=");
+ yaz_log(YLOG_DEBUG, "Relation <=");
gen_regular_rel (term_tmp, term_value, 1);
break;
case 4:
- yaz_log(LOG_DEBUG, "Relation >=");
+ yaz_log(YLOG_DEBUG, "Relation >=");
gen_regular_rel (term_tmp, term_value, 0);
break;
case 5:
- yaz_log(LOG_DEBUG, "Relation >");
+ yaz_log(YLOG_DEBUG, "Relation >");
gen_regular_rel (term_tmp, term_value+1, 0);
break;
case 3:
default:
- yaz_log(LOG_DEBUG, "Relation =");
+ yaz_log(YLOG_DEBUG, "Relation =");
sprintf (term_tmp, "(0*%d)", term_value);
}
- yaz_log(LOG_DEBUG, "dict_lookup_grep: %s", term_tmp);
+ yaz_log(YLOG_DEBUG, "dict_lookup_grep: %s", term_tmp);
r = dict_lookup_grep (zh->reg->dict, term_dict, 0, grep_info, max_pos,
0, grep_handle);
if (r)
- yaz_log(LOG_WARN, "dict_lookup_grep fail, rel=gt: %d", r);
- yaz_log(LOG_DEBUG, "%d positions", grep_info->isam_p_indx);
+ yaz_log(YLOG_WARN, "dict_lookup_grep fail, rel=gt: %d", r);
+ yaz_log(YLOG_DEBUG, "%d positions", grep_info->isam_p_indx);
return 1;
}
if ((r=att_getentbyatt (zh, &attp, curAttributeSet, use_value,
use_string)))
{
- yaz_log(LOG_DEBUG, "att_getentbyatt fail. set=%d use=%d r=%d",
+ yaz_log(YLOG_DEBUG, "att_getentbyatt fail. set=%d use=%d r=%d",
curAttributeSet, use_value, r);
if (r == -1)
{
term_dict[prefix_len++] = ')';
term_dict[prefix_len++] = 1;
term_dict[prefix_len++] = reg_type;
- yaz_log(LOG_DEBUG, "reg_type = %d", term_dict[prefix_len-1]);
+ yaz_log(YLOG_DEBUG, "reg_type = %d", term_dict[prefix_len-1]);
term_dict[prefix_len] = '\0';
if (!numeric_relation (zh, zapt, &termp, term_dict,
attributeSet, grep_info, &max_pos, reg_type,
return -1;
}
*term_sub = termp;
- yaz_log(LOG_DEBUG, "%d positions", grep_info->isam_p_indx);
+ yaz_log(YLOG_DEBUG, "%d positions", grep_info->isam_p_indx);
return 1;
}
return 0;
while (1)
{
- yaz_log(LOG_DEBUG, "APT_numeric termp=%s", termp);
+ yaz_log(YLOG_DEBUG, "APT_numeric termp=%s", termp);
grep_info.isam_p_indx = 0;
r = numeric_term (zh, zapt, &termp, attributeSet, &grep_info,
reg_type, complete_flag, num_bases, basenames,
stream);
if (r < 1)
break;
- yaz_log(LOG_DEBUG, "term: %s", term_dst);
+ yaz_log(YLOG_DEBUG, "term: %s", term_dst);
rset[rset_no] = rset_trunc (zh, grep_info.isam_p_buf,
grep_info.isam_p_indx, term_dst,
strlen(term_dst), rank_type,
grep_info.isam_p_indx = 0;
r = dict_lookup_grep (zh->reg->dict, term_dict, 0,
&grep_info, &max_pos, 0, grep_handle);
- yaz_log (LOG_LOG, "%s %d positions", term, grep_info.isam_p_indx);
+ yaz_log(YLOG_LOG, "%s %d positions", term, grep_info.isam_p_indx);
rset = rset_trunc (zh, grep_info.isam_p_buf,
grep_info.isam_p_indx, term, strlen(term),
flags, 1, term_type);
if (xpath_len < 0)
return rset;
- yaz_log (LOG_DEBUG, "len=%d", xpath_len);
+ yaz_log(YLOG_DEBUG, "len=%d", xpath_len);
for (i = 0; i<xpath_len; i++)
{
- yaz_log (LOG_DEBUG, "XPATH %d %s", i, xpath[i].part);
+ yaz_log(YLOG_DEBUG, "XPATH %d %s", i, xpath[i].part);
}
curAttributeSet = VAL_IDXPATH;
if (!first_path)
continue;
}
- yaz_log (LOG_DEBUG, "xpath_rev (%d) = %s", level, xpath_rev);
+ yaz_log(YLOG_DEBUG, "xpath_rev (%d) = %s", level, xpath_rev);
if (strlen(xpath_rev))
{
rset_start_tag = xpath_trunc(zh, stream,
zebra_maps_attr (zh->reg->zebra_maps, zapt, ®_id, &search_type,
rank_type, &complete_flag, &sort_flag);
- yaz_log(LOG_DEBUG, "reg_id=%c", reg_id);
- yaz_log(LOG_DEBUG, "complete_flag=%d", complete_flag);
- yaz_log(LOG_DEBUG, "search_type=%s", search_type);
- yaz_log(LOG_DEBUG, "rank_type=%s", rank_type);
+ yaz_log(YLOG_DEBUG, "reg_id=%c", reg_id);
+ yaz_log(YLOG_DEBUG, "complete_flag=%d", complete_flag);
+ yaz_log(YLOG_DEBUG, "search_type=%s", search_type);
+ yaz_log(YLOG_DEBUG, "rank_type=%s", rank_type);
if (zapt_term_to_utf8(zh, zapt, termz))
return 0;
{
if (zs->u.simple->which == Z_Operand_APT)
{
- yaz_log(LOG_DEBUG, "rpn_search_APT");
+ yaz_log(YLOG_DEBUG, "rpn_search_APT");
r = rpn_search_APT (zh, zs->u.simple->u.attributesPlusTerm,
attributeSet, stream, sort_sequence,
num_bases, basenames);
}
else if (zs->u.simple->which == Z_Operand_resultSetId)
{
- yaz_log(LOG_DEBUG, "rpn_search_ref");
+ yaz_log(YLOG_DEBUG, "rpn_search_ref");
r = resultSetRef (zh, zs->u.simple->u.resultSetId);
if (!r)
{
return 0;
if (zh->errCode)
- yaz_log(LOG_DEBUG, "search error: %d", zh->errCode);
+ yaz_log(YLOG_DEBUG, "search error: %d", zh->errCode);
for (i = 0; sort_sequence->specs[i]; i++)
;
resultSetRank (zh, sset, rset);
else
{
- yaz_log(LOG_DEBUG, "resultSetSortSingle in rpn_search");
+ yaz_log(YLOG_DEBUG, "resultSetSortSingle in rpn_search");
resultSetSortSingle (zh, nmem, sset, rset,
sort_sequence, &sort_status);
if (zh->errCode)
{
- yaz_log(LOG_DEBUG, "resultSetSortSingle status = %d", zh->errCode);
+ yaz_log(YLOG_DEBUG, "resultSetSortSingle status = %d", zh->errCode);
}
}
return rset;
RSFD rfd;
int term_index;
- yaz_log(LOG_DEBUG, "count_set");
+ yaz_log(YLOG_DEBUG, "count_set");
*count = 0;
rfd = rset_open (r, RSETF_READ);
kno++;
}
rset_close (r, rfd);
- yaz_log(LOG_DEBUG, "%d keys, %d records", kno, *count);
+ yaz_log(YLOG_DEBUG, "%d keys, %d records", kno, *count);
}
void rpn_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
}
}
- yaz_log (LOG_DEBUG, "position = %d, num = %d set=%d",
+ yaz_log(YLOG_DEBUG, "position = %d, num = %d set=%d",
pos, num, attributeset);
attr_init (&use, zapt, 1);
zh->errCode = 113;
return ;
}
- yaz_log (LOG_DEBUG, "use_value = %d", use_value);
+ yaz_log(YLOG_DEBUG, "use_value = %d", use_value);
if (use_value == -1)
use_value = 1016;
if ((r=att_getentbyatt (zh, &attp, attributeset, use_value,
use_string)))
{
- yaz_log(LOG_DEBUG, "att_getentbyatt fail. set=%d use=%d",
+ yaz_log(YLOG_DEBUG, "att_getentbyatt fail. set=%d use=%d",
attributeset, use_value);
if (r == -1)
{
}
*list = glist + i; /* list is set to first 'real' entry */
- yaz_log(LOG_DEBUG, "position = %d, num_entries = %d",
+ yaz_log(YLOG_DEBUG, "position = %d, num_entries = %d",
*position, *num_entries);
if (zh->errCode)
- yaz_log(LOG_DEBUG, "scan error: %d", zh->errCode);
+ yaz_log(YLOG_DEBUG, "scan error: %d", zh->errCode);
}
-/* $Id: zserver.c,v 1.117.2.7 2006-10-27 11:06:46 adam Exp $
+/* $Id: zserver.c,v 1.117.2.8 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
q->implementation_name = "Zebra Information Server";
q->implementation_version = "Zebra " ZEBRAVER;
- yaz_log (LOG_DEBUG, "bend_init");
+ yaz_log(YLOG_DEBUG, "bend_init");
sob = statserv_getcontrol ();
if (!(zh = zebra_open (sob->handle)))
{
- yaz_log (LOG_WARN, "Failed to read config `%s'", sob->configname);
+ yaz_log(YLOG_WARN, "Failed to read config `%s'", sob->configname);
r->errcode = 1;
return r;
}
int i;
NMEM nmem = nmem_create();
- yaz_log (LOG_LOG, "character set and language negotiation");
+ yaz_log(YLOG_LOG, "character set and language negotiation");
yaz_get_proposal_charneg (nmem, q->charneg_request,
&charsets, &num_charsets,
}
if (odr_set_charset (q->decode, "UTF-8", right_name) == 0)
{
- yaz_log (LOG_LOG, "charset %d %s (proper name %s): OK", i,
+ yaz_log(YLOG_LOG, "charset %d %s (proper name %s): OK", i,
charsets[i], right_name);
odr_set_charset (q->stream, right_name, "UTF-8");
if (selected)
0, selected);
break;
} else {
- yaz_log (LOG_LOG, "charset %d %s (proper name %s): unsupported", i,
+ yaz_log(YLOG_LOG, "charset %d %s (proper name %s): unsupported", i,
charsets[i], right_name);
}
}
switch (type)
{
case Z_Term_characterString:
- yaz_log (LOG_DEBUG, "term as characterString");
+ yaz_log(YLOG_DEBUG, "term as characterString");
term->which = Z_Term_characterString;
term->u.characterString = odr_strdup (r->stream, outbuf);
break;
case Z_Term_general:
- yaz_log (LOG_DEBUG, "term as general");
+ yaz_log(YLOG_DEBUG, "term as general");
term->which = Z_Term_general;
term->u.general = odr_malloc (r->stream, sizeof(*term->u.general));
term->u.general->size = term->u.general->len = len;
zebra_result (zh, &r->errcode, &r->errstring);
return 0;
}
- yaz_log (LOG_LOG, "ResultSet '%s'", r->setname);
+ yaz_log(YLOG_LOG, "ResultSet '%s'", r->setname);
switch (r->query->which)
{
case Z_Query_type_1: case Z_Query_type_101:
{
if (r->toKeep->databaseName)
{
- yaz_log(LOG_LOG, "adm request database %s", r->toKeep->databaseName);
+ yaz_log(YLOG_LOG, "adm request database %s", r->toKeep->databaseName);
}
switch (r->toKeep->which)
{
case Z_ESAdminOriginPartToKeep_reIndex:
- yaz_log(LOG_LOG, "adm-reindex");
+ yaz_log(YLOG_LOG, "adm-reindex");
break;
case Z_ESAdminOriginPartToKeep_truncate:
- yaz_log(LOG_LOG, "adm-truncate");
+ yaz_log(YLOG_LOG, "adm-truncate");
break;
case Z_ESAdminOriginPartToKeep_drop:
- yaz_log(LOG_LOG, "adm-drop");
+ yaz_log(YLOG_LOG, "adm-drop");
zebra_drop_database (zh, r->toKeep->databaseName);
break;
case Z_ESAdminOriginPartToKeep_create:
- yaz_log(LOG_LOG, "adm-create %s", r->toKeep->databaseName);
+ yaz_log(YLOG_LOG, "adm-create %s", r->toKeep->databaseName);
zebra_create_database (zh, r->toKeep->databaseName);
break;
case Z_ESAdminOriginPartToKeep_import:
- yaz_log(LOG_LOG, "adm-import");
+ yaz_log(YLOG_LOG, "adm-import");
zebra_admin_import_begin (zh, r->toKeep->databaseName,
r->toKeep->u.import->recordType);
break;
case Z_ESAdminOriginPartToKeep_refresh:
- yaz_log(LOG_LOG, "adm-refresh");
+ yaz_log(YLOG_LOG, "adm-refresh");
break;
case Z_ESAdminOriginPartToKeep_commit:
- yaz_log(LOG_LOG, "adm-commit");
+ yaz_log(YLOG_LOG, "adm-commit");
if (r->toKeep->databaseName)
zebra_select_database(zh, r->toKeep->databaseName);
zebra_commit(zh);
break;
case Z_ESAdminOriginPartToKeep_shutdown:
- yaz_log(LOG_LOG, "shutdown");
+ yaz_log(YLOG_LOG, "shutdown");
zebra_admin_shutdown(zh);
break;
case Z_ESAdminOriginPartToKeep_start:
- yaz_log(LOG_LOG, "start");
+ yaz_log(YLOG_LOG, "start");
zebra_admin_start(zh);
break;
default:
- yaz_log(LOG_LOG, "unknown admin");
+ yaz_log(YLOG_LOG, "unknown admin");
}
return 0;
}
es_admin_request (zh, r->u.esRequest);
break;
case Z_Admin_taskPackage:
- yaz_log (LOG_LOG, "adm taskpackage (unhandled)");
+ yaz_log(YLOG_LOG, "adm taskpackage (unhandled)");
break;
default:
break;
{
ZebraHandle zh = (ZebraHandle) handle;
- yaz_log(LOG_LOG, "function: %d", *rr->esr->function);
+ yaz_log(YLOG_LOG, "function: %d", *rr->esr->function);
if (rr->esr->packageName)
- yaz_log(LOG_LOG, "packagename: %s", rr->esr->packageName);
- yaz_log(LOG_LOG, "Waitaction: %d", *rr->esr->waitAction);
+ yaz_log(YLOG_LOG, "packagename: %s", rr->esr->packageName);
+ yaz_log(YLOG_LOG, "Waitaction: %d", *rr->esr->waitAction);
if (!rr->esr->taskSpecificParameters)
{
- yaz_log (LOG_WARN, "No task specific parameters");
+ yaz_log(YLOG_WARN, "No task specific parameters");
}
else if (rr->esr->taskSpecificParameters->which == Z_External_ESAdmin)
{
else if (rr->esr->taskSpecificParameters->which == Z_External_update)
{
Z_IUUpdate *up = rr->esr->taskSpecificParameters->u.update;
- yaz_log (LOG_LOG, "Received DB Update");
+ yaz_log(YLOG_LOG, "Received DB Update");
if (up->which == Z_IUUpdate_esRequest)
{
Z_IUUpdateEsRequest *esRequest = up->u.esRequest;
Z_IUSuppliedRecords *notToKeep = esRequest->notToKeep;
int res;
- yaz_log (LOG_LOG, "action");
+ yaz_log(YLOG_LOG, "action");
if (toKeep->action)
{
switch (*toKeep->action)
{
case Z_IUOriginPartToKeep_recordInsert:
- yaz_log (LOG_LOG, "recordInsert");
+ yaz_log(YLOG_LOG, "recordInsert");
break;
case Z_IUOriginPartToKeep_recordReplace:
- yaz_log (LOG_LOG, "recordUpdate");
+ yaz_log(YLOG_LOG, "recordUpdate");
break;
case Z_IUOriginPartToKeep_recordDelete:
- yaz_log (LOG_LOG, "recordDelete");
+ yaz_log(YLOG_LOG, "recordDelete");
break;
case Z_IUOriginPartToKeep_elementUpdate:
- yaz_log (LOG_LOG, "elementUpdate");
+ yaz_log(YLOG_LOG, "elementUpdate");
break;
case Z_IUOriginPartToKeep_specialUpdate:
- yaz_log (LOG_LOG, "specialUpdate");
+ yaz_log(YLOG_LOG, "specialUpdate");
break;
case Z_ESAdminOriginPartToKeep_shutdown:
- yaz_log (LOG_LOG, "shutDown");
+ yaz_log(YLOG_LOG, "shutDown");
break;
case Z_ESAdminOriginPartToKeep_start:
- yaz_log (LOG_LOG, "start");
+ yaz_log(YLOG_LOG, "start");
break;
default:
- yaz_log (LOG_LOG, " unknown (%d)", *toKeep->action);
+ yaz_log(YLOG_LOG, " unknown (%d)", *toKeep->action);
}
}
if (toKeep->databaseName)
{
- yaz_log (LOG_LOG, "database: %s", toKeep->databaseName);
+ yaz_log(YLOG_LOG, "database: %s", toKeep->databaseName);
if (zebra_select_database(zh, toKeep->databaseName))
return 0;
}
else
{
- yaz_log (LOG_WARN, "no database supplied for ES Update");
+ yaz_log(YLOG_WARN, "no database supplied for ES Update");
rr->errcode = 1008;
rr->errstring = "database";
return 0;
{
oident = oid_getentbyoid(rec->direct_reference);
if (oident)
- yaz_log (LOG_LOG, "record %d type %s", i,
+ yaz_log(YLOG_LOG, "record %d type %s", i,
oident->desc);
}
switch (rec->which)
{
case Z_External_sutrs:
if (rec->u.octet_aligned->len > 170)
- yaz_log (LOG_LOG, "%d bytes:\n%.168s ...",
+ yaz_log(YLOG_LOG, "%d bytes:\n%.168s ...",
rec->u.sutrs->len,
rec->u.sutrs->buf);
else
- yaz_log (LOG_LOG, "%d bytes:\n%s",
+ yaz_log(YLOG_LOG, "%d bytes:\n%s",
rec->u.sutrs->len,
rec->u.sutrs->buf);
break;
case Z_External_octet:
if (rec->u.octet_aligned->len > 170)
- yaz_log (LOG_LOG, "%d bytes:\n%.168s ...",
+ yaz_log(YLOG_LOG, "%d bytes:\n%.168s ...",
rec->u.octet_aligned->len,
rec->u.octet_aligned->buf);
else
- yaz_log (LOG_LOG, "%d bytes\n%s",
+ yaz_log(YLOG_LOG, "%d bytes\n%s",
rec->u.octet_aligned->len,
rec->u.octet_aligned->buf);
}
0);
if (r)
{
- yaz_log(LOG_WARN, "zebra_insert_record failed r=%d", r);
+ yaz_log(YLOG_WARN, "zebra_insert_record failed r=%d", r);
rr->errcode = 224;
rr->errstring = "insert_record failed";
}
1);
if (r)
{
- yaz_log(LOG_WARN, "zebra_update_record failed r=%d", r);
+ yaz_log(YLOG_WARN, "zebra_update_record failed r=%d", r);
rr->errcode = 224;
rr->errstring =
"update_record failed";
0);
if (r)
{
- yaz_log(LOG_WARN, "zebra_delete_record failed r=%d", r);
+ yaz_log(YLOG_WARN, "zebra_delete_record failed r=%d", r);
rr->errcode = 224;
rr->errstring = "delete_record failed";
}
}
else
{
- yaz_log (LOG_WARN, "Unknown Extended Service(%d)",
+ yaz_log(YLOG_WARN, "Unknown Extended Service(%d)",
rr->esr->taskSpecificParameters->which);
rr->errcode = 221;
sob->handle = zebra_start(sob->configname);
if (!sob->handle)
{
- yaz_log (LOG_FATAL, "Failed to read config `%s'", sob->configname);
+ yaz_log(YLOG_FATAL, "Failed to read config `%s'", sob->configname);
exit(1);
}
#ifdef WIN32
{
if (errno != EEXIST)
{
- yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "lock file %s", pidfname);
exit(1);
}
fd = open(pidfname, O_RDWR, 0666);
if (fd == -1)
{
- yaz_log(LOG_FATAL|LOG_ERRNO, "lock file %s", pidfname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "lock file %s", pidfname);
exit(1);
}
}
area.l_len = area.l_start = 0L;
if (fcntl (fd, F_SETLK, &area) == -1)
{
- yaz_log(LOG_ERRNO|LOG_FATAL, "Zebra server already running");
+ yaz_log(YLOG_ERRNO|YLOG_FATAL, "Zebra server already running");
exit(1);
}
else
-/* $Id: zsets.c,v 1.49.2.7 2006-08-14 10:39:02 adam Exp $
+/* $Id: zsets.c,v 1.49.2.8 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005
Index Data Aps
break;
if (s)
{
- yaz_log (LOG_DEBUG, "updating result set %s", name);
+ yaz_log(YLOG_DEBUG, "updating result set %s", name);
if (!ov || s->locked)
return NULL;
if (s->rset)
{
const char *sort_max_str = zebra_get_resource(zh, "sortmax", "1000");
- yaz_log (LOG_DEBUG, "adding result set %s", name);
+ yaz_log(YLOG_DEBUG, "adding result set %s", name);
s = (ZebraSet) xmalloc (sizeof(*s));
s->next = zh->sets;
zh->sets = s;
if (!s->term_entries && !s->rset && s->rpn)
{
NMEM nmem = nmem_create ();
- yaz_log (LOG_LOG, "research %s", name);
+ yaz_log(YLOG_LOG, "research %s", name);
s->rset =
rpn_search (zh, nmem, s->rpn, s->num_bases,
s->basenames, s->name, s);
if (s->rset && s->sortSpec)
{
int sort_status;
- yaz_log (LOG_LOG, "resort %s", name);
+ yaz_log(YLOG_LOG, "resort %s", name);
resultSetSortSingle (zh, nmem, s, s->rset, s->sortSpec,
&sort_status);
}
position = positions[i];
if (position > 0 && position <= sort_info->num_entries)
{
- yaz_log (LOG_DEBUG, "got pos=%d (sorted)", position);
+ yaz_log(YLOG_DEBUG, "got pos=%d (sorted)", position);
sr[i].sysno = sort_info->entries[position-1]->sysno;
sr[i].score = sort_info->entries[position-1]->score;
}
if (position == positions[num_i])
{
sr[num_i].sysno = psysno;
- yaz_log (LOG_DEBUG, "got pos=%d (unsorted)", position);
+ yaz_log(YLOG_DEBUG, "got pos=%d (unsorted)", position);
sr[num_i].score = -1;
num_i++;
}
zh->errCode = 230;
return;
}
- yaz_log (LOG_DEBUG, "result set sort input=%s output=%s",
+ yaz_log(YLOG_DEBUG, "result set sort input=%s output=%s",
*input_setnames, output_setname);
sset = resultSetGet (zh, input_setnames[0]);
if (!sset)
switch (sk->which)
{
case Z_SortKey_sortField:
- yaz_log (LOG_DEBUG, "Sort: key %d is of type sortField", i+1);
+ yaz_log(YLOG_DEBUG, "Sort: key %d is of type sortField", i+1);
zh->errCode = 207;
return;
case Z_SortKey_elementSpec:
- yaz_log (LOG_DEBUG, "Sort: key %d is of type elementSpec", i+1);
+ yaz_log(YLOG_DEBUG, "Sort: key %d is of type elementSpec", i+1);
zh->errCode = 207;
return;
case Z_SortKey_sortAttributes:
- yaz_log (LOG_DEBUG, "Sort: key %d is of type sortAttributes", i+1);
+ yaz_log(YLOG_DEBUG, "Sort: key %d is of type sortAttributes", i+1);
sort_criteria[i].attrUse =
zebra_maps_sort (zh->reg->zebra_maps,
sk->u.sortAttributes,
&sort_criteria[i].numerical);
- yaz_log (LOG_DEBUG, "use value = %d", sort_criteria[i].attrUse);
+ yaz_log(YLOG_DEBUG, "use value = %d", sort_criteria[i].attrUse);
if (sort_criteria[i].attrUse == -1 && sks->which != Z_SortKeySpec_null)
{
zh->errCode = 116;
}
rset_close (rset, rfd);
- yaz_log (LOG_LOG, "%d keys, %d sysnos, sort", kno, sset->hits);
+ yaz_log(YLOG_LOG, "%d keys, %d sysnos, sort", kno, sset->hits);
for (i = 0; i < rset->no_rset_terms; i++)
- yaz_log (LOG_LOG, "term=\"%s\" nn=%d type=%s count=%d",
+ yaz_log(YLOG_LOG, "term=\"%s\" nn=%d type=%s count=%d",
rset->rset_terms[i]->name,
rset->rset_terms[i]->nn,
rset->rset_terms[i]->flags,
rank_class = zebraRankLookup (zh, rank_handler_name);
if (!rank_class)
{
- yaz_log (LOG_WARN, "No such rank handler: %s", rank_handler_name);
+ yaz_log(YLOG_WARN, "No such rank handler: %s", rank_handler_name);
return;
}
rc = rank_class->control;
}
rset_close (rset, rfd);
- yaz_log (LOG_LOG, "%d keys, %d sysnos, rank", kno, zebraSet->hits);
+ yaz_log(YLOG_LOG, "%d keys, %d sysnos, rank", kno, zebraSet->hits);
for (i = 0; i < rset->no_rset_terms; i++)
- yaz_log (LOG_LOG, "term=\"%s\" nn=%d type=%s count=%d",
+ yaz_log(YLOG_LOG, "term=\"%s\" nn=%d type=%s count=%d",
rset->rset_terms[i]->name,
rset->rset_terms[i]->nn,
rset->rset_terms[i]->flags,
-/* $Id: zvrank.c,v 1.7.2.1 2004-11-04 12:49:36 heikki Exp $
+/* $Id: zvrank.c,v 1.7.2.2 2006-12-05 21:14:40 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
typedef struct rs_info *RS;
static void prn_rs(RS rs) { /* for debugging */
- yaz_log(LOG_DEBUG, "* RS:");
- yaz_log(LOG_DEBUG, " db_docs: %d", rs->db_docs);
- yaz_log(LOG_DEBUG, " db_terms: %d", rs->db_terms);
- yaz_log(LOG_DEBUG, " f_max: %d", rs->db_f_max);
- yaz_log(LOG_DEBUG, " f_max_str: %s", rs->db_f_max_str);
- yaz_log(LOG_DEBUG, " veclen: %d", rs->veclen);
+ yaz_log(YLOG_DEBUG, "* RS:");
+ yaz_log(YLOG_DEBUG, " db_docs: %d", rs->db_docs);
+ yaz_log(YLOG_DEBUG, " db_terms: %d", rs->db_terms);
+ yaz_log(YLOG_DEBUG, " f_max: %d", rs->db_f_max);
+ yaz_log(YLOG_DEBUG, " f_max_str: %s", rs->db_f_max_str);
+ yaz_log(YLOG_DEBUG, " veclen: %d", rs->veclen);
/* rscheme implies functions */
- yaz_log(LOG_DEBUG, " rscheme: %s", rs->rscheme);
+ yaz_log(YLOG_DEBUG, " rscheme: %s", rs->rscheme);
return;
}
#if 0
static void prn_ds(DS ds) { /* for debugging */
- yaz_log(LOG_DEBUG, " * DS:");
- yaz_log(LOG_DEBUG, " docid: %s", ds->docid);
- yaz_log(LOG_DEBUG, " docno: %d", ds->docno);
- yaz_log(LOG_DEBUG, " doclen: %d", ds->doclen);
- yaz_log(LOG_DEBUG, " d_f_max: %d", ds->d_f_max);
- yaz_log(LOG_DEBUG, " d_f_max_str:%s", ds->d_f_max_str);
- yaz_log(LOG_DEBUG, " veclen: %d", ds->veclen);
+ yaz_log(YLOG_DEBUG, " * DS:");
+ yaz_log(YLOG_DEBUG, " docid: %s", ds->docid);
+ yaz_log(YLOG_DEBUG, " docno: %d", ds->docno);
+ yaz_log(YLOG_DEBUG, " doclen: %d", ds->doclen);
+ yaz_log(YLOG_DEBUG, " d_f_max: %d", ds->d_f_max);
+ yaz_log(YLOG_DEBUG, " d_f_max_str:%s", ds->d_f_max_str);
+ yaz_log(YLOG_DEBUG, " veclen: %d", ds->veclen);
return;
}
#endif
#if 0
static void prn_ts(TS ts) { /* for debugging */
- yaz_log(LOG_DEBUG, " * TERM:%s gocc:%d locc:%d tf:%f idf:%f wt:%f",
+ yaz_log(YLOG_DEBUG, " * TERM:%s gocc:%d locc:%d tf:%f idf:%f wt:%f",
ts->name, ts->gocc, ts->locc, ts->tf, ts->idf, ts->wt);
return;
}
/* idf ^ 2 */
veclen=ds->veclen;
num_docs=rs->db_docs;
- yaz_log(LOG_DEBUG, "idf_squared: db_docs required");
+ yaz_log(YLOG_DEBUG, "idf_squared: db_docs required");
for (i=0; i < veclen; i++) {
gocc=ds->terms[i].gocc;
if (gocc==0)
char c0, c1, c2, c3, c4, c5, c6;
const char *def_rscheme="ntc-atn"; /* a good default */
/**/
- yaz_log(LOG_DEBUG, "zv_init_scheme");
+ yaz_log(YLOG_DEBUG, "zv_init_scheme");
slen=strlen(sname);
if (slen < 7)
- yaz_log(LOG_LOG, "zvrank: invalid weighting-scheme \"%s\"", sname);
+ yaz_log(YLOG_LOG, "zvrank: invalid weighting-scheme \"%s\"", sname);
if (slen > 0) c0=sname[0]; else c0=def_rscheme[0];
if (slen > 1) c1=sname[1]; else c1=def_rscheme[1];
if (slen > 2) c2=sname[2]; else c2=def_rscheme[2];
case 'm':
rs->d_tf_fct=tf_max_norm;
rs->rscheme[0]='m';
- yaz_log(LOG_DEBUG, "tf_max_norm: d_f_max required");
+ yaz_log(YLOG_DEBUG, "tf_max_norm: d_f_max required");
break;
case 'a':
rs->d_tf_fct=tf_aug_norm;
rs->rscheme[0]='a';
- yaz_log(LOG_DEBUG, "tf_aug_norm: d_f_max required");
+ yaz_log(YLOG_DEBUG, "tf_aug_norm: d_f_max required");
break;
case 's':
rs->d_tf_fct=tf_square;
case 't':
rs->d_idf_fct=idf_tfidf;
rs->rscheme[1]='t';
- yaz_log(LOG_DEBUG, "idf_tfidf: db_docs required");
+ yaz_log(YLOG_DEBUG, "idf_tfidf: db_docs required");
break;
case 'p':
rs->d_idf_fct=idf_prob;
rs->rscheme[1]='p';
- yaz_log(LOG_DEBUG, "idf_prob: db_docs required");
+ yaz_log(YLOG_DEBUG, "idf_prob: db_docs required");
break;
case 'f':
rs->d_idf_fct=idf_freq;
rs->rscheme[1]='f';
- yaz_log(LOG_DEBUG, "idf_freq: db_docs required");
+ yaz_log(YLOG_DEBUG, "idf_freq: db_docs required");
break;
case 's':
rs->d_idf_fct=idf_squared;
rs->rscheme[1]='s';
- yaz_log(LOG_DEBUG, "idf_squared: db_docs required");
+ yaz_log(YLOG_DEBUG, "idf_squared: db_docs required");
break;
default: /* 'n' */
rs->d_idf_fct=idf_none;
break;
case 'm':
rs->q_tf_fct=tf_max_norm;
- yaz_log(LOG_DEBUG, "tf_max_norm: d_f_max required");
+ yaz_log(YLOG_DEBUG, "tf_max_norm: d_f_max required");
rs->rscheme[4]='m';
break;
case 'a':
rs->q_tf_fct=tf_aug_norm;
rs->rscheme[4]='a';
- yaz_log(LOG_DEBUG, "tf_aug_norm: d_f_max required");
+ yaz_log(YLOG_DEBUG, "tf_aug_norm: d_f_max required");
break;
case 's':
rs->q_tf_fct=tf_square;
case 't':
rs->q_idf_fct=idf_tfidf;
rs->rscheme[5]='t';
- yaz_log(LOG_DEBUG, "idf_tfidf: db_docs required");
+ yaz_log(YLOG_DEBUG, "idf_tfidf: db_docs required");
break;
case 'p':
rs->q_idf_fct=idf_prob;
rs->rscheme[5]='p';
- yaz_log(LOG_DEBUG, "idf_prob: db_docs required");
+ yaz_log(YLOG_DEBUG, "idf_prob: db_docs required");
break;
case 'f':
rs->q_idf_fct=idf_freq;
rs->rscheme[5]='f';
- yaz_log(LOG_DEBUG, "idf_freq: db_docs required");
+ yaz_log(YLOG_DEBUG, "idf_freq: db_docs required");
break;
case 's':
rs->q_idf_fct=idf_squared;
rs->rscheme[5]='s';
- yaz_log(LOG_DEBUG, "idf_squared: db_docs required");
+ yaz_log(YLOG_DEBUG, "idf_squared: db_docs required");
break;
default: /* 'n' */
rs->q_idf_fct=idf_none;
rs->rscheme[7]='\0';
/**/
rs->sim_fct=sim_cosine;
- yaz_log(LOG_DEBUG, "zv_scheme %s", rs->rscheme);
+ yaz_log(YLOG_DEBUG, "zv_scheme %s", rs->rscheme);
return;
}
static void zv_init(RS rs, const char *rscheme) {
- yaz_log(LOG_DEBUG, "zv_init");
+ yaz_log(YLOG_DEBUG, "zv_init");
/**/
rs->db_docs=100000; /* assign correct value here */
rs->db_terms=500000; /* assign correct value here (for debugging) */
const char *wscheme;
struct rank_class_info *ci = (struct rank_class_info *)
xmalloc (sizeof(*ci));
- yaz_log(LOG_DEBUG, "zv_create");
+ yaz_log(YLOG_DEBUG, "zv_create");
wscheme=res_get_def(res, "zvrank.weighting-scheme", "");
for (i=0; wscheme[i] && i < 8; i++)
ci->rscheme[i]=wscheme[i];
*/
static void zv_destroy (struct zebra_register *reg, void *class_handle) {
struct rank_class_info *ci = (struct rank_class_info *) class_handle;
- yaz_log(LOG_DEBUG, "zv_destroy");
+ yaz_log(YLOG_DEBUG, "zv_destroy");
xfree (ci);
}
int i;
int veclen, gocc;
/**/
- yaz_log(LOG_DEBUG, "zv_begin");
+ yaz_log(YLOG_DEBUG, "zv_begin");
veclen=rset->no_rset_terms; /* smaller vector here */
zv_init(rs, ci->rscheme);
rs->veclen=veclen;
rs->rdoc->veclen=veclen;
rs->rdoc->d_f_max=10; /* just a guess */
rs->rdoc->d_f_max_str="";
- /* yaz_log(LOG_DEBUG, "zv_begin_init"); */
+ /* yaz_log(YLOG_DEBUG, "zv_begin_init"); */
for (i = 0; i < rs->veclen; i++)
{
gocc=rset->rset_terms[i]->nn;
- /* yaz_log(LOG_DEBUG, "zv_begin_init i=%d gocc=%d", i, gocc); */
+ /* yaz_log(YLOG_DEBUG, "zv_begin_init i=%d gocc=%d", i, gocc); */
rs->qdoc->terms[i].gocc=gocc;
rs->qdoc->terms[i].locc=1; /* assume query has no duplicate terms */
rs->rdoc->terms[i].gocc=gocc;
static void zv_end (struct zebra_register *reg, void *rsi)
{
RS rs=(RS)rsi;
- yaz_log(LOG_DEBUG, "zv_end");
+ yaz_log(YLOG_DEBUG, "zv_end");
xfree(rs->qdoc->terms);
xfree(rs->rdoc->terms);
xfree(rs->qdoc);
*/
static void zv_add (void *rsi, int seqno, int i) {
RS rs=(RS)rsi;
- /* yaz_log(LOG_DEBUG, "zvrank zv_add seqno=%d term_index=%d", seqno, term_index);*/
+ /* yaz_log(YLOG_DEBUG, "zvrank zv_add seqno=%d term_index=%d", seqno, term_index);*/
rs->rdoc->terms[i].locc++;
}
int score=0;
double dscore=0.0;
RS rs=(RS)rsi;
- /* yaz_log(LOG_DEBUG, "zv_calc"); */
+ /* yaz_log(YLOG_DEBUG, "zv_calc"); */
/**/
veclen=rs->veclen;
if (veclen==0)
dscore=rs->sim_fct(rs->qdoc, rs->rdoc);
}
score = dscore * 1000;
- yaz_log (LOG_LOG, "sysno=%d score=%d", sysno, score);
+ yaz_log(YLOG_LOG, "sysno=%d score=%d", sysno, score);
if (score > 1000) /* should not happen */
score = 1000;
/* reset counts for the next record */
-/* $Id: isam.c,v 1.28.2.1 2006-08-14 10:39:03 adam Exp $
+/* $Id: isam.c,v 1.28.2.2 2006-12-05 21:14:41 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
ct++;
if (ct > max)
{
- logf (LOG_WARN, "Ignoring extra args to is resource");
+ yaz_log(YLOG_WARN, "Ignoring extra args to is resource");
bf[ct] = '\0';
return(ct - 1);
}
const char *r;
is_type_header th;
- logf (LOG_DEBUG, "is_open(%s, %s)", name, writeflag ? "RW" : "RDONLY");
+ yaz_log(YLOG_DEBUG, "is_open(%s, %s)", name, writeflag ? "RW" : "RDONLY");
if (writeflag)
{
statistics.total_merge_operations = 0;
"blocktypes", 0), "64 512 4K 32K")) ||
!(num = splitargs(r, pp, IS_MAX_BLOCKTYPES)))
{
- logf (LOG_FATAL, "Failed to locate resource %s", nm);
+ yaz_log(YLOG_FATAL, "Failed to locate resource %s", nm);
return 0;
}
inew->num_types = num;
{
if ((rs = sscanf(pp[i], "%d%1[bBkKmM]", &size, m)) < 1)
{
- logf (LOG_FATAL, "Error in resource %s: %s", r, pp[i]);
+ yaz_log(YLOG_FATAL, "Error in resource %s: %s", r, pp[i]);
return 0;
}
if (rs == 1)
case 'm': case 'M':
inew->types[i].blocksize = size * 1048576; break;
default:
- logf (LOG_FATAL, "Illegal size suffix: %c", *m);
+ yaz_log(YLOG_FATAL, "Illegal size suffix: %c", *m);
return 0;
}
inew->types[i].dbuf = (char *) xmalloc(inew->types[i].blocksize);
if (!(inew->types[i].bf = bf_open(bfs, strconcat(name, m, 0),
inew->types[i].blocksize, writeflag)))
{
- logf (LOG_FATAL, "bf_open failed");
+ yaz_log(YLOG_FATAL, "bf_open failed");
return 0;
}
if ((rs = is_rb_read(&inew->types[i], &th)) > 0)
{
if (th.blocksize != inew->types[i].blocksize)
{
- logf (LOG_FATAL, "File blocksize mismatch in %s", name);
+ yaz_log(YLOG_FATAL, "File blocksize mismatch in %s", name);
exit(1);
}
inew->types[i].freelist = th.freelist;
{
if ((rs = is_rb_write(&inew->types[i], &th)) <=0) /* dummy */
{
- logf (LOG_FATAL, "Failed to write initial superblock.");
+ yaz_log(YLOG_FATAL, "Failed to write initial superblock.");
exit(1);
}
inew->types[i].freelist = -1;
if (!(r = res_get_def(res, nm = strconcat(name, ".",
"keysize", 0), "4")))
{
- logf (LOG_FATAL, "Failed to locate resource %s", nm);
+ yaz_log(YLOG_FATAL, "Failed to locate resource %s", nm);
return 0;
}
if ((inew->keysize = atoi(r)) <= 0)
{
- logf (LOG_FATAL, "Must specify positive keysize.");
+ yaz_log(YLOG_FATAL, "Must specify positive keysize.");
return 0;
}
}
if (!(r = res_get_def(res, nm = strconcat(name, ".", "repack",
0), IS_DEF_REPACK_PERCENT)))
{
- logf (LOG_FATAL, "Failed to locate resource %s", nm);
+ yaz_log(YLOG_FATAL, "Failed to locate resource %s", nm);
return 0;
}
inew->repack = atoi(r);
"maxkeys", 0), "50 640 10000")) ||
!(num = splitargs(r, pp, IS_MAX_BLOCKTYPES)))
{
- logf (LOG_FATAL, "Failed to locate resource %s", nm);
+ yaz_log(YLOG_FATAL, "Failed to locate resource %s", nm);
return 0;
}
if (num < inew->num_types -1)
{
- logf (LOG_FATAL, "Not enough elements in %s", nm);
+ yaz_log(YLOG_FATAL, "Not enough elements in %s", nm);
return 0;
}
for (i = 0; i < num; i++)
{
if ((rs = sscanf(pp[i], "%d", &tmp)) < 1)
{
- logf (LOG_FATAL, "Error in resource %s: %s", r, pp[i]);
+ yaz_log(YLOG_FATAL, "Error in resource %s: %s", r, pp[i]);
return 0;
}
inew->types[i].max_keys = tmp;
inew->keysize;
if (inew->types[i].max_keys_block0 < 1)
{
- logf (LOG_FATAL, "Blocksize too small in %s", name);
+ yaz_log(YLOG_FATAL, "Blocksize too small in %s", name);
exit(1);
}
}
"nicefill", 0), "90 90 90 95")) ||
!(num = splitargs(r, pp, IS_MAX_BLOCKTYPES)))
{
- logf (LOG_FATAL, "Failed to locate resource %s", nm);
+ yaz_log(YLOG_FATAL, "Failed to locate resource %s", nm);
return 0;
}
if (num < inew->num_types)
{
- logf (LOG_FATAL, "Not enough elements in %s", nm);
+ yaz_log(YLOG_FATAL, "Not enough elements in %s", nm);
return 0;
}
for (i = 0; i < num; i++)
{
if ((rs = sscanf(pp[i], "%d", &tmp)) < 1)
{
- logf (LOG_FATAL, "Error in resource %s: %s", r, pp[i]);
+ yaz_log(YLOG_FATAL, "Error in resource %s: %s", r, pp[i]);
return 0;
}
inew->types[i].nice_keys_block = (inew->types[i].max_keys_block0 * tmp) /
int i;
is_type_header th;
- logf (LOG_DEBUG, "is_close()");
+ yaz_log(YLOG_DEBUG, "is_close()");
for (i = 0; i < is->num_types; i++)
{
if (is->types[i].bf)
th.top = is->types[i].top;
if (is_rb_write(&is->types[i], &th) < 0)
{
- logf (LOG_FATAL, "Failed to write headerblock");
+ yaz_log(YLOG_FATAL, "Failed to write headerblock");
exit(1);
}
}
if (is->writeflag)
{
- logf(LOG_LOG, "ISAM statistics:");
- logf(LOG_LOG, "total_merge_operations %d",
+ yaz_log(YLOG_LOG, "ISAM statistics:");
+ yaz_log(YLOG_LOG, "total_merge_operations %d",
statistics.total_merge_operations);
- logf(LOG_LOG, "total_items %d", statistics.total_items);
- logf(LOG_LOG, "dub_items_removed %d",
+ yaz_log(YLOG_LOG, "total_items %d", statistics.total_items);
+ yaz_log(YLOG_LOG, "dub_items_removed %d",
statistics.dub_items_removed);
- logf(LOG_LOG, "new_items %d", statistics.new_items);
- logf(LOG_LOG, "failed_deletes %d",
+ yaz_log(YLOG_LOG, "new_items %d", statistics.new_items);
+ yaz_log(YLOG_LOG, "failed_deletes %d",
statistics.failed_deletes);
- logf(LOG_LOG, "skipped_inserts %d",
+ yaz_log(YLOG_LOG, "skipped_inserts %d",
statistics.skipped_inserts);
- logf(LOG_LOG, "delete_insert_noop %d",
+ yaz_log(YLOG_LOG, "delete_insert_noop %d",
statistics.delete_insert_noop);
- logf(LOG_LOG, "delete_replace %d",
+ yaz_log(YLOG_LOG, "delete_replace %d",
statistics.delete_replace);
- logf(LOG_LOG, "delete %d", statistics.deletes);
- logf(LOG_LOG, "remaps %d", statistics.remaps);
- logf(LOG_LOG, "block_jumps %d", statistics.block_jumps);
- logf(LOG_LOG, "tab_deletes %d", statistics.tab_deletes);
+ yaz_log(YLOG_LOG, "delete %d", statistics.deletes);
+ yaz_log(YLOG_LOG, "remaps %d", statistics.remaps);
+ yaz_log(YLOG_LOG, "block_jumps %d", statistics.block_jumps);
+ yaz_log(YLOG_LOG, "tab_deletes %d", statistics.tab_deletes);
}
xfree(is);
return 0;
if (pos)
if (is_m_read_full(&tab, tab.data) < 0)
{
- logf (LOG_FATAL, "read_full failed");
+ yaz_log(YLOG_FATAL, "read_full failed");
exit(1);
}
oldnum = tab.num_records;
{
if (operation == KEYOP_INSERT)
{
- logf (LOG_DEBUG, "XXInserting new record.");
+ yaz_log(YLOG_DEBUG, "XXInserting new record.");
is_m_write_record(&tab, record);
statistics.new_items++;
}
else
{
- logf (LOG_DEBUG, "XXDeletion failed to find match.");
+ yaz_log(YLOG_DEBUG, "XXDeletion failed to find match.");
statistics.failed_deletes++;
}
}
{
if (operation == KEYOP_INSERT)
{
- logf (LOG_DEBUG, "XXSkipping insertion - match found.");
+ yaz_log(YLOG_DEBUG, "XXSkipping insertion - match found.");
statistics.skipped_inserts++;
continue;
}
/* next key is identical insert? - NOOP - skip it */
if (!memcmp(record, data + 1, is_keysize(is)))
{
- logf (LOG_DEBUG, "XXNoop delete. skipping.");
+ yaz_log(YLOG_DEBUG, "XXNoop delete. skipping.");
data += 1 + is_keysize(is);
num--;
while (num && !memcmp(data, data + is_keysize(tab.is) +
if (is_m_peek_record(&tab, keybuf) &&
(*is->cmp)(data + 1, keybuf) < 0)
{
- logf (LOG_DEBUG, "XXReplacing record.");
+ yaz_log(YLOG_DEBUG, "XXReplacing record.");
is_m_replace_record(&tab, data + 1);
data += 1 + is_keysize(is);
num--;
continue;
}
}
- logf (LOG_DEBUG, "Deleting record.");
+ yaz_log(YLOG_DEBUG, "Deleting record.");
is_m_delete_record(&tab);
statistics.deletes++;
}
-/* $Id: issh.c,v 1.6.2.1 2006-08-14 10:39:03 adam Exp $
+/* $Id: issh.c,v 1.6.2.2 2006-12-05 21:14:41 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
static char word[1024] = "help", arg[1024] = "";
int i;
- log_init(LOG_ALL, "issh", 0);
+ log_init(YLOG_ALL, "issh", 0);
common_resource = res_open("testres");
assert(common_resource);
-/* $Id: memory.c,v 1.18.2.1 2006-08-14 10:39:03 adam Exp $
+/* $Id: memory.c,v 1.18.2.2 2006-12-05 21:14:41 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
mbuf->cur_record = 0;
}
/*
- logf (LOG_DEBUG, "is_m_write_rec(rec == %d)", mbuf->cur_record);
+ yaz_log(YLOG_DEBUG, "is_m_write_rec(rec == %d)", mbuf->cur_record);
*/
memcpy(mbuf->data + mbuf->offset + mbuf->cur_record * is_keysize(tab->is),
rec, is_keysize(tab->is));
if (tab->data->state < IS_MBSTATE_PARTIAL)
if (read_current_full(tab, tab->data) < 0)
{
- logf (LOG_FATAL, "read full failed");
+ yaz_log(YLOG_FATAL, "read full failed");
exit(1);
}
return tab->num_records;
-/* $Id: physical.c,v 1.18.2.2 2006-08-14 10:39:03 adam Exp $
+/* $Id: physical.c,v 1.18.2.3 2006-12-05 21:14:41 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
if (bf_read(is->types[type].bf, tmp, 0, sizeof(tmp),
&is->types[type].freelist) <=0)
{
- logf (LOG_FATAL, "Failed to allocate block");
+ yaz_log(YLOG_FATAL, "Failed to allocate block");
exit(1);
}
}
else
tmp = is->types[type].top++;
- logf (LOG_DEBUG, "Allocating block #%d", tmp);
+ yaz_log(YLOG_DEBUG, "Allocating block #%d", tmp);
return tmp;
}
{
int tmp;
- logf (LOG_DEBUG, "Releasing block #%d", block);
+ yaz_log(YLOG_DEBUG, "Releasing block #%d", block);
tmp = is->types[type].freelist;
is->types[type].freelist = block;
if (bf_write(is->types[type].bf, block, 0, sizeof(tmp), &tmp) < 0)
{
- logf (LOG_FATAL, "Failed to deallocate block.");
+ yaz_log(YLOG_FATAL, "Failed to deallocate block.");
exit(1);
}
}
if (bf_read(tab->is->types[tab->pos_type].bf, block->diskpos, 0, toread,
buf->data) < 0)
{
- logf (LOG_FATAL, "bfread failed.");
+ yaz_log(YLOG_FATAL, "bfread failed.");
return -1;
}
/* extract header info */
sizeof(tab->num_records));
buf->offset +=sizeof(tab->num_records);
}
- logf(LOG_DEBUG, "R: Block #%d: num %d nextpos %d total %d",
+ yaz_log(YLOG_DEBUG, "R: Block #%d: num %d nextpos %d total %d",
block->diskpos, block->num_records, block->nextpos,
block == tab->data ? tab->num_records : -1);
buf->num = (toread - buf->offset) / is_keysize(tab->is);
if (block->state == IS_MBSTATE_UNREAD && is_p_read_partial(tab, block) < 0)
{
- logf (LOG_FATAL, "partial read failed.");
+ yaz_log(YLOG_FATAL, "partial read failed.");
return -1;
}
if (block->state == IS_MBSTATE_PARTIAL)
if (bf_read(tab->is->types[tab->pos_type].bf, block->diskpos, block->bread, toread *
is_keysize(tab->is), buf->data) < 0)
{
- logf (LOG_FATAL, "bfread failed.");
+ yaz_log(YLOG_FATAL, "bfread failed.");
return -1;
}
buf->offset = 0;
}
block->state = IS_MBSTATE_CLEAN;
}
- logf (LOG_DEBUG, "R: Block #%d contains %d records.", block->diskpos, block->num_records);
+ yaz_log(YLOG_DEBUG, "R: Block #%d contains %d records.", block->diskpos, block->num_records);
return 0;
}
sizeof(tab->num_records));
sum += sizeof(tab->num_records);
}
- logf (LOG_DEBUG, "W: Block #%d contains %d records.", p->diskpos,
+ yaz_log(YLOG_DEBUG, "W: Block #%d contains %d records.", p->diskpos,
p->num_records);
assert(p->num_records > 0);
for (b = p->data; b; b = b->next)
{
- logf(LOG_DEBUG, " buf: offset %d, keys %d, type %d, ref %d",
+ yaz_log(YLOG_DEBUG, " buf: offset %d, keys %d, type %d, ref %d",
b->offset, b->num, b->type, b->refcount);
if ((v = b->num * is_keysize(tab->is)) > 0)
memcpy(type->dbuf + sum, b->data + b->offset, v);
}
if (bf_write(type->bf, p->diskpos, 0, sum, type->dbuf) < 0)
{
- logf (LOG_FATAL, "Failed to write block.");
+ yaz_log(YLOG_FATAL, "Failed to write block.");
exit(1);
}
}
is_mbuf *mbufs, *mbp;
int blocks, recsblock;
- logf (LOG_DEBUG, "Realigning table.");
+ yaz_log(YLOG_DEBUG, "Realigning table.");
for (mblock = tab->data; mblock; mblock = next)
{
next = mblock->next;
{
if (is_p_read_full(tab, next) < 0)
{
- logf(LOG_FATAL, "Error during re-alignment");
+ yaz_log(YLOG_FATAL, "Error during re-alignment");
abort();
}
if (next->nextpos && !next->next)
is_mblock *blockp, **blockpp;
int recsblock, blocks;
- logf (LOG_DEBUG, "Remapping table.");
+ yaz_log(YLOG_DEBUG, "Remapping table.");
/* collect all data */
bufpp = &mbufs;
for (blockp = tab->data; blockp; blockp = blockp->next)
{
if (blockp->state < IS_MBSTATE_CLEAN && is_m_read_full(tab, blockp) < 0)
{
- logf (LOG_FATAL, "Read-full failed in remap.");
+ yaz_log(YLOG_FATAL, "Read-full failed in remap.");
exit(1);
}
*bufpp = blockp->data;
-/* $Id: isamb.c,v 1.47.2.7 2006-10-27 11:06:46 adam Exp $
+/* $Id: isamb.c,v 1.47.2.8 2006-12-05 21:14:42 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
b_size = b_size * 4;
}
#if ISAMB_DEBUG
- logf(LOG_WARN, "isamb debug enabled. Things will be slower than usual");
+ yaz_log(YLOG_WARN, "isamb debug enabled. Things will be slower than usual");
#endif
return isamb;
}
{
int i;
for (i=0;isamb->accessed_nodes[i];i++)
- logf(LOG_DEBUG,"isamb_close level leaf-%d: %d read, %d skipped",
+ yaz_log(YLOG_DEBUG,"isamb_close level leaf-%d: %d read, %d skipped",
i, isamb->accessed_nodes[i], isamb->skipped_nodes[i]);
- logf(LOG_DEBUG,"isamb_close returned %d values, skipped %d",
+ yaz_log(YLOG_DEBUG,"isamb_close returned %d values, skipped %d",
isamb->skipped_numbers, isamb->returned_numbers);
for (i = 0; i<isamb->no_cat; i++)
{
yaz_log (b->log_io, "bf_read: open_block");
if (!bf_read (b->file[cat].bf, pos/CAT_MAX, 0, 0, p->buf))
{
- yaz_log (LOG_FATAL, "isamb: read fail for pos=%ld block=%ld",
+ yaz_log(YLOG_FATAL, "isamb: read fail for pos=%ld block=%ld",
(long) pos, (long) pos/CAT_MAX);
abort();
}
p->size = (p->buf[1] + 256 * p->buf[2]) - ISAMB_DATA_OFFSET;
if (p->size < 0)
{
- yaz_log (LOG_FATAL, "Bad block size %d in pos=%d\n", p->size, pos);
+ yaz_log(YLOG_FATAL, "Bad block size %d in pos=%d\n", p->size, pos);
}
assert (p->size >= 0);
p->offset = 0;
p->dirty = 0;
p->deleted = 0;
p->decodeClientData = (*b->method->code_start)(ISAMC_DECODE);
- yaz_log (LOG_DEBUG, "isamb_open_block: Opened block %d ofs=%d",pos, p->offset);
+ yaz_log(YLOG_DEBUG, "isamb_open_block: Opened block %d ofs=%d",pos, p->offset);
return p;
}
yaz_log (b->log_io, "bf_read: new_block");
if (!bf_read (b->file[cat].bf, p->pos/CAT_MAX, 0, 0, p->buf))
{
- yaz_log (LOG_FATAL, "isamb: read fail for pos=%ld block=%ld",
+ yaz_log(YLOG_FATAL, "isamb: read fail for pos=%ld block=%ld",
(long) p->pos/CAT_MAX, (long) p->pos/CAT_MAX);
abort ();
}
dst_item = lookahead_item;
if (!*lookahead_mode)
{
- yaz_log (LOG_WARN, "isamb: Inconsistent register (1)");
+ yaz_log(YLOG_WARN, "isamb: Inconsistent register (1)");
assert (*lookahead_mode);
}
}
}
if (!*lookahead_mode)
{
- yaz_log (LOG_WARN, "isamb: Inconsistent register (2)");
+ yaz_log(YLOG_WARN, "isamb: Inconsistent register (2)");
abort();
}
else if (!half1 && dst > cut)
int i;
if (!pp)
return;
- logf(LOG_DEBUG,"isamb_pp_close lev=%d returned %d values, skipped %d",
+ yaz_log(YLOG_DEBUG,"isamb_pp_close lev=%d returned %d values, skipped %d",
pp->maxlevel, pp->skipped_numbers, pp->returned_numbers);
for (i=pp->maxlevel;i>=0;i--)
if ( pp->skipped_nodes[i] || pp->accessed_nodes[i])
- logf(LOG_DEBUG,"isamb_pp_close level leaf-%d: %d read, %d skipped", i,
+ yaz_log(YLOG_DEBUG,"isamb_pp_close level leaf-%d: %d read, %d skipped", i,
pp->accessed_nodes[i], pp->skipped_nodes[i]);
pp->isamb->skipped_numbers += pp->skipped_numbers;
pp->isamb->returned_numbers += pp->returned_numbers;
char *dst = buf;
(*b->method->code_item)(ISAMC_DECODE, p->decodeClientData,
&dst, &src);
- (*b->method->log_item)(LOG_DEBUG, buf, prefix_str);
+ (*b->method->log_item)(YLOG_DEBUG, buf, prefix_str);
p->offset = src - (char*) p->bytes;
}
assert(p->offset == p->size);
while (p->offset < p->size)
{
decode_ptr (&src, &item_len);
- (*b->method->log_item)(LOG_DEBUG, src, prefix_str);
+ (*b->method->log_item)(YLOG_DEBUG, src, prefix_str);
src += item_len;
decode_ptr (&src, &sub);
(*pp->isamb->method->code_item)(ISAMC_DECODE, p->decodeClientData,
&dst, &src);
p->offset = src - (char*) p->bytes;
- /* key_logdump_txt(LOG_DEBUG,buf, "isamb_pp_read returning 1"); */
+ /* key_logdump_txt(YLOG_DEBUG,buf, "isamb_pp_read returning 1"); */
return 1;
}
assert(level>=0);
if ( level == 0) {
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_on_right returning true for root");
+ yaz_log(YLOG_DEBUG,"isamb_pp_on_right returning true for root");
#endif
return 1; /* we can never skip the root node */
}
src=p->bytes + p->offset;
decode_ptr(&src,&item_len);
#if ISAMB_DEBUG
- (*pp->isamb->method->log_item)(LOG_DEBUG,untilbuf,"on_leaf: until");
- (*pp->isamb->method->log_item)(LOG_DEBUG,src,"on_leaf: value");
+ (*pp->isamb->method->log_item)(YLOG_DEBUG,untilbuf,"on_leaf: until");
+ (*pp->isamb->method->log_item)(YLOG_DEBUG,src,"on_leaf: value");
#endif
cmp=(*pp->isamb->method->compare_item)(untilbuf,src);
if (cmp<2) {
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_on_right returning true "
+ yaz_log(YLOG_DEBUG,"isamb_pp_on_right returning true "
"cmp=%d lev=%d ofs=%d",cmp,level,p->offset);
#endif
return 1;
}
else {
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_on_right returning false "
+ yaz_log(YLOG_DEBUG,"isamb_pp_on_right returning false "
"cmp=%d lev=%d ofs=%d",cmp,level,p->offset);
#endif
return 0;
}
else {
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_on_right at tail, looking higher "
+ yaz_log(YLOG_DEBUG,"isamb_pp_on_right at tail, looking higher "
"lev=%d",level);
#endif
return isamb_pp_on_right_node(pp, level, untilbuf);
assert(buf);
if (!p || p->offset == p->size) {
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_read_on_leaf returning 0 on node %d",p->pos);
+ yaz_log(YLOG_DEBUG,"isamb_pp_read_on_leaf returning 0 on node %d",p->pos);
#endif
return 0; /* at end of leaf */
}
p->offset = src - (char*) p->bytes;
/*
#if ISAMB_DEBUG
- (*pp->isamb->method->log_item)(LOG_DEBUG, buf, "read_on_leaf returning 1");
+ (*pp->isamb->method->log_item)(YLOG_DEBUG, buf, "read_on_leaf returning 1");
#endif
*/
return 1;
if (cmp <2){ /* found a good one */
#if ISAMB_DEBUG
if (skips)
- logf(LOG_DEBUG, "isam_pp_fwd_on_leaf skipped %d items",skips);
+ yaz_log(YLOG_DEBUG, "isam_pp_fwd_on_leaf skipped %d items",skips);
#endif
pp->returned_numbers++;
return 1;
char *src;
int item_len;
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_climb_level starting "
+ yaz_log(YLOG_DEBUG,"isamb_pp_climb_level starting "
"at level %d node %d ofs=%d sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
if (pp->level==0)
{
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_climb_level returning 0 at root");
+ yaz_log(YLOG_DEBUG,"isamb_pp_climb_level returning 0 at root");
#endif
return 0;
}
(pp->level)--;
p=pp->block[pp->level];
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_climb_level climbed to level %d node %d ofs=%d",
+ yaz_log(YLOG_DEBUG,"isamb_pp_climb_level climbed to level %d node %d ofs=%d",
pp->level, p->pos, p->offset);
#endif
assert(!p->leaf);
{
/* skip the child we just came from */
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isam_pp_climb_level: skipping lev=%d ofs=%d sz=%d",
+ yaz_log(YLOG_DEBUG,"isam_pp_climb_level: skipping lev=%d ofs=%d sz=%d",
pp->level, p->offset, p->size);
#endif
assert (p->offset < p->size );
#if ISAMB_DEBUG
int skips = 0;
if (p)
- logf(LOG_DEBUG,"isamb_pp_forward_unode starting "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward_unode starting "
"at level %d node %d ofs=%di sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
assert(p->offset <= p->size);
if (p->offset == p->size) {
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward_unode returning at end "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward_unode returning at end "
"at level %d node %d ofs=%di sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
if (cmp<2)
{
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward_unode returning a hit "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward_unode returning a hit "
"at level %d node %d ofs=%d sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
#endif
}
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward_unode returning at tail "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward_unode returning at tail "
"at level %d node %d ofs=%d sz=%d skips=%d",
pp->level, p->pos, p->offset, p->size, skips);
#endif
char *src;
assert(!p->leaf);
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_descend_to_leaf "
+ yaz_log(YLOG_DEBUG,"isamb_pp_descend_to_leaf "
"starting at lev %d node %d ofs=%d lf=%d u=%p",
pp->level, p->pos, p->offset, p->leaf, untilbuf);
#endif
++(pp->accessed_nodes[pp->maxlevel-pp->level]);
++(pp->no_blocks);
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_descend_to_leaf "
+ yaz_log(YLOG_DEBUG,"isamb_pp_descend_to_leaf "
"got lev %d node %d lf=%d",
pp->level, p->pos, p->leaf);
#endif
p->offset = src-(char*)p->bytes;
isamb_pp_descend_to_leaf(pp,pos,untilbuf);
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_descend_to_leaf "
+ yaz_log(YLOG_DEBUG,"isamb_pp_descend_to_leaf "
"returning at lev %d node %d ofs=%d lf=%d",
pp->level, p->pos, p->offset, p->leaf);
#endif
int pos;
#if ISAMB_DEBUG
struct ISAMB_block *p = pp->block[pp->level];
- logf(LOG_DEBUG,"isamb_pp_climb_desc starting "
+ yaz_log(YLOG_DEBUG,"isamb_pp_climb_desc starting "
"at level %d node %d ofs=%d sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
isamb_pp_descend_to_leaf(pp, pos,untilbuf);
#if ISAMB_DEBUG
p = pp->block[pp->level];
- logf(LOG_DEBUG,"isamb_pp_climb_desc done "
+ yaz_log(YLOG_DEBUG,"isamb_pp_climb_desc done "
"at level %d node %d ofs=%d sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
if (p)
{
assert(p->leaf);
- logf(LOG_DEBUG,"isamb_pp_forward starting "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward starting "
"at level %d node %d ofs=%d sz=%d u=%p",
pp->level, p->pos, p->offset, p->size,untilbuf);
}
if (isamb_pp_forward_on_leaf( pp, buf, untilbuf)) {
#if ISAMB_DEBUG
if (p)
- logf(LOG_DEBUG,"isamb_pp_forward (f) returning (A) "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward (f) returning (A) "
"at level %d node %d ofs=%d sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
if (! isamb_pp_climb_desc( pp, buf, untilbuf)) {
#if ISAMB_DEBUG
if (p)
- logf(LOG_DEBUG,"isamb_pp_forward (f) returning notfound (B) "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward (f) returning notfound (B) "
"at level %d node %d ofs=%d sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
if (isamb_pp_forward_on_leaf( pp, buf, untilbuf)) {
#if ISAMB_DEBUG
if(p)
- logf(LOG_DEBUG,"isamb_pp_forward (f) returning (C) "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward (f) returning (C) "
"at level %d node %d ofs=%d sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
if (isamb_pp_read_on_leaf( pp, buf)) {
#if ISAMB_DEBUG
if (p)
- logf(LOG_DEBUG,"isamb_pp_forward (read) returning (D) "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward (read) returning (D) "
"at level %d node %d ofs=%d sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
if (isamb_pp_find_next_leaf(pp)) {
#if ISAMB_DEBUG
if (p)
- logf(LOG_DEBUG,"isamb_pp_forward (read) returning (E) "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward (read) returning (E) "
"at level %d node %d ofs=%d sz=%d",
pp->level, p->pos, p->offset, p->size);
#endif
if (!p)
return 0;
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward starting [%p] p=%d",pp,p->pos);
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward starting [%p] p=%d",pp,p->pos);
- (*pp->isamb->method->log_item)(LOG_DEBUG, untilbuf, "until");
- (*pp->isamb->method->log_item)(LOG_DEBUG, buf, "buf");
+ (*pp->isamb->method->log_item)(YLOG_DEBUG, untilbuf, "until");
+ (*pp->isamb->method->log_item)(YLOG_DEBUG, buf, "buf");
#endif
while (1)
{ /* end of this block - climb higher */
assert (p->offset <= p->size);
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward climbing from l=%d",
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward climbing from l=%d",
pp->level);
#endif
if (pp->level == 0)
{
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward returning 0 at root");
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward returning 0 at root");
#endif
return 0; /* at end of the root, nothing left */
}
(pp->level)--;
p=pp->block[pp->level];
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward climbed to node %d off=%d",
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward climbed to node %d off=%d",
p->pos, p->offset);
#endif
assert(!p->leaf);
src = p->bytes + p->offset;
decode_ptr(&src, &item_len);
#if ISAMB_DEBUG
- (*pp->isamb->method->log_item)(LOG_DEBUG, src,
+ (*pp->isamb->method->log_item)(YLOG_DEBUG, src,
" isamb_pp_forward "
"climb skipping old key");
#endif
{
decode_ptr(&src, &item_len);
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward (B) on a high node. "
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward (B) on a high node. "
"ofs=%d sz=%d nxtpos=%d ",
p->offset,p->size,pos);
- (*pp->isamb->method->log_item)(LOG_DEBUG, src, "");
+ (*pp->isamb->method->log_item)(YLOG_DEBUG, src, "");
#endif
if (untilbuf)
cmp=(*pp->isamb->method->compare_item)(untilbuf,src);
if (cmp<2)
{
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isambb_pp_forward descending l=%d p=%d ",
+ yaz_log(YLOG_DEBUG,"isambb_pp_forward descending l=%d p=%d ",
pp->level, pos);
#endif
descending=1; /* prevent climbing for a while */
decode_ptr(&src,&pos);
p->offset=src-(char*) p->bytes;
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward: block %d starts with %d",
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward: block %d starts with %d",
p->pos, pos);
#endif
}
pos=nxtpos;
(pp->skipped_nodes[pp->maxlevel - pp->level -1])++;
#if ISAMB_DEBUG
- logf(LOG_DEBUG,
+ yaz_log(YLOG_DEBUG,
"isamb_pp_forward: skipping block on level %d, noting "
"on %d (%d)",
pp->level, pp->maxlevel - pp->level-1 ,
else
cmp=-2;
#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward on a leaf. cmp=%d",
+ yaz_log(YLOG_DEBUG,"isamb_pp_forward on a leaf. cmp=%d",
cmp);
- (*pp->isamb->method->log_item)(LOG_DEBUG, buf, "");
+ (*pp->isamb->method->log_item)(YLOG_DEBUG, buf, "");
#endif
if (cmp <2)
{
dst = dst0;
if (p->offset == p->size) goto again;
}
- /* key_logdump_txt(LOG_DEBUG,buf, "isamb_pp_read returning 1"); */
+ /* key_logdump_txt(YLOG_DEBUG,buf, "isamb_pp_read returning 1"); */
return 1;
}
if (src<=cur)
(*current)++;
}
- logf(LOG_DEBUG, "isamb_pp_leaf_pos: cur=%d tot=%d ofs=%d sz=%d lev=%d",
+ yaz_log(YLOG_DEBUG, "isamb_pp_leaf_pos: cur=%d tot=%d ofs=%d sz=%d lev=%d",
*current, *total, p->offset, p->size, pp->level);
assert(src==end);
}
int child;
assert(level>=0);
assert(!p->leaf);
- logf(LOG_DEBUG,"isamb_pp_upper_pos at beginning l=%d "
+ yaz_log(YLOG_DEBUG,"isamb_pp_upper_pos at beginning l=%d "
"cur=%d tot=%d ofs=%d sz=%d pos=%d",
level, *current, *total, p->offset, p->size, p->pos);
assert (p->offset <= p->size);
if (pp->level>0)
isamb_pp_upper_pos(pp, current, total, *total, pp->level-1);
/*
- logf(LOG_DEBUG,"isamb_pp_pos: C=%d T=%d =%6.2f%%",
+ yaz_log(YLOG_DEBUG,"isamb_pp_pos: C=%d T=%d =%6.2f%%",
*current, *total, 100.0*(*current)/(*total));
*/
}
-/* $Id: tstisamb.c,v 1.7.2.2 2006-08-14 10:39:07 adam Exp $
+/* $Id: tstisamb.c,v 1.7.2.3 2006-12-05 21:14:42 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
{
int x;
memcpy(&x, b, sizeof(int));
- yaz_log(LOG_DEBUG, "%s %d", txt, x);
+ yaz_log(YLOG_DEBUG, "%s %d", txt, x);
}
static void log_pr(const char *txt)
{
- yaz_log(LOG_DEBUG, "%s", txt);
+ yaz_log(YLOG_DEBUG, "%s", txt);
}
int compare_item(const void *a, const void *b)
isamb_pp_forward(pp, &x, &xu);
if (x != xu && xu != x+1)
{
- yaz_log(LOG_WARN, "isamb_pp_forward (1). Got %d (expected %d)",
+ yaz_log(YLOG_WARN, "isamb_pp_forward (1). Got %d (expected %d)",
x, xu);
exit(4);
}
isamb_pp_forward(pp, &x, &xu);
if (x != xu && xu != x+1)
{
- yaz_log(LOG_WARN, "isamb_pp_forward (2). Got %d (expected %d)",
+ yaz_log(YLOG_WARN, "isamb_pp_forward (2). Got %d (expected %d)",
x, xu);
exit(4);
}
memcpy (&x, key_buf, sizeof(int));
if (x != ri.no)
{
- yaz_log(LOG_WARN, "isamb_pp_read. Got %d (expected %d)",
+ yaz_log(YLOG_WARN, "isamb_pp_read. Got %d (expected %d)",
x, ri.no);
exit(3);
}
}
if (ri.no != ri.max)
{
- yaz_log(LOG_WARN, "ri.max != ri.max (%d != %d)", ri.no, ri.max);
+ yaz_log(YLOG_WARN, "ri.max != ri.max (%d != %d)", ri.no, ri.max);
exit(3);
}
isamb_pp_close(pp);
ISAMC_M method;
if (argc == 2)
- yaz_log_init_level(LOG_ALL);
+ yaz_log_init_level(YLOG_ALL);
/* setup method (attributes) */
method.compare_item = compare_item;
bfs = bfs_create(0, 0);
if (!bfs)
{
- yaz_log(LOG_WARN, "bfs_create failed");
+ yaz_log(YLOG_WARN, "bfs_create failed");
exit(1);
}
isb = isamb_open (bfs, "isamb", 1, &method, 0);
if (!isb)
{
- yaz_log(LOG_WARN, "isamb_open failed");
+ yaz_log(YLOG_WARN, "isamb_open failed");
exit(2);
}
tst_insert(isb, 1);
-/* $Id: isamc.c,v 1.24.2.2 2006-10-27 11:06:47 adam Exp $
+/* $Id: isamc.c,v 1.24.2.3 2006-12-05 21:14:42 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
*/
-
-
/*
* TODO:
* Reduction to lower categories in isc_merge
#include <string.h>
#include <stdio.h>
+#include <yaz/xmalloc.h>
#include <yaz/log.h>
#include "isamc-p.h"
/* determine number of block categories */
if (is->method->debug)
- logf (LOG_LOG, "isc: bsize ifill mfill mblocks");
+ yaz_log(YLOG_LOG, "isc: bsize ifill mfill mblocks");
do
{
if (is->method->debug)
- logf (LOG_LOG, "isc:%6d %6d %6d %6d",
+ yaz_log(YLOG_LOG, "isc:%6d %6d %6d %6d",
filecat[i].bsize, filecat[i].ifill,
filecat[i].mfill, filecat[i].mblocks);
if (max_buf_size < filecat[i].mblocks * filecat[i].bsize)
if (max_buf_size < (1+is->method->max_blocks_mem) * filecat[i].bsize)
max_buf_size = (1+is->method->max_blocks_mem) * filecat[i].bsize;
if (is->method->debug)
- logf (LOG_LOG, "isc: max_buf_size %d", max_buf_size);
+ yaz_log(YLOG_LOG, "isc: max_buf_size %d", max_buf_size);
assert (is->no_files > 0);
is->files = (ISAMC_file) xmalloc (sizeof(*is->files)*is->no_files);
if (is->method->debug)
{
- logf (LOG_LOG, "isc: next forw mid-f prev backw mid-b");
+ yaz_log(YLOG_LOG, "isc: next forw mid-f prev backw mid-b");
for (i = 0; i<is->no_files; i++)
- logf (LOG_LOG, "isc:%8d%8d%8.1f%8d%8d%8.1f",
+ yaz_log(YLOG_LOG, "isc:%8d%8d%8.1f%8d%8d%8.1f",
is->files[i].no_next,
is->files[i].no_forward,
is->files[i].no_forward ?
: 0.0);
}
if (is->method->debug)
- logf (LOG_LOG, "isc: writes reads skipped alloc released remap");
+ yaz_log(YLOG_LOG, "isc: writes reads skipped alloc released remap");
for (i = 0; i<is->no_files; i++)
{
release_fc (is, i);
bf_write (is->files[i].bf, 0, 0, sizeof(ISAMC_head),
&is->files[i].head);
if (is->method->debug)
- logf (LOG_LOG, "isc:%8d%8d%8d%8d%8d%8d",
+ yaz_log(YLOG_LOG, "isc:%8d%8d%8d%8d%8d%8d",
is->files[i].no_writes,
is->files[i].no_reads,
is->files[i].no_skip_writes,
{
++(is->files[cat].no_writes);
if (is->method->debug > 2)
- logf (LOG_LOG, "isc: write_block %d %d", cat, pos);
+ yaz_log(YLOG_LOG, "isc: write_block %d %d", cat, pos);
return bf_write (is->files[cat].bf, pos, 0, 0, src);
}
{
ISAMC_BLOCK_SIZE size = offset + ISAMC_BLOCK_OFFSET_N;
if (is->method->debug > 2)
- logf (LOG_LOG, "isc: write_dblock. size=%d nextpos=%d",
+ yaz_log(YLOG_LOG, "isc: write_dblock. size=%d nextpos=%d",
(int) size, nextpos);
src -= ISAMC_BLOCK_OFFSET_N;
memcpy (src, &nextpos, sizeof(int));
if (!block)
block = alloc_block (is, cat);
if (is->method->debug > 3)
- logf (LOG_LOG, "isc: alloc_block in cat %d: %d", cat, block);
+ yaz_log(YLOG_LOG, "isc: alloc_block in cat %d: %d", cat, block);
return block;
}
void isc_release_block (ISAMC is, int cat, int pos)
{
if (is->method->debug > 3)
- logf (LOG_LOG, "isc: release_block in cat %d: %d", cat, pos);
+ yaz_log(YLOG_LOG, "isc: release_block in cat %d: %d", cat, pos);
if (is->files[cat].fc_list)
{
int j;
pp->offset = src - pp->buf;
assert (pp->offset == ISAMC_BLOCK_OFFSET_1);
if (is->method->debug > 2)
- logf (LOG_LOG, "isc: read_block size=%d %d %d next=%d",
+ yaz_log(YLOG_LOG, "isc: read_block size=%d %d %d next=%d",
pp->size, pp->cat, pp->pos, pp->next);
}
return pp;
(*is->method->code_item)(ISAMC_DECODE, pp->decodeClientData, dst, &src);
pp->offset = src - pp->buf;
if (is->method->debug > 2)
- logf (LOG_LOG, "isc: read_block size=%d %d %d next=%d",
+ yaz_log(YLOG_LOG, "isc: read_block size=%d %d %d next=%d",
pp->size, pp->cat, pp->pos, pp->next);
return 2;
}
-/* $Id: isamd.c,v 1.27.2.2 2006-10-27 11:06:47 adam Exp $
+/* $Id: isamd.c,v 1.27.2.3 2006-12-05 21:14:42 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
/* determine number of block categories */
if (is->method->debug>0)
- logf (LOG_LOG, "isamd: bsize maxkeys");
+ yaz_log(YLOG_LOG, "isamd: bsize maxkeys");
do
{
if (is->method->debug>0)
- logf (LOG_LOG, "isamd:%6d %6d",
+ yaz_log(YLOG_LOG, "isamd:%6d %6d",
filecat[i].bsize, filecat[i].mblocks);
} while (filecat[i++].mblocks);
is->no_files = i;
if (is->method->debug>0)
{
- logf (LOG_LOG, "isamd statistics");
- logf (LOG_LOG, "f nxt forw mid-f prev backw mid-b");
+ yaz_log(YLOG_LOG, "isamd statistics");
+ yaz_log(YLOG_LOG, "f nxt forw mid-f prev backw mid-b");
for (i = 0; i<is->no_files; i++)
- logf (LOG_LOG, "%d%7d%7d%7.1f%7d%7d%7.1f",i,
+ yaz_log(YLOG_LOG, "%d%7d%7d%7.1f%7d%7d%7.1f",i,
is->files[i].no_next,
is->files[i].no_forward,
is->files[i].no_forward ?
: 0.0);
}
if (is->method->debug>0)
- logf (LOG_LOG, "f writes reads skipped alloc released ");
+ yaz_log(YLOG_LOG, "f writes reads skipped alloc released ");
for (i = 0; i<is->no_files; i++)
{
release_fc (is, i);
bf_write (is->files[i].bf, 0, 0, sizeof(ISAMD_head),
&is->files[i].head);
if (is->method->debug>0)
- logf (LOG_LOG, "%d%8d%8d%8d%8d%8d",i,
+ yaz_log(YLOG_LOG, "%d%8d%8d%8d%8d%8d",i,
is->files[i].no_writes,
is->files[i].no_reads,
is->files[i].no_skip_writes,
if (is->method->debug>0)
{
- logf (LOG_LOG, "f opens main diffonly");
+ yaz_log(YLOG_LOG, "f opens main diffonly");
for (i = 0; i<is->no_files; i++)
{
- logf (LOG_LOG, "%d%8d%8d%8d",i,
+ yaz_log(YLOG_LOG, "%d%8d%8d%8d",i,
is->files[i].no_op_main+
is->files[i].no_op_diffonly,
is->files[i].no_op_main,
is->files[i].no_op_diffonly);
}
- logf(LOG_LOG,"open single %8d", is->no_op_single);
- logf(LOG_LOG,"open new %8d", is->no_op_new);
+ yaz_log(YLOG_LOG,"open single %8d", is->no_op_single);
+ yaz_log(YLOG_LOG,"open new %8d", is->no_op_new);
- logf(LOG_LOG, "new build %8d", is->no_fbuilds);
- logf(LOG_LOG, "append %8d", is->no_appds);
- logf(LOG_LOG, " merges %8d", is->no_merges);
- logf(LOG_LOG, " singles %8d", is->no_singles);
- logf(LOG_LOG, " no-ops %8d", is->no_non);
+ yaz_log(YLOG_LOG, "new build %8d", is->no_fbuilds);
+ yaz_log(YLOG_LOG, "append %8d", is->no_appds);
+ yaz_log(YLOG_LOG, " merges %8d", is->no_merges);
+ yaz_log(YLOG_LOG, " singles %8d", is->no_singles);
+ yaz_log(YLOG_LOG, " no-ops %8d", is->no_non);
- logf(LOG_LOG, "read blocks %8d", is->no_read);
- logf(LOG_LOG, "read keys: %8d %8.1f k/bl",
+ yaz_log(YLOG_LOG, "read blocks %8d", is->no_read);
+ yaz_log(YLOG_LOG, "read keys: %8d %8.1f k/bl",
is->no_read_keys,
1.0*(is->no_read_keys+1)/(is->no_read+1) );
- logf(LOG_LOG, "read main-k %8d %8.1f %% of keys",
+ yaz_log(YLOG_LOG, "read main-k %8d %8.1f %% of keys",
is->no_read_main,
100.0*(is->no_read_main+1)/(is->no_read_keys+1) );
- logf(LOG_LOG, "read ends: %8d %8.1f k/e",
+ yaz_log(YLOG_LOG, "read ends: %8d %8.1f k/e",
is->no_read_eof,
1.0*(is->no_read_keys+1)/(is->no_read_eof+1) );
s= is->no_seek_nxt+ is->no_seek_sam+ is->no_seek_fwd +
is->no_seek_prv+ is->no_seek_bak+ is->no_seek_cat;
if (s==0)
s++;
- logf(LOG_LOG, "seek same %8d %8.1f%%",
+ yaz_log(YLOG_LOG, "seek same %8d %8.1f%%",
is->no_seek_sam, 100.0*is->no_seek_sam/s );
- logf(LOG_LOG, "seek next %8d %8.1f%%",
+ yaz_log(YLOG_LOG, "seek next %8d %8.1f%%",
is->no_seek_nxt, 100.0*is->no_seek_nxt/s );
- logf(LOG_LOG, "seek prev %8d %8.1f%%",
+ yaz_log(YLOG_LOG, "seek prev %8d %8.1f%%",
is->no_seek_prv, 100.0*is->no_seek_prv/s );
- logf(LOG_LOG, "seek forw %8d %8.1f%%",
+ yaz_log(YLOG_LOG, "seek forw %8d %8.1f%%",
is->no_seek_fwd, 100.0*is->no_seek_fwd/s );
- logf(LOG_LOG, "seek back %8d %8.1f%%",
+ yaz_log(YLOG_LOG, "seek back %8d %8.1f%%",
is->no_seek_bak, 100.0*is->no_seek_bak/s );
- logf(LOG_LOG, "seek cat %8d %8.1f%%",
+ yaz_log(YLOG_LOG, "seek cat %8d %8.1f%%",
is->no_seek_cat, 100.0*is->no_seek_cat/s );
}
xfree (is->files);
++(is->files[cat].no_reads);
++(is->no_read);
if (is->method->debug > 6)
- logf (LOG_LOG, "isamd: read_block %d:%d",cat, pos);
+ yaz_log(YLOG_LOG, "isamd: read_block %d:%d",cat, pos);
return bf_read (is->files[cat].bf, pos, 0, 0, dst);
}
++(is->files[cat].no_writes);
++(is->no_write);
if (is->method->debug > 6)
- logf (LOG_LOG, "isamd: write_block %d:%d", cat, pos);
+ yaz_log(YLOG_LOG, "isamd: write_block %d:%d", cat, pos);
return bf_write (is->files[cat].bf, pos, 0, 0, src);
}
{
ISAMD_BLOCK_SIZE size = offset + ISAMD_BLOCK_OFFSET_N;
if (is->method->debug > 4)
- logf (LOG_LOG, "isamd: write_dblock. size=%d nextpos=%d",
+ yaz_log(YLOG_LOG, "isamd: write_dblock. size=%d nextpos=%d",
(int) size, nextpos);
src -= ISAMD_BLOCK_OFFSET_N;
assert( ISAMD_BLOCK_OFFSET_N == sizeof(int)+sizeof(int) );
if (!block)
block = alloc_block (is, cat);
if (is->method->debug > 4)
- logf (LOG_LOG, "isamd: alloc_block in cat %d: %d", cat, block);
+ yaz_log(YLOG_LOG, "isamd: alloc_block in cat %d: %d", cat, block);
return block;
}
void isamd_release_block (ISAMD is, int cat, int pos)
{
if (is->method->debug > 4)
- logf (LOG_LOG, "isamd: release_block in cat %d: %d", cat, pos);
+ yaz_log(YLOG_LOG, "isamd: release_block in cat %d: %d", cat, pos);
assert(pos!=0);
if (is->files[cat].fc_list)
(*is->method->code_stop)(ISAMD_DECODE, pp->decodeClientData);
isamd_free_diffs(pp); /* see merge-d.h */
if (is->method->debug > 5)
- logf (LOG_LOG, "isamd_pp_close %p %d=%d:%d sz=%d n=%d=%d:%d nk=%d",
+ yaz_log(YLOG_LOG, "isamd_pp_close %p %d=%d:%d sz=%d n=%d=%d:%d nk=%d",
pp, isamd_addr(pp->pos, pp->cat), pp->cat, pp->pos, pp->size,
pp->next, isamd_type(pp->next), isamd_block(pp->next),
pp->numKeys );
pp->cat=0;
pp->pos=0;
if (is->method->debug > 5)
- logf (LOG_LOG, "isamd_pp_open dict");
+ yaz_log(YLOG_LOG, "isamd_pp_open dict");
pp->numKeys=(unsigned char) dictbuf[0];
memcpy(pp->buf+ISAMD_BLOCK_OFFSET_1, dictbuf+1,dictlen-1);
pp->size=pp->offset=dictlen+ISAMD_BLOCK_OFFSET_1-1;
is->files[pp->cat].no_op_diffonly++;
}
if (is->method->debug > 5)
- logf (LOG_LOG, "isamd_pp_open %p %d=%d:%d sz=%d n=%d=%d:%d",
+ yaz_log(YLOG_LOG, "isamd_pp_open %p %d=%d:%d sz=%d n=%d=%d:%d",
pp, isamd_addr(pp->pos, pp->cat), pp->cat, pp->pos, pp->size,
pp->next, isamd_type(pp->next), isamd_block(pp->next) );
dst += sizeof(pp->numKeys);
assert (dst - pp->buf == ISAMD_BLOCK_OFFSET_1);
if (pp->is->method->debug > 5)
- logf (LOG_LOG, "isamd: bldfirst: p=%d=%d:%d n=%d:%d:%d sz=%d nk=%d ",
+ yaz_log(YLOG_LOG, "isamd: bldfirst: p=%d=%d:%d n=%d:%d:%d sz=%d nk=%d ",
isamd_addr(pp->pos,pp->cat),pp->cat, pp->pos,
pp->next, isamd_type(pp->next), isamd_block(pp->next),
pp->size, pp->numKeys);
dst += sizeof(pp->size);
assert (dst - pp->buf == ISAMD_BLOCK_OFFSET_N);
if (pp->is->method->debug > 5)
- logf (LOG_LOG, "isamd: l8r: sz=%d p=%d/%d>%d/%d",
+ yaz_log(YLOG_LOG, "isamd: l8r: sz=%d p=%d/%d>%d/%d",
pp->size,
pp->pos, pp->cat,
isamd_block(pp->next), isamd_type(pp->next) );
(*is->method->code_item)(ISAMD_DECODE, pp->decodeClientData, dst, &src);
pp->offset = src - pp->buf;
if (is->method->debug > 8)
- logf (LOG_LOG, "isamd: read_m: block %d:%d sz=%d ofs=%d-%d next=%d",
+ yaz_log(YLOG_LOG, "isamd: read_m: block %d:%d sz=%d ofs=%d-%d next=%d",
pp->cat, pp->pos, pp->size, oldoffs, pp->offset, pp->next);
return 2;
}
(*is->method->code_item)(ISAMD_DECODE, pp->decodeClientData, dst, &src);
pp->offset = src - pp->buf;
if (is->method->debug > 8)
- logf (LOG_LOG, "isamd: read_m: got %d:%d sz=%d ofs=%d-%d next=%d",
+ yaz_log(YLOG_LOG, "isamd: read_m: got %d:%d sz=%d ofs=%d-%d next=%d",
pp->cat, pp->pos, pp->size, oldoffs, pp->offset, pp->next);
return 1;
}
int olddebug= is->method->debug;
is->method->debug=0; /* no debug logs while reading for dump */
- logf(LOG_LOG,"dumping isamd block %d (%d:%d)",
+ yaz_log(YLOG_LOG,"dumping isamd block %d (%d:%d)",
(int)ipos, isamd_type(ipos), isamd_block(ipos) );
pp=isamd_pp_open(is,ipos);
- logf(LOG_LOG,"numKeys=%d, ofs=%d sz=%d",
+ yaz_log(YLOG_LOG,"numKeys=%d, ofs=%d sz=%d",
pp->numKeys, pp->offset, pp->size );
diffidx=oldoffs= pp->offset;
while ((diffidx < is->method->filecat[pp->cat].bsize) && (diffmax>0))
{
memcpy(&diffmax,&(pp->buf[diffidx]),sizeof(int));
- logf (LOG_LOG,"diff set at %d-%d: %s", diffidx, diffmax,
+ yaz_log(YLOG_LOG,"diff set at %d-%d: %s", diffidx, diffmax,
hexdump(pp->buf+diffidx,8,0));
/*! todo: dump the actual diffs as well !!! */
diffidx=diffmax;
if (oldaddr != isamd_addr(pp->pos,pp->cat) )
{
oldaddr = isamd_addr(pp->pos,pp->cat);
- logf(LOG_LOG,"block %d=%d:%d sz=%d nx=%d=%d:%d ofs=%d",
+ yaz_log(YLOG_LOG,"block %d=%d:%d sz=%d nx=%d=%d:%d ofs=%d",
isamd_addr(pp->pos,pp->cat), pp->cat, pp->pos,
pp->size,
pp->next, isamd_type(pp->next), isamd_block(pp->next),
while (i<pp->size) {
n=pp->size-i;
if (n>8) n=8;
- logf(LOG_LOG," %05x: %s",i,hexdump(pp->buf+i,n,hexbuff));
+ yaz_log(YLOG_LOG," %05x: %s",i,hexdump(pp->buf+i,n,hexbuff));
i+=n;
}
if (oldoffs > ISAMD_BLOCK_OFFSET_N)
oldoffs=ISAMD_BLOCK_OFFSET_N;
} /* new block */
occur++;
- logf (LOG_LOG," got %d:%d=%x:%x from %s at %d=%x",
+ yaz_log(YLOG_LOG," got %d:%d=%x:%x from %s at %d=%x",
key.sysno, key.seqno,
key.sysno, key.seqno,
hexdump(pp->buf+oldoffs, pp->offset-oldoffs, hexbuff),
-/* $Id: merge-d.c,v 1.30.2.2 2006-10-27 11:06:47 adam Exp $
+/* $Id: merge-d.c,v 1.30.2.3 2006-12-05 21:14:42 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
if ( 0 != F->r1 ) /* not eof */
F->r2 = FILTER_NOTYET; /* say we want more */
if (F->is->method->debug > 9)
- logf(LOG_LOG,"filt_fill: shift %d.%d m=%d r=%d",
+ yaz_log(YLOG_LOG,"filt_fill: shift %d.%d m=%d r=%d",
F->k1.sysno,
F->k1.seqno,
F->m1, F->r1);
char *k_ptr = (char*) &F->k2;
F->r2 = (F->data->read_item)(F->data->clientData, &k_ptr, &F->m2);
if (F->is->method->debug > 9)
- logf(LOG_LOG,"filt_fill: read %d.%d m=%d r=%d",
+ yaz_log(YLOG_LOG,"filt_fill: read %d.%d m=%d r=%d",
F->k2.sysno, F->k2.seqno, F->m2, F->r2);
}
if ( (F->k1.sysno == F->k2.sysno) &&
(F->r1 >0 ) && (F->r2 >0) )
{ /* del-ins pair of same key (not eof) , ignore both */
if (F->is->method->debug > 9)
- logf(LOG_LOG,"filt_fill: skipped %d.%d m=%d/%d r=%d/%d",
+ yaz_log(YLOG_LOG,"filt_fill: skipped %d.%d m=%d/%d r=%d/%d",
F->k1.sysno, F->k1.seqno,
F->m1,F->m2, F->r1,F->r2);
F->r1 = FILTER_NOTYET;
int res;
filter_fill(F);
if (F->is->method->debug > 9)
- logf(LOG_LOG,"filt_read: reading %d.%d m=%d r=%d",
+ yaz_log(YLOG_LOG,"filt_read: reading %d.%d m=%d r=%d",
F->k1.sysno, F->k1.seqno, F->m1, F->r1);
res = F->r1;
if(res)
return; /* existing block, do not touch */
/* TODO: Probably we may touch anyway? */
if (pp->is->method->debug > 5)
- logf(LOG_LOG,"isamd_reduce: start p=%d c=%d sz=%d",
+ yaz_log(YLOG_LOG,"isamd_reduce: start p=%d c=%d sz=%d",
pp->pos, pp->cat, pp->size);
while ( ( pp->cat > 0 ) && (!pp->next) &&
(pp->offset < pp->is->method->filecat[pp->cat-1].bsize ) )
pp->cat--;
pp->pos = isamd_alloc_block(pp->is, pp->cat);
if (pp->is->method->debug > 5)
- logf(LOG_LOG,"isamd_reduce: got p=%d c=%d sz=%d",
+ yaz_log(YLOG_LOG,"isamd_reduce: got p=%d c=%d sz=%d",
pp->pos, pp->cat, pp->size);
} /* reduceblock */
{
int i;
if (pp->is->method->debug > 5)
- logf(LOG_LOG,"isamd_free_diffs: pp=%p di=%p", pp, pp->diffinfo);
+ yaz_log(YLOG_LOG,"isamd_free_diffs: pp=%p di=%p", pp, pp->diffinfo);
if (!pp->diffinfo)
return;
for (i=0;pp->diffinfo[i].difftype!=DT_NONE;i++)
if(pp->diffinfo[i].decodeData)
{
if (pp->is->method->debug > 8)
- logf(LOG_LOG,"isamd_free_diffs [%d]=%p",i,
+ yaz_log(YLOG_LOG,"isamd_free_diffs [%d]=%p",i,
pp->diffinfo[i].decodeData);
(*pp->is->method->code_stop)(ISAMD_DECODE,pp->diffinfo[i].decodeData);
}
pp->offset = pp->size+1; /* used this block up */
memset(pp->diffinfo,'\0',diffsz);
if (pp->is->method->debug > 5)
- logf(LOG_LOG,"isamd_getDiffInfo: %d=%d:%d->%d, ix=%d mx=%d",
+ yaz_log(YLOG_LOG,"isamd_getDiffInfo: %d=%d:%d->%d, ix=%d mx=%d",
isamd_addr(pp->pos, pp->cat), pp->cat, pp->pos, pp->next,
diffidx,maxinfos);
if ( diffidx+sizeof(int) > pp->is->method->filecat[pp->cat].bsize )
{
if (pp->is->method->debug > 5)
- logf(LOG_LOG,"isamd_getDiffInfo:Near end (no room for len) at ix=%d n=%d",
+ yaz_log(YLOG_LOG,"isamd_getDiffInfo:Near end (no room for len) at ix=%d n=%d",
diffidx, i);
return; /* whole block done */
}
memcpy( &pp->diffinfo[i].maxidx, &pp->diffbuf[diffidx], sizeof(int) );
pp->diffinfo[i].difftype=DT_DIFF;
if (pp->is->method->debug > 5)
- logf(LOG_LOG,"isamd_getDiffInfo: max=%d ix=%d dbuf=%p",
+ yaz_log(YLOG_LOG,"isamd_getDiffInfo: max=%d ix=%d dbuf=%p",
pp->diffinfo[i].maxidx, diffidx, pp->diffbuf);
if ( (pp->is->method->debug > 0) &&
(pp->diffinfo[i].maxidx > pp->is->method->filecat[pp->cat].bsize) )
{
- logf(LOG_LOG,"Bad MaxIx!!! %s:%d: diffidx=%d",
+ yaz_log(YLOG_LOG,"Bad MaxIx!!! %s:%d: diffidx=%d",
__FILE__,__LINE__, diffidx);
- logf(LOG_LOG,"i=%d maxix=%d bsz=%d", i, pp->diffinfo[i].maxidx,
+ yaz_log(YLOG_LOG,"i=%d maxix=%d bsz=%d", i, pp->diffinfo[i].maxidx,
pp->is->method->filecat[pp->cat].bsize);
- logf(LOG_LOG,"pp=%d=%d:%d pp->nx=%d=%d:%d",
+ yaz_log(YLOG_LOG,"pp=%d=%d:%d pp->nx=%d=%d:%d",
isamd_addr(pp->pos,pp->cat), pp->pos, pp->cat,
pp->next, isamd_type(pp->next), isamd_block(pp->next) );
}
if (0==pp->diffinfo[i].maxidx)
{
if (pp->is->method->debug > 5) /* !!! 4 */
- logf(LOG_LOG,"isamd_getDiffInfo:End mark at ix=%d n=%d",
+ yaz_log(YLOG_LOG,"isamd_getDiffInfo:End mark at ix=%d n=%d",
diffidx, i);
return; /* end marker */
}
pp->diffinfo[i].decodeData = (*pp->is->method->code_start)(ISAMD_DECODE);
pp->diffinfo[i].diffidx = diffidx;
if (pp->is->method->debug > 5)
- logf(LOG_LOG,"isamd_getDiff[%d]:%d-%d %s",
+ yaz_log(YLOG_LOG,"isamd_getDiff[%d]:%d-%d %s",
i,diffidx-sizeof(int),pp->diffinfo[i].maxidx,
hexdump((unsigned char *)&pp->diffbuf[diffidx-4],8,0) );
diffidx=pp->diffinfo[i].maxidx;
pp->pos = isamd_alloc_block(pp->is,pp->cat);
firstpp->next = isamd_addr(pp->pos,pp->cat);
if (pp->is->method->debug >3)
- logf(LOG_LOG,"isamd_build: Alloc 1. dblock p=%d=%d:%d",
+ yaz_log(YLOG_LOG,"isamd_build: Alloc 1. dblock p=%d=%d:%d",
isamd_addr(pp->pos,pp->cat), pp->cat, pp->pos);
}
newblock=isamd_alloc_block(pp->is,pp->cat);
isamd_buildlaterblock(pp);
isamd_write_block(pp->is,pp->cat,pp->pos,pp->buf);
if (pp->is->method->debug >3)
- logf(LOG_LOG,"isamd_build: Alloc nxt %d=%d:%d -> %d=%d:%d",
+ yaz_log(YLOG_LOG,"isamd_build: Alloc nxt %d=%d:%d -> %d=%d:%d",
isamd_addr(pp->pos,pp->cat), pp->cat, pp->pos,
isamd_addr(newblock,pp->cat), pp->cat, newblock);
pp->next=0;
codelen = c_ptr - codebuff;
assert ( (codelen<128) && (codelen>0));
if (pp->is->method->debug >7)
- logf(LOG_LOG,"isamd:build: coded %s nk=%d,ofs=%d-%d",
+ yaz_log(YLOG_LOG,"isamd:build: coded %s nk=%d,ofs=%d-%d",
hexdump((unsigned char *) codebuff, c_ptr-codebuff,hexbuff), firstpp->numKeys+1,
pp->offset, pp->offset+codelen);
codelen = c_ptr - codebuff;
assert ( (codelen<128) && (codelen>0));
if (pp->is->method->debug >7)
- logf(LOG_LOG,"isamd:build: recoded into %s (nk=%d)",
+ yaz_log(YLOG_LOG,"isamd:build: recoded into %s (nk=%d)",
hexdump((unsigned char *) codebuff, c_ptr-codebuff,hexbuff), firstpp->numKeys+1);
} /* block full */
if (p_key)
{ /* we have an extra item to inject into the merge */
if (pp->is->method->debug >9) /* !!!!! */
- logf(LOG_LOG,"isamd_read_item: going to merge with %d.%d",
+ yaz_log(YLOG_LOG,"isamd_read_item: going to merge with %d.%d",
p_key->sysno, p_key->seqno);
pp->diffinfo[i].key = *p_key; /* the key merge could not handle */
pp->diffinfo[i].mode = pp->diffinfo[i].key.seqno & 1;
pp->diffinfo[i].key.seqno >>= 1;
pp->diffinfo[i].difftype=DT_INPU;
if (pp->is->method->debug > 7)
- logf(LOG_LOG,"isamd_read_item: inpu key %d sys=%d seq=%d=2*%d+%d",
+ yaz_log(YLOG_LOG,"isamd_read_item: inpu key %d sys=%d seq=%d=2*%d+%d",
i, p_key->sysno,
pp->diffinfo[i].key.seqno*2 + pp->diffinfo[1].mode,
pp->diffinfo[i].key.seqno,
pp->diffinfo[i].mode = pp->diffinfo[i].key.seqno & 1;
pp->diffinfo[i].key.seqno = pp->diffinfo[i].key.seqno >>1 ;
if (pp->is->method->debug > 9)
- logf(LOG_LOG,"isamd_read_item: dif[%d] at %d-%d: %s",
+ yaz_log(YLOG_LOG,"isamd_read_item: dif[%d] at %d-%d: %s",
i,oldoffs, pp->diffinfo[i].diffidx,
hexdump((unsigned char *) pp->buf+oldoffs, pp->diffinfo[i].diffidx-oldoffs,0));
if (pp->is->method->debug > 7)
- logf(LOG_LOG,"isamd_read_item: rd dif[%d] %d.%d (%x.%x)",
+ yaz_log(YLOG_LOG,"isamd_read_item: rd dif[%d] %d.%d (%x.%x)",
i,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno);
if (0==rc)
{ /* eof */
if (pp->is->method->debug > 7)
- logf(LOG_LOG,"isamd_read_item: eof (rc=%d) main ",
+ yaz_log(YLOG_LOG,"isamd_read_item: eof (rc=%d) main ",
rc);
pp->diffinfo[i].maxidx=-1;
pp->diffinfo[i].key.sysno=0;
{ /* not eof */
pp->diffinfo[i].mode = 1;
if (pp->is->method->debug > 7)
- logf(LOG_LOG,"isamd_read_item: rd main %d-%d %d.%d (%x.%x) m=%d",
+ yaz_log(YLOG_LOG,"isamd_read_item: rd main %d-%d %d.%d (%x.%x) m=%d",
oldoffs,pp->offset,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno,
pp->diffinfo[i].difftype=DT_DONE;
}
if (pp->is->method->debug >7)
- logf(LOG_LOG,"merge: read inpu m=%d %d.%d (%x.%x)",
+ yaz_log(YLOG_LOG,"merge: read inpu m=%d %d.%d (%x.%x)",
pp->diffinfo[i].mode,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno );
} /* read a new one */
if (pp->is->method->debug > 8)
- logf(LOG_LOG,"isamd_read_item: considering d%d %d.%d ix=%d mx=%d",
+ yaz_log(YLOG_LOG,"isamd_read_item: considering d%d %d.%d ix=%d mx=%d",
i, pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno,
pp->diffinfo[i].diffidx, pp->diffinfo[i].maxidx);
if (cmp<0)
{
if (pp->is->method->debug > 8)
- logf(LOG_LOG,"isamd_read_item: ins [%d]%d.%d < [%d]%d.%d",
+ yaz_log(YLOG_LOG,"isamd_read_item: ins [%d]%d.%d < [%d]%d.%d",
i,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno,
winner,
else
{
if (pp->is->method->debug > 1)
- logf(LOG_LOG,"delete diff for nonexisting item");
+ yaz_log(YLOG_LOG,"delete diff for nonexisting item");
assert(!"delete diff for nonexisting item");
/* is an assert too steep here? Not really.*/
}
if (!pp->diffinfo[i].mode) /* delete diff. should always be */
{
if (pp->is->method->debug > 8)
- logf(LOG_LOG,"isamd_read_item: del %d at%d %d.%d (%x.%x)",
+ yaz_log(YLOG_LOG,"isamd_read_item: del %d at%d %d.%d (%x.%x)",
i, winner,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno);
}
else
if (pp->is->method->debug > 2)
- logf(LOG_LOG,"isamd_read_item: duplicate ins %d at%d %d.%d (%x.%x)",
+ yaz_log(YLOG_LOG,"isamd_read_item: duplicate ins %d at%d %d.%d (%x.%x)",
i, winner,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno,
pp->diffinfo[i].key.sysno, pp->diffinfo[i].key.seqno);
if ( pp->diffinfo[winner].key.sysno)
{
if (pp->is->method->debug > 7)
- logf(LOG_LOG,"isamd_read_item: got %d %d.%d (%x.%x)",
+ yaz_log(YLOG_LOG,"isamd_read_item: got %d %d.%d (%x.%x)",
winner,
pp->diffinfo[winner].key.sysno, pp->diffinfo[winner].key.seqno,
pp->diffinfo[winner].key.sysno, pp->diffinfo[winner].key.seqno);
else
{
if (pp->is->method->debug > 7)
- logf(LOG_LOG,"isamd_read_item: eof w=%d %d.%d (%x.%x)",
+ yaz_log(YLOG_LOG,"isamd_read_item: eof w=%d %d.%d (%x.%x)",
winner,
pp->diffinfo[winner].key.sysno, pp->diffinfo[winner].key.seqno,
pp->diffinfo[winner].key.sysno, pp->diffinfo[winner].key.seqno);
diffidx = ISAMD_BLOCK_OFFSET_1;
if (readpp->is->method->debug >4)
- logf(LOG_LOG,"isamd_merge: f=%d=%d:%d n=%d=%d:%d",
+ yaz_log(YLOG_LOG,"isamd_merge: f=%d=%d:%d n=%d=%d:%d",
isamd_addr(firstpp->pos,firstpp->cat), firstpp->cat, firstpp->pos,
firstpp->next, isamd_type(firstpp->next), isamd_block(firstpp->next));
{
isamd_release_block(firstpp->is, firstpp->cat, killblk);
if (readpp->is->method->debug >3)
- logf(LOG_LOG,"isamd_merge: released old firstblock %d (%d:%d)",
+ yaz_log(YLOG_LOG,"isamd_merge: released old firstblock %d (%d:%d)",
isamd_addr(killblk,firstpp->cat), firstpp->cat, killblk );
}
r_key.sysno = 0;
r_key.seqno = 0;
if (readpp->is->method->debug >5)
- logf(LOG_LOG,"isamd_merge:all data has been deleted (nk=%d) ",
+ yaz_log(YLOG_LOG,"isamd_merge:all data has been deleted (nk=%d) ",
readpp->numKeys);
}
firstpp=isamd_pp_create(readpp->is, diffcat);
firstpp->pos=isamd_alloc_block(firstpp->is,diffcat);
if (readpp->is->method->debug >3)
- logf(LOG_LOG,"isamd_merge: allocated new firstpp %d=%d:%d",
+ yaz_log(YLOG_LOG,"isamd_merge: allocated new firstpp %d=%d:%d",
isamd_addr(firstpp->pos,firstpp->cat), firstpp->cat, firstpp->pos );
pp=isamd_pp_create(readpp->is,readpp->is->max_cat );
while (r_more)
{
if (readpp->is->method->debug >6)
- logf(LOG_LOG,"isamd_merge: got key %d.%d",
+ yaz_log(YLOG_LOG,"isamd_merge: got key %d.%d",
r_key.sysno, r_key.seqno );
pp= append_main_item(firstpp, pp, &r_key);
if ( (readpp->pos != killblk ) && (0!=readpp->pos) )
{ /* pos can get to 0 at end of main seq, if still diffs left...*/
if (readpp->is->method->debug >3)
- logf(LOG_LOG,"isamd_merge: released block %d (%d:%d) now %d=%d:%d",
+ yaz_log(YLOG_LOG,"isamd_merge: released block %d (%d:%d) now %d=%d:%d",
isamd_addr(killblk,readpp->cat), readpp->cat, killblk,
isamd_addr(readpp->pos,readpp->cat),readpp->cat, readpp->pos );
isamd_release_block(readpp->is, readpp->cat, readpp->pos);
firstpp->next = isamd_addr(pp->pos,pp->cat);
save_last_pp(pp);
if (readpp->is->method->debug >4)
- logf(LOG_LOG,"isamd_merge: saved last block %d=%d:%d",
+ yaz_log(YLOG_LOG,"isamd_merge: saved last block %d=%d:%d",
isamd_addr(pp->pos,pp->cat), pp->cat, pp->pos);
isamd_pp_close(pp);
if (readpp->is->method->debug >5)
- logf(LOG_LOG,"isamd_merge: closing readpp %d=%d:%d di=%p",
+ yaz_log(YLOG_LOG,"isamd_merge: closing readpp %d=%d:%d di=%p",
isamd_addr(readpp->pos,readpp->cat), readpp->cat, readpp->pos,
readpp->diffinfo);
isamd_pp_close(readpp); /* pos is 0 by now, at eof. close works anyway */
if (readpp->is->method->debug >2)
- logf(LOG_LOG,"isamd_merge: merge ret f=%d=%d:%d pp=%d=%d:%d",
+ yaz_log(YLOG_LOG,"isamd_merge: merge ret f=%d=%d:%d pp=%d=%d:%d",
isamd_addr(firstpp->pos,pp->cat), firstpp->cat, firstpp->pos,
isamd_addr(pp->pos,pp->cat), pp->cat, pp->pos);
}
if (is->method->debug >2)
- logf(LOG_LOG,"isamd_appd: Start ipos=%d=%d:%d n=%d=%d:%d nk=%d sz=%d",
+ yaz_log(YLOG_LOG,"isamd_appd: Start ipos=%d=%d:%d n=%d=%d:%d nk=%d sz=%d",
ipos, isamd_type(ipos), isamd_block(ipos),
firstpp->next, isamd_type(firstpp->next), isamd_block(firstpp->next),
firstpp->numKeys, firstpp->size);
/* i_more = (*data->read_item)(data->clientData, &i_ptr, &i_mode); */
if (is->method->debug >6)
- logf(LOG_LOG,"isamd_appd: start m=%d %d.%d=%x.%x: %d",
+ yaz_log(YLOG_LOG,"isamd_appd: start m=%d %d.%d=%x.%x: %d",
i_mode,
i_key.sysno, i_key.seqno,
i_key.sysno, i_key.seqno,
codelen = c_ptr - codebuff;
assert ( (codelen<128) && (codelen>0));
if (is->method->debug >7)
- logf(LOG_LOG,"isamd_appd: coded %d: %s (nk=%d) (ix=%d)",
+ yaz_log(YLOG_LOG,"isamd_appd: coded %d: %s (nk=%d) (ix=%d)",
codelen, hexdump((unsigned char *) codebuff, codelen,hexbuff),
firstpp->numKeys,diffidx);
maxsize = is->method->filecat[firstpp->cat].bsize;
firstpp->pos=0; /* need to allocate it when saving */
if (is->method->debug >3)
- logf(LOG_LOG,"isamd_appd: increased diff block sz to %d (%d)",
+ yaz_log(YLOG_LOG,"isamd_appd: increased diff block sz to %d (%d)",
firstpp->cat, maxsize);
}
if ((firstpp->cat >= firstpp->is->max_cat) &&
(diffidx + codelen > maxsize) )
{ /* max size - can't help, need to merge it */
if (is->method->debug >7)
- logf(LOG_LOG,"isamd_appd: need to merge");
+ yaz_log(YLOG_LOG,"isamd_appd: need to merge");
if (is->method->debug >9) /* !!!!! */
- logf(LOG_LOG,"isamd_appd: going to merge with m=%d %d.%d",
+ yaz_log(YLOG_LOG,"isamd_appd: going to merge with m=%d %d.%d",
i_mode, i_key.sysno, i_key.seqno);
merge_rc = merge (firstpp, &i_key, filt, dictentry, dictlen);
if (0!=merge_rc)
if (!( diffidx+codelen <= maxsize ))
{ /* bug hunting */
- logf(LOG_LOG,"OOPS, diffidx problem: d=%d c=%d s=%d > m=%d",
+ yaz_log(YLOG_LOG,"OOPS, diffidx problem: d=%d c=%d s=%d > m=%d",
diffidx, codelen, diffidx+codelen, maxsize);
- logf(LOG_LOG,"ipos=%d f=%d=%d:%d",
+ yaz_log(YLOG_LOG,"ipos=%d f=%d=%d:%d",
ipos,
isamd_addr(firstpp->pos, firstpp->cat),
firstpp->cat, firstpp->pos );
i_more = filter_read(filt, &i_key, &i_mode);
/* i_more = (*data->read_item)(data->clientData, &i_ptr, &i_mode); */
if ( (i_more) && (is->method->debug >6) )
- logf(LOG_LOG,"isamd_appd: got m=%d %d.%d=%x.%x: %d",
+ yaz_log(YLOG_LOG,"isamd_appd: got m=%d %d.%d=%x.%x: %d",
i_mode,
i_key.sysno, i_key.seqno,
i_key.sysno, i_key.seqno,
}
dsize=diffidx-ISAMD_BLOCK_OFFSET_1;
- /* logf(LOG_LOG,"!! nxt=%d diffidx=%d ds=%d",
+ /* yaz_log(YLOG_LOG,"!! nxt=%d diffidx=%d ds=%d",
firstpp->next, diffidx, dsize); */
if ( (0==firstpp->next) && (dsize <ISAMD_MAX_DICT_LEN))
{
- /* logf(LOG_LOG,"building a dict entry!!"); */
+ /* yaz_log(YLOG_LOG,"building a dict entry!!"); */
assert(firstpp->numKeys < 128);
assert(firstpp->numKeys >0);
/* actually, 255 is good enough, but sign mismatches... */
if ( filter_isempty(F) ) /* can be, if del-ins of the same */
{
if (is->method->debug >3)
- logf(LOG_LOG,"isamd_appd: nothing to do ");
+ yaz_log(YLOG_LOG,"isamd_appd: nothing to do ");
filter_close(F);
++(is->no_non);
return dictlen; /* without doing anything at all */
if (!rc)
{
if (is->method->debug >9)
- logf(LOG_LOG,"isamd_appd: singleton didn't fit, backfilling");
+ yaz_log(YLOG_LOG,"isamd_appd: singleton didn't fit, backfilling");
filter_backfill(F,&k, mode);
}
if (is->method->debug >9)
- logf(LOG_LOG,"isamd_appd: singleton %d (%x)",
+ yaz_log(YLOG_LOG,"isamd_appd: singleton %d (%x)",
rc,rc);
if (rc)
is->no_singles++;
filter_close(F);
if (is->method->debug >2)
- logf(LOG_LOG,"isamd_appd: ret len=%d ", newlen);
+ yaz_log(YLOG_LOG,"isamd_appd: ret len=%d ", newlen);
return newlen;
} /* isamd_append */
/*
* $Log: merge-d.c,v $
- * Revision 1.30.2.2 2006-10-27 11:06:47 adam
+ * Revision 1.30.2.3 2006-12-05 21:14:42 adam
+ * Updated code to use new YAZ log functions/defines.
+ *
+ * Revision 1.30.2.2 2006/10/27 11:06:47 adam
* Fixed several compilation warnings. (gcc 4.1.2, -O3 -g -Wall)
*
* Revision 1.30.2.1 2006/08/14 10:39:11 adam
-/* $Id: merge.c,v 1.23.2.1 2006-08-14 10:39:12 adam Exp $
+/* $Id: merge.c,v 1.23.2.2 2006-12-05 21:14:42 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
if (!*firstpos)
*firstpos = mb[i].block;
if (is->method->debug > 2)
- logf (LOG_LOG, "isc: skip ptr=%d size=%d %d %d",
+ yaz_log(YLOG_LOG, "isc: skip ptr=%d size=%d %d %d",
i, ssize, cat, mb[i].block);
++(is->files[cat].no_skip_writes);
continue;
memcpy (src+sizeof(int)+sizeof(ssize), numkeys,
sizeof(*numkeys));
if (is->method->debug > 2)
- logf (LOG_LOG, "isc: flush ptr=%d numk=%d size=%d nextpos=%d",
+ yaz_log(YLOG_LOG, "isc: flush ptr=%d numk=%d size=%d nextpos=%d",
i, *numkeys, (int) ssize, mb[i+1].block);
}
else
src = r_buf + mb[i].offset - ISAMC_BLOCK_OFFSET_N;
ssize += ISAMC_BLOCK_OFFSET_N;
if (is->method->debug > 2)
- logf (LOG_LOG, "isc: flush ptr=%d size=%d nextpos=%d",
+ yaz_log(YLOG_LOG, "isc: flush ptr=%d size=%d nextpos=%d",
i, (int) ssize, mb[i+1].block);
}
memcpy (src, &mb[i+1].block, sizeof(int));
cat = pp->cat;
if (debug > 1)
- logf (LOG_LOG, "isc: isc_merge begin %d %d", cat, pp->pos);
+ yaz_log(YLOG_LOG, "isc: isc_merge begin %d %d", cat, pp->pos);
/* read first item from i */
i_item_ptr = i_item;
the original (if any)
*/
if (debug > 3)
- logf (LOG_LOG, "isc: release A");
+ yaz_log(YLOG_LOG, "isc: release A");
if (mb[ptr].block)
isc_release_block (is, pp->cat, mb[ptr].block);
mb[ptr].block = pp->pos;
mb[ptr].dirty = last_dirty;
mb[ptr].offset = r_offset;
if (debug > 3)
- logf (LOG_LOG, "isc: bound ptr=%d,offset=%d",
+ yaz_log(YLOG_LOG, "isc: bound ptr=%d,offset=%d",
ptr, r_offset);
if (cat==is->max_cat && ptr >= is->method->max_blocks_mem)
{
except 1 will be flushed.
*/
if (debug > 2)
- logf (LOG_LOG, "isc: flush A %d sections", ptr);
+ yaz_log(YLOG_LOG, "isc: flush A %d sections", ptr);
flush_blocks (is, mb, ptr-1, r_buf, &firstpos, cat,
0, &pp->numKeys);
mb[0].block = mb[ptr-1].block;
{
if (!i_mode) /* delete item which isn't there? */
{
- logf (LOG_FATAL, "Inconsistent register at offset %d",
+ yaz_log(YLOG_FATAL, "Inconsistent register at offset %d",
r_offset);
abort ();
}
if (border < new_offset && border >= r_offset)
{
if (debug > 2)
- logf (LOG_LOG, "isc: border %d %d", ptr, border);
+ yaz_log(YLOG_LOG, "isc: border %d %d", ptr, border);
/* Max size of current block category reached ...
make new virtual block entry */
mb[++ptr].block = 0;
surely not the last one(s).
*/
if (debug > 2)
- logf (LOG_LOG, "isc: flush B %d sections", ptr-1);
+ yaz_log(YLOG_LOG, "isc: flush B %d sections", ptr-1);
flush_blocks (is, mb, ptr-1, r_buf, &firstpos, cat,
0, &pp->numKeys);
mb[0].block = mb[ptr-1].block;
int border = is->method->filecat[cat].ifill -
ISAMC_BLOCK_OFFSET_1 + mb[j].offset;
if (debug > 3)
- logf (LOG_LOG, "isc: remap %d border=%d", i, border);
+ yaz_log(YLOG_LOG, "isc: remap %d border=%d", i, border);
if (mb[i+1].offset > border && mb[i].offset <= border)
{
if (debug > 3)
- logf (LOG_LOG, "isc: to %d %d", j, mb[i].offset);
+ yaz_log(YLOG_LOG, "isc: to %d %d", j, mb[i].offset);
mb[++j].dirty = 1;
mb[j].block = 0;
mb[j].offset = mb[i].offset;
}
}
if (debug > 2)
- logf (LOG_LOG, "isc: remap from %d to %d sections to cat %d",
+ yaz_log(YLOG_LOG, "isc: remap from %d to %d sections to cat %d",
ptr, j, cat);
ptr = j;
border = get_border (is, mb, ptr, cat, firstpos);
if (debug > 3)
- logf (LOG_LOG, "isc: border=%d r_offset=%d", border, r_offset);
+ yaz_log(YLOG_LOG, "isc: border=%d r_offset=%d", border, r_offset);
}
}
if (mb[ptr].offset < r_offset)
if (cat == pp->cat && mb[ptr].block)
{
if (debug > 3)
- logf (LOG_LOG, "isc: release C");
+ yaz_log(YLOG_LOG, "isc: release C");
isc_release_block (is, pp->cat, mb[ptr].block);
mb[ptr].block = 0;
if (ptr > 0)
}
if (debug > 2)
- logf (LOG_LOG, "isc: flush C, %d sections", ptr);
+ yaz_log(YLOG_LOG, "isc: flush C, %d sections", ptr);
if (firstpos)
{
if (numKeys != isc_pp_num (pp))
{
if (debug > 2)
- logf (LOG_LOG, "isc: patch num keys firstpos=%d num=%d",
+ yaz_log(YLOG_LOG, "isc: patch num keys firstpos=%d num=%d",
firstpos, numKeys);
bf_write (is->files[cat].bf, firstpos, ISAMC_BLOCK_OFFSET_N,
sizeof(numKeys), &numKeys);
if (!firstpos)
cat = 0;
if (debug > 1)
- logf (LOG_LOG, "isc: isc_merge return %d %d", cat, firstpos);
+ yaz_log(YLOG_LOG, "isc: isc_merge return %d %d", cat, firstpos);
isc_pp_close (pp);
return cat + firstpos * 8;
}
/*
* $Log: merge.c,v $
- * Revision 1.23.2.1 2006-08-14 10:39:12 adam
+ * Revision 1.23.2.2 2006-12-05 21:14:42 adam
+ * Updated code to use new YAZ log functions/defines.
+ *
+ * Revision 1.23.2.1 2006/08/14 10:39:12 adam
* Update copyright year + FSF address
*
* Revision 1.23 2003/06/23 15:36:11 adam
-/* $Id: isamg.c,v 1.3.2.1 2006-08-14 10:39:13 adam Exp $
+/* $Id: isamg.c,v 1.3.2.2 2006-12-05 21:14:43 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
writeflag, key_isamd_m (res,&isamd_m)
}
else {
- logf (LOG_FATAL, "isamg: Unknown isam type: %s", isam_type_name);
+ yaz_log(YLOG_FATAL, "isamg: Unknown isam type: %s", isam_type_name);
exit(1);
}
} /* open */
/*
* $Log: isamg.c,v $
- * Revision 1.3.2.1 2006-08-14 10:39:13 adam
+ * Revision 1.3.2.2 2006-12-05 21:14:43 adam
+ * Updated code to use new YAZ log functions/defines.
+ *
+ * Revision 1.3.2.1 2006/08/14 10:39:13 adam
* Update copyright year + FSF address
*
* Revision 1.3 2003/04/02 19:01:47 adam
-/* $Id: isams.c,v 1.5.2.2 2006-10-27 11:06:48 adam Exp $
+/* $Id: isams.c,v 1.5.2.3 2006-12-05 21:14:43 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
#include <string.h>
#include <stdio.h>
+#include <yaz/xmalloc.h>
#include <yaz/log.h>
#include <isams.h>
if (is->head.last_offset > is->block_size)
{
if (is->debug > 2)
- logf (LOG_LOG, "first_block=%d", first_block);
+ yaz_log(YLOG_LOG, "first_block=%d", first_block);
bf_write(is->bf, is->head.last_block, 0, 0, is->merge_buf);
(is->head.last_block)++;
is->head.last_offset -= is->block_size;
ISAMS_PP pp = (ISAMS_PP) xmalloc (sizeof(*pp));
if (is->debug > 1)
- logf (LOG_LOG, "isams: isams_pp_open pos=%ld", (long) pos);
+ yaz_log(YLOG_LOG, "isams: isams_pp_open pos=%ld", (long) pos);
pp->is = is;
pp->decodeClientData = (*is->method->code_start)(ISAMC_DECODE);
pp->numKeys = 0;
pp->block_no = pos/is->block_size;
pp->block_offset = pos - pp->block_no * is->block_size;
if (is->debug)
- logf (LOG_LOG, "isams: isams_pp_open off=%d no=%d",
+ yaz_log(YLOG_LOG, "isams: isams_pp_open off=%d no=%d",
pp->block_offset, pp->block_no);
if (pos)
{
bf_read (is->bf, pp->block_no+1, 0, 0, pp->buf + is->block_size);
memcpy(&pp->numKeys, pp->buf + pp->block_offset, sizeof(int));
if (is->debug)
- logf (LOG_LOG, "isams: isams_pp_open numKeys=%d", pp->numKeys);
+ yaz_log(YLOG_LOG, "isams: isams_pp_open numKeys=%d", pp->numKeys);
pp->block_offset += sizeof(int);
}
return pp;
void init (void) {
nmem_init ();
yaz_log_init_prefix ("ZebraPerl");
- yaz_log (LOG_LOG, "Zebra API initialized");
+ yaz_log(YLOG_LOG, "Zebra API initialized");
}
void DESTROY (void) {
nmem_exit ();
- yaz_log (LOG_LOG, "Zebra API destroyed");
+ yaz_log(YLOG_LOG, "Zebra API destroyed");
}
/* Logging facilities from yaz */
void logMsg (int level, const char *message) {
- logf(level, "%s", message);
+ yaz_log(level, "%s", message);
}
/* debug tool for data1... maybe should be moved to data1.
} else {
schema = oid_getvalbyname (a_schema);
if (schema == VAL_NONE) {
- logf(LOG_WARN,"unknown schema '%s'",a_schema);
+ yaz_log(YLOG_WARN,"unknown schema '%s'",a_schema);
}
}
} else {
recordsyntax = oid_getvalbyname (a_format);
if (recordsyntax == VAL_NONE) {
- logf(LOG_WARN,"unknown record syntax '%s', using SUTRS",a_schema);
+ yaz_log(YLOG_WARN,"unknown record syntax '%s', using SUTRS",a_schema);
recordsyntax = VAL_SUTRS;
}
}
if (cql_transform_buf(ct, cql_parser_result(cp), res, len)) {
status = cql_transform_error(ct, &addinfo);
- logf (LOG_WARN,"Transform error %d %s\n", status, addinfo ? addinfo : "");
+ yaz_log(YLOG_WARN,"Transform error %d %s\n", status, addinfo ? addinfo : "");
cql_parser_destroy(cp);
return (status);
}
ZebraScanEntry *entries;
int i, class;
- logf(LOG_DEBUG,
+ yaz_log(YLOG_DEBUG,
"scan req: pos:%d, num:%d, partial:%d",
so->position, so->num_entries, so->is_partial);
zapt = p_query_scan (stream, PROTO_Z3950, &attrsetid, pqf_query);
oidname = yaz_z3950oid_to_str (attrsetid, &class);
- logf (LOG_DEBUG, "Attributreset: %s", oidname);
+ yaz_log(YLOG_DEBUG, "Attributreset: %s", oidname);
attributeset = oid_getvalbyname(oidname);
if (!zapt) {
- logf (LOG_WARN, "bad query %s\n", pqf_query);
+ yaz_log(YLOG_WARN, "bad query %s\n", pqf_query);
odr_reset (stream);
return;
}
&so->position, &so->num_entries,
(ZebraScanEntry **) &so->entries, &so->is_partial);
- logf(LOG_DEBUG,
+ yaz_log(YLOG_DEBUG,
"scan res: pos:%d, num:%d, partial:%d",
so->position, so->num_entries, so->is_partial);
}
-/* $Id: marcread.c,v 1.24.2.6 2006-10-26 23:46:49 adam Exp $
+/* $Id: marcread.c,v 1.24.2.7 2006-12-05 21:14:44 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
{
int i;
- yaz_log(LOG_WARN, "MARC: Skipping bad byte %d (0x%02X)",
+ yaz_log(YLOG_WARN, "MARC: Skipping bad byte %d (0x%02X)",
*buf & 0xff, *buf & 0xff);
for (i = 0; i<4; i++)
buf[i] = buf[i+1];
record_length = atoi_n (buf, 5);
if (record_length < 25)
{
- logf (LOG_WARN, "MARC record length < 25, is %d", record_length);
+ yaz_log(YLOG_WARN, "MARC record length < 25, is %d", record_length);
return NULL;
}
/* read remaining part - attempt to read one byte furhter... */
read_bytes = (*p->readf)(p->fh, buf+5, record_length-4);
if (read_bytes < record_length-5)
{
- logf (LOG_WARN, "Couldn't read whole MARC record");
+ yaz_log(YLOG_WARN, "Couldn't read whole MARC record");
return NULL;
}
if (read_bytes == record_length - 4)
res_root = data1_mk_root (p->dh, p->mem, absynName);
if (!res_root)
{
- yaz_log (LOG_WARN, "cannot read MARC without an abstract syntax");
+ yaz_log(YLOG_WARN, "cannot read MARC without an abstract syntax");
return 0;
}
if (marc_xml)
int l = 3 + length_data_entry + length_starting;
if (entry_p + l >= record_length)
{
- yaz_log(LOG_WARN, "MARC: Directory offset %d: end of record.",
+ yaz_log(YLOG_WARN, "MARC: Directory offset %d: end of record.",
entry_p);
return 0;
}
if (l >= 3)
{
/* not all digits, so stop directory scan */
- yaz_log(LOG_LOG, "MARC: Bad directory");
+ yaz_log(YLOG_LOG, "MARC: Bad directory");
break;
}
entry_p += 3 + length_data_entry + length_starting;
end_of_directory = entry_p;
if (base_address != entry_p+1)
{
- yaz_log(LOG_WARN, "MARC: Base address does not follow directory");
+ yaz_log(YLOG_WARN, "MARC: Base address does not follow directory");
}
for (entry_p = 24; entry_p != end_of_directory; )
{
if (data_length <= 0 || data_offset < 0 || end_offset >= record_length)
{
- yaz_log(LOG_WARN, "MARC: Bad offsets in data. Skipping rest");
+ yaz_log(YLOG_WARN, "MARC: Bad offsets in data. Skipping rest");
break;
}
wrbuf_puts(buf, " ");
}
#if MARCOMP_DEBUG
- logf(LOG_LOG, "cat_inline_subfield(): add subfield $%s", found->name);
+ yaz_log(YLOG_LOG, "cat_inline_subfield(): add subfield $%s", found->name);
#endif
pisf = found->next;
}
int i;
if ((i=inline_parse(pif, psubf->u.tag.tag, get_data(psubf, &len)))<0)
{
- logf(LOG_WARN, "inline subfield ($%s): parse error",
+ yaz_log(YLOG_WARN, "inline subfield ($%s): parse error",
psubf->u.tag.tag);
inline_destroy_field(pif);
return;
}
else
{
- logf(LOG_WARN, "In-line field %s missed -- indicators do not match", pif->name);
+ yaz_log(YLOG_WARN, "In-line field %s missed -- indicators do not match", pif->name);
}
}
}
inline_destroy_field(pif);
}
#if MARCOMP_DEBUG
- logf(LOG_LOG, "cat_inline_field(): got buffer {%s}", buf->buf);
+ yaz_log(YLOG_LOG, "cat_inline_field(): got buffer {%s}", buf->buf);
#endif
}
wrbuf_puts(buf, " ");
}
#if MARCOMP_DEBUG
- logf(LOG_LOG, "cat_subfield(): add subfield $%s", found->u.tag.tag);
+ yaz_log(YLOG_LOG, "cat_subfield(): add subfield $%s", found->u.tag.tag);
#endif
subfield = found->next;
}
wrbuf_puts(buf, "");
}
#if MARCOMP_DEBUG
- logf(LOG_LOG, "cat_field(): got buffer {%s}", buf->buf);
+ yaz_log(YLOG_LOG, "cat_field(): got buffer {%s}", buf->buf);
#endif
return field->next;
}
))
{
#if MARCOMP_DEBUG
- logf(LOG_WARN, "Field %s missed -- does not match indicators", field->u.tag.tag);
+ yaz_log(YLOG_WARN, "Field %s missed -- does not match indicators", field->u.tag.tag);
#endif
return field->next;
}
cat_subfield(pf->list, buf, subfield);
#if MARCOMP_DEBUG
- logf(LOG_LOG, "cat_field(): got buffer {%s}", buf->buf);
+ yaz_log(YLOG_LOG, "cat_field(): got buffer {%s}", buf->buf);
#endif
return field->next;
}
buf = wrbuf_alloc();
#if MARCOMP_DEBUG
- logf(LOG_LOG, "parse_data1_tree(): statement -{%s}", mc_stmnt);
+ yaz_log(YLOG_LOG, "parse_data1_tree(): statement -{%s}", mc_stmnt);
#endif
if (!yaz_matchstr(pf->name, "ldr"))
{
data1_node *new;
#if MARCOMP_DEBUG
- logf(LOG_LOG,"parse_data1_tree(): try LEADER from {%d} to {%d} positions",
+ yaz_log(YLOG_LOG,"parse_data1_tree(): try LEADER from {%d} to {%d} positions",
pf->interval.start, pf->interval.end);
#endif
if (marctab)
data1_node *new;
char *pb;
#if MARCOMP_DEBUG
- logf(LOG_LOG, "parse_data1_tree(): try field {%s}", field->u.tag.tag);
+ yaz_log(YLOG_LOG, "parse_data1_tree(): try field {%s}", field->u.tag.tag);
#endif
wrbuf_rewind(buf);
wrbuf_puts(buf, "");
-/* $Id: perlread.c,v 1.8.2.4 2006-08-14 10:39:16 adam Exp $
+/* $Id: perlread.c,v 1.8.2.5 2006-12-05 21:14:44 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
if (!context->origi) {
context->perli = perl_alloc();
PERL_SET_CONTEXT(context->perli);
- logf (LOG_LOG, "Initializing new perl interpreter context (%p)",context->perli);
+ yaz_log(YLOG_LOG, "Initializing new perl interpreter context (%p)",context->perli);
} else {
- logf (LOG_LOG, "Using existing perl interpreter context (%p)",context->origi);
+ yaz_log(YLOG_LOG, "Using existing perl interpreter context (%p)",context->origi);
}
context->perli_ready = 0;
strcpy(context->filterClass, "");
{
struct perl_context *context = (struct perl_context *) clientData;
- logf (LOG_LOG, "Destroying perl interpreter context");
+ yaz_log(YLOG_LOG, "Destroying perl interpreter context");
if (context->perli_ready) {
/*
FREETMPS;
/* parse, and run the init call */
if (context->origi == NULL) {
- logf (LOG_LOG, "Interpreting filter class:%s", filterClass);
+ yaz_log(YLOG_LOG, "Interpreting filter class:%s", filterClass);
arglist[2] = (char *) data1_get_tabpath(p->dh);
sprintf(modarg,"-M%s",filterClass);
the filter object reference may go out of scope... */
if (!sv_isa(context->filterRef, context->filterClass)) {
Filter_create(context);
- logf (LOG_DEBUG,"Filter recreated");
+ yaz_log(YLOG_DEBUG,"Filter recreated");
}
if (!SvTRUE(context->filterRef))
{
- logf (LOG_WARN,"Failed to initialize perl filter %s",context->filterClass);
+ yaz_log(YLOG_WARN,"Failed to initialize perl filter %s",context->filterClass);
return (0);
}
-/* $Id: recgrs.c,v 1.86.2.14 2006-11-03 10:11:37 adam Exp $
+/* $Id: recgrs.c,v 1.86.2.15 2006-12-05 21:14:44 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
if (p->which == XPATH_PREDICATE_RELATION) {
if (p->u.relation.name[0]) {
if (*p->u.relation.name != '@') {
- yaz_log(LOG_WARN,
+ yaz_log(YLOG_WARN,
" Only attributes (@) are supported in xelm xpath predicates");
- yaz_log(LOG_WARN, "predicate %s ignored", p->u.relation.name);
+ yaz_log(YLOG_WARN, "predicate %s ignored", p->u.relation.name);
return (1);
}
attname = p->u.relation.name + 1;
res = 0;
/* looking for the attribute with a specified name */
for (attr = n->u.tag.attributes; attr; attr = attr->next) {
- yaz_log(LOG_DEBUG," - attribute %s <-> %s", attname, attr->name );
+ yaz_log(YLOG_DEBUG," - attribute %s <-> %s", attname, attr->name );
if (!strcmp(attr->name, attname)) {
if (p->u.relation.op[0]) {
if (*p->u.relation.op != '=') {
- yaz_log(LOG_WARN,
+ yaz_log(YLOG_WARN,
"Only '=' relation is supported (%s)",p->u.relation.op);
- yaz_log(LOG_WARN, "predicate %s ignored", p->u.relation.name);
+ yaz_log(YLOG_WARN, "predicate %s ignored", p->u.relation.name);
res = 1; break;
} else {
- yaz_log(LOG_DEBUG," - value %s <-> %s",
+ yaz_log(YLOG_DEBUG," - value %s <-> %s",
p->u.relation.value, attr->value );
if (!strcmp(attr->value, p->u.relation.value)) {
res = 1; break;
}
}
}
- yaz_log(LOG_DEBUG, "return %d", res);
+ yaz_log(YLOG_DEBUG, "return %d", res);
return res;
} else {
return 1;
return (d1_check_xpath_predicate(n, p->u.boolean.left)
|| d1_check_xpath_predicate(n, p->u.boolean.right));
} else {
- yaz_log(LOG_WARN, "Unknown boolean relation %s, ignored",p->u.boolean.op);
+ yaz_log(YLOG_WARN, "Unknown boolean relation %s, ignored",p->u.boolean.op);
return 1;
}
}
sprintf (pexpr, "/%s\n", tagpath);
#if 0
- yaz_log(LOG_DEBUG, "Checking tagpath %s", tagpath);
+ yaz_log(YLOG_DEBUG, "Checking tagpath %s", tagpath);
#endif
for (xpe = abs->xp_elements; xpe; xpe = xpe->next)
backwards trough xpath location steps ... */
for (i=xpe->xpath_len - 1; i>0; i--) {
- yaz_log(LOG_DEBUG,"Checking step %d: %s on tag %s",
+ yaz_log(YLOG_DEBUG,"Checking step %d: %s on tag %s",
i,xp[i].part,nn->u.tag.tag);
if (!d1_check_xpath_predicate(nn, xp[i].predicate)) {
- yaz_log(LOG_DEBUG," Predicates didn't match");
+ yaz_log(YLOG_DEBUG," Predicates didn't match");
ok = 0;
break;
}
xfree(pexpr);
if (xpe) {
- yaz_log(LOG_DEBUG,"Got it");
+ yaz_log(YLOG_DEBUG,"Got it");
return xpe->termlists;
} else {
return NULL;
data1_termlist *tl;
int xpdone = 0;
- yaz_log(LOG_DEBUG, "index_xpath level=%d use=%d", level, use);
+ yaz_log(YLOG_DEBUG, "index_xpath level=%d use=%d", level, use);
if ((!n->root->u.root.absyn) ||
(n->root->u.root.absyn->enable_xpath_indexing)) {
termlist_only = 0;
if (!(eset = data1_getesetbyname(dh, n->u.root.absyn,
c->u.simple->u.generic)))
{
- yaz_log(LOG_LOG, "Unknown esetname '%s'", c->u.simple->u.generic);
+ yaz_log(YLOG_LOG, "Unknown esetname '%s'", c->u.simple->u.generic);
return 25; /* invalid esetname */
}
- yaz_log(LOG_DEBUG, "Esetname '%s' in simple compspec",
+ yaz_log(YLOG_DEBUG, "Esetname '%s' in simple compspec",
c->u.simple->u.generic);
espec = eset->spec;
break;
data1_getesetbyname(dh, n->u.root.absyn,
p->u.elementSetName)))
{
- yaz_log(LOG_LOG, "Unknown esetname '%s'",
+ yaz_log(YLOG_LOG, "Unknown esetname '%s'",
p->u.elementSetName);
return 25; /* invalid esetname */
}
- yaz_log(LOG_DEBUG, "Esetname '%s' in complex compspec",
+ yaz_log(YLOG_DEBUG, "Esetname '%s' in complex compspec",
p->u.elementSetName);
espec = eset->spec;
break;
case Z_ElementSpec_externalSpec:
if (p->u.externalSpec->which == Z_External_espec1)
{
- yaz_log(LOG_DEBUG, "Got Espec-1");
+ yaz_log(YLOG_DEBUG, "Got Espec-1");
espec = p->u.externalSpec-> u.espec1;
}
else
{
- yaz_log(LOG_LOG, "Unknown external espec.");
+ yaz_log(YLOG_LOG, "Unknown external espec.");
return 25; /* bad. what is proper diagnostic? */
}
break;
}
if (espec)
{
- yaz_log(LOG_DEBUG, "Element: Espec-1 match");
+ yaz_log(YLOG_DEBUG, "Element: Espec-1 match");
return data1_doespec1(dh, n, espec);
}
else
{
- yaz_log(LOG_DEBUG, "Element: all match");
+ yaz_log(YLOG_DEBUG, "Element: all match");
return -1;
}
}
gri.mem = mem;
gri.dh = p->dh;
- yaz_log(LOG_DEBUG, "grs_retrieve");
+ yaz_log(YLOG_DEBUG, "grs_retrieve");
if (read_grs_type (h, &gri, p->subType, &node))
{
p->diagnostic = 14;
#endif
top = data1_get_root_tag (p->dh, node);
- yaz_log(LOG_DEBUG, "grs_retrieve: size");
+ yaz_log(YLOG_DEBUG, "grs_retrieve: size");
tagname = data1_systag_lookup(node->u.root.absyn, "size", "size");
if (tagname &&
(dnew = data1_mk_tag_data_wd(p->dh, top, tagname, mem)))
if (tagname && p->score >= 0 &&
(dnew = data1_mk_tag_data_wd(p->dh, top, tagname, mem)))
{
- yaz_log(LOG_DEBUG, "grs_retrieve: %s", tagname);
+ yaz_log(YLOG_DEBUG, "grs_retrieve: %s", tagname);
dnew->u.data.what = DATA1I_num;
dnew->u.data.data = dnew->lbuf;
sprintf(dnew->u.data.data, "%d", p->score);
if (tagname && p->localno > 0 &&
(dnew = data1_mk_tag_data_wd(p->dh, top, tagname, mem)))
{
- yaz_log(LOG_DEBUG, "grs_retrieve: %s", tagname);
+ yaz_log(YLOG_DEBUG, "grs_retrieve: %s", tagname);
dnew->u.data.what = DATA1I_text;
dnew->u.data.data = dnew->lbuf;
*/
if (requested_schema != VAL_NONE)
{
- yaz_log(LOG_DEBUG, "grs_retrieve: schema mapping");
+ yaz_log(YLOG_DEBUG, "grs_retrieve: schema mapping");
for (map = node->u.root.absyn->maptabs; map; map = map->next)
{
if (map->target_absyn_ref == requested_schema)
* the overlap of schema and formatting which is inherent in the MARC
* family)
*/
- yaz_log(LOG_DEBUG, "grs_retrieve: syntax mapping");
+ yaz_log(YLOG_DEBUG, "grs_retrieve: syntax mapping");
if (node->u.root.absyn)
for (map = node->u.root.absyn->maptabs; map; map = map->next)
{
break;
}
}
- yaz_log(LOG_DEBUG, "grs_retrieve: schemaIdentifier");
+ yaz_log(YLOG_DEBUG, "grs_retrieve: schemaIdentifier");
if (node->u.root.absyn &&
node->u.root.absyn->reference != VAL_NONE &&
p->input_format == VAL_GRS1)
}
}
- yaz_log(LOG_DEBUG, "grs_retrieve: element spec");
+ yaz_log(YLOG_DEBUG, "grs_retrieve: element spec");
if (p->comp && (res = process_comp(p->dh, node, p->comp)) > 0)
{
p->diagnostic = res;
#if 0
data1_pr_tree (p->dh, node, stdout);
#endif
- yaz_log(LOG_DEBUG, "grs_retrieve: transfer syntax mapping");
+ yaz_log(YLOG_DEBUG, "grs_retrieve: transfer syntax mapping");
switch (p->output_format = (p->input_format != VAL_NONE ?
p->input_format : VAL_SUTRS))
{
-/* $Id: rectext.c,v 1.18.2.1 2006-08-14 10:39:16 adam Exp $
+/* $Id: rectext.c,v 1.18.2.2 2006-12-05 21:14:44 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
struct buf_info *fi = buf_open (p);
#if 0
- yaz_log(LOG_LOG, "text_extract off=%ld",
+ yaz_log(YLOG_LOG, "text_extract off=%ld",
(long) (*fi->p->tellf)(fi->p->fh));
#endif
xfree(tinfo->sep);
-/* $Id: regxread.c,v 1.50.2.4 2006-10-30 14:14:20 adam Exp $
+/* $Id: regxread.c,v 1.50.2.5 2006-12-05 21:14:44 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
cmd[i] = '\0';
if (i == 0)
{
- logf (LOG_WARN, "bad character %d %c", *cp, *cp);
+ yaz_log(YLOG_WARN, "bad character %d %c", *cp, *cp);
cp++;
while (*cp && *cp != ' ' && *cp != '\t' &&
*cp != '\n' && *cp != '\r')
return REGX_INIT;
else
{
- logf (LOG_WARN, "bad command %s", cmd);
+ yaz_log(YLOG_WARN, "bad command %s", cmd);
return 0;
}
}
int sz = s - s0;
xfree (*ap);
*ap = NULL;
- logf (LOG_WARN, "regular expression error '%.*s'", sz, s0);
+ yaz_log(YLOG_WARN, "regular expression error '%.*s'", sz, s0);
return -1;
}
if (debug_dfa_tran)
s++;
break;
case REGX_BEGIN:
- logf (LOG_WARN, "cannot use BEGIN here");
+ yaz_log(YLOG_WARN, "cannot use BEGIN here");
continue;
case REGX_INIT:
- logf (LOG_WARN, "cannot use INIT here");
+ yaz_log(YLOG_WARN, "cannot use INIT here");
continue;
case REGX_END:
*ap = (struct lexRuleAction *) xmalloc (sizeof(**ap));
tok = readParseToken (&s, &len);
if (tok != REGX_CODE)
{
- logf (LOG_WARN, "missing name after CONTEXT keyword");
+ yaz_log(YLOG_WARN, "missing name after CONTEXT keyword");
return 0;
}
if (len > 31)
break;
case REGX_PATTERN:
#if REGX_DEBUG
- logf (LOG_LOG, "rule %d %s", spec->context->ruleNo, s);
+ yaz_log(YLOG_LOG, "rule %d %s", spec->context->ruleNo, s);
#endif
r = dfa_parse (spec->context->dfa, &s);
if (r)
{
- logf (LOG_WARN, "regular expression error. r=%d", r);
+ yaz_log(YLOG_WARN, "regular expression error. r=%d", r);
return -1;
}
if (*s != '/')
{
- logf (LOG_WARN, "expects / at end of pattern. got %c", *s);
+ yaz_log(YLOG_WARN, "expects / at end of pattern. got %c", *s);
return -1;
}
s++;
}
if (!spec_inf)
{
- logf (LOG_ERRNO|LOG_WARN, "cannot read spec file %s", spec->name);
+ yaz_log(YLOG_ERRNO|YLOG_WARN, "cannot read spec file %s", spec->name);
return -1;
}
- logf (LOG_LOG, "reading regx filter %s", fname);
+ yaz_log(YLOG_LOG, "reading regx filter %s", fname);
#if HAVE_TCL_H
if (spec->tcl_interp)
- logf (LOG_LOG, "Tcl enabled");
+ yaz_log(YLOG_LOG, "Tcl enabled");
#endif
#if 0
return ;
#if REGX_DEBUG
if (elen > 80)
- logf (LOG_LOG, "data(%d bytes) %.40s ... %.*s", elen,
+ yaz_log(YLOG_LOG, "data(%d bytes) %.40s ... %.*s", elen,
ebuf, 40, ebuf + elen-40);
else if (elen == 1 && ebuf[0] == '\n')
{
- logf (LOG_LOG, "data(new line)");
+ yaz_log(YLOG_LOG, "data(new line)");
}
else if (elen > 0)
- logf (LOG_LOG, "data(%d bytes) %.*s", elen, elen, ebuf);
+ yaz_log(YLOG_LOG, "data(%d bytes) %.*s", elen, elen, ebuf);
else
- logf (LOG_LOG, "data(%d bytes)", elen);
+ yaz_log(YLOG_LOG, "data(%d bytes)", elen);
#endif
if (spec->d1_level <= 1)
if (spec->d1_level == 0)
{
- logf (LOG_WARN, "in variant begin. No record type defined");
+ yaz_log(YLOG_WARN, "in variant begin. No record type defined");
return ;
}
if (class_len >= DATA1_MAX_SYMBOL)
ttype[type_len] = '\0';
#if REGX_DEBUG
- logf (LOG_LOG, "variant begin(%s,%s,%d)", tclass, ttype,
+ yaz_log(YLOG_LOG, "variant begin(%s,%s,%d)", tclass, ttype,
spec->d1_level);
#endif
}
#if REGX_DEBUG
- logf (LOG_LOG, "variant node(%d)", spec->d1_level);
+ yaz_log(YLOG_LOG, "variant node(%d)", spec->d1_level);
#endif
parent = spec->d1_stack[spec->d1_level-1];
res = data1_mk_node2 (spec->dh, spec->m, DATA1N_variant, parent);
{
if (spec->d1_level == 0)
{
- logf (LOG_WARN, "in element begin. No record type defined");
+ yaz_log(YLOG_WARN, "in element begin. No record type defined");
return ;
}
tagStrip (&tag, &len);
tagDataRelease (spec);
#if REGX_DEBUG
- logf (LOG_LOG, "begin tag(%.*s, %d)", len, tag, spec->d1_level);
+ yaz_log(YLOG_LOG, "begin tag(%.*s, %d)", len, tag, spec->d1_level);
#endif
spec->d1_stack[spec->d1_level] = data1_mk_tag_n (
break;
}
#if REGX_DEBUG
- logf (LOG_LOG, "end tag(%d)", spec->d1_level);
+ yaz_log(YLOG_LOG, "end tag(%d)", spec->d1_level);
#endif
}
data1_node *res;
#if REGX_DEBUG
- logf (LOG_LOG, "begin record %s", absynName);
+ yaz_log(YLOG_LOG, "begin record %s", absynName);
#endif
res = data1_mk_root (spec->dh, spec->m, absynName);
{
struct lexContext *lc = spec->context;
#if REGX_DEBUG
- logf (LOG_LOG, "begin context %s",argv[2]);
+ yaz_log(YLOG_LOG, "begin context %s",argv[2]);
#endif
while (lc && strcmp (argv[2], lc->name))
lc = lc->next;
spec->context_stack[++(spec->context_stack_top)] = lc;
}
else
- logf (LOG_WARN, "unknown context %s", argv[2]);
+ yaz_log(YLOG_WARN, "unknown context %s", argv[2]);
}
else
return TCL_ERROR;
(spec->d1_level)--;
}
#if REGX_DEBUG
- logf (LOG_LOG, "end record");
+ yaz_log(YLOG_LOG, "end record");
#endif
spec->stop_flag = 1;
}
if (spec->d1_level <= 1)
{
#if REGX_DEBUG
- logf (LOG_LOG, "end element end records");
+ yaz_log(YLOG_LOG, "end element end records");
#endif
spec->stop_flag = 1;
}
else if (!strcmp (argv[1], "context"))
{
#if REGX_DEBUG
- logf (LOG_LOG, "end context");
+ yaz_log(YLOG_LOG, "end context");
#endif
if (spec->context_stack_top)
(spec->context_stack_top)--;
if (ret != TCL_OK)
{
const char *err = Tcl_GetVar(spec->tcl_interp, "errorInfo", 0);
- logf(LOG_FATAL, "Tcl error, line=%d, \"%s\"\n%s",
+ yaz_log(YLOG_FATAL, "Tcl error, line=%d, \"%s\"\n%s",
spec->tcl_interp->errorLine,
spec->tcl_interp->result,
err ? err : "[NO ERRORINFO]");
r = execTok (spec, &s, &cmd_str, &cmd_len);
if (r < 2)
{
- logf (LOG_WARN, "missing keyword after 'begin'");
+ yaz_log(YLOG_WARN, "missing keyword after 'begin'");
continue;
}
p = regxStrz (cmd_str, cmd_len, ptmp);
memcpy (absynName, cmd_str, cmd_len);
absynName[cmd_len] = '\0';
#if REGX_DEBUG
- logf (LOG_LOG, "begin record %s", absynName);
+ yaz_log(YLOG_LOG, "begin record %s", absynName);
#endif
res = data1_mk_root (spec->dh, spec->m, absynName);
r = execTok (spec, &s, &cmd_str, &cmd_len);
p = regxStrz (cmd_str, cmd_len, ptmp);
#if REGX_DEBUG
- logf (LOG_LOG, "begin context %s", p);
+ yaz_log(YLOG_LOG, "begin context %s", p);
#endif
while (lc && strcmp (p, lc->name))
lc = lc->next;
if (lc)
spec->context_stack[++(spec->context_stack_top)] = lc;
else
- logf (LOG_WARN, "unknown context %s", p);
+ yaz_log(YLOG_WARN, "unknown context %s", p);
}
r = execTok (spec, &s, &cmd_str, &cmd_len);
}
else
{
- logf (LOG_WARN, "bad keyword '%s' after begin", p);
+ yaz_log(YLOG_WARN, "bad keyword '%s' after begin", p);
}
}
else if (!strcmp (p, "end"))
r = execTok (spec, &s, &cmd_str, &cmd_len);
if (r < 2)
{
- logf (LOG_WARN, "missing keyword after 'end'");
+ yaz_log(YLOG_WARN, "missing keyword after 'end'");
continue;
}
p = regxStrz (cmd_str, cmd_len, ptmp);
}
r = execTok (spec, &s, &cmd_str, &cmd_len);
#if REGX_DEBUG
- logf (LOG_LOG, "end record");
+ yaz_log(YLOG_LOG, "end record");
#endif
spec->stop_flag = 1;
}
if (spec->d1_level <= 1)
{
#if REGX_DEBUG
- logf (LOG_LOG, "end element end records");
+ yaz_log(YLOG_LOG, "end element end records");
#endif
spec->stop_flag = 1;
}
else if (!strcmp (p, "context"))
{
#if REGX_DEBUG
- logf (LOG_LOG, "end context");
+ yaz_log(YLOG_LOG, "end context");
#endif
if (spec->context_stack_top)
(spec->context_stack_top)--;
r = execTok (spec, &s, &cmd_str, &cmd_len);
}
else
- logf (LOG_WARN, "bad keyword '%s' after end", p);
+ yaz_log(YLOG_WARN, "bad keyword '%s' after end", p);
}
else if (!strcmp (p, "data"))
{
break;
}
else
- logf (LOG_WARN, "bad data option: %.*s",
+ yaz_log(YLOG_WARN, "bad data option: %.*s",
cmd_len, cmd_str);
}
if (r != 2)
{
- logf (LOG_WARN, "missing data item after data");
+ yaz_log(YLOG_WARN, "missing data item after data");
continue;
}
if (element_str)
r = execTok (spec, &s, &cmd_str, &cmd_len);
if (r < 2)
{
- logf (LOG_WARN, "missing number after -offset");
+ yaz_log(YLOG_WARN, "missing number after -offset");
continue;
}
p = regxStrz (cmd_str, cmd_len, ptmp);
offset = 0;
if (r < 2)
{
- logf (LOG_WARN, "missing index after unread command");
+ yaz_log(YLOG_WARN, "missing index after unread command");
continue;
}
if (cmd_len != 1 || *cmd_str < '0' || *cmd_str > '9')
{
- logf (LOG_WARN, "bad index after unread command");
+ yaz_log(YLOG_WARN, "bad index after unread command");
continue;
}
else
if (lc)
spec->context_stack[spec->context_stack_top] = lc;
else
- logf (LOG_WARN, "unknown context %s", p);
+ yaz_log(YLOG_WARN, "unknown context %s", p);
}
r = execTok (spec, &s, &cmd_str, &cmd_len);
}
else
{
- logf (LOG_WARN, "unknown code command '%.*s'", cmd_len, cmd_str);
+ yaz_log(YLOG_WARN, "unknown code command '%.*s'", cmd_len, cmd_str);
r = execTok (spec, &s, &cmd_str, &cmd_len);
continue;
}
if (r > 1)
{
- logf (LOG_WARN, "ignoring token %.*s", cmd_len, cmd_str);
+ yaz_log(YLOG_WARN, "ignoring token %.*s", cmd_len, cmd_str);
do {
r = execTok (spec, &s, &cmd_str, &cmd_len);
} while (r > 1);
arg_no++;
arg_start[arg_no] = F_WIN_EOF;
arg_end[arg_no] = F_WIN_EOF;
- yaz_log(LOG_DEBUG, "Pattern match rest of record");
+ yaz_log(YLOG_DEBUG, "Pattern match rest of record");
*pptr = F_WIN_EOF;
}
else
int ruleNo, int start_ptr, int *pptr)
{
#if REGX_DEBUG
- logf (LOG_LOG, "exec rule %d", ruleNo);
+ yaz_log(YLOG_LOG, "exec rule %d", ruleNo);
#endif
return execAction (spec, context->fastRule[ruleNo]->actionList,
start_ptr, pptr);
if (spec->f_win_ef && *ptr != F_WIN_EOF)
{
#if REGX_DEBUG
- logf (LOG_LOG, "regx: endf ptr=%d", *ptr);
+ yaz_log(YLOG_LOG, "regx: endf ptr=%d", *ptr);
#endif
(*spec->f_win_ef)(spec->f_win_fh, *ptr);
}
}
if (!lt)
{
- logf (LOG_WARN, "cannot find context %s", context_name);
+ yaz_log(YLOG_WARN, "cannot find context %s", context_name);
return NULL;
}
spec->context_stack[spec->context_stack_top] = lt;
struct lexSpec **curLexSpec = &specs->spec;
#if REGX_DEBUG
- logf (LOG_LOG, "grs_read_regx");
+ yaz_log(YLOG_LOG, "grs_read_regx");
#endif
if (!*curLexSpec || strcmp ((*curLexSpec)->name, p->type))
{
struct lexSpec **curLexSpec = &specs->spec;
#if REGX_DEBUG
- logf (LOG_LOG, "grs_read_tcl");
+ yaz_log(YLOG_LOG, "grs_read_tcl");
#endif
if (!*curLexSpec || strcmp ((*curLexSpec)->name, p->type))
{
-/* $Id: xmlread.c,v 1.12.2.2 2006-08-14 10:39:17 adam Exp $
+/* $Id: xmlread.c,v 1.12.2.3 2006-12-05 21:14:44 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
data1_mk_preprocess (ui->dh, ui->nmem, "xml", attr_list,
ui->d1_stack[ui->level-1]);
#if 0
- yaz_log (LOG_LOG, "decl version=%s encoding=%s",
+ yaz_log(YLOG_LOG, "decl version=%s encoding=%s",
version ? version : "null",
encoding ? encoding : "null");
#endif
if (!(inf = fopen (systemId, "rb")))
{
- yaz_log (LOG_WARN|LOG_ERRNO, "fopen %s", systemId);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "fopen %s", systemId);
return 0;
}
void *buf = XML_GetBuffer (parser, XML_CHUNK);
if (!buf)
{
- yaz_log (LOG_WARN, "XML_GetBuffer fail");
+ yaz_log(YLOG_WARN, "XML_GetBuffer fail");
break;
}
r = fread (buf, 1, XML_CHUNK, inf);
{
if (ferror(inf))
{
- yaz_log (LOG_WARN|LOG_ERRNO, "fread %s", systemId);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "fread %s", systemId);
break;
}
done = 1;
if (!XML_ParseBuffer (parser, r, done))
{
done = 1;
- yaz_log (LOG_WARN, "%s:%d:%d:XML error: %s",
+ yaz_log(YLOG_WARN, "%s:%d:%d:XML error: %s",
systemId,
XML_GetCurrentLineNumber(parser),
XML_GetCurrentColumnNumber(parser),
unsigned short code;
#if 1
- yaz_log(LOG_LOG, "------------------------- cb_encoding_convert --- ");
+ yaz_log(YLOG_LOG, "------------------------- cb_encoding_convert --- ");
#endif
ret = iconv (t, &inbuf, &inleft, &outbuf, &outleft);
if (ret == (size_t) (-1) && errno != E2BIG)
{
info->map[i] = -1; /* no room for output */
if (i != 0)
- yaz_log (LOG_WARN, "Encoding %d: no room for output",
+ yaz_log(YLOG_WARN, "Encoding %d: no room for output",
i);
}
}
else
{ /* should never happen */
info->map[i] = -1;
- yaz_log (LOG_DEBUG, "Encoding %d: bad state", i);
+ yaz_log(YLOG_DEBUG, "Encoding %d: bad state", i);
}
}
if (info->data)
int done = 0;
data1_node *first_node;
- uinfo.loglevel = LOG_DEBUG;
+ uinfo.loglevel = YLOG_DEBUG;
uinfo.level = 1;
uinfo.dh = dh;
uinfo.nmem = m;
if (!buf)
{
/* error */
- yaz_log (LOG_WARN, "XML_GetBuffer fail");
+ yaz_log(YLOG_WARN, "XML_GetBuffer fail");
break;
}
r = (*rf)(fh, buf, XML_CHUNK);
if (r < 0)
{
/* error */
- yaz_log (LOG_WARN, "XML read fail");
+ yaz_log(YLOG_WARN, "XML read fail");
break;
}
else if (r == 0)
if (!XML_ParseBuffer (parser, r, done))
{
done = 1;
- yaz_log (LOG_WARN, "%d:%d:XML error: %s",
+ yaz_log(YLOG_WARN, "%d:%d:XML error: %s",
XML_GetCurrentLineNumber(parser),
XML_GetCurrentColumnNumber(parser),
XML_ErrorString(XML_GetErrorCode(parser)));
-/* $Id: rsbetween.c,v 1.15.2.5 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsbetween.c,v 1.15.2.6 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
char buf_l[32];
char buf_m[32];
char buf_r[32];
- logf(LOG_DEBUG,"btw: %s l=%s(%d/%d) m=%s(%d) r=%s(%d/%d), lev=%d",
+ yaz_log(YLOG_DEBUG,"btw: %s l=%s(%d/%d) m=%s(%d) r=%s(%d/%d), lev=%d",
msg,
(*p->info->printer)(p->buf_l, buf_l), p->more_l, cmp_l,
(*p->info->printer)(p->buf_m, buf_m), p->more_m,
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "between set type is read-only");
+ yaz_log(YLOG_FATAL, "between set type is read-only");
return NULL;
}
rfd = (struct rset_between_rfd *) xmalloc (sizeof(*rfd));
xfree (rfd);
return;
}
- logf (LOG_FATAL, "r_close_between but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close_between but no rfd match!");
assert (0);
}
struct rset_between_rfd *p = (struct rset_between_rfd *) rfd;
#if RSBETWEEN_DEBUG
- logf (LOG_DEBUG, "rsbetween_rewind");
+ yaz_log(YLOG_DEBUG, "rsbetween_rewind");
#endif
rset_rewind (info->rset_l, p->rfd_l);
rset_rewind (info->rset_m, p->rfd_m);
static int r_write_between (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "between set type is read-only");
+ yaz_log(YLOG_FATAL, "between set type is read-only");
return -1;
}
-/* $Id: rsbool.c,v 1.32.2.2 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsbool.c,v 1.32.2.3 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "bool set type is read-only");
+ yaz_log(YLOG_FATAL, "bool set type is read-only");
return NULL;
}
rfd = (struct rset_bool_rfd *) xmalloc (sizeof(*rfd));
- logf(LOG_DEBUG,"rsbool (%s) open [%p]", ct->control->desc, rfd);
+ yaz_log(YLOG_DEBUG,"rsbool (%s) open [%p]", ct->control->desc, rfd);
rfd->next = info->rfd_list;
info->rfd_list = rfd;
rfd->info = info;
xfree (rfd);
return;
}
- logf (LOG_FATAL, "r_close but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close but no rfd match!");
assert (0);
}
struct rset_bool_info *info = ((struct rset_bool_rfd*)rfd)->info;
struct rset_bool_rfd *p = (struct rset_bool_rfd *) rfd;
- logf (LOG_DEBUG, "rsbool_rewind");
+ yaz_log(YLOG_DEBUG, "rsbool_rewind");
rset_rewind (info->rset_l, p->rfd_l);
rset_rewind (info->rset_r, p->rfd_r);
p->more_l = rset_read (info->rset_l, p->rfd_l, p->buf_l, &p->term_index_l);
int rc;
#if RSET_DEBUG
- logf (LOG_DEBUG, "rsbool_forward (L) [%p] '%s' (ct=%p rfd=%p m=%d,%d)",
+ yaz_log(YLOG_DEBUG, "rsbool_forward (L) [%p] '%s' (ct=%p rfd=%p m=%d,%d)",
rfd, ct->control->desc, ct, rfd, p->more_l, p->more_r);
#endif
if ( p->more_l && ((cmpfunc)(untilbuf,p->buf_l)==2) )
p->more_l = rset_forward(info->rset_l, p->rfd_l, p->buf_l,
&p->term_index_l, info->cmp, untilbuf);
#if RSET_DEBUG
- logf (LOG_DEBUG, "rsbool_forward (R) [%p] '%s' (ct=%p rfd=%p m=%d,%d)",
+ yaz_log(YLOG_DEBUG, "rsbool_forward (R) [%p] '%s' (ct=%p rfd=%p m=%d,%d)",
rfd, ct->control->desc, ct, rfd, p->more_l, p->more_r);
#endif
if ( p->more_r && ((cmpfunc)(untilbuf,p->buf_r)==2))
p->more_r = rset_forward(info->rset_r, p->rfd_r, p->buf_r,
&p->term_index_r, info->cmp, untilbuf);
#if RSET_DEBUG
- logf (LOG_DEBUG, "rsbool_forward [%p] calling read, m=%d,%d t=%d",
+ yaz_log(YLOG_DEBUG, "rsbool_forward [%p] calling read, m=%d,%d t=%d",
rfd, p->more_l, p->more_r, p->tail);
#endif
p->tail=0;
rc = rset_read(ct,rfd,buf,term_index);
#if RSET_DEBUG
- logf (LOG_DEBUG, "rsbool_forward returning [%p] %d m=%d,%d",
+ yaz_log(YLOG_DEBUG, "rsbool_forward returning [%p] %d m=%d,%d",
rfd, rc, p->more_l, p->more_r);
#endif
return rc;
else
cmp = 2;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] looping: m=%d/%d c=%d t=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] looping: m=%d/%d c=%d t=%d",
rfd, p->more_l, p->more_r, cmp, p->tail);
- (*info->log_item)(LOG_DEBUG, p->buf_l, "left ");
- (*info->log_item)(LOG_DEBUG, p->buf_r, "right ");
+ (*info->log_item)(YLOG_DEBUG, p->buf_l, "left ");
+ (*info->log_item)(YLOG_DEBUG, p->buf_r, "right ");
#endif
if (!cmp)
{
&p->term_index_r);
p->tail = 1;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] returning R m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] returning R m=%d/%d c=%d",
rfd, p->more_l, p->more_r, cmp);
- key_logdump(LOG_DEBUG,buf);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ key_logdump(YLOG_DEBUG,buf);
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
&p->term_index_l);
p->tail = 1;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] returning L m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] returning L m=%d/%d c=%d",
rfd, p->more_l, p->more_r, cmp);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
if (!p->more_r || (*info->cmp)(p->buf_r, buf) > 1)
p->tail = 0;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and returning C m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and returning C m=%d/%d c=%d",
p->more_l, p->more_r, cmp);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
if (!p->more_l || (*info->cmp)(p->buf_l, buf) > 1)
p->tail = 0;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] returning R tail m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] returning R tail m=%d/%d c=%d",
rfd, p->more_l, p->more_r, cmp);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
}
}
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] reached its end",rfd);
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] reached its end",rfd);
#endif
return 0;
}
else
cmp = 2;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] looping: m=%d/%d c=%d t=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] looping: m=%d/%d c=%d t=%d",
rfd, p->more_l, p->more_r, cmp, p->tail);
- (*info->log_item)(LOG_DEBUG, p->buf_l, "left ");
- (*info->log_item)(LOG_DEBUG, p->buf_r, "right ");
+ (*info->log_item)(YLOG_DEBUG, p->buf_l, "left ");
+ (*info->log_item)(YLOG_DEBUG, p->buf_r, "right ");
#endif
if (!cmp)
{
&p->term_index_r);
p->tail = 1;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] returning R m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] returning R m=%d/%d c=%d",
rfd, p->more_l, p->more_r, cmp);
- key_logdump(LOG_DEBUG,buf);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ key_logdump(YLOG_DEBUG,buf);
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
&p->term_index_l);
p->tail = 1;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] returning L m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] returning L m=%d/%d c=%d",
rfd, p->more_l, p->more_r, cmp);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
if (!p->more_r || (*info->cmp)(p->buf_r, buf) > 1)
p->tail = 0;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] returning R tail m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] returning R tail m=%d/%d c=%d",
rfd, p->more_l, p->more_r, cmp);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
else
{
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] about to forward R m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] about to forward R m=%d/%d c=%d",
rfd, p->more_l, p->more_r, cmp);
#endif
if (p->more_r && p->more_l)
if (!p->more_l || (*info->cmp)(p->buf_l, buf) > 1)
p->tail = 0;
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] returning L tail m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] returning L tail m=%d/%d c=%d",
rfd, p->more_l, p->more_r, cmp);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
else
{
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] about to forward L m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] about to forward L m=%d/%d c=%d",
rfd, p->more_l, p->more_r, cmp);
#endif
if (p->more_r && p->more_l)
}
}
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_and [%p] reached its end",rfd);
+ yaz_log(YLOG_DEBUG, "r_read_and [%p] reached its end",rfd);
#endif
return 0;
}
p->more_r = rset_read (info->rset_r, p->rfd_r, p->buf_r,
&p->term_index_r);
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_or returning A m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_or returning A m=%d/%d c=%d",
p->more_l, p->more_r, cmp);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
p->more_r = rset_read (info->rset_r, p->rfd_r, p->buf_r,
&p->term_index_r);
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_or returning B m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_or returning B m=%d/%d c=%d",
p->more_l, p->more_r, cmp);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
p->more_l = rset_read (info->rset_l, p->rfd_l, p->buf_l,
&p->term_index_l);
#if RSET_DEBUG
- logf (LOG_DEBUG, "r_read_or returning C m=%d/%d c=%d",
+ yaz_log(YLOG_DEBUG, "r_read_or returning C m=%d/%d c=%d",
p->more_l, p->more_r, cmp);
- (*info->log_item)(LOG_DEBUG, buf, "");
+ (*info->log_item)(YLOG_DEBUG, buf, "");
#endif
return 1;
}
static int r_write (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "bool set type is read-only");
+ yaz_log(YLOG_FATAL, "bool set type is read-only");
return -1;
}
-/* $Id: rset.c,v 1.21.2.1 2006-08-14 10:39:20 adam Exp $
+/* $Id: rset.c,v 1.21.2.2 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
RSET rnew;
int i;
- logf (LOG_DEBUG, "rs_create(%s)", sel->desc);
+ yaz_log(YLOG_DEBUG, "rs_create(%s)", sel->desc);
rnew = (RSET) xmalloc(sizeof(*rnew));
rnew->control = sel;
rnew->flags = 0;
rnew->rset_terms = NULL;
rnew->no_rset_terms = 0;
rnew->buf = (*sel->f_create)(rnew, sel, parms);
- logf (LOG_DEBUG, "no_rset_terms: %d", rnew->no_rset_terms);
+ yaz_log(YLOG_DEBUG, "no_rset_terms: %d", rnew->no_rset_terms);
for (i = 0; i<rnew->no_rset_terms; i++)
- logf (LOG_DEBUG, " %s", rnew->rset_terms[i]->name);
+ yaz_log(YLOG_DEBUG, " %s", rnew->rset_terms[i]->name);
return rnew;
}
{
int more=1;
int cmp=2;
- logf (LOG_DEBUG, "rset_default_forward starting '%s' (ct=%p rfd=%p)",
+ yaz_log(YLOG_DEBUG, "rset_default_forward starting '%s' (ct=%p rfd=%p)",
ct->control->desc, ct,rfd);
- key_logdump(LOG_DEBUG, untilbuf);
+ key_logdump(YLOG_DEBUG, untilbuf);
while ( (cmp==2) && (more))
{
- logf (LOG_DEBUG, "rset_default_forward looping m=%d c=%d",more,cmp);
+ yaz_log(YLOG_DEBUG, "rset_default_forward looping m=%d c=%d",more,cmp);
more=rset_read(ct, rfd, buf, term_index);
if (more)
cmp=(*cmpfunc)(untilbuf,buf);
if (more)
- key_logdump(LOG_DEBUG,buf);
+ key_logdump(YLOG_DEBUG,buf);
}
- logf (LOG_DEBUG, "rset_default_forward exiting m=%d c=%d",more,cmp);
+ yaz_log(YLOG_DEBUG, "rset_default_forward exiting m=%d c=%d",more,cmp);
return more;
}
-/* $Id: rsisam.c,v 1.26.2.1 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsisam.c,v 1.26.2.2 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
struct rset_isam_info *info = (struct rset_isam_info *) ct->buf;
struct rset_ispt_info *ptinfo;
- logf (LOG_DEBUG, "risam_open");
+ yaz_log(YLOG_DEBUG, "risam_open");
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "ISAM set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAM set type is read-only");
return NULL;
}
ptinfo = (struct rset_ispt_info *) xmalloc (sizeof(*ptinfo));
xfree (rfd);
return;
}
- logf (LOG_FATAL, "r_close but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close but no rfd match!");
assert (0);
}
{
struct rset_isam_info *info = (struct rset_isam_info *) ct->buf;
- logf (LOG_DEBUG, "rsisam_delete");
+ yaz_log(YLOG_DEBUG, "rsisam_delete");
assert (info->ispt_list == NULL);
rset_term_destroy (ct->rset_terms[0]);
xfree (ct->rset_terms);
static void r_rewind (RSFD rfd)
{
- logf (LOG_DEBUG, "rsisam_rewind");
+ yaz_log(YLOG_DEBUG, "rsisam_rewind");
is_rewind( ((struct rset_ispt_info*) rfd)->pt);
}
static int r_write (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "ISAM set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAM set type is read-only");
return -1;
}
-/* $Id: rsisamb.c,v 1.10.2.3 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsisamb.c,v 1.10.2.4 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995-2005
Index Data Aps
struct rset_isamb_info *info = (struct rset_isamb_info *) ct->buf;
struct rset_pp_info *ptinfo;
- logf (LOG_DEBUG, "risamb_open");
+ yaz_log(YLOG_DEBUG, "risamb_open");
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "ISAMB set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAMB set type is read-only");
return NULL;
}
ptinfo = (struct rset_pp_info *) xmalloc (sizeof(*ptinfo));
xfree (rfd);
return;
}
- logf (LOG_FATAL, "r_close but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close but no rfd match!");
assert (0);
}
{
struct rset_isamb_info *info = (struct rset_isamb_info *) ct->buf;
- logf (LOG_DEBUG, "rsisamb_delete");
+ yaz_log(YLOG_DEBUG, "rsisamb_delete");
assert (info->ispt_list == NULL);
rset_term_destroy (ct->rset_terms[0]);
xfree (ct->rset_terms);
static void r_rewind (RSFD rfd)
{
- logf (LOG_DEBUG, "rsisamb_rewind");
+ yaz_log(YLOG_DEBUG, "rsisamb_rewind");
abort ();
}
int i;
struct rset_pp_info *pinfo = (struct rset_pp_info *) rfd;
#if RSET_DEBUG
- logf (LOG_DEBUG, "rset_rsisamb_forward starting '%s' (ct=%p rfd=%p)",
+ yaz_log(YLOG_DEBUG, "rset_rsisamb_forward starting '%s' (ct=%p rfd=%p)",
ct->control->desc, ct,rfd);
- key_logdump(LOG_DEBUG, untilbuf);
- key_logdump(LOG_DEBUG, buf);
+ key_logdump(YLOG_DEBUG, untilbuf);
+ key_logdump(YLOG_DEBUG, buf);
#endif
i=isamb_pp_forward(pinfo->pt, buf, untilbuf);
#if RSET_DEBUG
- logf (LOG_DEBUG, "rset_rsisamb_forward returning %d",i);
+ yaz_log(YLOG_DEBUG, "rset_rsisamb_forward returning %d",i);
#endif
return i;
}
static int r_write (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "ISAMB set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAMB set type is read-only");
return -1;
}
-/* $Id: rsisamc.c,v 1.16.2.1 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsisamc.c,v 1.16.2.2 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
struct rset_isamc_info *info = (struct rset_isamc_info *) ct->buf;
struct rset_pp_info *ptinfo;
- logf (LOG_DEBUG, "risamc_open");
+ yaz_log(YLOG_DEBUG, "risamc_open");
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "ISAMC set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAMC set type is read-only");
return NULL;
}
ptinfo = (struct rset_pp_info *) xmalloc (sizeof(*ptinfo));
xfree (rfd);
return;
}
- logf (LOG_FATAL, "r_close but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close but no rfd match!");
assert (0);
}
{
struct rset_isamc_info *info = (struct rset_isamc_info *) ct->buf;
- logf (LOG_DEBUG, "rsisamc_delete");
+ yaz_log(YLOG_DEBUG, "rsisamc_delete");
assert (info->ispt_list == NULL);
rset_term_destroy (ct->rset_terms[0]);
xfree (ct->rset_terms);
static void r_rewind (RSFD rfd)
{
- logf (LOG_DEBUG, "rsisamc_rewind");
+ yaz_log(YLOG_DEBUG, "rsisamc_rewind");
abort ();
}
static int r_write (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "ISAMC set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAMC set type is read-only");
return -1;
}
-/* $Id: rsisamd.c,v 1.8.2.1 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsisamd.c,v 1.8.2.2 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
struct rset_isamd_info *info = (struct rset_isamd_info *) ct->buf;
struct rset_pp_info *ptinfo;
- logf (LOG_DEBUG, "risamd_open");
+ yaz_log(YLOG_DEBUG, "risamd_open");
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "ISAMD set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAMD set type is read-only");
return NULL;
}
ptinfo = (struct rset_pp_info *) xmalloc (sizeof(*ptinfo));
xfree (rfd);
return;
}
- logf (LOG_FATAL, "r_close but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close but no rfd match!");
assert (0);
}
{
struct rset_isamd_info *info = (struct rset_isamd_info *) ct->buf;
- logf (LOG_DEBUG, "rsisamd_delete");
+ yaz_log(YLOG_DEBUG, "rsisamd_delete");
assert (info->ispt_list == NULL);
rset_term_destroy (ct->rset_terms[0]);
xfree (ct->rset_terms);
static void r_rewind (RSFD rfd)
{
- logf (LOG_DEBUG, "rsisamd_rewind");
+ yaz_log(YLOG_DEBUG, "rsisamd_rewind");
abort ();
}
static int r_write (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "ISAMD set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAMD set type is read-only");
return -1;
}
-/* $Id: rsisams.c,v 1.6.2.1 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsisams.c,v 1.6.2.2 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
struct rset_isams_info *info = (struct rset_isams_info *) ct->buf;
struct rset_pp_info *ptinfo;
- logf (LOG_DEBUG, "risams_open");
+ yaz_log(YLOG_DEBUG, "risams_open");
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "ISAMS set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAMS set type is read-only");
return NULL;
}
ptinfo = (struct rset_pp_info *) xmalloc (sizeof(*ptinfo));
xfree (rfd);
return;
}
- logf (LOG_FATAL, "r_close but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close but no rfd match!");
assert (0);
}
{
struct rset_isams_info *info = (struct rset_isams_info *) ct->buf;
- logf (LOG_DEBUG, "rsisams_delete");
+ yaz_log(YLOG_DEBUG, "rsisams_delete");
assert (info->ispt_list == NULL);
rset_term_destroy (ct->rset_terms[0]);
xfree (ct->rset_terms);
static void r_rewind (RSFD rfd)
{
- logf (LOG_DEBUG, "rsisams_rewind");
+ yaz_log(YLOG_DEBUG, "rsisams_rewind");
abort ();
}
static int r_write (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "ISAMS set type is read-only");
+ yaz_log(YLOG_FATAL, "ISAMS set type is read-only");
return -1;
}
-/* $Id: rsm_or.c,v 1.16.2.1 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsm_or.c,v 1.16.2.2 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "m_or set type is read-only");
+ yaz_log(YLOG_FATAL, "m_or set type is read-only");
return NULL;
}
rfd = (struct rset_mor_rfd *) xmalloc (sizeof(*rfd));
xfree (rfd);
return;
}
- logf (LOG_FATAL, "r_close but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close but no rfd match!");
assert (0);
}
static int r_write (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "mor set type is read-only");
+ yaz_log(YLOG_FATAL, "mor set type is read-only");
return -1;
}
-/* $Id: rsnull.c,v 1.18.2.1 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsnull.c,v 1.18.2.2 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
{
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "NULL set type is read-only");
+ yaz_log(YLOG_FATAL, "NULL set type is read-only");
return NULL;
}
return "";
static void r_rewind (RSFD rfd)
{
- logf (LOG_DEBUG, "rsnull_rewind");
+ yaz_log(YLOG_DEBUG, "rsnull_rewind");
}
static void r_pos (RSFD rfd, int *current, int *total)
static int r_write (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "NULL set type is read-only");
+ yaz_log(YLOG_FATAL, "NULL set type is read-only");
return -1;
}
-/* $Id: rsprox.c,v 1.5.2.2 2006-08-14 10:39:20 adam Exp $
+/* $Id: rsprox.c,v 1.5.2.3 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
if (flag & RSETF_WRITE)
{
- logf (LOG_FATAL, "prox set type is read-only");
+ yaz_log(YLOG_FATAL, "prox set type is read-only");
return NULL;
}
rfd = (struct rset_prox_rfd *) xmalloc (sizeof(*rfd));
- logf(LOG_DEBUG,"rsprox (%s) open [%p]", ct->control->desc, rfd);
+ yaz_log(YLOG_DEBUG,"rsprox (%s) open [%p]", ct->control->desc, rfd);
rfd->next = info->rfd_list;
info->rfd_list = rfd;
rfd->info = info;
xfree (rfd);
return;
}
- logf (LOG_FATAL, "r_close but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close but no rfd match!");
assert (0);
}
struct rset_prox_rfd *p = (struct rset_prox_rfd *) rfd;
int dummy, i;
- logf (LOG_DEBUG, "rsprox_rewind");
+ yaz_log(YLOG_DEBUG, "rsprox_rewind");
for (i = 0; i < info->p.rset_no; i++)
{
static int r_write (RSFD rfd, const void *buf)
{
- logf (LOG_FATAL, "prox set type is read-only");
+ yaz_log(YLOG_FATAL, "prox set type is read-only");
return -1;
}
-/* $Id: rstemp.c,v 1.38.2.1 2006-08-14 10:39:20 adam Exp $
+/* $Id: rstemp.c,v 1.38.2.2 2006-12-05 21:14:45 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
Index Data Aps
info->fd = open (info->fname, O_BINARY|O_RDONLY);
if (info->fd == -1)
{
- logf (LOG_FATAL|LOG_ERRNO, "open %s", info->fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "open %s", info->fname);
exit (1);
}
}
if (info->fd == -1)
{
- logf (LOG_FATAL|LOG_ERRNO, "mkstemp %s", template);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "mkstemp %s", template);
exit (1);
}
info->fname = (char *) xmalloc (strlen(template)+1);
info->fname = (char *) xmalloc (strlen(s)+1);
strcpy (info->fname, s);
- logf (LOG_DEBUG, "creating tempfile %s", info->fname);
+ yaz_log(YLOG_DEBUG, "creating tempfile %s", info->fname);
info->fd = open (info->fname, O_BINARY|O_RDWR|O_CREAT, 0666);
if (info->fd == -1)
{
- logf (LOG_FATAL|LOG_ERRNO, "open %s", info->fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "open %s", info->fname);
exit (1);
}
#endif
if (lseek (info->fd, info->pos_buf, SEEK_SET) == -1)
{
- logf (LOG_FATAL|LOG_ERRNO, "lseek %s", info->fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "lseek %s", info->fname);
exit (1);
}
count = info->buf_size;
if ((r = write (info->fd, info->buf_mem, count)) < (int) count)
{
if (r == -1)
- logf (LOG_FATAL|LOG_ERRNO, "read %s", info->fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "read %s", info->fname);
else
- logf (LOG_FATAL, "write of %ld but got %ld",
+ yaz_log(YLOG_FATAL, "write of %ld but got %ld",
(long) count, (long) r);
exit (1);
}
}
return;
}
- logf (LOG_FATAL, "r_close but no rfd match!");
+ yaz_log(YLOG_FATAL, "r_close but no rfd match!");
assert (0);
}
if (info->fname)
unlink (info->fname);
xfree (info->buf_mem);
- logf (LOG_DEBUG, "r_delete: set size %ld", (long) info->pos_end);
+ yaz_log(YLOG_DEBUG, "r_delete: set size %ld", (long) info->pos_end);
if (info->fname)
{
- logf (LOG_DEBUG, "r_delete: unlink %s", info->fname);
+ yaz_log(YLOG_DEBUG, "r_delete: unlink %s", info->fname);
unlink (info->fname);
xfree (info->fname);
}
{
if (lseek (info->fd, info->pos_buf, SEEK_SET) == -1)
{
- logf (LOG_FATAL|LOG_ERRNO, "lseek %s", info->fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "lseek %s", info->fname);
exit (1);
}
if ((r = read (info->fd, info->buf_mem, count)) < (int) count)
{
if (r == -1)
- logf (LOG_FATAL|LOG_ERRNO, "read %s", info->fname);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "read %s", info->fname);
else
- logf (LOG_FATAL, "read of %ld but got %ld",
+ yaz_log(YLOG_FATAL, "read of %ld but got %ld",
(long) count, (long) r);
exit (1);
}
-/* $Id: t2.c,v 1.11.2.1 2006-08-14 10:39:23 adam Exp $
+/* $Id: t2.c,v 1.11.2.2 2006-12-05 21:14:46 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
zebra_search_PQF (zh, "@attr 1=4 my", "set1", &hits);
if (hits != 1)
{
- yaz_log(LOG_FATAL, "Expected 1 hit. Got %d", hits);
+ yaz_log(YLOG_FATAL, "Expected 1 hit. Got %d", hits);
exit_code = 1;
}
-/* $Id: t5.c,v 1.4.2.2 2006-08-14 10:39:23 adam Exp $
+/* $Id: t5.c,v 1.4.2.3 2006-12-05 21:14:46 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
int hits;
if (zebra_search_PQF (zh, pqf, "set1", &hits) != 0)
{
- yaz_log(LOG_FATAL, "Search %s: failed", pqf);
+ yaz_log(YLOG_FATAL, "Search %s: failed", pqf);
*exit_code = 1;
}
else if (hits != hits_expect)
{
- yaz_log(LOG_FATAL, "Search %s: Expected %d, got %d", pqf,
+ yaz_log(YLOG_FATAL, "Search %s: Expected %d, got %d", pqf,
hits_expect, hits);
*exit_code = 2;
}
-/* $Id: charmap.c,v 1.29.2.7 2006-08-14 10:39:24 adam Exp $
+/* $Id: charmap.c,v 1.29.2.8 2006-12-05 21:14:46 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
root->target && root->target[0] && root->target[0][0] &&
strcmp ((const char *)root->target[0], CHR_UNKNOWN))
{
- yaz_log (LOG_WARN, "duplicate entry for charmap from '%s'",
+ yaz_log(YLOG_WARN, "duplicate entry for charmap from '%s'",
from_0);
}
root->target = (unsigned char **)
unsigned char c;
unsigned int i = 0;
- yaz_log (LOG_DEBUG, "prim %.3s", *s);
+ yaz_log(YLOG_DEBUG, "prim %.3s", *s);
if (**s == '\\')
{
(*s)++;
ucs4_t i = 0;
char fmtstr[8];
- yaz_log (LOG_DEBUG, "prim_w %.3s", (char *) *s);
+ yaz_log(YLOG_DEBUG, "prim_w %.3s", (char *) *s);
if (**s == '\\')
{
(*s)++;
c = **s;
++(*s);
}
- yaz_log (LOG_DEBUG, "out %d", c);
+ yaz_log(YLOG_DEBUG, "out %d", c);
return c;
}
res = chr_map_input(arg->map, &s, strlen(s), 0);
if (*res == (char*) CHR_UNKNOWN)
- yaz_log(LOG_WARN, "Map: '%s' has no mapping", p);
+ yaz_log(YLOG_WARN, "Map: '%s' has no mapping", p);
strncat(arg->string, *res, CHR_MAXSTR - strlen(arg->string));
arg->string[CHR_MAXSTR] = '\0';
}
chrwork *arg = (chrwork *) data;
assert(arg->map->input);
- yaz_log (LOG_DEBUG, "set map %.*s", (int) strlen(s), s);
+ yaz_log(YLOG_DEBUG, "set map %.*s", (int) strlen(s), s);
set_map_string(arg->map->input, arg->map->nmem, s, strlen(s), arg->string,
0);
for (s = arg->string; *s; s++)
- yaz_log (LOG_DEBUG, " %3d", (unsigned char) *s);
+ yaz_log(YLOG_DEBUG, " %3d", (unsigned char) *s);
}
static int scan_to_utf8 (yaz_iconv_t t, ucs4_t *from, size_t inlen,
ret = yaz_iconv (t, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
if (ret == (size_t) (-1))
{
- yaz_log(LOG_LOG, "from: %2X %2X %2X %2X",
+ yaz_log(YLOG_LOG, "from: %2X %2X %2X %2X",
from[0], from[1], from[2], from[3]);
- yaz_log (LOG_WARN|LOG_ERRNO, "bad unicode sequence");
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "bad unicode sequence");
return -1;
}
}
begin = zebra_prim_w(&s);
if (*s != '-')
{
- yaz_log(LOG_FATAL, "Bad range in char-map");
+ yaz_log(YLOG_FATAL, "Bad range in char-map");
return -1;
}
s++;
end = zebra_prim_w(&s);
if (end <= begin)
{
- yaz_log(LOG_FATAL, "Bad range in char-map");
+ yaz_log(YLOG_FATAL, "Bad range in char-map");
return -1;
}
s++;
t_utf8 = yaz_iconv_open ("UTF-8", ucs4_native);
- yaz_log (LOG_DEBUG, "maptab %s open", name);
+ yaz_log(YLOG_DEBUG, "maptab %s open", name);
if (!(f = yaz_fopen(tabpath, name, "r", tabroot)))
{
- yaz_log(LOG_WARN|LOG_ERRNO, "%s", name);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "%s", name);
return 0;
}
nmem = nmem_create ();
{
if (argc != 2)
{
- yaz_log(LOG_FATAL, "Syntax error in charmap");
+ yaz_log(YLOG_FATAL, "Syntax error in charmap");
++errors;
}
if (scan_string(argv[1], t_unicode, t_utf8, fun_addentry,
res, &num) < 0)
{
- yaz_log(LOG_FATAL, "Bad value-set specification");
+ yaz_log(YLOG_FATAL, "Bad value-set specification");
++errors;
}
res->base_uppercase = num;
{
if (!res->base_uppercase)
{
- yaz_log(LOG_FATAL, "Uppercase directive with no lowercase set");
+ yaz_log(YLOG_FATAL, "Uppercase directive with no lowercase set");
++errors;
}
if (argc != 2)
{
- yaz_log(LOG_FATAL, "Missing arg for uppercase directive");
+ yaz_log(YLOG_FATAL, "Missing arg for uppercase directive");
++errors;
}
if (scan_string(argv[1], t_unicode, t_utf8, fun_addentry,
res, &num) < 0)
{
- yaz_log(LOG_FATAL, "Bad value-set specification");
+ yaz_log(YLOG_FATAL, "Bad value-set specification");
++errors;
}
}
{
if (argc != 2)
{
- yaz_log(LOG_FATAL, "Syntax error in charmap for space");
+ yaz_log(YLOG_FATAL, "Syntax error in charmap for space");
++errors;
}
if (scan_string(argv[1], t_unicode, t_utf8,
fun_addspace, res, 0) < 0)
{
- yaz_log(LOG_FATAL, "Bad space specification");
+ yaz_log(YLOG_FATAL, "Bad space specification");
++errors;
}
}
{
if (argc != 2)
{
- yaz_log(LOG_FATAL, "Syntax error in charmap for cut");
+ yaz_log(YLOG_FATAL, "Syntax error in charmap for cut");
++errors;
}
if (scan_string(argv[1], t_unicode, t_utf8,
fun_addcut, res, 0) < 0)
{
- yaz_log(LOG_FATAL, "Bad cut specification");
+ yaz_log(YLOG_FATAL, "Bad cut specification");
++errors;
}
}
if (argc != 3)
{
- yaz_log(LOG_FATAL, "charmap directive map requires 2 args");
+ yaz_log(YLOG_FATAL, "charmap directive map requires 2 args");
++errors;
}
buf.map = res;
if (scan_string(argv[2], t_unicode, t_utf8,
fun_mkstring, &buf, 0) < 0)
{
- yaz_log(LOG_FATAL, "Bad map target");
+ yaz_log(YLOG_FATAL, "Bad map target");
++errors;
}
if (scan_string(argv[1], t_unicode, t_utf8,
fun_add_map, &buf, 0) < 0)
{
- yaz_log(LOG_FATAL, "Bad map source");
+ yaz_log(YLOG_FATAL, "Bad map source");
++errors;
}
}
if (argc != 2)
{
- yaz_log(LOG_FATAL, "equivalent requires 1 argument");
+ yaz_log(YLOG_FATAL, "equivalent requires 1 argument");
++errors;
}
w.nmem = res->nmem;
if (scan_string(argv[1], t_unicode, t_utf8,
fun_add_equivalent_string, &w, 0) < 0)
{
- yaz_log(LOG_FATAL, "equivalent: invalid string");
+ yaz_log(YLOG_FATAL, "equivalent: invalid string");
++errors;
}
else if (w.no_eq == 0)
{
- yaz_log(LOG_FATAL, "equivalent: no strings");
+ yaz_log(YLOG_FATAL, "equivalent: no strings");
++errors;
}
else
}
else
{
- yaz_log(LOG_WARN, "Syntax error at '%s' in %s", line, name);
+ yaz_log(YLOG_WARN, "Syntax error at '%s' in %s", line, name);
}
yaz_fclose(f);
chrmaptab_destroy(res);
res = 0;
}
- yaz_log (LOG_DEBUG, "maptab %s close %d errors", name, errors);
+ yaz_log(YLOG_DEBUG, "maptab %s close %d errors", name, errors);
if (t_utf8 != 0)
yaz_iconv_close(t_utf8);
if (t_unicode != 0)
-/* $Id: flock.c,v 1.4.2.5 2006-10-27 11:06:48 adam Exp $
+/* $Id: flock.c,v 1.4.2.6 2006-12-05 21:14:46 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
if (p->fd == -1)
{
xfree(p);
- logf(LOG_WARN | LOG_ERRNO,
+ yaz_log(YLOG_WARN|YLOG_ERRNO,
"zebra_lock_create fail fname=%s", fname);
p = 0;
}
#ifndef WIN32
h->write_flag = 0;
#endif
- logf(log_level, "zebra_lock_create fd=%d p=%p fname=%s",
+ yaz_log(log_level, "zebra_lock_create fd=%d p=%p fname=%s",
h->p->fd, h, p->fname);
}
zebra_mutex_unlock(&lock_list_mutex);
{
if (!h)
return;
- logf(log_level, "zebra_lock_destroy fd=%d p=%p fname=%s",
+ yaz_log(log_level, "zebra_lock_destroy fd=%d p=%p fname=%s",
h->p->fd, h, h->p->fname);
zebra_mutex_lock(&lock_list_mutex);
- logf(log_level, "zebra_lock_destroy fd=%d p=%p fname=%s refcount=%d",
+ yaz_log(log_level, "zebra_lock_destroy fd=%d p=%p fname=%s refcount=%d",
h->p->fd, h, h->p->fname, h->p->ref_count);
assert(h->p->ref_count > 0);
--(h->p->ref_count);
hp = &(*hp)->next;
}
- logf(log_level, "zebra_lock_destroy fd=%d p=%p fname=%s remove",
+ yaz_log(log_level, "zebra_lock_destroy fd=%d p=%p fname=%s remove",
h->p->fd, h, h->p->fname);
#ifndef WIN32
area.l_whence = SEEK_SET;
area.l_len = area.l_start = 0L;
- logf(log_level, "fcntl begin type=%d fd=%d", type, fd);
+ yaz_log(log_level, "fcntl begin type=%d fd=%d", type, fd);
r = fcntl(fd, cmd, &area);
if (r == -1)
- logf(LOG_WARN|LOG_ERRNO, "fcntl FAIL type=%d fd=%d", type, fd);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "fcntl FAIL type=%d fd=%d", type, fd);
else
- logf(log_level, "fcntl type=%d OK fd=%d", type, fd);
+ yaz_log(log_level, "fcntl type=%d OK fd=%d", type, fd);
return r;
}
{
int r = 0;
int do_lock = 0;
- logf(log_level, "zebra_lock_w fd=%d p=%p fname=%s begin",
+ yaz_log(log_level, "zebra_lock_w fd=%d p=%p fname=%s begin",
h->p->fd, h, h->p->fname);
#ifdef WIN32
h->write_flag = 1;
#endif
- logf(log_level, "zebra_lock_w fd=%d p=%p fname=%s end",
+ yaz_log(log_level, "zebra_lock_w fd=%d p=%p fname=%s end",
h->p->fd, h, h->p->fname);
return r;
int r = 0;
int do_lock = 0;
- logf(log_level, "zebra_lock_r fd=%d p=%p fname=%s begin",
+ yaz_log(log_level, "zebra_lock_r fd=%d p=%p fname=%s begin",
h->p->fd, h, h->p->fname);
#ifdef WIN32
while ((r = _locking(h->p->fd, _LK_LOCK, 1)))
h->write_flag = 0;
#endif
- logf(log_level, "zebra_lock_r fd=%d p=%p fname=%s end",
+ yaz_log(log_level, "zebra_lock_r fd=%d p=%p fname=%s end",
h->p->fd, h, h->p->fname);
return r;
}
int zebra_unlock(ZebraLockHandle h)
{
int r = 0;
- logf(log_level, "zebra_unlock fd=%d p=%p fname=%s begin",
+ yaz_log(log_level, "zebra_unlock fd=%d p=%p fname=%s begin",
h->p->fd, h, h->p->fname);
#ifdef WIN32
r = _locking(h->p->fd, _LK_UNLCK, 1);
zebra_lock_rdwr_runlock(&h->p->rdwr_lock);
}
#endif
- logf(log_level, "zebra_unlock fd=%d p=%p fname=%s end",
+ yaz_log(log_level, "zebra_unlock fd=%d p=%p fname=%s end",
h->p->fd, h, h->p->fname);
return r;
}
size_t r = confstr(_CS_GNU_LIBPTHREAD_VERSION, conf_buf, sizeof(conf_buf));
if (r == 0)
{
- logf(LOG_WARN|LOG_ERRNO, "confstr failed");
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "confstr failed");
return -1;
}
if (strncmp(conf_buf, "linuxthreads", 12) == 0)
{
initialized = 1;
log_level = yaz_log_module_level("flock");
- logf(log_level, "zebra_flock_init");
+ yaz_log(log_level, "zebra_flock_init");
check_for_linuxthreads();
zebra_mutex_init(&lock_list_mutex);
- logf(log_level, "posix_locks: %d", posix_locks);
+ yaz_log(log_level, "posix_locks: %d", posix_locks);
}
}
-/* $Id: passwddb.c,v 1.7.2.4 2006-10-11 20:18:47 adam Exp $
+/* $Id: passwddb.c,v 1.7.2.5 2006-12-05 21:14:46 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
{
struct passwd_entry *pe;
for (pe = db->entries; pe; pe = pe->next)
- logf (LOG_LOG,"%s:%s", pe->name, pe->des);
+ yaz_log(YLOG_LOG,"%s:%s", pe->name, pe->des);
}
int passwd_db_auth (Passwd_db db, const char *user, const char *pass)
-/* $Id: res-test.c,v 1.8.2.1 2006-08-14 10:39:24 adam Exp $
+/* $Id: res-test.c,v 1.8.2.2 2006-12-05 21:14:46 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
static void res_print (const char *name, const char *value)
{
- logf (LOG_LOG, "%s=%s", name, value);
+ yaz_log(YLOG_LOG, "%s=%s", name, value);
}
int main(int argc, char **argv)
Res res;
int write_flag = 0;
- log_init (LOG_DEFAULT_LEVEL, prog, NULL);
+ log_init(YLOG_DEFAULT_LEVEL, prog, NULL);
while ((ret = options ("wp:v", argv, argc, &arg)) != -2)
if (ret == 0)
resfile = arg;
else if (ret == 'v')
- log_init (LOG_ALL, prog, NULL);
+ log_init(YLOG_ALL, prog, NULL);
else if (ret == 'p')
prefix = arg;
else if (ret == 'w')
write_flag = 1;
else
{
- logf (LOG_FATAL, "Unknown option '-%s'", arg);
+ yaz_log(YLOG_FATAL, "Unknown option '-%s'", arg);
exit (1);
}
if (!resfile)
{
- logf (LOG_FATAL, "No resource file given.");
+ yaz_log(YLOG_FATAL, "No resource file given.");
exit (1);
}
res = res_open (resfile);
-/* $Id: res.c,v 1.37.2.2 2006-08-14 10:39:24 adam Exp $
+/* $Id: res.c,v 1.37.2.3 2006-12-05 21:14:46 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004
Index Data Aps
fr = fopen (r->name, "r");
if (!fr)
{
- logf (LOG_WARN|LOG_ERRNO, "Cannot open `%s'", r->name);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Cannot open `%s'", r->name);
return ;
}
val_buf = (char*) xmalloc (val_max);
val_size--;
val_buf[val_size] = '\0';
resp->value = xstrdup_env(val_buf);
- logf (LOG_DEBUG, "(name=%s,value=%s)",
+ yaz_log(YLOG_DEBUG, "(name=%s,value=%s)",
resp->name, resp->value);
break;
}
if (access (name, R_OK))
#endif
{
- logf (LOG_WARN|LOG_ERRNO, "Cannot open `%s'", name);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "Cannot open `%s'", name);
return 0;
}
}
if (!(t = res_get (r, name)))
{
- logf (LOG_DEBUG, "CAUTION: Using default resource %s:%s", name, def);
+ yaz_log(YLOG_DEBUG, "CAUTION: Using default resource %s:%s", name, def);
return def;
}
else
fr = fopen (r->name, "w");
if (!fr)
{
- logf (LOG_FATAL|LOG_ERRNO, "Cannot create `%s'", r->name);
+ yaz_log(YLOG_FATAL|YLOG_ERRNO, "Cannot create `%s'", r->name);
exit (1);
}
-/* $Id: tstflock.c,v 1.16.2.1 2006-10-23 11:37:11 adam Exp $
+/* $Id: tstflock.c,v 1.16.2.2 2006-12-05 21:14:46 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
for (i = 0; i < num; i++)
YAZ_CHECK(id[i] == 123);
*seqp++ = '\0';
- logf(LOG_LOG, "tst_thread(%d,%d) returns seq=%s",
+ yaz_log(YLOG_LOG, "tst_thread(%d,%d) returns seq=%s",
num, write_flag, seq);
}
-/* $Id: zebramap.c,v 1.32.2.6 2006-08-14 10:39:25 adam Exp $
+/* $Id: zebramap.c,v 1.32.2.7 2006-12-05 21:14:46 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
if (!(f = yaz_fopen(zms->tabpath, name, "r", zms->tabroot)))
{
- yaz_log(LOG_WARN|LOG_ERRNO, "%s", name);
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "%s", name);
return ;
}
while ((argc = readconf_line(f, &lineno, line, 512, argv, 10)))
token->next = (*zm)->replace_tokens;
(*zm)->replace_tokens = token;
#if 0
- yaz_log (LOG_LOG, "replace %s", argv[1]);
+ yaz_log(YLOG_LOG, "replace %s", argv[1]);
#endif
token->token_from = 0;
if (argc >= 2)
{
*dp++ = zebra_prim(&cp);
#if 0
- yaz_log (LOG_LOG, " char %2X %c", dp[-1], dp[-1]);
+ yaz_log(YLOG_LOG, " char %2X %c", dp[-1], dp[-1]);
#endif
}
*dp = '\0';
if (!zm)
{
zm = (struct zebra_map *) nmem_malloc (zms->nmem, sizeof(*zm));
- yaz_log (LOG_WARN, "Unknown register type: %c", reg_id);
+ yaz_log(YLOG_WARN, "Unknown register type: %c", reg_id);
zm->reg_id = reg_id;
zm->maptab_name = nmem_strdup (zms->nmem, "@");
if (!(zm->maptab = chrmaptab_create (zms->tabpath,
zm->maptab_name, 0,
zms->tabroot)))
- yaz_log(LOG_WARN, "Failed to read character table %s",
- zm->maptab_name);
+ yaz_log(YLOG_WARN, "Failed to read character table %s",
+ zm->maptab_name);
else
- yaz_log(LOG_DEBUG, "Read character table %s", zm->maptab_name);
+ yaz_log(YLOG_DEBUG, "Read character table %s", zm->maptab_name);
}
return zm->maptab;
}
return zms->wrbuf_1;
#if 0
- yaz_log (LOG_LOG, "in:%.*s:", wrbuf_len(zms->wrbuf_1),
+ yaz_log(YLOG_LOG, "in:%.*s:", wrbuf_len(zms->wrbuf_1),
wrbuf_buf(zms->wrbuf_1));
#endif
for (;;)
}
}
#if 0
- yaz_log (LOG_LOG, "out:%.*s:", wrbuf_len(wrbuf), wrbuf_buf(wrbuf));
+ yaz_log(YLOG_LOG, "out:%.*s:", wrbuf_len(wrbuf), wrbuf_buf(wrbuf));
#endif
return no_replaces;
}