Add or fix docstrings of syscalls.
[iolib.git] / base / pkgdcl.lisp
blobaabac180bdd0ff4c7adfbdb609361f31d5762e8b
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; indent-tabs-mode: nil -*-
2 ;;;
3 ;;; --- Package definition.
4 ;;;
6 (in-package :common-lisp-user)
8 (defpackage :iolib.base
9 (:use #:common-lisp :alexandria)
10 (:shadow #:defun #:defmethod #:defmacro #:define-compiler-macro #:defconstant)
11 (:export
12 ;; Conditions
13 #:bug #:iolib-bug
14 #:subtype-error #:subtype-error-datum #:subtype-error-expected-supertype
15 ;; Debugging
16 #:*safety-checks*
17 #:debug-only #:debug-only*
18 #:production-only #:production-only*
19 ;; Types
20 #:function-designator
21 ;; RETURN*
22 #:return* #:lambda* #:defun #:defmethod
23 #:defmacro #:define-compiler-macro
24 ;; Definitions
25 #:defconstant
26 ;; DEFOBSOLETE
27 #:defobsolete
28 #:deprecation-warning
29 #:deprecation-warning-function-name
30 #:deprecation-warning-type
31 #:deprecation-warning-reason
32 ;; Reader utils
33 #:define-syntax
34 #:enable-reader-macro #:enable-reader-macro*
35 #:disable-reader-macro #:disable-reader-macro*
36 ;; SPLIT-SEQUENCE
37 #:split-sequence #:split-sequence-if #:split-sequence-if-not
38 ;; Misc
39 #:function-name #:function-name-p
40 #:check-bounds #:join
41 ;; Matching
42 #:multiple-value-case #:flags-case
43 ;; Time
44 #:decode-timeout #:normalize-timeout #:clamp-timeout))
46 (flet ((gather-external-symbols (&rest packages)
47 (let (symbols)
48 (with-package-iterator (iterator packages :external)
49 (loop (multiple-value-bind (morep symbol) (iterator)
50 (unless morep (return))
51 (pushnew (intern (string symbol) :iolib.base)
52 symbols))))
53 symbols)))
54 (export (gather-external-symbols :common-lisp :alexandria :iolib.base)
55 :iolib.base))
58 ;;;-------------------------------------------------------------------------
59 ;;; GRAY stream symbols
60 ;;;-------------------------------------------------------------------------
62 #+cmu
63 (eval-when (:compile-toplevel :load-toplevel :execute)
64 (require :gray-streams))
66 #+allegro
67 (eval-when (:compile-toplevel :load-toplevel :execute)
68 (unless (fboundp 'stream:stream-write-string)
69 (require "streamc.fasl")))
71 (eval-when (:compile-toplevel :load-toplevel :execute)
72 (defvar *gray-stream-symbols*
73 '(#:fundamental-stream #:fundamental-input-stream
74 #:fundamental-output-stream #:fundamental-character-stream
75 #:fundamental-binary-stream #:fundamental-character-input-stream
76 #:fundamental-character-output-stream
77 #:fundamental-binary-input-stream
78 #:fundamental-binary-output-stream #:stream-read-char
79 #:stream-unread-char #:stream-read-char-no-hang
80 #:stream-peek-char #:stream-listen #:stream-read-line
81 #:stream-clear-input #:stream-write-char #:stream-line-column
82 #:stream-start-line-p #:stream-write-string #:stream-terpri
83 #:stream-fresh-line #:stream-finish-output #:stream-force-output
84 #:stream-clear-output #:stream-advance-to-column
85 #:stream-read-byte #:stream-write-byte))
87 (defparameter *gray-stream-package*
88 #+allegro :excl
89 #+(or cmu scl) :ext
90 #+(or clisp ecl) :gray
91 #+(or ccl openmcl) :ccl
92 #+lispworks :stream
93 #+sbcl :sb-gray
94 #-(or allegro cmu scl clisp ecl ccl openmcl lispworks sbcl)
95 (error "Your CL implementation isn't supported.")))
97 (eval-when (:compile-toplevel :load-toplevel :execute)
98 (import (mapcar #'(lambda (s) (intern (string s) *gray-stream-package*))
99 *gray-stream-symbols*)
100 :iolib.base)
101 (export (mapcar (lambda (s) (intern (string s) :iolib.base))
102 (list* '#:trivial-gray-stream-mixin
103 '#:stream-read-sequence
104 '#:stream-write-sequence
105 '#:stream-file-position
106 *gray-stream-symbols*))
107 :iolib.base))