/* CCL qualifiers
* Europagate, 1995
*
- * $Id: cclqfile.c,v 1.4 2004-09-29 20:37:50 adam Exp $
+ * $Id: cclqfile.c,v 1.5 2004-10-02 13:28:26 adam Exp $
*
* Old Europagate Log:
*
len = split - qual_value;
else
len = strlen(qual_value);
- svalue_ar[pair_no] = xmalloc(len+1);
+ svalue_ar[pair_no] = (char *) xmalloc(len+1);
memcpy(svalue_ar[pair_no], qual_value, len);
svalue_ar[pair_no][len] = '\0';
}
/* CCL - lexical analysis
* Europagate, 1995
*
- * $Id: ccltoken.c,v 1.3 2004-09-29 20:37:50 adam Exp $
+ * $Id: ccltoken.c,v 1.4 2004-10-02 13:28:26 adam Exp $
*
* Old Europagate Log:
*
struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command)
{
const char *aliases;
- const unsigned char *cp = command;
+ const unsigned char *cp = (const unsigned char *) command;
struct ccl_token *first = NULL;
struct ccl_token *last = NULL;
last = last->next;
}
last->next = NULL;
- last->name = cp;
+ last->name = (const char *) cp;
last->len = 1;
switch (*cp++)
{
break;
case '\"':
last->kind = CCL_TOK_TERM;
- last->name = cp;
+ last->name = (const char *) cp;
last->len = 0;
while (*cp && *cp != '\"')
{
-/* $Id: cql.y,v 1.4 2004-03-17 18:31:11 adam Exp $
+/* $Id: cql.y,v 1.5 2004-10-02 13:28:26 adam Exp $
Copyright (C) 2002-2004
Index Data Aps
{
if (lval->len+1 >= lval->size)
{
- char *nb = nmem_malloc(cp->nmem, (lval->size = lval->len * 2 + 20));
+ char *nb = (char *)
+ nmem_malloc(cp->nmem, (lval->size = lval->len * 2 + 20));
memcpy (nb, lval->buf, lval->len);
lval->buf = nb;
}
lval->rel = 0;
lval->len = 0;
lval->size = 10;
- lval->buf = nmem_malloc(cp->nmem, lval->size);
+ lval->buf = (char *) nmem_malloc(cp->nmem, lval->size);
lval->buf[0] = '\0';
do
{
-/* $Id: cqltransform.c,v 1.9 2004-05-25 14:06:15 adam Exp $
+/* $Id: cqltransform.c,v 1.10 2004-10-02 13:28:26 adam Exp $
Copyright (C) 2002-2004
Index Data Aps
* characters starting at `term', or a null pointer of there are
* none -- like memchr().
*/
-static char *wcchar(const char *term, int length)
+static const char *wcchar(const char *term, int length)
{
- char *best = 0;
- char *current;
+ const char *best = 0;
+ const char *current;
char *whichp;
for (whichp = "*?"; *whichp != '\0'; whichp++) {
- current = memchr(term, *whichp, length);
+ current = (const char *) memchr(term, *whichp, length);
if (current != 0 && (best == 0 || current < best))
best = current;
}
char *mem;
cql_pr_attr(ct, "truncation", "z3958", 0,
pr, client_data, 28);
- mem = xmalloc(length+1);
+ mem = (char *) xmalloc(length+1);
for (i = 0; i < length; i++) {
if (term[i] == '*') mem[i] = '?';
else if (term[i] == '?') mem[i] = '#';
* Copyright (c) 1995-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: odr.c,v 1.6 2004-10-01 13:16:18 adam Exp $
+ * $Id: odr.c,v 1.7 2004-10-02 13:28:26 adam Exp $
*
*/
#if HAVE_CONFIG_H
const char *buf, int len),
void (*stream_close)(void *handle))
{
- o->print = handle;
+ o->print = (FILE*) handle;
o->op->stream_write = stream_write;
o->op->stream_close = stream_close;
}
* Copyright (c) 1995-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: odr_oct.c,v 1.4 2004-08-13 08:59:07 adam Exp $
+ * $Id: odr_oct.c,v 1.5 2004-10-02 13:28:26 adam Exp $
*/
#if HAVE_CONFIG_H
#include <config.h>
odr_printf(o, "OCTETSTRING(len=%d) ", (*p)->len);
o->op->stream_write(o, o->print, ODR_OCTETSTRING,
- (*p)->buf, (*p)->len);
+ (char*) (*p)->buf, (*p)->len);
odr_printf(o, "\n");
return 1;
}
* Copyright (c) 2002-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: soap.c,v 1.7 2004-01-14 00:15:56 adam Exp $
+ * $Id: soap.c,v 1.8 2004-10-02 13:28:26 adam Exp $
*/
#include <yaz/soap.h>
ptr = ptr->children;
p->which = Z_SOAP_fault;
- p->u.fault = odr_malloc(o, sizeof(*p->u.fault));
+ p->u.fault = (Z_SOAP_Fault *) odr_malloc(o, sizeof(*p->u.fault));
p->u.fault->fault_code = 0;
p->u.fault->fault_string = 0;
p->u.fault->details = 0;
else
{
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 = i;
p->u.generic->ns = handlers[i].ns;
p->u.generic->p = handler_data;
* Copyright (c) 2002-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: srw.c,v 1.25 2004-03-17 18:43:35 adam Exp $
+ * $Id: srw.c,v 1.26 2004-10-02 13:28:26 adam Exp $
*/
#include <yaz/srw.h>
}
if (!*num)
return 1;
- *recs = odr_malloc(o, *num * sizeof(**recs));
+ *recs = (Z_SRW_record *) odr_malloc(o, *num * sizeof(**recs));
for (i = 0, ptr = pptr->children; ptr; ptr = ptr->next)
{
if (ptr->type == XML_ELEMENT_NODE &&
}
if (!*num)
return 1;
- *recs = odr_malloc(o, *num * sizeof(**recs));
+ *recs = (Z_SRW_diagnostic *) odr_malloc(o, *num * sizeof(**recs));
for (i = 0; i < *num; i++)
{
(*recs)[i].uri = 0;
}
if (!*num)
return 1;
- *terms = odr_malloc(o, *num * sizeof(**terms));
+ *terms = (Z_SRW_scanTerm *) odr_malloc(o, *num * sizeof(**terms));
for (i = 0, ptr = pptr->children; ptr; ptr = ptr->next, i++)
{
if (ptr->type == XML_ELEMENT_NODE &&
int yaz_srw_codec(ODR o, void * vptr, Z_SRW_PDU **handler_data,
void *client_data, const char *ns)
{
- xmlNodePtr pptr = vptr;
+ xmlNodePtr pptr = (xmlNodePtr) vptr;
if (o->direction == ODR_DECODE)
{
Z_SRW_PDU **p = handler_data;
if (method->type != XML_ELEMENT_NODE)
return -1;
- *p = odr_malloc(o, sizeof(**p));
+ *p = (Z_SRW_PDU *) odr_malloc(o, sizeof(**p));
(*p)->srw_version = odr_strdup(o, "1.1");
if (!strcmp(method->name, "searchRetrieveRequest"))
Z_SRW_searchRetrieveRequest *req;
(*p)->which = Z_SRW_searchRetrieve_request;
- req = (*p)->u.request = odr_malloc(o, sizeof(*req));
+ req = (*p)->u.request = (Z_SRW_searchRetrieveRequest *)
+ odr_malloc(o, sizeof(*req));
req->query_type = Z_SRW_query_type_cql;
req->query.cql = 0;
req->sort_type = Z_SRW_sort_type_none;
Z_SRW_searchRetrieveResponse *res;
(*p)->which = Z_SRW_searchRetrieve_response;
- res = (*p)->u.response = odr_malloc(o, sizeof(*res));
+ res = (*p)->u.response = (Z_SRW_searchRetrieveResponse *)
+ odr_malloc(o, sizeof(*res));
res->numberOfRecords = 0;
res->resultSetId = 0;
xmlNodePtr ptr = method->children;
(*p)->which = Z_SRW_explain_request;
- req = (*p)->u.explain_request = odr_malloc(o, sizeof(*req));
+ req = (*p)->u.explain_request = (Z_SRW_explainRequest *)
+ odr_malloc(o, sizeof(*req));
req->recordPacking = 0;
req->database = 0;
req->stylesheet = 0;
xmlNodePtr ptr = method->children;
(*p)->which = Z_SRW_explain_response;
- res = (*p)->u.explain_response = odr_malloc(o, sizeof(*res));
+ res = (*p)->u.explain_response = (Z_SRW_explainResponse*)
+ odr_malloc(o, sizeof(*res));
res->diagnostics = 0;
res->num_diagnostics = 0;
xmlNodePtr ptr = method->children;
(*p)->which = Z_SRW_scan_request;
- req = (*p)->u.scan_request = odr_malloc(o, sizeof(*req));
+ req = (*p)->u.scan_request = (Z_SRW_scanRequest *)
+ odr_malloc(o, sizeof(*req));
req->database = 0;
req->scanClause = 0;
req->stylesheet = 0;
xmlNodePtr ptr = method->children;
(*p)->which = Z_SRW_scan_response;
- res = (*p)->u.scan_response = odr_malloc(o, sizeof(*res));
+ res = (*p)->u.scan_response = (Z_SRW_scanResponse *)
+ odr_malloc(o, sizeof(*res));
res->terms = 0;
res->num_terms = 0;
res->diagnostics = 0;
* Copyright (c) 2002-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: srwutil.c,v 1.15 2004-03-24 10:14:24 adam Exp $
+ * $Id: srwutil.c,v 1.16 2004-10-02 13:28:26 adam Exp $
*/
#include <yaz/srw.h>
p1 = strchr(path, '&');
if (!p1)
p1 = strlen(path) + path;
- ret = odr_malloc(o, p1 - path + 1);
+ ret = (char *) odr_malloc(o, p1 - path + 1);
while (*path && *path != '&')
{
if (*path == '+')
Z_SRW_PDU *yaz_srw_get(ODR o, int which)
{
- Z_SRW_PDU *sr = odr_malloc(o, sizeof(*o));
+ Z_SRW_PDU *sr = (Z_SRW_PDU *) odr_malloc(o, sizeof(*o));
sr->srw_version = odr_strdup(o, "1.1");
sr->which = which;
* Copyright (c) 2000-2004, Index Data
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.29 2004-08-02 10:06:34 adam Exp $
+ * $Id: zoom-c.c,v 1.30 2004-10-02 13:28:26 adam Exp $
*
* ZOOM layer for C, connections, result sets, queries.
*/
}
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.29 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.30 $");
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)
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