Home modules.gotpike.org
Username: Password: [Create Account]
[Forgot Password?]

Modules

ADT
Database
GTK2
GUI
IP
PiJAX
Public
Sql
Stdio
Subversion
System
Tools
Xosd
lua
v4l2
wx

Recent Changes

Public.Parser.XML2 1.50
Public.ZeroMQ 1.1
Public.Template.Mustache 1.0
Public.Protocols.XMPP 1.4
Sql.Provider.jdbc 1.0

Popular Downloads

Public.Parser.JSON2 1.0
Public.Parser.JSON 0.2
GTK2 2.23
Public.Web.FCGI 1.8
Public.Parser.XML2 1.48


Module Information
Public.Parser.XML2
Viewing contents of Public_Parser_XML2-1.16/Node.c

/* Generated from "Node.cmod" by precompile.pike
 *
 * Do NOT edit this file.
 */

#undef PRECOMPILE_API_VERSION
#define PRECOMPILE_API_VERSION 2


#line 1 "Node.cmod"
/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: Node.cmod,v 1.7 2005/05/06 02:45:51 hww3 Exp $
 */

/*
 * File licensing and authorship information block.
 *
 * Version: MPL 1.1/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Initial Developer of the Original Code is
 *
 * Bill Welliver 
 *
 * Portions created by the Initial Developer are Copyright (C) Bill Welliver
 * All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of the LGPL, and not to allow others to use your version
 * of this file under the terms of the MPL, indicate your decision by
 * deleting the provisions above and replace them with the notice
 * and other provisions required by the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL or the LGPL.
 *
 * Significant Contributors to this file are:
 *
 *
 */

#define THIS_IS_XML2_NODE 1

#include "xml2.h"

/*! @module Public
 */

/*! @module Parser
 */

/*! @module XML2
 */

/*! @class Node
 */


#undef class_Node_defined
#define class_Node_defined
struct program *Node_program=NULL;
static int Node_program_fun_num=-1;

#undef var_object_data_Node_defined
#define var_object_data_Node_defined

#undef THIS
#define THIS ((struct Node_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef THIS_NODE
#define THIS_NODE ((struct Node_struct *)(Pike_interpreter.frame_pointer->current_storage))

#undef OBJ2_NODE
#define OBJ2_NODE(o) ((struct Node_struct *)(o->storage+Node_storage_offset))

#undef GET_NODE_STORAGE
#define GET_NODE_STORAGE ((struct Node_struct *)(o->storage+Node_storage_offset)
static ptrdiff_t Node_storage_offset;
struct Node_struct {

#ifdef var_object_data_Node_defined
#line 79 "Node.cmod"
NODE_OBJECT_DATA   *object_data;
#endif /* var_object_data_Node_defined */
};
#define f_Node_cq__sprintf_defined
ptrdiff_t f_Node_cq__sprintf_fun_num = 0;
void f_Node_cq__sprintf(INT32 args) {
#line 81 "Node.cmod"
INT_TYPE type;
#line 81 "Node.cmod"
struct svalue * t;
#line 81 "Node.cmod"
if(args != 2) wrong_number_of_args_error("_sprintf",args,2);
#line 81 "Node.cmod"
if(Pike_sp[0-2].type != PIKE_T_INT) SIMPLE_BAD_ARG_ERROR("_sprintf",1,"int");
type=Pike_sp[0-2].u.integer;
#line 81 "Node.cmod"
t=Pike_sp+1-2; dmalloc_touch_svalue(Pike_sp+1-2);
{
  char * desc;

  check_node_created();
  if(MY_NODE->name == NULL)
  {
    pop_n_elems(args);
    push_text("Node(UNKNOWN)");
    return;    
  }
  desc = malloc(strlen(MY_NODE->name) + 15);

  if(desc == NULL)
    Pike_error("Unable to allocate memory!\n");

  snprintf(desc, strlen(MY_NODE->name)+15, "Node(%d, %s)", 
    MY_NODE->type, (char *)(MY_NODE->name));

  pop_n_elems(args);
  
  push_text(desc);
}

}
#define f_Node_create_defined
ptrdiff_t f_Node_create_fun_num = 0;
void f_Node_create(INT32 args) {
#line 105 "Node.cmod"
if(args != 0) wrong_number_of_args_error("create",args,0);
{
}

}
/*! @decl int get_line_no()
 *! @returns 
 *!   the line number the node is present on
 */
#define f_Node_get_line_no_defined
ptrdiff_t f_Node_get_line_no_fun_num = 0;
void f_Node_get_line_no(INT32 args) {
#line 113 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_line_no",args,0);
{
  check_node_created();

  push_int(MY_NODE->line);
}

}
/*! @decl Node set_ns(string ns_prefix)
 *!
 */
#define f_Node_set_ns_defined
ptrdiff_t f_Node_set_ns_fun_num = 0;
void f_Node_set_ns(INT32 args) {
#line 123 "Node.cmod"
struct pike_string * ns_prefix;
#line 123 "Node.cmod"
if(args != 1) wrong_number_of_args_error("set_ns",args,1);
#line 123 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("set_ns",1,"string");
#line 123 "Node.cmod"
debug_malloc_pass(ns_prefix=Pike_sp[0-1].u.string);
{
  xmlNsPtr ans;
  
  ans = xmlSearchNs(MY_NODE->doc, MY_NODE, (xmlChar *)ns_prefix->str);
  if(ans == NULL)
  {
    Pike_error("Namespace %s does not yet exist.\n", ns_prefix->str);
  }

  xmlSetNs(MY_NODE, ans);

  push_object(this_object());
}

}
/*! @decl Node set_content(string content)
 *!
 *! sets the content for a node
 *!
 */
#define f_Node_set_content_defined
ptrdiff_t f_Node_set_content_fun_num = 0;
void f_Node_set_content(INT32 args) {
#line 143 "Node.cmod"
struct pike_string * content;
#line 143 "Node.cmod"
if(args != 1) wrong_number_of_args_error("set_content",args,1);
#line 143 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("set_content",1,"string");
#line 143 "Node.cmod"
debug_malloc_pass(content=Pike_sp[0-1].u.string);
{
  check_node_created();
  xmlNodeSetContent(MY_NODE, (xmlChar *)content->str);
  
  push_object(this_object());

}

}
/*! @decl string get_text()
 *!
 *! gets the contents of a text node, or the contents and children of an 
 *! element, or the value of an attribute node.
 */
#define f_Node_get_text_defined
ptrdiff_t f_Node_get_text_fun_num = 0;
void f_Node_get_text(INT32 args) {
#line 157 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_text",args,0);
{
  xmlChar * val;
  check_node_created();
  val = xmlNodeGetContent(MY_NODE);

  if(val == NULL)
    push_int(0);
  else
    push_text(val);
}

}
/*! @decl string get_node_path()
 *!
 *! returns an XPath/XQuery based path for this Node.
 */
