;; fontconfig.ffi			-*- Scheme -*-

;; Copyright (C) 2025 Matthew Wette
;; 
;; Copying and distribution of this file, with or without modification,
;; are permitted in any medium without royalty provided the copyright
;; notice and this notice are preserved.  This file is offered as-is,
;; without any warranty.

(define-ffi-module (ffi fontconfig)
  #:pkg-config "fontconfig"
  #:include '("fontconfig/fontconfig.h")
  #:inc-filter (lambda (file-spec path-spec)
                 (string-contains path-spec "fontconfig/" 0))
  )

;; FcObjectSet *FcObjectSetBuild(const char *first, ...);
(define-public FcObjectSetBuild
  (let ((fp (foreign-pointer-search "FcObjectSetBuild")))
    (lambda args
      (let ((~proc (ffi:pointer->procedure '* fp (map (lambda (a) '*) args))))
        (apply ~proc (map cdata-arg->pointer args))))))

;; --- last line ---
