From: Adam Dickmeiss Date: Tue, 20 Mar 2007 07:27:51 +0000 (+0000) Subject: WRBUF updates. X-Git-Tag: stable.27032007~12 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=8acdfb7a90bd20104f67a2b1dfc9023c54473422;p=pazpar2-moved-to-github.git WRBUF updates. --- diff --git a/configure.ac b/configure.ac index 323b51d..a2131f0 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ AC_PROG_CC AC_LANG(C) -YAZ_INIT(libxml2,2.1.46) +YAZ_INIT(libxml2,2.1.50) if test -z "$YAZLIB"; then AC_MSG_ERROR([YAZ development libraries missing]) fi diff --git a/src/config.c b/src/config.c index 8747af7..d862443 100644 --- a/src/config.c +++ b/src/config.c @@ -1,4 +1,4 @@ -/* $Id: config.c,v 1.16 2007-03-20 03:42:53 quinn Exp $ */ +/* $Id: config.c,v 1.17 2007-03-20 07:27:51 adam Exp $ */ #include @@ -36,11 +36,12 @@ static struct conf_service *parse_service(xmlNode *node) r->num_sortkeys = r->num_metadata = 0; // Allocate array of conf metadata and sortkey tructs, if necessary for (n = node->children; n; n = n->next) - if (n->type == XML_ELEMENT_NODE && !strcmp(n->name, "metadata")) + if (n->type == XML_ELEMENT_NODE && !strcmp((const char *) + n->name, "metadata")) { - xmlChar *sortkey = xmlGetProp(n, "sortkey"); + xmlChar *sortkey = xmlGetProp(n, (xmlChar *) "sortkey"); r->num_metadata++; - if (sortkey && strcmp(sortkey, "no")) + if (sortkey && strcmp((const char *) sortkey, "no")) r->num_sortkeys++; xmlFree(sortkey); } @@ -57,7 +58,7 @@ static struct conf_service *parse_service(xmlNode *node) { if (n->type != XML_ELEMENT_NODE) continue; - if (!strcmp(n->name, "metadata")) + if (!strcmp(n->name, (const char *) "metadata")) { struct conf_metadata *md = &r->metadata[md_node]; xmlChar *name = xmlGetProp(n, "name"); diff --git a/src/http_command.c b/src/http_command.c index 0dfbc6d..223903d 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1,5 +1,5 @@ /* - * $Id: http_command.c,v 1.27 2007-03-20 05:32:58 quinn Exp $ + * $Id: http_command.c,v 1.28 2007-03-20 07:27:51 adam Exp $ */ #include @@ -237,7 +237,7 @@ static void cmd_termlist(struct http_channel *c) name++; } wrbuf_puts(c->wrbuf, ""); - rs->payload = nmem_strdup(rq->channel->nmem, wrbuf_buf(c->wrbuf)); + rs->payload = nmem_strdup(rq->channel->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c); } @@ -272,7 +272,7 @@ static void cmd_bytarget(struct http_channel *c) } wrbuf_puts(c->wrbuf, ""); - rs->payload = nmem_strdup(c->nmem, wrbuf_buf(c->wrbuf)); + rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c); } @@ -348,7 +348,7 @@ static void cmd_record(struct http_channel *c) for (r = rec->records; r; r = r->next) write_subrecord(r, c->wrbuf, service); wrbuf_puts(c->wrbuf, "\n"); - rs->payload = nmem_strdup(c->nmem, wrbuf_buf(c->wrbuf)); + rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c); } @@ -415,7 +415,7 @@ static void show_records(struct http_channel *c, int active) } wrbuf_puts(c->wrbuf, "\n"); - rs->payload = nmem_strdup(c->nmem, wrbuf_buf(c->wrbuf)); + rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c); } @@ -519,7 +519,7 @@ static void cmd_stat(struct http_channel *c) wrbuf_printf(c->wrbuf, "%d\n", stat.num_failed); wrbuf_printf(c->wrbuf, "%d\n", stat.num_error); wrbuf_puts(c->wrbuf, ""); - rs->payload = nmem_strdup(c->nmem, wrbuf_buf(c->wrbuf)); + rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c); } @@ -539,7 +539,7 @@ static void cmd_info(struct http_channel *c) wrbuf_printf(c->wrbuf, " \n"); wrbuf_puts(c->wrbuf, ""); - rs->payload = nmem_strdup(c->nmem, wrbuf_buf(c->wrbuf)); + rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c); } diff --git a/src/pazpar2.c b/src/pazpar2.c index 3c37fc7..f0bd9be 100644 --- a/src/pazpar2.c +++ b/src/pazpar2.c @@ -1,4 +1,4 @@ -/* $Id: pazpar2.c,v 1.50 2007-03-20 05:32:58 quinn Exp $ */ +/* $Id: pazpar2.c,v 1.51 2007-03-20 07:27:51 adam Exp $ */ #include #include @@ -1347,7 +1347,7 @@ void destroy_session(struct session *s) while (s->clients) client_destroy(s->clients); nmem_destroy(s->nmem); - wrbuf_free(s->wrbuf, 1); + wrbuf_destroy(s->wrbuf); } struct session *new_session()