* Copyright (c) 1998-2005, Index Data.
* See the file LICENSE for details.
*
- * $Id: z-assoc.h,v 1.2 2007-04-12 15:00:33 adam Exp $
+ * $Id: z-assoc.h,v 1.3 2007-04-16 21:54:23 adam Exp $
*/
#ifndef YAZ_Z_ASSOC_INCLUDED
Z_OtherInformationUnit *update_otherInformation (
Z_OtherInformation **otherInformationP, int createFlag,
const int *oid, int categoryValue, int deleteFlag);
+ void set_otherInformationString(
+ Z_APDU *apdu,
+ const int *oid, int categoryValue, const char *str);
void set_otherInformationString (
Z_OtherInformation **otherInformationP,
const int *oid, int categoryValue,
const char *str);
- void set_otherInformationString (
- Z_OtherInformation **otherInformation,
- const char *oidname, int categoryValue,
- const char *str);
- void set_otherInformationString (
- Z_APDU *apdu,
- const char *oidval, int categoryValue,
- const char *str);
-
Z_ReferenceId *getRefID(char* str);
Z_ReferenceId **get_referenceIdP(Z_APDU *apdu);
void transfer_referenceId(Z_APDU *from, Z_APDU *to);
* Copyright (c) 2000-2007, Index Data.
* See the file LICENSE for details.
*
- * $Id: z-server.h,v 1.2 2007-04-12 15:00:33 adam Exp $
+ * $Id: z-server.h,v 1.3 2007-04-16 21:54:23 adam Exp $
*/
#include <yazpp/z-assoc.h>
class YAZ_EXPORT Z_ServerUtility {
public:
void create_databaseRecord (ODR odr, Z_NamePlusRecord *rec,
- const char *dbname, const char *format,
+ const char *dbname, const int *format,
const void *buf, int len);
void create_surrogateDiagnostics(ODR odr, Z_NamePlusRecord *rec,
const char *dbname, int error,
* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-ir-assoc.cpp,v 1.28 2007-04-12 15:00:33 adam Exp $
+ * $Id: yaz-ir-assoc.cpp,v 1.29 2007-04-16 21:54:23 adam Exp $
*/
#include <assert.h>
assert (req->otherInfo == 0);
if (m_cookie)
{
- set_otherInformationString(&req->otherInfo, OID_STR_COOKIE, 1, m_cookie);
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
+ 1, m_cookie);
assert (req->otherInfo);
}
}
if (m_cookie)
- set_otherInformationString(&req->otherInfo, OID_STR_COOKIE,
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
1, m_cookie);
if ( pRefId )
}
if (m_proxy && m_host)
- set_otherInformationString(&req->otherInfo, OID_STR_PROXY, 1, m_host);
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy,
+ 1, m_host);
if (m_cookie)
- set_otherInformationString(&req->otherInfo, OID_STR_COOKIE, 1, m_cookie);
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
+ 1, m_cookie);
return send_Z_PDU(apdu, 0);
}
}
if (m_proxy && m_host)
- set_otherInformationString(&req->otherInfo, OID_STR_PROXY, 1, m_host);
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_proxy,
+ 1, m_host);
if (m_cookie)
- set_otherInformationString(&req->otherInfo, OID_STR_COOKIE, 1, m_cookie);
+ set_otherInformationString(&req->otherInfo, yaz_oid_userinfo_cookie,
+ 1, m_cookie);
return send_Z_PDU(apdu, 0);
}
* Copyright (c) 1998-2007, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-my-client.cpp,v 1.27 2007-04-12 15:00:33 adam Exp $
+ * $Id: yaz-my-client.cpp,v 1.28 2007-04-16 21:54:23 adam Exp $
*/
#include <stdlib.h>
char *MyClient::get_cookie(Z_OtherInformation **otherInfo)
{
- Z_OtherInformationUnit *oi;
+ Z_OtherInformationUnit *oi =
+ update_otherInformation(otherInfo, 0, yaz_oid_userinfo_cookie, 1, 1);
- const int *oid =
- yaz_string_to_oid(yaz_oid_std(), CLASS_USERINFO, OID_STR_COOKIE);
-
- if (oid &&
- (oi = update_otherInformation(otherInfo, 0, oid, 1, 1)) &&
- oi->which == Z_OtherInfo_characterInfo)
+ if (oi->which == Z_OtherInfo_characterInfo)
return oi->information.characterInfo;
return 0;
}
* Copyright (c) 1998-2001, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-my-server.cpp,v 1.21 2007-04-12 15:00:33 adam Exp $
+ * $Id: yaz-my-server.cpp,v 1.22 2007-04-16 21:54:23 adam Exp $
*/
#include <stdlib.h>
const char *rec = get_record(position);
if (rec)
create_databaseRecord(odr_encode(), namePlusRecord, 0,
- OID_STR_USMARC, rec, strlen(rec));
+ yaz_oid_recsyn_usmarc, rec, strlen(rec));
else
create_surrogateDiagnostics(odr_encode(), namePlusRecord, 0,
YAZ_BIB1_PRESENT_REQUEST_OUT_OF_RANGE, 0);
* Copyright (c) 1998-2007, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-z-assoc.cpp,v 1.41 2007-04-12 15:00:33 adam Exp $
+ * $Id: yaz-z-assoc.cpp,v 1.42 2007-04-16 21:54:23 adam Exp $
*/
#include <assert.h>
}
}
-void Z_Assoc::set_otherInformationString (
+void Z_Assoc::set_otherInformationString(
Z_APDU *apdu,
- const char *oidname, int categoryValue,
- const char *str)
+ const int *oid, int categoryValue, const char *str)
{
Z_OtherInformation **otherInformation;
get_otherInfoAPDU(apdu, &otherInformation);
if (!otherInformation)
return;
- set_otherInformationString(otherInformation, oidname, categoryValue, str);
-}
-
-void Z_Assoc::set_otherInformationString (
- Z_OtherInformation **otherInformation,
- const char *oidname, int categoryValue,
- const char *str)
-{
- int *oid = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_USERINFO, oidname,
- odr_encode());
- if (!oid)
- return ;
set_otherInformationString(otherInformation, oid, categoryValue, str);
}
+
void Z_Assoc::set_otherInformationString (
Z_OtherInformation **otherInformation,
const int *oid, int categoryValue, const char *str)
* Copyright (c) 2000-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-z-server.cpp,v 1.25 2007-04-12 15:00:33 adam Exp $
+ * $Id: yaz-z-server.cpp,v 1.26 2007-04-16 21:54:23 adam Exp $
*/
#include <yaz/log.h>
* database record.
*/
void Z_ServerUtility::create_databaseRecord (
- ODR odr, Z_NamePlusRecord *rec, const char *dbname, const char *format,
+ ODR odr, Z_NamePlusRecord *rec, const char *dbname, const int *format,
const void *buf, int len)
{
- int *oid = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_RECSYN, format,
- odr);
+ int *oid = odr_oiddup(odr, format);
rec->databaseName = dbname ? odr_strdup (odr, dbname) : 0;
rec->which = Z_NamePlusRecord_databaseRecord;
rec->u.databaseRecord = z_ext_record_oid(odr, oid,
rec->u.surrogateDiagnostic = drec;
drec->which = Z_DiagRec_defaultFormat;
drec->u.defaultFormat = dr;
- dr->diagnosticSetId =
- yaz_string_to_oid_odr(yaz_oid_std(), CLASS_DIAGSET, OID_STR_BIB1, odr);
+ dr->diagnosticSetId = odr_oiddup(odr, yaz_oid_diagset_bib_1);
dr->condition = err;
dr->which = Z_DefaultDiagFormat_v2Addinfo;
*err = error;
rec->which = Z_Records_NSD;
rec->u.nonSurrogateDiagnostic = dr;
- dr->diagnosticSetId =
- yaz_string_to_oid_odr(yaz_oid_std(), CLASS_DIAGSET, OID_STR_BIB1, odr);
+ dr->diagnosticSetId = odr_oiddup(odr, yaz_oid_diagset_bib_1);
dr->condition = err;
dr->which = Z_DefaultDiagFormat_v2Addinfo;
drec->which = Z_DiagRec_defaultFormat;
drec->u.defaultFormat = dr;
- dr->diagnosticSetId =
- yaz_string_to_oid_odr(yaz_oid_std(), CLASS_DIAGSET, OID_STR_BIB1, odr);
+ dr->diagnosticSetId = odr_oiddup(odr, yaz_oid_diagset_bib_1);
dr->condition = odr_intdup (odr, error);
dr->which = Z_DefaultDiagFormat_v2Addinfo;
dr->u.v2Addinfo = odr_strdup (odr, addinfo ? addinfo : "");