351 lines
6.5 KiB
Scheme
351 lines
6.5 KiB
Scheme
(define-interface jobd-interface
|
|
(export make-jobd
|
|
jobd?
|
|
version
|
|
execute
|
|
stop
|
|
continue
|
|
shutdown
|
|
set-jobbers!))
|
|
|
|
(define-structure jobd jobd-interface
|
|
(open scheme-with-scsh
|
|
formats
|
|
srfi-1
|
|
(with-prefix srfi-8 srfi-8/)
|
|
srfi-9
|
|
srfi-11
|
|
threads
|
|
threads-internal
|
|
(with-prefix rendezvous cml-rv/)
|
|
(with-prefix mcast-channels cml-mcast-ch/)
|
|
(with-prefix rendezvous-channels cml-sync-ch/)
|
|
(with-prefix rendezvous-async-channels cml-async-ch/)
|
|
finite-types
|
|
job
|
|
cml-pe)
|
|
(files jobd))
|
|
|
|
(define-interface cml-pe-interface
|
|
(export cml-fork
|
|
cml-fork-collecting))
|
|
|
|
(define-structure cml-pe cml-pe-interface
|
|
(open scheme-with-scsh
|
|
srfi-9
|
|
threads
|
|
(with-prefix rendezvous cml-rv/)
|
|
(with-prefix rendezvous-channels cml-sync-ch/))
|
|
(files cml-pe))
|
|
|
|
(define-interface mcast-channels-interface
|
|
(export make-mcast-channel
|
|
mcast-channel?
|
|
mcast-port?
|
|
mcast
|
|
mcast-port
|
|
mcast-port-receive
|
|
mcast-port-receive-rv))
|
|
|
|
(define-structure mcast-channels mcast-channels-interface
|
|
(open scheme
|
|
srfi-9
|
|
threads
|
|
finite-types
|
|
rendezvous
|
|
rendezvous-channels)
|
|
(files mcast-channels))
|
|
|
|
(define-interface job-interface
|
|
(export make-job-desc
|
|
job-desc?
|
|
job-desc-wd
|
|
job-desc-env
|
|
job-desc-cmd
|
|
make-job-res
|
|
job-res?
|
|
job-res-errno
|
|
job-res-stdout
|
|
job-res-stderr
|
|
display-job-output))
|
|
|
|
(define-structure job job-interface
|
|
(open scheme-with-scsh
|
|
srfi-9)
|
|
(files job))
|
|
|
|
(define-structure test-jobd
|
|
(export do-some-jobs)
|
|
(open scheme-with-scsh
|
|
locks
|
|
threads
|
|
threads-internal
|
|
srfi-1
|
|
(with-prefix rendezvous cml-rv/)
|
|
(with-prefix rendezvous-channels cml-sync-ch/)
|
|
(with-prefix rendezvous-async-channels cml-async-ch/)
|
|
cml-pe
|
|
job
|
|
(with-prefix jobd jobd/))
|
|
(files test-jobd))
|
|
|
|
(define-structure test-mcast-channels
|
|
(export test-it)
|
|
(open scheme
|
|
srfi-9
|
|
threads
|
|
rendezvous
|
|
rendezvous-channels
|
|
mcast-channels)
|
|
(files test-mcast-channels))
|
|
|
|
(define-interface collect-channels-interface
|
|
(export make-tagged-msg
|
|
is-tagged-msg?
|
|
tagged-msg-tag
|
|
tagged-msg-stripped
|
|
make-cmd-msg
|
|
is-cmd-msg?
|
|
cmd-msg-cmd
|
|
cmd-msg-data
|
|
print-info
|
|
collect&reply/make-channel
|
|
send&collect/make-channel
|
|
is-collect&reply-channel?
|
|
is-send&collect-channel?
|
|
make-link
|
|
collect-cmd
|
|
collect&reply/receive
|
|
collect&reply/receive-rv
|
|
collect&reply/send
|
|
; collect&reply/send-rv
|
|
send&collect/send
|
|
; send&collect/send-rv
|
|
send&collect/receive
|
|
send&collect/receive-rv))
|
|
|
|
(define-structure collect-channels collect-channels-interface
|
|
(open scheme-with-scsh
|
|
finite-types
|
|
srfi-9
|
|
big-util ; for breakpoints
|
|
let-opt ; for logging
|
|
threads
|
|
threads-internal
|
|
(with-prefix rendezvous cml-rv/)
|
|
(with-prefix rendezvous-channels cml-sync-ch/)
|
|
(with-prefix rendezvous-async-channels cml-async-ch/))
|
|
(files collect-channels))
|
|
|
|
(define-interface make-rule-interface
|
|
(export make-rule
|
|
is-rule?
|
|
make-empty-rule-set
|
|
rule-set-add
|
|
is-rule-set?
|
|
make-rule-result
|
|
is-rule-result?
|
|
rule-result-wants-build?
|
|
rule-result-build-func
|
|
rule-make))
|
|
|
|
(define-structure make-rule-cml make-rule-interface
|
|
(open scheme-with-scsh
|
|
locks
|
|
with-lock
|
|
threads
|
|
threads-internal
|
|
big-util ; for breakpoints
|
|
srfi-1
|
|
srfi-9
|
|
finite-types
|
|
collect-channels
|
|
dfs
|
|
(with-prefix rendezvous cml-rv/)
|
|
(with-prefix rendezvous-channels cml-sync-ch/))
|
|
(files make-rule))
|
|
|
|
(define-structure make-rule-no-cml make-rule-interface
|
|
(open scheme-with-scsh
|
|
locks
|
|
with-lock
|
|
srfi-1
|
|
srfi-9)
|
|
(files make-rule-no-cml))
|
|
|
|
(define-interface macros-interface
|
|
(export (makefile :syntax)
|
|
(file :syntax)
|
|
(makefile-rule :syntax)
|
|
(is-out-of-date? :syntax)
|
|
(md5 :syntax)
|
|
(file-md5 :syntax)
|
|
(phony :syntax)
|
|
(always :syntax)
|
|
(is-out-of-date! :syntax)
|
|
(once :syntax)
|
|
(file-once :syntax)
|
|
(common-file :syntax)
|
|
(common-md5 :syntax)
|
|
(common-file-md5 :syntax)
|
|
(common-always :syntax)
|
|
(common-file-always :syntax)
|
|
(common-once :syntax)
|
|
(common-file-once :syntax)))
|
|
|
|
(define-structure macros macros-interface
|
|
(open scheme-with-scsh
|
|
srfi-1
|
|
to-rule-set
|
|
dfs
|
|
autovars
|
|
templates
|
|
make-rule)
|
|
(files macros))
|
|
|
|
(define-interface to-rule-set-interface
|
|
(export lookup-rc
|
|
lookup-fname
|
|
lookup-rule
|
|
rcs->dag
|
|
dag->rcs
|
|
rcs->rules
|
|
rules->rule-set))
|
|
|
|
(define-structure to-rule-set to-rule-set-interface
|
|
(open scheme-with-scsh
|
|
srfi-1
|
|
templates
|
|
make-rule
|
|
common-rules
|
|
dfs)
|
|
(files to-rule-set))
|
|
|
|
(define-interface dfs-interface
|
|
(export make-dfs
|
|
dfs->list
|
|
dfs
|
|
dfs-dag-show
|
|
sort))
|
|
|
|
(define-structure dfs dfs-interface
|
|
(open scheme-with-scsh
|
|
finite-types
|
|
threads
|
|
srfi-1
|
|
srfi-9
|
|
let-opt
|
|
(with-prefix rendezvous-channels cml-sync-ch/))
|
|
(files dfs))
|
|
|
|
(define-interface templates-interface
|
|
(export make-file-build-func
|
|
make-md5-build-func
|
|
make-always-build-func
|
|
make-once-build-func
|
|
make-is-out-of-date!
|
|
make-once
|
|
make-is-out-of-date?
|
|
make-md5-sum-changed?
|
|
make-common-file-build-func
|
|
make-common-md5-build-func
|
|
make-common-always-build-func
|
|
make-common-once-build-func
|
|
make-common-is-out-of-date!
|
|
make-common-once
|
|
make-common-is-out-of-date?
|
|
make-common-md5-sum-changed?))
|
|
|
|
(define-structure templates templates-interface
|
|
(open scheme-with-scsh
|
|
common-rules
|
|
autovars
|
|
srfi-1
|
|
big-util
|
|
srfi-13)
|
|
(files templates))
|
|
|
|
(define-interface autovars-interface
|
|
(export bind-fluids-common
|
|
bind-fluids-gnu
|
|
fluid-$@
|
|
fluid-$<
|
|
fluid-$?
|
|
fluid-$^
|
|
fluid-$+
|
|
fluid-$*
|
|
fluid-$=*
|
|
fluid-$*=
|
|
fluid-$=*=
|
|
fluid-$@/
|
|
fluid-/$@
|
|
fluid-$=*=/
|
|
fluid-/$=*=
|
|
fluid-$</
|
|
fluid-/$<
|
|
fluid-$^/
|
|
fluid-/$^
|
|
fluid-$+/
|
|
fluid-/$+
|
|
fluid-$?/
|
|
fluid-/$?
|
|
$@
|
|
$<
|
|
$?
|
|
$^
|
|
$+
|
|
$*
|
|
$=*
|
|
$*=
|
|
$=*=
|
|
$@/
|
|
/$@
|
|
$=*=/
|
|
/$=*=
|
|
$</
|
|
/$<
|
|
$^/
|
|
/$^
|
|
$+/
|
|
/$+
|
|
$?/
|
|
/$?
|
|
bind-fluids-human))
|
|
|
|
(define-structure autovars autovars-interface
|
|
(open scheme-with-scsh
|
|
make-rule
|
|
thread-fluids
|
|
srfi-1
|
|
srfi-13)
|
|
(files autovars))
|
|
|
|
(define-interface common-rules-interface
|
|
(export make-empty-common-rules
|
|
common-rules-add
|
|
common-rules-show
|
|
search-match-in-common-rules
|
|
common-rcs->common-rules
|
|
is-matched-by?
|
|
replace-by-match))
|
|
|
|
(define-structure common-rules common-rules-interface
|
|
(open scheme-with-scsh
|
|
autovars
|
|
srfi-1
|
|
srfi-9
|
|
big-util
|
|
srfi-13)
|
|
(files common-rules))
|
|
|
|
(define-structure make (export make)
|
|
(open scheme-with-scsh
|
|
srfi-1
|
|
macros
|
|
let-opt
|
|
to-rule-set
|
|
make-rule)
|
|
(files make))
|
|
|
|
(define make-rule make-rule-no-cml)
|