* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: client.c,v 1.336 2007-05-03 08:04:10 adam Exp $
+ * $Id: client.c,v 1.337 2007-05-06 20:12:19 adam Exp $
*/
/** \file client.c
* \brief yaz-client program
#define AVOID_MARC_DECODE 1
#define maxOtherInfosSupported 10
-struct {
+struct eoi {
int oid[OID_SIZE];
char* value;
} extraOtherInfos[maxOtherInfosSupported];
return 0;
}
*len = fsize;
- *buf = odr_malloc(out, fsize);
+ *buf = (char *) odr_malloc(out, fsize);
if (fread(*buf, 1, fsize, inf) != fsize)
{
printf("Unable to read %s\n", fname);
Z_GDU *gdu;
char *path = 0;
- path = odr_malloc(out, 2+strlen(databaseNames[0]));
+ path = (char *) odr_malloc(out, 2+strlen(databaseNames[0]));
*path = '/';
strcpy(path+1, databaseNames[0]);
/* If this fails, no problem: we detect cqltrans == 0 later */
#if HAVE_READLINE_READLINE_H
- rl_attempted_completion_function = (CPPFunction*)readline_completer;
+ rl_attempted_completion_function =
+ (char **(*)(const char *, int, int)) readline_completer;
#endif
for(i = 0; i < maxOtherInfosSupported; ++i) {
extraOtherInfos[i].oid[0] = -1;
soap_handlers);
if (!ret && soap_package->which == Z_SOAP_generic)
{
- 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(sr->u.response);
else if (sr->which == Z_SRW_explain_response)
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: fhistory.c,v 1.3 2007-03-19 22:17:41 adam Exp $
+ * $Id: fhistory.c,v 1.4 2007-05-06 20:12:19 adam Exp $
*/
/** \file fhistory.c
* \brief file history implementation
file_history_t file_history_new()
{
- file_history_t fh = xmalloc(sizeof(*fh));
+ file_history_t fh = (file_history_t) xmalloc(sizeof(*fh));
fh->wr = wrbuf_alloc();
return fh;
}
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* $Id: oid_db.h,v 1.5 2007-04-16 21:53:08 adam Exp $ */
+/* $Id: oid_db.h,v 1.6 2007-05-06 20:12:20 adam Exp $ */
/**
* \file oid_db.h
char *name;
};
+YAZ_END_CDECL
+
#define Z3950_PREFIX 1, 2, 840, 10003
#include <yaz/oid_std.h>
-YAZ_END_CDECL
-
#endif
/*
* Local variables:
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/* $Id: xmlquery.h,v 1.9 2007-01-03 08:42:14 adam Exp $ */
+/* $Id: xmlquery.h,v 1.10 2007-05-06 20:12:20 adam Exp $ */
/** \file xmlquery.h
\brief Query / XML conversions
YAZ_EXPORT void yaz_query2xml(const Z_Query *q, xmlDocPtr *docp);
YAZ_EXPORT void yaz_rpnquery2xml(const Z_RPNQuery *rpn, xmlDocPtr *docp);
-YAZ_EXPORT void yaz_xml2query(const void *xmlnodep, Z_Query **query, ODR odr,
- int *error_code, const char **addinfo);
+YAZ_EXPORT void yaz_xml2query(const xmlNode *xmlnodep, Z_Query **query,
+ ODR odr, int *error_code, const char **addinfo);
YAZ_END_CDECL
const char *qname,
const char *t, size_t len)
{
- struct ccl_stop_info *csi = nmem_malloc(csw->nmem, sizeof(*csi));
+ struct ccl_stop_info *csi = (struct ccl_stop_info *)
+ nmem_malloc(csw->nmem, sizeof(*csi));
struct ccl_stop_info **csip = &csw->removed_items;
if (qname)
csi->qualname = nmem_strdup(csw->nmem, qname);
else
csi->qualname = 0;
- csi->term = nmem_malloc(csw->nmem, len+1);
+ csi->term = (char *) nmem_malloc(csw->nmem, len+1);
memcpy(csi->term, t, len);
csi->term[len] = '\0';
csi->next = 0;
ccl_stop_words_t ccl_stop_words_create(void)
{
NMEM nmem = nmem_create();
- ccl_stop_words_t csw = xmalloc(sizeof(*csw));
+ ccl_stop_words_t csw = (ccl_stop_words_t) xmalloc(sizeof(*csw));
csw->nmem = nmem;
csw->removed_items = 0;
csw->blank_chars = xstrdup(" \r\n\t");
/* CCL qualifiers
* Europagate, 1995
*
- * $Id: cclqual.c,v 1.11 2007-05-01 12:54:44 adam Exp $
+ * $Id: cclqual.c,v 1.12 2007-05-06 20:12:20 adam Exp $
*
* Old Europagate Log:
*
void ccl_qual_add_special(CCL_bibset bibset, const char *n, const char *cp)
{
size_t no = 2;
- char **vlist = xmalloc(no * sizeof(*vlist));
+ char **vlist = (char **) xmalloc(no * sizeof(*vlist));
yaz_tok_cfg_t yt = yaz_tok_cfg_create();
int t;
size_t i = 0;
while (t == YAZ_TOK_STRING)
{
if (i >= no-1)
- vlist = xrealloc(vlist, (no = no * 2) * sizeof(*vlist));
+ vlist = (char **) xrealloc(vlist, (no = no * 2) * sizeof(*vlist));
vlist[i++] = xstrdup(yaz_tok_parse_string(tp));
t = yaz_tok_move(tp);
}
/* CCL - lexical analysis
* Europagate, 1995
*
- * $Id: ccltoken.c,v 1.13 2007-05-01 12:54:44 adam Exp $
+ * $Id: ccltoken.c,v 1.14 2007-05-06 20:12:20 adam Exp $
*
* Old Europagate Log:
*
static const char **create_ar(const char *v1, const char *v2)
{
- const char **a = xmalloc(3 * sizeof(*a));
+ const char **a = (const char **) xmalloc(3 * sizeof(*a));
a[0] = xstrdup(v1);
if (v2)
{
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: elementset.c,v 1.3 2007-01-03 08:42:15 adam Exp $
+ * $Id: elementset.c,v 1.4 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file elementset.c
void yaz_set_esn(Z_RecordComposition **comp_p, const char *esn, NMEM nmem)
{
- Z_RecordComposition *comp = nmem_malloc(nmem, sizeof(*comp));
+ Z_RecordComposition *comp = (Z_RecordComposition *)
+ nmem_malloc(nmem, sizeof(*comp));
comp->which = Z_RecordComp_simple;
- comp->u.simple = nmem_malloc(nmem, sizeof(*comp->u.simple));
+ comp->u.simple = (Z_ElementSetNames *)
+ nmem_malloc(nmem, sizeof(*comp->u.simple));
comp->u.simple->which = Z_ElementSetNames_generic;
comp->u.simple->u.generic = nmem_strdup(nmem, esn);
*comp_p = comp;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: http.c,v 1.1 2007-01-11 10:55:57 adam Exp $
+ * $Id: http.c,v 1.2 2007-05-06 20:12:20 adam Exp $
*/
/**
const char *l = "Content-Type";
if (charset)
{
- char *ctype = odr_malloc(o, strlen(content_type)+strlen(charset) + 15);
+ char *ctype = (char *)
+ odr_malloc(o, strlen(content_type)+strlen(charset) + 15);
sprintf(ctype, "%s; charset=%s", content_type, charset);
z_HTTP_header_add(o, hp, l, ctype);
}
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: log.c,v 1.50 2007-04-17 20:26:18 adam Exp $
+ * $Id: log.c,v 1.51 2007-05-06 20:12:20 adam Exp $
*/
/**
}
mask_names[i].mask = next_log_bit;
next_log_bit = next_log_bit<<1;
- mask_names[i].name = malloc(strlen(name)+1);
+ mask_names[i].name = (char *) malloc(strlen(name)+1);
strcpy(mask_names[i].name, name);
mask_names[i+1].name = NULL;
mask_names[i+1].mask = 0;
* Copyright (C) 1995-2007, Index Data ApS
* All rights reserved.
*
- * $Id: logrpn.c,v 1.16 2007-04-12 13:52:57 adam Exp $
+ * $Id: logrpn.c,v 1.17 2007-05-06 20:12:20 adam Exp $
*/
/**
yaz_log_zquery_level(YLOG_LOG, q);
}
-void wrbuf_diags(WRBUF b, int num_diagnostics,Z_DiagRec **diags)
-{
- /* we only dump the first diag - that keeps the log cleaner. */
- wrbuf_printf(b," ERROR ");
- if (diags[0]->which != Z_DiagRec_defaultFormat)
- wrbuf_printf(b,"(diag not in default format?)");
- else
- {
- Z_DefaultDiagFormat *e=diags[0]->u.defaultFormat;
- if (e->condition)
- wrbuf_printf(b, "%d ",*e->condition);
- else
- wrbuf_printf(b, "?? ");
- if ((e->which==Z_DefaultDiagFormat_v2Addinfo) && (e->u.v2Addinfo))
- wrbuf_printf(b,"%s ",e->u.v2Addinfo);
- else if ((e->which==Z_DefaultDiagFormat_v3Addinfo) && (e->u.v3Addinfo))
- wrbuf_printf(b,"%s ",e->u.v3Addinfo);
- }
-}
/*
* Local variables:
* c-basic-offset: 4
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: marc_read_xml.c,v 1.2 2007-01-03 08:42:15 adam Exp $
+ * $Id: marc_read_xml.c,v 1.3 2007-05-06 20:12:20 adam Exp $
*/
/**
for (p = ptr->children; p ; p = p->next)
if (p->type == XML_TEXT_NODE)
ctrl_data_len += strlen((const char *)p->content);
- ctrl_data_buf = nmem_malloc(nmem, ctrl_data_len+1);
+ ctrl_data_buf = (char *) nmem_malloc(nmem, ctrl_data_len+1);
strcpy(ctrl_data_buf, (const char *)ptr_code->content);
for (p = ptr->children; p ; p = p->next)
if (p->type == XML_TEXT_NODE)
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: marcdisp.c,v 1.49 2007-03-20 21:37:32 adam Exp $
+ * $Id: marcdisp.c,v 1.50 2007-05-06 20:12:20 adam Exp $
*/
/**
static struct yaz_marc_node *yaz_marc_add_node(yaz_marc_t mt)
{
- struct yaz_marc_node *n = nmem_malloc(mt->nmem, sizeof(*n));
+ struct yaz_marc_node *n = (struct yaz_marc_node *)
+ nmem_malloc(mt->nmem, sizeof(*n));
n->next = 0;
*mt->nodes_pp = n;
mt->nodes_pp = &n->next;
if (mt->subfield_pp)
{
- struct yaz_marc_subfield *n = nmem_malloc(mt->nmem, sizeof(*n));
+ struct yaz_marc_subfield *n = (struct yaz_marc_subfield *)
+ nmem_malloc(mt->nmem, sizeof(*n));
n->code_data = nmem_strdupn(mt->nmem, code_data, code_data_len);
n->next = 0;
/* mark subfield_pp to point to this one, so we append here next */
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: mime.c,v 1.3 2007-01-03 08:42:15 adam Exp $
+ * $Id: mime.c,v 1.4 2007-05-06 20:12:20 adam Exp $
*/
/** \file mime.c
yaz_mime_types yaz_mime_types_create()
{
- yaz_mime_types p = xmalloc(sizeof(*p));
+ yaz_mime_types p = (yaz_mime_types) xmalloc(sizeof(*p));
p->table = 0;
return p;
}
void yaz_mime_types_add(yaz_mime_types t, const char *suffix,
const char *mime_type)
{
- struct yaz_mime_entry *e = xmalloc(sizeof(*e));
+ struct yaz_mime_entry *e = (struct yaz_mime_entry *) xmalloc(sizeof(*e));
e->mime_type = xstrdup(mime_type);
e->suffix = xstrdup(suffix);
e->next = t->table;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: nmemsdup.c,v 1.10 2007-01-03 08:42:15 adam Exp $
+ * $Id: nmemsdup.c,v 1.11 2007-05-06 20:12:20 adam Exp $
*/
/**
#endif
#include <string.h>
-#include <yaz/nmem.h>
-#if YAZ_HAVE_XML2
-#include <libxml/tree.h>
-#endif
+#include <yaz/nmem_xml.h>
char *nmem_strdup (NMEM mem, const char *src)
{
else
{
size_t i = 0;
- *darray = nmem_malloc(nmem, *num * sizeof(**darray));
+ *darray = (char **) nmem_malloc(nmem, *num * sizeof(**darray));
for (cp = dstr; *cp; )
{
const char *cp0;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: odr_mem.c,v 1.10 2007-04-12 13:52:57 adam Exp $
+ * $Id: odr_mem.c,v 1.11 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file odr_mem.c
Odr_oct *odr_create_Odr_oct(ODR o, const unsigned char *buf, int sz)
{
Odr_oct *p = (Odr_oct *) odr_malloc(o, sizeof(Odr_oct));
- p->buf = odr_malloc(o, sz);
+ p->buf = (unsigned char *) odr_malloc(o, sz);
memcpy(p->buf, buf, sz);
p->size = sz;
p->len = sz;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: oid_db.c,v 1.6 2007-04-18 08:08:02 adam Exp $
+ * $Id: oid_db.c,v 1.7 2007-05-06 20:12:20 adam Exp $
*/
/**
while (oid_db->next)
oid_db = oid_db->next;
- oid_db->next = xmalloc(sizeof(*oid_db->next));
+ oid_db->next = (struct yaz_oid_db *) xmalloc(sizeof(*oid_db->next));
oid_db = oid_db->next;
oid_db->next = 0;
oid_db->xmalloced = 1;
- oid_db->entries = ent = xmalloc(2 * sizeof(*ent));
+ oid_db->entries = ent = (struct yaz_oid_entry *) xmalloc(2 * sizeof(*ent));
- alloc_oid = xmalloc(sizeof(*alloc_oid) * (oid_oidlen(new_oid)+1));
+ alloc_oid = (int *)
+ xmalloc(sizeof(*alloc_oid) * (oid_oidlen(new_oid)+1));
oid_oidcpy(alloc_oid, new_oid);
ent[0].oid = alloc_oid;
ent[0].name = xstrdup(name);
yaz_oid_db_t yaz_oid_db_new(void)
{
- yaz_oid_db_t p = xmalloc(sizeof(*p));
+ yaz_oid_db_t p = (yaz_oid_db_t) xmalloc(sizeof(*p));
p->entries = 0;
p->next = 0;
p->xmalloced = 1;
# Copyright (c) Index Data 2006-2007
# See the file LICENSE for details.
#
-# $Id: oidtoc.tcl,v 1.3 2007-04-24 12:55:15 adam Exp $
+# $Id: oidtoc.tcl,v 1.4 2007-05-06 20:12:20 adam Exp $
#
# Converts a CSV file with Object identifiers to C
set lname [string map {- _ . _ { } _ ( {} ) {}} $lname]
set prefix [string tolower [lindex $oid 0]]
- puts -nonewline $cfile "YAZ_EXPORT const int yaz_oid_${prefix}_${lname}\[\] = \{"
+ puts -nonewline $cfile "YAZ_EXPORT extern const int yaz_oid_${prefix}_${lname}\[\] = \{"
puts -nonewline $cfile [string map {. ,} [lindex $oid 1]]
puts $cfile ",-1\};"
* Copyright (C) 1995-2007, Index Data ApS
* All rights reserved.
*
- * $Id: querytowrbuf.c,v 1.9 2007-04-12 13:52:57 adam Exp $
+ * $Id: querytowrbuf.c,v 1.10 2007-05-06 20:12:20 adam Exp $
*/
/** \file querytowrbuf.c
yaz_apt_to_wrbuf(b, zapt);
}
+void wrbuf_diags(WRBUF b, int num_diagnostics,Z_DiagRec **diags)
+{
+ /* we only dump the first diag - that keeps the log cleaner. */
+ wrbuf_printf(b," ERROR ");
+ if (diags[0]->which != Z_DiagRec_defaultFormat)
+ wrbuf_printf(b,"(diag not in default format?)");
+ else
+ {
+ Z_DefaultDiagFormat *e=diags[0]->u.defaultFormat;
+ if (e->condition)
+ wrbuf_printf(b, "%d ",*e->condition);
+ else
+ wrbuf_printf(b, "?? ");
+ if ((e->which==Z_DefaultDiagFormat_v2Addinfo) && (e->u.v2Addinfo))
+ wrbuf_printf(b,"%s ",e->u.v2Addinfo);
+ else if ((e->which==Z_DefaultDiagFormat_v3Addinfo) && (e->u.v3Addinfo))
+ wrbuf_printf(b,"%s ",e->u.v3Addinfo);
+ }
+}
+
/*
* Local variables:
* c-basic-offset: 4
* Copyright (C) 2005-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: record_conv.c,v 1.15 2007-03-19 14:40:07 adam Exp $
+ * $Id: record_conv.c,v 1.16 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file record_conv.c
yaz_record_conv_t yaz_record_conv_create()
{
- yaz_record_conv_t p = xmalloc(sizeof(*p));
+ yaz_record_conv_t p = (yaz_record_conv_t) xmalloc(sizeof(*p));
p->nmem = nmem_create();
p->wr_error = wrbuf_alloc();
p->rules = 0;
static struct yaz_record_conv_rule *add_rule(yaz_record_conv_t p,
enum YAZ_RECORD_CONV_RULE type)
{
- struct yaz_record_conv_rule *r = nmem_malloc(p->nmem, sizeof(*r));
+ struct yaz_record_conv_rule *r = (struct yaz_record_conv_rule *)
+ nmem_malloc(p->nmem, sizeof(*r));
r->which = type;
r->next = 0;
*p->rules_p = r;
* Copyright (C) 2005-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: retrieval.c,v 1.19 2007-04-12 20:47:28 adam Exp $
+ * $Id: retrieval.c,v 1.20 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file retrieval.c
yaz_retrieval_t yaz_retrieval_create()
{
- yaz_retrieval_t p = xmalloc(sizeof(*p));
+ yaz_retrieval_t p = (yaz_retrieval_t) xmalloc(sizeof(*p));
p->odr = odr_createmem(ODR_ENCODE);
p->nmem = odr_getmem(p->odr);
p->wr_error = wrbuf_alloc();
{
struct _xmlAttr *attr;
- struct yaz_retrieval_elem *el = nmem_malloc(p->nmem, sizeof(*el));
+ struct yaz_retrieval_elem *el = (struct yaz_retrieval_elem *)
+ nmem_malloc(p->nmem, sizeof(*el));
el->syntax = 0;
el->identifier = 0;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: seshigh.c,v 1.117 2007-05-02 12:36:34 adam Exp $
+ * $Id: seshigh.c,v 1.118 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file seshigh.c
if (sr->username)
{
- Z_IdAuthentication *auth = odr_malloc(assoc->decode, sizeof(*auth));
+ Z_IdAuthentication *auth = (Z_IdAuthentication *)
+ odr_malloc(assoc->decode, sizeof(*auth));
int len;
len = strlen(sr->username) + 1;
if (sr->password)
len += strlen(sr->password) + 2;
auth->which = Z_IdAuthentication_open;
- auth->u.open = odr_malloc(assoc->decode, len);
+ auth->u.open = (char *) odr_malloc(assoc->decode, len);
strcpy(auth->u.open, sr->username);
if (sr->password && *sr->password)
{
else
{
rr->len = wrbuf_len(output_record);
- rr->record = odr_malloc(rr->stream, rr->len);
+ rr->record = (char *) odr_malloc(rr->stream, rr->len);
memcpy(rr->record, wrbuf_buf(output_record), rr->len);
}
wrbuf_destroy(output_record);
if (rr.errstring)
len += strlen(rr.errstring);
- record->recordData_buf = odr_malloc(o, len);
+ record->recordData_buf = (char *) odr_malloc(o, len);
sprintf(record->recordData_buf, "<diagnostic "
"xmlns=\"http://www.loc.gov/zing/srw/diagnostic/\">\n"
static char *srw_bend_explain_default(void *handle, bend_explain_rr *rr)
{
#if YAZ_HAVE_XML2
- xmlNodePtr ptr = rr->server_node_ptr;
+ xmlNodePtr ptr = (xmlNode *) rr->server_node_ptr;
if (!ptr)
return 0;
for (ptr = ptr->children; ptr; ptr = ptr->next)
if (bsrr->num_entries > 0)
{
int i;
- bsrr->entries = odr_malloc(assoc->decode, sizeof(*bsrr->entries) *
- bsrr->num_entries);
+ bsrr->entries = (struct scan_entry *)
+ odr_malloc(assoc->decode, sizeof(*bsrr->entries) *
+ bsrr->num_entries);
for (i = 0; i<bsrr->num_entries; i++)
{
bsrr->entries[i].term = 0;
int srw_error;
bsrr->scanClause = 0;
bsrr->attributeset = 0;
- bsrr->term = odr_malloc(assoc->decode, sizeof(*bsrr->term));
+ bsrr->term = (Z_AttributesPlusTerm *)
+ odr_malloc(assoc->decode, sizeof(*bsrr->term));
srw_error = cql2pqf_scan(assoc->encode,
srw_req->scanClause.cql,
assoc->server->cql_transform,
fseek(inf, 0L, SEEK_END);
*sz = ftell(inf);
rewind(inf);
- buf = odr_malloc(o, *sz);
+ buf = (char *) odr_malloc(o, *sz);
fread(buf, 1, *sz, inf);
fclose(inf);
return buf;
else
{
/* no backend. return error */
- binitres = odr_malloc(assoc->encode, sizeof(*binitres));
+ binitres = (bend_initresult *)
+ odr_malloc(assoc->encode, sizeof(*binitres));
binitres->errstring = 0;
binitres->errcode = YAZ_BIB1_PERMANENT_SYSTEM_ERROR;
iochan_settimeout(assoc->client_chan, 10);
assoc->init->implementation_name,
odr_prepend(assoc->encode, "GFS", resp->implementationName));
- version = odr_strdup(assoc->encode, "$Revision: 1.117 $");
+ version = odr_strdup(assoc->encode, "$Revision: 1.118 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
resp->implementationVersion = odr_prepend(assoc->encode,
if (bsrr->num_entries > 0)
{
int i;
- bsrr->entries = odr_malloc(assoc->decode, sizeof(*bsrr->entries) *
- bsrr->num_entries);
+ bsrr->entries = (struct scan_entry *)
+ odr_malloc(assoc->decode, sizeof(*bsrr->entries) *
+ bsrr->num_entries);
for (i = 0; i<bsrr->num_entries; i++)
{
bsrr->entries[i].term = 0;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: soap.c,v 1.17 2007-01-03 08:42:15 adam Exp $
+ * $Id: soap.c,v 1.18 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file soap.c
}
if (stylesheet)
{
- char *content = odr_malloc(o, strlen(stylesheet) + 40);
+ char *content = (char *) odr_malloc(o, strlen(stylesheet) + 40);
xmlNodePtr pi, ptr = xmlDocGetRootElement(doc);
sprintf(content, "type=\"text/xsl\" href=\"%s\"", stylesheet);
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: srw.c,v 1.54 2007-01-03 08:42:15 adam Exp $
+ * $Id: srw.c,v 1.55 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file srw.c
xmlFreeNode(tmp);
- *val = odr_malloc(o, buf->use+1);
+ *val = (char *) odr_malloc(o, buf->use+1);
memcpy (*val, buf->content, buf->use);
(*val)[buf->use] = '\0';
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: srwutil.c,v 1.55 2007-01-03 08:42:15 adam Exp $
+ * $Id: srwutil.c,v 1.56 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file srwutil.c
size_t i, szp = 0, sz = extra_args ? 1+strlen(extra_args) : 1;
for(i = 0; name[i]; i++)
sz += strlen(name[i]) + 3 + strlen(value[i]) * 3;
- *path = odr_malloc(o, sz);
+ *path = (char *) odr_malloc(o, sz);
for(i = 0; name[i]; i++)
{
cp++;
no++;
}
- *name = odr_malloc(o, no * sizeof(char*));
- *val = odr_malloc(o, no * sizeof(char*));
+ *name = (char **) odr_malloc(o, no * sizeof(char*));
+ *val = (char **) odr_malloc(o, no * sizeof(char*));
for (no = 0; *path; no++)
{
if (!p1)
break;
- (*name)[no] = odr_malloc(o, (p1-path)+1);
+ (*name)[no] = (char *) odr_malloc(o, (p1-path)+1);
memcpy((*name)[no], path, p1-path);
(*name)[no][p1-path] = '\0';
p1 = strchr(path, '&');
if (!p1)
p1 = strlen(path) + path;
- (*val)[no] = ret = odr_malloc(o, p1 - path + 1);
+ (*val)[no] = ret = (char *) odr_malloc(o, p1 - path + 1);
while (*path && *path != '&')
{
if (*path == '+')
sr->u.request->database = db;
- (*soap_package) = odr_malloc(decode, sizeof(**soap_package));
+ (*soap_package) = (Z_SOAP *)
+ odr_malloc(decode, sizeof(**soap_package));
(*soap_package)->which = Z_SOAP_generic;
- (*soap_package)->u.generic =
+ (*soap_package)->u.generic = (Z_SOAP_Generic *)
odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
(*soap_package)->u.generic->p = sr;
sr->u.explain_request->stylesheet = stylesheet;
- (*soap_package) = odr_malloc(decode, sizeof(**soap_package));
+ (*soap_package) = (Z_SOAP *)
+ odr_malloc(decode, sizeof(**soap_package));
(*soap_package)->which = Z_SOAP_generic;
- (*soap_package)->u.generic =
+ (*soap_package)->u.generic = (Z_SOAP_Generic *)
odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
(*soap_package)->u.generic->p = sr;
sr->u.scan_request->stylesheet = stylesheet;
- (*soap_package) = odr_malloc(decode, sizeof(**soap_package));
+ (*soap_package) = (Z_SOAP *)
+ odr_malloc(decode, sizeof(**soap_package));
(*soap_package)->which = Z_SOAP_generic;
- (*soap_package)->u.generic =
+ (*soap_package)->u.generic = (Z_SOAP_Generic *)
odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
(*soap_package)->u.generic->p = sr;
sr->u.explain_request->stylesheet = stylesheet;
- (*soap_package) = odr_malloc(decode, sizeof(**soap_package));
+ (*soap_package) = (Z_SOAP *)
+ odr_malloc(decode, sizeof(**soap_package));
(*soap_package)->which = Z_SOAP_generic;
- (*soap_package)->u.generic =
+ (*soap_package)->u.generic = (Z_SOAP_Generic *)
odr_malloc(decode, sizeof(*(*soap_package)->u.generic));
(*soap_package)->u.generic->p = sr;
if (val)
{
name[*i] = a_name;
- value[*i] = odr_malloc(o, 30);
+ value[*i] = (char *) odr_malloc(o, 30);
sprintf(value[*i], "%d", *val);
(*i)++;
}
hreq->method = "GET";
- path = odr_malloc(encode, strlen(hreq->path) + strlen(uri_args) + 4
- +(srw_pdu->extra_args ? strlen(srw_pdu->extra_args) : 0)
- );
+ path = (char *)
+ odr_malloc(encode, strlen(hreq->path) + strlen(uri_args) + 4
+ +(srw_pdu->extra_args ? strlen(srw_pdu->extra_args) : 0));
+
sprintf(path, "%s?%s", hreq->path, uri_args);
hreq->path = path;
* NT threaded server code by
* Chas Woodfield, Fretwell Downing Informatics.
*
- * $Id: statserv.c,v 1.48 2007-05-02 11:53:25 adam Exp $
+ * $Id: statserv.c,v 1.49 2007-05-06 20:12:20 adam Exp $
*/
/**
len += xmlStrlen(p->content);
}
/* now allocate for the string */
- str = nmem_malloc(n, len);
+ str = (unsigned char *) nmem_malloc(n, len);
*str = '\0'; /* so we can use strcat */
for (p = ptr; p; p = p->next)
{
static struct gfs_server * gfs_server_new(void)
{
- struct gfs_server *n = nmem_malloc(gfs_nmem, sizeof(*n));
+ struct gfs_server *n = (struct gfs_server *)
+ nmem_malloc(gfs_nmem, sizeof(*n));
memcpy(&n->cb, &control_block, sizeof(control_block));
n->next = 0;
n->host = 0;
static struct gfs_listen * gfs_listen_new(const char *id,
const char *address)
{
- struct gfs_listen *n = nmem_malloc(gfs_nmem, sizeof(*n));
+ struct gfs_listen *n = (struct gfs_listen *)
+ nmem_malloc(gfs_nmem, sizeof(*n));
if (id)
n->id = nmem_strdup(gfs_nmem, id);
else
else if (!strcmp((const char *) ptr->name, "stylesheet"))
{
char *s = nmem_dup_xml_content(gfs_nmem, ptr->children);
- gfs->stylesheet =
+ gfs->stylesheet = (char *)
nmem_malloc(gfs_nmem, strlen(s) + 2);
sprintf(gfs->stylesheet, "/%s", s);
}
association *newas;
IOCHAN new_chan;
COMSTACK new_line = (COMSTACK) vp;
- IOCHAN parent_chan = new_line->user;
+ IOCHAN parent_chan = (IOCHAN) new_line->user;
unsigned cs_get_mask, cs_accept_mask, mask =
((new_line->io_pending & CS_WANT_WRITE) ? EVENT_OUTPUT : 0) |
return &control_block;
#elif YAZ_POSIX_THREADS
if (init_control_tls)
- return pthread_getspecific(current_control_tls);
+ return (statserv_options_block *)
+ pthread_getspecific(current_control_tls);
else
return &control_block;
#else
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: timing.c,v 1.4 2007-01-05 14:05:24 adam Exp $
+ * $Id: timing.c,v 1.5 2007-05-06 20:12:20 adam Exp $
*/
/**
yaz_timing_t yaz_timing_create(void)
{
- yaz_timing_t t = xmalloc(sizeof(*t));
+ yaz_timing_t t = (yaz_timing_t) xmalloc(sizeof(*t));
yaz_timing_start(t);
return t;
}
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: tokenizer.c,v 1.2 2007-04-27 10:09:45 adam Exp $
+ * $Id: tokenizer.c,v 1.3 2007-05-06 20:12:20 adam Exp $
*/
/**
yaz_tok_cfg_t yaz_tok_cfg_create(void)
{
- yaz_tok_cfg_t t = xmalloc(sizeof(*t));
+ yaz_tok_cfg_t t = (yaz_tok_cfg_t) xmalloc(sizeof(*t));
t->white_space = xstrdup(" \t\r\n");
t->single_tokens = xstrdup("");
t->quote_tokens_begin = xstrdup("\"");
yaz_tok_get_byte_t h,
void *vp)
{
- yaz_tok_parse_t tp = xmalloc(sizeof(*tp));
+ yaz_tok_parse_t tp = (yaz_tok_parse_t) xmalloc(sizeof(*tp));
tp->cfg = t;
tp->cfg->ref_count++;
* Copyright (C) 1995-2007, Index Data ApS
* All rights reserved.
*
- * $Id: xmlquery.c,v 1.14 2007-04-13 09:55:21 adam Exp $
+ * $Id: xmlquery.c,v 1.15 2007-05-06 20:12:20 adam Exp $
*/
/** \file xmlquery.c
*zs = (Z_RPNStructure *) odr_malloc(odr, sizeof(Z_RPNStructure));
if (!xmlStrcmp(ptr->name, BAD_CAST "operator"))
{
- Z_Complex *zc = odr_malloc(odr, sizeof(Z_Complex));
+ Z_Complex *zc = (Z_Complex *) odr_malloc(odr, sizeof(Z_Complex));
(*zs)->which = Z_RPNStructure_complex;
(*zs)->u.complex = zc;
}
}
-void yaz_xml2query(const void *xmlnodep, Z_Query **query, ODR odr,
+void yaz_xml2query(const xmlNode *xmlnodep, Z_Query **query, ODR odr,
int *error_code, const char **addinfo)
{
yaz_xml2query_(xmlnodep, query, odr, error_code, addinfo);
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zget.c,v 1.14 2007-04-16 21:53:09 adam Exp $
+ * $Id: zget.c,v 1.15 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file zget.c
x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_userInfo1;
- u = odr_malloc(odr, sizeof *u);
+ u = (Z_OtherInformation *) odr_malloc(odr, sizeof *u);
x->u.userInfo1 = u;
u->num_elements = 1;
u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list);
int octet_len;
ODR encode;
- u = odr_malloc(odr, sizeof *u);
+ u = (Z_OtherInformation *) odr_malloc(odr, sizeof *u);
u->num_elements = 1;
u->list = (Z_OtherInformationUnit**) odr_malloc(odr, sizeof *u->list);
u->list[0] = (Z_OtherInformationUnit*) odr_malloc(odr, sizeof *u->list[0]);
x->direct_reference = odr_oiddup(odr, yaz_oid_userinfo_userinfo_1);
x->which = Z_External_octet;
x->u.octet_aligned = (Odr_oct *) odr_malloc(odr, sizeof(Odr_oct));
- x->u.octet_aligned->buf = odr_malloc(odr, octet_len);
+ x->u.octet_aligned->buf = (unsigned char *) odr_malloc(odr, octet_len);
memcpy(x->u.octet_aligned->buf, octet_buf, octet_len);
x->u.octet_aligned->len = octet_len;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoom-c.c,v 1.128 2007-05-05 11:55:22 adam Exp $
+ * $Id: zoom-c.c,v 1.129 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file zoom-c.c
odr_prepend(c->odr_out, "ZOOM-C",
ireq->implementationName));
- version = odr_strdup(c->odr_out, "$Revision: 1.128 $");
+ version = odr_strdup(c->odr_out, "$Revision: 1.129 $");
if (strlen(version) > 10) /* check for unexpanded CVS strings */
version[strlen(version)-2] = '\0';
ireq->implementationVersion =
static void set_init_option(const char *name, void *clientData) {
- ZOOM_connection c = clientData;
+ ZOOM_connection c = (ZOOM_connection) clientData;
char buf[80];
sprintf(buf, "init_opt_%.70s", name);
static void cql2pqf_wrbuf_puts(const char *buf, void *client_data)
{
- WRBUF wrbuf = client_data;
+ WRBUF wrbuf = (WRBUF) client_data;
wrbuf_puts(wrbuf, buf);
}
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: zoom-socket.c,v 1.3 2007-02-28 11:14:56 mike Exp $
+ * $Id: zoom-socket.c,v 1.4 2007-05-06 20:12:20 adam Exp $
*/
/**
* \file zoom-socket.c
ZOOM_API(int)
ZOOM_event_sys_poll(int no, ZOOM_connection *cs)
{
- struct pollfd *pollfds = xmalloc(no * sizeof *pollfds);
- ZOOM_connection *poll_cs = xmalloc(no * sizeof *poll_cs);
+ struct pollfd *pollfds = (struct pollfd *) xmalloc(no * sizeof *pollfds);
+ ZOOM_connection *poll_cs = (ZOOM_connection *)
+ xmalloc(no * sizeof *poll_cs);
int i, r;
int nfds = 0;
int timeout = 30;
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: srwtst.c,v 1.7 2007-04-17 20:26:18 adam Exp $
+ * $Id: srwtst.c,v 1.8 2007-05-06 20:12:20 adam Exp $
*/
#include <stdlib.h>
if (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_request)
{
Z_SRW_searchRetrieveRequest *req = sr->u.request;
* Copyright (C) 1995-2006, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: yaz-illclient.c,v 1.5 2007-04-25 16:51:47 heikki Exp $
+ * $Id: yaz-illclient.c,v 1.6 2007-05-06 20:12:20 adam Exp $
*/
/* WARNING - This is work in progress - not at all ready */
/* Call-back to be called for every field in the ill-request */
/* It can set values to any field, perhaps from the prog_args */
const char *get_ill_element(void *clientData, const char *element) {
- struct prog_args *args = clientData;
+ struct prog_args *args = (struct prog_args *) clientData;
struct nameval *nv=args->namevals;
char *ret=0;
if (!nv)
/** \brief parse a parameter string */
/* string is like 'name=value' */
struct nameval *parse_nameval( char *arg ) {
- struct nameval *nv = xmalloc(sizeof(*nv));
+ struct nameval *nv = (struct nameval *) xmalloc(sizeof(*nv));
char *p=arg;
int len;
if (!p || !*p)
len = p - arg;
if (!len)
return 0;
- nv->name = xmalloc(len+1);
+ nv->name = (char *) xmalloc(len+1);
strncpy(nv->name, arg, len);
nv->name[len]='\0';
if (*p == '=' )
int ret;
char *arg;
char *prog=*argv;
- char *version="$Id: yaz-illclient.c,v 1.5 2007-04-25 16:51:47 heikki Exp $"; /* from cvs */
+ char *version="$Id: yaz-illclient.c,v 1.6 2007-05-06 20:12:20 adam Exp $"; /* from cvs */
struct nameval *nv;
/* default values */
/* * * * * * * * * * * * * * * */
/* Makes a Z39.50-like prompt package with username and password */
Z_PromptObject1 *makeprompt(struct prog_args *args, ODR odr) {
- Z_PromptObject1 *p = odr_malloc(odr, sizeof(*p) );
- Z_ResponseUnit1 *ru = odr_malloc(odr, sizeof(*ru) );
+ Z_PromptObject1 *p = (Z_PromptObject1 *) odr_malloc(odr, sizeof(*p) );
+ Z_ResponseUnit1 *ru = (Z_ResponseUnit1 *) odr_malloc(odr, sizeof(*ru) );
p->which=Z_PromptObject1_response;
- p->u.response = odr_malloc(odr, sizeof(*(p->u.response)) );
+ p->u.response = (Z_Response1*) odr_malloc(odr, sizeof(*(p->u.response)) );
p->u.response->num=2;
- p->u.response->elements=odr_malloc(odr,
+ p->u.response->elements= (Z_ResponseUnit1 **) odr_malloc(odr,
p->u.response->num*sizeof(*(p->u.response->elements)) );
/* user id, aka "oclc authorization number" */
p->u.response->elements[0] = ru;
- ru->promptId = odr_malloc(odr, sizeof(*(ru->promptId) ));
+ ru->promptId = (Z_PromptId *) odr_malloc(odr, sizeof(*(ru->promptId) ));
ru->promptId->which = Z_PromptId_enumeratedPrompt;
- ru->promptId->u.enumeratedPrompt =
+ ru->promptId->u.enumeratedPrompt = (Z_PromptIdEnumeratedPrompt *)
odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) ));
ru->promptId->u.enumeratedPrompt->type =
odr_intdup(odr,Z_PromptIdEnumeratedPrompt_userId);
ru->which = Z_ResponseUnit1_string ;
ru->u.string = odr_strdup(odr, args->auth_userid);
/* password */
- ru = odr_malloc(odr, sizeof(*ru) );
+ ru = (Z_ResponseUnit1 *) odr_malloc(odr, sizeof(*ru) );
p->u.response->elements[1] = ru;
- ru->promptId = odr_malloc(odr, sizeof(*(ru->promptId) ));
+ ru->promptId = (Z_PromptId *) odr_malloc(odr, sizeof(*(ru->promptId) ));
ru->promptId->which = Z_PromptId_enumeratedPrompt;
- ru->promptId->u.enumeratedPrompt =
+ ru->promptId->u.enumeratedPrompt = (Z_PromptIdEnumeratedPrompt *)
odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) ));
ru->promptId->u.enumeratedPrompt->type =
odr_intdup(odr,Z_PromptIdEnumeratedPrompt_password);
ILL_Extension *makepromptextension(struct prog_args *args, ODR odr) {
ODR odr_ext = odr_createmem(ODR_ENCODE);
ODR odr_prt = odr_createmem(ODR_PRINT);
- ILL_Extension *e = odr_malloc(odr, sizeof(*e));
+ ILL_Extension *e = (ILL_Extension *) odr_malloc(odr, sizeof(*e));
Z_PromptObject1 *p = makeprompt(args,odr_ext);
char * buf;
int siz;
- Z_External *ext = odr_malloc(odr, sizeof(*ext));
+ Z_External *ext = (Z_External *) odr_malloc(odr, sizeof(*ext));
ext->direct_reference = odr_getoidbystr(odr,"1.2.840.10003.8.1");
ext->indirect_reference=0;
ext->descriptor=0;
z_PromptObject1(odr_prt, &p, 0,0 ); /*!*/
buf= odr_getbuf(odr_ext,&siz,0);
- ext->u.single_ASN1_type=odr_malloc(odr,sizeof(*ext->u.single_ASN1_type));
- ext->u.single_ASN1_type->buf= odr_malloc(odr, siz);
+ ext->u.single_ASN1_type=(Odr_any *)
+ odr_malloc(odr,sizeof(*ext->u.single_ASN1_type));
+ ext->u.single_ASN1_type->buf= (unsigned char *) odr_malloc(odr, siz);
memcpy(ext->u.single_ASN1_type->buf,buf, siz );
ext->u.single_ASN1_type->len = ext->u.single_ASN1_type->size = siz;
odr_reset(odr_ext);
e->identifier = odr_intdup(odr,1);
e->critical = odr_intdup(odr,0);
- e->item=odr_malloc(odr,sizeof(*e->item));
+ e->item = (Odr_any *) odr_malloc(odr,sizeof(*e->item));
if ( ! z_External(odr_ext, &ext,0,0) ) {
yaz_log(YLOG_FATAL,"Encoding of z_External failed ");
exit (6);
printf("External: \n");
z_External(odr_prt, &ext,0,0); /*!*/
buf= odr_getbuf(odr_ext,&siz,0);
- e->item->buf= odr_malloc(odr, siz);
+ e->item->buf= (unsigned char *) odr_malloc(odr, siz);
memcpy(e->item->buf,buf, siz );
e->item->len = e->item->size = siz;
/* fields. Here we just null them all out */
ODR odr_ext = odr_createmem(ODR_ENCODE);
ODR odr_prt = odr_createmem(ODR_PRINT);
- ILL_Extension *e = odr_malloc(odr, sizeof(*e));
- ILL_OCLCILLRequestExtension *oc = odr_malloc(odr_ext, sizeof(*oc));
+ ILL_Extension *e = (ILL_Extension *) odr_malloc(odr, sizeof(*e));
+ ILL_OCLCILLRequestExtension *oc = (ILL_OCLCILLRequestExtension *)
+ odr_malloc(odr_ext, sizeof(*oc));
char * buf;
int siz;
- Z_External *ext = odr_malloc(odr, sizeof(*ext));
+ Z_External *ext = (Z_External *) odr_malloc(odr, sizeof(*ext));
oc->clientDepartment = 0;
oc->paymentMethod = 0;
oc->uniformTitle = 0;
ill_OCLCILLRequestExtension(odr_prt, &oc, 0,0 ); /*!*/
buf= odr_getbuf(odr_ext,&siz,0);
- ext->u.single_ASN1_type=odr_malloc(odr,sizeof(*ext->u.single_ASN1_type));
- ext->u.single_ASN1_type->buf= odr_malloc(odr, siz);
+ ext->u.single_ASN1_type = (Odr_any*)
+ odr_malloc(odr,sizeof(*ext->u.single_ASN1_type));
+ ext->u.single_ASN1_type->buf = (unsigned char *) odr_malloc(odr, siz);
memcpy(ext->u.single_ASN1_type->buf,buf, siz );
ext->u.single_ASN1_type->len = ext->u.single_ASN1_type->size = siz;
odr_reset(odr_ext);
e->identifier = odr_intdup(odr,1);
e->critical = odr_intdup(odr,0);
- e->item=odr_malloc(odr,sizeof(*e->item));
+ e->item = (Odr_any *) odr_malloc(odr,sizeof(*e->item));
if ( ! z_External(odr_ext, &ext,0,0) ) {
yaz_log(YLOG_FATAL,"Encoding of z_External failed ");
exit (6);
printf("External: \n");
z_External(odr_prt, &ext,0,0); /*!*/
buf= odr_getbuf(odr_ext,&siz,0);
- e->item->buf= odr_malloc(odr, siz);
- memcpy(e->item->buf,buf, siz );
+ e->item->buf= (unsigned char *) odr_malloc(odr, siz);
+ memcpy(e->item->buf, buf, siz);
e->item->len = e->item->size = siz;
odr_destroy(odr_prt);
ctl.odr = odr;
ctl.clientData = args;
ctl.f = get_ill_element;
- apdu = odr_malloc( odr, sizeof(*apdu) );
+ apdu = (ILL_APDU *) odr_malloc( odr, sizeof(*apdu) );
apdu->which=ILL_APDU_ILL_Request;
req = ill_get_ILLRequest(&ctl, "ill", 0);
apdu->u.illRequest=req;
req->num_iLL_request_extensions=2;
- req->iLL_request_extensions=
+ req->iLL_request_extensions = (ILL_Extension **)
odr_malloc(odr, req->num_iLL_request_extensions*sizeof(*req->iLL_request_extensions));
req->iLL_request_extensions[0]=makepromptextension(args,odr);
req->iLL_request_extensions[1]=makeoclcextension(args,odr);
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: yaz-xmlquery.c,v 1.8 2007-03-19 22:17:41 adam Exp $
+ * $Id: yaz-xmlquery.c,v 1.9 2007-05-06 20:12:20 adam Exp $
*/
#include <stdlib.h>
exit(1);
}
rewind(f);
- xmlstr = xmalloc(sz+1);
+ xmlstr = (char *) xmalloc(sz+1);
xmlstr[sz] = '\0';
fread(xmlstr, sz, 1, f);
fclose(f);
if (filter)
{
strcat (filter, " ");
- filter = realloc (filter, roomsize);
+ filter = (char *) realloc (filter, roomsize);
strcat (filter, argv [optind ++]);
}
else
{
- filter = malloc (roomsize);
+ filter = (char *) malloc (roomsize);
strcpy (filter, argv [optind ++]);
}
}
/*
- * $Id: zoom-benchmark.c,v 1.18 2007-01-04 14:44:34 marc Exp $
+ * $Id: zoom-benchmark.c,v 1.19 2007-05-06 20:12:21 adam Exp $
*
* Asynchronous multi-target client doing search and piggyback retrieval
*/
read_params(argc, argv, ¶meters);
- z = xmalloc(sizeof(*z) * parameters.concurrent);
- r = xmalloc(sizeof(*r) * parameters.concurrent);
- elc = xmalloc(sizeof(*elc) * parameters.concurrent * parameters.repeat);
- els = xmalloc(sizeof(*els)
- * parameters.concurrent * parameters.repeat * 10);
+ z = (ZOOM_connection *) xmalloc(sizeof(*z) * parameters.concurrent);
+ r = (ZOOM_resultset *) xmalloc(sizeof(*r) * parameters.concurrent);
+ elc = (int *) xmalloc(sizeof(*elc) * parameters.concurrent * parameters.repeat);
+ els = (event_line_t *) xmalloc(
+ sizeof(*els) * parameters.concurrent * parameters.repeat * 10);
o = ZOOM_options_create();
/* async mode */
-/* $Id: zoom-bug-641.c,v 1.2 2007-01-03 08:42:17 adam Exp $ */
+/* $Id: zoom-bug-641.c,v 1.3 2007-05-06 20:12:21 adam Exp $ */
/** \file zoom-bug641.c
\brief Program to illustrate bug 641
}
size = statbuf.st_size;
printf("size=%lu\n", (unsigned long) size);
- buf = xmalloc(size+1);
+ buf = (char *) xmalloc(size+1);
while ((n = read(fd, &buf[offset], size)) < size) {
if (n < 0) {
perror("read");
* Copyright (C) 1995-2007, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: read-marc.c,v 1.9 2007-03-19 14:40:08 adam Exp $
+ * $Id: read-marc.c,v 1.10 2007-05-06 20:12:22 adam Exp $
*/
/*
len = yaz_marc_decode_buf (mt, rec, -1, &result, &rlen);
if (len > 1)
{
- rec = odr_malloc(odr, rlen+1);
+ rec = (char *) odr_malloc(odr, rlen+1);
memcpy(rec, result, rlen);
rec[rlen] = '\0';
}