(import (chicken foreign) (chicken blob)) #> #include #include #include <# (define-foreign-type time_t unsigned-integer64) (define strftime (foreign-lambda size_t "strftime" (c-pointer char) size_t c-string (c-pointer (struct tm))) ) (define gmtime (foreign-lambda (c-pointer (struct tm)) "gmtime" (c-pointer time_t)) ) (define time-get (foreign-lambda time_t "time" (c-pointer time_t))) (let ((buf0 (make-string 256))) (let-location ((t0 time_t (time-get #f))) (let ((z0 (strftime (location buf0) 256 "%FT%T" (gmtime (location t0))))) (if (equal? z0 0) (error "not working") (begin (write buf0) (newline)) ))))