/*
* $Log: admin.c,v $
- * Revision 1.9 2001-02-21 13:46:53 adam
+ * Revision 1.10 2001-07-19 19:51:41 adam
+ * Added typecasts to make C++ happy.
+ *
+ * Revision 1.9 2001/02/21 13:46:53 adam
* C++ fixes.
*
* Revision 1.8 2000/04/17 14:21:38 adam
struct dirent *ent;
int chunk = 10;
Z_APDU *apdu = 0;
+ Z_Segment *segment = 0;
ODR out = getODROutputStream();
if (arg && sscanf (arg, "%19s %1023s %1023s", type_str,
if (S_ISREG(status.st_mode) && (inf = fopen(fname, "r")))
{
- Z_Segment *segment;
Z_NamePlusRecord *rec;
Odr_oct *oct = (Odr_oct *) odr_malloc (out, sizeof(*oct));
* See the file LICENSE for details.
*
* $Log: client.c,v $
- * Revision 1.124 2001-07-04 20:13:51 ja7
+ * Revision 1.125 2001-07-19 19:51:41 adam
+ * Added typecasts to make C++ happy.
+ *
+ * Revision 1.124 2001/07/04 20:13:51 ja7
* Added new commend "proxy" for ysing a yaz-proxy to connect to the target
* Added new command line option -p for setting the proxy host
*
#include <yaz/proto.h>
#include <yaz/marcdisp.h>
#include <yaz/diagbib1.h>
+#include <yaz/otherinfo.h>
#include <yaz/pquery.h>
static char* esPackageName = 0;
static char* yazProxy = 0;
-static char last_cmd[100] = "?";
+static char last_cmd[32] = "?";
static FILE *marcdump = 0;
static char *refid = NULL;
#ifdef USE_SELECT
fd_set input;
#endif
- char line[1024], word[1024], arg[1024];
+ char line[1024], word[32], arg[1024];
#ifdef USE_SELECT
FD_ZERO(&input);
gettimeofday (&tv_start, 0);
#endif
- if ((res = sscanf(line, "%s %[^;]", word, arg)) <= 0)
+ if ((res = sscanf(line, "%31s %1023[^;]", word, arg)) <= 0)
{
strcpy(word, last_cmd);
*arg = '\0';
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: requestq.c,v $
- * Revision 1.7 1999-11-30 13:47:12 adam
+ * Revision 1.8 2001-07-19 19:51:41 adam
+ * Added typecasts to make C++ happy.
+ *
+ * Revision 1.7 1999/11/30 13:47:12 adam
* Improved installation. Moved header files to include/yaz.
*
* Revision 1.6 1998/02/11 11:53:35 adam
r->q = q;
r->len_refid = 0;
r->refid = 0;
- r->request = 0;
+ r->apdu_request = 0;
r->request_mem = 0;
r->len_response = 0;
r->clientData = 0;
* See the file LICENSE for details.
*
* $Log: seshigh.c,v $
- * Revision 1.117 2001-06-13 20:47:40 adam
+ * Revision 1.118 2001-07-19 19:51:41 adam
+ * Added typecasts to make C++ happy.
+ *
+ * Revision 1.117 2001/06/13 20:47:40 adam
* When error is returned from present handler, non-surrogate diagnostic
* is returned in present response (and fetch handler is no longer called).
*
req = request_get(&assoc->incoming); /* get a new request structure */
odr_reset(assoc->decode);
odr_setbuf(assoc->decode, assoc->input_buffer, res, 0);
- if (!z_APDU(assoc->decode, &req->request, 0, 0))
+ if (!z_APDU(assoc->decode, &req->apdu_request, 0, 0))
{
yaz_log(LOG_LOG, "ODR error on incoming PDU: %s [near byte %d] ",
odr_errmsg(odr_geterror(assoc->decode)),
return;
}
req->request_mem = odr_extract_mem(assoc->decode);
- if (assoc->print && !z_APDU(assoc->print, &req->request, 0, 0))
+ if (assoc->print && !z_APDU(assoc->print, &req->apdu_request, 0, 0))
{
yaz_log(LOG_WARN, "ODR print error: %s",
odr_errmsg(odr_geterror(assoc->print)));
*msg = "Unknown Error";
assert(req && req->state == REQUEST_IDLE);
- if (req->request->which != Z_APDU_initRequest && !assoc->init)
+ if (req->apdu_request->which != Z_APDU_initRequest && !assoc->init)
{
*msg = "Missing InitRequest";
return -1;
}
- switch (req->request->which)
+ switch (req->apdu_request->which)
{
case Z_APDU_initRequest:
res = process_initRequest(assoc, req); break;
yaz_log(LOG_DEBUG, "backend_response");
assert(assoc && req && req->state != REQUEST_IDLE);
/* determine what it is we're waiting for */
- switch (req->request->which)
+ switch (req->apdu_request->which)
{
case Z_APDU_searchRequest:
res = response_searchRequest(assoc, req, 0, &fd); break;
static Z_APDU *process_initRequest(association *assoc, request *reqb)
{
statserv_options_block *cb = statserv_getcontrol();
- Z_InitRequest *req = reqb->request->u.initRequest;
+ Z_InitRequest *req = reqb->apdu_request->u.initRequest;
Z_APDU *apdu = zget_APDU(assoc->encode, Z_APDU_initResponse);
Z_InitResponse *resp = apdu->u.initResponse;
bend_initresult *binitres;
static Z_APDU *process_searchRequest(association *assoc, request *reqb,
int *fd)
{
- Z_SearchRequest *req = reqb->request->u.searchRequest;
+ Z_SearchRequest *req = reqb->apdu_request->u.searchRequest;
bend_search_rr *bsrr =
(bend_search_rr *)nmem_malloc (reqb->request_mem, sizeof(*bsrr));
static Z_APDU *response_searchRequest(association *assoc, request *reqb,
bend_search_rr *bsrt, int *fd)
{
- Z_SearchRequest *req = reqb->request->u.searchRequest;
+ Z_SearchRequest *req = reqb->apdu_request->u.searchRequest;
Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu));
Z_SearchResponse *resp = (Z_SearchResponse *)
odr_malloc (assoc->encode, sizeof(*resp));
static Z_APDU *process_presentRequest(association *assoc, request *reqb,
int *fd)
{
- Z_PresentRequest *req = reqb->request->u.presentRequest;
+ Z_PresentRequest *req = reqb->apdu_request->u.presentRequest;
oident *prefformat;
oid_value form;
Z_APDU *apdu;
*/
static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd)
{
- Z_ScanRequest *req = reqb->request->u.scanRequest;
+ Z_ScanRequest *req = reqb->apdu_request->u.scanRequest;
Z_APDU *apdu = (Z_APDU *)odr_malloc (assoc->encode, sizeof(*apdu));
Z_ScanResponse *res = (Z_ScanResponse *)
odr_malloc (assoc->encode, sizeof(*res));
static Z_APDU *process_sortRequest(association *assoc, request *reqb,
int *fd)
{
- Z_SortRequest *req = reqb->request->u.sortRequest;
+ Z_SortRequest *req = reqb->apdu_request->u.sortRequest;
Z_SortResponse *res = (Z_SortResponse *)
odr_malloc (assoc->encode, sizeof(*res));
bend_sort_rr *bsrr = (bend_sort_rr *)
static Z_APDU *process_deleteRequest(association *assoc, request *reqb,
int *fd)
{
- Z_DeleteResultSetRequest *req = reqb->request->u.deleteResultSetRequest;
+ Z_DeleteResultSetRequest *req =
+ reqb->apdu_request->u.deleteResultSetRequest;
Z_DeleteResultSetResponse *res = (Z_DeleteResultSetResponse *)
odr_malloc (assoc->encode, sizeof(*res));
bend_delete_rr *bdrr = (bend_delete_rr *)
static void process_close(association *assoc, request *reqb)
{
- Z_Close *req = reqb->request->u.close;
+ Z_Close *req = reqb->apdu_request->u.close;
static char *reasons[] =
{
"finished",
{
bend_segment_rr request;
- request.segment = reqb->request->u.segmentRequest;
+ request.segment = reqb->apdu_request->u.segmentRequest;
request.stream = assoc->encode;
request.decode = assoc->decode;
request.print = assoc->print;
{
bend_esrequest_rr esrequest;
- Z_ExtendedServicesRequest *req = reqb->request->u.extendedServicesRequest;
+ Z_ExtendedServicesRequest *req = reqb->apdu_request->u.extendedServicesRequest;
Z_APDU *apdu = zget_APDU(assoc->encode, Z_APDU_extendedServicesResponse);
Z_ExtendedServicesResponse *resp = apdu->u.extendedServicesResponse;
yaz_log(LOG_DEBUG,"inside Process esRequest");
- esrequest.esr = reqb->request->u.extendedServicesRequest;
+ esrequest.esr = reqb->apdu_request->u.extendedServicesRequest;
esrequest.stream = assoc->encode;
esrequest.decode = assoc->decode;
esrequest.print = assoc->print;
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: session.h,v $
- * Revision 1.24 2000-11-23 10:58:32 adam
+ * Revision 1.25 2001-07-19 19:51:42 adam
+ * Added typecasts to make C++ happy.
+ *
+ * Revision 1.24 2000/11/23 10:58:32 adam
* SSL comstack support. Separate POSIX thread support library.
*
* Revision 1.23 2000/04/05 07:39:55 adam
char *refid; /* referenceid */
request_state state;
- Z_APDU *request; /* Current request */
+ Z_APDU *apdu_request; /* Current request */
NMEM request_mem; /* memory handle for request */
int size_response; /* size of buffer */
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: nmem.c,v $
- * Revision 1.25 2001-06-26 14:11:27 adam
+ * Revision 1.26 2001-07-19 19:51:42 adam
+ * Added typecasts to make C++ happy.
+ *
+ * Revision 1.25 2001/06/26 14:11:27 adam
* Added MUTEX functions for NMEM module (used by OID utility).
*
* Revision 1.24 2000/05/11 14:37:55 adam
NMEM_ENTER;
if (!*p)
{
- *p = malloc (sizeof(**p));
+ *p = (NMEM_MUTEX) malloc (sizeof(**p));
#ifdef WIN32
InitializeCriticalSection(&(*p)->m_handle);
#elif _REENTRANT
* Chas Woodfield, Fretwell Downing Datasystems.
*
* $Log: ztest.c,v $
- * Revision 1.43 2001-06-28 09:27:25 adam
+ * Revision 1.44 2001-07-19 19:51:42 adam
+ * Added typecasts to make C++ happy.
+ *
+ * Revision 1.43 2001/06/28 09:27:25 adam
* Number of Extended Services Requests logged.
*
* Revision 1.42 2001/04/06 12:26:46 adam
int ztest_esrequest (void *handle, bend_esrequest_rr *rr)
{
- int *counter = handle; /* user-defined handle - created in bend_init */
+ /* user-defined handle - created in bend_init */
+ int *counter = (int*) handle;
yaz_log(LOG_LOG, "ESRequest no %d", *counter);
}
if (toKeep)
{
- Z_External *ext = odr_malloc (rr->stream, sizeof(*ext));
- Z_IUOriginPartToKeep *keep =
- odr_malloc (rr->stream, sizeof(*keep));
- Z_IUTargetPart *targetPart =
+ Z_External *ext = (Z_External *)
+ odr_malloc (rr->stream, sizeof(*ext));
+ Z_IUOriginPartToKeep *keep = (Z_IUOriginPartToKeep *)
+ odr_malloc (rr->stream, sizeof(*keep));
+ Z_IUTargetPart *targetPart = (Z_IUTargetPart *)
odr_malloc (rr->stream, sizeof(*targetPart));
- rr->taskPackage = odr_malloc (rr->stream, sizeof(*rr->taskPackage));
+ rr->taskPackage = (Z_TaskPackage *)
+ odr_malloc (rr->stream, sizeof(*rr->taskPackage));
rr->taskPackage->packageType =
odr_oiddup (rr->stream, rr->esr->packageType);
rr->taskPackage->packageName = 0;
rr->taskPackage->targetReference = (Odr_oct *)
odr_malloc (rr->stream, sizeof(Odr_oct));
rr->taskPackage->targetReference->buf =
- odr_strdup (rr->stream, "123");
+ (unsigned char *) odr_strdup (rr->stream, "123");
rr->taskPackage->targetReference->len =
rr->taskPackage->targetReference->size =
- strlen(rr->taskPackage->targetReference->buf);
+ strlen((char *) (rr->taskPackage->targetReference->buf));
rr->taskPackage->creationDateTime = 0;
rr->taskPackage->taskStatus = odr_intdup(rr->stream, 0);
rr->taskPackage->packageDiagnostics = 0;
ext->u.update->u.taskPackage->originPart = keep;
ext->u.update->u.taskPackage->targetPart = targetPart;
- keep->action = odr_malloc (rr->stream, sizeof(int));
+ keep->action = (int *) odr_malloc (rr->stream, sizeof(int));
*keep->action = *toKeep->action;
keep->databaseName =
odr_strdup (rr->stream, toKeep->databaseName);
targetPart->updateStatus = odr_intdup (rr->stream, 1);
targetPart->num_globalDiagnostics = 0;
- targetPart->globalDiagnostics = odr_nullval();
+ targetPart->globalDiagnostics = (Z_DiagRec **) odr_nullval();
targetPart->num_taskPackageRecords = 0;
- targetPart->taskPackageRecords = odr_nullval();
+ targetPart->taskPackageRecords =
+ (Z_IUTaskPackageRecordStructure **) odr_nullval();
}
if (notToKeep)
{