ZOOM_connection_scan1 (ZOOM_connection c, ZOOM_query startterm)
ZOOM_query_cql2rpn(ZOOM_query s, const char *str, ZOOM_connection conn)
-->
-<!-- $Id: zoom.xml,v 1.63 2007-08-31 21:23:45 adam Exp $ -->
+<!-- $Id: zoom.xml,v 1.64 2007-09-08 06:17:45 adam Exp $ -->
<chapter id="zoom"><title>ZOOM</title>
<para>
&zoom; is an acronym for 'Z39.50 Object-Orientation Model' and is
<literal>const char *</literal>.
</para></listitem>
</varlistentry>
+ <varlistentry><term><literal>schema</literal></term>
+ <listitem><para>The schema of the record is returned
+ as a C null-terminated string. Return type is
+ <literal>const char *</literal>.
+ </para></listitem>
+ </varlistentry>
<varlistentry><term><literal>render</literal></term>
<listitem><para>The record is returned in a display friendly
format. Upon completion buffer is returned
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.145 2007-09-06 12:40:53 mike Exp $
+ * $Id: zoom-c.c,v 1.146 2007-09-08 06:17:45 adam Exp $
*/
/**
* \file zoom-c.c
odr_prepend(c->odr_out, "ZOOM-C",
ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.145 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.146 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion =
*len = (npr->databaseName ? strlen(npr->databaseName) : 0);
return npr->databaseName;
}
+ else if (!strcmp(type, "schema"))
+ {
+ if (len)
+ *len = rec->schema ? strlen(rec->schema) : 0;
+ return rec->schema;
+ }
else if (!strcmp(type, "syntax"))
{
const char *desc = 0;
static void record_cache_add(ZOOM_resultset r, Z_NamePlusRecord *npr,
int pos,
- const char *syntax, const char *elementSetName)
+ const char *syntax, const char *elementSetName,
+ const char *schema)
{
ZOOM_record_cache rc;
}
}
rc = (ZOOM_record_cache) odr_malloc(r->odr, sizeof(*rc));
- rc->rec.npr = npr;
+ rc->rec.npr = npr;
+ rc->rec.schema = schema ? odr_strdup(r->odr, schema) : 0;
rc->rec.odr = 0;
rc->rec.wrbuf_marc = 0;
rc->rec.wrbuf_iconv = 0;
for (i = 0; i<p->num_records; i++)
{
record_cache_add(resultset, p->records[i], i + *start,
- syntax, elementSetName);
+ syntax, elementSetName,
+ elementSetName);
}
*count -= i;
if (*count < 0)
Z_NamePlusRecord *myrec =
zget_surrogateDiagRec(resultset->odr, 0, 14, 0);
record_cache_add(resultset, myrec, *start,
- syntax, elementSetName);
+ syntax, elementSetName, 0);
}
}
else if (present_phase)
/* present response and we didn't get any records! */
Z_NamePlusRecord *myrec =
zget_surrogateDiagRec(resultset->odr, 0, 14, 0);
- record_cache_add(resultset, myrec, *start, syntax, elementSetName);
+ record_cache_add(resultset, myrec, *start, syntax, elementSetName,
+ 0);
}
}
}
npr->u.databaseRecord->u.octet_aligned->len =
npr->u.databaseRecord->u.octet_aligned->size =
res->records[i].recordData_len;
- record_cache_add(resultset, npr, pos, syntax, elementSetName);
+ record_cache_add(resultset, npr, pos, syntax, elementSetName,
+ res->records[i].recordSchema);
}
if (res->num_diagnostics > 0)
set_SRU_error(c, &res->diagnostics[0]);
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoomsh.c,v 1.48 2007-08-16 10:09:37 adam Exp $
+ * $Id: zoomsh.c,v 1.49 2007-09-08 06:17:45 adam Exp $
*/
/** \file zoomsh.c
const char *render = ZOOM_record_get(rec, "render", &len);
const char *opac_render = ZOOM_record_get(rec, "opac", &opac_len);
const char *syntax = ZOOM_record_get(rec, "syntax", 0);
+ const char *schema = ZOOM_record_get(rec, "schema", 0);
/* if rec is non-null, we got a record for display */
if (rec)
{
- printf("%d %s %s\n",
- pos, (db ? db : "unknown"), syntax);
+ printf("%d database=%s syntax=%s schema=%s\n",
+ pos, (db ? db : "unknown"), syntax,
+ schema ? schema : "unknown");
if (render)
fwrite(render, 1, len, stdout);
printf("\n");
fwrite(opac_render, 1, opac_len, stdout);
}
}
-
}
}