markam/linkwave.scm
2012-12-24 01:27:14 +01:00

17 lines
576 B
Scheme

(declare (uses paths))
(require-extension sqlite3)
(require-library posix srfi-4)
(: string-no-null (string -> string))
(define (string-no-null str)
(substring str 0 (- (string-length str) 1)))
(: print-row (string fixnum string string -> void))
(define (print-row url seconds name description)
(format #t "~a~% ~a~% ~a~% ~a~%~%" (string-no-null name) (string-no-null description)
(string-no-null url) (seconds->string seconds)))
(define db (open-database (data-file "linkwave.db")))
(for-each-row print-row db "select * from bookmark")
(finalize! db #t)