From 4e8503c8c711511071c175bffc064c34bcbccfc3 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 9 Jan 2002 11:03:41 +0000 Subject: [PATCH] ZOOM_record_get returns ISO2709 buffer when "raw" is given. --- CHANGELOG | 2 ++ zoom/zoom-c.c | 21 ++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 963ac7e..32c3090 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ Possible compatibility problems with earlier versions marked with '*'. +ZOOM_record_get returns ISO2709 buffer when "raw" is given. + --- 1.8.4 2002/01/04 Scan for ZOOM API. New object ZOOM_scanset. New functions diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index 2c6297b..1e1be0d 100644 --- a/zoom/zoom-c.c +++ b/zoom/zoom-c.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-c.c,v 1.18 2002-01-03 12:18:38 adam Exp $ + * $Id: zoom-c.c,v 1.19 2002-01-09 11:03:41 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -923,8 +923,23 @@ void *ZOOM_record_get (ZOOM_record rec, const char *type, size_t *len) { if (npr->which == Z_NamePlusRecord_databaseRecord) { - *len = -1; - return (Z_External *) npr->u.databaseRecord; + Z_External *r = (Z_External *) npr->u.databaseRecord; + + if (r->which == Z_External_sutrs) + { + *len = r->u.sutrs->len; + return r->u.sutrs->buf; + } + else if (r->which == Z_External_octet) + { + *len = r->u.octet_aligned->len; + return r->u.octet_aligned->buf; + } + else /* grs-1, explain, ... */ + { + *len = -1; + return (Z_External *) npr->u.databaseRecord; + } } return 0; } -- 1.7.10.4