projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added ill_get_APDU and ill_get_Cancel.
[yaz-moved-to-github.git]
/
client
/
client.c
diff --git
a/client/client.c
b/client/client.c
index
946fe49
..
e874e31
100644
(file)
--- a/
client/client.c
+++ b/
client/client.c
@@
-1,10
+1,16
@@
/*
/*
- * Copyright (c) 1995-2000, Index Data
+ * Copyright (c) 1995-2001, Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- * Sebastian Hammer, Adam Dickmeiss
*
* $Log: client.c,v $
*
* $Log: client.c,v $
- * Revision 1.110 2001-01-29 11:19:05 adam
+ * Revision 1.112 2001-02-20 11:25:32 adam
+ * Added ill_get_APDU and ill_get_Cancel.
+ *
+ * Revision 1.111 2001/01/30 15:52:48 ja7
+ * added command for setting packageName in ES packages!
+ * command is named packagename default is NULL for server suplyed package name
+ *
+ * Revision 1.110 2001/01/29 11:19:05 adam
* Clients prints options in InitResponse.
*
* Revision 1.109 2001/01/22 10:41:47 adam
* Clients prints options in InitResponse.
*
* Revision 1.109 2001/01/22 10:41:47 adam
@@
-417,6
+423,7
@@
static NMEM session_mem = NULL; /* memory handle for init-response */
static Z_InitResponse *session = 0; /* session parameters */
static char last_scan_line[512] = "0";
static char last_scan_query[512] = "0";
static Z_InitResponse *session = 0; /* session parameters */
static char last_scan_line[512] = "0";
static char last_scan_query[512] = "0";
+char* esPackageName = 0;
static char last_cmd[100] = "?";
static FILE *marcdump = 0;
static char last_cmd[100] = "?";
static FILE *marcdump = 0;
@@
-1376,10
+1383,10
@@
static Z_External *create_external_itemRequest()
#endif
#ifdef ASN_COMPILED
#endif
#ifdef ASN_COMPILED
-static Z_External *create_external_ILLRequest()
+static Z_External *create_external_ILL_APDU(int which)
{
struct ill_get_ctl ctl;
{
struct ill_get_ctl ctl;
- ILL_Request *req;
+ ILL_APDU *ill_apdu;
Z_External *r = 0;
int ill_request_size = 0;
char *ill_request_buf = 0;
Z_External *r = 0;
int ill_request_size = 0;
char *ill_request_buf = 0;
@@
-1388,14
+1395,14
@@
static Z_External *create_external_ILLRequest()
ctl.clientData = 0;
ctl.f = get_ill_element;
ctl.clientData = 0;
ctl.f = get_ill_element;
- req = ill_get_ILLRequest(&ctl, "ill", 0);
+ ill_apdu = ill_get_APDU(&ctl, "ill", 0);
- if (!ill_Request (out, &req, 0, 0))
+ if (!ill_APDU (out, &ill_apdu, 0, 0))
{
if (apdu_file)
{
printf ("-------------------\n");
{
if (apdu_file)
{
printf ("-------------------\n");
- ill_Request(print, &req, 0, 0);
+ ill_APDU(print, &ill_apdu, 0, 0);
odr_reset(print);
printf ("-------------------\n");
}
odr_reset(print);
printf ("-------------------\n");
}
@@
-1495,7
+1502,7
@@
static Z_External *create_ItemOrderExternal(const char *type, int itemno)
{
printf ("using ILL-request\n");
r->u.itemOrder->u.esRequest->notToKeep->itemRequest =
{
printf ("using ILL-request\n");
r->u.itemOrder->u.esRequest->notToKeep->itemRequest =
- create_external_ILLRequest();
+ create_external_ILL_APDU(ILL_APDU_ILL_Request);
}
else
r->u.itemOrder->u.esRequest->notToKeep->itemRequest = 0;
}
else
r->u.itemOrder->u.esRequest->notToKeep->itemRequest = 0;
@@
-1512,7
+1519,7
@@
static int send_itemorder(const char *type, int itemno)
ItemOrderRequest.oclass = CLASS_EXTSERV;
ItemOrderRequest.value = VAL_ITEMORDER;
req->packageType = odr_oiddup(out,oid_getoidbyent(&ItemOrderRequest));
ItemOrderRequest.oclass = CLASS_EXTSERV;
ItemOrderRequest.value = VAL_ITEMORDER;
req->packageType = odr_oiddup(out,oid_getoidbyent(&ItemOrderRequest));
- req->packageName = "1.Extendedserveq";
+ req->packageName = esPackageName;
req->taskSpecificParameters = create_ItemOrderExternal(type, itemno);
req->taskSpecificParameters = create_ItemOrderExternal(type, itemno);
@@
-1539,7
+1546,7
@@
static int cmd_update(char *arg)
update_oid.value = VAL_DBUPDATE;
oid_ent_to_oid (&update_oid, oid);
req->packageType = odr_oiddup(out,oid);
update_oid.value = VAL_DBUPDATE;
oid_ent_to_oid (&update_oid, oid);
req->packageType = odr_oiddup(out,oid);
- req->packageName = "1.Extendedserveq";
+ req->packageName = esPackageName;
r = req->taskSpecificParameters = (Z_External *)
odr_malloc (out, sizeof(*r));
r = req->taskSpecificParameters = (Z_External *)
odr_malloc (out, sizeof(*r));
@@
-2324,6
+2331,17
@@
int cmd_close(char *arg)
return 2;
}
return 2;
}
+int cmd_packagename(char* arg) {
+ xfree (esPackageName);
+ esPackageName = NULL;
+ if (*arg)
+ {
+ esPackageName = (char *) xmalloc (strlen(arg)+1);
+ strcpy (esPackageName, arg);
+ }
+ return 1;
+};
+
static void initialize(void)
{
#if CCL2RPN
static void initialize(void)
{
#if CCL2RPN
@@
-2385,6
+2403,7
@@
static int client(int wait)
{"refid", cmd_refid, "<id>"},
{"itemorder", cmd_itemorder, "ill|item <itemno>"},
{"update", cmd_update, "<item>"},
{"refid", cmd_refid, "<id>"},
{"itemorder", cmd_itemorder, "ill|item <itemno>"},
{"update", cmd_update, "<item>"},
+ {"packagename", cmd_packagename, "<packagename>"},
#ifdef ASN_COMPILED
/* Server Admin Functions */
{"adm-reindex", cmd_adm_reindex, "<database-name>"},
#ifdef ASN_COMPILED
/* Server Admin Functions */
{"adm-reindex", cmd_adm_reindex, "<database-name>"},