-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.lisp
executable file
·1022 lines (950 loc) · 23.8 KB
/
io.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;#!/opt/local/bin/sbcl.bin --core /opt/local/lib/sbcl/sbcl.core --noinform
;#!/usr/local/bin/sbcl --noinform
;#!/sw/bin/clisp
;#!/usr/local/bin/clisp
;;;; Hey, Emacs, this is a -*- Mode: Lisp; Syntax: Common-Lisp -*- file!
;;;;
;;;; Programming should be fun. Programs should be beautiful.
;;;; -- Paul Graham
;;;;
;;;; Name: io.lisp
;;;;
;;;; Started: Fri Jan 6 19:12:16 2006
;;;; Modifications:
;;;;
;;;; Purpose:
;;;;
;;;;
;;;;
;;;; Calling Sequence:
;;;;
;;;;
;;;; Inputs:
;;;;
;;;; Outputs:
;;;;
;;;; Example:
;;;;
;;;; Notes:
;;;;
;;;;
(eval-when (:compile-toplevel :load-toplevel :execute)
#+ :sbcl (load "/home/slytobias/lisp/packages/core" :verbose nil)
#- :sbcl (load "/home/slytobias/lisp/packages/core.lisp" :verbose nil))
(defpackage :io
(:use :common-lisp :core)
(:export :add-column :atime
:break-loop
:copy-file :ctime
:file-each-line
:get-num
:mtime
:number-file
:print-plist :prompt :prompt-read
:read-file
:read-file-as-string
:read-list
:reread
:search-file :search-lines-of-file
:valid-num-p
:write-file))
(in-package :io)
#+sbcl (eval-when (:compile-toplevel :load-toplevel :execute)
(require 'sb-posix))
;----------I/O Functions-----------------
;;;
;;; Read each line of a file into a list of strings.
;;; Returns nil if file does not exist.
;;;
;; (defun read-file (file-name)
;; (with-open-file (in-stream file-name :if-does-not-exist nil)
;; (if in-stream
;; (loop for line = (read-line in-stream nil nil)
;; while line
;; collect line)
;; (format *error-output* "Error: File does not exist!~%"))))
(defun read-file (file-name)
(with-open-file (in-stream file-name :if-does-not-exist nil)
(if (null in-stream)
(format *error-output* "Error: File does not exist!~%")
(loop for line = (read-line in-stream nil nil)
until (null line)
collect line))))
;; (defun read-file (file-name)
;; (with-open-file (in-stream file-name :if-does-not-exist nil)
;; (cond ((null in-stream)
;; (format *error-output* "Error: File does not exist!~%"))
;; (t (let ((eof (list 'eof)))
;; (loop for line = (read-line in-stream nil eof)
;; until (eq line eof) collect line)))) ))
; (defun read-file (file-name)
; (with-open-file (in-stream file-name :if-does-not-exist nil)
; (cond ((null in-stream)
; (format *error-output* "Error: File does not exist!~%")
; (return-from read-file nil)))
; (do ((results '())
; (line (read-line in-stream nil nil)
; (read-line in-stream nil nil)))
; ((null line) (reverse results))
; (setf results (cons line results)))) )
;; (defun read-file (file-name)
;; (with-open-file (in-stream file-name :if-does-not-exist nil)
;; (unless in-stream
;; (format *error-output* "Error: File does not exist!~%")
;; (return-from read-file nil))
;; (let ((eof (list 'eof)))
;; (do ((line (read-line in-stream nil eof)
;; (read-line in-stream nil eof))
;; (results '() (cons line results)))
;; ((eq line eof) (nreverse results)))) ))
;;;
;;; This loses the last line. (It quits too soon.)
;;;
; ((not (listen in-stream)) (reverse results)))) )
(defun read-file-as-string (file-name)
(with-open-file (in-stream file-name :if-does-not-exist nil)
(if in-stream
(with-output-to-string (result)
(loop for line = (read-line in-stream nil nil)
while line
do (write-line line result)))
(format *error-output* "Error: File does not exist!~%"))))
;;;
;;; Edi Weitz
;;;
(defun read-file-as-string (file-name)
(with-open-file (in-stream file-name :if-does-not-exist nil)
(if in-stream
(let* ((result (make-string (file-length in-stream)))
(pos (read-sequence result in-stream)))
(subseq result 0 pos))
(format *error-output* "Error: File does not exist!~%"))))
;;;
;;; Wade Humeniuk
;;;
;; (defun read-file-as-string (file-name)
;; (with-open-file (in-stream file-name)
;; (if in-stream
;; (let ((result (make-array (file-length in-stream)
;; :element-type 'character
;; :adjustable t
;; :fill-pointer t)))
;; (setf (fill-pointer result) (read-sequence result in-stream))
;; result)
;; (format *error-output* "Error: File does not exist!~%"))))
(defun file-each-line (file-name f)
(dolist (line (read-file file-name))
(funcall f line)))
(defun number-file (file-name)
(let ((i 1))
(file-each-line file-name #'(lambda (line) (format t "~4,'0D: ~A~%" i line) (incf i)))) )
;;;
;;; Write a list of strings to a file.
;;; Prompt user if file already exists.
;;; Returns nil if file exists and user chooses not to overwrite.
;;;
(defun write-file (file-name contents &optional overwrite)
(with-open-file (out-stream file-name
:direction :output
:if-exists (if overwrite :supersede nil))
; :if-exists (if overwrite :overwrite nil))
(if (null out-stream)
;; Assume file exists? ;;;Fix this!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
(cond ((y-or-n-p (format nil "The file ~A already exists. Overwrite?"
file-name))
(write-file file-name contents t))
(t (format *error-output* "Error: File already exists!~%")
(return-from write-file nil))))
(dolist (line contents)
(format out-stream "~A~%" line))) )
(defun add-column (file-name)
"Add a column to a table in an HTML file."
(with-open-file (s file-name)
(let ((eof (list 'eof)))
(do ((line0 (read-line s nil eof) (read-line s nil eof))
(line1 "" line0))
((eq line0 eof))
(when (search "</tr>" line0)
(write-line line1))
(write-line line0)))) )
;;;
;;; The following are by Kent Pitman:
;;; http://www.nhplace.com/kent/PS/Hindsight.html
;;;
(defun search-lines-of-file (string file)
(with-open-file (stream file :direction :input)
(loop for line = (read-line stream)
for i from 0
when (search string line)
do (format t "~&Line ~D: ~A" i line)
finally (format t "~&Done.~%"))))
(defun search-file (string file)
(handler-case (search-lines-of-file string file)
(file-error (condition)
(format t "~&File problem: ~A~%" condition))))
;;;
;;; Lauri Siponen, Helsinki University of Technology
;;; (From CMU repository)
;;; (Modified slightly)
;;;
(defun copy-file (source target &optional overwrite)
(with-open-file (in source
:direction :input
:if-does-not-exist nil)
(with-open-file (out target
:direction :output
:if-exists (if overwrite :supersede nil))
(cond ((null in) (format *error-output* "Error: Source file does not exist!~%"))
((null out) (format *error-output* "Error: Target already exists!~%"))
(t (loop with buffer = (make-string (* 64 512))
for n = (read-sequence buffer in)
until (= n 0)
do (write-sequence buffer out :end n)))) )))
; CMUCL (unix:unix-stat file)...
(defun atime (file)
#+sbcl (sb-posix:stat-atime (sb-posix:stat file))
#+clisp (posix:file-stat-atime (posix:file-stat file))
#+cmucl (nth-value 9 (unix:unix-stat file))
#-(or sbcl clisp cmucl)
(error "ATIME not implemented"))
(defun ctime (file)
#+sbcl (sb-posix:stat-ctime (sb-posix:stat file))
#+clisp (posix:file-stat-ctime (posix:file-stat file))
#+cmucl (nth-value 11 (unix:unix-stat file))
#-(or sbcl clisp cmucl)
(error "CTIME not implemented"))
(defun mtime (file)
#+sbcl (sb-posix:stat-mtime (sb-posix:stat file))
#+clisp (file-stat-mtime (file-stat file))
#+cmucl (nth-value 10 (unix:unix-stat file))
#-(or sbcl clisp cmucl)
(error "MTIME not implemented"))
(defun prompt-read (prompt &rest keys &key (allow-empty t) (trim t) test error)
(labels ((validate (response)
(cond ((and (string= response "") (not allow-empty)) (fail))
((null test) response)
((funcall test response) response)
(t (when error
(funcall error response))
(fail))))
(fail ()
(apply #'prompt-read prompt keys)))
(format *query-io* prompt)
(force-output *query-io*)
(let ((response (read-line *query-io*)))
(if trim
(validate (string-trim " " response))
(validate response)))) )
;(defun get-num (prompt &optional test)
(defun get-num (prompt &key test (precision 'double-float))
(let ((num (read-num (prompt-read prompt) :test test :precision precision)))
(if (null num)
(get-num prompt :test test :precision precision)
num)))
(defun read-num (s &key test (precision 'double-float))
"Attempt to read a number from string S. Apply the TEST validity function if provided. Return NIL if value is not valid."
(let* ((*read-default-float-format* precision)
(*read-eval* nil)
(num (handler-case (read-from-string s nil)
(error (e)
(format t "Your input is not so good: ~A~%" e)
(return-from read-num nil)))) )
(if (valid-num-p num test)
num
nil)))
(defun valid-num-p (obj &optional test)
(if (numberp obj)
(if test
(funcall test obj)
t)
nil))
;; (defun is-integer (x)
;; (zerop (nth-value 1 (truncate x))))
;; (defun is-integer (x)
;; (multiple-value-bind (_ rem) (truncate x)
;; (declare (ignore _))
;; (zerop rem)))
(defun is-integer (x)
(and (realp x) (zerop (rem x 1))))
;;; The number may be constrained by optional min and max
;;; args (which are inclusive).
; (defun get-num (prompt &optional min max)
; (format t "~A" prompt)
; (or (valid-num (read-from-string (read-line) nil nil) min max)
; (get-num prompt min max)) )
; ;;;
; ;;; GET-NUM should send in 3 args, but by making MIN and MAX optional
; ;;; this can be used by other functions too.
; ;;;
; (defun valid-num (num &optional min max)
; (and (numberp num)
; (if min (>= num min) t)
; (if max (<= num max) t)
; num) )
;;;
;;; Christopher Stacy
;;;
;; (defun read-a-number (&key stream default)
;; (let* ((line (read-line stream))
;; (n (let* ((*read-eval* nil))
;; (ignore-errors (read-from-string line nil)))))
;; (if (numberp n)
;; n
;; default)))
;;;
;;; Matthew Danish
;;;
;; (defun parse-float (string &optional (default 0.0))
;; (let* ((*read-eval* nil)
;; (val (ignore-errors (read-from-string string))))
;; (typecase val
;; (number val)
;; (t default))))
;(defun readlist (&rest args)
(defun read-list (&rest args)
(values (read-from-string
(concatenate 'string "(" (apply #'read-line args) ")"))))
(defun prompt (&rest args)
(apply #'format *query-io* args)
(read *query-io*))
(defun break-loop (fn quit &rest args)
(format *query-io* "Entering break-loop.~%")
(loop
(let ((in (apply #'prompt args)))
(if (funcall quit in)
(return)
(format *query-io* "~A~%" (funcall fn in)))) ))
;;;
;;; Alternative to backquote???
;;; (defmacro foo (x) (reread (format nil "(+ 2 ~A)" x)))
;;; vs.
;;; (defmacro bar (x) `(+ 2 ,x))
;;;
(defun reread (&rest args)
(values (read-from-string (apply #'mkstr args))))
;; (defun print-plist (sym)
;; (do ((plist (symbol-plist sym) (cddr plist)))
;; ((null plist))
;; (format t "Property: ~S~%" (car plist))
;; (format t "Value: ~S~%" (cadr plist))))
(defun print-plist (sym)
(dotuples ((property value) (symbol-plist sym))
(format t "Property: ~S~%" property)
(format t "Value: ~S~%" value)))
#|
;;;
;;; Read a number from STDIN using a given prompt and meeting the given
;;; TEST criterion. Continue prompting until a valid number is entered.
;;;
;;; Note: READ-LINE is used so that all input is consumed rather than
;;; leaving anything in buffer.
;;;
; (defun get-num (prompt &optional min max)
; (do ((num nil))
; ((if (numberp num)
; (and (if (numberp min)
; (>= num min)
; t)
; (if (numberp max)
; (<= num max)
; t))
; nil)
; num)
; (format t "~A" prompt)
; (setf num (read-from-string (read-line) nil))) )
(defun get-num (prompt &optional test)
(format t "~A" prompt)
(force-output)
(let ((num (read-from-string (read-line) nil nil)))
(if (valid-num num test)
num
(get-num prompt test))))
(defun valid-num (num test)
(if (numberp num)
(if test
(funcall test num)
t)
nil))
;;; The number may be constrained by optional min and max
;;; args (which are inclusive).
; (defun get-num (prompt &optional min max)
; (format t "~A" prompt)
; (or (valid-num (read-from-string (read-line) nil nil) min max)
; (get-num prompt min max)) )
; ;;;
; ;;; GET-NUM should send in 3 args, but by making MIN and MAX optional
; ;;; this can be used by other functions too.
; ;;;
; (defun valid-num (num &optional min max)
; (and (numberp num)
; (if min (>= num min) t)
; (if max (<= num max) t)
; num) )
;;;
;;; Christopher Stacy
;;;
;; (defun read-a-number (&key stream default)
;; (let* ((line (read-line stream))
;; (n (let* ((*read-eval* nil))
;; (ignore-errors (read-from-string line nil)))))
;; (if (numberp n)
;; n
;; default)))
;;;
;;; Matthew Danish
;;;
;; (defun parse-float (string &optional (default 0.0))
;; (let* ((*read-eval* nil)
;; (val (ignore-errors (read-from-string string))))
;; (typecase val
;; (number val)
;; (t default))))
;; (defmacro read-from-file ((file-name var) &body body)
;; (let ((stream (gensym))
;; (eof (gensym)))
;; `(with-open-file (,stream ,file-name :if-does-not-exist nil)
;; (cond ((null ,stream) (warn "File does not exist!~%"))
;; (t (do* ((,eof (list 'eof))
;; (,var (read-line ,stream nil ,eof)
;; (read-line ,stream nil ,eof)))
;; ((eq ,var ,eof))
;; ,@body)))) ))
(defun readlist (&rest args)
(values (read-from-string (concatenate 'string
"("
(apply #'read-line args)
")"))))
(defun prompt (&rest args)
(apply #'format *query-io* args)
(read *query-io*))
(defun break-loop (fn quit &rest args)
(format *query-io* "Entering break-loop.~%")
(loop
(let ((in (apply #'prompt args)))
(if (funcall quit in)
(return)
(format *query-io* "~A~%" (funcall fn in)))) ))
|#
#|
SB-POSIX:CREAD
SB-POSIX:VQUIT
SB-POSIX:EPERM
SB-POSIX:ELIBSCN
SB-POSIX:TCOON
SB-POSIX:ENODEV
SB-POSIX:O-RDWR
SB-POSIX:TIMEVAL-USEC
SB-POSIX:O-DIRECTORY
SB-POSIX:OPENLOG
SB-POSIX:R-OK
SB-POSIX:TCSAFLUSH
SB-POSIX:TCSADRAIN
SB-POSIX:LOG-AUTHPRIV
SB-POSIX:ENOTDIR
SB-POSIX:OFILL
SB-POSIX:ONLRET
SB-POSIX:VSTOP
SB-POSIX:ETOOMANYREFS
SB-POSIX:CR1
SB-POSIX:PUTENV
SB-POSIX:LOG-DAEMON
SB-POSIX:B57600
SB-POSIX:UMASK
SB-POSIX:MS-INVALIDATE
SB-POSIX:WIFSTOPPED
SB-POSIX:ENFILE
SB-POSIX:B600
SB-POSIX:CREAT
SB-POSIX:S-IFWHT
SB-POSIX:S-ISBLK
SB-POSIX:EMEDIUMTYPE
SB-POSIX:LOG-LOCAL6
SB-POSIX:SYSCALL-ERRNO
SB-POSIX:CS5
SB-POSIX:O-CREAT
SB-POSIX:WTERMSIG
SB-POSIX:EBUSY
SB-POSIX:EBFONT
SB-POSIX:LOG-LOCAL7
SB-POSIX:EFBIG
SB-POSIX:ICANON
SB-POSIX:CS8
SB-POSIX:S-IXOTH
SB-POSIX:B134
SB-POSIX:CFSETISPEED
SB-POSIX:W-OK
SB-POSIX:ERANGE
SB-POSIX:EBADR
SB-POSIX:SYSCALL-ERROR
SB-POSIX:ECHONL
SB-POSIX:SIGXCPU
SB-POSIX:IOCTL
SB-POSIX:IGNCR
SB-POSIX:LOG-LOCAL3
SB-POSIX:ECHOE
SB-POSIX:F-OK
SB-POSIX:LOG-ALERT
SB-POSIX:ENETDOWN
SB-POSIX:ENETUNREACH
SB-POSIX:OPEN
SB-POSIX:SIGTSTP
SB-POSIX:VERASE
SB-POSIX:LSEEK
SB-POSIX:PASSWD-SHELL
SB-POSIX:ECOMM
SB-POSIX:S-IWOTH
SB-POSIX:UTIME
SB-POSIX:GETPAGESIZE
SB-POSIX:S-ISREG
SB-POSIX:EL2HLT
SB-POSIX:ECHRNG
SB-POSIX:MMAP
SB-POSIX:FSYNC
SB-POSIX:PROT-WRITE
SB-POSIX:EBADF
SB-POSIX:B200
SB-POSIX:ENOTEMPTY
SB-POSIX:SETEUID
SB-POSIX:EIO
SB-POSIX:SIGTRAP
SB-POSIX:SIGBUS
SB-POSIX:F-TLOCK
SB-POSIX:RENAME
SB-POSIX:S-IFCHR
SB-POSIX:SETPGID
SB-POSIX:ISTRIP
SB-POSIX:EADDRINUSE
SB-POSIX:FF0
SB-POSIX:LOG-NOTICE
SB-POSIX:SIGPWR
SB-POSIX:LOG-USER
SB-POSIX:SIGIO
SB-POSIX:S-ISDIR
SB-POSIX:IXOFF
SB-POSIX:S-IROTH
SB-POSIX:SETUID
SB-POSIX:WEXITSTATUS
SB-POSIX:EPFNOSUPPORT
SB-POSIX:OPOST
SB-POSIX:O-RSYNC
SB-POSIX:ELIBEXEC
SB-POSIX:ENOTNAM
SB-POSIX:DUP2
SB-POSIX:ICRNL
SB-POSIX:S-IRUSR
SB-POSIX:TAB1
SB-POSIX:EPROTOTYPE
SB-POSIX:TERMIOS-LFLAG
SB-POSIX:B75
SB-POSIX:SIGPROF
SB-POSIX:SEEK-SET
SB-POSIX:S-IWUSR
SB-POSIX:GROUP
SB-POSIX:EUNATCH
SB-POSIX:NOFLSH
SB-POSIX:WAIT
SB-POSIX:F-GETOWN
SB-POSIX:FLOCK-PID
SB-POSIX:ENOCSI
SB-POSIX:VEOL
SB-POSIX:ENOSR
SB-POSIX:CSIZE
SB-POSIX:PASSWD-NAME
SB-POSIX:SIGCHLD
SB-POSIX:FTRUNCATE
SB-POSIX:O-ASYNC
SB-POSIX:FF1
SB-POSIX:PASSWD-PASSWD
SB-POSIX:ESOCKTNOSUPPORT
SB-POSIX:LOG-LOCAL5
SB-POSIX:LOCKF
SB-POSIX:B0
SB-POSIX:SETRESUID
SB-POSIX:SIGALRM
SB-POSIX:B300
SB-POSIX:MCL-CURRENT
SB-POSIX:TIMEVAL-SEC
SB-POSIX:PIPE
SB-POSIX:NL0
SB-POSIX:TERMIOS-OFLAG
SB-POSIX:ENOSPC
SB-POSIX:CHOWN
SB-POSIX:B230400
SB-POSIX:O-LARGEFILE
SB-POSIX:ETIME
SB-POSIX:READLINK
SB-POSIX:WIFEXITED
SB-POSIX:EUCLEAN
SB-POSIX:UNLINK
SB-POSIX:S-IFSOCK
SB-POSIX:BS0
SB-POSIX:PASSWD-GID
SB-POSIX:MCL-FUTURE
SB-POSIX:LOG-FTP
SB-POSIX:EL3HLT
SB-POSIX:STAT-INO
SB-POSIX:LOG-UUCP
SB-POSIX:F-SETFD
SB-POSIX:CLOSEDIR
SB-POSIX:LSTAT
SB-POSIX:EREMOTE
SB-POSIX:S-IFMT
SB-POSIX:PASSWD
SB-POSIX:GETGRNAM
SB-POSIX:O-DSYNC
SB-POSIX:S-ISUID
SB-POSIX:GETUID
SB-POSIX:CLOSELOG
SB-POSIX:DIRENT-NAME
SB-POSIX:ETXTBSY
SB-POSIX:EFAULT
SB-POSIX:ENOBUFS
SB-POSIX:STAT-CTIME
SB-POSIX:EMSGSIZE
SB-POSIX:LOG-MAIL
SB-POSIX:EINVAL
SB-POSIX:O-APPEND
SB-POSIX:PROT-NONE
SB-POSIX:S-ISVTX
SB-POSIX:O-NONBLOCK
SB-POSIX:ECHILD
SB-POSIX:TERMIOS-CFLAG
SB-POSIX:FCNTL
SB-POSIX:SIGCONT
SB-POSIX:FORK
SB-POSIX:GETEUID
SB-POSIX:IXON
SB-POSIX:STAT-NLINK
SB-POSIX:CHMOD
SB-POSIX:EUSERS
SB-POSIX:EIDRM
SB-POSIX:NL1
SB-POSIX:EILSEQ
SB-POSIX:F-DUPFD
SB-POSIX:SIGQUIT
SB-POSIX:MKSTEMP
SB-POSIX:SIGTTIN
SB-POSIX:TCIOFLUSH
SB-POSIX:ELIBBAD
SB-POSIX:EXFULL
SB-POSIX:EDOTDOT
SB-POSIX:TERMIOS-IFLAG
SB-POSIX:O-NOCTTY
SB-POSIX:SYMLINK
SB-POSIX:TCSETATTR
SB-POSIX:MAP-FIXED
SB-POSIX:TERMIOS
SB-POSIX:ENOMSG
SB-POSIX:MKDTEMP
SB-POSIX:ELIBACC
SB-POSIX:TAB2
SB-POSIX:ELOOP
SB-POSIX:LOG-CONS
SB-POSIX:UTIMES
SB-POSIX:EL3RST
SB-POSIX:SETPGRP
SB-POSIX:EREMCHG
SB-POSIX:EINPROGRESS
SB-POSIX:S-IFBLK
SB-POSIX:MS-ASYNC
SB-POSIX:ELNRNG
SB-POSIX:DUP
SB-POSIX:GETENV
SB-POSIX:ECONNREFUSED
SB-POSIX:LOG-LOCAL1
SB-POSIX:MLOCKALL
SB-POSIX:SIGINT
SB-POSIX:FLOCK-START
SB-POSIX:B115200
SB-POSIX:VSUSP
SB-POSIX:O-NOFOLLOW
SB-POSIX:CR0
SB-POSIX:EDEADLK
SB-POSIX:LOG-LOCAL0
SB-POSIX:GETRESGID
SB-POSIX:LINK
SB-POSIX:LOG-CRON
SB-POSIX:CFSETOSPEED
SB-POSIX:EAGAIN
SB-POSIX:SIGURG
SB-POSIX:GROUP-NAME
SB-POSIX:EALREADY
SB-POSIX:PASSWD-GECOS
SB-POSIX:VKILL
SB-POSIX:S-IRGRP
SB-POSIX:EHOSTDOWN
SB-POSIX:X-OK
SB-POSIX:RMDIR
SB-POSIX:ENOPROTOOPT
SB-POSIX:F-TEST
SB-POSIX:ESHUTDOWN
SB-POSIX:ENOPKG
SB-POSIX:BSDLY
SB-POSIX:SETGID
SB-POSIX:O-SYNC
SB-POSIX:S-ISGID
SB-POSIX:OCRNL
SB-POSIX:S-ISSOCK
SB-POSIX:EDEADLOCK
SB-POSIX:LOG-NEWS
SB-POSIX:PAUSE
SB-POSIX:ENXIO
SB-POSIX:SPEED-T
SB-POSIX:SIGUSR2
SB-POSIX:STAT
SB-POSIX:S-IFDIR
SB-POSIX:LOG-LOCAL4
SB-POSIX:VT0
SB-POSIX:TABDLY
SB-POSIX:EINTR
SB-POSIX:FLOCK-LEN
SB-POSIX:SIGSYS
SB-POSIX:F-WRLCK
SB-POSIX:TCOOFF
SB-POSIX:LOG-LOCAL2
SB-POSIX:ESTRPIPE
SB-POSIX:SETFSGID
SB-POSIX:ENOTCONN
SB-POSIX:CHDIR
SB-POSIX:S-IXGRP
SB-POSIX:TERMIOS-CC
SB-POSIX:ESPIPE
SB-POSIX:EPIPE
SB-POSIX:SETEGID
SB-POSIX:TCFLAG-T
SB-POSIX:AF-INET
SB-POSIX:SETREUID
SB-POSIX:SIGRTMIN
SB-POSIX:SIGRTMAX
SB-POSIX:B4800
SB-POSIX:PASSWD-UID
SB-POSIX:GETPID
SB-POSIX:TAB0
SB-POSIX:MKFIFO
SB-POSIX:EISDIR
SB-POSIX:BRKINT
SB-POSIX:EBADMSG
SB-POSIX:EMFILE
SB-POSIX:EPROTO
SB-POSIX:PROT-READ
SB-POSIX:F-GETLK
SB-POSIX:O-DIRECT
SB-POSIX:ECONNRESET
SB-POSIX:WAITPID
SB-POSIX:GROUP-PASSWD
SB-POSIX:PASSWD-DIR
SB-POSIX:WIFSIGNALED
SB-POSIX:FDATASYNC
SB-POSIX:PARMRK
SB-POSIX:B1800
SB-POSIX:TCIOFF
SB-POSIX:STAT-ATIME
SB-POSIX:EDOM
SB-POSIX:LOG-NOWAIT
SB-POSIX:SIGKILL
SB-POSIX:TCIFLUSH
SB-POSIX:EEXIST
SB-POSIX:MS-SYNC
SB-POSIX:CFGETOSPEED
SB-POSIX:ENAMETOOLONG
SB-POSIX:TCION
SB-POSIX:SETSID
SB-POSIX:O-EXCL
SB-POSIX:MKTEMP
SB-POSIX:S-IREAD
SB-POSIX:TRUNCATE
SB-POSIX:STAT-MODE
SB-POSIX:KILL
SB-POSIX:ELIBMAX
SB-POSIX:MKDIR
SB-POSIX:EACCES
SB-POSIX:LCHOWN
SB-POSIX:SIGWINCH
SB-POSIX:S-IFLNK
SB-POSIX:STAT-DEV
SB-POSIX:CLOCAL
SB-POSIX:ENOSYS
SB-POSIX:S-IEXEC
SB-POSIX:S-IFIFO
SB-POSIX:TCSANOW
SB-POSIX:NLDLY
SB-POSIX:SIGSEGV
SB-POSIX:B1200
SB-POSIX:ENOTTY
SB-POSIX:EADV
SB-POSIX:S-IXUSR
SB-POSIX:WSTOPSIG
SB-POSIX:F-GETFD
SB-POSIX:ENOEXEC
SB-POSIX:B19200
SB-POSIX:ENAVAIL
SB-POSIX:B50
SB-POSIX:EAFNOSUPPORT
SB-POSIX:S-ISCHR
SB-POSIX:EROFS
SB-POSIX:SIGABRT
SB-POSIX:GETGRGID
SB-POSIX:LOG-DEBUG
SB-POSIX:EHOSTUNREACH
SB-POSIX:LOG-KERN
SB-POSIX:TOSTOP
SB-POSIX:ENOANO
SB-POSIX:SETREGID
SB-POSIX:EDESTADDRREQ
SB-POSIX:GETPGID
SB-POSIX:ENOENT
SB-POSIX:IGNBRK
SB-POSIX:SIGUSR1
SB-POSIX:EBADE
SB-POSIX:ENOSTR
SB-POSIX:SYSLOG
SB-POSIX:ENOMEM
SB-POSIX:TCGETATTR
SB-POSIX:SEEK-CUR
SB-POSIX:CLOSE
SB-POSIX:EMLINK
SB-POSIX:GETPGRP
SB-POSIX:GETGID
SB-POSIX:LOG-LPR
SB-POSIX:SIGXFSZ
SB-POSIX:LOG-PID
SB-POSIX:GETPWUID
SB-POSIX:EXDEV
SB-POSIX:ACCESS
SB-POSIX:FCHMOD
SB-POSIX:TIMEVAL
SB-POSIX:SYNC
SB-POSIX:S-ISFIFO
SB-POSIX:ECHOK
SB-POSIX:ESTALE
SB-POSIX:EISCONN
SB-POSIX:MAP-PRIVATE
SB-POSIX:SIGILL
SB-POSIX:SETUP-MACH-EXCEPTIONS
SB-POSIX:SIGTTOU
SB-POSIX:B2400
SB-POSIX:ERESTART
SB-POSIX:VTIME
SB-POSIX:TAB3
SB-POSIX:ENOTUNIQ
SB-POSIX:CS7
SB-POSIX:ENOMEDIUM
SB-POSIX:B110
SB-POSIX:MUNLOCKALL
SB-POSIX:O-NDELAY
SB-POSIX:STAT-UID
SB-POSIX:SEEK-END
SB-POSIX:ECONNABORTED
SB-POSIX:F-GETFL
SB-POSIX:E2BIG
SB-POSIX:VT1
SB-POSIX:BS1
SB-POSIX:CFGETISPEED
SB-POSIX:ENONET
SB-POSIX:ENOLCK
SB-POSIX:EDQUOT
SB-POSIX:ETIMEDOUT
SB-POSIX:CR3
SB-POSIX:F-SETLK
SB-POSIX:F-SETFL
SB-POSIX:EPROTONOSUPPORT
SB-POSIX:FFDLY
SB-POSIX:SIGSTOP
SB-POSIX:MAP-SHARED
SB-POSIX:EOVERFLOW
SB-POSIX:IGNPAR
SB-POSIX:GETEGID
SB-POSIX:F-LOCK
SB-POSIX:NCCS
SB-POSIX:ISIG
SB-POSIX:EMULTIHOP
SB-POSIX:SIGEMT
SB-POSIX:SIGFPE
SB-POSIX:EOPNOTSUPP
SB-POSIX:F-SETOWN
SB-POSIX:EWOULDBLOCK
SB-POSIX:IEXTEN
SB-POSIX:LOG-SYSLOG
SB-POSIX:S-IWRITE
SB-POSIX:MUNMAP
SB-POSIX:GETRESUID
SB-POSIX:ENOTBLK
SB-POSIX:HUPCL
SB-POSIX:SETRESGID
SB-POSIX:SIGPIPE
SB-POSIX:O-TRUNC
SB-POSIX:EL2NSYNC
SB-POSIX:STAT-GID
SB-POSIX:S-IWGRP
SB-POSIX:F-SETLKW
SB-POSIX:ENODATA
SB-POSIX:INPCK
SB-POSIX:SIGTERM
SB-POSIX:MSYNC
SB-POSIX:F-RDLCK
SB-POSIX:TIME
SB-POSIX:FLOCK-TYPE
SB-POSIX:GROUP-GID
SB-POSIX:ESRCH
SB-POSIX:ENOTSOCK
SB-POSIX:B150
SB-POSIX:PARENB
SB-POSIX:ENETRESET
SB-POSIX:PARODD
SB-POSIX:KILLPG
SB-POSIX:CR2
SB-POSIX:ALARM
SB-POSIX:TCOFLUSH
SB-POSIX:CHROOT
SB-POSIX:LOG-ODELAY
SB-POSIX:FLOCK-WHENCE
SB-POSIX:SIGVTALRM
SB-POSIX:LOG-NDELAY
SB-POSIX:EBADFD
SB-POSIX:CRDLY
SB-POSIX:VMIN
SB-POSIX:GETCWD
SB-POSIX:GETPPID
SB-POSIX:OPENDIR
SB-POSIX:FSTAT
SB-POSIX:ENOLINK
SB-POSIX:POSIX-FORK
SB-POSIX:STAT-MTIME
SB-POSIX:STAT-SIZE
SB-POSIX:VTDLY
SB-POSIX:S-ISLNK
SB-POSIX:LOG-ERR
SB-POSIX:S-IFREG
SB-POSIX:LOG-WARNING
SB-POSIX:LOG-EMERG
SB-POSIX:INLCR
SB-POSIX:SIGHUP
SB-POSIX:EBADSLT
SB-POSIX:SETFSUID
SB-POSIX:VSTART
SB-POSIX:GETSID
SB-POSIX:FLOCK
SB-POSIX:B9600
SB-POSIX:FCHDIR