summaryrefslogtreecommitdiff
path: root/net/yaz/patches
diff options
context:
space:
mode:
authordmcmahill <dmcmahill@pkgsrc.org>2003-05-16 12:17:25 +0000
committerdmcmahill <dmcmahill@pkgsrc.org>2003-05-16 12:17:25 +0000
commitf1ddcf79acb7c97b780ce902136e67df918aed81 (patch)
treea921e0b80681e91fe01ec2b83d3660e8de8e6a4f /net/yaz/patches
parent197b332fc88e89a92fe07b57469f583bb7676d85 (diff)
downloadpkgsrc-f1ddcf79acb7c97b780ce902136e67df918aed81.tar.gz
import yaz-2.0
YAZ is a C/C++ library for information retrieval applications using the Z39.50/SRW protocols for information retrieval. Properties of YAZ: * Complete Z39.50 version 3 support. Amendments and Z39.50-2002 revision is supported. * Supports SRW version 1.0 (over HTTP and HTTPS). * Includes BER encoders/decoders for the ISO ILL protocol. * Supports the following transports: BER over TCP/IP (RFC1729), BER over unix local socket, and HTTP 1.1. * Secure Socket Layer support using OpenSSL. If enabled, YAZ uses HTTPS transport (for SOAP) or "Secure BER" (for Z39.50). * Offers ZOOM C API implementing both Z39.50 and SRW. * The YAZ library offers a set of useful utilities related to the protocols, such as MARC (ISO2709) parser, CCL (ISO8777) parser, CQL parser, memory management routines, character set conversion. * Portable code. YAZ compiles out-of-the box on most Unixes and on Windows using Microsoft Visual C++. * Fast operation. The C based BER encoders/decoders as well as the server component of YAZ is very fast. * Liberal license that allows for commercial use of YAZ.
Diffstat (limited to 'net/yaz/patches')
-rw-r--r--net/yaz/patches/patch-aa144
1 files changed, 144 insertions, 0 deletions
diff --git a/net/yaz/patches/patch-aa b/net/yaz/patches/patch-aa
new file mode 100644
index 00000000000..a3e03016e40
--- /dev/null
+++ b/net/yaz/patches/patch-aa
@@ -0,0 +1,144 @@
+$NetBSD: patch-aa,v 1.1.1.1 2003/05/16 12:17:27 dmcmahill Exp $
+
+These patches are needed to avoid unaligned accesses on 64 bit
+systems.
+
+--- util/xmalloc.c.orig Mon Jan 6 08:20:28 2003
++++ util/xmalloc.c
+@@ -23,9 +23,9 @@
+
+ #if TRACE_XMALLOC > 1
+
+-static const unsigned char head[] = {44, 33, 22, 11};
+-static const unsigned char tail[] = {11, 22, 33, 44};
+-static const unsigned char freed[] = {11, 22, 33, 44};
++static const unsigned char head[] = {88, 77, 66, 55, 44, 33, 22, 11};
++static const unsigned char tail[] = {11, 22, 33, 44, 55, 66, 77, 88};
++static const unsigned char freed[] = {11, 22, 33, 44, 55, 66, 77, 88};
+
+ struct dmalloc_info {
+ int len;
+@@ -42,7 +42,7 @@ void *xmalloc_d(size_t nbytes, const cha
+ char *res;
+ struct dmalloc_info *dinfo;
+
+- if (!(res = (char*) malloc(nbytes + sizeof(*dinfo)+8*sizeof(char))))
++ if (!(res = (char*) malloc(nbytes + sizeof(*dinfo)+16*sizeof(char))))
+ return 0;
+ dinfo = (struct dmalloc_info *) res;
+ strncpy (dinfo->file, file, sizeof(dinfo->file)-1);
+@@ -56,9 +56,9 @@ void *xmalloc_d(size_t nbytes, const cha
+ dinfo->next->prev = dinfo;
+ dmalloc_list = dinfo;
+
+- memcpy(res + sizeof(*dinfo), head, 4*sizeof(char));
+- res += sizeof(*dinfo) + 4*sizeof(char);
+- memcpy(res + nbytes, tail, 4*sizeof(char));
++ memcpy(res + sizeof(*dinfo), head, 8*sizeof(char));
++ res += sizeof(*dinfo) + 8*sizeof(char);
++ memcpy(res + nbytes, tail, 8*sizeof(char));
+ return res;
+ }
+
+@@ -69,13 +69,13 @@ void xfree_d(void *ptr, const char *file
+ if (!ptr)
+ return;
+ dinfo = (struct dmalloc_info *)
+- ((char*)ptr - 4*sizeof(char) - sizeof(*dinfo));
+- if (memcmp(head, (char*) ptr - 4*sizeof(char), 4*sizeof(char)))
++ ((char*)ptr - 8*sizeof(char) - sizeof(*dinfo));
++ if (memcmp(head, (char*) ptr - 8*sizeof(char), 8*sizeof(char)))
+ {
+ yaz_log(LOG_FATAL, "xfree_d bad head, %s:%d, %p", file, line, ptr);
+ abort();
+ }
+- if (memcmp((char*) ptr + dinfo->len, tail, 4*sizeof(char)))
++ if (memcmp((char*) ptr + dinfo->len, tail, 8*sizeof(char)))
+ {
+ yaz_log(LOG_FATAL, "xfree_d bad tail, %s:%d, %p", file, line, ptr);
+ abort();
+@@ -86,7 +86,7 @@ void xfree_d(void *ptr, const char *file
+ dmalloc_list = dinfo->next;
+ if (dinfo->next)
+ dinfo->next->prev = dinfo->prev;
+- memcpy ((char*) ptr - 4*sizeof(char), freed, 4*sizeof(char));
++ memcpy ((char*) ptr - 8*sizeof(char), freed, 8*sizeof(char));
+ free(dinfo);
+ return;
+ }
+@@ -101,18 +101,18 @@ void *xrealloc_d(void *p, size_t nbytes,
+ {
+ if (!nbytes)
+ return 0;
+- res = (char *) malloc(nbytes + sizeof(*dinfo) + 8*sizeof(char));
++ res = (char *) malloc(nbytes + sizeof(*dinfo) + 16*sizeof(char));
+ }
+ else
+ {
+- if (memcmp(head, ptr - 4*sizeof(char), 4*sizeof(char)))
++ if (memcmp(head, ptr - 8*sizeof(char), 8*sizeof(char)))
+ {
+ yaz_log(LOG_FATAL, "xrealloc_d bad head, %s:%d, %p",
+ file, line, ptr);
+ abort();
+ }
+- dinfo = (struct dmalloc_info *) (ptr-4*sizeof(char) - sizeof(*dinfo));
+- if (memcmp(ptr + dinfo->len, tail, 4*sizeof(char)))
++ dinfo = (struct dmalloc_info *) (ptr-8*sizeof(char) - sizeof(*dinfo));
++ if (memcmp(ptr + dinfo->len, tail, 8*sizeof(char)))
+ {
+ yaz_log(LOG_FATAL, "xrealloc_d bad tail, %s:%d, %p",
+ file, line, ptr);
+@@ -131,7 +131,7 @@ void *xrealloc_d(void *p, size_t nbytes,
+ return 0;
+ }
+ res = (char *)
+- realloc(dinfo, nbytes + sizeof(*dinfo) + 8*sizeof(char));
++ realloc(dinfo, nbytes + sizeof(*dinfo) + 16*sizeof(char));
+ }
+ if (!res)
+ return 0;
+@@ -147,9 +147,9 @@ void *xrealloc_d(void *p, size_t nbytes,
+ dmalloc_list->prev = dinfo;
+ dmalloc_list = dinfo;
+
+- memcpy(res + sizeof(*dinfo), head, 4*sizeof(char));
+- res += sizeof(*dinfo) + 4*sizeof(char);
+- memcpy(res + nbytes, tail, 4*sizeof(char));
++ memcpy(res + sizeof(*dinfo), head, 8*sizeof(char));
++ res += sizeof(*dinfo) + 8*sizeof(char);
++ memcpy(res + nbytes, tail, 8*sizeof(char));
+ return res;
+ }
+
+@@ -159,7 +159,7 @@ void *xcalloc_d(size_t nmemb, size_t siz
+ struct dmalloc_info *dinfo;
+ size_t nbytes = nmemb * size;
+
+- if (!(res = (char*) calloc(1, nbytes+sizeof(*dinfo)+8*sizeof(char))))
++ if (!(res = (char*) calloc(1, nbytes+sizeof(*dinfo)+16*sizeof(char))))
+ return 0;
+ dinfo = (struct dmalloc_info *) res;
+ strncpy (dinfo->file, file, sizeof(dinfo->file)-1);
+@@ -173,9 +173,9 @@ void *xcalloc_d(size_t nmemb, size_t siz
+ dinfo->next->prev = dinfo;
+ dmalloc_list = dinfo;
+
+- memcpy(res + sizeof(*dinfo), head, 4*sizeof(char));
+- res += sizeof(*dinfo) + 4*sizeof(char);
+- memcpy(res + nbytes, tail, 4*sizeof(char));
++ memcpy(res + sizeof(*dinfo), head, 8*sizeof(char));
++ res += sizeof(*dinfo) + 8*sizeof(char);
++ memcpy(res + nbytes, tail, 8*sizeof(char));
+ return res;
+ }
+
+@@ -188,7 +188,7 @@ void xmalloc_trav_d(const char *file, in
+ while (dinfo)
+ {
+ yaz_log (LOG_MALLOC, " %20s:%d p=%p size=%d", dinfo->file, dinfo->line,
+- ((char*) dinfo)+sizeof(*dinfo)+4*sizeof(char), dinfo->len);
++ ((char*) dinfo)+sizeof(*dinfo)+8*sizeof(char), dinfo->len);
+ size += dinfo->len;
+ dinfo = dinfo->next;
+ }