From 4dde0c63ec2098c9b99896b04f1d27eea2e2c6da Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 5 Dec 2006 21:14:38 +0000 Subject: [PATCH] Updated code to use new YAZ log functions/defines. --- NEWS | 2 + bfile/bfile.c | 12 +-- bfile/cfile.c | 28 +++---- bfile/commit.c | 14 ++-- bfile/mfile.c | 58 +++++++-------- data1/d1_absyn.c | 78 ++++++++++---------- data1/d1_attset.c | 18 ++--- data1/d1_doespec.c | 8 +- data1/d1_espec.c | 24 +++--- data1/d1_expout.c | 10 +-- data1/d1_grs.c | 12 +-- data1/d1_handle.c | 6 +- data1/d1_if.c | 14 ++-- data1/d1_map.c | 20 ++--- data1/d1_marc.c | 30 ++++---- data1/d1_read.c | 12 +-- data1/d1_sumout.c | 8 +- data1/d1_tagset.c | 22 +++--- data1/d1_varset.c | 24 +++--- dfa/dfa.c | 4 +- dfa/grepper.c | 6 +- dfa/imalloc.c | 18 ++--- dict/close.c | 5 +- dict/dclose.c | 5 +- dict/dcompact.c | 13 ++-- dict/dictext.c | 8 +- dict/dicttest.c | 42 +++++------ dict/dopen.c | 5 +- dict/drdwr.c | 8 +- dict/insert.c | 7 +- dict/lookgrep.c | 13 ++-- dict/open.c | 14 ++-- dict/scan.c | 6 +- index/apitest.c | 4 +- index/dir.c | 8 +- index/dirs.c | 18 ++--- index/extract.c | 134 ++++++++++++++++----------------- index/invstat.c | 14 ++-- index/kcompare.c | 6 +- index/kdump.c | 10 +-- index/kinput.c | 44 +++++------ index/livcode.c | 22 +++--- index/locksrv.c | 18 ++--- index/main.c | 12 +-- index/rank1.c | 24 +++--- index/recindex.c | 32 ++++---- index/recstat.c | 12 +-- index/retrieve.c | 12 +-- index/sortidx.c | 7 +- index/trav.c | 30 ++++---- index/trunc.c | 12 +-- index/zebraapi.c | 208 ++++++++++++++++++++++++++-------------------------- index/zebrash.c | 24 +++--- index/zinfo.c | 32 ++++---- index/zrpn.c | 116 ++++++++++++++--------------- index/zserver.c | 100 ++++++++++++------------- index/zsets.c | 34 ++++----- index/zvrank.c | 84 ++++++++++----------- isam/isam.c | 82 ++++++++++----------- isam/issh.c | 4 +- isam/memory.c | 6 +- isam/physical.c | 34 ++++----- isamb/isamb.c | 122 +++++++++++++++--------------- isamb/tstisamb.c | 20 ++--- isamc/isamc.c | 31 ++++---- isamc/isamd.c | 90 +++++++++++------------ isamc/merge-d.c | 123 ++++++++++++++++--------------- isamc/merge.c | 43 ++++++----- isamg/isamg.c | 9 ++- isams/isams.c | 11 +-- perl/zebra_perl.c | 20 ++--- recctrl/marcread.c | 40 +++++----- recctrl/perlread.c | 14 ++-- recctrl/recgrs.c | 62 ++++++++-------- recctrl/rectext.c | 4 +- recctrl/regxread.c | 108 +++++++++++++-------------- recctrl/xmlread.c | 26 +++---- rset/rsbetween.c | 12 +-- rset/rsbool.c | 88 +++++++++++----------- rset/rset.c | 18 ++--- rset/rsisam.c | 14 ++-- rset/rsisamb.c | 22 +++--- rset/rsisamc.c | 14 ++-- rset/rsisamd.c | 14 ++-- rset/rsisams.c | 14 ++-- rset/rsm_or.c | 8 +- rset/rsnull.c | 8 +- rset/rsprox.c | 12 +-- rset/rstemp.c | 28 +++---- test/api/t2.c | 4 +- test/api/t5.c | 6 +- util/charmap.c | 62 ++++++++-------- util/flock.c | 36 ++++----- util/passwddb.c | 4 +- util/res-test.c | 12 +-- util/res.c | 12 +-- util/tstflock.c | 4 +- util/zebramap.c | 20 ++--- 98 files changed, 1417 insertions(+), 1415 deletions(-) diff --git a/NEWS b/NEWS index d48578a..63a0a71 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ +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) diff --git a/bfile/bfile.c b/bfile/bfile.c index 00c8690..9fcc4c6 100644 --- a/bfile/bfile.c +++ b/bfile/bfile.c @@ -1,4 +1,4 @@ -/* $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 @@ -88,7 +88,7 @@ void bf_cache (BFiles bfs, const char *spec) { 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) @@ -97,7 +97,7 @@ void bf_cache (BFiles bfs, const char *spec) 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 @@ -132,7 +132,7 @@ BFile bf_open (BFiles bfs, const char *name, int block_size, int wflag) 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); @@ -146,7 +146,7 @@ BFile bf_open (BFiles bfs, const char *name, int block_size, int wflag) } 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; } @@ -215,7 +215,7 @@ void bf_commitExec (BFiles bfs) 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) diff --git a/bfile/cfile.c b/bfile/cfile.c index ba149d1..5332bad 100644 --- a/bfile/cfile.c +++ b/bfile/cfile.c @@ -1,4 +1,4 @@ -/* $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 @@ -78,17 +78,17 @@ CFile cf_open (MFile mf, MFile_area area, const char *fname, 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); @@ -223,7 +223,7 @@ static struct CFile_hash_bucket *get_bucket (CFile cf, int block_no, int hno) 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); @@ -290,13 +290,13 @@ static int cf_lookup_hash (CFile cf, int 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; iph.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 (); } } @@ -327,8 +327,8 @@ static void cf_moveto_flat (CFile cf) 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); @@ -339,7 +339,7 @@ static void cf_moveto_flat (CFile cf) { 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++) @@ -406,7 +406,7 @@ static int cf_new_hash (CFile cf, int no) { 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 (); } } @@ -461,7 +461,7 @@ int cf_read (CFile cf, int no, int offset, int nbytes, void *buf) 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; @@ -488,7 +488,7 @@ int cf_write (CFile cf, int no, int offset, int nbytes, const void *buf) 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; @@ -496,7 +496,7 @@ int cf_write (CFile cf, int no, int offset, int nbytes, const void *buf) 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); diff --git a/bfile/commit.c b/bfile/commit.c index 3f92dde..304104c 100644 --- a/bfile/commit.c +++ b/bfile/commit.c @@ -1,4 +1,4 @@ -/* $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 @@ -83,7 +83,7 @@ static void map_cache_flush (struct map_cache *m_p) 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); } @@ -141,7 +141,7 @@ static void cf_commit_hash (CFile cf) { 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; ivno[i]; i++) @@ -151,7 +151,7 @@ static void cf_commit_hash (CFile cf) #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); @@ -186,7 +186,7 @@ static void cf_commit_flat (CFile cf) 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++) @@ -198,7 +198,7 @@ static void cf_commit_flat (CFile cf) #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); @@ -222,7 +222,7 @@ void cf_commit (CFile cf) 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) diff --git a/bfile/mfile.c b/bfile/mfile.c index 631acf7..a37602a 100644 --- a/bfile/mfile.c +++ b/bfile/mfile.c @@ -1,4 +1,4 @@ -/* $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 @@ -83,12 +83,12 @@ static int scan_areadef(MFile_area ma, const char *ad, const char *base) 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') @@ -103,7 +103,7 @@ static int scan_areadef(MFile_area ma, const char *ad, const char *base) 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; @@ -116,10 +116,10 @@ static int scan_areadef(MFile_area ma, const char *ad, const char *base) 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++; @@ -158,7 +158,7 @@ static int file_position(MFile mf, int pos, int offset) { 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; } } @@ -166,8 +166,8 @@ static int file_position(MFile mf, int pos, int offset) 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; } @@ -195,13 +195,13 @@ MFile_area mf_init(const char *name, const char *spec, const char *base) 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 */ @@ -209,7 +209,7 @@ MFile_area mf_init(const char *name, const char *spec, const char *base) { 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; } @@ -257,13 +257,13 @@ MFile_area mf_init(const char *name, const char *spec, const char *base) /* 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; } @@ -278,7 +278,7 @@ MFile_area mf_init(const char *name, const char *spec, const char *base) } 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); @@ -340,7 +340,7 @@ MFile mf_open(MFile_area ma, const char *name, int block_size, int wflag) 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) @@ -368,7 +368,7 @@ MFile mf_open(MFile_area ma, const char *name, int block_size, int wflag) 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; @@ -415,7 +415,7 @@ int mf_close(MFile mf) { 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++) { @@ -449,14 +449,14 @@ int mf_read(MFile mf, int no, int offset, int nbytes, void *buf) } 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); } @@ -480,7 +480,7 @@ int mf_write(MFile mf, int no, int offset, int nbytes, const void *buf) 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 */ @@ -496,20 +496,20 @@ int mf_write(MFile mf, int no, int offset, int nbytes, const void *buf) 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); } @@ -519,12 +519,12 @@ int mf_write(MFile mf, int no, int offset, int nbytes, const void *buf) 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); } @@ -545,7 +545,7 @@ int mf_write(MFile mf, int no, int offset, int nbytes, const void *buf) /* 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); } @@ -563,7 +563,7 @@ int mf_write(MFile mf, int no, int offset, int nbytes, const void *buf) 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); } diff --git a/data1/d1_absyn.c b/data1/d1_absyn.c index 5df30fc..3a56f9a 100644 --- a/data1/d1_absyn.c +++ b/data1/d1_absyn.c @@ -1,4 +1,4 @@ -/* $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 @@ -80,7 +80,7 @@ void data1_absyn_destroy (data1_handle dh) { 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; } @@ -170,7 +170,7 @@ data1_attset *data1_attset_add (data1_handle dh, const char *name) *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) @@ -267,7 +267,7 @@ void fix_element_ref (data1_handle dh, data1_absyn *absyn, data1_element *e) 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); } } @@ -360,7 +360,7 @@ static const char * mk_xpath_regexp (data1_handle dh, const char *expr) } sprintf (res_p, "$"); res_p++; - yaz_log(LOG_DEBUG, "Got regexp: %s", res); + yaz_log(YLOG_DEBUG, "Got regexp: %s", res); return res; } @@ -392,7 +392,7 @@ static int parse_termlists (data1_handle dh, data1_termlist ***tpp, if (i == 0) { if (*cp) - yaz_log(LOG_WARN, + yaz_log(YLOG_WARN, "%s:%d: Syntax error in termlistspec '%s'", file, lineno, cp); break; @@ -432,7 +432,7 @@ static int parse_termlists (data1_handle dh, data1_termlist ***tpp, 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; @@ -483,7 +483,7 @@ static int melm2xpath(char *melm, char *buf) 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; } @@ -576,7 +576,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -619,7 +619,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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]; @@ -650,7 +650,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, } 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; } @@ -678,14 +678,14 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, { 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; @@ -711,7 +711,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, } 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; } @@ -758,7 +758,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -836,7 +836,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -856,7 +856,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, { 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; } @@ -866,7 +866,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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); } } @@ -875,13 +875,13 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -895,7 +895,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, { 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; } @@ -907,14 +907,14 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -926,14 +926,14 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -949,7 +949,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -959,7 +959,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, *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; } @@ -971,14 +971,14 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -989,7 +989,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -1004,7 +1004,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, (*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; } @@ -1016,14 +1016,14 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -1035,14 +1035,14 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } @@ -1052,7 +1052,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, { 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; } @@ -1062,7 +1062,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, { 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; } @@ -1074,7 +1074,7 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, } else { - yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'", file, + yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, cmd); continue; } @@ -1090,6 +1090,6 @@ data1_absyn *data1_read_absyn (data1_handle dh, const char *file, 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; } diff --git a/data1/d1_attset.c b/data1/d1_attset.c index dfa0ac6..61cbd8a 100644 --- a/data1/d1_attset.c +++ b/data1/d1_attset.c @@ -1,4 +1,4 @@ -/* $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 @@ -90,7 +90,7 @@ data1_attset *data1_read_attset(data1_handle dh, const char *file) 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]); @@ -129,7 +129,7 @@ data1_attset *data1_read_attset(data1_handle dh, const char *file) { 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; } } @@ -139,14 +139,14 @@ data1_attset *data1_read_attset(data1_handle dh, const char *file) 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; @@ -154,7 +154,7 @@ data1_attset *data1_read_attset(data1_handle dh, const char *file) } 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")) @@ -164,7 +164,7 @@ data1_attset *data1_read_attset(data1_handle dh, const char *file) 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; } @@ -172,7 +172,7 @@ data1_attset *data1_read_attset(data1_handle dh, const char *file) 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; @@ -185,7 +185,7 @@ data1_attset *data1_read_attset(data1_handle dh, const char *file) } else { - yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'", + yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, cmd); } } diff --git a/data1/d1_doespec.c b/data1/d1_doespec.c index b948c21..53b6069 100644 --- a/data1/d1_doespec.c +++ b/data1/d1_doespec.c @@ -1,4 +1,4 @@ -/* $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 @@ -188,7 +188,7 @@ static int match_node_and_attr (data1_node *c, const char *spec) } else { - yaz_log(LOG_WARN, "Bad simpleelement component: '%s'", spec); + yaz_log(YLOG_WARN, "Bad simpleelement component: '%s'", spec); } return 0; } @@ -247,7 +247,7 @@ static int match_children_here (data1_handle dh, data1_node *n, } else { - yaz_log(LOG_WARN, "Bad SpecificTag type: %d", + yaz_log(YLOG_WARN, "Bad SpecificTag type: %d", want->tagValue->which); continue; } @@ -262,7 +262,7 @@ static int match_children_here (data1_handle dh, data1_node *n, 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 || diff --git a/data1/d1_espec.c b/data1/d1_espec.c index 4b596bb..4a19b5d 100644 --- a/data1/d1_espec.c +++ b/data1/d1_espec.c @@ -1,4 +1,4 @@ -/* $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 @@ -56,7 +56,7 @@ static Z_Variant *read_variant(int argc, char **argv, NMEM nmem, 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; } @@ -117,7 +117,7 @@ static Z_Occurrences *read_occurrences(char *occ, NMEM nmem, 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; } @@ -226,7 +226,7 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) 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; } @@ -245,7 +245,7 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) if (!nnames) { - yaz_log(LOG_WARN, "%s:%d: Empty elementsetnames directive", + yaz_log(YLOG_WARN, "%s:%d: Empty elementsetnames directive", file, lineno); continue; } @@ -262,14 +262,14 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) { 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; } @@ -278,7 +278,7 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) { 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; } @@ -289,7 +289,7 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) 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; } @@ -316,7 +316,7 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) } 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; } @@ -348,7 +348,7 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) 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; } @@ -360,7 +360,7 @@ Z_Espec1 *data1_read_espec1 (data1_handle dh, const char *file) 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; diff --git a/data1/d1_expout.c b/data1/d1_expout.c index 54b6d0c..a3c9050 100644 --- a/data1/d1_expout.c +++ b/data1/d1_expout.c @@ -1,4 +1,4 @@ -/* $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 @@ -47,12 +47,12 @@ static int is_numeric_tag (ExpHandle *eh, data1_node *c) 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) @@ -1381,7 +1381,7 @@ Z_ExplainRecord *data1_nodetoexplain (data1_handle dh, data1_node *n, 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) @@ -1415,6 +1415,6 @@ Z_ExplainRecord *data1_nodetoexplain (data1_handle dh, data1_node *n, return res; } } - yaz_log(LOG_WARN, "No category in Explain record"); + yaz_log(YLOG_WARN, "No category in Explain record"); return 0; } diff --git a/data1/d1_grs.c b/data1/d1_grs.c index 735e14c..ed976c9 100644 --- a/data1/d1_grs.c +++ b/data1/d1_grs.c @@ -1,4 +1,4 @@ -/* $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 @@ -94,7 +94,7 @@ static Z_Variant *make_variant(data1_node *n, int num, ODR o) 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; } @@ -118,7 +118,7 @@ static int traverse_triples(data1_node *n, int level, Z_ElementMetaData *m, 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; } @@ -218,7 +218,7 @@ static Z_ElementData *nodetoelementdata(data1_handle dh, data1_node *n, *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; } } @@ -294,7 +294,7 @@ static Z_TaggedElement *nodetotaggedelement(data1_handle dh, data1_node *n, } else { - yaz_log(LOG_WARN, "Bad data."); + yaz_log(YLOG_WARN, "Bad data."); return 0; } @@ -392,7 +392,7 @@ Z_GenericRecord *data1_nodetogr(data1_handle dh, data1_node *n, 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; diff --git a/data1/d1_handle.c b/data1/d1_handle.c index 16f0850..6d8340c 100644 --- a/data1/d1_handle.c +++ b/data1/d1_handle.c @@ -1,4 +1,4 @@ -/* $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 @@ -116,14 +116,14 @@ WRBUF data1_get_wrbuf (data1_handle dp) 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; } diff --git a/data1/d1_if.c b/data1/d1_if.c index 01d1d0d..15eb861 100644 --- a/data1/d1_if.c +++ b/data1/d1_if.c @@ -1,4 +1,4 @@ -/* $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 @@ -90,17 +90,17 @@ char *data1_getNodeValue(data1_node* node, char* pTagPath) } 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 ""; @@ -174,7 +174,7 @@ data1_node *data1_LookupNode(data1_node* node, char* pTagPath) } 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); } @@ -197,7 +197,7 @@ data1_node *data1_LookupNode(data1_node* node, char* pTagPath) } - 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 */ @@ -228,7 +228,7 @@ data1_node *data1_LookupNode(data1_node* node, char* pTagPath) } 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; diff --git a/data1/d1_map.c b/data1/d1_map.c index bf66de3..bc02300 100644 --- a/data1/d1_map.c +++ b/data1/d1_map.c @@ -1,4 +1,4 @@ -/* $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 @@ -44,7 +44,7 @@ data1_maptab *data1_read_maptab (data1_handle dh, const char *file) 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; } @@ -59,14 +59,14 @@ data1_maptab *data1_read_maptab (data1_handle dh, const char *file) { 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; } @@ -75,7 +75,7 @@ data1_maptab *data1_read_maptab (data1_handle dh, const char *file) { 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; } @@ -89,7 +89,7 @@ data1_maptab *data1_read_maptab (data1_handle dh, const char *file) { 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); @@ -102,7 +102,7 @@ data1_maptab *data1_read_maptab (data1_handle dh, const char *file) 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; } @@ -129,7 +129,7 @@ data1_maptab *data1_read_maptab (data1_handle dh, const char *file) 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; @@ -158,7 +158,7 @@ data1_maptab *data1_read_maptab (data1_handle dh, const char *file) 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); @@ -332,7 +332,7 @@ data1_node *data1_map_record (data1_handle dh, data1_node *n, 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)) diff --git a/data1/d1_marc.c b/data1/d1_marc.c index 95d879b..87736e4 100644 --- a/data1/d1_marc.c +++ b/data1/d1_marc.c @@ -1,4 +1,4 @@ -/* $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 @@ -45,7 +45,7 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) 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; } @@ -70,7 +70,7 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) { 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; } @@ -80,13 +80,13 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) { 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; } @@ -95,7 +95,7 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) { 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; } @@ -105,7 +105,7 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) { 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; } @@ -115,7 +115,7 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) { 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; } @@ -125,7 +125,7 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) { 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; } @@ -135,7 +135,7 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) { 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; } @@ -145,14 +145,14 @@ data1_marctab *data1_read_marctab (data1_handle dh, const char *file) { 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); @@ -241,7 +241,7 @@ static int nodetomarc(data1_handle dh, #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); @@ -425,14 +425,14 @@ static int nodetomarc(data1_handle dh, 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; diff --git a/data1/d1_read.c b/data1/d1_read.c index a0959d7..9b348bc 100644 --- a/data1/d1_read.c +++ b/data1/d1_read.c @@ -1,4 +1,4 @@ -/* $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 @@ -118,7 +118,7 @@ static void data1_init_node (data1_handle dh, data1_node *r, int type) 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); } } @@ -194,7 +194,7 @@ data1_node *data1_mk_root (data1_handle dh, NMEM nmem, const char *name) 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 */ } @@ -804,7 +804,7 @@ data1_node *data1_read_nodex (data1_handle dh, NMEM m, } if (amp || c != '>') { - yaz_log(LOG_WARN, "d1: %d: Malformed tag", line); + yaz_log(YLOG_WARN, "d1: %d: Malformed tag", line); return 0; } else @@ -832,7 +832,7 @@ data1_node *data1_read_nodex (data1_handle dh, NMEM m, } 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; } @@ -1126,7 +1126,7 @@ int data1_iconv (data1_handle dh, NMEM m, data1_node *n, 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(); diff --git a/data1/d1_sumout.c b/data1/d1_sumout.c index e725516..835b0ca 100644 --- a/data1/d1_sumout.c +++ b/data1/d1_sumout.c @@ -1,4 +1,4 @@ -/* $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 @@ -63,7 +63,7 @@ Z_BriefBib *data1_nodetosummary (data1_handle dh, data1_node *n, 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; } @@ -87,7 +87,7 @@ Z_BriefBib *data1_nodetosummary (data1_handle dh, data1_node *n, { 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) @@ -109,7 +109,7 @@ Z_BriefBib *data1_nodetosummary (data1_handle dh, data1_node *n, 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; diff --git a/data1/d1_tagset.c b/data1/d1_tagset.c index 5eb1614..8469c95 100644 --- a/data1/d1_tagset.c +++ b/data1/d1_tagset.c @@ -1,4 +1,4 @@ -/* $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 @@ -129,7 +129,7 @@ data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int type) 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); @@ -149,7 +149,7 @@ data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int type) 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]); @@ -167,7 +167,7 @@ data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int type) 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; @@ -195,7 +195,7 @@ data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int type) { 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]); @@ -206,14 +206,14 @@ data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int type) 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; } @@ -222,7 +222,7 @@ data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int type) { 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) @@ -235,7 +235,7 @@ data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int 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; } @@ -245,7 +245,7 @@ data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int type) *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; } @@ -253,7 +253,7 @@ data1_tagset *data1_read_tagset (data1_handle dh, const char *file, int type) } else { - yaz_log(LOG_WARN, "%s:%d: Unknown directive '%s'", + yaz_log(YLOG_WARN, "%s:%d: Unknown directive '%s'", file, lineno, cmd); } } diff --git a/data1/d1_varset.c b/data1/d1_varset.c index a506318..1449287 100644 --- a/data1/d1_varset.c +++ b/data1/d1_varset.c @@ -1,4 +1,4 @@ -/* $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 @@ -39,11 +39,11 @@ data1_vartype *data1_getvartypebyct (data1_handle dh, data1_varset *set, 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; } @@ -64,7 +64,7 @@ data1_varset *data1_read_varset (data1_handle dh, const char *file) 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))) @@ -74,7 +74,7 @@ data1_varset *data1_read_varset (data1_handle dh, const char *file) 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; } @@ -94,13 +94,13 @@ data1_varset *data1_read_varset (data1_handle dh, const char *file) 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; } @@ -110,7 +110,7 @@ data1_varset *data1_read_varset (data1_handle dh, const char *file) 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; @@ -122,7 +122,7 @@ data1_varset *data1_read_varset (data1_handle dh, const char *file) { 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; } @@ -132,19 +132,19 @@ data1_varset *data1_read_varset (data1_handle dh, const char *file) { 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); diff --git a/dfa/dfa.c b/dfa/dfa.c index 0ee30b3..736b8d7 100644 --- a/dfa/dfa.c +++ b/dfa/dfa.c @@ -1,4 +1,4 @@ -/* $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 @@ -459,7 +459,7 @@ static int map_l_char (struct DFA_parse *parse_info) 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; } diff --git a/dfa/grepper.c b/dfa/grepper.c index b4a1134..898cd94 100644 --- a/dfa/grepper.c +++ b/dfa/grepper.c @@ -1,4 +1,4 @@ -/* $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 @@ -329,7 +329,7 @@ static int grep_file (struct DFA *dfa, const char *fname, int range) 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); } } @@ -401,7 +401,7 @@ int main (int argc, char **argv) } else { - logf (LOG_FATAL, "Unknown option '-%s'", arg); + yaz_log(YLOG_FATAL, "Unknown option '-%s'", arg); exit (1); } } diff --git a/dfa/imalloc.c b/dfa/imalloc.c index 61c9af0..81a423f 100644 --- a/dfa/imalloc.c +++ b/dfa/imalloc.c @@ -1,4 +1,4 @@ -/* $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 @@ -45,7 +45,7 @@ void *imalloc (size_t size) 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; @@ -59,7 +59,7 @@ void *imalloc (size_t size) #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 } @@ -70,7 +70,7 @@ void *icalloc (size_t size) 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; @@ -84,7 +84,7 @@ void *icalloc (size_t size) #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 } @@ -98,14 +98,14 @@ void ifree (void *p) ++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); diff --git a/dict/close.c b/dict/close.c index 121b648..5f85456 100644 --- a/dict/close.c +++ b/dict/close.c @@ -1,4 +1,4 @@ -/* $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 @@ -20,13 +20,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - #include #include #include #include +#include #include int dict_close (Dict dict) diff --git a/dict/dclose.c b/dict/dclose.c index 0d7b27a..0a78adc 100644 --- a/dict/dclose.c +++ b/dict/dclose.c @@ -1,4 +1,4 @@ -/* $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 @@ -20,13 +20,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - #include #include #include #include +#include #include int dict_bf_close (Dict_BFile dbf) diff --git a/dict/dcompact.c b/dict/dcompact.c index d772501..6b329f1 100644 --- a/dict/dcompact.c +++ b/dict/dcompact.c @@ -1,4 +1,4 @@ -/* $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 @@ -20,13 +20,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - #include #include #include #include +#include #include #include @@ -110,7 +109,7 @@ int dict_copy_compact (BFiles bfs, const char *from_name, const char *to_name) 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) + @@ -119,8 +118,8 @@ int dict_copy_compact (BFiles bfs, const char *from_name, const char *to_name) 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]; @@ -129,7 +128,7 @@ int dict_copy_compact (BFiles bfs, const char *from_name, const char *to_name) 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]); diff --git a/dict/dictext.c b/dict/dictext.c index 2c63d2c..d72e925 100644 --- a/dict/dictext.c +++ b/dict/dictext.c @@ -1,4 +1,4 @@ -/* $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 @@ -50,7 +50,7 @@ int main (int argc, char **argv) inputfile = arg; else { - logf (LOG_FATAL, "too many files specified\n"); + yaz_log(YLOG_FATAL, "too many files specified\n"); exit (1); } } @@ -68,7 +68,7 @@ int main (int argc, char **argv) use8 = 1; else { - logf (LOG_FATAL, "Unknown option '-%s'", arg); + yaz_log(YLOG_FATAL, "Unknown option '-%s'", arg); exit (1); } } @@ -77,7 +77,7 @@ int main (int argc, char **argv) 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); } } diff --git a/dict/dicttest.c b/dict/dicttest.c index 6e869c5..5bf78ba 100644 --- a/dict/dicttest.c +++ b/dict/dicttest.c @@ -1,4 +1,4 @@ -/* $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 @@ -103,7 +103,7 @@ int main (int argc, char **argv) name = arg; else { - logf (LOG_FATAL, "too many files specified\n"); + yaz_log(YLOG_FATAL, "too many files specified\n"); exit (1); } } @@ -151,31 +151,31 @@ int main (int argc, char **argv) } 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) @@ -188,7 +188,7 @@ int main (int argc, char **argv) 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); } @@ -227,11 +227,11 @@ int main (int argc, char **argv) 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; } @@ -270,36 +270,36 @@ int main (int argc, char **argv) } 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) { @@ -307,7 +307,7 @@ int main (int argc, char **argv) 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); diff --git a/dict/dopen.c b/dict/dopen.c index 027a2a9..612c497 100644 --- a/dict/dopen.c +++ b/dict/dopen.c @@ -1,4 +1,4 @@ -/* $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 @@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - #include #include #ifndef WIN32 @@ -30,6 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include +#include #include static void common_init (Dict_BFile bf, int block_size, int cache) diff --git a/dict/drdwr.c b/dict/drdwr.c index ff58c69..828affd 100644 --- a/dict/drdwr.c +++ b/dict/drdwr.c @@ -1,4 +1,4 @@ -/* $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 @@ -102,7 +102,7 @@ void dict_bf_flush_blocks (Dict_BFile bf, int no_to_flush) 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 @@ -111,14 +111,14 @@ void dict_bf_flush_blocks (Dict_BFile bf, int no_to_flush) 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, diff --git a/dict/insert.c b/dict/insert.c index 09d8cc4..a823773 100644 --- a/dict/insert.c +++ b/dict/insert.c @@ -1,4 +1,4 @@ -/* $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 @@ -20,13 +20,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - #include #include #include #include +#include #include #define CHECK 0 @@ -343,7 +342,7 @@ static int dict_ins (Dict dict, const Dict_char *str, } 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); diff --git a/dict/lookgrep.c b/dict/lookgrep.c index 522364c..d912151 100644 --- a/dict/lookgrep.c +++ b/dict/lookgrep.c @@ -1,4 +1,4 @@ -/* $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 @@ -20,13 +20,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - #include #include #include #include +#include #include #include @@ -373,10 +372,10 @@ int dict_lookup_grep (Dict dict, const char *pattern, int range, void *client, 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] : '?'); } @@ -385,7 +384,7 @@ int dict_lookup_grep (Dict dict, const char *pattern, int range, void *client, 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; } @@ -418,7 +417,7 @@ int dict_lookup_grep (Dict dict, const char *pattern, int range, void *client, 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); diff --git a/dict/open.c b/dict/open.c index 40bde58..5689cc4 100644 --- a/dict/open.c +++ b/dict/open.c @@ -1,4 +1,4 @@ -/* $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 @@ -20,12 +20,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - #include #include #include - +#include #include Dict dict_open (BFiles bfs, const char *name, int cache, int rw, @@ -46,7 +44,7 @@ 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; } @@ -55,7 +53,7 @@ Dict dict_open (BFiles bfs, const char *name, int cache, int rw, if(!dict->dbf) { - logf (LOG_WARN, "Cannot open `%s'", name); + yaz_log(YLOG_WARN, "Cannot open `%s'", name); xfree (dict); return NULL; } @@ -78,12 +76,12 @@ Dict dict_open (BFiles bfs, const char *name, int cache, int rw, 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; } diff --git a/dict/scan.c b/dict/scan.c index c9c8261..55df4ed 100644 --- a/dict/scan.c +++ b/dict/scan.c @@ -1,4 +1,4 @@ -/* $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 @@ -215,10 +215,10 @@ int dict_scan (Dict dict, char *str, int *before, int *after, void *client, { 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) diff --git a/index/apitest.c b/index/apitest.c index cb9fd67..025941f 100644 --- a/index/apitest.c +++ b/index/apitest.c @@ -1,4 +1,4 @@ -/* $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 @@ -168,7 +168,7 @@ int main (int argc, char **argv) /* 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; } diff --git a/index/dir.c b/index/dir.c index 745f727..c56e568 100644 --- a/index/dir.c +++ b/index/dir.c @@ -1,4 +1,4 @@ -/* $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 @@ -66,10 +66,10 @@ struct dir_entry *dir_open (const char *rep, const char *base, *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; @@ -127,7 +127,7 @@ struct dir_entry *dir_open (const char *rep, const char *base, } entry[idx].name = NULL; closedir (dir); - logf (LOG_DEBUG, "dir_close"); + yaz_log(YLOG_DEBUG, "dir_close"); return entry; } diff --git a/index/dirs.c b/index/dirs.c index 11a3e85..f92a3b0 100644 --- a/index/dirs.c +++ b/index/dirs.c @@ -1,4 +1,4 @@ -/* $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 @@ -84,7 +84,7 @@ struct dirs_info *dirs_open (Dict dict, const char *rep, int rw) 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; @@ -96,7 +96,7 @@ struct dirs_info *dirs_open (Dict dict, const char *rep, int 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; } @@ -136,7 +136,7 @@ struct dirs_entry *dirs_read (struct dirs_info *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++); } @@ -154,7 +154,7 @@ struct dirs_entry *dirs_read (struct dirs_info *p) } 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; @@ -171,7 +171,7 @@ void dirs_mkdir (struct dirs_info *p, const char *src, time_t mtime) 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); } @@ -181,7 +181,7 @@ void dirs_rmdir (struct dirs_info *p, const char *src) 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); } @@ -192,7 +192,7 @@ void dirs_add (struct dirs_info *p, const char *src, int sysno, time_t mtime) 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) @@ -204,7 +204,7 @@ void dirs_del (struct dirs_info *p, const char *src) 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)) diff --git a/index/extract.c b/index/extract.c index 7802416..426e32a 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $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 @@ -73,7 +73,7 @@ static void logRecord (ZebraHandle zh) ++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); } @@ -322,7 +322,7 @@ static char *fileMatchStr (ZebraHandle zh, ; 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; } @@ -340,7 +340,7 @@ static char *fileMatchStr (ZebraHandle zh, } 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; } @@ -397,7 +397,7 @@ static char *fileMatchStr (ZebraHandle zh, } 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; } @@ -405,7 +405,7 @@ static char *fileMatchStr (ZebraHandle zh, } 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; } @@ -439,7 +439,7 @@ static int file_extract_record(ZebraHandle zh, 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; } @@ -507,7 +507,7 @@ static int file_extract_record(ZebraHandle zh, 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; @@ -518,7 +518,7 @@ static int file_extract_record(ZebraHandle zh, 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); } @@ -531,7 +531,7 @@ static int file_extract_record(ZebraHandle zh, 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; } @@ -558,7 +558,7 @@ static int file_extract_record(ZebraHandle zh, } else { - logf (LOG_WARN, "Bad match criteria"); + yaz_log(YLOG_WARN, "Bad match criteria"); return 0; } } @@ -569,13 +569,13 @@ static int file_extract_record(ZebraHandle zh, /* 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); @@ -606,8 +606,8 @@ static int file_extract_record(ZebraHandle zh, 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); @@ -627,14 +627,14 @@ static int file_extract_record(ZebraHandle zh, /* 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) @@ -650,14 +650,14 @@ static int file_extract_record(ZebraHandle zh, /* 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); @@ -720,14 +720,14 @@ static int file_extract_record(ZebraHandle zh, 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); } @@ -766,7 +766,7 @@ int fileExtract (ZebraHandle zh, SYSNO *sysno, const char *fname, 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'; @@ -788,7 +788,7 @@ int fileExtract (ZebraHandle zh, SYSNO *sysno, const char *fname, 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 */ @@ -816,7 +816,7 @@ int fileExtract (ZebraHandle zh, SYSNO *sysno, const char *fname, 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; } @@ -894,22 +894,22 @@ int buffer_extract_record (ZebraHandle zh, } 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; } @@ -936,13 +936,13 @@ int buffer_extract_record (ZebraHandle zh, 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) @@ -951,8 +951,8 @@ int buffer_extract_record (ZebraHandle zh, 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 */ @@ -968,7 +968,7 @@ int buffer_extract_record (ZebraHandle zh, zh->m_record_id); if (!matchStr) { - logf (LOG_WARN, "Bad match criteria (recordID)"); + yaz_log(YLOG_WARN, "Bad match criteria (recordID)"); return 1; } } @@ -985,12 +985,12 @@ int buffer_extract_record (ZebraHandle zh, /* 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); @@ -1015,7 +1015,7 @@ int buffer_extract_record (ZebraHandle zh, 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; @@ -1030,7 +1030,7 @@ int buffer_extract_record (ZebraHandle zh, 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); @@ -1052,13 +1052,13 @@ int buffer_extract_record (ZebraHandle zh, /* 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) @@ -1074,13 +1074,13 @@ int buffer_extract_record (ZebraHandle zh, /* 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); @@ -1250,7 +1250,7 @@ void extract_flushRecordKeys (ZebraHandle zh, SYSNO sysno, 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 */ @@ -1345,19 +1345,19 @@ void extract_flushWriteKeys (ZebraHandle zh, int final) #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, @@ -1371,7 +1371,7 @@ void extract_flushWriteKeys (ZebraHandle zh, int final) 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'; } @@ -1393,10 +1393,10 @@ void extract_flushWriteKeys (ZebraHandle zh, int final) 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); @@ -1422,10 +1422,10 @@ void extract_flushWriteKeys (ZebraHandle zh, int final) 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) @@ -1433,7 +1433,7 @@ void extract_flushWriteKeys (ZebraHandle zh, int final) { 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, @@ -1455,10 +1455,10 @@ void extract_flushWriteKeys (ZebraHandle zh, int final) #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; } @@ -1520,7 +1520,7 @@ void extract_add_index_string (RecWord *p, const char *string, 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); @@ -1707,7 +1707,7 @@ void extract_token_add (RecWord *p) { 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); @@ -1818,7 +1818,7 @@ void encode_key_write (char *k, struct encode_info *i, FILE *outf) 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); } } @@ -1886,7 +1886,7 @@ void encode_key_write (char *k, struct encode_info *i, FILE *outf) 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 */ @@ -1920,7 +1920,7 @@ void encode_key_flush (struct encode_info *i, FILE *outf) 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 */ diff --git a/index/invstat.c b/index/invstat.c index c294717..58d4315 100644 --- a/index/invstat.c +++ b/index/invstat.c @@ -1,4 +1,4 @@ -/* $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 @@ -64,7 +64,7 @@ static void print_dict_item (ZebraMaps zm, const char *s, int count, *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); } @@ -173,7 +173,7 @@ static int inv_stat_handle (char *name, const char *info, int pos, 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); @@ -181,12 +181,12 @@ static int inv_stat_handle (char *name, const char *info, int pos, /* 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]) @@ -321,7 +321,7 @@ int zebra_register_statistics (ZebraHandle zh, int dumpdict) { 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); @@ -338,7 +338,7 @@ int zebra_register_statistics (ZebraHandle zh, int dumpdict) (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, diff --git a/index/kcompare.c b/index/kcompare.c index 86187a3..dab3588 100644 --- a/index/kcompare.c +++ b/index/kcompare.c @@ -1,4 +1,4 @@ -/* $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 @@ -40,10 +40,10 @@ void key_logdump_txt (int logmask, const void *p, const char *txt) 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) diff --git a/index/kdump.c b/index/kdump.c index ad4e208..ec99a17 100644 --- a/index/kdump.c +++ b/index/kdump.c @@ -1,4 +1,4 @@ -/* $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 @@ -127,13 +127,13 @@ int main (int argc, char **argv) { 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); } } @@ -147,7 +147,7 @@ int main (int argc, char **argv) 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"); @@ -181,7 +181,7 @@ int main (int argc, char **argv) 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); } diff --git a/index/kinput.c b/index/kinput.c index 799b675..139b1a4 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -1,4 +1,4 @@ -/* $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 @@ -85,21 +85,21 @@ void key_file_chunk_read (struct key_file *f) 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 ; } @@ -112,7 +112,7 @@ void key_file_chunk_read (struct key_file *f) } 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; } @@ -220,7 +220,7 @@ int key_file_read (struct key_file *f, char *key) 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); @@ -235,7 +235,7 @@ int key_file_read (struct key_file *f, char *key) 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; @@ -310,8 +310,8 @@ struct heap_info *key_heap_init_buff ( ZebraHandle zh, 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]); @@ -385,7 +385,7 @@ static int heap_read_one_raw (struct heap_info *hi, char *name, char *key) 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); @@ -625,7 +625,7 @@ static void print_dict_item (ZebraMaps zm, const char *s) *to++ = *res++; } *to = '\0'; - yaz_log (LOG_LOG, "%s", keybuf); + yaz_log(YLOG_LOG, "%s", keybuf); } #endif @@ -725,7 +725,7 @@ int heap_inpd (struct heap_info *hi) 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]); /*!*/ @@ -747,7 +747,7 @@ int heap_inpd (struct heap_info *hi) 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(); } } @@ -875,7 +875,7 @@ int heap_inps (struct heap_info *hi) } 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; } } @@ -905,10 +905,10 @@ void progressFunc (struct key_file *keyp, void *info) 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; @@ -928,7 +928,7 @@ void zebra_index_merge (ZebraHandle zh) 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 */ @@ -1000,11 +1000,11 @@ void zebra_index_merge (ZebraHandle zh) } 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; diff --git a/index/livcode.c b/index/livcode.c index d6e30f1..2b4f69f 100644 --- a/index/livcode.c +++ b/index/livcode.c @@ -11,7 +11,7 @@ rights reserved. 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 $ */ @@ -166,7 +166,7 @@ int read_zrank_file(ZebraHandle zh) 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" ) ; @@ -188,7 +188,7 @@ int read_zrank_file(ZebraHandle zh) { 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; } @@ -211,7 +211,7 @@ int read_zrank_file(ZebraHandle zh) } 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); } } @@ -559,7 +559,7 @@ static void *create (ZebraHandle zh) 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) ; @@ -575,7 +575,7 @@ static void destroy (struct zebra_register *reg, void *class_handle) { struct rank_class_info *ci = (struct rank_class_info *) class_handle; - logf (LOG_DEBUG, "livrank destroy"); + yaz_log(YLOG_DEBUG, "livrank destroy"); xfree (ci); } @@ -590,7 +590,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) 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 *) @@ -614,7 +614,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) 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; } @@ -626,7 +626,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) 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); } @@ -639,7 +639,7 @@ static void end (struct zebra_register *reg, void *set_handle) 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++; } @@ -655,7 +655,7 @@ static int calc (void *set_handle, int sysno) 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; diff --git a/index/locksrv.c b/index/locksrv.c index 8b9918c..fc8a709 100644 --- a/index/locksrv.c +++ b/index/locksrv.c @@ -1,4 +1,4 @@ -/* $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 @@ -46,7 +46,7 @@ int zebra_server_lock_init (ZebraService zi) 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; } @@ -55,7 +55,7 @@ int zebra_server_lock_destroy (ZebraService zi) 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; } @@ -69,7 +69,7 @@ int zebra_server_lock (ZebraService zi, int commitPhase) 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); @@ -78,18 +78,18 @@ int zebra_server_lock (ZebraService zi, int commitPhase) 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; @@ -99,9 +99,9 @@ void zebra_server_unlock (ZebraService zi, int commitPhase) { 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); } diff --git a/index/main.c b/index/main.c index 408c3c9..797ec57 100644 --- a/index/main.c +++ b/index/main.c @@ -1,4 +1,4 @@ -/* $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 @@ -124,7 +124,7 @@ int main (int argc, char **argv) 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); @@ -133,7 +133,7 @@ int main (int argc, char **argv) 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); } @@ -181,7 +181,7 @@ int main (int argc, char **argv) } else { - logf (LOG_FATAL, "unknown command: %s", arg); + yaz_log(YLOG_FATAL, "unknown command: %s", arg); exit (1); } } @@ -266,7 +266,7 @@ int main (int argc, char **argv) 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) @@ -281,7 +281,7 @@ int main (int argc, char **argv) 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); diff --git a/index/rank1.c b/index/rank1.c index 078bfc0..8a85157 100644 --- a/index/rank1.c +++ b/index/rank1.c @@ -1,4 +1,4 @@ -/* $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 @@ -70,7 +70,7 @@ static void *create (ZebraHandle zh) 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; } @@ -83,7 +83,7 @@ static void destroy (struct zebra_register *reg, void *class_handle) { 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); } @@ -99,7 +99,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) 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; @@ -109,7 +109,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) { 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)) { @@ -120,7 +120,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) 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)++; @@ -130,7 +130,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) 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; } @@ -142,7 +142,7 @@ static void *begin (struct zebra_register *reg, void *class_handle, RSET rset) 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); } @@ -156,7 +156,7 @@ static void add (void *set_handle, int seqno, int term_index) { 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++; @@ -177,12 +177,12 @@ static int calc (void *set_handle, int sysno) 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)) @@ -192,7 +192,7 @@ static int calc (void *set_handle, int sysno) 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; diff --git a/index/recindex.c b/index/recindex.c index 786eec1..e48cddb 100644 --- a/index/recindex.c +++ b/index/recindex.c @@ -1,4 +1,4 @@ -/* $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 @@ -58,7 +58,7 @@ static void rec_write_head (Records p) 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); } } @@ -83,7 +83,7 @@ static int read_indx (Records p, int sysno, void *buf, int itemsize, 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); } @@ -119,7 +119,7 @@ static void rec_release_blocks (Records p, int sysno) 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) @@ -133,7 +133,7 @@ static void rec_release_blocks (Records p, int sysno) 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; @@ -144,7 +144,7 @@ static void rec_release_blocks (Records p, int sysno) 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; @@ -188,7 +188,7 @@ static void rec_write_tmp_buf (Records p, int size, int *sysnos) 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); } @@ -238,7 +238,7 @@ Records rec_open (BFiles bfs, int rw, int compression_method) 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); @@ -271,13 +271,13 @@ Records rec_open (BFiles bfs, int rw, int compression_method) 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); } @@ -297,7 +297,7 @@ Records rec_open (BFiles bfs, int rw, int compression_method) 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); } } @@ -449,10 +449,10 @@ static void rec_write_multiple (Records p, int saveCount) &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; @@ -646,17 +646,17 @@ static Record rec_get_int (Records p, int sysno) 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; diff --git a/index/recstat.c b/index/recstat.c index 1bb11a0..9d067ec 100644 --- a/index/recstat.c +++ b/index/recstat.c @@ -1,4 +1,4 @@ -/* $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 @@ -35,24 +35,24 @@ void rec_prstat (Records records) 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); } diff --git a/index/retrieve.c b/index/retrieve.c index fa72031..e9c4dce 100644 --- a/index/retrieve.c +++ b/index/retrieve.c @@ -1,4 +1,4 @@ -/* $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 @@ -111,7 +111,7 @@ int zebra_record_fetch (ZebraHandle zh, int sysno, int score, ODR stream, 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; } @@ -132,10 +132,10 @@ int zebra_record_fetch (ZebraHandle zh, int sysno, int score, ODR stream, 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; @@ -147,7 +147,7 @@ int zebra_record_fetch (ZebraHandle zh, int sysno, int score, ODR stream, 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; @@ -173,7 +173,7 @@ int zebra_record_fetch (ZebraHandle zh, int sysno, int score, ODR stream, 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; diff --git a/index/sortidx.c b/index/sortidx.c index f7ac135..3d7288d 100644 --- a/index/sortidx.c +++ b/index/sortidx.c @@ -1,4 +1,4 @@ -/* $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 @@ -20,10 +20,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - #include +#include #include #include #include @@ -92,7 +91,7 @@ int sortIdx_type (SortIdx si, int type) 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) { diff --git a/index/trav.c b/index/trav.c index 35f8278..d6a1e12 100644 --- a/index/trav.c +++ b/index/trav.c @@ -1,4 +1,4 @@ -/* $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 @@ -53,7 +53,7 @@ static void repositoryExtractR (ZebraHandle zh, int deleteFlag, char *rep, 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 @@ -122,7 +122,7 @@ static void fileUpdateR (ZebraHandle zh, 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)) @@ -167,7 +167,7 @@ static void fileUpdateR (ZebraHandle zh, { 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); } @@ -178,7 +178,7 @@ static void fileUpdateR (ZebraHandle zh, sd = 1; else break; - yaz_log (LOG_DEBUG, "trav sd=%d", sd); + yaz_log(YLOG_DEBUG, "trav sd=%d", sd); if (sd == 0) { @@ -194,15 +194,15 @@ static void fileUpdateR (ZebraHandle zh, { 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); @@ -260,7 +260,7 @@ void repositoryShow (ZebraHandle zh, const char *path) 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; } @@ -277,7 +277,7 @@ void repositoryShow (ZebraHandle zh, const char *path) 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); } @@ -307,7 +307,7 @@ static void fileUpdate (ZebraHandle zh, Dict dict, const char *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)) { @@ -343,7 +343,7 @@ static void fileUpdate (ZebraHandle zh, Dict dict, const char *path) } else { - yaz_log (LOG_WARN, "Skipping path %s", src); + yaz_log(YLOG_WARN, "Skipping path %s", src); } } @@ -369,13 +369,13 @@ static void repositoryExtract (ZebraHandle zh, 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, @@ -401,7 +401,7 @@ void repositoryUpdate (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, "-")) diff --git a/index/trunc.c b/index/trunc.c index df9df2a..b63da1d 100644 --- a/index/trunc.c +++ b/index/trunc.c @@ -1,4 +1,4 @@ -/* $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 @@ -342,7 +342,7 @@ static RSET rset_trunc_r (ZebraHandle zi, const char *term, int length, 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)) @@ -487,7 +487,7 @@ static RSET rset_trunc_r (ZebraHandle zi, const char *term, int length, 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); @@ -541,7 +541,7 @@ RSET rset_trunc (ZebraHandle zi, ISAMS_P *isam_p, int no, 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; @@ -614,7 +614,7 @@ RSET rset_trunc (ZebraHandle zi, ISAMS_P *isam_p, int no, { 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; @@ -661,7 +661,7 @@ RSET rset_trunc (ZebraHandle zi, ISAMS_P *isam_p, int no, } 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, diff --git a/index/zebraapi.c b/index/zebraapi.c index 424d254..2351bc4 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $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 @@ -53,11 +53,11 @@ static void zebra_chdir (ZebraService zs) { 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 @@ -68,7 +68,7 @@ static void zebra_chdir (ZebraService zs) 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); @@ -93,7 +93,7 @@ ZebraHandle zebra_open (ZebraService zs) 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 */ @@ -123,12 +123,12 @@ ZebraHandle zebra_open (ZebraService zs) 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); @@ -150,7 +150,7 @@ ZebraService zebra_start_res (const char *configName, Res def_res, Res over_res) { 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(); @@ -160,7 +160,7 @@ ZebraService zebra_start_res (const char *configName, Res def_res, Res over_res) 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); @@ -178,13 +178,13 @@ ZebraService zebra_start_res (const char *configName, Res def_res, Res over_res) { 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); } @@ -192,7 +192,7 @@ ZebraService zebra_start_res (const char *configName, Res def_res, Res over_res) { 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); } @@ -236,7 +236,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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); @@ -253,7 +253,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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); @@ -296,7 +296,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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) @@ -305,12 +305,12 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, } 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)) @@ -319,7 +319,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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; } } @@ -328,7 +328,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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; } } @@ -338,7 +338,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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; } } @@ -349,7 +349,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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; } } @@ -360,7 +360,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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; } } @@ -371,7 +371,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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; } } @@ -382,7 +382,7 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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; } } @@ -391,18 +391,18 @@ struct zebra_register *zebra_register_open (ZebraService zs, const char *name, 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); @@ -415,7 +415,7 @@ int zebra_admin_start (ZebraHandle zh) { 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); @@ -426,7 +426,7 @@ int zebra_admin_start (ZebraHandle zh) 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) @@ -467,7 +467,7 @@ int zebra_stop(ZebraService zs) { if (!zs) return 0; - yaz_log (LOG_LOG|LOG_API, "zebra_stop"); + yaz_log(YLOG_LOG|YLOG_DEBUG, "zebra_stop"); while (zs->sessions) { @@ -491,14 +491,14 @@ int zebra_close (ZebraHandle zh) 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) @@ -569,7 +569,7 @@ static Res zebra_open_res (ZebraHandle zh) } 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; @@ -701,7 +701,7 @@ void map_basenames (ZebraHandle zh, ODR stream, 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; @@ -724,7 +724,7 @@ void map_basenames (ZebraHandle zh, ODR stream, *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) @@ -745,7 +745,7 @@ 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); } @@ -757,7 +757,7 @@ int zebra_select_databases (ZebraHandle zh, int num_bases, 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); @@ -832,7 +832,7 @@ int zebra_search_RPN (ZebraHandle zh, ODR o, 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; @@ -860,7 +860,7 @@ int zebra_records_retrieve (ZebraHandle zh, ODR stream, 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); @@ -880,7 +880,7 @@ int zebra_records_retrieve (ZebraHandle zh, ODR stream, 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; @@ -931,7 +931,7 @@ int zebra_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, int *is_partial) { ASSERTZH; - yaz_log(LOG_API,"zebra_scan"); + yaz_log(YLOG_DEBUG, "zebra_scan"); zh->errCode=0; if (zebra_begin_read (zh)) { @@ -952,7 +952,7 @@ int zebra_sort (ZebraHandle zh, ODR stream, 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; @@ -968,7 +968,7 @@ int zebra_deleleResultSet(ZebraHandle zh, int function, { 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; @@ -993,10 +993,10 @@ int zebra_errCode (ZebraHandle zh) { 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; } @@ -1005,7 +1005,7 @@ const char *zebra_errString (ZebraHandle zh) 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; } @@ -1014,7 +1014,7 @@ char *zebra_errAdd (ZebraHandle zh) 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; } @@ -1042,7 +1042,7 @@ int zebra_auth (ZebraHandle zh, const char *user, const char *pass) 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')) @@ -1057,7 +1057,7 @@ int zebra_admin_import_begin (ZebraHandle zh, const char *database, 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)) @@ -1070,7 +1070,7 @@ int zebra_admin_import_begin (ZebraHandle zh, const char *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; @@ -1081,7 +1081,7 @@ int zebra_admin_import_segment (ZebraHandle zh, Z_Segment *segment) 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; inum_segmentRecords; i++) { @@ -1126,7 +1126,7 @@ int zebra_admin_exchange_record (ZebraHandle zh, 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)) @@ -1211,7 +1211,7 @@ int zebra_drop_database (ZebraHandle zh, const char *database) { int ret = 0; ASSERTZH; - yaz_log(LOG_API,"zebra_drop_database"); + yaz_log(YLOG_DEBUG, "zebra_drop_database"); zebra_clearError(zh); @@ -1228,7 +1228,7 @@ int zebra_drop_database (ZebraHandle zh, const char *database) } 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); @@ -1238,7 +1238,7 @@ int zebra_drop_database (ZebraHandle zh, const char *database) 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)) @@ -1265,7 +1265,7 @@ int zebra_string_norm (ZebraHandle zh, unsigned reg_id, { 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; @@ -1289,14 +1289,14 @@ int zebra_set_state (ZebraHandle zh, int val, int seqno) 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); @@ -1310,7 +1310,7 @@ int zebra_get_state (ZebraHandle zh, char *val, int *seqno) 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); @@ -1375,7 +1375,7 @@ int zebra_begin_trans (ZebraHandle zh, int rw) 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) { @@ -1444,7 +1444,7 @@ int zebra_begin_trans (ZebraHandle zh, int rw) 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); @@ -1456,20 +1456,20 @@ int zebra_begin_trans (ZebraHandle zh, int rw) { 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; } @@ -1492,7 +1492,7 @@ int zebra_begin_trans (ZebraHandle zh, int rw) 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; } } @@ -1533,13 +1533,13 @@ int zebra_begin_trans (ZebraHandle zh, int rw) 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; } @@ -1577,7 +1577,7 @@ int zebra_begin_trans (ZebraHandle zh, int rw) 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); } @@ -1588,7 +1588,7 @@ int zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *status) const char *rval; ASSERTZH; - yaz_log(LOG_API,"zebra_end_transaction"); + yaz_log(YLOG_DEBUG, "zebra_end_transaction"); status->processed = 0; status->inserted = 0; @@ -1619,7 +1619,7 @@ int zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *status) 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); @@ -1631,7 +1631,7 @@ int zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *status) 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); @@ -1644,7 +1644,7 @@ int zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *status) 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); } @@ -1658,7 +1658,7 @@ int zebra_end_transaction (ZebraHandle zh, ZebraTransactionStatus *status) } #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)); @@ -1710,8 +1710,8 @@ static int zebra_commit_ex (ZebraHandle zh, int clean_only) 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; } @@ -1724,7 +1724,7 @@ static int zebra_commit_ex (ZebraHandle zh, int clean_only) 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; } @@ -1738,7 +1738,7 @@ static int zebra_commit_ex (ZebraHandle zh, int clean_only) { zebra_set_state (zh, 'c', seqno); - logf (LOG_LOG, "commit start"); + yaz_log(YLOG_LOG, "commit start"); bf_commitExec (bfs); } seqno++; @@ -1755,7 +1755,7 @@ static int zebra_commit_ex (ZebraHandle zh, int clean_only) { 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); @@ -1764,13 +1764,13 @@ static int zebra_commit_ex (ZebraHandle zh, int clean_only) 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); } @@ -1779,7 +1779,7 @@ int zebra_init (ZebraHandle zh) 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); @@ -1806,7 +1806,7 @@ int zebra_compact (ZebraHandle zh) { BFiles bfs; ASSERTZH; - yaz_log(LOG_API,"zebra_compact"); + yaz_log(YLOG_DEBUG, "zebra_compact"); zh->errCode=0; if (!zh->res) { @@ -1822,7 +1822,7 @@ int zebra_compact (ZebraHandle zh) 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; @@ -1831,7 +1831,7 @@ int zebra_result (ZebraHandle zh, int *code, char **addinfo) 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; @@ -1840,7 +1840,7 @@ int zebra_shadow_enable (ZebraHandle zh, int value) 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); @@ -1856,16 +1856,16 @@ int zebra_record_encoding (ZebraHandle zh, const char *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; } @@ -1873,7 +1873,7 @@ int zebra_record_encoding (ZebraHandle zh, const char *encoding) 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; @@ -1886,7 +1886,7 @@ const char *zebra_get_resource(ZebraHandle zh, 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; } @@ -1896,19 +1896,19 @@ const char *zebra_get_resource(ZebraHandle zh, 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; } @@ -1922,7 +1922,7 @@ void api_records_retrieve (ZebraHandle zh, ODR stream, { 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) { @@ -1942,7 +1942,7 @@ void api_records_retrieve (ZebraHandle zh, ODR stream, 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); } @@ -2018,7 +2018,7 @@ int zebra_insert_record (ZebraHandle zh, 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); @@ -2044,7 +2044,7 @@ int zebra_update_record (ZebraHandle zh, { 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); @@ -2058,7 +2058,7 @@ int zebra_update_record (ZebraHandle zh, 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; } @@ -2070,7 +2070,7 @@ int zebra_delete_record (ZebraHandle zh, 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); @@ -2100,18 +2100,18 @@ int zebra_search_PQF (ZebraHandle zh, const char *pqf_query, 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; @@ -2132,10 +2132,10 @@ int zebra_sort_by_specstr (ZebraHandle zh, 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; } diff --git a/index/zebrash.c b/index/zebrash.c index b573f5d..7c4928f 100644 --- a/index/zebrash.c +++ b/index/zebrash.c @@ -1,4 +1,4 @@ -/* $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 @@ -210,10 +210,10 @@ static int cmd_quickstart( char *args[], WRBUF outbuff) 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,""); @@ -239,7 +239,7 @@ static int cmd_yaz_log_file( char *args[], WRBUF 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 */ @@ -253,15 +253,15 @@ static int cmd_yaz_log_prefix( char *args[], WRBUF outbuff) 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 */ } @@ -560,7 +560,7 @@ struct cmdstruct cmds[] = { { "logf", "[level] text...", "writes an entry in the log", - cmd_logf}, + cmd_yaz_log}, { "", "Error handling:","", 0}, { "err", "", @@ -652,7 +652,7 @@ int onecommand( 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 *));*/ @@ -692,7 +692,7 @@ int onecommand( 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; } @@ -747,7 +747,7 @@ static void Zerrors ( WRBUF outbuff) 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", @@ -811,7 +811,7 @@ void shell() if (rc==0) { wrbuf_puts(outbuff, " OK\n"); - logf(LOG_APP, "OK"); + yaz_log(YLOG_APP, "OK"); } else if (rc>-90) { diff --git a/index/zinfo.c b/index/zinfo.c index 8e992fe..1642b8e 100644 --- a/index/zinfo.c +++ b/index/zinfo.c @@ -1,4 +1,4 @@ -/* $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 @@ -199,7 +199,7 @@ void zebraExplain_flush (ZebraExplainInfo zei, void *handle) void zebraExplain_close (ZebraExplainInfo zei) { #if ZINFO_DEBUG - yaz_log (LOG_LOG, "zebraExplain_close"); + yaz_log(YLOG_LOG, "zebraExplain_close"); #endif if (!zei) return; @@ -333,7 +333,7 @@ ZebraExplainInfo zebraExplain_open ( 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; @@ -382,7 +382,7 @@ ZebraExplainInfo zebraExplain_open ( 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; } @@ -464,7 +464,7 @@ ZebraExplainInfo zebraExplain_open ( 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); @@ -489,7 +489,7 @@ ZebraExplainInfo zebraExplain_open ( "\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; } @@ -598,7 +598,7 @@ static void zebraExplain_readAttributeDetails (ZebraExplainInfo zei, 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; } @@ -705,19 +705,19 @@ int zebraExplain_curDatabase (ZebraExplainInfo zei, const char *database) 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); } @@ -789,7 +789,7 @@ int zebraExplain_newDatabase (ZebraExplainInfo zei, const char *database, 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) @@ -918,7 +918,7 @@ static void zebraExplain_writeCategoryList (ZebraExplainInfo zei, 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); @@ -972,7 +972,7 @@ static void zebraExplain_writeAttributeDetails (ZebraExplainInfo zei, zad->dirty = 0; #if ZINFO_DEBUG - logf (LOG_LOG, "zebraExplain_writeAttributeDetails"); + yaz_log(YLOG_LOG, "zebraExplain_writeAttributeDetails"); #endif drec = createRecord (zei->records, &zad->sysno); @@ -1100,7 +1100,7 @@ static void zebraExplain_writeDatabase (ZebraExplainInfo zei, 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); @@ -1184,7 +1184,7 @@ static void zebraExplain_writeAttributeSet (ZebraExplainInfo zei, 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 : ""); #endif @@ -1461,7 +1461,7 @@ static void att_loadset(void *p, const char *n, const char *name) { 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) diff --git a/index/zrpn.c b/index/zrpn.c index 58c051f..d9364f4 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -1,4 +1,4 @@ -/* $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 @@ -61,10 +61,10 @@ static const char **rpn_char_map_handler(void *vp, const char **from, int len) 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++; } } @@ -234,10 +234,10 @@ static void add_isam_p(const char *name, const char *info, 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); @@ -680,7 +680,7 @@ static void gen_regular_rel(char *dst, int val, int islt) 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) @@ -812,7 +812,7 @@ static int string_relation(ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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: @@ -820,7 +820,7 @@ static int string_relation(ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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]; ) @@ -853,7 +853,7 @@ static int string_relation(ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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]; ) @@ -886,7 +886,7 @@ static int string_relation(ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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];) @@ -921,7 +921,7 @@ static int string_relation(ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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];) @@ -957,7 +957,7 @@ static int string_relation(ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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; @@ -992,7 +992,7 @@ static RSET term_trunc (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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 */, @@ -1033,10 +1033,10 @@ static int string_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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; @@ -1078,7 +1078,7 @@ static int string_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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) { @@ -1147,7 +1147,7 @@ static int string_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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) @@ -1232,12 +1232,12 @@ static int string_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, } 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) @@ -1247,7 +1247,7 @@ static int string_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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; } @@ -1428,7 +1428,7 @@ static int grep_info_prepare (ZebraHandle zh, } 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) { @@ -1462,7 +1462,7 @@ static RSET rpn_search_APT_phrase (ZebraHandle zh, 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, @@ -1526,7 +1526,7 @@ static RSET rpn_search_APT_or_list (ZebraHandle zh, 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, @@ -1583,7 +1583,7 @@ static RSET rpn_search_APT_and_list (ZebraHandle zh, 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, @@ -1638,7 +1638,7 @@ static int numeric_relation (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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)) @@ -1647,32 +1647,32 @@ static int numeric_relation (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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; } @@ -1731,7 +1731,7 @@ static int numeric_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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) { @@ -1784,7 +1784,7 @@ static int numeric_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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, @@ -1798,7 +1798,7 @@ static int numeric_term (ZebraHandle zh, Z_AttributesPlusTerm *zapt, 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; } @@ -1821,7 +1821,7 @@ static RSET rpn_search_APT_numeric (ZebraHandle zh, 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, @@ -1829,7 +1829,7 @@ static RSET rpn_search_APT_numeric (ZebraHandle zh, 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, @@ -2041,7 +2041,7 @@ static RSET xpath_trunc(ZebraHandle zh, NMEM stream, 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); @@ -2062,10 +2062,10 @@ static RSET rpn_search_xpath (ZebraHandle zh, 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; ireg->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; @@ -2367,14 +2367,14 @@ static RSET rpn_search_structure (ZebraHandle zh, Z_RPNStructure *zs, { 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) { @@ -2434,7 +2434,7 @@ RSET rpn_search (ZebraHandle zh, NMEM nmem, 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++) ; @@ -2443,12 +2443,12 @@ RSET rpn_search (ZebraHandle zh, NMEM nmem, 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; @@ -2525,7 +2525,7 @@ static void count_set (RSET r, int *count) 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); @@ -2539,7 +2539,7 @@ static void count_set (RSET r, int *count) 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, @@ -2604,7 +2604,7 @@ 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); @@ -2617,7 +2617,7 @@ void rpn_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, 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; @@ -2630,7 +2630,7 @@ void rpn_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, 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) { @@ -2900,9 +2900,9 @@ void rpn_scan (ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt, } *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); } diff --git a/index/zserver.c b/index/zserver.c index f208cbd..9d251a1 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -1,4 +1,4 @@ -/* $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 @@ -71,12 +71,12 @@ bend_initresult *bend_init (bend_initrequest *q) 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; } @@ -119,7 +119,7 @@ bend_initresult *bend_init (bend_initrequest *q) 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, @@ -150,7 +150,7 @@ bend_initresult *bend_init (bend_initrequest *q) } 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) @@ -160,7 +160,7 @@ bend_initresult *bend_init (bend_initrequest *q) 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); } } @@ -228,12 +228,12 @@ static void search_terms (ZebraHandle zh, bend_search_rr *r) 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; @@ -267,7 +267,7 @@ int bend_search (void *handle, bend_search_rr *r) 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: @@ -386,48 +386,48 @@ static int es_admin_request (ZebraHandle zh, Z_AdminEsRequest *r) { 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; } @@ -440,7 +440,7 @@ static int es_admin (ZebraHandle zh, Z_Admin *r) 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; @@ -465,14 +465,14 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) { 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) { @@ -483,7 +483,7 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) 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; @@ -491,46 +491,46 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) 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; @@ -564,28 +564,28 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) { 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); } @@ -650,7 +650,7 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) 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"; } @@ -668,7 +668,7 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) 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"; @@ -686,7 +686,7 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) 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"; } @@ -701,7 +701,7 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) } else { - yaz_log (LOG_WARN, "Unknown Extended Service(%d)", + yaz_log(YLOG_WARN, "Unknown Extended Service(%d)", rr->esr->taskSpecificParameters->which); rr->errcode = 221; @@ -716,7 +716,7 @@ static void bend_start (struct statserv_options_block *sob) 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 @@ -735,13 +735,13 @@ static void bend_start (struct statserv_options_block *sob) { 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); } } @@ -750,7 +750,7 @@ static void bend_start (struct statserv_options_block *sob) 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 diff --git a/index/zsets.c b/index/zsets.c index e157f4b..1428ea3 100644 --- a/index/zsets.c +++ b/index/zsets.c @@ -1,4 +1,4 @@ -/* $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 @@ -202,7 +202,7 @@ ZebraSet resultSetAdd (ZebraHandle zh, const char *name, int ov) 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) @@ -218,7 +218,7 @@ ZebraSet resultSetAdd (ZebraHandle zh, const char *name, int ov) { 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; @@ -262,14 +262,14 @@ ZebraSet resultSetGet (ZebraHandle zh, const char *name) 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); } @@ -397,7 +397,7 @@ ZebraPosSet zebraPosSetCreate (ZebraHandle zh, const char *name, 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; } @@ -455,7 +455,7 @@ ZebraPosSet zebraPosSetCreate (ZebraHandle zh, const char *name, 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++; } @@ -695,7 +695,7 @@ void resultSetSort (ZebraHandle zh, NMEM nmem, 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) @@ -769,20 +769,20 @@ void resultSetSortSingle (ZebraHandle zh, NMEM nmem, 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; @@ -815,9 +815,9 @@ void resultSetSortSingle (ZebraHandle zh, NMEM nmem, } 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, @@ -854,7 +854,7 @@ void resultSetRank (ZebraHandle zh, ZebraSet zebraSet, RSET rset) 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; @@ -886,9 +886,9 @@ void resultSetRank (ZebraHandle zh, ZebraSet zebraSet, RSET rset) } 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, diff --git a/index/zvrank.c b/index/zvrank.c index 8c1a034..304a718 100644 --- a/index/zvrank.c +++ b/index/zvrank.c @@ -1,4 +1,4 @@ -/* $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 @@ -91,14 +91,14 @@ struct rs_info { /* for result set */ 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; } @@ -116,13 +116,13 @@ typedef struct ds_info* DS; #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 @@ -141,7 +141,7 @@ typedef struct ts_info *TS; #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; } @@ -332,7 +332,7 @@ static void idf_squared(void *rsi, void *dsi) { /* 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) @@ -467,10 +467,10 @@ static void zv_init_scheme(RS rs, const char *sname) { 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]; @@ -488,12 +488,12 @@ static void zv_init_scheme(RS rs, const char *sname) { 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; @@ -511,22 +511,22 @@ static void zv_init_scheme(RS rs, const char *sname) { 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; @@ -563,13 +563,13 @@ static void zv_init_scheme(RS rs, const char *sname) { 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; @@ -587,22 +587,22 @@ static void zv_init_scheme(RS rs, const char *sname) { 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; @@ -632,12 +632,12 @@ static void zv_init_scheme(RS rs, const char *sname) { 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) */ @@ -659,7 +659,7 @@ static void *zv_create (ZebraHandle zh) { 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]; @@ -674,7 +674,7 @@ static void *zv_create (ZebraHandle zh) { */ 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); } @@ -691,7 +691,7 @@ static void *zv_begin(struct zebra_register *reg, void *class_handle, RSET rset) 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; @@ -708,11 +708,11 @@ static void *zv_begin(struct zebra_register *reg, void *class_handle, RSET rset) 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; @@ -731,7 +731,7 @@ static void *zv_begin(struct zebra_register *reg, void *class_handle, RSET rset) 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); @@ -747,7 +747,7 @@ static void zv_end (struct zebra_register *reg, void *rsi) */ 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++; } @@ -763,7 +763,7 @@ static int zv_calc (void *rsi, int sysno) 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) @@ -776,7 +776,7 @@ static int zv_calc (void *rsi, int sysno) 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 */ diff --git a/isam/isam.c b/isam/isam.c index 74b7ef2..974b08f 100644 --- a/isam/isam.c +++ b/isam/isam.c @@ -1,4 +1,4 @@ -/* $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 @@ -86,7 +86,7 @@ static int splitargs(const char *s, char *bf[], int max) 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); } @@ -109,7 +109,7 @@ ISAM is_open(BFiles bfs, const char *name, 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; @@ -138,7 +138,7 @@ ISAM is_open(BFiles bfs, const char *name, "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; @@ -146,7 +146,7 @@ ISAM is_open(BFiles bfs, const char *name, { 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) @@ -160,7 +160,7 @@ ISAM is_open(BFiles bfs, const char *name, 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); @@ -169,14 +169,14 @@ ISAM is_open(BFiles bfs, const char *name, 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; @@ -186,7 +186,7 @@ ISAM is_open(BFiles bfs, const char *name, { 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; @@ -201,12 +201,12 @@ ISAM is_open(BFiles bfs, const char *name, 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; } } @@ -215,7 +215,7 @@ ISAM is_open(BFiles bfs, const char *name, 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); @@ -226,19 +226,19 @@ ISAM is_open(BFiles bfs, const char *name, "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; @@ -259,7 +259,7 @@ ISAM is_open(BFiles bfs, const char *name, 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); } } @@ -270,19 +270,19 @@ ISAM is_open(BFiles bfs, const char *name, "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) / @@ -303,7 +303,7 @@ int is_close(ISAM is) 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) @@ -316,7 +316,7 @@ int is_close(ISAM is) 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); } } @@ -328,25 +328,25 @@ int is_close(ISAM is) 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; @@ -378,7 +378,7 @@ ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data) 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; @@ -399,13 +399,13 @@ ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data) { 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++; } } @@ -413,7 +413,7 @@ ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data) { if (operation == KEYOP_INSERT) { - logf (LOG_DEBUG, "XXSkipping insertion - match found."); + yaz_log(YLOG_DEBUG, "XXSkipping insertion - match found."); statistics.skipped_inserts++; continue; } @@ -425,7 +425,7 @@ ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data) /* 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) + @@ -442,7 +442,7 @@ ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data) 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--; @@ -457,7 +457,7 @@ ISAM_P is_merge(ISAM is, ISAM_P pos, int num, char *data) continue; } } - logf (LOG_DEBUG, "Deleting record."); + yaz_log(YLOG_DEBUG, "Deleting record."); is_m_delete_record(&tab); statistics.deletes++; } diff --git a/isam/issh.c b/isam/issh.c index 59ef271..0b15b8c 100644 --- a/isam/issh.c +++ b/isam/issh.c @@ -1,4 +1,4 @@ -/* $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 @@ -161,7 +161,7 @@ int main() 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); diff --git a/isam/memory.c b/isam/memory.c index 1720198..cbd57df 100644 --- a/isam/memory.c +++ b/isam/memory.c @@ -1,4 +1,4 @@ -/* $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 @@ -289,7 +289,7 @@ int is_m_write_record(is_mtable *tab, const void *rec) 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)); @@ -422,7 +422,7 @@ int is_m_num_records(is_mtable *tab) 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; diff --git a/isam/physical.c b/isam/physical.c index 5e41db2..b20c00e 100644 --- a/isam/physical.c +++ b/isam/physical.c @@ -1,4 +1,4 @@ -/* $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 @@ -44,14 +44,14 @@ static int is_freestore_alloc(ISAM is, int type) 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; } @@ -59,12 +59,12 @@ static void is_freestore_free(ISAM is, int type, int block) { 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); } } @@ -88,7 +88,7 @@ int is_p_read_partial(is_mtable *tab, is_mblock *block) 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 */ @@ -105,7 +105,7 @@ int is_p_read_partial(is_mtable *tab, is_mblock *block) 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); @@ -126,7 +126,7 @@ int is_p_read_full(is_mtable *tab, is_mblock *block) 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) @@ -145,7 +145,7 @@ int is_p_read_full(is_mtable *tab, is_mblock *block) 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; @@ -155,7 +155,7 @@ int is_p_read_full(is_mtable *tab, is_mblock *block) } 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; } @@ -199,12 +199,12 @@ void is_p_sync(is_mtable *tab) 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); @@ -214,7 +214,7 @@ void is_p_sync(is_mtable *tab) } 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); } } @@ -282,7 +282,7 @@ void is_p_align(is_mtable *tab) 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; @@ -303,7 +303,7 @@ void is_p_align(is_mtable *tab) { 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) @@ -371,14 +371,14 @@ void is_p_remap(is_mtable *tab) 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; diff --git a/isamb/isamb.c b/isamb/isamb.c index 8a0a584..b62515b 100644 --- a/isamb/isamb.c +++ b/isamb/isamb.c @@ -1,4 +1,4 @@ -/* $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 @@ -212,7 +212,7 @@ ISAMB isamb_open (BFiles bfs, const char *name, int writeflag, ISAMC_M *method, 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; } @@ -312,9 +312,9 @@ void isamb_close (ISAMB 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; ino_cat; i++) { @@ -347,7 +347,7 @@ static struct ISAMB_block *open_block (ISAMB b, ISAMC_P pos) 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(); } @@ -357,14 +357,14 @@ static struct ISAMB_block *open_block (ISAMB b, ISAMC_P pos) 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; } @@ -390,7 +390,7 @@ struct ISAMB_block *new_block (ISAMB b, int leaf, int cat) 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 (); } @@ -650,7 +650,7 @@ int insert_leaf (ISAMB b, struct ISAMB_block **sp1, void *lookahead_item, 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); } } @@ -735,7 +735,7 @@ int insert_leaf (ISAMB b, struct ISAMB_block **sp1, void *lookahead_item, } 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) @@ -980,11 +980,11 @@ void isamb_pp_close_x (ISAMB_PP pp, int *size, int *blocks) 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; @@ -1036,7 +1036,7 @@ static void isamb_dump_r (ISAMB b, ISAMB_P pos, void (*pr)(const char *str), 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); @@ -1055,7 +1055,7 @@ static void isamb_dump_r (ISAMB b, ISAMB_P pos, void (*pr)(const char *str), 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); @@ -1133,7 +1133,7 @@ int isamb_pp_read (ISAMB_PP pp, void *buf) (*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; } @@ -1163,7 +1163,7 @@ static int isamb_pp_on_right_node(ISAMB_PP pp, int level, const void *untilbuf) 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 */ } @@ -1176,20 +1176,20 @@ static int isamb_pp_on_right_node(ISAMB_PP pp, int level, const void *untilbuf) 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; @@ -1197,7 +1197,7 @@ static int isamb_pp_on_right_node(ISAMB_PP pp, int level, const void *untilbuf) } 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); @@ -1213,7 +1213,7 @@ static int isamb_pp_read_on_leaf(ISAMB_PP pp, void *buf) 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 */ } @@ -1224,7 +1224,7 @@ static int isamb_pp_read_on_leaf(ISAMB_PP pp, void *buf) 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; @@ -1242,7 +1242,7 @@ static int isamb_pp_forward_on_leaf(ISAMB_PP pp, void *buf, const void *untilbuf 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; @@ -1262,7 +1262,7 @@ static int isamb_pp_climb_level(ISAMB_PP pp, int *pos) 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 @@ -1273,7 +1273,7 @@ static int isamb_pp_climb_level(ISAMB_PP pp, int *pos) 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; } @@ -1283,7 +1283,7 @@ static int isamb_pp_climb_level(ISAMB_PP pp, int *pos) (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); @@ -1298,7 +1298,7 @@ static int isamb_pp_climb_level(ISAMB_PP pp, int *pos) { /* 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 ); @@ -1329,7 +1329,7 @@ static int isamb_pp_forward_unode(ISAMB_PP pp, int pos, const void *untilbuf) #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 @@ -1337,7 +1337,7 @@ static int isamb_pp_forward_unode(ISAMB_PP pp, int pos, const void *untilbuf) 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 @@ -1352,7 +1352,7 @@ static int isamb_pp_forward_unode(ISAMB_PP pp, int pos, const void *untilbuf) 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 @@ -1366,7 +1366,7 @@ static int isamb_pp_forward_unode(ISAMB_PP pp, int pos, const void *untilbuf) #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 @@ -1380,7 +1380,7 @@ static void isamb_pp_descend_to_leaf(ISAMB_PP pp, int pos, const void *untilbuf) 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 @@ -1393,7 +1393,7 @@ static void isamb_pp_descend_to_leaf(ISAMB_PP pp, int pos, const void *untilbuf) ++(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 @@ -1405,7 +1405,7 @@ static void isamb_pp_descend_to_leaf(ISAMB_PP pp, int pos, const void *untilbuf) 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 @@ -1425,7 +1425,7 @@ static int isamb_pp_climb_desc(ISAMB_PP pp, void *buf, const void *untilbuf) 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 @@ -1438,7 +1438,7 @@ static int isamb_pp_climb_desc(ISAMB_PP pp, void *buf, const void *untilbuf) 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 @@ -1452,7 +1452,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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); } @@ -1461,7 +1461,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *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 @@ -1470,7 +1470,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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 @@ -1480,7 +1480,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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 @@ -1497,7 +1497,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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 @@ -1506,7 +1506,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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 @@ -1550,10 +1550,10 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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) @@ -1562,13 +1562,13 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) { /* 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 */ } @@ -1577,7 +1577,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) (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); @@ -1588,7 +1588,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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 @@ -1610,10 +1610,10 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) { 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); @@ -1625,7 +1625,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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 */ @@ -1641,7 +1641,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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 } @@ -1652,7 +1652,7 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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 , @@ -1680,9 +1680,9 @@ int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf) 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) { @@ -1802,7 +1802,7 @@ again: 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; } @@ -1836,7 +1836,7 @@ static void isamb_pp_leaf_pos( ISAMB_PP pp, 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); } @@ -1852,7 +1852,7 @@ static void isamb_pp_upper_pos( ISAMB_PP pp, int *current, int *total, 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); @@ -1884,7 +1884,7 @@ void isamb_pp_pos( ISAMB_PP pp, int *current, int *total ) 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)); */ } diff --git a/isamb/tstisamb.c b/isamb/tstisamb.c index 2b4ad2a..307cba4 100644 --- a/isamb/tstisamb.c +++ b/isamb/tstisamb.c @@ -1,4 +1,4 @@ -/* $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 @@ -31,12 +31,12 @@ static void log_item(int level, const void *b, const char *txt) { 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) @@ -117,7 +117,7 @@ void tst_forward(ISAMB isb, int n) 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); } @@ -133,7 +133,7 @@ void tst_forward(ISAMB isb, int n) 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); } @@ -171,7 +171,7 @@ void tst_insert(ISAMB isb, int n) 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); } @@ -179,7 +179,7 @@ void tst_insert(ISAMB isb, int n) } 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); @@ -195,7 +195,7 @@ int main(int argc, char **argv) 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; @@ -209,7 +209,7 @@ int main(int argc, char **argv) bfs = bfs_create(0, 0); if (!bfs) { - yaz_log(LOG_WARN, "bfs_create failed"); + yaz_log(YLOG_WARN, "bfs_create failed"); exit(1); } @@ -219,7 +219,7 @@ int main(int argc, char **argv) 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); diff --git a/isamc/isamc.c b/isamc/isamc.c index f84c809..517a3c4 100644 --- a/isamc/isamc.c +++ b/isamc/isamc.c @@ -1,4 +1,4 @@ -/* $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 @@ -20,8 +20,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - - /* * TODO: * Reduction to lower categories in isc_merge @@ -31,6 +29,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include +#include #include #include "isamc-p.h" @@ -89,11 +88,11 @@ ISAMC isc_open (BFiles bfs, const char *name, int writeflag, ISAMC_M *method) /* 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) @@ -106,7 +105,7 @@ ISAMC isc_open (BFiles bfs, const char *name, int writeflag, ISAMC_M *method) 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); @@ -175,9 +174,9 @@ int isc_close (ISAMC is) 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; ino_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 ? @@ -190,7 +189,7 @@ int isc_close (ISAMC is) : 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; ino_files; i++) { release_fc (is, i); @@ -199,7 +198,7 @@ int isc_close (ISAMC is) 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, @@ -227,7 +226,7 @@ int isc_write_block (ISAMC is, int cat, int pos, char *src) { ++(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); } @@ -236,7 +235,7 @@ int isc_write_dblock (ISAMC is, int cat, int pos, char *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)); @@ -394,14 +393,14 @@ int isc_alloc_block (ISAMC is, int cat) 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; @@ -479,7 +478,7 @@ ISAMC_PP isc_pp_open (ISAMC is, ISAMC_P ipos) 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; @@ -546,7 +545,7 @@ int isc_read_item (ISAMC_PP pp, char **dst) (*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; } diff --git a/isamc/isamd.c b/isamc/isamd.c index 5babb4d..2cbb896 100644 --- a/isamc/isamd.c +++ b/isamc/isamd.c @@ -1,4 +1,4 @@ -/* $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 @@ -113,11 +113,11 @@ ISAMD isamd_open (BFiles bfs, const char *name, int writeflag, ISAMD_M *method) /* 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; @@ -213,10 +213,10 @@ int isamd_close (ISAMD is) 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; ino_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 ? @@ -229,7 +229,7 @@ int isamd_close (ISAMD is) : 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; ino_files; i++) { release_fc (is, i); @@ -238,7 +238,7 @@ int isamd_close (ISAMD is) 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, @@ -251,49 +251,49 @@ int isamd_close (ISAMD is) if (is->method->debug>0) { - logf (LOG_LOG, "f opens main diffonly"); + yaz_log(YLOG_LOG, "f opens main diffonly"); for (i = 0; ino_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); @@ -326,7 +326,7 @@ int isamd_read_block (ISAMD is, int cat, int pos, char *dst) ++(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); } @@ -336,7 +336,7 @@ int isamd_write_block (ISAMD is, int cat, int pos, char *src) ++(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); } @@ -345,7 +345,7 @@ int isamd_write_dblock (ISAMD is, int cat, int pos, char *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) ); @@ -504,14 +504,14 @@ int isamd_alloc_block (ISAMD is, int cat) 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) @@ -557,7 +557,7 @@ void isamd_pp_close (ISAMD_PP pp) (*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 ); @@ -625,7 +625,7 @@ ISAMD_PP isamd_pp_open (ISAMD is, const char *dictbuf, int dictlen) 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; @@ -659,7 +659,7 @@ ISAMD_PP isamd_pp_open (ISAMD is, const char *dictbuf, int dictlen) 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) ); @@ -680,7 +680,7 @@ void isamd_buildfirstblock(ISAMD_PP pp){ 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); @@ -696,7 +696,7 @@ void isamd_buildlaterblock(ISAMD_PP pp){ 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) ); @@ -774,7 +774,7 @@ int isamd_read_main_item (ISAMD_PP pp, char **dst) (*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; } @@ -782,7 +782,7 @@ int isamd_read_main_item (ISAMD_PP pp, char **dst) (*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; } @@ -825,16 +825,16 @@ void isamd_pp_dump (ISAMD is, ISAMD_P ipos) 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; @@ -845,7 +845,7 @@ void isamd_pp_dump (ISAMD is, ISAMD_P ipos) 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), @@ -854,14 +854,14 @@ void isamd_pp_dump (ISAMD is, ISAMD_P ipos) while (isize) { 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), diff --git a/isamc/merge-d.c b/isamc/merge-d.c index 69aa1b7..064ca66 100644 --- a/isamc/merge-d.c +++ b/isamc/merge-d.c @@ -1,4 +1,4 @@ -/* $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 @@ -84,7 +84,7 @@ void filter_fill(FILTER F) 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); @@ -94,7 +94,7 @@ void filter_fill(FILTER F) 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) && @@ -103,7 +103,7 @@ void filter_fill(FILTER F) (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; @@ -139,7 +139,7 @@ static int filter_read( FILTER F, 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) @@ -249,14 +249,14 @@ static void isamd_reduceblock(ISAMD_PP pp) 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 */ @@ -302,14 +302,14 @@ void isamd_free_diffs(ISAMD_PP pp) { 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); } @@ -334,7 +334,7 @@ static void getDiffInfo(ISAMD_PP pp ) 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); @@ -352,24 +352,24 @@ static void getDiffInfo(ISAMD_PP pp ) 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) ); } @@ -378,7 +378,7 @@ static void getDiffInfo(ISAMD_PP pp ) 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 */ } @@ -386,7 +386,7 @@ static void getDiffInfo(ISAMD_PP pp ) 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; @@ -411,7 +411,7 @@ static ISAMD_PP get_new_main_block( ISAMD_PP firstpp, ISAMD_PP pp) 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); @@ -419,7 +419,7 @@ static ISAMD_PP get_new_main_block( ISAMD_PP firstpp, ISAMD_PP pp) 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; @@ -449,7 +449,7 @@ static ISAMD_PP append_main_item(ISAMD_PP firstpp, 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); @@ -465,7 +465,7 @@ static ISAMD_PP append_main_item(ISAMD_PP firstpp, 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 */ @@ -518,14 +518,14 @@ int isamd_read_item_merge ( 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, @@ -560,11 +560,11 @@ int isamd_read_item_merge ( 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); @@ -578,7 +578,7 @@ int isamd_read_item_merge ( 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; @@ -589,7 +589,7 @@ int isamd_read_item_merge ( { /* 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, @@ -609,7 +609,7 @@ int isamd_read_item_merge ( 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 ); @@ -617,7 +617,7 @@ int isamd_read_item_merge ( } /* 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); @@ -632,7 +632,7 @@ int isamd_read_item_merge ( 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, @@ -642,7 +642,7 @@ int isamd_read_item_merge ( 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.*/ } @@ -652,7 +652,7 @@ int isamd_read_item_merge ( 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); @@ -660,7 +660,7 @@ int isamd_read_item_merge ( } 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); @@ -677,7 +677,7 @@ int isamd_read_item_merge ( 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); @@ -689,7 +689,7 @@ int isamd_read_item_merge ( 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); @@ -742,7 +742,7 @@ static int merge ( ISAMD_PP firstpp, /* first pp (with diffs) */ 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)); @@ -752,7 +752,7 @@ static int merge ( ISAMD_PP firstpp, /* first pp (with diffs) */ { 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 ); } @@ -766,7 +766,7 @@ static int merge ( ISAMD_PP firstpp, /* first pp (with diffs) */ 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); } @@ -776,7 +776,7 @@ static int merge ( ISAMD_PP firstpp, /* first pp (with diffs) */ 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 ); @@ -785,14 +785,14 @@ static int merge ( ISAMD_PP firstpp, /* first pp (with diffs) */ 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); @@ -811,18 +811,18 @@ static int merge ( ISAMD_PP firstpp, /* first pp (with diffs) */ 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); @@ -894,7 +894,7 @@ static int append_diffs( } 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); @@ -909,7 +909,7 @@ static int append_diffs( /* 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, @@ -928,7 +928,7 @@ static int append_diffs( 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); @@ -943,16 +943,16 @@ static int append_diffs( 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) @@ -963,9 +963,9 @@ static int append_diffs( 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 ); @@ -990,7 +990,7 @@ static int append_diffs( 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, @@ -1009,12 +1009,12 @@ static int append_diffs( } 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 numKeys < 128); assert(firstpp->numKeys >0); /* actually, 255 is good enough, but sign mismatches... */ @@ -1054,7 +1054,7 @@ int isamd_append (ISAMD is, char *dictentry, int dictlen, ISAMD_I data) 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 */ @@ -1072,11 +1072,11 @@ int isamd_append (ISAMD is, char *dictentry, int dictlen, ISAMD_I data) 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++; @@ -1088,7 +1088,7 @@ int isamd_append (ISAMD is, char *dictentry, int dictlen, ISAMD_I data) 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 */ @@ -1100,7 +1100,10 @@ int isamd_append (ISAMD is, char *dictentry, int dictlen, ISAMD_I data) /* * $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 diff --git a/isamc/merge.c b/isamc/merge.c index f8da385..ba03aba 100644 --- a/isamc/merge.c +++ b/isamc/merge.c @@ -1,4 +1,4 @@ -/* $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 @@ -105,7 +105,7 @@ static void flush_blocks (ISAMC is, struct isc_merge_block *mb, int ptr, 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; @@ -121,7 +121,7 @@ static void flush_blocks (ISAMC is, struct isc_merge_block *mb, int ptr, 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 @@ -129,7 +129,7 @@ static void flush_blocks (ISAMC is, struct isc_merge_block *mb, int ptr, 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)); @@ -190,7 +190,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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; @@ -221,7 +221,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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; @@ -237,7 +237,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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) { @@ -245,7 +245,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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; @@ -322,7 +322,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) { 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 (); } @@ -348,7 +348,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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; @@ -361,7 +361,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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; @@ -408,23 +408,23 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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) @@ -438,7 +438,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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) @@ -447,7 +447,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) } if (debug > 2) - logf (LOG_LOG, "isc: flush C, %d sections", ptr); + yaz_log(YLOG_LOG, "isc: flush C, %d sections", ptr); if (firstpos) { @@ -456,7 +456,7 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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); @@ -475,14 +475,17 @@ ISAMC_P isc_merge (ISAMC is, ISAMC_P ipos, ISAMC_I *data) 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 diff --git a/isamg/isamg.c b/isamg/isamg.c index a868d0c..adc2408 100644 --- a/isamg/isamg.c +++ b/isamg/isamg.c @@ -1,4 +1,4 @@ -/* $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 @@ -118,7 +118,7 @@ ISAMG isamg_open (BFiles bfs, int writeflag, char *isam_type_name, Res res){ 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 */ @@ -148,7 +148,10 @@ int isamg_close (ISAMG is){ /* * $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 diff --git a/isams/isams.c b/isams/isams.c index 28e4c43..afb2ebf 100644 --- a/isams/isams.c +++ b/isams/isams.c @@ -1,4 +1,4 @@ -/* $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 @@ -26,6 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #include +#include #include #include @@ -124,7 +125,7 @@ ISAMS_P isams_merge (ISAMS is, ISAMS_I data) 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; @@ -187,7 +188,7 @@ ISAMS_PP isams_pp_open (ISAMS is, ISAMS_P pos) 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; @@ -196,7 +197,7 @@ ISAMS_PP isams_pp_open (ISAMS is, ISAMS_P pos) 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) { @@ -204,7 +205,7 @@ ISAMS_PP isams_pp_open (ISAMS is, ISAMS_P 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; diff --git a/perl/zebra_perl.c b/perl/zebra_perl.c index 3143415..47c73af 100644 --- a/perl/zebra_perl.c +++ b/perl/zebra_perl.c @@ -20,17 +20,17 @@ NMEM handles; 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. @@ -122,7 +122,7 @@ void records_retrieve(ZebraHandle zh, } 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); } } @@ -132,7 +132,7 @@ void records_retrieve(ZebraHandle zh, } 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; } } @@ -212,7 +212,7 @@ int zebra_cql2pqf (cql_transform_t ct, 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); } @@ -233,18 +233,18 @@ void zebra_scan_PQF (ZebraHandle zh, 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; } @@ -257,7 +257,7 @@ void zebra_scan_PQF (ZebraHandle zh, &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); } diff --git a/recctrl/marcread.c b/recctrl/marcread.c index 88fa00d..2815382 100644 --- a/recctrl/marcread.c +++ b/recctrl/marcread.c @@ -1,4 +1,4 @@ -/* $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 @@ -60,7 +60,7 @@ static data1_node *grs_read_iso2709 (struct grs_read_info *p, int marc_xml) { 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]; @@ -71,14 +71,14 @@ static data1_node *grs_read_iso2709 (struct grs_read_info *p, int marc_xml) 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) @@ -93,7 +93,7 @@ static data1_node *grs_read_iso2709 (struct grs_read_info *p, int marc_xml) 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) @@ -137,7 +137,7 @@ static data1_node *grs_read_iso2709 (struct grs_read_info *p, int 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; } @@ -148,7 +148,7 @@ static data1_node *grs_read_iso2709 (struct grs_read_info *p, int marc_xml) 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; @@ -156,7 +156,7 @@ static data1_node *grs_read_iso2709 (struct grs_read_info *p, int marc_xml) 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; ) { @@ -189,7 +189,7 @@ static data1_node *grs_read_iso2709 (struct grs_read_info *p, int marc_xml) 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; } @@ -419,7 +419,7 @@ static inline_subfield *cat_inline_subfield(mc_subfield *psf, WRBUF buf, 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; } @@ -483,7 +483,7 @@ static void cat_inline_field(mc_field *pf, WRBUF buf, data1_node *subfield) 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; @@ -525,14 +525,14 @@ static void cat_inline_field(mc_field *pf, WRBUF buf, data1_node *subfield) } 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 } @@ -577,7 +577,7 @@ static data1_node *cat_subfield(mc_subfield *psf, WRBUF buf, 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; } @@ -653,7 +653,7 @@ static data1_node *cat_field(struct grs_read_info *p, mc_field *pf, 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; } @@ -671,7 +671,7 @@ static data1_node *cat_field(struct grs_read_info *p, mc_field *pf, )) { #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; } @@ -684,7 +684,7 @@ static data1_node *cat_field(struct grs_read_info *p, mc_field *pf, 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; @@ -726,13 +726,13 @@ static void parse_data1_tree(struct grs_read_info *p, const char *mc_stmnt, } 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) @@ -753,7 +753,7 @@ static void parse_data1_tree(struct grs_read_info *p, const char *mc_stmnt, 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, ""); diff --git a/recctrl/perlread.c b/recctrl/perlread.c index c6ba072..9534292 100644 --- a/recctrl/perlread.c +++ b/recctrl/perlread.c @@ -1,4 +1,4 @@ -/* $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 @@ -247,9 +247,9 @@ static void *grs_init_perl(void) 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, ""); @@ -260,7 +260,7 @@ void grs_destroy_perl(void *clientData) { 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; @@ -318,7 +318,7 @@ static data1_node *grs_read_perl (struct grs_read_info *p) /* 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); @@ -340,12 +340,12 @@ static data1_node *grs_read_perl (struct grs_read_info *p) 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); } diff --git a/recctrl/recgrs.c b/recctrl/recgrs.c index 5c09a82..149dba0 100644 --- a/recctrl/recgrs.c +++ b/recctrl/recgrs.c @@ -1,4 +1,4 @@ -/* $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 @@ -334,26 +334,26 @@ int d1_check_xpath_predicate(data1_node *n, struct xpath_predicate *p) 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; @@ -365,7 +365,7 @@ int d1_check_xpath_predicate(data1_node *n, struct xpath_predicate *p) } } } - yaz_log(LOG_DEBUG, "return %d", res); + yaz_log(YLOG_DEBUG, "return %d", res); return res; } else { return 1; @@ -380,7 +380,7 @@ int d1_check_xpath_predicate(data1_node *n, struct xpath_predicate *p) 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; } } @@ -447,7 +447,7 @@ data1_termlist *xpath_termlist_by_tagpath(char *tagpath, data1_node *n) 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) @@ -485,11 +485,11 @@ data1_termlist *xpath_termlist_by_tagpath(char *tagpath, data1_node *n) 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; } @@ -508,7 +508,7 @@ data1_termlist *xpath_termlist_by_tagpath(char *tagpath, data1_node *n) xfree(pexpr); if (xpe) { - yaz_log(LOG_DEBUG,"Got it"); + yaz_log(YLOG_DEBUG,"Got it"); return xpe->termlists; } else { return NULL; @@ -574,7 +574,7 @@ static void index_xpath (data1_node *n, struct recExtractCtrl *p, 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; @@ -1114,10 +1114,10 @@ static int process_comp(data1_handle dh, data1_node *n, Z_RecordComposition *c) 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; @@ -1134,23 +1134,23 @@ static int process_comp(data1_handle dh, data1_node *n, Z_RecordComposition *c) 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; @@ -1162,12 +1162,12 @@ static int process_comp(data1_handle dh, data1_node *n, Z_RecordComposition *c) } 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; } } @@ -1244,7 +1244,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) 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; @@ -1267,7 +1267,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) #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))) @@ -1283,7 +1283,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) 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); @@ -1295,7 +1295,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) 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; @@ -1334,7 +1334,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) */ 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) @@ -1362,7 +1362,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) * 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) { @@ -1378,7 +1378,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) 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) @@ -1416,7 +1416,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) } } - 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; @@ -1432,7 +1432,7 @@ static int grs_retrieve(void *clientData, struct recRetrieveCtrl *p) #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)) { diff --git a/recctrl/rectext.c b/recctrl/rectext.c index 902eb4f..f2b9101 100644 --- a/recctrl/rectext.c +++ b/recctrl/rectext.c @@ -1,4 +1,4 @@ -/* $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 @@ -100,7 +100,7 @@ static int text_extract (void *clientData, struct recExtractCtrl *p) 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); diff --git a/recctrl/regxread.c b/recctrl/regxread.c index a0513af..4aadf6a 100644 --- a/recctrl/regxread.c +++ b/recctrl/regxread.c @@ -1,4 +1,4 @@ -/* $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 @@ -412,7 +412,7 @@ static int readParseToken (const char **cpp, int *len) 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') @@ -433,7 +433,7 @@ static int readParseToken (const char **cpp, int *len) return REGX_INIT; else { - logf (LOG_WARN, "bad command %s", cmd); + yaz_log(YLOG_WARN, "bad command %s", cmd); return 0; } } @@ -472,7 +472,7 @@ static int actionListMk (struct lexSpec *spec, const char *s, 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) @@ -484,10 +484,10 @@ static int actionListMk (struct lexSpec *spec, const char *s, 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)); @@ -513,7 +513,7 @@ int readOneSpec (struct lexSpec *spec, const char *s) 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) @@ -544,17 +544,17 @@ int readOneSpec (struct lexSpec *spec, const char *s) 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++; @@ -589,13 +589,13 @@ int readFileSpec (struct lexSpec *spec) } 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 @@ -679,16 +679,16 @@ static void execData (struct lexSpec *spec, 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) @@ -807,7 +807,7 @@ static void variantBegin (struct lexSpec *spec, 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) @@ -821,7 +821,7 @@ static void variantBegin (struct lexSpec *spec, 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 @@ -846,7 +846,7 @@ static void variantBegin (struct lexSpec *spec, } #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); @@ -883,7 +883,7 @@ static void tagBegin (struct lexSpec *spec, { 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); @@ -891,7 +891,7 @@ static void tagBegin (struct lexSpec *spec, 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 ( @@ -917,7 +917,7 @@ static void tagEnd (struct lexSpec *spec, int min_level, break; } #if REGX_DEBUG - logf (LOG_LOG, "end tag(%d)", spec->d1_level); + yaz_log(YLOG_LOG, "end tag(%d)", spec->d1_level); #endif } @@ -1089,7 +1089,7 @@ static int cmd_tcl_begin (ClientData clientData, Tcl_Interp *interp, 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); @@ -1117,7 +1117,7 @@ static int cmd_tcl_begin (ClientData clientData, Tcl_Interp *interp, { 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; @@ -1126,7 +1126,7 @@ static int cmd_tcl_begin (ClientData clientData, Tcl_Interp *interp, 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; @@ -1148,7 +1148,7 @@ static int cmd_tcl_end (ClientData clientData, Tcl_Interp *interp, (spec->d1_level)--; } #if REGX_DEBUG - logf (LOG_LOG, "end record"); + yaz_log(YLOG_LOG, "end record"); #endif spec->stop_flag = 1; } @@ -1169,7 +1169,7 @@ static int cmd_tcl_end (ClientData clientData, Tcl_Interp *interp, 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; } @@ -1177,7 +1177,7 @@ static int cmd_tcl_end (ClientData clientData, Tcl_Interp *interp, 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)--; @@ -1299,7 +1299,7 @@ static void execTcl (struct lexSpec *spec, struct regxCode *code) 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]"); @@ -1330,7 +1330,7 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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); @@ -1349,7 +1349,7 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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); @@ -1412,21 +1412,21 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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")) @@ -1434,7 +1434,7 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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); @@ -1447,7 +1447,7 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) } 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; } @@ -1469,7 +1469,7 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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; } @@ -1478,14 +1478,14 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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")) { @@ -1513,12 +1513,12 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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) @@ -1541,7 +1541,7 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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); @@ -1552,12 +1552,12 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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 @@ -1582,20 +1582,20 @@ static void execCode (struct lexSpec *spec, struct regxCode *code) 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); @@ -1633,7 +1633,7 @@ static int execAction (struct lexSpec *spec, struct lexRuleAction *ap, 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 @@ -1685,7 +1685,7 @@ static int execRule (struct lexSpec *spec, struct lexContext *context, 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); @@ -1764,7 +1764,7 @@ data1_node *lexNode (struct lexSpec *spec, int *ptr) 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); } @@ -1829,7 +1829,7 @@ static data1_node *lexRoot (struct lexSpec *spec, off_t offset, } 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; @@ -1876,7 +1876,7 @@ data1_node *grs_read_regx (struct grs_read_info *p) 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)) { @@ -1922,7 +1922,7 @@ data1_node *grs_read_tcl (struct grs_read_info *p) 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)) { diff --git a/recctrl/xmlread.c b/recctrl/xmlread.c index 4769927..719d1f7 100644 --- a/recctrl/xmlread.c +++ b/recctrl/xmlread.c @@ -1,4 +1,4 @@ -/* $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 @@ -99,7 +99,7 @@ static void cb_decl (void *user, const char *version, const char *encoding, 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 @@ -176,7 +176,7 @@ static int cb_external_entity (XML_Parser pparser, 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; } @@ -187,7 +187,7 @@ static int cb_external_entity (XML_Parser pparser, 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); @@ -195,7 +195,7 @@ static int cb_external_entity (XML_Parser pparser, { if (ferror(inf)) { - yaz_log (LOG_WARN|LOG_ERRNO, "fread %s", systemId); + yaz_log(YLOG_WARN|YLOG_ERRNO, "fread %s", systemId); break; } done = 1; @@ -203,7 +203,7 @@ static int cb_external_entity (XML_Parser pparser, 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), @@ -228,7 +228,7 @@ static int cb_encoding_convert (void *data, const char *s) 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) @@ -344,7 +344,7 @@ static int cb_encoding_handler (void *userData, const char *name, { 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); } } @@ -358,7 +358,7 @@ static int cb_encoding_handler (void *userData, const char *name, 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) @@ -402,7 +402,7 @@ data1_node *zebra_read_xml (data1_handle dh, int done = 0; data1_node *first_node; - uinfo.loglevel = LOG_DEBUG; + uinfo.loglevel = YLOG_DEBUG; uinfo.level = 1; uinfo.dh = dh; uinfo.nmem = m; @@ -431,14 +431,14 @@ data1_node *zebra_read_xml (data1_handle dh, 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) @@ -446,7 +446,7 @@ data1_node *zebra_read_xml (data1_handle dh, 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))); diff --git a/rset/rsbetween.c b/rset/rsbetween.c index 779e93e..0806c6c 100644 --- a/rset/rsbetween.c +++ b/rset/rsbetween.c @@ -1,4 +1,4 @@ -/* $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 @@ -130,7 +130,7 @@ static void log2 (struct rset_between_rfd *p, char *msg, int cmp_l, int cmp_r) 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, @@ -202,7 +202,7 @@ static RSFD r_open_between (RSET ct, int flag) 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)); @@ -275,7 +275,7 @@ static void r_close_between (RSFD 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); } @@ -299,7 +299,7 @@ static void r_rewind_between (RSFD rfd) 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); @@ -349,7 +349,7 @@ static int r_forward_between(RSET ct, RSFD rfd, void *buf, int *term_index, 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; } diff --git a/rset/rsbool.c b/rset/rsbool.c index 8d003c3..47ae28e 100644 --- a/rset/rsbool.c +++ b/rset/rsbool.c @@ -1,4 +1,4 @@ -/* $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 @@ -169,11 +169,11 @@ static RSFD r_open (RSET ct, int flag) 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; @@ -206,7 +206,7 @@ static void r_close (RSFD 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); } @@ -226,7 +226,7 @@ static void r_rewind (RSFD rfd) 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); @@ -242,28 +242,28 @@ static int r_forward (RSET ct, RSFD rfd, void *buf, int *term_index, 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; @@ -301,10 +301,10 @@ static int r_read_and (RSFD rfd, void *buf, int *term_index) 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) { @@ -322,10 +322,10 @@ static int r_read_and (RSFD rfd, void *buf, int *term_index) &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; } @@ -337,9 +337,9 @@ static int r_read_and (RSFD rfd, void *buf, int *term_index) &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; } @@ -355,9 +355,9 @@ static int r_read_and (RSFD rfd, void *buf, int *term_index) 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; } @@ -373,16 +373,16 @@ static int r_read_and (RSFD rfd, void *buf, int *term_index) 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; } @@ -403,10 +403,10 @@ static int r_read_and_forward (RSFD rfd, void *buf, int *term_index) 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) { @@ -424,10 +424,10 @@ static int r_read_and_forward (RSFD rfd, void *buf, int *term_index) &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; } @@ -439,9 +439,9 @@ static int r_read_and_forward (RSFD rfd, void *buf, int *term_index) &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; } @@ -456,16 +456,16 @@ static int r_read_and_forward (RSFD rfd, void *buf, int *term_index) 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) @@ -490,16 +490,16 @@ static int r_read_and_forward (RSFD rfd, void *buf, int *term_index) 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) @@ -516,7 +516,7 @@ static int r_read_and_forward (RSFD rfd, void *buf, int *term_index) } } #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; } @@ -545,9 +545,9 @@ static int r_read_or (RSFD rfd, void *buf, int *term_index) 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; } @@ -558,9 +558,9 @@ static int r_read_or (RSFD rfd, void *buf, int *term_index) 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; } @@ -571,9 +571,9 @@ static int r_read_or (RSFD rfd, void *buf, int *term_index) 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; } @@ -643,7 +643,7 @@ static int r_read_not (RSFD rfd, void *buf, int *term_index) 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; } diff --git a/rset/rset.c b/rset/rset.c index 7ec81d1..2a39d70 100644 --- a/rset/rset.c +++ b/rset/rset.c @@ -1,4 +1,4 @@ -/* $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 @@ -35,7 +35,7 @@ RSET rset_create(const struct rset_control *sel, void *parms) 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; @@ -43,9 +43,9 @@ RSET rset_create(const struct rset_control *sel, void *parms) 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; ino_rset_terms; i++) - logf (LOG_DEBUG, " %s", rnew->rset_terms[i]->name); + yaz_log(YLOG_DEBUG, " %s", rnew->rset_terms[i]->name); return rnew; } @@ -81,19 +81,19 @@ int rset_default_forward(RSET ct, RSFD rfd, void *buf, int *term_index, { 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; } diff --git a/rset/rsisam.c b/rset/rsisam.c index 692625a..43436d4 100644 --- a/rset/rsisam.c +++ b/rset/rsisam.c @@ -1,4 +1,4 @@ -/* $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 @@ -84,10 +84,10 @@ RSFD r_open (RSET ct, int flag) 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)); @@ -114,7 +114,7 @@ static void r_close (RSFD 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); } @@ -122,7 +122,7 @@ static void r_delete (RSET ct) { 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); @@ -131,7 +131,7 @@ static void r_delete (RSET ct) 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); } @@ -150,6 +150,6 @@ static int r_read (RSFD rfd, void *buf, int *term_index) 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; } diff --git a/rset/rsisamb.c b/rset/rsisamb.c index f2697d5..0999549 100644 --- a/rset/rsisamb.c +++ b/rset/rsisamb.c @@ -1,4 +1,4 @@ -/* $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 @@ -117,10 +117,10 @@ RSFD r_open (RSET ct, int flag) 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)); @@ -150,7 +150,7 @@ static void r_close (RSFD 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); } @@ -158,7 +158,7 @@ static void r_delete (RSET ct) { 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); @@ -167,7 +167,7 @@ static void r_delete (RSET ct) static void r_rewind (RSFD rfd) { - logf (LOG_DEBUG, "rsisamb_rewind"); + yaz_log(YLOG_DEBUG, "rsisamb_rewind"); abort (); } @@ -178,15 +178,15 @@ static int r_forward(RSET ct, RSFD rfd, void *buf, int *term_index, 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; } @@ -217,6 +217,6 @@ static int r_read (RSFD rfd, void *buf, int *term_index) 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; } diff --git a/rset/rsisamc.c b/rset/rsisamc.c index 8f408f3..28757ca 100644 --- a/rset/rsisamc.c +++ b/rset/rsisamc.c @@ -1,4 +1,4 @@ -/* $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 @@ -92,10 +92,10 @@ RSFD r_open (RSET ct, int flag) 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)); @@ -125,7 +125,7 @@ static void r_close (RSFD 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); } @@ -133,7 +133,7 @@ static void r_delete (RSET ct) { 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); @@ -142,7 +142,7 @@ static void r_delete (RSET ct) static void r_rewind (RSFD rfd) { - logf (LOG_DEBUG, "rsisamc_rewind"); + yaz_log(YLOG_DEBUG, "rsisamc_rewind"); abort (); } @@ -165,6 +165,6 @@ static int r_read (RSFD rfd, void *buf, int *term_index) 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; } diff --git a/rset/rsisamd.c b/rset/rsisamd.c index 9050680..ca57bc9 100644 --- a/rset/rsisamd.c +++ b/rset/rsisamd.c @@ -1,4 +1,4 @@ -/* $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 @@ -90,10 +90,10 @@ RSFD r_open (RSET ct, int flag) 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)); @@ -119,7 +119,7 @@ static void r_close (RSFD 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); } @@ -127,7 +127,7 @@ static void r_delete (RSET ct) { 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); @@ -136,7 +136,7 @@ static void r_delete (RSET ct) static void r_rewind (RSFD rfd) { - logf (LOG_DEBUG, "rsisamd_rewind"); + yaz_log(YLOG_DEBUG, "rsisamd_rewind"); abort (); } @@ -149,6 +149,6 @@ static int r_read (RSFD rfd, void *buf, int *term_index) 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; } diff --git a/rset/rsisams.c b/rset/rsisams.c index a26280e..e11f0fe 100644 --- a/rset/rsisams.c +++ b/rset/rsisams.c @@ -1,4 +1,4 @@ -/* $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 @@ -84,10 +84,10 @@ RSFD r_open (RSET ct, int flag) 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)); @@ -113,7 +113,7 @@ static void r_close (RSFD 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); } @@ -121,7 +121,7 @@ static void r_delete (RSET ct) { 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); @@ -130,7 +130,7 @@ static void r_delete (RSET ct) static void r_rewind (RSFD rfd) { - logf (LOG_DEBUG, "rsisams_rewind"); + yaz_log(YLOG_DEBUG, "rsisams_rewind"); abort (); } @@ -143,6 +143,6 @@ static int r_read (RSFD rfd, void *buf, int *term_index) 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; } diff --git a/rset/rsm_or.c b/rset/rsm_or.c index 68885bf..c666f2d 100644 --- a/rset/rsm_or.c +++ b/rset/rsm_or.c @@ -1,4 +1,4 @@ -/* $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 @@ -212,7 +212,7 @@ static RSFD r_open (RSET ct, int flag) 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)); @@ -273,7 +273,7 @@ static void r_close (RSFD 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); } @@ -351,6 +351,6 @@ static int r_read (RSFD rfd, void *buf, int *term_index) 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; } diff --git a/rset/rsnull.c b/rset/rsnull.c index 9bc3c91..06722de 100644 --- a/rset/rsnull.c +++ b/rset/rsnull.c @@ -1,4 +1,4 @@ -/* $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 @@ -72,7 +72,7 @@ static RSFD r_open (RSET ct, int flag) { 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 ""; @@ -90,7 +90,7 @@ static void r_delete (RSET ct) 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) @@ -110,7 +110,7 @@ static int r_read (RSFD rfd, void *buf, int *term_index) 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; } diff --git a/rset/rsprox.c b/rset/rsprox.c index dc70fd6..a4bbd0a 100644 --- a/rset/rsprox.c +++ b/rset/rsprox.c @@ -1,4 +1,4 @@ -/* $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 @@ -140,11 +140,11 @@ static RSFD r_open (RSET ct, int flag) 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; @@ -192,7 +192,7 @@ static void r_close (RSFD 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); } @@ -216,7 +216,7 @@ static void r_rewind (RSFD rfd) 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++) { @@ -392,7 +392,7 @@ static int r_read (RSFD rfd, void *buf, int *term_index) 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; } diff --git a/rset/rstemp.c b/rset/rstemp.c index 4fe7c6b..18b8dc8 100644 --- a/rset/rstemp.c +++ b/rset/rstemp.c @@ -1,4 +1,4 @@ -/* $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 @@ -128,7 +128,7 @@ static RSFD r_open (RSET ct, int flag) 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); } } @@ -166,7 +166,7 @@ static void r_flush (RSFD rfd, int mk) 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); @@ -176,11 +176,11 @@ static void r_flush (RSFD rfd, int mk) 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 @@ -192,7 +192,7 @@ static void r_flush (RSFD rfd, int mk) 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; @@ -201,9 +201,9 @@ static void r_flush (RSFD rfd, int mk) 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); } @@ -232,7 +232,7 @@ static void r_close (RSFD rfd) } return; } - logf (LOG_FATAL, "r_close but no rfd match!"); + yaz_log(YLOG_FATAL, "r_close but no rfd match!"); assert (0); } @@ -243,10 +243,10 @@ static void r_delete (RSET ct) 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); } @@ -279,15 +279,15 @@ static void r_reread (RSFD rfd) { 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); } diff --git a/test/api/t2.c b/test/api/t2.c index 2316204..be43424 100644 --- a/test/api/t2.c +++ b/test/api/t2.c @@ -1,4 +1,4 @@ -/* $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 @@ -59,7 +59,7 @@ int main(int argc, char **argv) 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; } diff --git a/test/api/t5.c b/test/api/t5.c index 3cb4a08..849895f 100644 --- a/test/api/t5.c +++ b/test/api/t5.c @@ -1,4 +1,4 @@ -/* $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 @@ -40,12 +40,12 @@ static void expect(ZebraHandle zh, const char *pqf, int hits_expect, 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; } diff --git a/util/charmap.c b/util/charmap.c index 298c058..983e44a 100644 --- a/util/charmap.c +++ b/util/charmap.c @@ -1,4 +1,4 @@ -/* $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 @@ -108,7 +108,7 @@ static chr_t_entry *set_map_string(chr_t_entry *root, NMEM nmem, 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 **) @@ -247,7 +247,7 @@ unsigned char zebra_prim(char **s) unsigned char c; unsigned int i = 0; - yaz_log (LOG_DEBUG, "prim %.3s", *s); + yaz_log(YLOG_DEBUG, "prim %.3s", *s); if (**s == '\\') { (*s)++; @@ -300,7 +300,7 @@ ucs4_t zebra_prim_w(ucs4_t **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)++; @@ -366,7 +366,7 @@ ucs4_t zebra_prim_w(ucs4_t **s) c = **s; ++(*s); } - yaz_log (LOG_DEBUG, "out %d", c); + yaz_log(YLOG_DEBUG, "out %d", c); return c; } @@ -417,7 +417,7 @@ static void fun_mkstring(const char *s, void *data, int num) 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'; } @@ -442,11 +442,11 @@ static void fun_add_map(const char *s, void *data, int num) 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, @@ -463,9 +463,9 @@ 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; } } @@ -516,14 +516,14 @@ static int scan_string(char *s_native, 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++; @@ -576,10 +576,10 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, 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 (); @@ -626,13 +626,13 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, { 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; @@ -644,18 +644,18 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, { 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; } } @@ -663,13 +663,13 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, { 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; } } @@ -677,13 +677,13 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, { 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; } } @@ -693,7 +693,7 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, 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; @@ -701,13 +701,13 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, 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; } } @@ -717,7 +717,7 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, if (argc != 2) { - yaz_log(LOG_FATAL, "equivalent requires 1 argument"); + yaz_log(YLOG_FATAL, "equivalent requires 1 argument"); ++errors; } w.nmem = res->nmem; @@ -725,12 +725,12 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, 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 @@ -791,7 +791,7 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, } 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); @@ -800,7 +800,7 @@ chrmaptab chrmaptab_create(const char *tabpath, const char *name, int map_only, 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) diff --git a/util/flock.c b/util/flock.c index cc3444b..a7831cf 100644 --- a/util/flock.c +++ b/util/flock.c @@ -1,4 +1,4 @@ -/* $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 @@ -147,7 +147,7 @@ ZebraLockHandle zebra_lock_create(const char *dir, const char *name) 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; } @@ -176,7 +176,7 @@ ZebraLockHandle zebra_lock_create(const char *dir, const char *name) #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); @@ -189,10 +189,10 @@ void zebra_lock_destroy(ZebraLockHandle h) { 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); @@ -211,7 +211,7 @@ void zebra_lock_destroy(ZebraLockHandle h) 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 @@ -237,12 +237,12 @@ static int unixLock(int fd, int type, int cmd) 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; } @@ -252,7 +252,7 @@ int zebra_lock_w(ZebraLockHandle h) { 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 @@ -279,7 +279,7 @@ int zebra_lock_w(ZebraLockHandle h) 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; @@ -290,7 +290,7 @@ int zebra_lock_r(ZebraLockHandle h) 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))) @@ -316,7 +316,7 @@ int zebra_lock_r(ZebraLockHandle h) 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; } @@ -324,7 +324,7 @@ int zebra_lock_r(ZebraLockHandle h) 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); @@ -358,7 +358,7 @@ int zebra_unlock(ZebraLockHandle h) 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; } @@ -376,7 +376,7 @@ static int check_for_linuxthreads() 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) @@ -394,10 +394,10 @@ void zebra_flock_init() { 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); } } diff --git a/util/passwddb.c b/util/passwddb.c index 16d5c71..fa79aed 100644 --- a/util/passwddb.c +++ b/util/passwddb.c @@ -1,4 +1,4 @@ -/* $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 @@ -122,7 +122,7 @@ void passwd_db_show (Passwd_db db) { 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) diff --git a/util/res-test.c b/util/res-test.c index 5afcaa1..e2323e9 100644 --- a/util/res-test.c +++ b/util/res-test.c @@ -1,4 +1,4 @@ -/* $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 @@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 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) @@ -41,24 +41,24 @@ 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); diff --git a/util/res.c b/util/res.c index df6d221..9fe3c30 100644 --- a/util/res.c +++ b/util/res.c @@ -1,4 +1,4 @@ -/* $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 @@ -150,7 +150,7 @@ static void reread (Res r) 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); @@ -206,7 +206,7 @@ static void reread (Res r) 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; } @@ -253,7 +253,7 @@ Res res_open (const char *name, Res def_res, Res over_res) 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; } } @@ -339,7 +339,7 @@ const char *res_get_def (Res r, const char *name, const char *def) 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 @@ -415,7 +415,7 @@ int res_write (Res r) 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); } diff --git a/util/tstflock.c b/util/tstflock.c index d44b7a8..ccb015c 100644 --- a/util/tstflock.c +++ b/util/tstflock.c @@ -1,4 +1,4 @@ -/* $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 @@ -190,7 +190,7 @@ static void tst_thread(int num, int write_flag) 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); } diff --git a/util/zebramap.c b/util/zebramap.c index 18a9f67..e90cdfd 100644 --- a/util/zebramap.c +++ b/util/zebramap.c @@ -1,4 +1,4 @@ -/* $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 @@ -98,7 +98,7 @@ static void zebra_map_read (ZebraMaps zms, const char *name) 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))) @@ -157,7 +157,7 @@ static void zebra_map_read (ZebraMaps zms, const char *name) 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) @@ -180,7 +180,7 @@ static void zebra_map_read (ZebraMaps zms, const char *name) { *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'; @@ -263,7 +263,7 @@ chrmaptab zebra_charmap_get (ZebraMaps zms, unsigned reg_id) 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, "@"); @@ -283,10 +283,10 @@ chrmaptab zebra_charmap_get (ZebraMaps zms, unsigned reg_id) 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; } @@ -573,7 +573,7 @@ WRBUF zebra_replace(ZebraMaps zms, unsigned reg_id, const char *ex_list, 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 (;;) @@ -660,7 +660,7 @@ int zebra_replace_sub(ZebraMaps zms, unsigned reg_id, const char *ex_list, } } #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; } -- 1.7.10.4