Module: Nokogiri::LibXML

Extended by:
FFI::Library
Defined in:
lib/nokogiri/ffi/structs/xml_ns.rb,
lib/nokogiri/ffi/libxml.rb,
lib/nokogiri/ffi/libxml.rb,
lib/nokogiri/ffi/structs/xml_dtd.rb,
lib/nokogiri/ffi/structs/xml_attr.rb,
lib/nokogiri/ffi/structs/xml_node.rb,
lib/nokogiri/ffi/structs/xml_alloc.rb,
lib/nokogiri/ffi/structs/xml_buffer.rb,
lib/nokogiri/ffi/structs/xml_entity.rb,
lib/nokogiri/ffi/structs/xml_schema.rb,
lib/nokogiri/ffi/structs/common_node.rb,
lib/nokogiri/ffi/structs/xml_element.rb,
lib/nokogiri/ffi/structs/xml_document.rb,
lib/nokogiri/ffi/structs/xml_node_set.rb,
lib/nokogiri/ffi/structs/xml_notation.rb,
lib/nokogiri/ffi/structs/xml_relax_ng.rb,
lib/nokogiri/ffi/structs/xml_attribute.rb,
lib/nokogiri/ffi/structs/html_elem_desc.rb,
lib/nokogiri/ffi/structs/xml_enumeration.rb,
lib/nokogiri/ffi/structs/xml_sax_handler.rb,
lib/nokogiri/ffi/structs/xml_text_reader.rb,
lib/nokogiri/ffi/structs/xslt_stylesheet.rb,
lib/nokogiri/ffi/structs/html_entity_desc.rb,
lib/nokogiri/ffi/structs/xml_syntax_error.rb,
lib/nokogiri/ffi/structs/xml_xpath_object.rb,
lib/nokogiri/ffi/structs/xml_xpath_context.rb,
lib/nokogiri/ffi/structs/xml_parser_context.rb,
lib/nokogiri/ffi/structs/xml_element_content.rb,
lib/nokogiri/ffi/structs/xml_xpath_parser_context.rb,
lib/nokogiri/ffi/structs/xml_sax_push_parser_context.rb

Overview

:stopdoc:

Defined Under Namespace

Modules: CommonNode, XmlDocumentMixin, XmlNodeSetMixin, XmlXpathContextMixin Classes: HtmlElemDesc, HtmlEntityDesc, XmlAlloc, XmlAttr, XmlAttribute, XmlBuffer, XmlDocument, XmlDocumentCast, XmlDtd, XmlElement, XmlElementContent, XmlEntity, XmlEnumeration, XmlNode, XmlNodeSet, XmlNodeSetCast, XmlNotation, XmlNs, XmlParserContext, XmlRelaxNG, XmlSaxHandler, XmlSaxPushParserContext, XmlSchema, XmlSyntaxError, XmlTextReader, XmlXpathContext, XmlXpathContextCast, XmlXpathObject, XmlXpathParserContext, XsltStylesheet

Constant Summary collapse

XML_CHAR_ENCODING_ERROR =
-1
HtmlDocument =

implemented identically in libxml2.6

XmlDocument
HtmlDocumentCast =

implemented identically in libxml2.6

XmlDocumentCast

Class Method Summary collapse

Class Method Details

.pointer_offset(n) ⇒ Object

helpers



284
285
286
# File 'lib/nokogiri/ffi/libxml.rb', line 284

def self.pointer_offset(n)
  n * FFI.type_size(:pointer) # byte offset of nth pointer in an array of pointers
end

.xmlFree(pointer) ⇒ Object



202
203
204
205
# File 'lib/nokogiri/ffi/libxml.rb', line 202

def self.xmlFree(pointer)
  # xmlFree is a C preprocessor macro, not an actual function
  self.free(pointer)
end

.xmlXPathReturnFalse(ctx) ⇒ Object



189
190
191
# File 'lib/nokogiri/ffi/libxml.rb', line 189

def xmlXPathReturnFalse(ctx)
  valuePush(ctx, xmlXPathNewBoolean(0))
end

.xmlXPathReturnNodeSet(ctx, ns) ⇒ Object

these functions are implemented as C macros



183
184
185
# File 'lib/nokogiri/ffi/libxml.rb', line 183

def xmlXPathReturnNodeSet(ctx, ns)
  valuePush(ctx, xmlXPathWrapNodeSet(ns))
end

.xmlXPathReturnNumber(ctx, val) ⇒ Object



195
196
197
# File 'lib/nokogiri/ffi/libxml.rb', line 195

def xmlXPathReturnNumber(ctx, val)
  valuePush(ctx, xmlXPathNewFloat(val))
end

.xmlXPathReturnString(ctx, str) ⇒ Object



192
193
194
# File 'lib/nokogiri/ffi/libxml.rb', line 192

def xmlXPathReturnString(ctx, str)
  valuePush(ctx, xmlXPathWrapString(str))
end

.xmlXPathReturnTrue(ctx) ⇒ Object



186
187
188
# File 'lib/nokogiri/ffi/libxml.rb', line 186

def xmlXPathReturnTrue(ctx)
  valuePush(ctx, xmlXPathNewBoolean(1))
end