lib/sassc/native.rb in sassc-0.0.9 vs lib/sassc/native.rb in sassc-0.0.10
- old
+ new
@@ -45,9 +45,16 @@
# https://github.com/ffi/ffi/wiki/Examples#array-of-strings
def self.return_string_array(ptr)
ptr.null? ? [] : ptr.get_array_of_string(0).compact
end
+ def self.native_string(string)
+ string += "\0"
+ data = SassC::Native::LibC.malloc(string.size)
+ data.write_string(string)
+ data
+ end
+
require_relative "native/native_context_api"
require_relative "native/native_functions_api"
end
end