From 51dc2c663ed5a3a77aea662e9e9b09d2f3b53659 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 23 Jul 2002 12:33:21 +0000 Subject: [PATCH] Towards 1.1.3 --- CHANGELOG | 11 +++++++++++ README | 3 ++- bfile/mfile.c | 48 +++++++++++++++++++++++++++--------------------- configure.in | 8 ++++---- include/mfile.h | 17 +++++++++-------- include/zebraver.h | 8 ++++---- zebra.spec | 2 +- zmbol.spec | 2 +- 8 files changed, 59 insertions(+), 40 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3d3141a..80eada9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,12 @@ +--- 1.1.3 2002/23/07 + +Using busy wait for file locking on NT. + +--- 1.1.2 2002/23/07 + +64 bit NT file system support. + +--- 1.1.1 2002/09/04 (branch for stable version) Fix XML attributes for MARC reader. @@ -311,3 +320,5 @@ Changed some malloc() to xmalloc(). --- 1.0a1 1995/11/28 First release. + +($Id) diff --git a/README b/README index b580bca..e7aca14 100644 --- a/README +++ b/README @@ -1,7 +1,8 @@ Copyright (C) 1995-2002, Index Data ApS. See the file LICENSE.zebra for details. -Zebra: $Id: README,v 1.13 2002-04-05 08:46:26 adam Exp $ +README for Zebra + $Id: README,v 1.5.2.1 2002-07-23 12:33:21 adam Exp $ Documentation about this software can be found in the subdirectory 'doc' and Zebra's home page: http://www.indexdata.dk/zebra/ diff --git a/bfile/mfile.c b/bfile/mfile.c index d00e78e..f24491e 100644 --- a/bfile/mfile.c +++ b/bfile/mfile.c @@ -1,14 +1,14 @@ /* - * Copyright (C) 1994-1999, Index Data + * Copyright (C) 1994-2002, Index Data * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: mfile.c,v $ - * Revision 1.43 2002-04-04 20:50:36 adam - * Multi register works with record paths and data1 profile path + * Revision 1.41.2.1 2002-07-23 12:33:21 adam + * Towards 1.1.3 * - * Revision 1.42 2002/04/04 14:14:13 adam - * Multiple registers (alpha early) + * Revision 1.41.4.1 2002/07/23 09:32:41 adam + * 64 bit file access on WIN32 * * Revision 1.41 2000/11/29 14:24:01 adam * Script configure uses yaz pthreads options. Added locking for @@ -165,7 +165,7 @@ #include #include -static int scan_areadef(MFile_area ma, const char *ad, const char *base) +static int scan_areadef(MFile_area ma, const char *name, const char *ad) { /* * If no definition is given, use current directory, unlimited. @@ -174,23 +174,17 @@ static int scan_areadef(MFile_area ma, const char *ad, const char *base) mf_dir **dp = &ma->dirs, *dir = *dp; if (!ad) - ad = ".:-1b"; + ad = ".:-1b"; for (;;) { const char *ad0 = ad; int i = 0, fact = 1, multi; - off_t size = 0; + mfile_off_t size = 0; while (*ad == ' ' || *ad == '\t') ad++; if (!*ad) break; - if (!yaz_is_abspath(ad) && base) - { - strcpy (dirname, base); - i = strlen(dirname); - dirname[i++] = '/'; - } while (*ad) { if (*ad == ':' && strchr ("+-0123456789", ad[1])) @@ -276,8 +270,14 @@ static int file_position(MFile mf, int pos, int offset) logf (LOG_WARN|LOG_ERRNO, "Failed to open %s", mf->files[c].path); return -1; } - if (lseek(mf->files[c].fd, (ps = pos - off) * mf->blocksize + offset, - SEEK_SET) < 0) + if ( +#ifdef WIN32 + _lseeki64 +#else + lseek +#endif + (mf->files[c].fd, (mfile_off_t) (ps = pos-off) * mf->blocksize + offset, + SEEK_SET) == (mfile_off_t) (-1)) { logf (LOG_WARN|LOG_ERRNO, "Failed to seek in %s", mf->files[c].path); return -1; @@ -295,7 +295,7 @@ static int cmp_part_file(const void *p1, const void *p2) * Create a new area, cotaining metafiles in directories. * Find the part-files in each directory, and inventory the existing metafiles. */ -MFile_area mf_init(const char *name, const char *spec, const char *base) +MFile_area mf_init(const char *name, const char *spec) { MFile_area ma = (MFile_area) xmalloc(sizeof(*ma)); mf_dir *dirp; @@ -310,7 +310,7 @@ MFile_area mf_init(const char *name, const char *spec, const char *base) strcpy(ma->name, name); ma->mfiles = 0; ma->dirs = 0; - if (scan_areadef(ma, spec, base) < 0) + if (scan_areadef(ma, name, spec) < 0) { logf (LOG_WARN, "Failed to access description of '%s'", name); return 0; @@ -372,7 +372,13 @@ MFile_area mf_init(const char *name, const char *spec, const char *base) dent->d_name); return 0; } - if ((part_f->bytes = lseek(fd, 0, SEEK_END)) < 0) + if ((part_f->bytes = +#ifdef WIN32 + _lseeki64 +#else + lseek +#endif + (fd, (mfile_off_t) 0, SEEK_END)) == (mfile_off_t)(-1)) { logf (LOG_FATAL|LOG_ERRNO, "Failed to seek in %s", dent->d_name); @@ -638,8 +644,8 @@ int mf_write(MFile mf, int no, int offset, int nbytes, const void *buf) mf->files[mf->cur_file].dir = dp; mf->files[mf->cur_file].number = mf->files[mf->cur_file-1].number + 1; - mf->files[mf->cur_file].blocks = - mf->files[mf->cur_file].bytes = 0; + mf->files[mf->cur_file].blocks = 0; + mf->files[mf->cur_file].bytes = 0; mf->files[mf->cur_file].fd = -1; sprintf(tmp, "%s/%s-%d.mf", dp->name, mf->name, mf->files[mf->cur_file].number); diff --git a/configure.in b/configure.in index 63f7958..f255547 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ -dnl Zebra, Index Data Aps, 1994-2000 -dnl $Id: configure.in,v 1.29.2.1 2002-04-09 14:55:40 adam Exp $ +dnl Zebra, Index Data Aps, 1994-2002 +dnl $Id: configure.in,v 1.29.2.2 2002-07-23 12:33:21 adam Exp $ dnl AC_INIT(include/zebraver.h) AC_MSG_CHECKING(for package) @@ -7,12 +7,12 @@ if test -r ${srcdir}/LICENSE.zmbol; then AC_MSG_RESULT([Z'mbol]) PROGPREFIX=zmbol AC_DEFINE(ZMBOL,1) - AM_INIT_AUTOMAKE(zmbol,1.1.1) + AM_INIT_AUTOMAKE(zmbol,1.1.3) else AC_MSG_RESULT([Zebra]) PROGPREFIX=zebra AC_DEFINE(ZMBOL,0) - AM_INIT_AUTOMAKE(zebra,1.1.1) + AM_INIT_AUTOMAKE(zebra,1.1.3) if test ! -r ${srcdir}/isam; then mkdir ${srcdir}/isam fi diff --git a/include/mfile.h b/include/mfile.h index 81fd99e..a6dd193 100644 --- a/include/mfile.h +++ b/include/mfile.h @@ -3,7 +3,7 @@ * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * - * $Id: mfile.h,v 1.17 2002-04-04 14:14:13 adam Exp $ + * $Id: mfile.h,v 1.16.2.1 2002-07-23 12:33:22 adam Exp $ */ #ifndef MFILE_H @@ -13,9 +13,10 @@ #include #ifdef WIN32 -typedef long off_t; +typedef __int64 mfile_off_t; #else #include +typedef off_t mfile_off_t; #endif #ifndef FILENAME_MAX @@ -36,8 +37,8 @@ YAZ_BEGIN_CDECL typedef struct mf_dir { char name[FILENAME_MAX+1]; - off_t max_bytes; /* allocated bytes in this dir. */ - off_t avail_bytes; /* bytes left */ + mfile_off_t max_bytes; /* allocated bytes in this dir. */ + mfile_off_t avail_bytes; /* bytes left */ struct mf_dir *next; } mf_dir; @@ -46,7 +47,7 @@ typedef struct part_file int number; int top; int blocks; - off_t bytes; + mfile_off_t bytes; mf_dir *dir; char *path; int fd; @@ -62,8 +63,8 @@ typedef struct meta_file int no_files; int cur_file; int open; /* is this file open? */ - off_t blocksize; - off_t min_bytes_creat; /* minimum bytes required to enter directory */ + int blocksize; + mfile_off_t min_bytes_creat; /* minimum bytes required to enter directory */ MFile_area ma; int wr; Zebra_mutex mutex; @@ -83,7 +84,7 @@ typedef struct MFile_area_struct /* * Open an area, cotaining metafiles in directories. */ -MFile_area mf_init(const char *name, const char *spec, const char *base); +MFile_area mf_init(const char *name, const char *spec); /* * Release an area. diff --git a/include/zebraver.h b/include/zebraver.h index b25fa75..e94c519 100644 --- a/include/zebraver.h +++ b/include/zebraver.h @@ -1,14 +1,14 @@ /* - * Copyright (C) 1994-2001, Index Data + * Copyright (C) 1994-2002, Index Data * All rights reserved. * - * $Id: zebraver.h,v 1.18.2.1 2002-04-09 14:55:40 adam Exp $ + * $Id: zebraver.h,v 1.18.2.2 2002-07-23 12:33:22 adam Exp $ */ #ifndef ZEBRAVER -#define ZEBRAVER "1.1.1" +#define ZEBRAVER "1.1.3" #endif #ifndef ZEBRADATE -#define ZEBRADATE "$Date: 2002-04-09 14:55:40 $" +#define ZEBRADATE "$Date: 2002-07-23 12:33:22 $" #endif diff --git a/zebra.spec b/zebra.spec index 8428878..5977842 100644 --- a/zebra.spec +++ b/zebra.spec @@ -1,5 +1,5 @@ Name: zebra -Version: 1.1.1 +Version: 1.1.3 Release: 1 Requires: yaz Copyright: Distributable diff --git a/zmbol.spec b/zmbol.spec index 61bd9ec..8fb5370 100644 --- a/zmbol.spec +++ b/zmbol.spec @@ -1,5 +1,5 @@ Name: zmbol -Version: 1.1.1 +Version: 1.1.3 Release: 1 Requires: yaz Copyright: Commercial -- 1.7.10.4