* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*
- * $Id: retrieval.h,v 1.3 2006-05-07 14:48:24 adam Exp $
+ * $Id: retrieval.h,v 1.4 2006-05-08 19:48:26 adam Exp $
*/
/**
* \file retrieval.h
\retval -1 failure, use yaz_retrieval_get_error() for reason
\retval 1 schema does not match
\retval 2 syntax does not match
- \retval 3 neither schema, nor syntax matches
- \retval 4 both match but not together
+ \retval 3 both match but not together
*/
YAZ_EXPORT
int yaz_retrieval_request(yaz_retrieval_t p,
* Copyright (C) 2005-2006, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: retrieval.c,v 1.6 2006-05-08 11:58:37 adam Exp $
+ * $Id: retrieval.c,v 1.7 2006-05-08 19:48:26 adam Exp $
*/
/**
* \file retrieval.c
int syntax_matches = 0;
int schema_matches = 0;
+ wrbuf_rewind(p->wr_error);
if (!el)
return 0;
for(; el; el = el->next)
schema_ok = 1;
if (!schema)
schema_ok = 1;
+ if (schema && !el->schema)
+ schema_ok = 1;
if (syntax && el->syntax && !oid_oidcmp(syntax, el->syntax))
syntax_ok = 1;
return 0;
}
}
- if (syntax_matches && !schema_matches)
- return 1;
- if (!syntax_matches && schema_matches)
+ if (!syntax_matches && syntax)
+ {
+ wrbuf_printf(p->wr_error, "%s", syntax);
return 2;
- if (!syntax_matches && !schema_matches)
- return 3;
- return 4;
+ }
+ if (schema)
+ wrbuf_printf(p->wr_error, "%s", schema);
+ if (!schema_matches)
+ return 1;
+ return 3;
}
const char *yaz_retrieval_get_error(yaz_retrieval_t p)
* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.78 2006-05-08 10:16:47 adam Exp $
+ * $Id: seshigh.c,v 1.79 2006-05-08 19:48:26 adam Exp $
*/
/**
* \file seshigh.c
&rc,
&backend_schema,
&backend_syntax);
+ yaz_log(YLOG_LOG, "yaz_retrieval_request r=%d", r);
if (r == -1) /* error ? */
{
const char *details = yaz_retrieval_get_error(
rr->errstring = odr_strdup(rr->stream, details);
return -1;
}
- else if (r == 1)
+ else if (r == 1 || r == 3)
{
const char *details = input_schema;
rr->errcode = YAZ_BIB1_ELEMENT_SET_NAMES_UNSUPP;
else if (r == 2)
{
rr->errcode = YAZ_BIB1_RECORD_SYNTAX_UNSUPP;
- return -1;
- }
- else if (r == 3)
- {
- const char *details = input_schema;
- rr->errcode = YAZ_BIB1_ELEMENT_SET_NAMES_UNSUPP;
- if (details)
- rr->errstring = odr_strdup(rr->stream, details);
- return -1;
- }
- else if (r == 4)
- {
- rr->errcode = YAZ_BIB1_RECORD_NOT_AVAILABLE_IN_REQUESTED_SYNTAX;
+ if (input_syntax_raw)
+ {
+ char oidbuf[OID_STR_MAX];
+ oid_to_dotstring(input_syntax_raw, oidbuf);
+ rr->errstring = odr_strdup(rr->stream, oidbuf);
+ }
return -1;
}
if (backend_schema)
assoc->init->implementation_name,
odr_prepend(assoc->encode, "GFS", resp->implementationName));
- version = odr_strdup(assoc->encode, "$Revision: 1.78 $");
+ version = odr_strdup(assoc->encode, "$Revision: 1.79 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
resp->implementationVersion = odr_prepend(assoc->encode,