Skip to content

Commit

Permalink
Added ups_version and Upskirt.version.
Browse files Browse the repository at this point in the history
  • Loading branch information
postmodern committed May 12, 2011
1 parent 183912e commit 7e6d602
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/ffi/upskirt/upskirt.rb
Expand Up @@ -34,10 +34,25 @@ module Upskirt

attach_function :is_safe_link, [:pointer, :size_t], :int
attach_function :ups_markdown, [:pointer, :pointer, :pointer, :uint], :void
attach_function :ups_version, [:pointer, :pointer, :pointer], :void

attach_function :upshtml_renderer, [:pointer, :uint], :void
attach_function :upshtml_toc_renderer, [:pointer], :void
attach_function :upshtml_free_renderer, [:pointer], :void
attach_function :upshtml_smartypants, [:pointer, :pointer], :void

#
# Returns the version of the installed `libupskirt`.
#
# @return [String]
# The version string.
#
def Upskirt.version
ints = FFI::MemoryPointer.new(:int,3)

ups_version(ints[0],ints[1],ints[2])

return ints.get_array_of_int(0,3).join('.')
end
end
end

0 comments on commit 7e6d602

Please sign in to comment.