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_char_encoding_handler.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, XmlCharEncodingHandler, 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
POINTER_SIZE =

helpers

FFI.type_size(:pointer)
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



298
299
300
# File 'lib/nokogiri/ffi/libxml.rb', line 298

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

.xmlFree(pointer) ⇒ Object



215
216
217
218
# File 'lib/nokogiri/ffi/libxml.rb', line 215

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

.xmlXPathReturnFalse(ctx) ⇒ Object



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

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

.xmlXPathReturnNodeSet(ctx, ns) ⇒ Object

these functions are implemented as C macros



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

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

.xmlXPathReturnNumber(ctx, val) ⇒ Object



208
209
210
# File 'lib/nokogiri/ffi/libxml.rb', line 208

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

.xmlXPathReturnString(ctx, str) ⇒ Object



205
206
207
# File 'lib/nokogiri/ffi/libxml.rb', line 205

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

.xmlXPathReturnTrue(ctx) ⇒ Object



199
200
201
# File 'lib/nokogiri/ffi/libxml.rb', line 199

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