More type casts for char signed/unsigned and xmlChar. Using
[yaz-moved-to-github.git] / test / tstsoap1.c
1 /*
2  * Copyright (C) 1995-2005, Index Data ApS
3  * See the file LICENSE for details.
4  *
5  * $Id: tstsoap1.c,v 1.4 2005-08-22 20:34:23 adam Exp $
6  */
7
8 #include <stdlib.h>
9 #if HAVE_XML2
10 #include <libxml/parser.h>
11 #endif
12
13 int main(int argc, char **argv)
14 {
15 #if HAVE_XML2
16     LIBXML_TEST_VERSION;
17
18     if (argc <= 1)
19     {
20         xmlChar *buf_out;
21         int len_out;
22         xmlDocPtr doc = xmlNewDoc(BAD_CAST "1.0");
23 #if 0
24         const char *val = "jordbær"; /* makes xmlDocDumpMemory hang .. */
25 #else
26         const char *val = "jordbaer"; /* OK */
27 #endif
28         xmlNodePtr top = xmlNewNode(0, BAD_CAST "top");
29         
30         xmlNewTextChild(top, 0, BAD_CAST "sub", BAD_CAST val);
31         xmlDocSetRootElement(doc, top);
32         
33         xmlDocDumpMemory(doc, &buf_out, &len_out);
34 #if 0
35         printf("%*s", len_out, buf_out);
36 #endif
37     }
38 #endif
39     return 0;
40 }
41
42
43 /*
44  * Local variables:
45  * c-basic-offset: 4
46  * indent-tabs-mode: nil
47  * End:
48  * vim: shiftwidth=4 tabstop=8 expandtab
49  */
50