Update of /project/elephant/cvsroot/elephant/src/memutil In directory common-lisp:/tmp/cvs-serv18566/src/memutil
Modified Files: memutil.lisp Log Message: Further reorg, added auto build of memutil
--- /project/elephant/cvsroot/elephant/src/memutil/memutil.lisp 2006/02/19 04:53:02 1.1 +++ /project/elephant/cvsroot/elephant/src/memutil/memutil.lisp 2006/02/19 16:22:43 1.2 @@ -65,21 +65,14 @@ #+(or darwin macosx) "dylib" #-(or darwin macosx) "so" )
- (defvar *elephant-lib-path* "/usr/local/share/common-lisp/elephant/")) - -(eval-when (:compile-toplevel :load-toplevel) - - (unless - (uffi:load-foreign-library - (if (find-package 'asdf) - (merge-pathnames - (make-pathname :name "libmemutil" :type *c-library-extension*) - (asdf:component-pathname (asdf:find-system 'elephant))) - (format nil "~A/~A.~A" *elephant-lib-path* "libmemutil" *c-library-extension*)) - :module "libmemutil") - (error "Couldn't load libmemutil.~A!" *c-library-extension*)) - - ;; fini on user editable part + (unless + (uffi:load-foreign-library + (merge-pathnames + (make-pathname :name "libmemutil" :type *c-library-extension* ) + (merge-pathnames (make-pathname :directory "src/memutil") + (asdf:component-pathname (asdf:find-system 'elephant)))) + :module "libmemutil") + (error "Couldn't load src/memutil/libmemutil.~A in!" *c-library-extension*))
(def-type pointer-int (* :int)) (def-type pointer-void :pointer-void) @@ -87,7 +80,16 @@ #+allegro (:array :char) #+(or cmu sbcl scl openmcl) (* :char)) (def-type array-or-pointer-char array-or-pointer-char) - ) + + ;; Standard utility for copying two foreign buffers -- + ;; also to test that lib is actually loaded! + (def-function ("copy_buf" copy-bufs) + ((dest array-or-pointer-char) + (dest-offset :int) + (src array-or-pointer-char) + (src-offset :int) + (length :int)) + :returning :void))
(declaim (inline read-int read-uint read-float read-double write-int write-uint write-float write-double @@ -410,15 +412,6 @@ (setf (deref-array dest 'array-or-pointer-char (+ i dest-offset)) (char-code (char src (+ i src-offset))))))))
-;; For copying two foreign buffers -(def-function ("copy_buf" copy-bufs) - ((dest array-or-pointer-char) - (dest-offset :int) - (src array-or-pointer-char) - (src-offset :int) - (length :int)) - :returning :void) -
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;