projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Choose IPV6 over IPV4 addrany addresses (bug #2350).
[yaz-moved-to-github.git]
/
src
/
nmemsdup.c
diff --git
a/src/nmemsdup.c
b/src/nmemsdup.c
index
7b2a051
..
0fe7373
100644
(file)
--- a/
src/nmemsdup.c
+++ b/
src/nmemsdup.c
@@
-1,8
+1,6
@@
-/*
- * Copyright (C) 1995-2006, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2008 Index Data
* See the file LICENSE for details.
* See the file LICENSE for details.
- *
- * $Id: nmemsdup.c,v 1.7 2006-05-03 13:04:46 adam Exp $
*/
/**
*/
/**
@@
-15,10
+13,7
@@
#endif
#include <string.h>
#endif
#include <string.h>
-#include <yaz/nmem.h>
-#if HAVE_XML2
-#include <libxml/tree.h>
-#endif
+#include <yaz/nmem_xml.h>
char *nmem_strdup (NMEM mem, const char *src)
{
char *nmem_strdup (NMEM mem, const char *src)
{
@@
-73,7
+68,7
@@
void nmem_strsplit(NMEM nmem, const char *delim, const char *dstr,
else
{
size_t i = 0;
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;
for (cp = dstr; *cp; )
{
const char *cp0;
@@
-89,19
+84,19
@@
void nmem_strsplit(NMEM nmem, const char *delim, const char *dstr,
}
}
}
}
-#if HAVE_XML2
-char *nmem_text_node_cdata(const void *ptr_cdata, NMEM nmem)
+#if YAZ_HAVE_XML2
+char *nmem_text_node_cdata(const xmlNode *ptr_cdata, NMEM nmem)
{
char *cdata;
int len = 0;
const xmlNode *ptr;
{
char *cdata;
int len = 0;
const xmlNode *ptr;
- for (ptr = (const xmlNode *) ptr_cdata; ptr; ptr = ptr->next)
+ for (ptr = ptr_cdata; ptr; ptr = ptr->next)
if (ptr->type == XML_TEXT_NODE)
len += xmlStrlen(ptr->content);
cdata = (char *) nmem_malloc(nmem, len+1);
*cdata = '\0';
if (ptr->type == XML_TEXT_NODE)
len += xmlStrlen(ptr->content);
cdata = (char *) nmem_malloc(nmem, len+1);
*cdata = '\0';
- for (ptr = (const xmlNode *) ptr_cdata; ptr; ptr = ptr->next)
+ for (ptr = ptr_cdata; ptr; ptr = ptr->next)
if (ptr->type == XML_TEXT_NODE)
strcat(cdata, (const char *) ptr->content);
return cdata;
if (ptr->type == XML_TEXT_NODE)
strcat(cdata, (const char *) ptr->content);
return cdata;