more-interfaces.scm 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. ; Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees. See file COPYING.
  2. ; Interfaces for packages that can get loaded after the initial.image
  3. ; starts up.
  4. ; Command processor
  5. (define-interface command-processor-interface
  6. (export abort-to-command-level
  7. add-sentinel!
  8. command-continuation
  9. command-threads
  10. command-loop
  11. command-level-condition
  12. command-processor
  13. error-form ;foo
  14. execute-command
  15. exit-command-processor
  16. evaluate-and-select
  17. gobble-line
  18. greet-user
  19. environment-for-commands
  20. pop-command-level
  21. read-command ;take
  22. read-command-carefully ;inspect
  23. read-form
  24. run-sentinels
  25. set-command-results!
  26. start-command-processor
  27. restart-command-processor
  28. value->expression ;foo
  29. y-or-n?
  30. help
  31. define-command-syntax
  32. define-user-command-syntax
  33. user-command-environment
  34. ;; set-command-structure! ;startup
  35. ;; command-structure ;pacman
  36. set-user-command-environment! ;pacman
  37. read-command-error ;inspect
  38. &environment-id-string
  39. ;&evaluate
  40. ; Settings
  41. add-setting
  42. lookup-setting
  43. setting-boolean?
  44. setting-value
  45. setting-set!
  46. setting-doc
  47. list-settings
  48. ))
  49. (define-interface command-levels-interface
  50. (export start-command-levels
  51. command-levels
  52. top-command-level
  53. push-command-level
  54. throw-to-command-level
  55. restart-command-level
  56. proceed-with-command-level
  57. kill-paused-thread!
  58. reset-command-input? ; condition predicate
  59. terminate-command-processor!
  60. command-level
  61. command-level-threads
  62. command-level-condition
  63. command-level-paused-thread
  64. command-level?))
  65. (define-interface command-state-interface
  66. (export user-context
  67. user-context-accessor
  68. user-context-modifier
  69. push-command-levels?
  70. set-push-command-levels?!
  71. focus-object
  72. set-focus-object!
  73. pop-value-stack!
  74. command-input
  75. command-output
  76. command-error-output
  77. batch-mode? set-batch-mode?!
  78. break-on-warnings? set-break-on-warnings?!
  79. load-noisily? set-load-noisily?!
  80. trace-writing-depth set-trace-writing-depth!
  81. inspector-menu-limit set-inspector-menu-limit!
  82. inspector-writing-depth set-inspector-writing-depth!
  83. inspector-writing-length set-inspector-writing-length!
  84. translations set-translations!
  85. maybe-menu
  86. set-menu!
  87. menu-position
  88. set-menu-position!
  89. value-stack
  90. set-value-stack!
  91. pop-value-stack!))
  92. (define-interface menus-interface
  93. (export present-menu
  94. present-more-menu
  95. current-menu-length
  96. current-menu-ref
  97. selection-command?
  98. write-line
  99. write-carefully
  100. with-limited-output))
  101. (define-interface basic-commands-interface
  102. (export exit
  103. exit-when-done
  104. go
  105. load
  106. load-script
  107. help
  108. run
  109. ?))
  110. (define-interface build-commands-interface
  111. (export dump
  112. build))
  113. (define-interface inspect-commands-interface
  114. (export inspect
  115. debug
  116. threads
  117. where
  118. menu
  119. m
  120. q
  121. u
  122. d
  123. template
  124. select-menu-item))
  125. (define-interface disassemble-commands-interface
  126. (export dis))
  127. (define-interface profile-commands-interface
  128. (export profile))
  129. (define-interface package-commands-interface
  130. (export in
  131. new-package
  132. load-package
  133. reload-package
  134. structure
  135. open
  136. for-syntax
  137. exec
  138. user
  139. user-package-is
  140. config
  141. config-package-is
  142. undefine))
  143. (define-interface debug-commands-interface
  144. (export translate
  145. preview
  146. proceed
  147. push
  148. pop
  149. reset
  150. resume
  151. level
  152. condition
  153. set
  154. unset
  155. batch
  156. bench
  157. break-on-warnings
  158. levels
  159. flush
  160. keep
  161. collect
  162. trace
  163. untrace
  164. time
  165. from-file
  166. forget
  167. bound?
  168. expand
  169. expand-once))
  170. (define-interface usual-commands-interface
  171. (compound-interface
  172. basic-commands-interface
  173. build-commands-interface
  174. package-commands-interface
  175. debug-commands-interface
  176. inspect-commands-interface
  177. disassemble-commands-interface
  178. ;profile-commands-interface
  179. ))
  180. (define-interface package-commands-internal-interface
  181. (export config-package
  182. new-command-processor
  183. get-structure
  184. ;get-package
  185. ;set-package-evaluator!
  186. ))
  187. (define-interface display-conditions-interface
  188. (export display-condition ;command.scm
  189. &disclose-condition ;env/disclosers.scm
  190. limited-write
  191. condition-display-depth set-condition-display-depth!
  192. condition-display-length set-condition-display-length!))
  193. (define-interface debuginfo-interface
  194. (export read-debug-info
  195. write-debug-info))
  196. (define-interface disclosers-interface
  197. (export make-print-name
  198. template-file-name
  199. value->expression
  200. error-form
  201. location-info
  202. location-name
  203. template-debug-data
  204. template-id
  205. template-name
  206. template-names
  207. debug-data-names
  208. disclose-vm-condition))
  209. (define-interface package-mutation-interface
  210. (export package-system-sentinel ;env/command.scm
  211. package-open! ;env/debug.scm
  212. package-undefine!
  213. ))
  214. (define-interface packages-cruft-interface
  215. (export assume-denotation
  216. ;; new-location-uid ;?
  217. interface-ref
  218. structure-interface
  219. verify-package ;for debugging the package system
  220. ))
  221. ; --------------------
  222. ; Linker
  223. (define-interface linker-interface
  224. (export link-simple-system
  225. link-reified-system
  226. link-semireified-system
  227. (struct-list :syntax)
  228. compile-structures))
  229. (define-interface expander-interface
  230. (export expand-form
  231. expand-stuff
  232. expand
  233. usage-reference-count
  234. usage-operator-count
  235. usage-assignment-count
  236. free-top-level-variables))
  237. ; --------------------
  238. ; Extended numbers: bignums, ratnums, etc.
  239. (define-interface extended-numbers-interface
  240. (export (define-extended-number-type :syntax)
  241. (define-opcode-extension :syntax)
  242. :exact :inexact
  243. string-position
  244. &+
  245. &-
  246. &*
  247. &/
  248. &=
  249. &<
  250. &quotient
  251. &remainder
  252. &integer?
  253. &rational?
  254. &real?
  255. &complex?
  256. &number?
  257. &exact?
  258. &exact->inexact
  259. &inexact->exact
  260. &real-part
  261. &imag-part
  262. &magnitude
  263. &angle
  264. &floor
  265. &numerator
  266. &denominator
  267. &exp &log
  268. &sin &cos &tan &asin &acos &atan1 &atan2
  269. &sqrt
  270. &make-rectangular
  271. &number->string
  272. &really-string->number))
  273. (define-interface time-interface
  274. (export real-time
  275. run-time))
  276. (define-interface unicode-char-maps-interface
  277. (export (primary-category :syntax)
  278. primary-category?
  279. (general-category :syntax)
  280. general-category?
  281. general-category-id
  282. general-category-symbol
  283. general-category-primary-category
  284. char-general-category
  285. char-titlecase
  286. char-title-case?
  287. char-foldcase
  288. string-upcase string-downcase
  289. string-foldcase
  290. string-titlecase))
  291. (define-interface conditions-interface
  292. (export make-condition-type
  293. condition-type?
  294. make-condition
  295. condition?
  296. condition-has-type?
  297. condition-ref
  298. make-compound-condition
  299. extract-condition
  300. (define-condition-type :syntax)
  301. (condition :syntax)
  302. &condition
  303. &message message-condition? condition-message
  304. &serious serious-condition?
  305. &error error?
  306. &bug bug?
  307. &irritants irritants?
  308. condition-irritants
  309. &call-error call-error?
  310. call-error-proc call-error-args
  311. &vm-exception vm-exception?
  312. vm-exception-opcode vm-exception-reason vm-exception-arguments
  313. &warning warning?
  314. &note note?
  315. &syntax-error syntax-error?
  316. &interrupt interrupt?
  317. interrupt-type
  318. &decoding-error decoding-error?
  319. decoding-error-encoding-name
  320. &simple-condition simple-condition?
  321. simple-condition-type simple-condition-stuff))
  322. (define-interface i/o-conditions-interface
  323. (export &i/o-error i/o-error?
  324. &i/o-port-error i/o-port-error?
  325. i/o-error-port
  326. &i/o-read-error i/o-read-error?
  327. &i/o-write-error i/o-write-error?
  328. &i/o-closed-error i/o-closed-error?
  329. &i/o-filename-error i/o-filename-error?
  330. i/o-error-filename
  331. &i/o-malformed-filename-error i/o-malformed-filename-error?
  332. &i/o-file-protection-error i/o-file-protection-error?
  333. &i/o-file-is-read-only-error i/o-file-is-read-only-error?
  334. &i/o-file-already-exists-error i/o-file-already-exists-error?
  335. &i/o-no-such-file-error i/o-no-such-file-error?
  336. &read-error read-error?
  337. read-error-line read-error-column read-error-position read-error-span
  338. &primitive-i/o-error primitive-i/o-error?
  339. i/o-error-status i/o-error-operation i/o-error-arguments))
  340. (define-interface signals-internal-interface
  341. (export simple-condition->condition
  342. condition->simple-condition
  343. coerce-to-condition
  344. coerce-to-simple-condition))
  345. ; Experimental DEFINE-RECORD-TYPE that is now officially a failure.
  346. (define-interface defrecord-interface ;RK's
  347. (export (define-record-type :syntax)
  348. define-record-discloser))
  349. ; Unicode
  350. ; -------
  351. (define-interface text-codec-utils-interface
  352. (export guess-port-text-codec-according-to-bom
  353. set-port-text-codec-according-to-bom!))
  354. (define-interface unicode-normalizations-interface
  355. (export string-normalize-nfd
  356. string-normalize-nfkd
  357. string-normalize-nfc
  358. string-normalize-nfkc))
  359. (define-interface r6rs-unicode-interface
  360. (compound-interface unicode-normalizations-interface
  361. (export char-titlecase
  362. char-title-case?
  363. char-foldcase
  364. string-upcase string-downcase
  365. string-foldcase
  366. string-titlecase)
  367. (export char-general-category)))
  368. ; --------------------
  369. ; Big Scheme
  370. (define-interface dynamic-externals-interface
  371. (export dynamic-load
  372. get-external
  373. lookup-external
  374. lookup-all-externals
  375. external?
  376. external-name
  377. external-value
  378. call-external))
  379. (define-interface shared-objects-interface
  380. (export open-shared-object
  381. close-shared-object
  382. shared-object?
  383. shared-object-name
  384. shared-object-address shared-object-address-or-false
  385. shared-object-address?
  386. shared-object-address-value
  387. call-shared-object-address))
  388. (define-interface load-dynamic-externals-interface
  389. (export load-dynamic-externals
  390. import-dynamic-externals
  391. reload-dynamic-externals
  392. unload-dynamic-externals))
  393. (define-interface dump/restore-interface
  394. (export dump
  395. restore
  396. note-location!
  397. $dump-index
  398. $restore-index))
  399. (define-interface extended-ports-interface
  400. (export byte-source->input-port char-source->input-port
  401. byte-sink->output-port char-sink->output-port
  402. make-tracking-input-port make-tracking-output-port
  403. make-byte-vector-input-port make-string-input-port
  404. make-byte-vector-output-port make-string-output-port
  405. byte-vector-output-port-output string-output-port-output
  406. limit-output
  407. current-row current-column fresh-line
  408. call-with-string-output-port ; deprecated
  409. write-one-line)) ; deprecated
  410. (define-interface arrays-interface
  411. (export make-array ; <initial-value> <bound1> ...
  412. array?
  413. array-shape ; <array>
  414. array-ref ; <array> <index1> ...
  415. array-set! ; <array> <value> <index1> ...
  416. make-shared-array ; <array> <linear-map> <bound1> ...
  417. copy-array ; <array>
  418. array->vector ; <array>
  419. array)) ; <bounds> . <elements>
  420. (define-interface lu-decompositions-interface
  421. (export lu-decomposition))
  422. (define-interface compact-tables-interface
  423. (export compute-compact-table))
  424. (define-interface inversion-lists-interface
  425. (export make-empty-inversion-list
  426. inversion-list?
  427. inversion-list-member?
  428. inversion-list-complement
  429. inversion-list-union inversion-list-intersection
  430. inversion-list-difference
  431. number->inversion-list numbers->inversion-list
  432. range->inversion-list ranges->inversion-list
  433. inversion-list-adjoin inversion-list-remove
  434. inversion-list-size
  435. inversion-list-copy
  436. inversion-list=?
  437. inversion-list-hash
  438. inversion-list-fold/done?
  439. inversion-list-cursor?
  440. inversion-list-cursor inversion-list-cursor-at-end?
  441. inversion-list-cursor-next inversion-list-cursor-ref))
  442. (define-interface mask-types-interface
  443. (export make-mask-type
  444. mask-type?
  445. mask-type
  446. mask-has-type?
  447. integer->mask
  448. list->mask
  449. mask?))
  450. (define-interface masks-interface
  451. (export mask->integer
  452. mask->list
  453. mask-member?
  454. mask-set
  455. mask-clear
  456. mask-union
  457. mask-intersection
  458. mask-subtract
  459. mask-negate))
  460. (define-interface enum-sets-interface
  461. (export (define-enum-set-type :syntax)
  462. enum-set->list
  463. enum-set-member?
  464. enum-set=?
  465. enum-set-union
  466. enum-set-intersection
  467. enum-set-negation))
  468. (define-interface enum-sets-internal-interface
  469. (export enum-set-has-type?
  470. enum-set?
  471. enum-set-type
  472. enum-set->integer
  473. integer->enum-set))
  474. (define-interface search-trees-interface
  475. (export make-search-tree
  476. search-tree?
  477. search-tree-ref
  478. search-tree-set!
  479. search-tree-modify!
  480. search-tree-max pop-search-tree-max!
  481. search-tree-min pop-search-tree-min!
  482. walk-search-tree))
  483. (define-interface sparse-vectors-interface
  484. (export make-sparse-vector
  485. sparse-vector-ref sparse-vector-set!
  486. sparse-vector->list))
  487. (define-interface variable-argument-lists-interface
  488. (export (opt-lambda :syntax)))
  489. ; This is getting to be a hodge-podge.
  490. (define-interface big-util-interface
  491. (export concatenate-symbol
  492. error breakpoint
  493. atom? null-list? neq? n=
  494. identity no-op
  495. memq? first any? any every?
  496. filter filter! filter-map partition-list partition-list!
  497. remove-duplicates delq delq! delete
  498. reverse!
  499. string->immutable-string
  500. ))
  501. (define-interface big-scheme-interface
  502. (compound-interface
  503. (interface-of ascii)
  504. (interface-of bitwise)
  505. (interface-of tables)
  506. (interface-of enumerated)
  507. ;defrecord-interface
  508. extended-ports-interface
  509. big-util-interface
  510. (export (destructure :syntax)
  511. (receive :syntax)
  512. format
  513. p pretty-print
  514. sort-list sort-list!)))
  515. ; --------------------
  516. ; Miscellaneous
  517. ; Copied from interfaces.scm.
  518. (define-interface define-record-types-interface
  519. (export (define-record-type :syntax)
  520. define-record-discloser))
  521. (define-interface parse-bytecode-interface
  522. (export byte-code?
  523. parse-template
  524. parse-template-code
  525. parse-instruction
  526. parse-protocol
  527. with-template
  528. make-attribution
  529. make-opcode-table
  530. opcode-table-set! opcode-table-ref
  531. protocol-protocol protocol-nargs n-ary-protocol?
  532. protocol-cwv-tailcall? call-with-values-protocol-target
  533. env-data? env-data-total-count env-data-frame-offsets
  534. env-data-maybe-template-index env-data-closure-offsets
  535. env-data-env-offsets
  536. cont-data? cont-data-length cont-data-mask-bytes cont-data-live-offsets cont-data-pc
  537. cont-data-template cont-data-gc-mask-size cont-data-depth))
  538. (define-interface reinitializers-interface
  539. (export (define-reinitializer :syntax)))
  540. (define-interface locks-interface
  541. (export lock?
  542. make-lock
  543. obtain-lock
  544. maybe-obtain-lock
  545. release-lock
  546. with-lock
  547. lock-owner)) ;really should be internal
  548. (define-interface value-pipes-interface
  549. (export make-pipe
  550. empty-pipe?
  551. pipe-read!
  552. pipe-write!
  553. pipe-push!
  554. empty-pipe!
  555. pipe-maybe-read!
  556. pipe-maybe-read?!
  557. pipe-maybe-write!))
  558. (define-interface placeholder-interface
  559. (export make-placeholder
  560. placeholder?
  561. placeholder-value
  562. placeholder-set!))
  563. (define-interface test-suites-interface
  564. (export ((define-test-suite define-test-case define-test-cases) :syntax)
  565. ((check check-exception) :syntax)
  566. run-test-suite
  567. =within
  568. zap-test-suite!))