#define f_Node_get_node_path_defined
ptrdiff_t f_Node_get_node_path_fun_num = 0;
void f_Node_get_node_path(INT32 args) {
#line 173 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_node_path",args,0);
{
  xmlChar * val;
  check_node_created();
  val = xmlGetNodePath(MY_NODE);

  if(val == NULL)
    push_int(0);
  else
    push_text(val);
}

}
/*! @decl string get_ns()
 *!  returns the default name space uri for the element
 */
#define f_Node_get_ns_defined
ptrdiff_t f_Node_get_ns_fun_num = 0;
void f_Node_get_ns(INT32 args) {
#line 188 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_ns",args,0);
{
  char * str;

  check_node_created();
  if(MY_NODE->ns != NULL)
  {
    str = xmlStrdup(MY_NODE->ns->href);
    push_text(str);    
  }
  else push_int(0);
}

}
/*! @decl mapping get_nss()
 *!   gets a list of all known namespaces for this element.
 *! @returns
 *!    a mapping of "short" prefixes to namespace uris.
 */
#define f_Node_get_nss_defined
ptrdiff_t f_Node_get_nss_fun_num = 0;
void f_Node_get_nss(INT32 args) {
#line 206 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_nss",args,0);
{
  xmlNsPtr * list;
  xmlNsPtr  ns;
  int num_ns = 0;

  check_node_created();
  list =  xmlGetNsList(MY_NODE->doc, MY_NODE);

  if(list == NULL)
  {
    push_int(0); 
    return;
  }   

  for(ns = * list; (ns!=NULL); ns = ns->next)
  {
    if(ns->prefix==NULL)
      push_text("_default");
    else 
      push_text(ns->prefix);
    push_text(ns->href);
    num_ns++;
  }
  f_aggregate_mapping(num_ns*2);
}

}
/*! @decl string get_base()
 *!
 */
#define f_Node_get_base_defined
ptrdiff_t f_Node_get_base_fun_num = 0;
void f_Node_get_base(INT32 args) {
#line 236 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_base",args,0);
{
  xmlChar * val;
  check_node_created();
  val = xmlNodeGetBase(MY_NODE->doc, MY_NODE);

  if(val == NULL)
    push_int(0);
  else
    push_text(val);
}

}
/*! @decl string get_lang()
 *!
 */
#define f_Node_get_lang_defined
ptrdiff_t f_Node_get_lang_fun_num = 0;
void f_Node_get_lang(INT32 args) {
#line 251 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_lang",args,0);
{
  xmlChar * val;
  check_node_created();
  val = xmlNodeGetLang(MY_NODE);

  if(val == NULL)
    push_int(0);
  else
    push_text(val);
}

}
/*! @decl int get_space_preserve()
 *!
 */
#define f_Node_get_space_preserve_defined
ptrdiff_t f_Node_get_space_preserve_fun_num = 0;
void f_Node_get_space_preserve(INT32 args) {
#line 266 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_space_preserve",args,0);
{
  int i;
  check_node_created();
  i = xmlNodeGetSpacePreserve(MY_NODE);

    push_int(i);
}


}
/*! @decl mapping get_attributes()
 *!   returns all attributes, irrespective of namespace
 *! @returns
 *!   a mapping of attribute name to attribute value.
 */
#define f_Node_get_attributes_defined
ptrdiff_t f_Node_get_attributes_fun_num = 0;
void f_Node_get_attributes(INT32 args) {
#line 281 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_attributes",args,0);
{
  struct _xmlAttr * attr;
  int num_attrs = 0;

  check_node_created();
  /* only element nodes have attributes. */
  if(MY_NODE->type != XML_ELEMENT_NODE)
  {
    push_int(0);
    return;
  }
  else
  {
    attr = MY_NODE->properties;

    for(attr; attr!=NULL; attr = attr->next)
    {
      xmlChar * val = NULL;
      if(attr==NULL) break;

      val = xmlGetProp(MY_NODE, attr->name);

      if(val == NULL) val = "";

      push_text((char *)(attr->name));
      push_text((char *)(val));

      xmlFree(val);

/*      printf("Found a property: %s\n", (char *)(attr->name)); */
      num_attrs ++;
    }
   
   f_aggregate_mapping(num_attrs*2);

   }
    return;
}

}
/*! @decl mapping get_no_ns_attributes()
 *!   returns all attributes not present in a namespace
 *! @returns
 *!   a mapping of attribute name to attribute value.
 */
#define f_Node_get_no_ns_attributes_defined
ptrdiff_t f_Node_get_no_ns_attributes_fun_num = 0;
void f_Node_get_no_ns_attributes(INT32 args) {
#line 326 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_no_ns_attributes",args,0);
{
  struct _xmlAttr * attr;
  int num_attrs = 0;

  check_node_created();
  /* only element nodes have attributes. */
  if(MY_NODE->type != XML_ELEMENT_NODE)
  {
    push_int(0);
    return;
  }
  else
  {
    attr = MY_NODE->properties;

    for(attr; attr!=NULL; attr = attr->next)
    {
      xmlChar * val = NULL;
      if(attr==NULL) break;
      if(attr->ns == NULL) continue;

      val = xmlGetNoNsProp(MY_NODE, attr->name);

      if(val != NULL) 
      {
        push_text((char *)(attr->name));
        push_text((char *)(val));
        num_attrs ++;
      }
    }
   
   f_aggregate_mapping(num_attrs*2);

   }
    return;
}

}
/*! @decl mapping get_ns_attributes(string ns_prefix)
 *!   given a namespace uri, return all elements for that namespace
 *!   present in the element.
 *! @returns
 *!    a mapping of attribute names to attribute values.
 */
#define f_Node_get_ns_attributes_defined
ptrdiff_t f_Node_get_ns_attributes_fun_num = 0;
void f_Node_get_ns_attributes(INT32 args) {
#line 370 "Node.cmod"
struct pike_string * ns_uri;
#line 370 "Node.cmod"
if(args != 1) wrong_number_of_args_error("get_ns_attributes",args,1);
#line 370 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("get_ns_attributes",1,"string");
#line 370 "Node.cmod"
debug_malloc_pass(ns_uri=Pike_sp[0-1].u.string);
{
  struct _xmlAttr * attr;
  int num_attrs = 0;

  check_node_created();
  /* only element nodes have attributes. */
  if(MY_NODE->type != XML_ELEMENT_NODE)
  {
    push_int(0);
    return;
  }
  else
  {
    attr = MY_NODE->properties;

    for(attr; attr!=NULL; attr = attr->next)
    {
      xmlChar * val = NULL;
      xmlNs * ns = NULL;
      if(attr==NULL) break;
      ns = attr->ns;
      if(!strcmp(ns_uri->str, ns->href)) continue;
      val = xmlGetProp(MY_NODE, attr->name);

      if(val == NULL) val = "";

      push_text((char *)(attr->name));
      push_text((char *)(val));
      xmlFree(val);
/*      printf("Found a property: %s\n", (char *)(attr->name)); */
      num_attrs ++;
    }
   
   f_aggregate_mapping(num_attrs*2);

   }
    return;
}

}
/*!  @decl array children()
 *!     get all children of this node
 *!  @returns
 *!      an array of all elements with are a direct child of this element.
 */
