X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fseshigh.c;h=1c4040c3d3f5f6c3b13a966711bb3404458e873d;hb=9c75e92604fae1efd7137d085dd2281e7886345b;hp=83ecd1d9e30b2d3b529734b1e1f6e7e019f293c0;hpb=af019cc83166ab755de4b9c9133c23caacc2f103;p=yaz-moved-to-github.git diff --git a/src/seshigh.c b/src/seshigh.c index 83ecd1d..1c4040c 100644 --- a/src/seshigh.c +++ b/src/seshigh.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: seshigh.c,v 1.116 2007-05-02 11:53:25 adam Exp $ + * $Id: seshigh.c,v 1.119 2007-05-08 08:22:36 adam Exp $ */ /** * \file seshigh.c @@ -497,6 +497,7 @@ static void assoc_init_reset(association *assoc) assoc->init->implementation_id = 0; assoc->init->implementation_name = 0; assoc->init->query_charset = 0; + assoc->init->records_in_same_charset = 0; assoc->init->bend_sort = NULL; assoc->init->bend_search = NULL; assoc->init->bend_present = NULL; @@ -533,14 +534,15 @@ static int srw_bend_init(association *assoc, Z_SRW_diagnostic **d, int *num, Z_S 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) { @@ -582,7 +584,7 @@ static int retrieve_fetch(association *assoc, bend_fetch_rr *rr) #if YAZ_HAVE_XML2 yaz_record_conv_t rc = 0; const char *match_schema = 0; - int *match_syntax = 0; + Odr_oid *match_syntax = 0; if (assoc->server) { @@ -653,7 +655,7 @@ static int retrieve_fetch(association *assoc, bend_fetch_rr *rr) 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); @@ -741,7 +743,7 @@ static int srw_bend_fetch(association *assoc, int pos, 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, "\n" @@ -1150,7 +1152,7 @@ static void srw_bend_search(association *assoc, request *req, 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) @@ -1266,8 +1268,9 @@ static void srw_bend_scan(association *assoc, request *req, 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; inum_entries; i++) { bsrr->entries[i].term = 0; @@ -1299,7 +1302,8 @@ static void srw_bend_scan(association *assoc, request *req, 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, @@ -1670,7 +1674,7 @@ static char *read_file(const char *fname, ODR o, int *sz) 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; @@ -2218,7 +2222,8 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) 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); @@ -2289,7 +2294,8 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) if (assoc->init->query_charset) { assoc->init->charneg_response = yaz_set_response_charneg( - assoc->encode, assoc->init->query_charset, 0, 0); + assoc->encode, assoc->init->query_charset, 0, + assoc->init->records_in_same_charset); } else { @@ -2352,7 +2358,7 @@ static Z_APDU *process_initRequest(association *assoc, request *reqb) assoc->init->implementation_name, odr_prepend(assoc->encode, "GFS", resp->implementationName)); - version = odr_strdup(assoc->encode, "$Revision: 1.116 $"); + version = odr_strdup(assoc->encode, "$Revision: 1.119 $"); if (strlen(version) > 10) /* check for unexpanded CVS strings */ version[strlen(version)-2] = '\0'; resp->implementationVersion = odr_prepend(assoc->encode, @@ -2466,7 +2472,7 @@ static Z_Records *pack_records(association *a, char *setname, int start, int *num, Z_RecordComposition *comp, int *next, int *pres, Z_ReferenceId *referenceId, - int *oid, int *errcode) + Odr_oid *oid, int *errcode) { int recno, total_length = 0, toget = *num, dumped_records = 0; Z_Records *records = @@ -3019,8 +3025,9 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb, int *fd) 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; inum_entries; i++) { bsrr->entries[i].term = 0;