Mercurial > hg > audiodb
diff bindings/sb-alien/interface.lisp @ 646:368c8c72e723
Implement sb-adb:liszt in sb-alien bindings
Don't forget to export the symbol from the package!
Fixes audioDB Trac ticket #33
author | mas01cr |
---|---|
date | Tue, 13 Oct 2009 14:26:28 +0000 |
parents | 9cda689dcc20 |
children | 7e7ba87b5466 |
line wrap: on
line diff
--- a/bindings/sb-alien/interface.lisp Tue Oct 13 14:26:27 2009 +0000 +++ b/bindings/sb-alien/interface.lisp Tue Oct 13 14:26:28 2009 +0000 @@ -325,6 +325,16 @@ (setf (slot qdatum 'power) (sb-sys:vector-sap (sb-ext:array-storage-vector (datum-times datum)))) (setf (slot qdatum 'power) nil)))) +(defgeneric liszt (adb)) +(defmethod liszt ((db adb)) + (let ((results (%liszt (slot-value db 'alien)))) + (unwind-protect + (loop for i below (slot results 'nresults) + with entries = (slot results 'entries) + for entry = (deref entries i) + collect (cons (slot entry 'key) (slot entry 'nvectors))) + (%free-liszt-results (slot-value db 'alien) results)))) + #+test (sb-adb:with-adb (db "/home/csr21/tmp/omras2-workshop/9.adb") (sb-adb:query "KSA_CHARM_337" db :exhaustivep t :sequence-length 30