#define f_Node_children_defined
ptrdiff_t f_Node_children_fun_num = 0;
void f_Node_children(INT32 args) {
#line 415 "Node.cmod"
if(args != 0) wrong_number_of_args_error("children",args,0);
#line 417 "Node.cmod"
{
  struct object * o;
  xmlNode *cur_node = NULL;
  int num_children=0;
  check_node_created();

  if(MY_NODE->children != NULL)
    cur_node = MY_NODE->children;

  for(cur_node; cur_node; cur_node = cur_node->next) {
    if (cur_node != NULL) {
      o = NEW_NODE();
      OBJ2_NODE(o)->object_data->node = cur_node; 
      NEW_NODE_REFS(o);
      push_object(o);
      num_children++;
    }
  }
  if(num_children>0)
    f_aggregate(num_children);
  else push_int(0);
}

}
/*!  @decl Node parent()
 *!     get the Node which is the parent of this Node.
 */
#define f_Node_parent_defined
ptrdiff_t f_Node_parent_fun_num = 0;
void f_Node_parent(INT32 args) {
#line 443 "Node.cmod"
if(args != 0) wrong_number_of_args_error("parent",args,0);
{
  struct object * o;
  check_node_created();
  if(MY_NODE->parent == NULL)
  {
    push_int(0);
    return;
  }

  else 
  {
    o=NEW_NODE();
    OBJ2_NODE(o)->object_data->node = MY_NODE->parent;
    NEW_NODE_REFS(o);
/* printf("refs: %d\n", (* OBJ2_NODE(o)->object_data->refs)); */
    push_object(o);
  }
}

}
/*!  @decl Node get_root_node()
 *!     get the Node which is the root of this tree.
 */
