diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-03-28 14:25:50 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-09-11 19:58:54 +0200 |
commit | f4f515b6982f1ae1457a8d3b181b1210f08aef8c (patch) | |
tree | e0ea7913372eb76b2b1f30d7c15251fb31df5f1d | |
parent | Require component for path append. (diff) | |
download | calp-f4f515b6982f1ae1457a8d3b181b1210f08aef8c.tar.gz calp-f4f515b6982f1ae1457a8d3b181b1210f08aef8c.tar.xz |
Simplify glob procedure bindings.
-rw-r--r-- | module/glob.scm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/module/glob.scm b/module/glob.scm index 64f97690..20cb4b1c 100644 --- a/module/glob.scm +++ b/module/glob.scm @@ -16,11 +16,14 @@ (define << ash) (include# "/usr/include/glob.h" define-public) -(define-values (glob% globfree%) - (let ((this (dynamic-link))) - (values - (pointer->procedure int (dynamic-func "glob" this) `(* ,int * *)) - (pointer->procedure void (dynamic-func "globfree" this) '(*))))) +(define lib (dynamic-link)) + +(define glob% + (pointer->procedure int (dynamic-func "glob" lib) + `(* ,int * *))) +(define globfree + (pointer->procedure void (dynamic-func "globfree" lib) + '(*))) (define glob-flags (logior GLOB_MARK GLOB_BRACE GLOB_TILDE_CHECK)) @@ -41,5 +44,5 @@ (ret (map (compose pointer->string make-pointer) (bytevector->uint-list strvec (native-endianness) (sizeof '*))))) - (globfree% (bytevector->pointer bv)) + (globfree (bytevector->pointer bv)) ret)))) |