* Copyright (c) 2000-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.28 2004-04-30 12:43:32 adam Exp $
- *
- * ZOOM layer for C, connections, result sets, queries.
+ * $Id: zoom-c.c,v 1.31 2004-10-15 00:19:01 adam Exp $
+ */
+/**
+ * \file zoom-c.c
+ * \brief Implements ZOOM C interface.
*/
+
#include <assert.h>
#include <string.h>
#include "zoom-p.h"
}
if (addinfo && addinfo2)
{
- c->addinfo = xmalloc(strlen(addinfo) + strlen(addinfo2) + 2);
+ c->addinfo = (char*) xmalloc(strlen(addinfo) + strlen(addinfo2) + 2);
strcpy(c->addinfo, addinfo);
strcat(c->addinfo, addinfo2);
}
c->proto = PROTO_HTTP;
cs_get_host_args(c->host_port, &path);
xfree(c->path);
- c->path = xmalloc(strlen(path)+2);
+ c->path = (char*) xmalloc(strlen(path)+2);
c->path[0] = '/';
strcpy (c->path+1, path);
#else
ZOOM_options_get(c->options, "implementationName"),
odr_prepend(c->odr_out, "ZOOM-C", ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.28 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.31 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion = odr_prepend(c->odr_out,
};
ODR o = odr_createmem(ODR_ENCODE);
int ret;
- Z_SOAP *p = odr_malloc(o, sizeof(*p));
+ Z_SOAP *p = (Z_SOAP*) odr_malloc(o, sizeof(*p));
Z_GDU *gdu;
ZOOM_Event event;
if (cp0 && cp1)
{
- char *h = odr_malloc(c->odr_out, cp1 - cp0 + 1);
+ char *h = (char*) odr_malloc(c->odr_out, cp1 - cp0 + 1);
memcpy (h, cp0, cp1 - cp0);
h[cp1-cp0] = '\0';
z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers,
z_HTTP_header_add(c->odr_out, &gdu->u.HTTP_Request->headers,
"SOAPAction", "\"\"");
p->which = Z_SOAP_generic;
- p->u.generic = odr_malloc(o, sizeof(*p->u.generic));
+ p->u.generic = (Z_SOAP_Generic *) odr_malloc(o, sizeof(*p->u.generic));
p->u.generic->no = 0;
p->u.generic->ns = 0;
p->u.generic->p = sr;
}
if (r->which == Z_External_sutrs)
return record_iconv_return(rec, len,
- r->u.sutrs->buf, r->u.sutrs->len,
+ (char*) r->u.sutrs->buf,
+ r->u.sutrs->len,
charset);
else if (r->which == Z_External_octet)
{
odr_malloc (p->odr_out, sizeof(Odr_oct));
notToKeep->elements[0]->u.opaque->size =
notToKeep->elements[0]->u.opaque->len = strlen(recordIdOpaque);
- notToKeep->elements[0]->u.opaque->buf =
+ notToKeep->elements[0]->u.opaque->buf = (unsigned char*)
odr_strdup(p->odr_out, recordIdOpaque);
}
else if (recordIdNumber)
apdu->u.extendedServicesRequest->taskSpecificParameters = r;
}
}
- if (!strcmp(type, "create")) /* create database */
+ else if (!strcmp(type, "create")) /* create database */
{
apdu = create_admin_package(p, Z_ESAdminOriginPartToKeep_create,
0, 0);
}
- if (!strcmp(type, "drop")) /* drop database */
+ else if (!strcmp(type, "drop")) /* drop database */
{
apdu = create_admin_package(p, Z_ESAdminOriginPartToKeep_drop,
0, 0);
}
- if (!strcmp(type, "update")) /* update record(s) */
+ else if (!strcmp(type, "commit")) /* commit changes */
+ {
+ apdu = create_admin_package(p, Z_ESAdminOriginPartToKeep_commit,
+ 0, 0);
+ }
+ else if (!strcmp(type, "update")) /* update record(s) */
{
apdu = create_update_package(p);
}
npr->u.databaseRecord->which = Z_External_octet;
npr->u.databaseRecord->u.octet_aligned = (Odr_oct *)
odr_malloc(c->odr_in, sizeof(Odr_oct));
- npr->u.databaseRecord->u.octet_aligned->buf =
+ npr->u.databaseRecord->u.octet_aligned->buf = (unsigned char*)
res->records[i].recordData_buf;
npr->u.databaseRecord->u.octet_aligned->len =
npr->u.databaseRecord->u.octet_aligned->size =
if (!ret && soap_package->which == Z_SOAP_generic &&
soap_package->u.generic->no == 0)
{
- Z_SRW_PDU *sr = soap_package->u.generic->p;
+ Z_SRW_PDU *sr = (Z_SRW_PDU*) soap_package->u.generic->p;
if (sr->which == Z_SRW_searchRetrieve_response)
handle_srw_response(c, sr->u.response);
else