]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/compression/snappy/ffi/ffi.factor
factor: trim using lists
[factor.git] / basis / compression / snappy / ffi / ffi.factor
index 5cdad5bd35da97132c6faf17fa9d795c0c313b2a..a010eeb4906da0c777d01a8830e7d3a88723c053 100644 (file)
@@ -1,11 +1,14 @@
 ! Copyright (C) 2014 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: alien alien.c-types alien.libraries
-alien.libraries.finder alien.syntax classes.struct ;
-USE: nested-comments
+USING: alien alien.c-types alien.libraries alien.syntax
+combinators system ;
 IN: compression.snappy.ffi
 
-<< "snappy" "snappy" find-library cdecl add-library >>
+<< "snappy" {
+    { [ os windows? ] [ "snappy.dll" ] }
+    { [ os macosx? ] [ "libsnappy.dylib" ] }
+    { [ os unix? ] [ "libsnappy.so" ] }
+} cond cdecl add-library >>
 
 LIBRARY: snappy
 
@@ -14,19 +17,18 @@ ENUM: snappy_status SNAPPY_OK SNAPPY_INVALID_INPUT SNAPPY_BUFFER_TOO_SMALL ;
 FUNCTION: snappy_status snappy_compress ( char* input,
                                           size_t input_length,
                                           char* compressed,
-                                          size_t* compressed_length ) ;
+                                          size_t* compressed_length )
 
 FUNCTION: snappy_status snappy_uncompress ( char* compressed,
                                             size_t compressed_length,
                                             char* uncompressed,
-                                            size_t* uncompressed_length ) ;
+                                            size_t* uncompressed_length )
 
-FUNCTION: size_t snappy_max_compressed_length ( size_t source_length ) ;
+FUNCTION: size_t snappy_max_compressed_length ( size_t source_length )
 
 FUNCTION: snappy_status snappy_uncompressed_length ( char* compressed,
                                                      size_t compressed_length,
-                                                     size_t* result ) ;
+                                                     size_t* result )
 
 FUNCTION: snappy_status snappy_validate_compressed_buffer ( char* compressed,
-                                                            size_t compressed_length ) ; 
-
+                                                            size_t compressed_length )