Created
April 27, 2011 07:22
-
-
Save fstrozzi/943843 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Internal method to build argument list for BWA C functions | |
# @note this method should not be called directly | |
def self.build_args_for_BWA(args) | |
cmd_args = args.map do |arg| | |
FFI::MemoryPointer.from_string(arg.to_s) # convert every parameters into a string and then into a memory pointer | |
end | |
exec_args = FFI::MemoryPointer.new(:pointer, cmd_args.length) # creating a pointer to an array of pointers | |
cmd_args.each_with_index do |arg, i| | |
exec_args[i].put_pointer(0, arg) # filling in the array of pointers | |
end | |
return exec_args | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment