* See the file LICENSE for details.
*
* $Log: yaz-z-server-ill.cpp,v $
- * Revision 1.3 2001-04-03 14:37:19 adam
+ * Revision 1.4 2001-04-04 14:02:49 adam
+ * URSULA / Z-ruth service.
+ *
+ * Revision 1.3 2001/04/03 14:37:19 adam
* More work ILL-service.
*
* Revision 1.2 2001/03/29 15:14:26 adam
#include <yaz/log.h>
#include <yaz++/yaz-z-server.h>
-/*
- * database record.
- */
-void Yaz_Facility_ILL::create_databaseRecord (
- Z_NamePlusRecord *rec, const char *dbname, int format,
- const void *buf, int len)
-{
- rec->databaseName = dbname ? odr_strdup (m_odr, dbname) : 0;
- rec->which = Z_NamePlusRecord_databaseRecord;
- rec->u.databaseRecord = z_ext_record (m_odr, format,
- (const char *) buf, len);
-}
-
-/*
- * surrogate diagnostic.
- */
-void Yaz_Facility_ILL::create_surrogateDiagnostics(
- Z_NamePlusRecord *rec, const char *dbname, int error, char *const addinfo)
-{
- int oid[OID_SIZE];
- int *err = (int *)odr_malloc (m_odr, sizeof(*err));
- oident bib1;
- Z_DiagRec *drec = (Z_DiagRec *)odr_malloc (m_odr, sizeof(*drec));
- Z_DefaultDiagFormat *dr = (Z_DefaultDiagFormat *)
- odr_malloc (m_odr, sizeof(*dr));
-
- bib1.proto = PROTO_Z3950;
- bib1.oclass = CLASS_DIAGSET;
- bib1.value = VAL_BIB1;
-
- yaz_log(LOG_DEBUG, "SurrogateDiagnotic: %d -- %s", error, addinfo);
- *err = error;
- rec->databaseName = dbname ? odr_strdup (m_odr, dbname) : 0;
- rec->which = Z_NamePlusRecord_surrogateDiagnostic;
- rec->u.surrogateDiagnostic = drec;
- drec->which = Z_DiagRec_defaultFormat;
- drec->u.defaultFormat = dr;
- dr->diagnosticSetId = odr_oiddup (m_odr,
- oid_ent_to_oid(&bib1, oid));
- dr->condition = err;
- dr->which = Z_DefaultDiagFormat_v2Addinfo;
- dr->u.v2Addinfo = odr_strdup (m_odr, addinfo ? addinfo : "");
-}
-
-ODR Yaz_Facility_ILL::odr_encode()
-{
- return m_odr;
-}
-
int Yaz_Facility_ILL::init(Yaz_Z_Server *s, Z_InitRequest *initRequest,
Z_InitResponse *initResponse)
{
{
Z_APDU *apdu_response;
- m_odr = s->odr_encode();
if (apdu_request->which != Z_APDU_extendedServicesRequest)
return 0;
Z_ExtendedServicesRequest *req = apdu_request->u.extendedServicesRequest;