require 'fiddle'



c_var = Fiddle.dlopen(nil)['QueryPointer']

int = Fiddle::TYPE_INT
voidp = Fiddle::TYPE_VOIDP
sz_voidp = Fiddle::SIZEOF_VOIDP






Query = Fiddle::Closure::BlockCaller
          .new(int, [voidp, voidp]) do |datap, lengthp|
  message = 

  
  
  length = lengthp[0, sz_voidp].unpack('J').first

  
  if length < message.bytesize
    0  
  else
    length = message.bytesize
    datap[0, length] = message  
    lengthp[0, sz_voidp] = [length].pack('J')  
    1  
  end
end


Fiddle::Pointer.new(c_var)[0, sz_voidp] = [Query.to_i].pack('J')