
;; Copyright (C) 2026 Tommi Höynälänmaa

;; Distributed under GNU LGPL.

(define-proper-program (theme-d-intr dbus gen-dbus-theme-d-interface)

  (import (standard-library core)
          (standard-library console-io)
          (standard-library list-utilities)
          (standard-library text-file-io))


  (import (theme-d-intr dbus interfaces)
          (theme-d-intr base utils))


  (define-main-proc (((l-args (:uniform-list <string>)))
                     <none> nonpure)
    (let* ((str-filename (uniform-list-ref l-args 1))
           (str-path (uniform-list-ref l-args 2))
           (l-s-path (string->symbol-list str-path))
           (ip (open-input-file str-filename))
           (str-xml (read-string ip)))
      (close-input-port ip)
      (let* ((l-intf (load-interfaces str-xml))
             (intf (uniform-list-ref l-intf 0))
             (sx-target-intf (generate-intf-interface intf l-s-path)))
        (console-write-line sx-target-intf)))))