#define f_Node_get_root_node_defined
ptrdiff_t f_Node_get_root_node_fun_num = 0;
void f_Node_get_root_node(INT32 args) {
#line 466 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_root_node",args,0);
{
  struct object * o;
  xmlNodePtr node;

  check_node_created();
  
  node = xmlDocGetRootElement(MY_NODE->doc);
  if(node == NULL)
  {
    push_int(0);
    return;
  }

  else 
  {
    o=NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node set_root_node()
 *!     set this Node to be the root of this tree.
 *!  @returns
 *!     the old root of the tree, if any existed.
 */
#define f_Node_set_root_node_defined
ptrdiff_t f_Node_set_root_node_fun_num = 0;
void f_Node_set_root_node(INT32 args) {
#line 494 "Node.cmod"
if(args != 0) wrong_number_of_args_error("set_root_node",args,0);
{
  struct object * o;
  xmlNodePtr node;

  check_node_created();
  
  node = xmlDocSetRootElement(MY_NODE->doc, MY_NODE);
  if(node == NULL)
  {
    push_int(0);
    return;
  }

  else 
  {
    o=NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node new_cdata_block(string contents)
 *!     returns an unlinked CDATA block.
 */
#define f_Node_new_cdata_block_defined
ptrdiff_t f_Node_new_cdata_block_fun_num = 0;
void f_Node_new_cdata_block(INT32 args) {
#line 520 "Node.cmod"
struct pike_string * contents;
#line 520 "Node.cmod"
if(args != 1) wrong_number_of_args_error("new_cdata_block",args,1);
#line 520 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("new_cdata_block",1,"string");
#line 520 "Node.cmod"
debug_malloc_pass(contents=Pike_sp[0-1].u.string);
{
  struct object * o;
  xmlNodePtr node;

  check_node_created();

  node = xmlNewCDataBlock(MY_NODE->doc, contents->str, contents->len);
  
  if(node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node new_pi(string name, string contents)
 *!     returns a linked Processing Instruction node.
 */
#define f_Node_new_pi_defined
ptrdiff_t f_Node_new_pi_fun_num = 0;
void f_Node_new_pi(INT32 args) {
#line 546 "Node.cmod"
struct pike_string * name;
#line 546 "Node.cmod"
struct pike_string * contents;
#line 546 "Node.cmod"
if(args != 2) wrong_number_of_args_error("new_pi",args,2);
#line 546 "Node.cmod"
if(Pike_sp[0-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("new_pi",1,"string");
#line 546 "Node.cmod"
debug_malloc_pass(name=Pike_sp[0-2].u.string);
#line 546 "Node.cmod"
if(Pike_sp[1-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("new_pi",2,"string");
#line 546 "Node.cmod"
debug_malloc_pass(contents=Pike_sp[1-2].u.string);
{
  struct object * o;
  xmlNodePtr node;

  check_node_created();

#ifdef HAVE_XMLNEWDOCPI
  node = xmlNewDocPI(MY_NODE->doc, name->str, contents->str);
  
  if(node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }

#else
  Pike_error("new_pi() is not available. please upgrade your libxslt.\n");
#endif /* HAVE_XMLNEWDOCPI */

}

}
/*!  @decl Node set_attribute(string name, string value)
 *!  @decl Node set_ns_attribute(string name, string ns, string value)
 *!
 *!  sets a new attribute, overwriting any existing value.
 *!  if @[value] is zero, the attribute will be removed from the node.
 */
#define f_Node_set_ns_attribute_defined
ptrdiff_t f_Node_set_ns_attribute_fun_num = 0;
void f_Node_set_ns_attribute(INT32 args) {
#line 581 "Node.cmod"
struct pike_string * name;
#line 581 "Node.cmod"
struct pike_string * ns;
#line 581 "Node.cmod"
struct pike_string * value;
#line 581 "Node.cmod"
if(args != 3) wrong_number_of_args_error("set_ns_attribute",args,3);
#line 581 "Node.cmod"
if(Pike_sp[0-3].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("set_ns_attribute",1,"string");
#line 581 "Node.cmod"
debug_malloc_pass(name=Pike_sp[0-3].u.string);
#line 581 "Node.cmod"
if(Pike_sp[1-3].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("set_ns_attribute",2,"string");
#line 581 "Node.cmod"
debug_malloc_pass(ns=Pike_sp[1-3].u.string);
#line 581 "Node.cmod"
if(Pike_sp[2-3].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("set_ns_attribute",3,"string");
#line 581 "Node.cmod"
debug_malloc_pass(value=Pike_sp[2-3].u.string);
{
  struct object * o;
  xmlAttrPtr attr;
  xmlNsPtr ans;

printf("called ns version\n");

  check_node_created();

  ans = xmlSearchNs(MY_NODE->doc, MY_NODE, (xmlChar *)ns->str);
  if(ans == NULL)
  {
    Pike_error("Namespace %s does not exist.\n", ns->str);
  }

  attr = xmlNewNsProp(MY_NODE, ans, (xmlChar *)name->str, (xmlChar *)value->str);

  if(attr == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    push_object(this_object());
  }
}

}
/*! @decl object delete_attribute(string name, string|void ns)
 *!
 *! 
 */
#define f_Node_delete_attribute_1_defined
ptrdiff_t f_Node_delete_attribute_1_fun_num = 0;
void f_Node_delete_attribute_1(INT32 args) {
#line 614 "Node.cmod"
struct pike_string * name;
#line 614 "Node.cmod"
if(args != 1) wrong_number_of_args_error("delete_attribute",args,1);
#line 614 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("delete_attribute",1,"string");
#line 614 "Node.cmod"
debug_malloc_pass(name=Pike_sp[0-1].u.string);
{
  check_node_created();
  xmlUnsetProp(MY_NODE, (xmlChar *)name->str);

  push_object(this_object());

}

}
#define f_Node_delete_attribute_2_defined
ptrdiff_t f_Node_delete_attribute_2_fun_num = 0;
void f_Node_delete_attribute_2(INT32 args) {
#line 623 "Node.cmod"
struct pike_string * name;
#line 623 "Node.cmod"
struct pike_string * ns;
#line 623 "Node.cmod"
if(args != 2) wrong_number_of_args_error("delete_attribute",args,2);
#line 623 "Node.cmod"
if(Pike_sp[0-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("delete_attribute",1,"string");
#line 623 "Node.cmod"
debug_malloc_pass(name=Pike_sp[0-2].u.string);
#line 623 "Node.cmod"
if(Pike_sp[1-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("delete_attribute",2,"string");
#line 623 "Node.cmod"
debug_malloc_pass(ns=Pike_sp[1-2].u.string);
{
  xmlNsPtr ans;

  check_node_created();

  ans = xmlSearchNs(MY_NODE->doc, MY_NODE, (xmlChar *)ns->str);
  if(ans == NULL)
  {
    Pike_error("Namespace %s does not exist.\n", ns->str);
  }

  xmlUnsetNsProp(MY_NODE, ans, (xmlChar *)name->str);

  push_object(this_object());

}

}

#if defined(f_Node_delete_attribute_1_defined) || defined(f_Node_delete_attribute_2_defined)
#define f_Node_delete_attribute_defined
ptrdiff_t Node_f_Node_delete_attribute_fun_num = 0;
void f_Node_delete_attribute(INT32 args) {
  switch(args) {
   case 1:

#ifdef f_Node_delete_attribute_1_defined
    f_Node_delete_attribute_1(args);
    return;

#endif /* f_Node_delete_attribute_1_defined */
    break;
   case 2:

#ifdef f_Node_delete_attribute_2_defined
    f_Node_delete_attribute_2(args);
    return;

#endif /* f_Node_delete_attribute_2_defined */
    break;
   default:
    wrong_number_of_args_error("delete_attribute",args,1);
  }
}

#endif /* f_Node_delete_attribute_1_defined, f_Node_delete_attribute_2_defined */
#define f_Node_set_attribute_defined
ptrdiff_t f_Node_set_attribute_fun_num = 0;
void f_Node_set_attribute(INT32 args) {
#line 641 "Node.cmod"
struct pike_string * name;
#line 641 "Node.cmod"
struct pike_string * value;
#line 641 "Node.cmod"
if(args != 2) wrong_number_of_args_error("set_attribute",args,2);
#line 641 "Node.cmod"
if(Pike_sp[0-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("set_attribute",1,"string");
#line 641 "Node.cmod"
debug_malloc_pass(name=Pike_sp[0-2].u.string);
#line 641 "Node.cmod"
if(Pike_sp[1-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("set_attribute",2,"string");
#line 641 "Node.cmod"
debug_malloc_pass(value=Pike_sp[1-2].u.string);
{
  struct object * o;
  xmlAttrPtr attr;
  xmlAttrPtr val;

  check_node_created();

  xmlUnsetProp(MY_NODE, (xmlChar *)name->str);

  attr = xmlNewProp(MY_NODE, (xmlChar *)name->str, (xmlChar *)value->str);

  if(attr == NULL)
  {
    pop_n_elems(2);
    push_int(0);
    return;
  }
  else
  {
    pop_n_elems(2);
    push_object(this_object());
  }
}

}
/*!  @decl Node new_char_ref(string name)
 *!     returns an unlinked character reference node.
 */
#define f_Node_new_char_ref_defined
ptrdiff_t f_Node_new_char_ref_fun_num = 0;
void f_Node_new_char_ref(INT32 args) {
#line 669 "Node.cmod"
struct pike_string * name;
#line 669 "Node.cmod"
if(args != 1) wrong_number_of_args_error("new_char_ref",args,1);
#line 669 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("new_char_ref",1,"string");
#line 669 "Node.cmod"
debug_malloc_pass(name=Pike_sp[0-1].u.string);
{
  struct object * o;
  xmlNodePtr node;

  check_node_created();

  if(name->str[0] != '&' || name->str[0] != '#')
  {
    Pike_error("Invalid charater reference.\n");
  }

  node = xmlNewCharRef(MY_NODE->doc, name->str);
  
  if(node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node new_comment(string content)
 *!     returns an unlinked character reference node.
 */
#define f_Node_new_comment_defined
ptrdiff_t f_Node_new_comment_fun_num = 0;
void f_Node_new_comment(INT32 args) {
#line 700 "Node.cmod"
struct pike_string * content;
#line 700 "Node.cmod"
if(args != 1) wrong_number_of_args_error("new_comment",args,1);
#line 700 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("new_comment",1,"string");
#line 700 "Node.cmod"
debug_malloc_pass(content=Pike_sp[0-1].u.string);
{
  struct object * o;
  xmlNodePtr node;

  check_node_created();

  node = xmlNewComment(content->str);
  
  if(node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}


}
/*!  @decl Node new_doc_comment(string content)
 *!     returns an unlinked character reference node.
 */
#define f_Node_new_doc_comment_defined
ptrdiff_t f_Node_new_doc_comment_fun_num = 0;
void f_Node_new_doc_comment(INT32 args) {
#line 727 "Node.cmod"
struct pike_string * content;
#line 727 "Node.cmod"
if(args != 1) wrong_number_of_args_error("new_doc_comment",args,1);
#line 727 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("new_doc_comment",1,"string");
#line 727 "Node.cmod"
debug_malloc_pass(content=Pike_sp[0-1].u.string);
{
  struct object * o;
  xmlNodePtr node;

  check_node_created();

  node = xmlNewDocComment(MY_NODE->doc, content->str);
  
  if(node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}



}
/*!  @decl Node new_child(string ns, string name, string content)
 *!     add a new child element, added to end of children for this node.
 */
#define f_Node_new_child_defined
ptrdiff_t f_Node_new_child_fun_num = 0;
void f_Node_new_child(INT32 args) {
#line 755 "Node.cmod"
struct pike_string * name;
#line 755 "Node.cmod"
struct pike_string * content;
#line 755 "Node.cmod"
if(args != 2) wrong_number_of_args_error("new_child",args,2);
#line 755 "Node.cmod"
if(Pike_sp[0-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("new_child",1,"string");
#line 755 "Node.cmod"
debug_malloc_pass(name=Pike_sp[0-2].u.string);
#line 755 "Node.cmod"
if(Pike_sp[1-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("new_child",2,"string");
#line 755 "Node.cmod"
debug_malloc_pass(content=Pike_sp[1-2].u.string);
{
  struct object * o;
  xmlNodePtr node;

  check_node_created();

  node = xmlNewChild(MY_NODE, NULL, name->str, content->str);
  
  if(node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*! @decl Node add_ns(string href, string prefix)
 *!
 */
#define f_Node_add_ns_defined
ptrdiff_t f_Node_add_ns_fun_num = 0;
void f_Node_add_ns(INT32 args) {
#line 781 "Node.cmod"
struct pike_string * href;
#line 781 "Node.cmod"
struct pike_string * prefix;
#line 781 "Node.cmod"
if(args != 2) wrong_number_of_args_error("add_ns",args,2);
#line 781 "Node.cmod"
if(Pike_sp[0-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("add_ns",1,"string");
#line 781 "Node.cmod"
debug_malloc_pass(href=Pike_sp[0-2].u.string);
#line 781 "Node.cmod"
if(Pike_sp[1-2].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("add_ns",2,"string");
#line 781 "Node.cmod"
debug_malloc_pass(prefix=Pike_sp[1-2].u.string);
{
  xmlNsPtr ns;

  ns = xmlNewNs(MY_NODE, (xmlChar *) href->str, (xmlChar *) prefix->str);

  if(ns == NULL)
  {
    Pike_error("Unable to create new namespace.\n");
  }

  push_object(this_object());
}

}
/*!  @decl Node add_child(Node child)
 *!     add a node to end of children for this node.
 */
#define f_Node_add_child_defined
ptrdiff_t f_Node_add_child_fun_num = 0;
void f_Node_add_child(INT32 args) {
#line 798 "Node.cmod"
struct object * child;
#line 798 "Node.cmod"
if(args != 1) wrong_number_of_args_error("add_child",args,1);
#line 798 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_OBJECT) SIMPLE_BAD_ARG_ERROR("add_child",1,"object");
#line 798 "Node.cmod"
debug_malloc_pass(child=Pike_sp[0-1].u.object);
{
  struct object * o;
  xmlNodePtr node;

  CHECK_NODE_PASSED(child);

  check_node_created();

  node = xmlAddChild(MY_NODE, OBJ2_NODE(child)->object_data->node);
  
  if(node == NULL || OBJ2_NODE(child)->object_data->node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node add_sibling(Node sibling)
 *!     add a node to end of siblings for this node.
 */
#define f_Node_add_sibling_defined
ptrdiff_t f_Node_add_sibling_fun_num = 0;
void f_Node_add_sibling(INT32 args) {
#line 826 "Node.cmod"
struct object * sibling;
#line 826 "Node.cmod"
if(args != 1) wrong_number_of_args_error("add_sibling",args,1);
#line 826 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_OBJECT) SIMPLE_BAD_ARG_ERROR("add_sibling",1,"object");
#line 826 "Node.cmod"
debug_malloc_pass(sibling=Pike_sp[0-1].u.object);
{
  struct object * o;
  xmlNodePtr node;

  CHECK_NODE_PASSED(sibling);
  check_node_created();

  node = xmlAddSibling(MY_NODE, OBJ2_NODE(sibling)->object_data->node);
  
  if(node == NULL || OBJ2_NODE(sibling)->object_data->node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node add_next_sibling(Node sibling)
 *!     add a sibling node after this node.
 */
#define f_Node_add_next_sibling_defined
ptrdiff_t f_Node_add_next_sibling_fun_num = 0;
void f_Node_add_next_sibling(INT32 args) {
#line 853 "Node.cmod"
struct object * sibling;
#line 853 "Node.cmod"
if(args != 1) wrong_number_of_args_error("add_next_sibling",args,1);
#line 853 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_OBJECT) SIMPLE_BAD_ARG_ERROR("add_next_sibling",1,"object");
#line 853 "Node.cmod"
debug_malloc_pass(sibling=Pike_sp[0-1].u.object);
{
  struct object * o;
  xmlNodePtr node;

  CHECK_NODE_PASSED(sibling);
  check_node_created();

  node = xmlAddNextSibling(MY_NODE, OBJ2_NODE(sibling)->object_data->node);
  
  if(node == NULL || OBJ2_NODE(sibling)->object_data->node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node add_prev_sibling(Node sibling)
 *!     add a sibling node after this node.
 */
#define f_Node_add_prev_sibling_defined
ptrdiff_t f_Node_add_prev_sibling_fun_num = 0;
void f_Node_add_prev_sibling(INT32 args) {
#line 880 "Node.cmod"
struct object * sibling;
#line 880 "Node.cmod"
if(args != 1) wrong_number_of_args_error("add_prev_sibling",args,1);
#line 880 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_OBJECT) SIMPLE_BAD_ARG_ERROR("add_prev_sibling",1,"object");
#line 880 "Node.cmod"
debug_malloc_pass(sibling=Pike_sp[0-1].u.object);
{
  struct object * o;
  xmlNodePtr node;

  CHECK_NODE_PASSED(sibling);
  check_node_created();

  node = xmlAddPrevSibling(MY_NODE, OBJ2_NODE(sibling)->object_data->node);
  
  if(node == NULL || OBJ2_NODE(sibling)->object_data->node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node get_last_child()
 *!     get the Node which is the last child of this Node.
 */
#define f_Node_get_last_child_defined
ptrdiff_t f_Node_get_last_child_fun_num = 0;
void f_Node_get_last_child(INT32 args) {
#line 907 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_last_child",args,0);
{
  struct object * o;
  xmlNodePtr node;

  check_node_created();

  node = xmlGetLastChild(MY_NODE);

  if(node == NULL)
  {
    push_int(0);
    return;
  }
  else
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = node;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node next()
 *!  get the next sibling of this Node.
 *!  @returns
 *!    the next node which is a sibling of this node.
 */
#define f_Node_next_defined
ptrdiff_t f_Node_next_fun_num = 0;
void f_Node_next(INT32 args) {
#line 935 "Node.cmod"
if(args != 0) wrong_number_of_args_error("next",args,0);
{
  struct object * o;
  check_node_created();
  if(MY_NODE->next == NULL)
  {
    push_int(0);
    return;
  }
	
  else 
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = MY_NODE->next;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*!  @decl Node prev()
 *!  get the previous sibling of this Node.
 *!  @returns
 *!    the previous node which is a sibling of this node.
 */
#define f_Node_prev_defined
ptrdiff_t f_Node_prev_fun_num = 0;
void f_Node_prev(INT32 args) {
#line 959 "Node.cmod"
if(args != 0) wrong_number_of_args_error("prev",args,0);
{
  struct object * o;
    check_node_created();
  if(MY_NODE->prev == NULL)
  {
    push_int(0);
    return;
  }

  else 
  {
    o = NEW_NODE();
    OBJ2_NODE(o)->object_data->node = MY_NODE->prev;
    NEW_NODE_REFS(o);
    push_object(o);
  }
}

}
/*! @decl int is_blank()
 *!
 *!  is this node empty?
 */
#define f_Node_is_blank_defined
ptrdiff_t f_Node_is_blank_fun_num = 0;
void f_Node_is_blank(INT32 args) {
#line 982 "Node.cmod"
if(args != 0) wrong_number_of_args_error("is_blank",args,0);
{
  check_node_created();

  do { INT_TYPE ret_=(xmlIsBlankNode(MY_NODE));  push_int(ret_); return; }while(0);
#line 987 "Node.cmod"
}

}
/*! @decl int is_text()
 *! 
 *!  is this a text node?
 */
#define f_Node_is_text_defined
ptrdiff_t f_Node_is_text_fun_num = 0;
void f_Node_is_text(INT32 args) {
#line 993 "Node.cmod"
if(args != 0) wrong_number_of_args_error("is_text",args,0);
{
  check_node_created();

  do { INT_TYPE ret_=(xmlNodeIsText(MY_NODE));  push_int(ret_); return; }while(0);
#line 998 "Node.cmod"
}

}
/*!  @decl int get_node_type()
 *!
 *!  get the type of node.
 *!  
 *!  @returns
 *!   the integer node type. Node type constants are 
 *!   defined in @[Constants].
 */
#define f_Node_get_node_type_defined
ptrdiff_t f_Node_get_node_type_fun_num = 0;
void f_Node_get_node_type(INT32 args) {
#line 1008 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_node_type",args,0);
{
  check_node_created();

  push_int((int)(MY_NODE->type));
}

}
/*! @decl string get_node_name()
 *!  gets the name of this node, if it has one.
 */
#define f_Node_get_node_name_defined
ptrdiff_t f_Node_get_node_name_fun_num = 0;
void f_Node_get_node_name(INT32 args) {
#line 1018 "Node.cmod"
if(args != 0) wrong_number_of_args_error("get_node_name",args,0);
{
  check_node_created();
  if((char *)(MY_NODE->name) != NULL)
    push_text((char *)(MY_NODE->name));
  else push_int(0);
} 

}
/*! @decl string set_node_name(string name)
 *!  gets the name of this node, if it has one.
 */
#define f_Node_set_node_name_defined
ptrdiff_t f_Node_set_node_name_fun_num = 0;
void f_Node_set_node_name(INT32 args) {
#line 1029 "Node.cmod"
struct pike_string * name;
#line 1029 "Node.cmod"
if(args != 1) wrong_number_of_args_error("set_node_name",args,1);
#line 1029 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("set_node_name",1,"string");
#line 1029 "Node.cmod"
debug_malloc_pass(name=Pike_sp[0-1].u.string);
{
  check_node_created();

  xmlNodeSetName(MY_NODE, (xmlChar *)name->str);

  push_object(this_object());
} 

}
/*! @decl string render_xml(int level, int format)
 *!
 *! renders the node and all children as xml. 
 *!
 *! @param level
 *!   the indentation level to use
 *!
 *! @param format
 *!    should the xml be formated for ease of human reading.
 *!    this setting only takes 	effect if 
 *!    Public.Parser.XML2.xmlKeepBlanksDefault(0) has been called.
 */
#define f_Node_render_xml_defined
ptrdiff_t f_Node_render_xml_fun_num = 0;
void f_Node_render_xml(INT32 args) {
#line 1050 "Node.cmod"
INT_TYPE level;
#line 1050 "Node.cmod"
INT_TYPE format;
#line 1050 "Node.cmod"
if(args != 2) wrong_number_of_args_error("render_xml",args,2);
#line 1050 "Node.cmod"
if(Pike_sp[0-2].type != PIKE_T_INT) SIMPLE_BAD_ARG_ERROR("render_xml",1,"int");
level=Pike_sp[0-2].u.integer;
#line 1050 "Node.cmod"
if(Pike_sp[1-2].type != PIKE_T_INT) SIMPLE_BAD_ARG_ERROR("render_xml",2,"int");
format=Pike_sp[1-2].u.integer;
#line 1051 "Node.cmod"
{
  int dumped;
  xmlBufferPtr buf;
  char * str;

  check_node_created();
  buf = xmlBufferCreate();
  dumped = xmlNodeDump(buf, MY_NODE->doc, MY_NODE, level, format);

  if(dumped>0)
  {
    str = (char *)xmlStrdup(buf->content);
    xmlBufferFree(buf);
    push_text(str);

  }
  
}

}
/*! @decl string render_html()
 *!
 *! renders the node and all children as html. 
 *!
 */
#define f_Node_render_html_defined
ptrdiff_t f_Node_render_html_fun_num = 0;
void f_Node_render_html(INT32 args) {
#line 1075 "Node.cmod"
if(args != 0) wrong_number_of_args_error("render_html",args,0);
{
  int dumped;
  xmlBufferPtr buf;
  char * str;

  check_node_created();
  buf = xmlBufferCreate();
  dumped = htmlNodeDump(buf, MY_NODE->doc, MY_NODE);

  if(dumped>0)
  {
    str = (char *)xmlStrdup(buf->content);
    xmlBufferFree(buf);
    push_text(str);

  }
  
}

}
#define f_Node_cast_defined
ptrdiff_t f_Node_cast_fun_num = 0;
void f_Node_cast(INT32 args) {
#line 1095 "Node.cmod"
struct pike_string * type;
#line 1095 "Node.cmod"
if(args != 1) wrong_number_of_args_error("cast",args,1);
#line 1095 "Node.cmod"
if(Pike_sp[0-1].type != PIKE_T_STRING) SIMPLE_BAD_ARG_ERROR("cast",1,"string");
#line 1095 "Node.cmod"
debug_malloc_pass(type=Pike_sp[0-1].u.string);
{
  if(strcmp(type->str, "string") == 0)
  { 
    pop_stack();
    push_int(1);
    push_int(1);
    f_Node_render_xml(2);
    return;
  }
  else
  {
    pop_stack();
    Pike_error("Unsupported cast type.\n");
  }
}

}
#line 1112 "Node.cmod"
int check_node_created()
{
  if(THIS->object_data->node != NULL)
    return 1;
  Pike_error("Node not initialized.\n");
}


#undef internal_init_Node_defined
#define internal_init_Node_defined

#undef Node_event_handler_defined
#define Node_event_handler_defined
static void init_Node_struct(void)
#line 1120 "Node.cmod"
{
  NODE_OBJECT_DATA * dta;

  dta = 
	(NODE_OBJECT_DATA*)malloc(sizeof(NODE_OBJECT_DATA));
    if (!dta)
        Pike_error("init_node: Out of memory!\n");

    dta->node = NULL;

    THIS->object_data = dta;
}


#undef internal_exit_Node_defined
#define internal_exit_Node_defined

#undef Node_event_handler_defined
#define Node_event_handler_defined
static void exit_Node_struct(void)
#line 1134 "Node.cmod"
{ 

  if(THIS != NULL && THIS->object_data != NULL && 
    (* THIS->object_data->refs)==1)
  {
    if(THIS->object_data->node->doc != NULL)
      xmlFreeDoc(THIS->object_data->node->doc);
  }
  else
  {
   (*( THIS->object_data->refs)) --;
/* printf("NODE EXIT, refs = %d\n", (*(THIS->object_data->refs))); */
  }

   if(THIS->object_data)
  {
    free(THIS->object_data);
  }
}

#ifdef Node_event_handler_defined
static void Node_event_handler(int ev) {
  switch(ev) {

#ifdef internal_init_Node_defined
  case PROG_EVENT_INIT: init_Node_struct(); break;

#endif /* internal_init_Node_defined */

#ifdef internal_exit_Node_defined
  case PROG_EVENT_EXIT: exit_Node_struct(); break;

#endif /* internal_exit_Node_defined */
  default: break; 
  }
}

#endif /* Node_event_handler_defined */
/*! @endclass
 */


/*! @endmodule
 */

/*! @endmodule
 */

/*! @endmodule
 */


#line 1168 "Node.cmod"
void pike_init_xml2_node()
{
  
#ifdef class_Node_defined

#ifdef PROG_NODE_ID
#line 75 "Node.cmod"
  START_NEW_PROGRAM_ID(NODE);
#else
#line 75 "Node.cmod"
  start_new_program();

#endif /* PROG_NODE_ID */

#ifndef tObjImpl_NODE

#undef tObjImpl_NODE
#define tObjImpl_NODE tObj

#endif /* tObjImpl_NODE */

#ifdef THIS_NODE
  Node_storage_offset = ADD_STORAGE(struct Node_struct);
#endif /* THIS_NODE */

#ifdef Node_event_handler_defined
  pike_set_prog_event_callback(Node_event_handler);

#endif /* Node_event_handler_defined */

#ifdef f_Node_cq__sprintf_defined
  f_Node_cq__sprintf_fun_num =
#line 81 "Node.cmod"
    ADD_FUNCTION2("_sprintf", f_Node_cq__sprintf, tFunc("\10\200\0\0\0\177\377\377\377" tMix,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_cq__sprintf_defined */

#ifdef f_Node_create_defined
  f_Node_create_fun_num =
#line 105 "Node.cmod"
    ADD_FUNCTION2("create", f_Node_create, tFunc(tNone,tVoid), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_create_defined */

#ifdef f_Node_get_line_no_defined
  f_Node_get_line_no_fun_num =
#line 113 "Node.cmod"
    ADD_FUNCTION2("get_line_no", f_Node_get_line_no, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_line_no_defined */

#ifdef f_Node_set_ns_defined
  f_Node_set_ns_fun_num =
#line 123 "Node.cmod"
    ADD_FUNCTION2("set_ns", f_Node_set_ns, tFunc(tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_set_ns_defined */

#ifdef f_Node_set_content_defined
  f_Node_set_content_fun_num =
#line 143 "Node.cmod"
    ADD_FUNCTION2("set_content", f_Node_set_content, tFunc(tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_set_content_defined */

#ifdef f_Node_get_text_defined
  f_Node_get_text_fun_num =
#line 157 "Node.cmod"
    ADD_FUNCTION2("get_text", f_Node_get_text, tFunc(tNone,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_text_defined */

#ifdef f_Node_get_node_path_defined
  f_Node_get_node_path_fun_num =
#line 173 "Node.cmod"
    ADD_FUNCTION2("get_node_path", f_Node_get_node_path, tFunc(tNone,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_node_path_defined */

#ifdef f_Node_get_ns_defined
  f_Node_get_ns_fun_num =
#line 188 "Node.cmod"
    ADD_FUNCTION2("get_ns", f_Node_get_ns, tFunc(tNone,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_ns_defined */

#ifdef f_Node_get_nss_defined
  f_Node_get_nss_fun_num =
#line 206 "Node.cmod"
    ADD_FUNCTION2("get_nss", f_Node_get_nss, tFunc(tNone,tMapping), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_nss_defined */

#ifdef f_Node_get_base_defined
  f_Node_get_base_fun_num =
#line 236 "Node.cmod"
    ADD_FUNCTION2("get_base", f_Node_get_base, tFunc(tNone,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_base_defined */

#ifdef f_Node_get_lang_defined
  f_Node_get_lang_fun_num =
#line 251 "Node.cmod"
    ADD_FUNCTION2("get_lang", f_Node_get_lang, tFunc(tNone,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_lang_defined */

#ifdef f_Node_get_space_preserve_defined
  f_Node_get_space_preserve_fun_num =
#line 266 "Node.cmod"
    ADD_FUNCTION2("get_space_preserve", f_Node_get_space_preserve, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_space_preserve_defined */

#ifdef f_Node_get_attributes_defined
  f_Node_get_attributes_fun_num =
#line 281 "Node.cmod"
    ADD_FUNCTION2("get_attributes", f_Node_get_attributes, tFunc(tNone,tMapping), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_attributes_defined */

#ifdef f_Node_get_no_ns_attributes_defined
  f_Node_get_no_ns_attributes_fun_num =
#line 326 "Node.cmod"
    ADD_FUNCTION2("get_no_ns_attributes", f_Node_get_no_ns_attributes, tFunc(tNone,tMapping), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_no_ns_attributes_defined */

#ifdef f_Node_get_ns_attributes_defined
  f_Node_get_ns_attributes_fun_num =
#line 370 "Node.cmod"
    ADD_FUNCTION2("get_ns_attributes", f_Node_get_ns_attributes, tFunc(tString,tMapping), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_ns_attributes_defined */

#ifdef f_Node_children_defined
  f_Node_children_fun_num =
#line 415 "Node.cmod"
    ADD_FUNCTION2("children", f_Node_children, tFunc(tNone,tArray), 0, OPT_SIDE_EFFECT
);

#endif /* f_Node_children_defined */

#ifdef f_Node_parent_defined
  f_Node_parent_fun_num =
#line 443 "Node.cmod"
    ADD_FUNCTION2("parent", f_Node_parent, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_parent_defined */

#ifdef f_Node_get_root_node_defined
  f_Node_get_root_node_fun_num =
#line 466 "Node.cmod"
    ADD_FUNCTION2("get_root_node", f_Node_get_root_node, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_root_node_defined */

#ifdef f_Node_set_root_node_defined
  f_Node_set_root_node_fun_num =
#line 494 "Node.cmod"
    ADD_FUNCTION2("set_root_node", f_Node_set_root_node, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_set_root_node_defined */

#ifdef f_Node_new_cdata_block_defined
  f_Node_new_cdata_block_fun_num =
#line 520 "Node.cmod"
    ADD_FUNCTION2("new_cdata_block", f_Node_new_cdata_block, tFunc(tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_new_cdata_block_defined */

#ifdef f_Node_new_pi_defined
  f_Node_new_pi_fun_num =
#line 546 "Node.cmod"
    ADD_FUNCTION2("new_pi", f_Node_new_pi, tFunc(tString tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_new_pi_defined */

#ifdef f_Node_set_ns_attribute_defined
  f_Node_set_ns_attribute_fun_num =
#line 581 "Node.cmod"
    ADD_FUNCTION2("set_ns_attribute", f_Node_set_ns_attribute, tFunc(tString tString tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_set_ns_attribute_defined */

#ifdef f_Node_delete_attribute_defined
  Node_f_Node_delete_attribute_fun_num =
#line 623 "Node.cmod"
    ADD_FUNCTION2("delete_attribute", f_Node_delete_attribute, tOr(tFunc(tString,tObj),tFunc(tString tString,tObj)), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_delete_attribute_defined */

#ifdef f_Node_set_attribute_defined
  f_Node_set_attribute_fun_num =
#line 641 "Node.cmod"
    ADD_FUNCTION2("set_attribute", f_Node_set_attribute, tFunc(tString tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_set_attribute_defined */

#ifdef f_Node_new_char_ref_defined
  f_Node_new_char_ref_fun_num =
#line 669 "Node.cmod"
    ADD_FUNCTION2("new_char_ref", f_Node_new_char_ref, tFunc(tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_new_char_ref_defined */

#ifdef f_Node_new_comment_defined
  f_Node_new_comment_fun_num =
#line 700 "Node.cmod"
    ADD_FUNCTION2("new_comment", f_Node_new_comment, tFunc(tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_new_comment_defined */

#ifdef f_Node_new_doc_comment_defined
  f_Node_new_doc_comment_fun_num =
#line 727 "Node.cmod"
    ADD_FUNCTION2("new_doc_comment", f_Node_new_doc_comment, tFunc(tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_new_doc_comment_defined */

#ifdef f_Node_new_child_defined
  f_Node_new_child_fun_num =
#line 755 "Node.cmod"
    ADD_FUNCTION2("new_child", f_Node_new_child, tFunc(tString tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_new_child_defined */

#ifdef f_Node_add_ns_defined
  f_Node_add_ns_fun_num =
#line 781 "Node.cmod"
    ADD_FUNCTION2("add_ns", f_Node_add_ns, tFunc(tString tString,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_add_ns_defined */

#ifdef f_Node_add_child_defined
  f_Node_add_child_fun_num =
#line 798 "Node.cmod"
    ADD_FUNCTION2("add_child", f_Node_add_child, tFunc(tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_add_child_defined */

#ifdef f_Node_add_sibling_defined
  f_Node_add_sibling_fun_num =
#line 826 "Node.cmod"
    ADD_FUNCTION2("add_sibling", f_Node_add_sibling, tFunc(tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_add_sibling_defined */

#ifdef f_Node_add_next_sibling_defined
  f_Node_add_next_sibling_fun_num =
#line 853 "Node.cmod"
    ADD_FUNCTION2("add_next_sibling", f_Node_add_next_sibling, tFunc(tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_add_next_sibling_defined */

#ifdef f_Node_add_prev_sibling_defined
  f_Node_add_prev_sibling_fun_num =
#line 880 "Node.cmod"
    ADD_FUNCTION2("add_prev_sibling", f_Node_add_prev_sibling, tFunc(tObj,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_add_prev_sibling_defined */

#ifdef f_Node_get_last_child_defined
  f_Node_get_last_child_fun_num =
#line 907 "Node.cmod"
    ADD_FUNCTION2("get_last_child", f_Node_get_last_child, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_last_child_defined */

#ifdef f_Node_next_defined
  f_Node_next_fun_num =
#line 935 "Node.cmod"
    ADD_FUNCTION2("next", f_Node_next, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_next_defined */

#ifdef f_Node_prev_defined
  f_Node_prev_fun_num =
#line 959 "Node.cmod"
    ADD_FUNCTION2("prev", f_Node_prev, tFunc(tNone,tObj), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_prev_defined */

#ifdef f_Node_is_blank_defined
  f_Node_is_blank_fun_num =
#line 982 "Node.cmod"
    ADD_FUNCTION2("is_blank", f_Node_is_blank, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_is_blank_defined */

#ifdef f_Node_is_text_defined
  f_Node_is_text_fun_num =
#line 993 "Node.cmod"
    ADD_FUNCTION2("is_text", f_Node_is_text, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_is_text_defined */

#ifdef f_Node_get_node_type_defined
  f_Node_get_node_type_fun_num =
#line 1008 "Node.cmod"
    ADD_FUNCTION2("get_node_type", f_Node_get_node_type, tFunc(tNone,"\10\200\0\0\0\177\377\377\377"), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_node_type_defined */

#ifdef f_Node_get_node_name_defined
  f_Node_get_node_name_fun_num =
#line 1018 "Node.cmod"
    ADD_FUNCTION2("get_node_name", f_Node_get_node_name, tFunc(tNone,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_get_node_name_defined */

#ifdef f_Node_set_node_name_defined
  f_Node_set_node_name_fun_num =
#line 1029 "Node.cmod"
    ADD_FUNCTION2("set_node_name", f_Node_set_node_name, tFunc(tString,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_set_node_name_defined */

#ifdef f_Node_render_xml_defined
  f_Node_render_xml_fun_num =
#line 1050 "Node.cmod"
    ADD_FUNCTION2("render_xml", f_Node_render_xml, tFunc("\10\200\0\0\0\177\377\377\377" "\10\200\0\0\0\177\377\377\377",tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_render_xml_defined */

#ifdef f_Node_render_html_defined
  f_Node_render_html_fun_num =
#line 1075 "Node.cmod"
    ADD_FUNCTION2("render_html", f_Node_render_html, tFunc(tNone,tString), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_render_html_defined */

#ifdef f_Node_cast_defined
  f_Node_cast_fun_num =
#line 1095 "Node.cmod"
    ADD_FUNCTION2("cast", f_Node_cast, tFunc(tString,tMix), 0, OPT_EXTERNAL_DEPEND|OPT_SIDE_EFFECT);

#endif /* f_Node_cast_defined */
#line 75 "Node.cmod"
  Node_program=end_program();
#line 75 "Node.cmod"
  Node_program_fun_num=add_program_constant("Node",Node_program,0);

#endif /* class_Node_defined */
#line 1171 "Node.cmod"
}

void pike_exit_xml2_node()
{
  
#ifdef class_Node_defined
  if(Node_program) {
#line 75 "Node.cmod"
    free_program(Node_program);
    Node_program=0;
  }

#endif /* class_Node_defined */
#line 1176 "Node.cmod"
}



gotpike.org | Copyright © 2004 - 2019 | Pike is a trademark of Department of Computer and Information Science, Linköping University