girparser: Better support for arrays in return type.
[vala-lang.git] / vapi / libxml-2.0.vapi
blob69fa838c9333309cd14d53a9e1a6765b8e6adcfb
1 /* libxml2.vala
2  *
3  * Copyright (C) 2006-2008  Jürg Billeter, Raffaele Sandrini, Michael Lawrence
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
18  *
19  * Author:
20  *      Jürg Billeter <j@bitron.ch>
21  *      Raffaele Sandrini <rasa@gmx.ch>
22  *      Michael Lawrence <lawremi@iastate.edu>
23  *      Ondřej Jirman <megous@megous.com>
24  */
26 namespace Xml {
27         /* nanoftp - minimal FTP implementation */
29         [CCode (has_target = false, cname = "ftpDataCallback", cheader_filename = "libxml/nanoftp.h")]
30         public delegate void FtpDataCallback (void* userData, [CCode (array_length = false)] char[] data, int len);
32         [CCode (has_target = false, cname = "ftpListCallback", cheader_filename = "libxml/nanoftp.h")]
33         public delegate void FtpListCallback (void* userData, string filename, string attrib, string owner, string group, ulong size, int links, int year, string month, int day, int hour, int minute);
35         [Compact]
36         [CCode (cname = "void", free_function = "xmlNanoFTPFreeCtxt", cheader_filename = "libxml/nanoftp.h")]
37         public class NanoFTP {
38                 [CCode (cname = "xmlNanoFTPCheckResponse")]
39                 public int check_response ();
41                 [CCode (cname = "xmlNanoFTPCleanup")]
42                 public static void cleanup ();
44                 [CCode (cname = "xmlNanoFTPClose")]
45                 public int close ();
47                 [CCode (cname = "xmlNanoFTPCloseConnection")]
48                 public int close_connection ();
50                 [CCode (cname = "xmlNanoFTPConnect")]
51                 public int connect ();
53                 [CCode (cname = "xmlNanoFTPConnectTo")]
54                 public static NanoFTP* connect_to (string server, int port);
56                 [CCode (cname = "xmlNanoFTPCwd")]
57                 public int cwd (string directory);
59                 [CCode (cname = "xmlNanoFTPDele")]
60                 public int dele (string file);
62                 [CCode (cname = "xmlNanoFTPGet")]
63                 public int get (FtpDataCallback cb, void* user_data, string filename);
65                 [CCode (cname = "xmlNanoFTPGetConnection")]
66                 public int get_connection ();
68                 [CCode (cname = "xmlNanoFTPGetResponse")]
69                 public int get_response ();
71                 [CCode (cname = "xmlNanoFTPGetSocket")]
72                 public int get_socket (string filename);
74                 [CCode (cname = "xmlNanoFTPInit")]
75                 public static void init ();
77                 [CCode (cname = "xmlNanoFTPList")]
78                 public int list (FtpListCallback cb, void* user_data, string filename);
80                 [CCode (cname = "xmlNanoFTPNewCtxt")]
81                 public NanoFTP (string url);
83                 [CCode (cname = "xmlNanoFTPOpen")]
84                 public static NanoFTP* open (string url);
86                 [CCode (cname = "xmlNanoFTPProxy")]
87                 public static void proxy (string host, int port, string user, string passwd, int type);
89                 [CCode (cname = "xmlNanoFTPQuit")]
90                 public int quit ();
92                 [CCode (cname = "xmlNanoFTPRead")]
93                 public int read (void* dest, int len);
95                 [CCode (cname = "xmlNanoFTPScanProxy")]
96                 public static void scan_proxy (string url);
98                 [CCode (cname = "xmlNanoFTPUpdateURL")]
99                 public int update_url (string url);
100         }
103         /* nanohttp - minimal HTTP implementation */
105         [Compact]
106         [CCode (cname = "void", cheader_filename = "libxml/nanohttp.h")]
107         public class NanoHTTP {
108                 [CCode (cname = "xmlNanoHTTPAuthHeader")]
109                 public unowned string auth_header ();
111                 [CCode (cname = "xmlNanoHTTPCleanup")]
112                 public static void cleanup ();
114                 [CCode (cname = "xmlNanoHTTPClose")]
115                 public int close ();
117                 [CCode (cname = "xmlNanoHTTPContentLength")]
118                 public int content_length ();
120                 [CCode (cname = "xmlNanoHTTPEncoding")]
121                 public unowned string http_encoding ();
123                 [CCode (cname = "xmlNanoHTTPFetch")]
124                 public static int fetch (string url, string filename, out string content_type);
126                 [CCode (cname = "xmlNanoHTTPInit")]
127                 public static void init ();
129                 [CCode (cname = "xmlNanoHTTPMethod")]
130                 public static NanoHTTP* method (string url, string method, string input, out string content_type, string headers, int ilen);
132                 [CCode (cname = "xmlNanoHTTPMethodRedir")]
133                 public static NanoHTTP* method_redir (string url, string method, string input, out string content_type, out string redir, string headers, int ilen);
135                 [CCode (cname = "xmlNanoHTTPMimeType")]
136                 public string mime_type ();
138                 [CCode (cname = "xmlNanoHTTPOpen")]
139                 public static NanoHTTP* open (string url, out string content_type);
141                 [CCode (cname = "xmlNanoHTTPOpenRedir")]
142                 public static NanoHTTP* open_redir (string url, out string content_type, out string redir);
144                 [CCode (cname = "xmlNanoHTTPRead")]
145                 public int read (void* dest, int len);
147                 [CCode (cname = "xmlNanoHTTPRedir")]
148                 public unowned string redir ();
150                 [CCode (cname = "xmlNanoHTTPReturnCode")]
151                 public int return_code ();
153                 [CCode (cname = "xmlNanoHTTPSave")]
154                 public int save (string filename);
156                 [CCode (cname = "xmlNanoHTTPScanProxy")]
157                 public static void scan_proxy (string URL);
158         }
161         /* parser - the core parser module */
163         [CCode (cheader_filename = "libxml/parser.h")]
164         namespace Parser {
165                 [CCode (cname = "xmlCleanupParser")]
166                 public static void cleanup ();
168                 [CCode (cname = "xmlInitParser")]
169                 public static void init ();
171                 [CCode (cname = "xmlParseDoc")]
172                 public static Doc* parse_doc (string cur);
174                 [CCode (cname = "xmlParseFile")]
175                 public static Doc* parse_file (string filename);
177                 [CCode (cname = "xmlParseMemory")]
178                 public static Doc* parse_memory (string buffer, int size);
180                 [CCode (cname = "xmlReadDoc")]
181                 public static Doc* read_doc (string cur, string? url = null, string? encoding = null, int options = 0);
183                 [CCode (cname = "xmlReadFd")]
184                 public static Doc* read_fd (int fd, string? base_url = null, string? encoding = null, int options = 0);
186                 [CCode (cname = "xmlReadFile")]
187                 public static Doc* read_file (string filename, string? encoding = null, int options = 0);
189                 [CCode (cname = "xmlReadMemory")]
190                 public static Doc* read_memory (string text, int len, string? url = null, string? encoding = null, int options = 0);
191         }
193         [CCode (cname = "xmlParserOption", cprefix = "XML_PARSE_", cheader_filename = "libxml/parser.h")]
194         public enum ParserOption {
195                 RECOVER,
196                 NOENT,
197                 DTDLOAD,
198                 DTDATTR,
199                 DTDVALID,
200                 NOERROR,
201                 NOWARNING,
202                 PEDANTIC,
203                 NOBLANKS,
204                 SAX1,
205                 XINCLUDE,
206                 NONET,
207                 NODICT,
208                 NSCLEAN,
209                 NOCDATA,
210                 NOXINCNODE,
211                 COMPACT,
212         }
214         [CCode (cname = "xmlCharEncoding", cprefix = "XML_CHAR_ENCODING_", cheader_filename = "libxml/encoding.h")]
215         public enum CharEncoding {
216                 ERROR,
217                 NONE,
218                 UTF8,
219                 UTF16LE,
220                 UTF16BE,
221                 UCS4LE,
222                 UCS4BE,
223                 EBCDIC,
224                 UCS4_2143,
225                 UCS4_3412,
226                 UCS2,
227                 [CCode (cname = "XML_CHAR_ENCODING_8859_1")]
228                 ISO_8859_1,
229                 [CCode (cname = "XML_CHAR_ENCODING_8859_2")]
230                 ISO_8859_2,
231                 [CCode (cname = "XML_CHAR_ENCODING_8859_3")]
232                 ISO_8859_3,
233                 [CCode (cname = "XML_CHAR_ENCODING_8859_4")]
234                 ISO_8859_4,
235                 [CCode (cname = "XML_CHAR_ENCODING_8859_5")]
236                 ISO_8859_5,
237                 [CCode (cname = "XML_CHAR_ENCODING_8859_6")]
238                 ISO_8859_6,
239                 [CCode (cname = "XML_CHAR_ENCODING_8859_7")]
240                 ISO_8859_7,
241                 [CCode (cname = "XML_CHAR_ENCODING_8859_8")]
242                 ISO_8859_8,
243                 [CCode (cname = "XML_CHAR_ENCODING_8859_9")]
244                 ISO_8859_9,
245                 ISO_2022_JP,
246                 SHIFT_JIS,
247                 EUC_JP,
248                 ASCII,
249         }
251         /* tree - interfaces for tree manipulation */
253         [CCode (cheader_filename = "libxml/tree.h")]
254         namespace Tree {
255                 [CCode (cname = "xmlGetCompressMode")]
256                 public static int get_compress_mode ();
258                 [CCode (cname = "xmlIsXHTML")]
259                 public static int is_xhtml (string system_id, string public_id);
261                 [CCode (cname = "xmlSetCompressMode")]
262                 public static void set_compress_mode (int mode);
263         }
265         [Compact]
266         [CCode (cname = "xmlAttr", free_function = "xmlFreeProp", cheader_filename = "libxml/tree.h")]
267         public class Attr {
268                 public ElementType type;
269                 public weak string name;
270                 public Node* children;
271                 public Node* last;
272                 public Node* parent;
273                 public Attr* next;
274                 public Attr* prev;
275                 public Doc* doc;
276                 public Ns* ns;
277                 public AttributeType atype;
279                 [CCode (cname = "xmlRemoveProp")]
280                 public int remove();
281         }
283         [Compact]
284         [CCode (cname = "xmlAttribute", cheader_filename = "libxml/tree.h")]
285         public class Attribute {
286                 public ElementType type;
287                 public weak string name;
288                 public Node* children;
289                 public Node* last;
290                 public Dtd* parent;
291                 public Node* next;
292                 public Node* prev;
293                 public Doc* doc;
294                 public Attribute* nexth;
295                 public AttributeType atype;
296                 public AttributeDefault def;
297                 public weak string default_value;
298                 public weak string prefix;
299                 public weak string elem;
300         }
302         [CCode (cname = "xmlAttributeDefault", cprefix = "XML_ATTRIBUTE_", cheader_filename = "libxml/tree.h")]
303         public enum AttributeDefault {
304                 NONE,
305                 REQUIRED,
306                 IMPLIED,
307                 FIXED
308         }
310         [CCode (cname = "xmlAttributeType", cprefix = "XML_ATTRIBUTE_", cheader_filename = "libxml/tree.h")]
311         public enum AttributeType {
312                 CDATA,
313                 ID,
314                 IDREF ,
315                 IDREFS,
316                 ENTITY,
317                 ENTITIES,
318                 NMTOKEN,
319                 NMTOKENS,
320                 ENUMERATION,
321                 NOTATION
322         }
324         [Compact]
325         [CCode (cname = "xmlDoc", free_function = "xmlFreeDoc", cheader_filename = "libxml/tree.h,libxml/parser.h")]
326         public class Doc {
327                 public ElementType type;
328                 public string name;
329                 public Node* children;
330                 public Node* last;
331                 public Node* parent;
332                 public Node* next;
333                 public Node* prev;
334                 public Doc* doc;
335                 public int compression;
336                 public int standalone;
337                 public Dtd* int_subset;
338                 public Dtd* ext_subset;
339                 public Ns* old_ns;
340                 public weak string version;
341                 public weak string encoding;
342                 public weak string url;
343                 public int charset;
345                 [CCode (cname = "xmlCopyDoc")]
346                 public Doc* copy (int recursive);
348                 [CCode (cname = "xmlCreateIntSubset")]
349                 public Dtd* create_int_subset (string name, string external_id, string system_id);
351                 [CCode (cname = "xmlDocDump", instance_pos = -1)]
352 #if POSIX
353                 public int dump (Posix.FILE f);
354 #else
355                 public int dump (GLib.FileStream f);
356 #endif
358                 [CCode (cname = "xmlDocDumpFormatMemory")]
359                 public void dump_memory_format (out string mem, out int len = null, bool format = true);
361                 [CCode (cname = "xmlDocDumpFormatMemoryEnc")]
362                 public void dump_memory_enc_format (out string mem, out int len = null, string enc = "UTF-8", bool format = true);
364                 [CCode (cname = "xmlDocDumpMemory")]
365                 public void dump_memory (out string mem, out int len = null);
367                 [CCode (cname = "xmlDocDumpMemoryEnc")]
368                 public void dump_memory_enc (out string mem, out int len = null, string enc = "UTF-8");
370                 [CCode (cname = "xmlDocFormatDump", instance_pos = 1.1)]
371 #if POSIX
372                 public int dump_format (Posix.FILE f, bool format = true);
373 #else
374                 public int dump_format (GLib.FileStream f, bool format = true);
375 #endif
377                 [CCode (cname = "xmlDocGetRootElement")]
378                 public Node* get_root_element();
380                 [CCode (cname = "xmlDocSetRootElement")]
381                 public Node* set_root_element(Node* root);
383                 [CCode (cname = "xmlElemDump", instance_pos = 1.1)]
384 #if POSIX
385                 public void elem_dump (Posix.FILE f, Node* cur);
386 #else
387                 public void elem_dump (GLib.FileStream f, Node* cur);
388 #endif
390                 [CCode (cname = "xmlGetDocCompressMode")]
391                 public int get_compress_mode ();
393                 [CCode (cname = "xmlNewCDataBlock")]
394                 public Node* new_cdata_block (string content, int len);
396                 [CCode (cname = "xmlNewCharRef")]
397                 public Node* new_char_ref (string name);
399                 [CCode (cname = "xmlNewDoc")]
400                 public Doc (string? version = null);
402                 [CCode (cname = "xmlNewDocComment")]
403                 public Node* new_comment (string content);
405                 [CCode (cname = "xmlNewDocFragment")]
406                 public Node* new_fragment ();
408                 [CCode (cname = "xmlNewDocNode")]
409                 public Node* new_node (Ns* ns, string name, string? content = null);
411                 [CCode (cname = "xmlNewDocNodeEatName")]
412                 public Node* new_node_eat_name (Ns* ns, owned string name, string? content = null);
414                 [CCode (cname = "xmlNewDocPI")]
415                 public Node* new_pi (string name, string content);
417                 [CCode (cname = "xmlNewDocProp")]
418                 public Attr* new_prop (string name, string value);
420                 [CCode (cname = "xmlNewDocRawNode")]
421                 public Node* new_raw_node (Ns* ns, string name, string? content = null);
423                 [CCode (cname = "xmlNewDocText")]
424                 public Node* new_text (string content);
426                 [CCode (cname = "xmlNewDocTextLen")]
427                 public Node* new_text_len (string content, int len);
429                 [CCode (cname = "xmlNewReference")]
430                 public Node* new_reference (string name);
432                 [CCode (cname = "xmlNodeListGetRawString")]
433                 public string node_list_get_raw_string (Node* list, bool in_line);
435                 [CCode (cname = "xmlNodeListGetString")]
436                 public string node_list_get_string (Node* list, bool in_line);
438                 [CCode (cname = "xmlSaveFile", instance_pos = -1)]
439                 public int save_file (string filename);
441                 [CCode (cname = "xmlSaveFileEnc", instance_pos = 1.1)]
442                 public void save_file_enc (string filename, string enc = "UTF-8");
444                 [CCode (cname = "xmlSaveFormatFile", instance_pos = 1.1)]
445                 public int save_format_file (string filename, int format);
447                 [CCode (cname = "xmlSaveFormatFileEnc", instance_pos = 1.1)]
448                 public void save_format_file_enc (string filename, string enc = "UTf-8", bool format = true);
450                 [CCode (cname = "xmlSetDocCompressMode")]
451                 public void set_compress_mode (int mode);
453                 [CCode (cname = "xmlStringGetNodeList")]
454                 public Node* string_get_node_list (string str);
456                 [CCode (cname = "xmlStringLenGetNodeList")]
457                 public Node* string_len_get_node_list (string str, int len);
458         }
460         [Compact]
461         [CCode (cname = "xmlDtd", free_function="xmlFreeDtd", cheader_filename = "libxml/tree.h")]
462         public class Dtd {
463                 public ElementType type;
464                 public string name;
465                 public Node* children;
466                 public Node* last;
467                 public Node* parent;
468                 public Node* next;
469                 public Node* prev;
470                 public Doc* doc;
472                 public weak string external_id;
473                 public weak string system_id;
475                 [CCode (cname = "xmlNewDtd")]
476                 public Dtd (Doc* doc, string name, string external_id, string system_id);
478                 [CCode (cname = "xmlCopyDtd")]
479                 public Dtd* copy();
480         }
482         [Compact]
483         [CCode (cname = "xmlElement", cheader_filename = "libxml/tree.h")]
484         public class Element {
485                 public ElementType type;
486                 public weak string name;
487                 public Node* children;
488                 public Node* last;
489                 public Dtd* parent;
490                 public Node* next;
491                 public Node* prev;
492                 public Doc* doc;
493                 public Attribute* attributes;
494                 public weak string prefix;
495         }
497         [CCode (cname = "xmlElementType", cprefix = "XML_", cheader_filename = "libxml/tree.h")]
498         public enum ElementType {
499                 ELEMENT_NODE,
500                 ATTRIBUTE_NODE,
501                 TEXT_NODE,
502                 CDATA_SECTION_NODE,
503                 ENTITY_REF_NODE,
504                 ENTITY_NODE,
505                 PI_NODE,
506                 COMMENT_NODE,
507                 DOCUMENT_NODE,
508                 DOCUMENT_TYPE_NODE,
509                 DOCUMENT_FRAG_NODE,
510                 NOTATION_NODE,
511                 HTML_DOCUMENT_NODE,
512                 DTD_NODE,
513                 ELEMENT_DECL,
514                 ATTRIBUTE_DECL,
515                 ENTITY_DECL,
516                 NAMESPACE_DECL,
517                 XINCLUDE_START,
518                 XINCLUDE_END,
519                 DOCB_DOCUMENT_NODE
520         }
522         [Compact]
523         [CCode (cname = "xmlElementContent", free_function = "xmlFreeElementContent", cheader_filename = "libxml/tree.h")]
524         public class ElementContent {
525                 [CCode (cname = "xmlNewElementContent")]
526                 ElementContent (string name, ElementContentType type);
528                 public ElementContentType type;
529                 public ElementContentOccur ocur;
530                 public const string name;
531                 public ElementContent c1;
532                 public ElementContent c2;
533                 public ElementContent parent;
534                 public const string prefix;
535         }
537         [CCode (cname = "xmlElementContentType", cprefix = "XML_ELEMENT_CONTENT_", cheader_filename = "libxml/tree.h")]
538         public enum ElementContentType {
539                 PCDATA,
540                 ELEMENT,
541                 SEQ,
542                 OR
543         }
545         [CCode (cname = "xmlElementContentOccur", cprefix = "XML_ELEMENT_CONTENT_", cheader_filename = "libxml/tree.h")]
546         public enum ElementContentOccur {
547                 ONCE,
548                 OPT,
549                 MULT,
550                 PLUS
551         }
553         [Compact]
554         [CCode (cname = "xmlEntity", cheader_filename = "libxml/tree.h")]
555         public struct Entity {
556                 public void* private;
557                 public ElementType type;
558                 public const string name;
559                 public Node* children;
560                 public Node* last;
561                 public Dtd* parent;
562                 public Node* next;
563                 public Node* prev;
564                 public Doc* doc;
565                 public string orig;
566                 public string content;
567                 public int length;
568                 public EntityType etype;
569                 [CCode (cname = "ExternalID")]
570                 public const string external_id;
571                 [CCode (cname = "SystemID")]
572                 public const string system_id;
573                 public Entity* nexte;
574                 [CCode (cname = "URI")]
575                 public const string uri;
576                 public int owner;
577                 public int checked;
578         }
580         [CCode (cname = "xmlEntityType", cprefix = "XML_", cheader_filename = "libxml/tree.h")]
581         public enum EntityType {
582                 INTERNAL_GENERAL_ENTITY,
583                 EXTERNAL_GENERAL_PARSED_ENTITY,
584                 EXTERNAL_GENERAL_UNPARSED_ENTITY,
585                 INTERNAL_PARAMETER_ENTITY,
586                 EXTERNAL_PARAMETER_ENTITY,
587                 INTERNAL_PREDEFINED_ENTITY
588         }
590         [Compact]
591         [CCode (cname = "xmlEnumeration", cheader_filename = "libxml/tree.h")]
592         public struct Enumeration {
593                 public Enumeration* next;
594                 public const string name;
595         }
598         [Compact]
599         [CCode (cname = "xmlNode", free_function = "xmlFreeNode", cheader_filename = "libxml/tree.h")]
600         public class Node {
601                 public ElementType type;
602                 public weak string name;
603                 public Node* children;
604                 public Node* last;
605                 public Node* parent;
606                 public Node* next;
607                 public Node* prev;
608                 public Doc* doc;
609                 public Ns* ns;
610                 public string content;
611                 public Attr* properties;
612                 [CCode (cname = "nsDef")]
613                 public Ns* ns_def;
614                 public ushort line;
615                 public ushort extra;
617                 [CCode (cname = "xmlAddChild")]
618                 public Node* add_child (Node* cur);
620                 [CCode (cname = "xmlAddChildList")]
621                 public Node* add_child_list (Node* cur);
623                 [CCode (cname = "xmlAddNextSibling")]
624                 public Node* add_next_sibling (Node* elem);
626                 [CCode (cname = "xmlAddPrevSibling")]
627                 public Node* add_prev_sibling (Node* elem);
629                 [CCode (cname = "xmlAddSibling")]
630                 public Node* add_sibling (Node* elem);
632                 [CCode (cname = "xmlCopyNode")]
633                 public Node* copy (int extended);
635                 [CCode (cname = "xmlCopyNodeList")]
636                 public Node copy_list();
638                 [CCode (cname = "xmlDocCopyNode")]
639                 public Node* doc_copy (Doc* doc, int extended);
641                 [CCode (cname = "xmlDocCopyNodeList")]
642                 public Node* doc_copy_list (Doc* doc);
644                 [CCode (cname = "xmlFreeNodeList")]
645                 public void free_list ();
647                 [CCode (cname = "xmlGetLastChild")]
648                 public Node* get_last_child ();
650                 [CCode (cname = "xmlGetLineNo")]
651                 public long get_line_no ();
653                 [CCode (cname = "xmlGetNoNsProp")]
654                 public string? get_no_ns_prop (string name);
656                 [CCode (cname = "xmlGetNodePath")]
657                 public string get_path ();
659                 [CCode (cname = "xmlGetNsProp")]
660                 public string? get_ns_prop (string name, string ns);
662                 [CCode (cname = "xmlGetProp")]
663                 public string? get_prop (string name);
665                 [CCode (cname = "xmlHasNsProp")]
666                 public Attr* has_ns_prop (string name, string name_space);
668                 [CCode (cname = "xmlHasProp")]
669                 public Attr* has_prop (string name);
671                 [CCode (cname = "xmlIsBlankNode")]
672                 public int is_blank ();
674                 [CCode (cname = "xmlNewChild")]
675                 public Node* new_child (Ns* ns, string name, string? content = null);
677                 [CCode (cname = "xmlNewNs")]
678                 public Ns* new_ns (string href, string prefix);
680                 [CCode (cname = "xmlNewNsProp")]
681                 public Attr* new_ns_prop (Ns* ns, string name, string value);
683                 [CCode (cname = "xmlNewProp")]
684                 public Attr* new_prop (string name, string value);
686                 [CCode (cname = "xmlNewTextChild")]
687                 public Node* new_text_child (Ns* ns, string name, string content);
689                 [CCode (cname = "xmlNodeAddContent")]
690                 public void add_content (string content);
692                 [CCode (cname = "xmlNodeAddContentLen")]
693                 public void add_content_len (string content, int len);
695                 [CCode (cname = "xmlNodeGetContent")]
696                 public string get_content();
698                 [CCode (cname = "xmlNodeGetLang")]
699                 public string get_lang();
701                 [CCode (cname = "xmlNodeGetSpacePreserve")]
702                 public int get_space_preserve();
704                 [CCode (cname = "xmlNodeIsText")]
705                 public int is_text();
707                 [CCode (cname = "xmlNodeSetContent")]
708                 public void set_content (string content);
710                 [CCode (cname = "xmlNodeSetContentLen")]
711                 public void set_content_len (string content, int len);
713                 [CCode (cname = "xmlNodeSetLang")]
714                 public void set_lang (string val);
716                 [CCode (cname = "xmlNodeSetName")]
717                 public void set_name (string name);
719                 [CCode (cname = "xmlNodeSetSpacePreserve")]
720                 public void set_space_preserve (int val);
722                 [CCode (cname = "xmlReplaceNode")]
723                 public Node* replace (Node* cur);
725                 [CCode (cname = "xmlNewComment")]
726                 public Node.comment (string content);
728                 [CCode (cname = "xmlNewNode")]
729                 public Node (Ns* ns, string name);
731                 [CCode (cname = "xmlNewNodeEatName")]
732                 public Node.eat_name (Ns* ns, owned string name);
734                 [CCode (cname = "xmlNewText")]
735                 public Node.text (string content);
737                 [CCode (cname = "xmlNewTextLen")]
738                 public Node.text_len (string content, int len);
740                 [CCode (cname = "xmlNewPI")]
741                 public Node.pi (string name, string content);
743                 [CCode (cname = "xmlSetListDoc")]
744                 public void set_list_doc (Doc* doc);
746                 [CCode (cname = "xmlSetNsProp")]
747                 public Attr* set_ns_prop (Ns* ns, string name, string value);
749                 [CCode (cname = "xmlSetProp")]
750                 public Attr* set_prop (string name, string value);
752                 [CCode (cname = "xmlSetTreeDoc")]
753                 public void set_tree_doc (Doc* doc);
755                 [CCode (cname = "xmlTextConcat")]
756                 public int text_concat (string content, int len);
758                 [CCode (cname = "xmlTextMerge")]
759                 public Node* text_merge (Node* second);
761                 [CCode (cname = "xmlUnlinkNode")]
762                 public void unlink ();
764                 [CCode (cname = "xmlUnsetNsProp")]
765                 public int unset_ns_prop (Ns* ns, string name);
767                 [CCode (cname = "xmlUnsetProp")]
768                 public int unset_prop (string name);
770                 [CCode (cname = "xmlNextElementSibling")]
771                 public Node* next_element_sibling ();
773                 [CCode (cname = "xmlFirstElementChild")]
774                 public Node* first_element_child ();
776                 [CCode (cname = "xmlChildElementCount")]
777                 public ulong child_element_count ();
778         }
780         [Compact]
781         [CCode (cname = "xmlNs", free_function= "xmlFreeNs", cheader_filename = "libxml/tree.h")]
782         public class Ns {
783                 [CCode (cname = "xmlNewNs")]
784                 public Ns (Xml.Node* node, string href, string prefix);
785                 public Ns* next;
786                 public ElementType type;
787                 public string href;
788                 public string prefix;
789                 public Doc* context;
790         }
792         [Compact]
793         [CCode (cname = "xmlParserCtxt")]
794         public class ParserCtxt {
795                 public SAXHandler* sax;
796                 [CCode (cname = "userData")]
797                 public void* user_data;
799                 [CCode (cname = "xmlParseDocument")]
800                 public int parse_document ();
801         }
804         /* uri - library of generic URI related routines */
806         [Compact]
807         [CCode (cname = "xmlURI", free_function = "xmlFreeURI", cheader_filename = "libxml/uri.h")]
808         public class URI {
809                 [CCode (cname = "xmlBuildRelativeURI")]
810                 public static string build_relative (string uri, string @base);
812                 [CCode (cname = "xmlBuildURI")]
813                 public static string build (string URI, string @base);
815                 [CCode (cname = "xmlCanonicPath")]
816                 public static string canonic_path (string path);
818                 [CCode (cname = "xmlCreateURI")]
819                 public URI ();
821                 [CCode (cname = "xmlNormalizeURIPath")]
822                 public static int normalize_uri_path (string path);
824                 [CCode (cname = "xmlParseURI")]
825                 public static URI parse (string str);
827                 [CCode (cname = "xmlParseURIRaw")]
828                 public static URI parse_raw (string str, bool raw);
830                 [CCode (cname = "xmlParseURIReference")]
831                 public int parse_reference (string str);
833                 [CCode (cname = "xmlPathToURI")]
834                 public static string path_to_uri (string path);
836                 [CCode (cname = "xmlPrintURI", instance_pos = -1)]
837 #if POSIX
838                 public void print (Posix.FILE stream);
839 #else
840                 public void print (GLib.FileStream stream);
841 #endif
843                 [CCode (cname = "xmlSaveUri")]
844                 public string save ();
846                 [CCode (cname = "xmlURIEscape")]
847                 public static string escape (string str);
849                 [CCode (cname = "xmlURIEscapeStr")]
850                 public static string escape_str (string str, string list);
852                 [CCode (cname = "xmlURIUnescapeString")]
853                 public static string unescape_string (string str, int len, string? target);
855                 public string scheme;
856                 public string opaque;
857                 public string authority;
858                 public string server;
859                 public string user;
860                 public int port;
861                 public string path;
862                 public string query;
863                 public string fragment;
864                 public int cleanup;
865                 public string query_raw;
866         }
869         /* xmlIO - interface for the I/O interfaces used by the parser */
871         [CCode (has_target = false, cname = "xmlInputCloseCallback", cheader_filename = "libxml/xmlIO.h")]
872         public delegate int InputCloseCallback (void* context);
874         [CCode (has_target = false, cname = "xmlInputReadCallback", cheader_filename = "libxml/xmlIO.h")]
875         public delegate int InputReadCallback (void* context, [CCode (array_length = false)] char[] buffer, int len);
877         [CCode (has_target = false, cname = "xmlInputMatchCallback", cheader_filename = "libxml/xmlIO.h")]
878         public delegate int InputMatchCallback (string filename);
880         [CCode (has_target = false, cname = "xmlInputOpenCallback", cheader_filename = "libxml/xmlIO.h")]
881         public delegate void* InputOpenCallback (string filename);
883         [CCode (has_target = false, cname = "xmlOutputMatchCallback", cheader_filename = "libxml/xmlIO.h")]
884         public delegate int OutputMatchCallback (string filename);
886         [CCode (has_target = false, cname = "xmlOutputOpenCallback", cheader_filename = "libxml/xmlIO.h")]
887         public delegate void* OutputOpenCallback (string filename);
889         [CCode (has_target = false, cname = "xmlOutputWriteCallback", cheader_filename = "libxml/xmlIO.h")]
890         public delegate int OutputWriteCallback ([CCode (array_length = false)] char[] buffer, int len);
892         [CCode (has_target = false, cname = "xmlOutputCloseCallback", cheader_filename = "libxml/xmlIO.h")]
893         public delegate int OutputCloseCallback (void * context);
895         [CCode (cname = "xmlRegisterInputCallbacks", cheader_filename = "libxml/xmlIO.h")]
896         public int registerInputCallbacks (InputMatchCallback matchFunc, InputOpenCallback openFunc, InputReadCallback readFunc, InputCloseCallback closeFunc);
898         [CCode (cname = "xmlRegisterOutputCallbacks", cheader_filename = "libxml/xmlIO.h")]
899         public int registerOutputCallbacks(OutputMatchCallback matchFunc, OutputOpenCallback openFunc, OutputWriteCallback writeFunc, OutputCloseCallback closeFunc);
901         /* xmlschemas - incomplete XML Schemas structure implementation */
903         [Compact]
904         [CCode (cname = "xmlSchemaValidCtxt", cheader_filename = "libxml/xmlreader.h")]
905         public class SchemaValidCtxt {
906         }
908         /* xmlwriter - the XMLWriter implementation */
910         [Compact]
911         [CCode (cname = "xmlTextWriter", free_function = "xmlFreeTextWriter", cheader_filename = "libxml/xmlwriter.h")]
912         public class TextWriter {
913                 [CCode (cname = "xmlNewTextWriterFilename")]
914                 public TextWriter.filename (string uri, bool compression = false);
916                 [CCode (cname = "xmlTextWriterFlush")]
917                 public int flush ();
919                 [CCode (cname = "xmlTextWriterSetIndent")]
920                 public int set_indent (bool indent);
922                 [CCode (cname = "xmlTextWriterSetIndentString")]
923                 public int set_indent_string (string str);
925                 /* End */
926                 [CCode (cname = "xmlTextWriterEndCDATA")]
927                 public int end_cdata ();
929                 [CCode (cname = "xmlTextWriterEndComment")]
930                 public int end_comment ();
932                 [CCode (cname = "xmlTextWriterEndDocument")]
933                 public int end_document ();
935                 [CCode (cname = "xmlTextWriterEndElement")]
936                 public int end_element ();
938                 [CCode (cname = "xmlTextWriterEndAttribute")]
939                 public int end_attribute ();
941                 /* Start */
943                 [CCode (cname = "xmlTextWriterStartCDATA")]
944                 public int start_cdata ();
946                 [CCode (cname = "xmlTextWriterStartComment")]
947                 public int start_comment ();
949                 [CCode (cname = "xmlTextWriterStartDocument")]
950                 public int start_document (string? version = null, string? encoding = null, string? standalone = null);
952                 [CCode (cname = "xmlTextWriterStartElement")]
953                 public int start_element (string name);
955                 [CCode (cname = "xmlTextWriterStartElementNS")]
956                 public int start_element_ns (string prefix, string name, string namespaceURI);
958                 [CCode (cname = "xmlTextWriterStartAttribute")]
959                 public int start_attribute (string name);
961                 [CCode (cname = "xmlTextWriterStartAttributeNS")]
962                 public int start_attribute_ns (string prefix, string name, string namespaceURI);
964                 /* write */
966                 [CCode (cname = "xmlTextWriterWriteAttribute")]
967                 public int write_attribute (string name, string content);
969                 [CCode (cname = "xmlTextWriterWriteAttributeNS")]
970                 public int write_attribute_ns (string prefix, string name, string namespaceURI, string content);
972                 [CCode (cname = "xmlTextWriterWriteElement")]
973                 public int write_element (string name, string content);
975                 [CCode (cname = "xmlTextWriterWriteElementNS")]
976                 public int write_element_ns (string prefix, string name, string namespaceURI, string content);
978                 [CCode (cname = "xmlTextWriterWriteBase64")]
979                 public int write_base64 (void* data, int start, int length);
981                 [CCode (cname = "xmlTextWriterWriteComment")]
982                 public int write_comment (string content);
984                 [CCode (cname = "xmlTextWriterWriteString")]
985                 public int write_string (string content);
987                 /* formatted */
989                 [CCode (cname = "xmlTextWriterWriteFormatAttribute")]
990                 public int format_attribute (string name, string format, ...);
992                 [CCode (cname = "xmlTextWriterWriteFormatAttributeNS")]
993                 public int format_attribute_ns (string prefix, string name, string namespaceURI, string format, ...);
995                 [CCode (cname = "xmlTextWriterWriteFormatCDATA")]
996                 public int format_cdata (string format, ...);
998                 [CCode (cname = "xmlTextWriterWriteFormatComment")]
999                 public int format_comment (string format, ...);
1001                 [CCode (cname = "xmlTextWriterWriteFormatElement")]
1002                 public int format_element (string name, string format, ...);
1004                 [CCode (cname = "xmlTextWriterWriteFormatElementNS")]
1005                 public int format_element_ns (string prefix, string name, string namespaceURI, string format, ...);
1007                 [CCode (cname = "xmlTextWriterWriteFormatString")]
1008                 public int format_string (string format, ...);
1009         }
1011         /* xmlreader - the XMLReader implementation */
1013         [CCode (cname = "xmlParserProperties", cprefix = "XML_PARSER_", cheader_filename = "libxml/xmlreader.h")]
1014         public enum ParserProperties {
1015                 LOADDTD,
1016                 DEFAULTATTRS,
1017                 VALIDATE,
1018                 SUBST_ENTITIES
1019         }
1021         [CCode (cname = "xmlParserSeverities", cprefix = "XML_PARSER_SEVERITY_", cheader_filename = "libxml/xmlreader.h")]
1022         public enum ParserSeverities {
1023                 VALIDITY_WARNING,
1024                 VALIDITY_ERROR,
1025                 WARNING,
1026                 ERROR
1027         }
1029         [CCode (cname = "xmlReaderTypes", cheader_filename = "libxml/xmlreader.h")]
1030         public enum ReaderType {
1031                 NONE,
1032                 ELEMENT,
1033                 ATTRIBUTE,
1034                 TEXT,
1035                 CDATA,
1036                 ENTITY_REFERENCE,
1037                 ENTITY,
1038                 PROCESSING_INSTRUCTION,
1039                 COMMENT,
1040                 DOCUMENT,
1041                 DOCUMENT_TYPE,
1042                 DOCUMENT_FRAGMENT,
1043                 NOTATION,
1044                 WHITESPACE,
1045                 SIGNIFICANT_WHITESPACE,
1046                 END_ELEMENT,
1047                 END_ENTITY,
1048                 XML_DECLARATION
1049         }
1051         [Compact]
1052         [CCode (cname = "xmlTextReader", free_function = "xmlFreeTextReader", cheader_filename = "libxml/xmlreader.h")]
1053         public class TextReader {
1054                 [CCode (cname = "xmlNewTextReaderFilename")]
1055                 public TextReader.filename (string uri);
1057                 [CCode (cname = "xmlReaderForDoc")]
1058                 public TextReader.for_doc (string cur, string url, string? encoding = null, int options = 0);
1060                 [CCode (cname = "xmlReaderForFd")]
1061                 public TextReader.for_fd (int fd, string url, string? encoding = null, int options = 0);
1063                 [CCode (cname = "xmlReaderForFile")]
1064                 public TextReader.for_file (string filename, string? encoding = null, int options = 0);
1066                 [CCode (cname = "xmlReaderForIO")]
1067                 public TextReader.for_io (InputReadCallback ioread, InputCloseCallback ioclose, void* ioctx, string url, string? encoding = null, int options = 0);
1069                 [CCode (cname = "xmlReaderForMemory")]
1070                 public TextReader.for_memory ([CCode (array_length = false)] char[] buffer, int size, string url, string? encoding = null, int options = 0);
1072                 [CCode (cname = "xmlReaderNewDoc")]
1073                 public int new_doc (string cur, string url, string? encoding = null, int options = 0);
1075                 [CCode (cname = "xmlReaderNewFd")]
1076                 public int new_fd (int fd, string url, string? encoding = null, int options = 0);
1078                 [CCode (cname = "xmlReaderNewFile")]
1079                 public int new_file (string filename, string? encoding = null, int options = 0);
1081                 [CCode (cname = "xmlReaderNewIO")]
1082                 public int new_io (InputReadCallback ioread, InputCloseCallback ioclose, void* ioctx, string url, string? encoding = null, int options = 0);
1084                 [CCode (cname = "xmlReaderNewMemory")]
1085                 public int new_memory ([CCode (array_length = false)] char[] buffer, int size, string url, string? encoding = null, int options = 0);
1087                 [CCode (cname = "xmlReaderNewWalker")]
1088                 public int new_walker (Doc* doc);
1090                 [CCode (cname = "xmlReaderWalker")]
1091                 public TextReader.walker (Doc* doc);
1093                 [CCode (cname = "xmlTextReaderAttributeCount")]
1094                 public int attribute_count ();
1096                 [CCode (cname = "xmlTextReaderBaseUri")]
1097                 public string base_uri ();
1099                 [CCode (cname = "xmlTextReaderByteConsumed")]
1100                 public long byte_consumed ();
1102                 [CCode (cname = "xmlTextReaderClose")]
1103                 public int close ();
1105                 [CCode (cname = "xmlTextReaderConstBaseUri")]
1106                 public unowned string const_base_uri ();
1108                 [CCode (cname = "xmlTextReaderConstEncoding")]
1109                 public unowned string const_encoding ();
1111                 [CCode (cname = "xmlTextReaderConstLocalName")]
1112                 public unowned string const_local_name ();
1114                 [CCode (cname = "xmlTextReaderConstName")]
1115                 public unowned string const_name ();
1117                 [CCode (cname = "xmlTextReaderConstNamespaceUri")]
1118                 public unowned string const_namespace_uri ();
1120                 [CCode (cname = "xmlTextReaderConstPrefix")]
1121                 public unowned string const_prefix ();
1123                 [CCode (cname = "xmlTextReaderConstString")]
1124                 public unowned string const_string (string str);
1126                 [CCode (cname = "xmlTextReaderConstValue")]
1127                 public unowned string const_value ();
1129                 [CCode (cname = "xmlTextReaderConstXmlLang")]
1130                 public unowned string const_xml_lang ();
1132                 [CCode (cname = "xmlTextReaderConstXmlVersion")]
1133                 public unowned string const_xml_version ();
1135                 [CCode (cname = "xmlTextReaderCurrentDoc")]
1136                 public Doc* current_doc ();
1138                 [CCode (cname = "xmlTextReaderCurrentNode")]
1139                 public Node* current_node ();
1141                 [CCode (cname = "xmlTextReaderDepth")]
1142                 public int depth ();
1144                 [CCode (cname = "xmlTextReaderExpand")]
1145                 public Node* expand ();
1147                 [CCode (cname = "xmlTextReaderGetAttribute")]
1148                 public string get_attribute (string name);
1150                 [CCode (cname = "xmlTextReaderGetAttributeNo")]
1151                 public string get_attribute_no (int no);
1153                 [CCode (cname = "xmlTextReaderGetAttributeNs")]
1154                 public string get_attribute_ns (string local_name, string namespace_uri);
1156                 [CCode (cname = "xmlTextReaderGetErrorHandler")]
1157                 public void get_error_handler (out TextReaderErrorFunc f, void** arg);
1159                 [CCode (cname = "xmlTextReaderGetParserColumnNumber")]
1160                 public int get_parser_column_number ();
1162                 [CCode (cname = "xmlTextReaderGetParserLineNumber")]
1163                 public int get_parser_line_number ();
1165                 [CCode (cname = "xmlTextReaderGetParserProp")]
1166                 public int get_parser_prop (int prop);
1168                 [CCode (cname = "xmlTextReaderHasAttributes")]
1169                 public int has_attributes ();
1171                 [CCode (cname = "xmlTextReaderHasValue")]
1172                 public int has_value ();
1174                 [CCode (cname = "xmlTextReaderIsDefault")]
1175                 public int is_default ();
1177                 [CCode (cname = "xmlTextReaderIsEmptyElement")]
1178                 public int is_empty_element ();
1180                 [CCode (cname = "xmlTextReaderIsNamespaceDecl")]
1181                 public int is_namespace_decl ();
1183                 [CCode (cname = "xmlTextReaderIsValid")]
1184                 public int is_valid ();
1186                 [CCode (cname = "xmlTextReaderLocalName")]
1187                 public string local_name ();
1189                 [CCode (cname = "xmlTextReaderLookupNamespace")]
1190                 public string lookup_namespace (string prefix);
1192                 [CCode (cname = "xmlTextReaderMoveToAttribute")]
1193                 public int move_to_attribute (string name);
1195                 [CCode (cname = "xmlTextReaderMoveToAttributeNo")]
1196                 public int move_to_attribute_no (int no);
1198                 [CCode (cname = "xmlTextReaderMoveToAttributeNs")]
1199                 public int move_to_attribute_ns (string local_name, string namespace_uri);
1201                 [CCode (cname = "xmlTextReaderMoveToElement")]
1202                 public int move_to_element ();
1204                 [CCode (cname = "xmlTextReaderMoveToFirstAttribute")]
1205                 public int move_to_first_attribute ();
1207                 [CCode (cname = "xmlTextReaderMoveToNextAttribute")]
1208                 public int move_to_next_attribute ();
1210                 [CCode (cname = "xmlTextReaderName")]
1211                 public string name ();
1213                 [CCode (cname = "xmlTextReaderNamespaceUri")]
1214                 public string namespace_uri ();
1216                 [CCode (cname = "xmlTextReaderNext")]
1217                 public int next ();
1219                 [CCode (cname = "xmlTextReaderNextSibling")]
1220                 public int next_sibling ();
1222                 [CCode (cname = "xmlTextReaderNodeType")]
1223                 public int node_type ();
1225                 [CCode (cname = "xmlTextReaderNormalization")]
1226                 public int normalization ();
1228                 [CCode (cname = "xmlTextReaderPrefix")]
1229                 public string prefix ();
1231                 [CCode (cname = "xmlTextReaderPreserve")]
1232                 public Node* preserve ();
1234                 [CCode (cname = "xmlTextReaderPreservePattern")]
1235                 public int preserve_pattern (string pattern, [CCode (array_length = false)] string[] namespaces);
1237                 [CCode (cname = "xmlTextReaderQuoteChar")]
1238                 public int quote_char ();
1240                 [CCode (cname = "xmlTextReaderRead")]
1241                 public int read ();
1243                 [CCode (cname = "xmlTextReaderReadAttributeValue")]
1244                 public int read_attribute_value ();
1246                 [CCode (cname = "xmlTextReaderReadInnerXml")]
1247                 public string read_inner_xml ();
1249                 [CCode (cname = "xmlTextReaderReadOuterXml")]
1250                 public string read_outer_xml ();
1252                 [CCode (cname = "xmlTextReaderReadState")]
1253                 public int read_state ();
1255                 [CCode (cname = "xmlTextReaderReadString")]
1256                 public string read_string ();
1258                 [CCode (cname = "xmlTextReaderSchemaValidate")]
1259                 public int schema_validate (string xsd);
1261                 [CCode (cname = "xmlTextReaderSchemaValidateCtxt")]
1262                 public int schema_validate_ctxt (SchemaValidCtxt* ctxt, int options);
1264                 [CCode (cname = "xmlTextReaderSetErrorHandler")]
1265                 public void set_error_handler (TextReaderErrorFunc f, void* arg);
1267                 [CCode (cname = "xmlTextReaderSetParserProp")]
1268                 public int set_parser_prop (SchemaValidCtxt* ctxt, int options);
1270                 [CCode (cname = "xmlTextReaderStandalone")]
1271                 public int standalone ();
1273                 [CCode (cname = "xmlTextReaderValue")]
1274                 public string value ();
1276                 [CCode (cname = "xmlTextReaderXmlLang")]
1277                 public string xml_lang ();
1278         }
1280         [Compact]
1281         [CCode (cname = "void", cheader_filename = "libxml/xmlreader.h")]
1282         public class TextReaderLocator {
1283         }
1285         [CCode (cname = "xmlTextReaderMode", cprefix = "XML_TEXTREADER_MODE_", cheader_filename = "libxml/xmlreader.h")]
1286         public enum TextReaderMode {
1287                 INITIAL,
1288                 INTERACTIVE,
1289                 ERROR,
1290                 EOF,
1291                 CLOSED,
1292                 READING
1293         }
1295         [CCode (has_target = false)]
1296         public delegate void TextReaderErrorFunc (void* arg, string msg, ParserSeverities severity, TextReaderLocator* locator);
1299         /* xpath - XML Path Language implementation */
1301         [CCode (cheader_filename = "libxml/xpath.h")]
1302         namespace XPath {
1303                 [CCode (cname = "xmlXPathOrderDocElems")]
1304                 public static long order_doc_elements (Doc* doc);
1306                 [Compact]
1307                 [CCode (cname = "xmlNodeSet", free_function="xmlXPathFreeNodeSet", cheader_filename = "libxml/xpath.h")]
1308                 public class NodeSet {
1309                         [CCode (cname = "xmlXPathNodeSetGetLength")]
1310                         public int length ();
1312                         [CCode (cname = "xmlXPathNodeSetIsEmpty")]
1313                         public bool is_empty ();
1315                         [CCode (cname = "xmlXPathNodeSetItem")]
1316                         public Node* item (int index);
1317                 }
1319                 [Compact]
1320                 [CCode (cname = "xmlXPathContext", free_function = "xmlXPathFreeContext", cheader_filename = "libxml/xpath.h")]
1321                 public class Context {
1322                         public Doc* doc;
1323                         public Node* node;
1325                         [CCode (cname = "xmlXPathContextSetCache")]
1326                         public int set_cache (int active, int value, int options);
1328                         [CCode (cname = "xmlXPathEval", instance_pos = -1)]
1329                         public Object* eval (string str);
1331                         [CCode (cname = "xmlXPathEvalExpression", instance_pos = -1)]
1332                         public Object* eval_expression (string str);
1334                         [CCode (cname = "xmlXPathRegisterNs")]
1335                         public int register_ns (string prefix, string ns_uri);
1337                         [CCode (cname = "xmlXPathNewContext")]
1338                         public Context (Doc* doc);
1339                 }
1341                 [CCode (cname = "xmlXPathError", cprefix = "XPATH_", cheader_filename = "libxml/xpath.h")]
1342                 public enum Error {
1343                         EXPRESSION_OK,
1344                         NUMBER_ERROR,
1345                         UNFINISHED_LITERAL_ERROR,
1346                         START_LITERAL_ERROR,
1347                         VARIABLE_REF_ERROR,
1348                         UNDEF_VARIABLE_ERROR,
1349                         INVALID_PREDICATE_ERROR,
1350                         EXPR_ERROR,
1351                         UNCLOSED_ERROR,
1352                         UNKNOWN_FUNC_ERROR,
1353                         INVALID_OPERAND,
1354                         INVALID_TYPE,
1355                         INVALID_ARITY,
1356                         INVALID_CTXT_SIZE,
1357                         INVALID_CTXT_POSITION,
1358                         MEMORY_ERROR,
1359                         [CCode (cname = "XPTR_SYNTAX_ERROR")]
1360                         XPTR_SYNTAX_ERROR,
1361                         [CCode (cname = "XPTR_RESOURCE_ERROR")]
1362                         XPTR_RESOURCE_ERROR,
1363                         [CCode (cname = "XPTR_SUB_RESOURCE_ERROR")]
1364                         XPTR_SUB_RESOURCE_ERROR,
1365                         UNDEF_PREFIX_ERROR,
1366                         ENCODING_ERROR,
1367                         INVALID_CHAR_ERROR,
1368                         INVALID_CTXT
1369                 }
1371                 [Compact]
1372                 [CCode (cname = "xmlXPathObject", free_function="xmlXPathFreeObject", cheader_filename = "libxml/xpath.h")]
1373                 public class Object {
1374                         public ObjectType type;
1375                         public NodeSet* nodesetval;
1376                         public int boolval;
1377                         public double floatval;
1378                         public string stringval;
1379                         public void* user;
1380                         public int index;
1381                         public void* user2;
1382                         public int index2;
1383                 }
1385                 [CCode (cname = "xmlXPathObjectType", cprefix = "XPATH_", cheader_filename = "libxml/xpath.h")]
1386                 public enum ObjectType {
1387                         UNDEFINED,
1388                         NODESET,
1389                         BOOLEAN,
1390                         NUMBER,
1391                         STRING,
1392                         POINT,
1393                         RANGE,
1394                         LOCATIONSET,
1395                         USERS,
1396                         XSLT_TREE
1397                 }
1398         }
1400         /* SAX CALLBACKS */
1402         [CCode (cname = "attributeDeclSAXFunc", has_target = false)]
1403         public delegate void attributeDeclSAXFunc (void* ctx, string elem, string fullname, int type, int def, string defaultValue, Enumeration* tree);
1405         [CCode (cname = "attributeSAXFunc", has_target = false)]
1406         public delegate void attributeSAXFunc (void* ctx, string name, string value);
1408         [CCode (cname = "cdataBlockSAXFunc", has_target = false)]
1409         public delegate void cdataBlockSAXFunc (void* ctx, string value, int len);
1411         [CCode (cname = "charactersSAXFunc", has_target = false)]
1412         public delegate void charactersSAXFunc (void* ctx, string ch, int len);
1414         [CCode (cname = "commentsSAXFunc", has_target = false)]
1415         public delegate void commentSAXFunc (void* ctx, string value);
1417         [CCode (cname = "elementDeclSAXFunc", has_target = false)]
1418         public delegate void elementDeclSAXFunc (void* ctx, string name, int type, ElementContent content);
1420         [CCode (cname = "endDocumentSAXFunc", has_target = false)]
1421         public delegate void endDocumentSAXFunc (void* ctx);
1423         [CCode (cname = "endElementNsSAX2Func", has_target = false)]
1424         public delegate void endElementNsSAX2Func (void* ctx, string localname, string prefix, string URI);
1426         [CCode (cname = "endElementSAXFunc", has_target = false)]
1427         public delegate void endElementSAXFunc (void* ctx, string name);
1429         [CCode (cname = "entityDeclSAXFunc", has_target = false)]
1430         public delegate void entityDeclSAXFunc (void* ctx, string name, int type, string publicId, string systemId, string content);
1432         [CCode (cname = "errorSAXFunc", has_target = false)]
1433         public delegate void errorSAXFunc (void* ctx, string msg, ...);
1435         [CCode (cname = "externalSubsetSAXFunc", has_target = false)]
1436         public delegate void externalSubsetSAXFunc (void* ctx, string name, string ExternalID, string SystemID);
1438         [CCode (cname = "fatalErrorSAXFunc", has_target = false)]
1439         public delegate void fatalErrorSAXFunc (void* ctx, string msg, ...);
1441         [CCode (cname = "getEntitySAXFunc", has_target = false)]
1442         public delegate Entity* getEntitySAXFunc (void* ctx, string name);
1444         [CCode (cname = "getParameterEntitySAXFunc", has_target = false)]
1445         public delegate Entity* getParameterEntitySAXFunc (void* ctx, string name);
1447         [CCode (cname = "hasExternalSubsetSAXFunc", has_target = false)]
1448         public delegate int hasExternalSubsetSAXFunc (void* ctx);
1450         [CCode (cname = "hasInternalSubsetSAXFunc", has_target = false)]
1451         public delegate int hasInternalSubsetSAXFunc (void* ctx);
1453         [CCode (cname = "ignorableWhitespaceSAXFunc", has_target = false)]
1454         public delegate void ignorableWhitespaceSAXFunc (void* ctx, string ch, int len);
1456         [CCode (cname = "internalSubsetSAXFunc", has_target = false)]
1457         public delegate void internalSubsetSAXFunc (void* ctx, string name, string ExternalID, string SystemID);
1459         [CCode (cname = "isStandaloneSAXFunc", has_target = false)]
1460         public delegate int isStandaloneSAXFunc (void* ctx);
1462         [CCode (cname = "notationDeclSAXFunc", has_target = false)]
1463         public delegate void notationDeclSAXFunc (void* ctx, string name, string publicId, string systemId);
1465         [CCode (cname = "processingInstructionSAXFunc", has_target = false)]
1466         public delegate void processingInstructionSAXFunc (void* ctx, string target, string data);
1468         [CCode (cname = "referenceSAXFunc", has_target = false)]
1469         public delegate void referenceSAXFunc (void* ctx, string name);
1471         // [CCode (cname = "resolveEntitySAXFunc", has_target = false)]
1472         // public delegate ParserInput resolveEntitySAXFunc (void* ctx, string publicId, string systemId);
1474         // [CCode (cname = "setDocumentLocatorSAXFunc", has_target = false)]
1475         // public delegate void setDocumentLocatorSAXFunc (void* ctx, SAXLocator loc);
1477         [CCode (cname = "startDocumentSAXFunc", has_target = false)]
1478         public delegate void startDocumentSAXFunc (void* ctx);
1480         [CCode (cname = "startElementNsSAX2Func", has_target = false)]
1481         public delegate void startElementNsSAX2Func (void* ctx, string localname, string prefix, string URI, int nb_namespaces, [CCode (array_length = false, array_null_terminated = true)] string[] namespaces, int nb_attributes, int nb_defaulted, [CCode (array_length = false)] string[] attributes);
1483         [CCode (cname = "startElementSAXFunc", has_target = false)]
1484         public delegate void startElementSAXFunc (void* ctx, string name, [CCode (array_length = false, array_null_terminated = true)] string[] atts);
1486         [CCode (cname = "unparsedEntityDeclSAXFunc", has_target = false)]
1487         public delegate void unparsedEntityDeclSAXFunc (void* ctx, string name, string publicId, string systemId, string notationName);
1489         [CCode (cname = "warningSAXFunc", has_target = false)]
1490         public delegate void warningSAXFunc (void* ctx, string msg, ...);
1492         [CCode (cname ="xmlStructuredErrorFunc", has_target = false)]
1493         public delegate void xmlStructuredErrorFunc (void* ctx, Error* error);
1495         [Compact]
1496         [CCode (cname = "xmlSAXHandler", cheader_filename = "libxml/parser.h")]
1497         public struct SAXHandler {
1498                 [CCode (cname = "internalSubset")]
1499                 public internalSubsetSAXFunc internalSubset;
1500                 [CCode (cname = "isStandalone")]
1501                 public isStandaloneSAXFunc is_standalone;
1502                 [CCode (cname = "hasInternalSubset")]
1503                 public hasInternalSubsetSAXFunc hasInternalSubset;
1504                 [CCode (cname = "hasExternalSubset")]
1505                 public hasExternalSubsetSAXFunc hasExternalSubset;
1506                 // public resolveEntitySAXFunc resolveEntity;
1507                 [CCode (cname = "getEntity")]
1508                 public getEntitySAXFunc getEntity;
1509                 [CCode (cname = "entityDecl")]
1510                 public entityDeclSAXFunc entityDecl;
1511                 [CCode (cname = "notationDecl")]
1512                 public notationDeclSAXFunc notationDecl;
1513                 [CCode (cname = "attributeDecl")]
1514                 public attributeDeclSAXFunc attributeDecl;
1515                 [CCode (cname = "elementDecl")]
1516                 public elementDeclSAXFunc elementDecl;
1517                 [CCode (cname = "unparsedEntityDecl")]
1518                 public unparsedEntityDeclSAXFunc unparsedEntityDecl;
1519                 // public setDocumentLocatorSAXFunc setDocumentLocator;
1520                 [CCode (cname = "startDocument")]
1521                 public startDocumentSAXFunc startDocument;
1522                 [CCode (cname = "endDocument")]
1523                 public endDocumentSAXFunc endDocument;
1524                 [CCode (cname = "startElement")]
1525                 public startElementSAXFunc startElement;
1526                 [CCode (cname = "endElement")]
1527                 public endElementSAXFunc endElement;
1528                 public referenceSAXFunc reference;
1529                 public charactersSAXFunc characters;
1530                 [CCode (cname = "ignorableWhitespace")]
1531                 public ignorableWhitespaceSAXFunc ignorableWhitespace;
1532                 [CCode (cname = "processingInstruction")]
1533                 public processingInstructionSAXFunc processingInstruction;
1534                 public commentSAXFunc comment;
1535                 public warningSAXFunc warning;
1536                 public errorSAXFunc error;
1537                 [CCode (cname = "fatalError")]
1538                 public fatalErrorSAXFunc fatalError;
1539                 [CCode (cname = "getParameterEntity")]
1540                 public getParameterEntitySAXFunc getParameterEntity;
1541                 [CCode (cname = "cdataBlock")]
1542                 public cdataBlockSAXFunc cdataBlock;
1543                 [CCode (cname = "externalSubset")]
1544                 public externalSubsetSAXFunc externalSubset;
1545                 public uint initialized;
1546                 [CCode (cname = "startElementNs")]
1547                 public startElementNsSAX2Func startElementNs;
1548                 [CCode (cname = "endElementNs")]
1549                 public endElementNsSAX2Func endElementNs;
1550                 public xmlStructuredErrorFunc serror;
1552                 [CCode (cname = "xmlSAXUserParseMemory")]
1553                 public int user_parse_memory (void* user_data, string buffer, int size);
1554                 [CCode (cname = "xmlSAXUserParseFile")]
1555                 public int user_parse_file (void* user_data, string filename);
1556         }
1559         /* xmlerror - error handling */
1561         [Compact]
1562         [CCode (cname = "xmlError", cheader_filename = "libxml/xmlerror.h")]
1563         public struct Error {
1564                 public int domain;
1565                 public int code;
1566                 public string message;
1567                 public ErrorLevel level;
1568                 public string file;
1569                 public int line;
1570                 public string str1;
1571                 public string str2;
1572                 public string str3;
1573                 public int int1;
1574                 public int int2;
1575                 public void* ctx;
1576                 public void* node;
1577         }
1579         [CCode (cname = "xmlErrorLevel", cprefix = "XML_ERR_", cheader_filename = "libxml/xmlerror.h")]
1580         public enum ErrorLevel {
1581                 NONE = 0,
1582                 WARNING = 1,
1583                 ERROR = 2,
1584                 FATAL = 3
1585         }
1589 namespace Html {
1590         [CCode (cname = "htmlIsBooleanAttr", cheader_filename = "libxml/HTMLtree.h")]
1591         public static int is_boolean_attr (string name);
1593         [CCode (cname = "UTF8ToHtml", cheader_filename = "libxml/HTMLparser.h")]
1594         public static int utf8_to_html ([CCode (array_length = false)] char[] outdata, out int outlen, [CCode (array_length = false)] char[] indata, out int inlen);
1596         [CCode (cname = "htmlEncodeEntities", cheader_filename = "libxml/HTMLparser.h")]
1597         public static int encode_entities ([CCode (array_length = false)] char[] outdata, out int outlen, [CCode (array_length = false)] char[] indata, out int inlen, char quote_char = '\0');
1599         [CCode (cname = "htmlIsScriptAttribute", cheader_filename = "libxml/HTMLparser.h")]
1600         public static bool is_script_attribute (string name);
1602         [CCode (cname = "htmlHandleOmittedElem", cheader_filename = "libxml/HTMLparser.h")]
1603         public static bool handle_omitted_elem (bool val);
1605         [CCode (cname = "htmlParserOption", cprefix = "HTML_PARSE_", cheader_filename = "libxml/HTMLparser.h")]
1606         public enum ParserOption {
1607                 RECOVER,
1608                 NOERROR,
1609                 NOWARNING,
1610                 PEDANTIC,
1611                 NOBLANKS,
1612                 NONET,
1613                 COMPACT,
1614         }
1616         [CCode (cname = "htmlStatus", cprefix = "HTML_", cheader_filename = "libxml/HTMLparser.h")]
1617         public enum Status {
1618                 NA,
1619                 INVALID,
1620                 DEPRECATED,
1621                 VALID,
1622                 REQUIRED,
1623         }
1625         [Compact]
1626         [CCode (cname = "xmlNode", cheader_filename = "libxml/HTMLparser.h")]
1627         public class Node : Xml.Node {
1628                 [CCode (cname = "htmlNodeStatus")]
1629                 public Status status (bool legacy);
1630         }
1632         [Compact]
1633         [CCode (cname = "xmlDoc", cheader_filename = "libxml/HTMLtree.h,libxml/HTMLparser.h")]
1634         public class Doc : Xml.Doc {
1635                 [CCode (cname = "htmlNewDoc")]
1636                 public Doc (string? uri = null, string? external_id = null);
1638                 [CCode (cname = "htmlNewNoDtD")]
1639                 public Doc.new_no_dtd (string? uri = null, string? external_id = null);
1641                 [CCode (cname = "htmlSAXParseDoc")]
1642                 public static Doc* sax_parse_doc (string cur, string? encoding, Xml.SAXHandler* sax, void* user_data = null);
1644                 [CCode (cname = "htmlSAXParseFile")]
1645                 public static Doc* sax_parse_file (string filename, string? encoding, Xml.SAXHandler* sax, void* user_data = null);
1647                 [CCode (cname = "htmlParseFile")]
1648                 public static Doc* parse_file (string filename, string? encoding);
1650                 [CCode (cname = "htmlReadDoc")]
1651                 public static Doc* read_doc (string cur, string url, string? encoding = null, int options = 0);
1653                 [CCode (cname = "htmlReadMemory")]
1654                 public static Doc* read_memory ([CCode (array_length = false)] char[] buffer, int size, string url, string? encoding = null, int options = 0);
1656                 [CCode (cname = "htmlReadFd")]
1657                 public static Doc* read_fd (int fd, string url, string? encoding = null, int options = 0);
1659                 [CCode (cname = "htmlReadIO")]
1660                 public static Doc* read_io (Xml.InputReadCallback ioread, Xml.InputCloseCallback ioclose, void* ioctx, string url, string? encoding = null, int options = 0);
1662                 [CCode (cname = "htmlGetMetaEncoding")]
1663                 public string get_meta_encoding ();
1665                 [CCode (cname = "htmlSetMetaEncoding")]
1666                 public int set_meta_encoding (string encoding);
1668                 [CCode (cname = "htmlDocDumpMemory")]
1669                 public void dump_memory (out string mem, out int len = null);
1671                 [CCode (cname = "htmlDocDumpMemoryFormat")]
1672                 public void dump_memory_format (out string mem, out int len = null, bool format = true);
1674                 [CCode (cname = "htmlDocDump", instance_pos = -1)]
1675 #if POSIX
1676                 public int dump (Posix.FILE f);
1677 #else
1678                 public int dump (GLib.FileStream f);
1679 #endif
1681                 [CCode (cname = "htmlSaveFile", instance_pos = -1)]
1682                 public int save_file (string filename);
1684                 [CCode (cname = "htmlNodeDumpFile", instance_pos = 1.1)]
1685 #if POSIX
1686                 public int node_dump_file (Posix.FILE file, Xml.Node* node);
1687 #else
1688                 public int node_dump_file (GLib.FileStream file, Xml.Node* node);
1689 #endif
1691                 [CCode (cname = "htmlNodeDumpFileFormat", instance_pos = 1.1)]
1692 #if POSIX
1693                 public int node_dump_file_format (Posix.FILE file, string enc = "UTF-8", bool format = true);
1694 #else
1695                 public int node_dump_file_format (GLib.FileStream file, string enc = "UTF-8", bool format = true);
1696 #endif
1698                 [CCode (cname = "htmlSaveFileEnc", instance_pos = 1.1)]
1699                 public int save_file_enc (string filename, string enc = "UTF-8");
1701                 [CCode (cname = "htmlSaveFileFormat", instance_pos = 1.1)]
1702                 public int save_file_format (string filename, string enc = "UTF-8", bool format = true);
1704                 [CCode (cname = "htmlIsAutoClosed")]
1705                 public bool is_auto_closed (Node* elem);
1707                 [CCode (cname = "htmlAutoCloseTag")]
1708                 public bool auto_close_tag (string name, Node* elem);
1709         }
1711         [Compact]
1712         [CCode (cname = "htmlElemDesc", cheader_filename = "libxml/HTMLparser.h")]
1713         public class ElemDesc {
1714                 public weak string name;
1715                 [CCode (cname = "startTag")]
1716                 public bool start_tag;
1717                 [CCode (cname = "endTag")]
1718                 public bool end_tag;
1719                 [CCode (cname = "saveEndTag")]
1720                 public bool save_end_tag;
1721                 public bool empty;
1722                 public bool depr;
1723                 public char dtd;
1724                 public bool isinline;
1725                 public weak string desc;
1726                 public weak string[] subelts;
1727                 public weak string defaultsubelt;
1728                 public weak string[] attrs_opt;
1729                 public weak string[] attrs_depr;
1730                 public weak string[] attrs_req;
1732                 [CCode (cname = "htmlTagLookup")]
1733                 public static ElemDesc* tag_lookup (string tag);
1735                 [CCode (cname = "htmlAttrAllowed")]
1736                 public Status attr_allowed (string attr, bool legacy);
1738                 [CCode (cname = "htmlElementAllowedHere")]
1739                 public bool allowed_here (string elt);
1741                 [CCode (cname = "htmlElementAllowedHereDesc")]
1742                 public bool allowed_here_desc (ElemDesc* child);
1744                 [CCode (cname = "htmlElementStatusHere")]
1745                 public Status status_here (ElemDesc* child);
1747                 [Ccode (cname = "htmlDefaultSubelement")]
1748                 public unowned string default_subelement ();
1750                 [Ccode (cname = "htmlRequiredAttrs")]
1751                 public unowned string[] required_attrs ();
1752         }
1754         [Compact]
1755         [CCode (cname = "htmlEntityDesc", cheader_filename = "libxml/HTMLParser.h")]
1756         public class EntityDesc
1757         {
1758                 public uint value;
1759                 public weak string name;
1760                 public weak string desc;
1762                 [CCode (cname = "htmlEntityDesc")]
1763                 public static EntityDesc* lookup (string name);
1765                 [CCode (cname = "htmlEntityValueDesc")]
1766                 public static EntityDesc* value_lookup (uint value);
1767         }
1769         [Compact]
1770         [CCode (cname = "htmlParserCtxt", free_function = "htmlFreeParserCtxt", cheader_filename = "libxml/HTMLparser.h")]
1771         public class ParserCtxt : Xml.ParserCtxt {
1772                 [CCode (cname = "htmlNewParserCtxt")]
1773                 public ParserCtxt ();
1775                 [CCode (cname = "htmlCreateMemoryParserCtxt")]
1776                 public ParserCtxt.create_memory ([CCode (array_length = false)] char[] buffer, int size);
1778                 [CCode (cname = "htmlCreatePushParserCtxt")]
1779                 public ParserCtxt.create_push (Xml.SAXHandler* sax, void* user_data, [CCode (array_length = false)] char[] data, int len, string? filename = null, Xml.CharEncoding enc = Xml.CharEncoding.NONE);
1781                 [CCode (cname = "htmlParseChunk")]
1782                 public int parse_chunk ([CCode (array_length = false)] char[] data, int size, bool terminate);
1784                 [CCode (cname = "htmlParseEntityRef")]
1785                 public EntityDesc* parse_entity_ref (out string entity_name);
1787                 [CCode (cname = "htmlParseCharRef")]
1788                 public int parse_char_ref ();
1790                 [CCode (cname = "htmlParseElement")]
1791                 public void parse_element ();
1793                 [CCode (cname = "htmlParseDocument")]
1794                 public int parse_document ();
1796                 [CCode (cname = "htmlCtxtReset")]
1797                 public void reset ();
1799                 [CCode (cname = "htmlCtxtUseOptions")]
1800                 public int use_options (int options);
1802                 [CCode (cname = "htmlCtxtReadDoc")]
1803                 public Doc* read_doc (string cur, string url, string? encoding = null, int options = 0);
1805                 [CCode (cname = "htmlCtxtReadFile")]
1806                 public Doc* read_file (string filename, string? encoding = null, int options = 0);
1808                 [CCode (cname = "htmlCtxtReadMemory")]
1809                 public Doc* read_memory ([CCode (array_length = false)] char[] buffer, int size, string url, string? encoding = null, int options = 0);
1811                 [CCode (cname = "htmlCtxtReadFd")]
1812                 public Doc* read_fd (int fd, string url, string? encoding = null, int options = 0);
1814                 [CCode (cname = "htmlCtxtReadIO")]
1815                 public Doc* read_io (Xml.InputReadCallback ioread, Xml.InputCloseCallback ioclose, void* ioctx, string url, string? encoding = null, int options = 0);
1816         }