Skip to content

Instantly share code, notes, and snippets.

@LeifW
Created February 21, 2009 19:29
Show Gist options
  • Save LeifW/68152 to your computer and use it in GitHub Desktop.
Save LeifW/68152 to your computer and use it in GitHub Desktop.
require 'libical'
array = MemoryPointer.new(:int,10)
LibIcal.icalrecur_expand_recurrence("FREQ=YEARLY;BYDAY=SU,WE",Time.now.to_i,10,array)
times = array.read_array_of_int(10).map {|s| Time.at(s)}
times.each {|s| puts s}
require 'rubygems'
require 'ffi'
module LibIcal
extend FFI::Library
ffi_lib "/usr/lib/libical.so"
#attach_function :icaltime_from_timet_with_zone [:int, :int, :pointer], :pointer
attach_function :icalrecur_expand_recurrence, [:string, :int, :int, :pointer], :int
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment