ll0.13/0040775000175200017560000000000007623416652012264 5ustar stephensstephensll0.13/src/0040775000175200017560000000000007623406402013043 5ustar stephensstephensll0.13/src/ll/0042755000175200017560000000000007623406402013452 5ustar stephensstephensll0.13/src/ll/CVS/0042755000175200017560000000000007623405443014111 5ustar stephensstephensll0.13/src/ll/CVS/Entries0100664000175200017560000001004307623405443015440 0ustar stephensstephens/README/1.4/Tue Apr 13 03:04:13 1999// /TODO/1.11/Thu Nov 4 07:07:55 1999// /ar.c/1.7/Mon Jan 15 03:44:22 2001// /assert.c/1.2/Mon Jan 15 03:44:46 2001// /bc.pl/1.1/Wed Oct 13 16:41:52 1999// /bcode.h/1.7/Sat Oct 2 19:00:39 1999// /bcompile.h/1.2/Mon Jun 28 13:59:24 1999// /binding.c/1.8/Mon Jan 15 03:59:39 2001// /bool.c/1.8/Mon Jan 15 03:47:49 2001// /cadr.c/1.4/Mon Jan 15 03:47:50 2001// /cadr.h/1.2/Mon Jun 28 13:59:28 1999// /call.h/1.3/Wed Oct 13 16:40:05 1999// /catch.c/1.16/Mon Jan 15 04:00:27 2001// /cfold.c/1.8/Mon Jan 15 03:47:51 2001// /char.c/1.8/Mon Jan 15 03:47:52 2001// /config.pl/1.1/Wed Oct 13 16:53:12 1999// /cons.c/1.14/Mon Jan 15 03:47:54 2001// /constant.c/1.4/Mon Jan 15 03:47:55 2001// /cops.h/1.2/Sat Dec 4 01:40:27 1999// /debug.c/1.7/Mon Jan 15 04:00:28 2001// /defs.sh/1.6/Wed Oct 13 16:40:05 1999// /env.ll/1.1/Wed Oct 13 16:48:06 1999// /eq.c/1.8/Mon Jan 15 03:47:59 2001// /fixnum.c/1.15/Mon Jan 15 03:49:22 2001// /floatcfg.c/1.4/Sat Oct 2 19:10:02 1999// /flonum.c/1.8/Mon Jan 15 03:49:23 2001// /fluid.c/1.12/Mon Jan 15 03:49:24 2001// /format.c/1.13/Mon Jan 15 03:50:20 2001// /global.h/1.3/Fri Oct 1 07:14:12 1999// /global1.h/1.6/Fri Oct 1 07:14:12 1999// /init.c/1.11/Mon Jan 15 03:50:58 2001// /inits.c/1.2/Wed Oct 13 16:40:06 1999// /lcache.c/1.3/Thu Nov 4 07:06:12 1999// /lcache.h/1.2/Thu Nov 4 07:06:13 1999// /lispread.c/1.13/Thu Nov 4 07:07:56 1999// /list.c/1.11/Mon Jan 15 03:51:29 2001// /llt.c/1.4/Mon Mar 29 03:13:43 1999// /llt.gdb/1.7/Wed Oct 13 16:40:06 1999// /load.c/1.11/Mon Jan 15 03:52:12 2001// /locative.c/1.6/Mon Jan 15 03:53:33 2001// /mem.c/1.6/Wed Oct 13 16:21:58 1999// /num.c/1.6/Mon Jan 15 03:53:38 2001// /number.c/1.10/Mon Jan 15 03:53:39 2001// /objdump.c/1.3/Wed Mar 24 16:35:46 1999// /object.c/1.7/Mon Jan 15 03:53:40 2001// /op.h/1.3/Wed Oct 13 16:55:44 1999// /op1.h/1.4/Fri Oct 1 07:14:12 1999// /ops.c/1.1/Wed Oct 13 16:58:17 1999// /port.c/1.16/Mon Jan 15 03:54:36 2001// /posix.c/1.7/Mon Jan 15 03:55:01 2001// /prims.c/1.1/Wed Oct 13 16:58:17 1999// /props.c/1.4/Mon Jan 15 04:01:38 2001// /read.c/1.9/Sat Dec 4 01:42:15 1999// /sig.h/1.3/Mon Jan 15 03:56:38 2001// /string.c/1.16/Mon Jan 15 03:57:52 2001// /symbol.h/1.3/Wed Oct 13 16:54:19 1999// /symbol1.h/1.7/Sat Oct 2 19:10:20 1999// /symbols.c/1.1/Wed Oct 13 16:58:18 1999// /test.gdb/1.2/Fri Feb 19 09:25:59 1999// /testold.c/1.3/Wed Mar 24 16:35:47 1999// /trace.c/1.7/Mon Jan 15 03:57:58 2001// /type.h/1.26/Fri Oct 1 09:34:27 1999// /undef.c/1.5/Fri Oct 1 07:14:13 1999// /value.h/1.7/Sat Oct 2 19:10:25 1999// /vec.c/1.17/Mon Jan 15 03:58:01 2001// /vec.h/1.2/Fri Feb 19 09:26:00 1999// D/lib//// D/src//// /assert.h/1.5/Tue Apr 3 18:51:56 2001// /call.c/1.3/Tue Apr 3 18:51:56 2001// /defs.pl/1.4/Tue Apr 3 18:51:56 2001// /doc.c/1.3/Tue Apr 3 18:51:56 2001// /error.c/1.17/Tue Apr 3 18:51:56 2001// /macro.c/1.17/Tue Apr 3 18:51:56 2001// /named.c/1.9/Tue Apr 3 18:51:56 2001// /prim.c/1.13/Tue Apr 3 18:51:56 2001// /sig.c/1.8/Tue Apr 3 18:51:56 2001// /stack.h/1.2/Tue Apr 3 18:51:56 2001// /symbol.c/1.16/Tue Apr 3 18:51:56 2001// /op.c/1.18/Sat Jun 2 08:15:47 2001// /types.h/1.9/Sat Jun 2 08:15:58 2001// /stack.c/1.12/Fri Jun 15 07:29:49 2001// /Makefile/1.43/Tue Aug 14 00:37:51 2001// /config.mak/1.5/Tue Aug 14 00:37:51 2001// /lookup.c/1.18/Tue Aug 14 00:37:51 2001// /write.c/1.21/Tue Aug 14 00:37:51 2001// /eval.c/1.11/Mon Apr 22 06:36:59 2002// /ll.h/1.32/Mon Apr 22 06:36:59 2002// /bcompile.c/1.31/Sat Feb 15 09:29:28 2003// /bmethod.c/1.28/Sat Feb 15 09:30:39 2003// /call_int.h/1.5/Sat Feb 15 09:31:03 2003// /debugger.c/1.11/Sat Feb 15 09:31:49 2003// /init.h/1.3/Sat Feb 15 09:32:12 2003// /prim.h/1.7/Sat Feb 15 09:32:50 2003// /type.c/1.19/Sat Feb 15 09:33:31 2003// /PKG/1.18/Sat Feb 15 09:33:53 2003// /env.c/1.19/Sat Feb 15 09:34:15 2003// /map.c/1.13/Sat Feb 15 09:34:15 2003// /meth.c/1.11/Sat Feb 15 09:34:15 2003// /nil.c/1.11/Sat Feb 15 09:34:15 2003// /syntax.c/1.18/Sat Feb 15 09:34:15 2003// /toplevel.c/1.7/Sat Feb 15 09:34:15 2003// /readline.c/1.7/Sat Feb 15 09:44:56 2003// /vector.c/1.8/Sat Feb 15 09:44:56 2003// ll0.13/src/ll/CVS/Root0100664000175200017560000000006107336072176014755 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/ll/CVS/Repository0100644000175200017560000000002007236675452016207 0ustar stephensstephenshome/ion/src/ll ll0.13/src/ll/lib/0042755000175200017560000000000007326751161014225 5ustar stephensstephensll0.13/src/ll/lib/CVS/0042755000175200017560000000000007336072176014663 5ustar stephensstephensll0.13/src/ll/lib/CVS/Root0100664000175200017560000000006107336072176015523 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/ll/lib/CVS/Repository0100644000175200017560000000002407236675452016761 0ustar stephensstephenshome/ion/src/ll/lib ll0.13/src/ll/lib/CVS/Entries0100644000175200017560000000001107236675452016207 0ustar stephensstephensD/ll//// ll0.13/src/ll/lib/ll/0042755000175200017560000000000007623406402014627 5ustar stephensstephensll0.13/src/ll/lib/ll/CVS/0042755000175200017560000000000007336072176015272 5ustar stephensstephensll0.13/src/ll/lib/ll/CVS/Root0100664000175200017560000000006107336072176016132 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/ll/lib/ll/CVS/Repository0100644000175200017560000000002707236675452017373 0ustar stephensstephenshome/ion/src/ll/lib/ll ll0.13/src/ll/lib/ll/CVS/Entries0100644000175200017560000000033507236675452016627 0ustar stephensstephens/fluid.ll/1.1/Wed Mar 3 07:53:38 1999// /let.scm/1.1/Wed Mar 3 07:53:38 1999// /match.scm/1.1/Mon Jan 15 04:03:27 2001// /outliner.ll/1.1/Fri Oct 1 07:14:13 1999// /strstrm.ll/1.1/Tue Mar 2 12:21:33 1999// D/test//// ll0.13/src/ll/lib/ll/test/0042755000175200017560000000000007623405443015612 5ustar stephensstephensll0.13/src/ll/lib/ll/test/CVS/0042755000175200017560000000000007623405443016245 5ustar stephensstephensll0.13/src/ll/lib/ll/test/CVS/Root0100664000175200017560000000006107336072176017111 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/ll/lib/ll/test/CVS/Repository0100644000175200017560000000003407236675452020350 0ustar stephensstephenshome/ion/src/ll/lib/ll/test ll0.13/src/ll/lib/ll/test/CVS/Entries0100664000175200017560000000020107623405443017567 0ustar stephensstephens/closed.scm/1.1/Sun Jan 14 16:30:49 2001// /test.scm/1.3/Mon Jul 9 05:44:06 2001// /mycons.scm/1.3/Sat Feb 15 09:44:56 2003// D ll0.13/src/ll/lib/ll/test/closed.scm0100744000175200017560000000055307230352071017556 0ustar stephensstephens; $Id: closed.scm,v 1.1 2001/01/14 16:30:49 stephens Exp $ (define x 'x) (define y 'y) (write "Test 1") (newline) (for-each (lambda (x) (write (cons x y)) (display #\ )) '(1 2 3 4)) (write "Test 2") (newline) (for-each (lambda (y) (for-each (lambda (x) (write (cons x y)) (display #\ )) '(1 2 3 4)) (newline)) '(a b c d)) ll0.13/src/ll/lib/ll/test/mycons.scm0100664000175200017560000000121107623406030017607 0ustar stephensstephens; $Id: mycons.scm,v 1.3 2003/02/15 09:44:56 stephens Exp $ (define (make (list ) '(car cdr))) (add-method (initialize ( car cdr) self x y) ; (%bc:debug) (set! car x) (set! cdr y) self) (define my-car (make )) (add-method (my-car ( car) self) ; (%bc:debug) car) (add-method ((setter my-car) ( car) self value) (set! car value)) (define my-cdr (make )) (add-method (my-cdr ( cdr) self) cdr) (add-method ((setter my-cdr) ( cdr) self value) (set! cdr value)) (define x (make 1 2)) (my-car x) (my-cdr x) 'ok ll0.13/src/ll/lib/ll/test/test.scm0100744000175200017560000006614407322242246017300 0ustar stephensstephens;;;; `test.scm' Test correctness of scheme implementations. ;;; Copyright (C) 1991, 1992, 1993, 1994, 1995 Aubrey Jaffer. ;;; This includes examples from ;;; William Clinger and Jonathan Rees, editors. ;;; Revised^4 Report on the Algorithmic Language Scheme ;;; and the IEEE specification. ;;; The input tests read this file expecting it to be named "test.scm". ;;; Files `tmp1', `tmp2' and `tmp3' will be created in the course of running ;;; these tests. You may need to delete them in order to run ;;; "test.scm" more than once. ;;; There are three optional tests: ;;; (TEST-CONT) tests multiple returns from call-with-current-continuation ;;; ;;; (TEST-SC4) tests procedures required by R4RS but not by IEEE ;;; ;;; (TEST-DELAY) tests DELAY and FORCE, which are not required by ;;; either standard. ;;; If you are testing a R3RS version which does not have `list?' do: ;;; (define list? #f) ;;; send corrections or additions to jaffer@ai.mit.edu or ;;; Aubrey Jaffer, 84 Pleasant St., Wakefield MA 01880, USA (define cur-section '())(define errs '()) (define SECTION (lambda args (display "SECTION") (write args) (newline) (set! cur-section args) #t)) (define record-error (lambda (e) (set! errs (cons (list cur-section e) errs)))) (define test (lambda (expect fun . args) (write (cons fun args)) (display " ==> ") ((lambda (res) (write res) (newline) (cond ((not (equal? expect res)) (record-error (list res expect (cons fun args))) (display " BUT EXPECTED ") (write expect) (newline) #f) (else #t))) (if (procedure? fun) (apply fun args) (car args))))) (define (report-errs) (newline) (if (null? errs) (display "Passed all tests") (begin (display "errors were:") (newline) (display "(SECTION (got expected (call)))") (newline) (for-each (lambda (l) (write l) (newline)) errs))) (newline)) (SECTION 2 1);; test that all symbol characters are supported. '(+ - ... !.. $.+ %.- &.! *.: /:. :+. <-. =. >. ?. ~. _. ^.) (SECTION 3 4) (define disjoint-type-functions (list boolean? char? null? number? pair? procedure? string? symbol? vector?)) (define type-examples (list #t #f #\a '() 9739 '(test) record-error "test" "" 'test '#() '#(a b c) )) (define i 1) (for-each (lambda (x) (display (make-string i #\ )) (set! i (+ 3 i)) (write x) (newline)) disjoint-type-functions) (define type-matrix (map (lambda (x) (let ((t (map (lambda (f) (f x)) disjoint-type-functions))) (write t) (write x) (newline) t)) type-examples)) (SECTION 4 1 2) (test '(quote a) 'quote (quote 'a)) (test '(quote a) 'quote ''a) (SECTION 4 1 3) (test 12 (if #f + *) 3 4) (SECTION 4 1 4) (test 8 (lambda (x) (+ x x)) 4) (define reverse-subtract (lambda (x y) (- y x))) (test 3 reverse-subtract 7 10) (define add4 (let ((x 4)) (lambda (y) (+ x y)))) (test 10 add4 6) (test '(3 4 5 6) (lambda x x) 3 4 5 6) (test '(5 6) (lambda (x y . z) z) 3 4 5 6) (SECTION 4 1 5) (test 'yes 'if (if (> 3 2) 'yes 'no)) (test 'no 'if (if (> 2 3) 'yes 'no)) (test '1 'if (if (> 3 2) (- 3 2) (+ 3 2))) (SECTION 4 1 6) (define x 2) (test 3 'define (+ x 1)) (set! x 4) (test 5 'set! (+ x 1)) (SECTION 4 2 1) (test 'greater 'cond (cond ((> 3 2) 'greater) ((< 3 2) 'less))) (test 'equal 'cond (cond ((> 3 3) 'greater) ((< 3 3) 'less) (else 'equal))) (test 2 'cond (cond ((assv 'b '((a 1) (b 2))) => cadr) (else #f))) (test 'composite 'case (case (* 2 3) ((2 3 5 7) 'prime) ((1 4 6 8 9) 'composite))) (test 'consonant 'case (case (car '(c d)) ((a e i o u) 'vowel) ((w y) 'semivowel) (else 'consonant))) (test #t 'and (and (= 2 2) (> 2 1))) (test #f 'and (and (= 2 2) (< 2 1))) (test '(f g) 'and (and 1 2 'c '(f g))) (test #t 'and (and)) (test #t 'or (or (= 2 2) (> 2 1))) (test #t 'or (or (= 2 2) (< 2 1))) (test #f 'or (or #f #f #f)) (test #f 'or (or)) (test '(b c) 'or (or (memq 'b '(a b c)) (+ 3 0))) (SECTION 4 2 2) (test 6 'let (let ((x 2) (y 3)) (* x y))) (test 35 'let (let ((x 2) (y 3)) (let ((x 7) (z (+ x y))) (* z x)))) (test 70 'let* (let ((x 2) (y 3)) (let* ((x 7) (z (+ x y))) (* z x)))) (test #t 'letrec (letrec ((even? (lambda (n) (if (zero? n) #t (odd? (- n 1))))) (odd? (lambda (n) (if (zero? n) #f (even? (- n 1)))))) (even? 88))) (define x 34) (test 5 'let (let ((x 3)) (define x 5) x)) (test 34 'let x) (test 6 'let (let () (define x 6) x)) (test 34 'let x) (test 7 'let* (let* ((x 3)) (define x 7) x)) (test 34 'let* x) (test 8 'let* (let* () (define x 8) x)) (test 34 'let* x) (test 9 'letrec (letrec () (define x 9) x)) (test 34 'letrec x) (test 10 'letrec (letrec ((x 3)) (define x 10) x)) (test 34 'letrec x) (SECTION 4 2 3) (define x 0) (test 6 'begin (begin (set! x 5) (+ x 1))) (SECTION 4 2 4) (test '#(0 1 2 3 4) 'do (do ((vec (make-vector 5)) (i 0 (+ i 1))) ((= i 5) vec) (vector-set! vec i i))) (test 25 'do (let ((x '(1 3 5 7 9))) (do ((x x (cdr x)) (sum 0 (+ sum (car x)))) ((null? x) sum)))) (test 1 'let (let foo () 1)) (test '((6 1 3) (-5 -2)) 'let (let loop ((numbers '(3 -2 1 6 -5)) (nonneg '()) (neg '())) (cond ((null? numbers) (list nonneg neg)) ((negative? (car numbers)) (loop (cdr numbers) nonneg (cons (car numbers) neg))) (else (loop (cdr numbers) (cons (car numbers) nonneg) neg))))) (SECTION 4 2 6) (test '(list 3 4) 'quasiquote `(list ,(+ 1 2) 4)) (test '(list a (quote a)) 'quasiquote (let ((name 'a)) `(list ,name ',name))) (test '(a 3 4 5 6 b) 'quasiquote `(a ,(+ 1 2) ,@(map abs '(4 -5 6)) b)) (test '((foo 7) . cons) 'quasiquote `((foo ,(- 10 3)) ,@(cdr '(c)) . ,(car '(cons)))) ;;; sqt is defined here because not all implementations are required to ;;; support it. (define (sqt x) (do ((i 0 (+ i 1))) ((> (* i i) x) (- i 1)))) (test '#(10 5 2 4 3 8) 'quasiquote `#(10 5 ,(sqt 4) ,@(map sqt '(16 9)) 8)) (test 5 'quasiquote `,(+ 2 3)) (test '(a `(b ,(+ 1 2) ,(foo 4 d) e) f) 'quasiquote `(a `(b ,(+ 1 2) ,(foo ,(+ 1 3) d) e) f)) (test '(a `(b ,x ,'y d) e) 'quasiquote (let ((name1 'x) (name2 'y)) `(a `(b ,,name1 ,',name2 d) e))) (test '(list 3 4) 'quasiquote (quasiquote (list (unquote (+ 1 2)) 4))) (test '`(list ,(+ 1 2) 4) 'quasiquote '(quasiquote (list (unquote (+ 1 2)) 4))) (SECTION 5 2 1) (define add3 (lambda (x) (+ x 3))) (test 6 'define (add3 3)) (define first car) (test 1 'define (first '(1 2))) (SECTION 5 2 2) (test 45 'define (let ((x 5)) (define foo (lambda (y) (bar x y))) (define bar (lambda (a b) (+ (* a b) a))) (foo (+ x 3)))) (define x 34) (define (foo) (define x 5) x) (test 5 foo) (test 34 'define x) (define foo (lambda () (define x 5) x)) (test 5 foo) (test 34 'define x) (define (foo x) ((lambda () (define x 5) x)) x) (test 88 foo 88) (test 4 foo 4) (test 34 'define x) (SECTION 6 1) (test #f not #t) (test #f not 3) (test #f not (list 3)) (test #t not #f) (test #f not '()) (test #f not (list)) (test #f not 'nil) (test #t boolean? #f) (test #f boolean? 0) (test #f boolean? '()) (SECTION 6 2) (test #t eqv? 'a 'a) (test #f eqv? 'a 'b) (test #t eqv? 2 2) (test #t eqv? '() '()) (test #t eqv? '10000 '10000) (test #f eqv? (cons 1 2)(cons 1 2)) (test #f eqv? (lambda () 1) (lambda () 2)) (test #f eqv? #f 'nil) (let ((p (lambda (x) x))) (test #t eqv? p p)) (define gen-counter (lambda () (let ((n 0)) (lambda () (set! n (+ n 1)) n)))) (let ((g (gen-counter))) (test #t eqv? g g)) (test #f eqv? (gen-counter) (gen-counter)) (letrec ((f (lambda () (if (eqv? f g) 'f 'both))) (g (lambda () (if (eqv? f g) 'g 'both)))) (test #f eqv? f g)) (test #t eq? 'a 'a) (test #f eq? (list 'a) (list 'a)) (test #t eq? '() '()) (test #t eq? car car) (let ((x '(a))) (test #t eq? x x)) (let ((x '#())) (test #t eq? x x)) (let ((x (lambda (x) x))) (test #t eq? x x)) (test #t equal? 'a 'a) (test #t equal? '(a) '(a)) (test #t equal? '(a (b) c) '(a (b) c)) (test #t equal? "abc" "abc") (test #t equal? 2 2) (test #t equal? (make-vector 5 'a) (make-vector 5 'a)) (SECTION 6 3) (test '(a b c d e) 'dot '(a . (b . (c . (d . (e . ())))))) (define x (list 'a 'b 'c)) (define y x) (and list? (test #t list? y)) (set-cdr! x 4) (test '(a . 4) 'set-cdr! x) (test #t eqv? x y) (test '(a b c . d) 'dot '(a . (b . (c . d)))) (and list? (test #f list? y)) (and list? (let ((x (list 'a))) (set-cdr! x x) (test #f 'list? (list? x)))) (test #t pair? '(a . b)) (test #t pair? '(a . 1)) (test #t pair? '(a b c)) (test #f pair? '()) (test #f pair? '#(a b)) (test '(a) cons 'a '()) (test '((a) b c d) cons '(a) '(b c d)) (test '("a" b c) cons "a" '(b c)) (test '(a . 3) cons 'a 3) (test '((a b) . c) cons '(a b) 'c) (test 'a car '(a b c)) (test '(a) car '((a) b c d)) (test 1 car '(1 . 2)) (test '(b c d) cdr '((a) b c d)) (test 2 cdr '(1 . 2)) (test '(a 7 c) list 'a (+ 3 4) 'c) (test '() list) (test 3 length '(a b c)) (test 3 length '(a (b) (c d e))) (test 0 length '()) (test '(x y) append '(x) '(y)) (test '(a b c d) append '(a) '(b c d)) (test '(a (b) (c)) append '(a (b)) '((c))) (test '() append) (test '(a b c . d) append '(a b) '(c . d)) (test 'a append '() 'a) (test '(c b a) reverse '(a b c)) (test '((e (f)) d (b c) a) reverse '(a (b c) d (e (f)))) (test 'c list-ref '(a b c d) 2) (test '(a b c) memq 'a '(a b c)) (test '(b c) memq 'b '(a b c)) (test '#f memq 'a '(b c d)) (test '#f memq (list 'a) '(b (a) c)) (test '((a) c) member (list 'a) '(b (a) c)) (test '(101 102) memv 101 '(100 101 102)) (define e '((a 1) (b 2) (c 3))) (test '(a 1) assq 'a e) (test '(b 2) assq 'b e) (test #f assq 'd e) (test #f assq (list 'a) '(((a)) ((b)) ((c)))) (test '((a)) assoc (list 'a) '(((a)) ((b)) ((c)))) (test '(5 7) assv 5 '((2 3) (5 7) (11 13))) (SECTION 6 4) (test #t symbol? 'foo) (test #t symbol? (car '(a b))) (test #f symbol? "bar") (test #t symbol? 'nil) (test #f symbol? '()) (test #f symbol? #f) ;;; But first, what case are symbols in? Determine the standard case: (define char-standard-case char-upcase) (if (string=? (symbol->string 'A) "a") (set! char-standard-case char-downcase)) (test #t 'standard-case (string=? (symbol->string 'a) (symbol->string 'A))) (test #t 'standard-case (or (string=? (symbol->string 'a) "A") (string=? (symbol->string 'A) "a"))) (define (str-copy s) (let ((v (make-string (string-length s)))) (do ((i (- (string-length v) 1) (- i 1))) ((< i 0) v) (string-set! v i (string-ref s i))))) (define (string-standard-case s) (set! s (str-copy s)) (do ((i 0 (+ 1 i)) (sl (string-length s))) ((>= i sl) s) (string-set! s i (char-standard-case (string-ref s i))))) (test (string-standard-case "flying-fish") symbol->string 'flying-fish) (test (string-standard-case "martin") symbol->string 'Martin) (test "Malvina" symbol->string (string->symbol "Malvina")) (test #t 'standard-case (eq? 'a 'A)) (define x (string #\a #\b)) (define y (string->symbol x)) (string-set! x 0 #\c) (test "cb" 'string-set! x) (test "ab" symbol->string y) (test y string->symbol "ab") (test #t eq? 'mISSISSIppi 'mississippi) (test #f 'string->symbol (eq? 'bitBlt (string->symbol "bitBlt"))) (test 'JollyWog string->symbol (symbol->string 'JollyWog)) (SECTION 6 5 5) (test #t number? 3) (test #t complex? 3) (test #t real? 3) (test #t rational? 3) (test #t integer? 3) (test #t exact? 3) (test #f inexact? 3) (test #t = 22 22 22) (test #t = 22 22) (test #f = 34 34 35) (test #f = 34 35) (test #t > 3 -6246) (test #f > 9 9 -2424) (test #t >= 3 -4 -6246) (test #t >= 9 9) (test #f >= 8 9) (test #t < -1 2 3 4 5 6 7 8) (test #f < -1 2 3 4 4 5 6 7) (test #t <= -1 2 3 4 5 6 7 8) (test #t <= -1 2 3 4 4 5 6 7) (test #f < 1 3 2) (test #f >= 1 3 2) (test #t zero? 0) (test #f zero? 1) (test #f zero? -1) (test #f zero? -100) (test #t positive? 4) (test #f positive? -4) (test #f positive? 0) (test #f negative? 4) (test #t negative? -4) (test #f negative? 0) (test #t odd? 3) (test #f odd? 2) (test #f odd? -4) (test #t odd? -1) (test #f even? 3) (test #t even? 2) (test #t even? -4) (test #f even? -1) (test 38 max 34 5 7 38 6) (test -24 min 3 5 5 330 4 -24) (test 7 + 3 4) (test '3 + 3) (test 0 +) (test 4 * 4) (test 1 *) (test -1 - 3 4) (test -3 - 3) (test 7 abs -7) (test 7 abs 7) (test 0 abs 0) (test 5 quotient 35 7) (test -5 quotient -35 7) (test -5 quotient 35 -7) (test 5 quotient -35 -7) (test 1 modulo 13 4) (test 1 remainder 13 4) (test 3 modulo -13 4) (test -1 remainder -13 4) (test -3 modulo 13 -4) (test 1 remainder 13 -4) (test -1 modulo -13 -4) (test -1 remainder -13 -4) (define (divtest n1 n2) (= n1 (+ (* n2 (quotient n1 n2)) (remainder n1 n2)))) (test #t divtest 238 9) (test #t divtest -238 9) (test #t divtest 238 -9) (test #t divtest -238 -9) (test 4 gcd 0 4) (test 4 gcd -4 0) (test 4 gcd 32 -36) (test 0 gcd) (test 288 lcm 32 -36) (test 1 lcm) ;;;;From: fred@sce.carleton.ca (Fred J Kaudel) ;;; Modified by jaffer. (define (test-inexact) (define f3.9 (string->number "3.9")) (define f4.0 (string->number "4.0")) (define f-3.25 (string->number "-3.25")) (define f.25 (string->number ".25")) (define f4.5 (string->number "4.5")) (define f3.5 (string->number "3.5")) (define f0.0 (string->number "0.0")) (define f0.8 (string->number "0.8")) (define f1.0 (string->number "1.0")) (define wto write-test-obj) (define dto display-test-obj) (define lto load-test-obj) (newline) (display ";testing inexact numbers; ") (newline) (SECTION 6 5 5) (test #t inexact? f3.9) (test #t 'inexact? (inexact? (max f3.9 4))) (test f4.0 'max (max f3.9 4)) (test f4.0 'exact->inexact (exact->inexact 4)) (test (- f4.0) round (- f4.5)) (test (- f4.0) round (- f3.5)) (test (- f4.0) round (- f3.9)) (test f0.0 round f0.0) (test f0.0 round f.25) (test f1.0 round f0.8) (test f4.0 round f3.5) (test f4.0 round f4.5) (set! write-test-obj (list f.25 f-3.25));.25 inexact errors less likely. (set! display-test-obj (list f.25 f-3.25));.3 often has such errors (~10^-13) (set! load-test-obj (list 'define 'foo (list 'quote write-test-obj))) (test #t call-with-output-file "tmp3" (lambda (test-file) (write-char #\; test-file) (display write-test-obj test-file) (newline test-file) (write load-test-obj test-file) (output-port? test-file))) (check-test-file "tmp3") (set! write-test-obj wto) (set! display-test-obj dto) (set! load-test-obj lto) (let ((x (string->number "4195835.0")) (y (string->number "3145727.0"))) (test #t 'pentium-fdiv-bug (> f1.0 (- x (* (/ x y) y))))) (report-errs)) (define (test-bignum) (define tb (lambda (n1 n2) (= n1 (+ (* n2 (quotient n1 n2)) (remainder n1 n2))))) (newline) (display ";testing bignums; ") (newline) (section 6 5 5) (test 0 modulo -2177452800 86400) (test 0 modulo 2177452800 -86400) (test 0 modulo 2177452800 86400) (test 0 modulo -2177452800 -86400) (test #t 'remainder (tb 281474976710655 65535)) (test #t 'remainder (tb 281474976710654 65535)) (SECTION 6 5 6) (test 281474976710655 string->number "281474976710655") (test "281474976710655" number->string 281474976710655) (report-errs)) (SECTION 6 5 6) (test "0" number->string 0) (test "100" number->string 100) (test "100" number->string 256 16) (test 100 string->number "100") (test 256 string->number "100" 16) (test #f string->number "") (test #f string->number ".") (test #f string->number "d") (test #f string->number "D") (test #f string->number "i") (test #f string->number "I") (test #f string->number "3i") (test #f string->number "3I") (test #f string->number "33i") (test #f string->number "33I") (test #f string->number "3.3i") (test #f string->number "3.3I") (test #f string->number "-") (test #f string->number "+") (SECTION 6 6) (test #t eqv? '#\ #\Space) (test #t eqv? #\space '#\Space) (test #t char? #\a) (test #t char? #\() (test #t char? #\ ) (test #t char? '#\newline) (test #f char=? #\A #\B) (test #f char=? #\a #\b) (test #f char=? #\9 #\0) (test #t char=? #\A #\A) (test #t char? #\A #\B) (test #f char>? #\a #\b) (test #t char>? #\9 #\0) (test #f char>? #\A #\A) (test #t char<=? #\A #\B) (test #t char<=? #\a #\b) (test #f char<=? #\9 #\0) (test #t char<=? #\A #\A) (test #f char>=? #\A #\B) (test #f char>=? #\a #\b) (test #t char>=? #\9 #\0) (test #t char>=? #\A #\A) (test #f char-ci=? #\A #\B) (test #f char-ci=? #\a #\B) (test #f char-ci=? #\A #\b) (test #f char-ci=? #\a #\b) (test #f char-ci=? #\9 #\0) (test #t char-ci=? #\A #\A) (test #t char-ci=? #\A #\a) (test #t char-ci? #\A #\B) (test #f char-ci>? #\a #\B) (test #f char-ci>? #\A #\b) (test #f char-ci>? #\a #\b) (test #t char-ci>? #\9 #\0) (test #f char-ci>? #\A #\A) (test #f char-ci>? #\A #\a) (test #t char-ci<=? #\A #\B) (test #t char-ci<=? #\a #\B) (test #t char-ci<=? #\A #\b) (test #t char-ci<=? #\a #\b) (test #f char-ci<=? #\9 #\0) (test #t char-ci<=? #\A #\A) (test #t char-ci<=? #\A #\a) (test #f char-ci>=? #\A #\B) (test #f char-ci>=? #\a #\B) (test #f char-ci>=? #\A #\b) (test #f char-ci>=? #\a #\b) (test #t char-ci>=? #\9 #\0) (test #t char-ci>=? #\A #\A) (test #t char-ci>=? #\A #\a) (test #t char-alphabetic? #\a) (test #t char-alphabetic? #\A) (test #t char-alphabetic? #\z) (test #t char-alphabetic? #\Z) (test #f char-alphabetic? #\0) (test #f char-alphabetic? #\9) (test #f char-alphabetic? #\space) (test #f char-alphabetic? #\;) (test #f char-numeric? #\a) (test #f char-numeric? #\A) (test #f char-numeric? #\z) (test #f char-numeric? #\Z) (test #t char-numeric? #\0) (test #t char-numeric? #\9) (test #f char-numeric? #\space) (test #f char-numeric? #\;) (test #f char-whitespace? #\a) (test #f char-whitespace? #\A) (test #f char-whitespace? #\z) (test #f char-whitespace? #\Z) (test #f char-whitespace? #\0) (test #f char-whitespace? #\9) (test #t char-whitespace? #\space) (test #f char-whitespace? #\;) (test #f char-upper-case? #\0) (test #f char-upper-case? #\9) (test #f char-upper-case? #\space) (test #f char-upper-case? #\;) (test #f char-lower-case? #\0) (test #f char-lower-case? #\9) (test #f char-lower-case? #\space) (test #f char-lower-case? #\;) (test #\. integer->char (char->integer #\.)) (test #\A integer->char (char->integer #\A)) (test #\a integer->char (char->integer #\a)) (test #\A char-upcase #\A) (test #\A char-upcase #\a) (test #\a char-downcase #\A) (test #\a char-downcase #\a) (SECTION 6 7) (test #t string? "The word \"recursion\\\" has many meanings.") (test #t string? "") (define f (make-string 3 #\*)) (test "?**" 'string-set! (begin (string-set! f 0 #\?) f)) (test "abc" string #\a #\b #\c) (test "" string) (test 3 string-length "abc") (test #\a string-ref "abc" 0) (test #\c string-ref "abc" 2) (test 0 string-length "") (test "" substring "ab" 0 0) (test "" substring "ab" 1 1) (test "" substring "ab" 2 2) (test "a" substring "ab" 0 1) (test "b" substring "ab" 1 2) (test "ab" substring "ab" 0 2) (test "foobar" string-append "foo" "bar") (test "foo" string-append "foo") (test "foo" string-append "foo" "") (test "foo" string-append "" "foo") (test "" string-append) (test "" make-string 0) (test #t string=? "" "") (test #f string? "" "") (test #t string<=? "" "") (test #t string>=? "" "") (test #t string-ci=? "" "") (test #f string-ci? "" "") (test #t string-ci<=? "" "") (test #t string-ci>=? "" "") (test #f string=? "A" "B") (test #f string=? "a" "b") (test #f string=? "9" "0") (test #t string=? "A" "A") (test #t string? "A" "B") (test #f string>? "a" "b") (test #t string>? "9" "0") (test #f string>? "A" "A") (test #t string<=? "A" "B") (test #t string<=? "a" "b") (test #f string<=? "9" "0") (test #t string<=? "A" "A") (test #f string>=? "A" "B") (test #f string>=? "a" "b") (test #t string>=? "9" "0") (test #t string>=? "A" "A") (test #f string-ci=? "A" "B") (test #f string-ci=? "a" "B") (test #f string-ci=? "A" "b") (test #f string-ci=? "a" "b") (test #f string-ci=? "9" "0") (test #t string-ci=? "A" "A") (test #t string-ci=? "A" "a") (test #t string-ci? "A" "B") (test #f string-ci>? "a" "B") (test #f string-ci>? "A" "b") (test #f string-ci>? "a" "b") (test #t string-ci>? "9" "0") (test #f string-ci>? "A" "A") (test #f string-ci>? "A" "a") (test #t string-ci<=? "A" "B") (test #t string-ci<=? "a" "B") (test #t string-ci<=? "A" "b") (test #t string-ci<=? "a" "b") (test #f string-ci<=? "9" "0") (test #t string-ci<=? "A" "A") (test #t string-ci<=? "A" "a") (test #f string-ci>=? "A" "B") (test #f string-ci>=? "a" "B") (test #f string-ci>=? "A" "b") (test #f string-ci>=? "a" "b") (test #t string-ci>=? "9" "0") (test #t string-ci>=? "A" "A") (test #t string-ci>=? "A" "a") (SECTION 6 8) (test #t vector? '#(0 (2 2 2 2) "Anna")) (test #t vector? '#()) (test '#(a b c) vector 'a 'b 'c) (test '#() vector) (test 3 vector-length '#(0 (2 2 2 2) "Anna")) (test 0 vector-length '#()) (test 8 vector-ref '#(1 1 2 3 5 8 13 21) 5) (test '#(0 ("Sue" "Sue") "Anna") 'vector-set (let ((vec (vector 0 '(2 2 2 2) "Anna"))) (vector-set! vec 1 '("Sue" "Sue")) vec)) (test '#(hi hi) make-vector 2 'hi) (test '#() make-vector 0) (test '#() make-vector 0 'a) (SECTION 6 9) (test #t procedure? car) (test #f procedure? 'car) (test #t procedure? (lambda (x) (* x x))) (test #f procedure? '(lambda (x) (* x x))) ;(test #t call-with-current-continuation procedure?) (test 7 apply + (list 3 4)) (test 7 apply (lambda (a b) (+ a b)) (list 3 4)) (test 17 apply + 10 (list 3 4)) (test '() apply list '()) (define compose (lambda (f g) (lambda args (f (apply g args))))) (test 30 (compose sqt *) 12 75) (test '(b e h) map cadr '((a b) (d e) (g h))) (test '(5 7 9) map + '(1 2 3) '(4 5 6)) (test '#(0 1 4 9 16) 'for-each (let ((v (make-vector 5))) (for-each (lambda (i) (vector-set! v i (* i i))) '(0 1 2 3 4)) v)) ;(test -3 call-with-current-continuation ; (lambda (exit) ; (for-each (lambda (x) (if (negative? x) (exit x))) ; '(54 0 37 -3 245 19)) ; #t)) ;(define list-length ; (lambda (obj) ; (call-with-current-continuation ; (lambda (return) ; (letrec ((r (lambda (obj) (cond ((null? obj) 0) ; ((pair? obj) (+ (r (cdr obj)) 1)) ; (else (return #f)))))) ; (r obj)))))) ;(test 4 list-length '(1 2 3 4)) ;(test #f list-length '(a b . c)) (test '() map cadr '()) ;;; This tests full conformance of call-with-current-continuation. It ;;; is a separate test because some schemes do not support call/cc ;;; other than escape procedures. I am indebted to ;;; raja@copper.ucs.indiana.edu (Raja Sooriamurthi) for fixing this ;;; code. The function leaf-eq? compares the leaves of 2 arbitrary ;;; trees constructed of conses. ;(define (next-leaf-generator obj eot) ; (letrec ((return #f) ; (cont (lambda (x) ; (recur obj) ; (set! cont (lambda (x) (return eot))) ; (cont #f))) ; (recur (lambda (obj) ; (if (pair? obj) ; (for-each recur obj) ; (call-with-current-continuation ; (lambda (c) ; (set! cont c) ; (return obj))))))) ; (lambda () (call-with-current-continuation ; (lambda (ret) (set! return ret) (cont #f)))))) ;(define (leaf-eq? x y) ; (let* ((eot (list 'eot)) ; (xf (next-leaf-generator x eot)) ; (yf (next-leaf-generator y eot))) ; (letrec ((loop (lambda (x y) ; (cond ((not (eq? x y)) #f) ; ((eq? eot x) #t) ; (else (loop (xf) (yf))))))) ; (loop (xf) (yf))))) (define (test-cont) (newline) (display ";testing continuations; ") (newline) (SECTION 6 9) (test #t leaf-eq? '(a (b (c))) '((a) b c)) (test #f leaf-eq? '(a (b (c))) '((a) b c d)) (report-errs)) ;;; Test Optional R4RS DELAY syntax and FORCE procedure (define (test-delay) (newline) (display ";testing DELAY and FORCE; ") (newline) (SECTION 6 9) (test 3 'delay (force (delay (+ 1 2)))) (test '(3 3) 'delay (let ((p (delay (+ 1 2)))) (list (force p) (force p)))) (test 2 'delay (letrec ((a-stream (letrec ((next (lambda (n) (cons n (delay (next (+ n 1))))))) (next 0))) (head car) (tail (lambda (stream) (force (cdr stream))))) (head (tail (tail a-stream))))) (letrec ((count 0) (p (delay (begin (set! count (+ count 1)) (if (> count x) count (force p))))) (x 5)) (test 6 force p) (set! x 10) (test 6 force p)) (test 3 'force (letrec ((p (delay (if c 3 (begin (set! c #t) (+ (force p) 1))))) (c #f)) (force p))) (report-errs)) (SECTION 6 10 1) (test #t input-port? (current-input-port)) (test #t output-port? (current-output-port)) (test #t call-with-input-file "test.scm" input-port?) (define this-file (open-input-file "test.scm")) (test #t input-port? this-file) (SECTION 6 10 2) (test #\; peek-char this-file) (test #\; read-char this-file) (test '(define cur-section '()) read this-file) (test #\( peek-char this-file) (test '(define errs '()) read this-file) (close-input-port this-file) (close-input-port this-file) (define (_show . args) (display args) (newline)) (define (check-test-file name) (define test-file (open-input-file name)) ;(_show "name=" name) (test #t 'input-port? (call-with-input-file name (lambda (test-file) (_show "test-file=" test-file) (test load-test-obj read test-file) (test #t eof-object? (peek-char test-file)) (test #t eof-object? (read-char test-file)) (input-port? test-file)))) (test #\; read-char test-file) (test display-test-obj read test-file) (test load-test-obj read test-file) (close-input-port test-file)) (SECTION 6 10 3) (define write-test-obj '(#t #f #\a () 9739 -3 . #((test) "te \" \" st" "" test #() b c))) (define display-test-obj '(#t #f a () 9739 -3 . #((test) te " " st test #() b c))) (define load-test-obj (list 'define 'foo (list 'quote write-test-obj))) (test #t call-with-output-file "tmp1" (lambda (test-file) (write-char #\; test-file) (display write-test-obj test-file) (newline test-file) (write load-test-obj test-file) (output-port? test-file))) (SECTION 6 10 3 1) (check-test-file "tmp1") (define test-file (open-output-file "tmp2")) (write-char #\; test-file) (display write-test-obj test-file) (newline test-file) (write load-test-obj test-file) (test #t output-port? test-file) (close-output-port test-file) (check-test-file "tmp2") (define (test-sc4) (newline) (display ";testing scheme 4 functions; ") (newline) (SECTION 6 7) (test '(#\P #\space #\l) string->list "P l") (test '() string->list "") (test "1\\\"" list->string '(#\1 #\\ #\")) (test "" list->string '()) (SECTION 6 8) (test '(dah dah didah) vector->list '#(dah dah didah)) (test '() vector->list '#()) (test '#(dididit dah) list->vector '(dididit dah)) (test '#() list->vector '()) (SECTION 6 10 4) (load "tmp1") (test write-test-obj 'load foo) (report-errs)) (report-errs) (if (and (string->number "0.0") (inexact? (string->number "0.0"))) (test-inexact)) (let ((n (string->number "281474976710655"))) (if (and n (exact? n)) (test-bignum))) (newline) (display "To fully test continuations, Scheme 4, and DELAY/FORCE do:") (newline) (display "(test-cont) (test-sc4) (test-delay)") (newline) "last item in file" ll0.13/src/ll/lib/ll/test/mycons.scm.~1.2.~0100664000175200017560000000120407623404006020563 0ustar stephensstephens; $Id: mycons.scm,v 1.2 2003/02/15 09:27:34 stephens Exp $ (define (make (list ) '(car cdr))) (add-method (initialize ( car cdr) self x y) ; (%bc:debug) (set! car x) (set! cdr y) self) (define my-car (make )) (add-method (my-car ( car) self) ; (%bc:debug) car) (add-method ((setter my-car) ( car) self value) (set! car value)) (define my-cdr (make )) (add-method (my-cdr ( cdr) self) cdr) (add-method ((setter my-cdr) ( cdr) self value) (set! cdr value)) (define x (make 1 2)) (my-car x) (my-cdr x) ll0.13/src/ll/lib/ll/fluid.ll0100644000175200017560000000055606667165202016273 0ustar stephensstephens; $Id: fluid.ll,v 1.1 1999/03/03 07:53:38 stephensk Exp $ (define-macro (let-fluid* bindings . body) (let* ((fsave (%gensym)) (result (%gensym))) `(let* ((,fsave %fluid-bindings) (,result #f)) ,@(map (lambda (x) (%fluid-bind (list quote (car (cdr x)))))) (set! ,result (begin ,@body)) (set! %fluid-bindings ,fsave) ,result ) ) ) ll0.13/src/ll/lib/ll/let.scm0100644000175200017560000000231306667165202016120 0ustar stephensstephens; $Id: let.scm,v 1.1 1999/03/03 07:53:38 stephensk Exp $ (define (%let-var binding) (car binding)) (define (%let-init binding) (car (cdr binding))) (define (%let-vars bindings) (if (null? bindings) '() (cons (%let-var (car bindings)) (%let-vars (cdr bindings))))) (define (%let-inits bindings) (if (null? bindings) '() (cons (%let-init (car bindings)) (%let-inits (cdr bindings))))) (define %let-undef '#u) (define (%let-undefs bindings) (if (null? bindings) '() (cons %let-undef (%let-undefs (cdr bindings))))) (define (%let-sets bindings) (if (null? bindings) '() (cons (list 'set! (%let-var (car bindings)) (%let-init (car bindings))) (%let-sets (cdr bindings))))) (define-macro (let bindings . body) (cons (cons 'lambda (cons (%let-vars bindings) body)) (%let-inits bindings))) (define (%let* bindings body) (if (null? bindings) body (list (cons 'lambda (list (%let-var (car bindings))) (%let* (cdr bindings))) (%let-init (car bindings))))) (define-macro (let* bindings . body) (%let* bindings body)) (define-macro (letrec bindings . body) (cons (cons 'lambda (cons (%let-vars bindings) (cons %let-sets bindings) body)) (%let-undefs bindings))) ll0.13/src/ll/lib/ll/match.scm0100744000175200017560000000402707230473217016430 0ustar stephensstephens;;;; $Id: match.scm,v 1.1 2001/01/15 04:03:27 stephens Exp $ (define (match-binding-var b) (car b)) (define (match-binding-value b) (cdr b)) (define (make-match-binding var val) (cons var val)) (define make-match-binding cons) (define (find-match-binding bs var) (if (null? bs) #f ; no binding found (if (eq? (match-binding-var (car bs)) var) (car bs) ; found binding (find-match-binding (cdr bs) var)))) ; continue (define (match e p bs) (if (pair? p) (if (eq? (car p) '?) ; pattern is (? ) (let* ((v (cadr p)) (b (find-match-binding bs v))) ; lookup existing match (if b (if (equal? e (match-binding-value b)) bs ; existing matched expr #f) ; existing did not match expr ;; No binding found yet (cons (make-match-binding v e) bs))) ; Return new binding ;; pattern must not be a (?) but a literal pair. ;; expr must also be a pair (if (pair? e) (begin (set! bs (match (car e) (car p) bs)) (if bs (match (cdr e) (cdr p) bs) bs)) ;; expr is not a pair, but pattern is => no match #f)) ;; pattern is not a pair, e and p must be matching literals (if (equal? e p) bs #f))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (match 'x 'y '()) (match 'x 'x '()) (match '(a b) '(a b) '()) (match 1 '(? x) '()) (match '(a b c d) '(a (? x) . (? y)) '()) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define unify:error '(unify:error)) (define (unify e bs) (if (pair? e) (if (eq? (car e) '?) (let* ((v (cadr e)) (b (find-match-binding bs v))) (if b (match-binding-value b) unify:error)) (cons (unify (car e) bs) (unify (cdr e) bs))) e)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ll0.13/src/ll/lib/ll/outliner.ll0100644000175200017560000000271706775057505017040 0ustar stephensstephens (define-macro (ll:type:make typename supers slots) `(begin (define-constant ,typename (make ,supers ,slots)) (add-method (initialize (,typename . ,slots) self . args) (while (not (null? args)) (case (car args) ,(map (lambda (slot) `((,slot) (begin (set! args (cdr args)) (set! ,slot (car args))))) ,slots))) (for ((s ,typename)) (super s initialize args))))) (define (make (list ) '( key getter setter deleter ))) (define (list ) '(collapsed items))) (define (list ) '(root window key_item_map))) (define-constant ll:outliner (make )) (add-method (ll:outliner () (self)) (let ((ol (get ll:outliner:object-outliner-map self))) (if ol (ol ll:outliner:refresh) (begin (set! ol (make 'root self)) (ll:outliner:fill self ol))) ol)) (define-constant ll:outliner:fill (make )) (add-method (ll:outliner:fill () (self outliner) (super ll:outliner:fill outliner) (let* ((sec (make 'vector-contents)) ((i 0))) (for ((i 0) (set! i (+ 1 i))) (ll:outliner:add-item (make 'key (make-locative-cell i) 'value (locative-vector-ref self i) 'setter)) )) ) ll0.13/src/ll/lib/ll/strstrm.ll0100644000175200017560000000244406666753715016717 0ustar stephensstephens;$Id: strstrm.ll,v 1.1 1999/03/02 12:21:33 stephensk Exp $ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; (define (make (list ) (list 'str 'pos))) (add-method (initialize ( str pos) self s) (set! str s) (set! pos 0) ) (add-method (port-impl ( str) self) str ) (add-method (peek-char ( str pos) self) (if (< pos (string-length str)) (string-ref str pos) port:$eos ) ) (add-method (read-char ( str pos) self) (if (< pos (string-length str)) (begin (string-ref str pos) (set! pos (+ pos 1)) ) port:$eos ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; ;; (define (make (list ) (list 'str))) (add-method (port-impl ( str) self) str ) (add-method (initialize ( str) self . s) (set! str (if (null? s) (make ) (car s))) ) (add-method (%output-char ( str) self c) (append-one! str c) ) (add-method (%output-string ( str) self s) (append! str s) ) ll0.13/src/ll/src/0042755000175200017560000000000007326751161014246 5ustar stephensstephensll0.13/src/ll/src/CVS/0042755000175200017560000000000007336072176014704 5ustar stephensstephensll0.13/src/ll/src/CVS/Root0100664000175200017560000000006107336072176015544 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/ll/src/CVS/Repository0100644000175200017560000000002407236675452017002 0ustar stephensstephenshome/ion/src/ll/src ll0.13/src/ll/src/CVS/Entries0100644000175200017560000000001607236675452016235 0ustar stephensstephensD/include//// ll0.13/src/ll/src/include/0042755000175200017560000000000007326751161015671 5ustar stephensstephensll0.13/src/ll/src/include/CVS/0042755000175200017560000000000007336072176016327 5ustar stephensstephensll0.13/src/ll/src/include/CVS/Root0100664000175200017560000000006107336072176017167 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/ll/src/include/CVS/Repository0100644000175200017560000000003407236675452020426 0ustar stephensstephenshome/ion/src/ll/src/include ll0.13/src/ll/src/include/CVS/Entries0100644000175200017560000000003007236675452017654 0ustar stephensstephensD/ll//// D/readline//// ll0.13/src/ll/src/include/ll/0042755000175200017560000000000007326751161016300 5ustar stephensstephensll0.13/src/ll/src/include/ll/CVS/0042755000175200017560000000000007336072176016736 5ustar stephensstephensll0.13/src/ll/src/include/ll/CVS/Root0100664000175200017560000000006107336072176017576 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/ll/src/include/ll/CVS/Repository0100644000175200017560000000003707236675452021040 0ustar stephensstephenshome/ion/src/ll/src/include/ll ll0.13/src/ll/src/include/ll/CVS/Entries0100644000175200017560000000067707236675452020304 0ustar stephensstephens/README/1.1/Thu Mar 4 07:02:07 1999// /bcs.h/1.1/Fri Oct 1 07:14:14 1999// /debugs.h/1.1/Fri Oct 1 07:14:14 1999// /errors.h/1.1/Wed Mar 10 16:08:08 1999// /floatcfg.h/1.1/Wed Mar 10 16:08:09 1999// /globals.h/1.1/Fri Oct 1 07:14:14 1999// /inits.h/1.1/Fri Oct 1 07:14:14 1999// /macros.h/1.1/Fri Oct 1 07:14:14 1999// /ops.h/1.1/Fri Oct 1 07:14:14 1999// /prims.h/1.1/Fri Oct 1 07:14:14 1999// /symbols.h/1.1/Fri Oct 1 07:14:15 1999// D ll0.13/src/ll/src/include/ll/README0100644000175200017560000000023406667427757017174 0ustar stephensstephens$Id: README,v 1.1 1999/03/04 07:02:07 stephensk Exp $ These files are shadowed by the headers created by defs.sh. They are here for bootstrapping purposes. ll0.13/src/ll/src/include/ll/bcs.h0100644000175200017560000000013306775057506017221 0ustar stephensstephens/* $Id: bcs.h,v 1.1 1999/10/01 07:14:14 stephensk Exp $ DO NOT MODIFY! */ #undef ll_bc_def ll0.13/src/ll/src/include/ll/debugs.h0100644000175200017560000000014106775057506017722 0ustar stephensstephens/* $Id: debugs.h,v 1.1 1999/10/01 07:14:14 stephensk Exp $ DO NOT MODIFY! */ #undef ll_DEBUG_def ll0.13/src/ll/src/include/ll/errors.h0100644000175200017560000000013506671514350017756 0ustar stephensstephens/* $Id: errors.h,v 1.1 1999/03/10 16:08:08 stephensk Exp $ DO NOT MODIFY! */ #undef ll_e_def ll0.13/src/ll/src/include/ll/floatcfg.h0100644000175200017560000000021106671514351020223 0ustar stephensstephens/* $Id: floatcfg.h,v 1.1 1999/03/10 16:08:09 stephensk Exp $ DO NOT MODIFY! */ #define ll_FLO_MAX_ERROR XXXX #define ll_FLO_DIGITS XXXXX ll0.13/src/ll/src/include/ll/globals.h0100644000175200017560000000013606775057506020100 0ustar stephensstephens/* $Id: globals.h,v 1.1 1999/10/01 07:14:14 stephensk Exp $ DO NOT MODIFY! */ #undef ll_g_def ll0.13/src/ll/src/include/ll/inits.h0100644000175200017560000000013706775057506017604 0ustar stephensstephens/* $Id: inits.h,v 1.1 1999/10/01 07:14:14 stephensk Exp $ DO NOT MODIFY! */ #undef ll_INIT_def ll0.13/src/ll/src/include/ll/macros.h0100644000175200017560000000012206775057506017734 0ustar stephensstephens/* $Id: macros.h,v 1.1 1999/10/01 07:14:14 stephensk Exp $ */ #undef ll_macro_def ll0.13/src/ll/src/include/ll/ops.h0100644000175200017560000000013206775057506017252 0ustar stephensstephens/* $Id: ops.h,v 1.1 1999/10/01 07:14:14 stephensk Exp $ DO NOT MODIFY! */ #undef ll_o_def ll0.13/src/ll/src/include/ll/prims.h0100644000175200017560000000013406775057506017605 0ustar stephensstephens/* $Id: prims.h,v 1.1 1999/10/01 07:14:14 stephensk Exp $ DO NOT MODIFY! */ #undef ll_p_def ll0.13/src/ll/src/include/ll/symbols.h0100644000175200017560000000013606775057507020146 0ustar stephensstephens/* $Id: symbols.h,v 1.1 1999/10/01 07:14:15 stephensk Exp $ DO NOT MODIFY! */ #undef ll_s_def ll0.13/src/ll/src/include/readline/0042755000175200017560000000000007326751161017454 5ustar stephensstephensll0.13/src/ll/src/include/readline/CVS/0042755000175200017560000000000007336072176020112 5ustar stephensstephensll0.13/src/ll/src/include/readline/CVS/Root0100664000175200017560000000006107336072176020752 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/ll/src/include/readline/CVS/Repository0100644000175200017560000000004507236675452022213 0ustar stephensstephenshome/ion/src/ll/src/include/readline ll0.13/src/ll/src/include/readline/CVS/Entries0100644000175200017560000000005407236675452021445 0ustar stephensstephens/history.h/1.1/Fri Mar 12 11:49:19 1999// D ll0.13/src/ll/src/include/readline/history.h0100644000175200017560000002052206672177477021341 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_readline_history_h__ #define __rcs_id_readline_history_h__ static const char __rcs_id_readline_history_h[] = "$Id: history.h,v 1.1 1999/03/12 11:49:19 stephensk Exp $"; #endif #endif /* __rcs_id__ */ /* History.h -- the names of functions that you can call in history. */ /* Copyright (C) 1989, 1992 Free Software Foundation, Inc. This file contains the GNU History Library (the Library), a set of routines for managing the text of previously typed lines. The Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. The Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The GNU General Public License is often shipped with GNU software, and is generally kept in a file called COPYING or LICENSE. If you do not have a copy of the license, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _HISTORY_H_ #define _HISTORY_H_ #if !defined (_FUNCTION_DEF) # define _FUNCTION_DEF typedef int Function (); typedef void VFunction (); typedef char *CPFunction (); typedef char **CPPFunction (); #endif /* The structure used to store a history entry. */ typedef struct _hist_entry { char *line; char *data; } HIST_ENTRY; /* A structure used to pass the current state of the history stuff around. */ typedef struct _hist_state { HIST_ENTRY **entries; /* Pointer to the entries themselves. */ int offset; /* The location pointer within this array. */ int length; /* Number of elements within this array. */ int size; /* Number of slots allocated to this array. */ int flags; } HISTORY_STATE; /* Flag values for the `flags' member of HISTORY_STATE. */ #define HS_STIFLED 0x01 /* Initialization and state management. */ /* Begin a session in which the history functions might be used. This just initializes the interactive variables. */ extern void using_history (); /* Return the current HISTORY_STATE of the history. */ extern HISTORY_STATE *history_get_history_state (); /* Set the state of the current history array to STATE. */ extern void history_set_history_state (); /* Manage the history list. */ /* Place STRING at the end of the history list. The associated data field (if any) is set to NULL. */ extern void add_history (); /* A reasonably useless function, only here for completeness. WHICH is the magic number that tells us which element to delete. The elements are numbered from 0. */ extern HIST_ENTRY *remove_history (); /* Make the history entry at WHICH have LINE and DATA. This returns the old entry so you can dispose of the data. In the case of an invalid WHICH, a NULL pointer is returned. */ extern HIST_ENTRY *replace_history_entry (); /* Clear the history list and start over. */ extern void clear_history (); /* Stifle the history list, remembering only MAX number of entries. */ extern void stifle_history (); /* Stop stifling the history. This returns the previous amount the history was stifled by. The value is positive if the history was stifled, negative if it wasn't. */ extern int unstifle_history (); /* Return 1 if the history is stifled, 0 if it is not. */ extern int history_is_stifled (); /* Information about the history list. */ /* Return a NULL terminated array of HIST_ENTRY which is the current input history. Element 0 of this list is the beginning of time. If there is no history, return NULL. */ extern HIST_ENTRY **history_list (); /* Returns the number which says what history element we are now looking at. */ extern int where_history (); /* Return the history entry at the current position, as determined by history_offset. If there is no entry there, return a NULL pointer. */ HIST_ENTRY *current_history (); /* Return the history entry which is logically at OFFSET in the history array. OFFSET is relative to history_base. */ extern HIST_ENTRY *history_get (); /* Return the number of bytes that the primary history entries are using. This just adds up the lengths of the_history->lines. */ extern int history_total_bytes (); /* Moving around the history list. */ /* Set the position in the history list to POS. */ int history_set_pos (); /* Back up history_offset to the previous history entry, and return a pointer to that entry. If there is no previous entry, return a NULL pointer. */ extern HIST_ENTRY *previous_history (); /* Move history_offset forward to the next item in the input_history, and return the a pointer to that entry. If there is no next entry, return a NULL pointer. */ extern HIST_ENTRY *next_history (); /* Searching the history list. */ /* Search the history for STRING, starting at history_offset. If DIRECTION < 0, then the search is through previous entries, else through subsequent. If the string is found, then current_history () is the history entry, and the value of this function is the offset in the line of that history entry that the string was found in. Otherwise, nothing is changed, and a -1 is returned. */ extern int history_search (); /* Search the history for STRING, starting at history_offset. The search is anchored: matching lines must begin with string. */ extern int history_search_prefix (); /* Search for STRING in the history list, starting at POS, an absolute index into the list. DIR, if negative, says to search backwards from POS, else forwards. Returns the absolute index of the history element where STRING was found, or -1 otherwise. */ extern int history_search_pos (); /* Managing the history file. */ /* Add the contents of FILENAME to the history list, a line at a time. If FILENAME is NULL, then read from ~/.history. Returns 0 if successful, or errno if not. */ extern int read_history (); /* Read a range of lines from FILENAME, adding them to the history list. Start reading at the FROM'th line and end at the TO'th. If FROM is zero, start at the beginning. If TO is less than FROM, read until the end of the file. If FILENAME is NULL, then read from ~/.history. Returns 0 if successful, or errno if not. */ extern int read_history_range (); /* Write the current history to FILENAME. If FILENAME is NULL, then write the history list to ~/.history. Values returned are as in read_history (). */ extern int write_history (); /* Append NELEMENT entries to FILENAME. The entries appended are from the end of the list minus NELEMENTs up to the end of the list. */ int append_history (); /* Truncate the history file, leaving only the last NLINES lines. */ extern int history_truncate_file (); /* History expansion. */ /* Expand the string STRING, placing the result into OUTPUT, a pointer to a string. Returns: 0) If no expansions took place (or, if the only change in the text was the de-slashifying of the history expansion character) 1) If expansions did take place -1) If there was an error in expansion. 2) If the returned line should just be printed. If an error ocurred in expansion, then OUTPUT contains a descriptive error message. */ extern int history_expand (); /* Extract a string segment consisting of the FIRST through LAST arguments present in STRING. Arguments are broken up as in the shell. */ extern char *history_arg_extract (); /* Return the text of the history event beginning at the current offset into STRING. */ extern char *get_history_event (); /* Return an array of tokens, much as the shell might. The tokens are parsed out of STRING. */ extern char **history_tokenize (); /* Exported history variables. */ extern int history_base; extern int history_length; extern int max_input_history; extern char history_expansion_char; extern char history_subst_char; extern char history_comment_char; extern char *history_no_expand_chars; extern char *history_search_delimiter_chars; extern int history_quotes_inhibit_expansion; /* If set, this function is called to decide whether or not a particular history expansion should be treated as a special case for the calling application and not expanded. */ extern Function *history_inhibit_expansion_function; #endif /* !_HISTORY_H_ */ ll0.13/src/ll/eval.c0100644000175200017560000000445107460727613014555 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_eval_c__ #define __rcs_id_ll_eval_c__ static const char __rcs_id_ll_eval_c[] = "$Id: eval.c,v 1.11 2002/04/22 06:36:59 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /************************************************************************/ /* The evaluator */ ll_define_primitive(constant,eval,1,_(object,env), _0()) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(object,Seval_hookS,1,(object), _0()) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(list,eval_list,1,_(list,env), _0()) { ll_v exprs = ll_SELF; ll_v ir; ll_v op; #if 1 ll_LIST_LOOP(exprs, expr); { ll_format(ll_undef, "\neval-list: ~S\n\n", 1, expr); ll_call(ll_o(eval), 1, (expr)); } ll_LIST_LOOP_END; #else exprs = ll_call(ll_o(map), 2, (ll_o(Seval_hookS), exprs)); exprs = ll_call(ll_o(map), 2, (ll_o(macro_expand), exprs)); ir = ll_call(ll_o(make), 2, (ll_type(_ir), exprs /* body */ )); op = ll_call(ll_o(_ir_operation), 1, (ir)); ll_tail_call(op, 0, ()); #endif } ll_define_primitive_end ll_define_primitive(object,eval,1,_(obj,env), _0()) { ll_v expr; ll_v ir; ll_v op; expr = ll_SELF; expr = ll_call(ll_o(Seval_hookS), 1, (expr)); expr = ll_call(ll_o(macro_expand), 1, (expr)); // ll_format(ll_undef, "\neval: after macro-expand: ~S\n\n", 1, expr); ir = ll_call(ll_o(make), 2, (ll_type(_ir), ll_cons(expr, ll_nil) /* body */ )); #if 1 /* Disable constant folding */ ll_call(ll_o(set_propertyE), 3, (ir, ll_s(no_const_folding), ll_t)); #endif op = ll_call(ll_o(_ir_operation), 1, (ir)); ll_tail_call(op, 0, ()); } ll_define_primitive_end ll_define_primitive(object,eval_no_const_fold,1,_(obj,env), _0()) { ll_v expr; ll_v ir; ll_v op; expr = ll_SELF; // ll_format(ll_undef, "\neval: after macro-expand: ~S\n\n", 1, expr); ir = ll_call(ll_o(make), 2, (ll_type(_ir), ll_cons(expr, ll_nil) /* body */ )); /* Disable constant folding */ ll_call(ll_o(set_propertyE), 3, (ir, ll_s(no_const_folding), ll_t)); op = ll_call(ll_o(_ir_operation), 1, (ir)); ll_tail_call(op, 0, ()); } ll_define_primitive_end /***********************************************************************/ ll0.13/src/ll/ll.h0100644000175200017560000003036407460727613014244 0ustar stephensstephens#ifndef _ll_ll_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_ll_h__ #define __rcs_id_ll_ll_h__ static const char __rcs_id_ll_ll_h[] = "$Id: ll.h,v 1.32 2002/04/22 06:36:59 stephens Exp $"; #endif #endif /* __rcs_id__ */ #define _ll_ll_h #include "ll/config.h" #include #include #include #include /*************************************************************************/ /* basic utils */ #ifndef ll_STRINGTIZE #define _ll_STRINGTIZE(X)#X #define ll_STRINGTIZE(X)_ll_STRINGTIZE(X) #endif #ifndef ll_OFFSET_OF #define ll_OFFSET_OF(T,E)((size_t)(&((T*)(0))->E)) #endif /*************************************************************************/ /* mem mgmt */ #ifndef ll_USE_GC #define ll_USE_GC 1 #endif #if ll_USE_GC #ifndef ll_USE_GC_BOEHM #define ll_USE_GC_BOEHM 1 #endif #ifndef ll_USE_GC_TREADMILL #define ll_USE_GC_TREADMILL 0 #endif #if ll_USE_GC_TREADMILL #include "tredmill/tm.h" #define _ll_gc_init(ARGC,ARGV,ENVP)tm_init((ARGC),(ARGV),(ENVP)) #define _ll_malloc(X)tm_alloc(X) #define _ll_realloc(X,Y)tm_realloc(X,Y) #define _ll_free(X) (void)(X) #define ll_gcollect() tm_gc_full() #define ll_write_barrier_ptr(X)tm_write_barrier(X) #define ll_write_barrier_ptr_pure(X)tm_write_barrier_pure(X) #define ll_write_root(X)tm_write_root(X) #endif #if ll_USE_GC_BOEHM #include "gc_boehm/gc.h" #define _ll_malloc(X) GC_malloc(X) #define _ll_realloc(X,Y) GC_realloc(X,Y) #define _ll_free(X) (void)(X) #define ll_gcollect() GC_gcollect() #endif #else /* ! ll_USE_GC */ #define _ll_malloc(X) malloc(X) #define _ll_realloc(X,Y) realloc(X,Y) #define _ll_free(X) free(X) #define ll_gcollect() (void)0 #endif #ifndef _ll_gc_init #define _ll_gc_init(ARGC,ARGV,ENVP)((void)0) #endif #ifndef ll_gcollect #define ll_gcollect()((void)0) #endif #if 1 extern void *ll_malloc(size_t); extern void *ll_realloc(void *, size_t); extern void ll_free(void *); #else #ifndef ll_malloc #define ll_malloc(X) _ll_malloc(X) #endif #ifndef ll_realloc #define ll_realloc(X,Y) _ll_realloc(X,Y) #endif #endif #ifndef ll_free #define ll_free(X) _ll_free(X) #endif /***********************************************************************/ /* Write barrier support for treadmill allocator. */ #ifndef ll_write_barrier_ptr #define ll_write_barrier_ptr(X) ((void)0) #endif #ifndef ll_write_barrier_ptr_pure #define ll_write_barrier_ptr_pure(X) ((void)0) #endif #ifndef ll_write_barrier #define ll_write_barrier(X)ll_write_barrier_ptr(ll_UNBOX_ref(X)) #endif #ifndef ll_write_barrier_pure #define ll_write_barrier_pure(X)ll_write_barrier(X) #endif #ifndef ll_write_barrier_SELF #define ll_write_barrier_SELF()ll_write_barrier_pure(ll_SELF) #endif #ifndef ll_write_root #define ll_write_root(X)((void)0) #endif /***********************************************************************/ /* Set field macros for write barrier support. */ #ifndef ll_setf #define ll_setf(X,F,V) ((X)->F = (V), ll_write_barrier(X)) #endif #ifndef ll_setf_THIS #define ll_setf_THIS(F,V) (ll_THIS->F = (V), ll_write_barrier_SELF()) #endif /***********************************************************************/ /* ll_v */ #include "ll/value.h" /***********************************************************************/ /* eq?, equal? */ #define ll_NE(X,Y)(!ll_EQ(X,Y)) #define ll_eqQ(X,Y)ll_EQ((X),(Y)) int ll_eqvQ(ll_v x, ll_v y); int ll_equalQ(ll_v x, ll_v y); /***********************************************************************/ /* undefined, unspecified, uninitialized */ #define ll_UNDEF ll_undef #define ll_UNSPEC ll_unspec #define ll_INITIALIZED(X)(X) /*************************************************************************/ /* error handling */ ll_v _ll_error(ll_v name, int nargs, ...); #define _ll_e_NAME(NAME,SUPER)NAME##_##SUPER #define ll_e_NAME(NAME,SUPER)_ll_e_NAME(NAME,SUPER) #ifndef ll_e #define ll_e(NAME,SUPER) ll_type(ll_e_NAME(NAME,SUPER)) #endif #define ll_re(NAME)ll_e(NAME,recoverable_error) #define ll_ee(NAME)ll_e(NAME,error) #define ll_fe(NAME)ll_e(NAME,fatal_error) /* basic error constructors */ ll_v _ll_range_error(ll_v name, ll_v value, long low, long high); ll_v _ll_rangecheck(ll_v name, ll_v *value, long low, long high); ll_v _ll_typecheck(ll_v type, ll_v *value); ll_v _ll_readonly_variable(ll_v var); ll_v _ll_undefined_variable(ll_v var); /************************************************************************/ /* primitives */ #include "prim.h" /*************************************************************************/ /* types */ #include "type.h" /*************************************************************************/ /* call */ #include "call.h" /************************************************************************/ /* operation references */ #ifndef ll_define_operation #define ll_define_operation(NAME,TYPE) #endif #ifndef ll_o #define ll_o(X)ll_g(X) #endif /*************************************************************************/ /* macros */ #define ll_mn(NAME)_mC##NAME #ifndef ll_define_macro #define _ll_define_macro(TYPE,NAME,MINNARGS,ARGS)ll_define_primitive(TYPE,ll_mn(NAME),MINNARGS,ARGS,_0()) #define ll_define_macro(TYPE,NAME,MINNARGS,ARGS)_ll_define_macro(TYPE,NAME,MINNARGS,ARGS) #define ll_define_macro_end ll_define_primitive_end #endif /*************************************************************************/ /* initialization */ #include "ll/init.h" /*************************************************************************/ /* type */ ll_v _ll_allocate_type(ll_v type); ll_v _ll_make_type(ll_v metatype, ll_v supers, ll_v slots); void _ll_add_method(ll_v type, ll_v op, ll_v meth); void _ll_remove_method(ll_v type, ll_v op); #ifndef ll_type #define _ll_type(X) ll_g(LT##X##GT) #define ll_type(X)_ll_type(X) #endif /*************************************************************************/ /* pair */ ll_v ll_cons(ll_v car, ll_v cdr); ll_v ll_immutable_cons(ll_v car, ll_v cdr); int ll_pairQ(ll_v x); ll_v ll_car(ll_v x); void ll_set_carE(ll_v x, ll_v v); ll_v ll_locative_car(ll_v x); #define ll_CAR(X) ll_SLOTS(X)[1] ll_v ll_cdr(ll_v x); void ll_set_cdrE(ll_v x, ll_v v); ll_v ll_locative_cdr(ll_v x); #define ll_CDR(X) ll_SLOTS(X)[2] #include "ll/cadr.h" /*************************************************************************/ /* nil */ #define ll_nil ll_g(nil) #define ll_nullQ(X) ll_EQ(X,ll_nil) /*************************************************************************/ /* list */ #define ll_LIST_LOOP(L,X) do{ ll_v _##X = (L); while ( ! ll_nullQ(_##X) ) { ll_v X = ll_car(_##X); _##X = ll_cdr(_##X) #define ll_LIST_LOOP_REF(L,X) do{ ll_v _##X = (L); while ( ! ll_nullQ(_##X) ) { ll_v* X = &ll_CAR(_##X); _##X = ll_cdr(_##X) #define ll_LIST_LOOP_END }}while(0) ll_v ll_listn(int n, ...); ll_v ll_listv(int n, const ll_v *v); void _ll_assq_set(ll_v *list, ll_v key, ll_v value); ll_v _ll_assq_to_front(ll_v *list, ll_v key); ll_v _ll_assq_delete(ll_v *x, ll_v key); ll_v ll_quote(ll_v x); /*************************************************************************/ /* boolean */ #define ll_t ll_g(__t) #define ll_f ll_g(__f) #define ll_make_boolean(X)((X)?ll_t:ll_f) #define ll_unbox_boolean(X)ll_NE((X),ll_f) /*************************************************************************/ /* undefined, unspecified, and end-of-stream */ #define ll_undef ll_g(__undef) #define ll_unspec ll_g(__unspec) #define ll_eos ll_g(__eos) /*************************************************************************/ /* char */ extern ll_v _ll_char_table[]; #define ll_MAX_char ((int)(unsigned char) ~0) #define ll_BOX_char(X) _ll_char_table[(X)&0xff] #define ll_make_char(X)ll_BOX_char(X) #define ll_UNBOX_char(X) ll_unbox_fixnum(ll_SLOTS(X)[1]) /* #define ll_unbox_char(X)ll_UNBOX_char(X) */ int ll_unbox_char(ll_v x); /*************************************************************************/ /* string */ #define _ll_VEC string #define _ll_VEC_ELEM_TYPE char #include "vec.h" #define ll_STRING_LOOP_REF(L,X)do{ char * X = _ll_ptr_string(L); size_t _l##X = _ll_len_string(L); while ( _l##X -- ) { #define ll_STRING_LOOP(L,X)ll_STRING_LOOP_REF(L,_##X) char X = *(_##X ++) #define ll_STRING_LOOP_END }}while(0) /*************************************************************************/ /* vector */ #define _ll_VEC vector #define _ll_VEC_ELEM_TYPE ll_v #include "vec.h" #define ll_VECTOR_LOOP_REF_FROM(L,X,I)do{ ll_v * X = _ll_ptr_vector(L) + (I); size_t _l##X = _ll_len_vector(L) - (I); while ( _l##X -- ) { #define ll_VECTOR_LOOP_REF(L,X)ll_VECTOR_LOOP_REF_FROM(L,X,0) #define ll_VECTOR_LOOP(L,X)ll_VECTOR_LOOP_REF(L,_##X) ll_v X = *(_##X ++) #define ll_VECTOR_LOOP_FROM(L,X,I)ll_VECTOR_LOOP_REF_FROM(L,_##X,I) ll_v X = *(_##X ++) #define ll_VECTOR_LOOP_END }}while(0) /*************************************************************************/ /* symbol */ ll_v _ll_make_symbol(ll_v str); ll_v _ll_make_symbol_(const char *name); const char *_ll_escape_symbol(const char *in); #ifndef ll_s_def extern ll_v #define ll_s_def(X) _ll_s_##X, #include "ll/symbols.h" _ll_s_; #define ll_s(X) _ll_s_##X #endif /*************************************************************************/ /* fluid */ ll_v ll_bind_fluid(ll_v var, ll_v val); ll_v ll_fluid(ll_v var); void ll_set_fluid(ll_v var, ll_v val); void ll_define_fluid(ll_v name, ll_v value); void ll_unbind_fluid(ll_v prev_bindings); #define ll_let_fluid() do { ll_v __fb_save = ll_g(_fluid_bindings); #define ll_let_fluid_END() ll_set_g(_fluid_bindings, __fb_save); } while(0) /*************************************************************************/ /* catch */ ll_v _ll_make_catch(ll_v type, ll_v *xp); void _ll_begin_catch(ll_v catch); ll_v _ll_end_catch(ll_v catch); /* returns the thrown value */ #define ll_CATCH_BEGIN(T,X) \ do { \ ll_v _ll_catch = ll_undef; \ ll_v X = _ll_make_catch(T, &_ll_catch); \ if ( ! setjmp(ll_THIS_ISA(catch,_ll_catch)->__jb) ) { \ _ll_begin_catch(_ll_catch) #define ll_CATCH_VALUE(V) \ _ll_end_catch(_ll_catch); \ } else { \ ll_v V = _ll_end_catch(_ll_catch) #define ll_CATCH_END \ } \ }while(0) /*************************************************************************/ /* environment */ extern int _ll_env_bindings_n; extern ll_v *_ll_env_bindings; extern ll_v _ll_env; #define __ll_g(X)_ll_g_##X #define _ll_g(X)__ll_g(X) #ifdef ll_g_def #ifndef ll_set_g #define ll_set_g(X,Y)ll_g(X) #endif #endif #ifndef ll_g #include "ll/global.h" /* Returns raw global binding value */ #define _ll_gb(X) _ll_env_bindings[_ll_g(X)] #define _ll_gv(X) (*ll_UNBOX_locative(ll_THIS_ISA(binding, X)->_locative)) #define _ll_gr(X) _ll_gv(_ll_gb(X)) #define _ll_gi(X) _ll_gv(_ll_env_bindings[(X)]) /* Global string name. */ extern const char *_ll_gn[]; #define _ll_gn(X) _ll_gn[X] #define ll_gn(X)_ll_gn(_ll_g(X)) /* Enable undefined global value checks */ #ifndef ll_g_CHECK #define ll_g_CHECK 0 #endif /* Enable use of global variables for all globally bound ll vars */ #ifndef ll_g_GLOBAL_VAR #define ll_g_GLOBAL_VAR 1 #endif #if ll_g_GLOBAL_VAR /* Use global variables for global values. */ #ifndef ll_g_def extern ll_v #define ll_g_def(X) _ll_gv_##X, #include "ll/globals.h" _ll_gv__; #endif #define ll_g_(X)_ll_gv_##X #define ll_g(X)ll_g_(X) #define ll_set_g(X,Y) (ll_g(X) = (Y)) #else #if ll_g_CHECK /* Checking for undefined global values */ ll_v _ll_global_get(ll_v binding); ll_v _ll_global_set(ll_v binding, ll_v value); #define ll_g(X)_ll_global_get(_ll_gb(X)) #define ll_set_g(X,Y)_ll_global_set(_ll_gb(X),(Y)) #else /* Don't bother checking for undefined global values */ #define ll_g(X) _ll_gi(_ll_g(X)) #define ll_set_g(X,Y) (_ll_gi(_ll_g(X)) = (Y)) #endif #endif #endif /*************************************************************************/ /* Named objects. */ const char *ll_po(ll_v x); void _ll_set_object_nameE(ll_v x, const char *name); /*************************************************************************/ /* formatting */ ll_v ll_format(ll_v port, const char *format, int nargs, ...); /*************************************************************************/ /* debug support */ #define _ll_DEBUG_SYM(X)SdebugC##X##S #ifndef _ll_DEBUG #define _ll_DEBUG(X)ll_g(_ll_DEBUG_SYM(X)) #endif #define ll_DEBUG(X)_ll_DEBUG(X) #define ll_DEBUG_SET(X, Y)ll_set_g(_ll_DEBUG_SYM(X), (Y)) void _ll_DEBUG_PRINT(const char *format, ...); #define ll_DEBUG_PRINT(X,Y...) do { if ( ll_DEBUG(X) ) { _ll_DEBUG_PRINT(Y); } } while(0) /*************************************************************************/ #endif ll0.13/src/ll/nil.c0100764000175200017560000000202407623404627014403 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_nil_c__ #define __rcs_id_ll_nil_c__ static const char __rcs_id_ll_nil_c[] = "$Id: nil.c,v 1.11 2003/02/15 09:34:15 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /**********************************************************************/ ll_define_primitive(null, initialize, 1, _(object,inits), _1(no_side_effect,"#t")) { /* nil is created "by hand" below. */ ll_return(ll_nil); } ll_define_primitive_end ll_define_primitive(null, clone, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(null, make_immutable, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end /**********************************************************************/ ll_INIT(nil,80,"nil, ()") { ll_set_g(nil, _ll_allocate_type(ll_type(null))); _ll_set_object_nameE(ll_nil, "()"); ll_set_g(_fluid_bindings, ll_nil); return 0; } /**********************************************************************/ ll0.13/src/ll/Makefile0100664000175200017560000001364707336071337015130 0ustar stephensstephens# $Id: Makefile,v 1.43 2001/08/13 07:27:50 stephens Exp $ ################################################################ # Configuration CONFIG_MAK=config.mak include $(CONFIG_MAK) MAKEFILES=Makefile $(CONFIG_MAK) ################################################################ DEF_DIR=lib/ll C_DEBUG=-g C_OPTIMIZE=#-O3 C_WARNINGS=-Wall CFLAGS += $(C_OPTIMIZE) $(C_DEBUG) $(C_WARNINGS) -I.. -I$(dir $(DEF_DIR)) -Isrc/include CPP = $(CC) -E C_FILES = \ init.c \ assert.c \ mem.c \ error.c \ toplevel.c \ debugger.c \ debug.c \ stack.c \ lookup.c \ lcache.c \ call.c \ ar.c \ eq.c \ object.c \ type.c \ props.c \ locative.c \ constant.c \ list.c \ cons.c \ cadr.c \ nil.c \ undef.c \ bool.c \ number.c \ fixnum.c \ flonum.c \ char.c \ string.c \ symbol.c \ vector.c \ op.c \ meth.c \ prim.c \ catch.c \ env.c \ binding.c \ port.c \ write.c \ format.c \ objdump.c \ read.c \ named.c \ eval.c \ macro.c \ syntax.c \ trace.c \ posix.c \ bcompile.c \ cfold.c \ bmethod.c \ load.c \ fluid.c \ map.c \ doc.c \ sig.c ifneq "$(strip $(HAS_READLINE))" "0" C_FILES += readline.c LIBS += -lreadline LIBS += -lncurses endif ifneq "$(strip $(HAS_HISTORY))" "0" LIBS += -lhistory endif LIBS += -lm DEFS = \ ../util/signals.h \ $(DEF_DIR)/config.h \ $(DEF_DIR)/floatcfg.h \ $(DEF_DIR)/errors.h \ $(DEF_DIR)/prims.h \ $(DEF_DIR)/macros.h \ $(DEF_DIR)/ops.h \ $(DEF_DIR)/globals.h \ $(DEF_DIR)/symbols.h \ $(DEF_DIR)/bcs.h \ $(DEF_DIR)/debugs.h \ $(DEF_DIR)/inits.h H_FILES = \ ll.h \ value.h \ call.h \ call_int.h \ assert.h \ init.h \ types.h \ type.h \ assert.h \ sig.h \ symbol1.h \ op1.h \ global.h \ global1.h \ cops.h \ lcache.h \ bcode.h \ bcompile.h \ cadr.h \ vec.h \ vec.c \ $(DEFS) #################################################################### ifeq "$(strip $(ll_USE_GC))" "0" GC=. GC_BEGIN= GC_END= GC_LIB= else GC=../gc GC_BEGIN = $(GC)/gc_begin.c GC_END = $(GC)/gc.c $(GC)/gc_end.c GC_LIB = ifneq "$(strip $(ll_USE_GC_BOEHM))" "0" GC=../gc_boehm GC_BEGIN = GC_END = GC_LIB = $(GC)/gc.a GC_TARGET=if_mach gc.a endif ifneq "$(strip $(ll_USE_GC_TREADMILL))" "0" GC=../tredmill GC_LIB = -L$(DEV_ROOT)/lib/$(MAKE_ARCH) -ltredmill GC_BEGIN = GC_END = endif endif GC_DEPS = $(GC_BEGIN) $(GC_END) #LIBS+=$(GC_LIB) #################################################################### DEF_SOURCES = $(C_FILES) DEF_FILES = #MAKE_SAVE_I=YES ifneq "$(MAKE_SAVE_I)" "" %.o : %.c $(CC) $(CFLAGS) -E $*.c | sed -e 's/^#.*//' -e 's/;/;@/g' | tr '@' '\012' > $*.i $(CC) $(CFLAGS) -c -S -o $*.s $*.i $(CC) $(CFLAGS) -c -o $*.o $*.s endif O_FILES = $(C_FILES:.c=.o) ######################################################################## ifeq "$(strip $(shell uname))" "Linux" EXE= else EXE=.exe endif ######################################################################## all : ifneq "$(strip $(v))" "" v : @$(foreach x,$(v),echo $(x)='$($(x))';) endif ######################################################################## PRODUCTS = \ llt$(EXE) ll_COLLECT_FILES = \ inits.c \ prims.c \ symbols.c \ ops.c all : $(PRODUCTS) llt$(EXE) : .defs llt.c $(O_FILES) $(ll_COLLECT_FILES) $(GC_DEPS) gc $(CC) $(CFLAGS) -o $@ $(GC_BEGIN) llt.c $(O_FILES) $(ll_COLLECT_FILES) $(GC_END) $(LIBS) $(GC_LIB) ifneq "$(strip $(ll_USE_GC))" "0" gc : $(MAKE) -C $(GC) CC=gcc else gc : endif ######################################################################## PERL = perl MAKE_DEFS = sh ./defs.sh - CPP "$(CPP)" - CFLAGS "$(CFLAGS)" $(O_FILES) : $(MAKEFILES) ll.h $(DEF_DIR)/config.h type.h .defs read.o : lispread.c string.o : vec.c vector.o : vec.c fixnum.o : num.c flonum.o : num.c symbol.o : ../hash/hash.c ../hash/hash.def ../hash/hash.h bcompile.o : $(DEF_DIR)/bcs.h bmethod.o : $(DEF_DIR)/bcs.h ######################################################################## #lookup.o : lookup.c # $(CC) $(filter-out $(C_DEBUG),$(CFLAGS)) -c -o $@ lookup.c #call.o : call.c # $(CC) $(filter-out $(C_DEBUG),$(CFLAGS)) -c -o $@ call.c ######################################################################## .defs : $(MAKE) DEFS touch $@ DEFS : $(DEFS) $(DEFS) : $(MAKEFILES) defs.sh defs.pl ../util/signals.h : cd ../util && $(MAKE) signals.h $(DEF_DIR)/config.h : $(MAKEFILES) perl -nl config.pl < $(CONFIG_MAK) > $@ $(DEF_DIR)/floatcfg.h : $(DEF_DIR)/config.h floatcfg.c $(CC) $(CFLAGS) floatcfg.c -lm -o floatcfg ./floatcfg > $@ rm -f floatcfg$(EXE) $(DEF_DIR)/errors.h : $(DEF_SOURCES) $(MAKE_DEFS) - o $@ - f ll_e - t ll_e_def $(DEF_SOURCES) $(DEF_DIR)/prims.h : $(DEF_SOURCES) $(MAKE_DEFS) - o $@ - f ll_define_primitive - t ll_p_def $(DEF_SOURCES) $(DEF_DIR)/macros.h : $(DEF_SOURCES) $(MAKE_DEFS) - o $@ - f ll_define_macro - t ll_macro_def $(DEF_SOURCES) $(DEF_DIR)/ops.h : $(DEF_SOURCES) op1.h $(DEF_DIR)/prims.h $(DEF_DIR)/macros.h $(MAKE_DEFS) - o $@ - f ll_o - t ll_o_def $(DEF_SOURCES) op1.h $(DEF_DIR)/globals.h : $(DEF_SOURCES) global1.h type.h $(DEF_DIR)/prims.h $(DEF_DIR)/macros.h $(DEF_DIR)/ops.h $(MAKE_DEFS) - o $@ - f ll_g - t ll_g_def $(DEF_SOURCES) global1.h $(DEF_DIR)/symbols.h : $(DEF_SOURCES) symbol1.h type.h $(DEF_DIR)/globals.h $(DEF_DIR)/prims.h $(DEF_DIR)/macros.h $(DEF_DIR)/ops.h $(MAKE_DEFS) - o $@ - f ll_s - t ll_s_def $(DEF_SOURCES) symbol1.h $(DEF_DIR)/bcs.h : bmethod.c $(MAKE_DEFS) - o $@ - f ll_bc - t ll_bc_def bmethod.c $(DEF_DIR)/debugs.h : $(DEF_SOURCES) $(MAKE_DEFS) - o $@ - f _ll_DEBUG - t ll_DEBUG_def $(DEF_SOURCES) $(DEF_DIR)/inits.h : # $(DEF_SOURCES) $(MAKE_DEFS) - o $@ - f ll_INIT - t ll_INIT_def $(DEF_SOURCES) ######################################################################## debug : all gdb -x llt.gdb llt ######################################################################## clean : rm -f $(PRODUCTS) llt *core *.a *.o *.i *.s *.exe [0-9]*.tmp veryclean : clean rm -f .defs $(DEFS) ######################################################################## #EOF ll0.13/src/ll/PKG0100664000175200017560000000062107623404601014011 0ustar stephensstephensNAME=ll VERSION=0.13 RCS_ID="$Id: PKG,v 1.18 2003/02/15 09:33:53 stephens Exp $" DESC="An embeddable pure, class-based, object Lisp system C library with multiple inheritance based on ideas from Scheme, Oaklisp and Dylan." CHANGES_RELEASES="0.13 0.12 0.11 0.10 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1" CATEGORY="Object Oriented" REQUIRES_PKGS="../util ../hash" REQUIRES_OTHERS="gcc perl gnumake readline" ll0.13/src/ll/README0100644000175200017560000002617306704532055014341 0ustar stephensstephens-*- outline -*- * ll README ** Preface Author: Kurt A. Stephens Contact: stephensk@acm.org Version: 0.9 Version Id: $Id: README,v 1.4 1999/04/13 03:04:13 stephensk Exp $ ** Overview ll is an embeddable, pure, class-based, object Lisp system C library with multiple inheritance based on ideas from Scheme, Oaklisp and Dylan. It differs from most implementations by its easy integration with the C programming language. It intergrates well with existing C applications better than Oaklisp (due to its namespace usage and proper tail-call implementation) and provide object-oriented features that do not exist in other embeddable Scheme environments like GNU's guile library. *** Compatiblity ll should be compatable with the Revised 5 Report, except for the macro facility. ll supports lexical closures and proper tail recursion. ll makes it easy to defined new primitive methods in C. In the future ll will handle calling in and out of C with a automatic C runtime system. ll might also be made source-code compatable with GNU guile. *** Conventions ll uses the typical s-expression Scheme syntax for all expressions. All types are named with angle brackets ("", "", "", etc.) All type predicates are suffixed with '?' ("cons?", "object?", "number?", etc.) All mutating (setter) operations are begin with 'set-' and end with '!' ("set-car!", etc.) ** Tutorial You should be familar with Scheme to understand the basics. Recommended reading: [R5RS] Revised 5 Report on the Algorithmic Language Scheme, ACM SIGPLAN Procedings, Vol. 33, Number 9. *** Messaging All values in ll are objects, even the internal objects and compiler are defined using objects. All operations in ll happen by sending messages; the car position of a function call is a object, the cdr contains the reciever and any arguments. The object is used as a key for looking up a method in the receiver's type. Message expresions take the form: (^operation^ ^receiver^ . ^arguments^) or (^operation^) For example, the expression: (car (cons 'x 'y)) Sends the stored in the 'cons global to 'x with the argument 'y. A method for the cons is stored in , which is a subtype. Then the stored in the 'car global variable is send to the result. The root type of most objects is . The type is also a subtype of . The method for message expressions with no receiver (^operation^) are found within the type. *** Type instantiation All objects have zero or more supertypes and zero or more instance slots. New types are created by sending the 'make to the ' object. (make ^supers^ ^slots^) Both ^supers^ and ^slots^ are objects. For example, the type might be defined as: (define (make (list ) (list 'car 'cdr))) *** Object instantiation All objects respond to 'make. :make allocates a new object of it's type and sends it an 'initialize message with the remaining arguments. For example, the expression: (cons 'x 'y) => (make 'x 'y). In this example the :intitialize method might be implemented as: (add-method (initialize ( car cdr) self a d) (set! car a) (set! cdr d) self) *** Operations New operations are created with (make ). objects are anonymous. *** Settable Operations New settable operations are created with (make ). Settable operations respond to (setter ^operation^). Most of the accessor primitives, like 'car, are defined as objects. For example; The 'car is defined: (define car (make )) (define set-car! (setter car)) The compiler macro expands (set! (^op^ . ^args^) ^value^) to ((setter ^op^) . ^args^ ^value^) Thus (set! (car x) 'y) is ((setter car) x 'y). *** Methods New objects are created and added to objects using the following syntax: (add-method (^op^ (^type^ . ^slots^) . ^formals^) . ^body^) ^slots^ is a list of slots defined in ^type^ that are lexically bound in the ^body^. You cannot access ^slots^ within super or types of ^type^ directly. You must defined operations and methods to do so. For example, the car and set-car! objects for types might be defined as: (add-method (car ( car) self) car) (add-method ((setter car) ( car) self new-car) (set! car new-car)) A method with no ^formals^ must be added to because all messages with no reciever and arguments is directed to . 'add-method forms can be lexically scoped within each other. *** Closures Closures are actually anonymous objects with a object added to the type. ll essentally macro expands: (lambda ^formals^ . ^body^) ==> (add-method (make ) () . ^formals^) . ^body^) Note: the 'add-method form always returns the anonymous . *** Object Coercion All objects respond to (coercer ^^) which evaluates to an anonymous object that can be sent to an object to coerce it to a ^^ object. ((coercer ) "5") ==> (number->string "5") -> 5 *** Memory Managment ll uses the Boehm garbage collector for memory managment. If you link against the ll library you will need to make sure your other code uses GC_malloc() instead of malloc(). *** Errors and the Debugger The debugger is envoked when the system sends the 'handle-error message to an object. allow the user to use a new value to recover from the error by using (db exit ^value^). objects return to the top-level loop after (db exit). objects, which never get seen by the user, dump themselves and call the C abort() function. You can envoke the debugger by calling (debugger). Eval (db help) within the debugger for more info. ** System Catalog *** Type Catalog Here is a list of the base system types. *** Operation Catalog Here is a list of the base system operations. We use the <^type^>:^operation^' syntax to name them. ** Building ll has been built on: Windows 98 using cygwin-b20 Linux using gcc 2.7.2.3 You will need gcc to support proper tail recursion. To build ll unpack ll*.tgz into a directory. cd into src/ll. Run "make all" to build. ** Packages *** llt llt is a simple interactive interpreter. Running llt, creates an interpreter and begins a top-level read, eval, and print loop. *** ll C Interface **** Limitations 'call/cc is not yet supported. You should never longjmp from within ll to your C code as it will destroy the object chain. Use ll_CATCH_BEGIN to define an escape . There is only one interpreter per process. ll cannot yet support threads. **** Headers ll.h contains all the declarations. **** Initialization You must call ll_init(&argc, &argv, &envp) from within your C main() function. ll_init() returns non-zero if the initialization fails. **** Values ll_v Is the C typedef for an ll value. ***** Constants ll_nil Is the null object. '() ll_undef Is the object. #u ll_unspec Is the object. #s. All operations that evaluate to an unspecified value will return this object. See [R5RS]. ll_t Is the true value. #t ll_f Is the false value. #f ll_eos Is the value. ll_s(NAME) Is the interned of the name NAME. The C indentifier NAME is translated using the following rules: Leading underscores '_' are replaced with '%'. "__" maps to "->". "_" maps to "-". "ADD" maps to "+", "SUB" maps to "-". "MUL" maps to "*". "DIV" maps to "/". "NEG" maps to "-". "C" maps to ":". "S" maps to "*". "Q" maps to "?". "P" maps to "%". "E" maps to "!". Example: ll_s(__ADD__to_meQ) is the '%%+->to-me? symbol. See ll/symbol.h for a list of system symbol constants. ***** Global Variables ll_g(GLOBAL_VAR_NAME) Is the global value for the global variable named by the symbol ll_s(GLOBAL_VAR). ll_set_g(GLOBAL_VAR_NAME, ll_v ^value^) Sets the global value to ^value^. ll_o(GLOBAL_VAR_NAME) Is the object stored in the global variable. It similar to ll_g(GLOBAL_VAR_NAME) except the ll_init() routine will allocate and define ll_g(NAME) as a (or if a ll_o(set_'GLOBAL_VAR_NAME'E) is referenced). ll_type(NAME) Is the object stored in the global variable named "<^NAME^>". See ll/globals.h for a list of system global names. ***** Constructors SYNC THESE!!!! ****** Fixnum (small integers) ll_v ll_box_fixnum(long x); long ll_unbox_fixnum(ll_v); long ll_UNBOX_fixnum(ll_v); ****** Flonum (floating point reals) ll_v ll_box_flonum(float x); float ll_unbox_flonum(ll_v); float ll_UNBOX_flonum(ll_v); ****** Pair and List ll_v ll_cons(ll_v car, ll_v cdr); ll_v ll_immutable_cons(ll_v car, ll_v cdr); ll_v ll_listn(int n, ll_v value, ...); ll_v ll_listv(int n, ll_v *values); ****** String ll_v ll_make_string(char *buf, size_t size); ll_v ll_make_string_copy(const char *buf, size_t size); ****** Vector ll_v ll_make_vector(ll_v *buf, size_t size); ll_v ll_make_vector_copy(const ll_v *buf, size_t size); ****** Symbol ll_v ll_make_symbol(ll_v name); ll_v ll_make_symbol_(const char *name); ****** Object Use ll_call(ll_o(make), ^N^, (^type^, ^inits^ ...)) to construct other types. **** Messaging ll_v ll_call(ll_v op, int nargs, (ll_v args ...)); Sends ^op^ with an argument list. **** Defining Primitive Types See ll/type.h for a list of all primitive types. **** Defining Primitive Methods ll_define_primitive(^type^, ^op^, ^nargs^, (^formals^), _^n^(^options^ ...)) { ... } ll_define_primitive_end Defines a primitive method object that is automatically added to ^type^ using ^op^. If (^formals^) is prefixed with "_", the primitive has rest args. ***** Primitive Method Body ****** Primitive Method Body Values These can only be used within a ll_define_primitive() int ll_ARGC; The number of arguments the method was called with. Do not modify this value. ll_v *ll_ARGV; A pointer to the argument vector the method was called with. ll_v ll_SELF; Same as ll_ARGV[0]. ll_tsa_^type^ *ll_THIS; A pointer to the C structure for the ll_SELF object. ll_v ll_OP; The object the method was called with. ****** Primitive Method Body Functions These can only be used within a ll_define_primitive(). void ll_tail_call(op, nargs, (arglist ...)); Does a tail call within a ll_define_primitive. void ll_return(value); Returns a value from a ll_define_primitive. ll_v ll_call_super(ll_v op, ll_v super, int nargs, (ll_v args ...)); void ll_tail_call_super(ll_v op, ll_v super, int nargs, (ll_v args ...)); Send ^op^ to ll_SELF's supertype. Do not include ll_SELF in the args list. **** Defining Macro Primitives Macros do lexical transformations to ll_define_macro(^type^, ^car_symbol^, ^nargs^, (^formals^), _^n^(^options^ ...)) { ... } ll_define_macro_end Creates an operation that is bound to ^car_symbol^'s macro binding, that will transform s-exprs with objects of ^type^ in the cadr position. See ll/syntax.c for implementations of the required R5RS library syntax. ll0.13/src/ll/TODO0100644000175200017560000000043707010230313014123 0ustar stephensstephens$Id: TODO,v 1.11 1999/11/04 07:07:55 stephensk Exp $ TO DO: * Allow value and activation record stacks to grow as necessary. * Implement call/cc. * bcompile.c : Use a separate environment to do the compilation in. * Intergrate bignums using gmp library. * Finish this TO DO list! ll0.13/src/ll/ar.c0100744000175200017560000000232007230471026014207 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_ar_c__ #define __rcs_id_ll_ar_c__ static const char __rcs_id_ll_ar_c[] = "$Id: ar.c,v 1.7 2001/01/15 03:44:22 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" ll_define_primitive(activation_record, _write_shallow_contents, 2, (obj, port), _0()) { ll_format(ll_ARGV[1], "op ~S type ~S argc ~S meth ~S", 4, ll_THIS->_op, ll_THIS->_type, ll_make_fixnum(ll_THIS->_argc), ll_THIS->_meth); } ll_define_primitive_end ll_define_primitive(activation_record, _ar_op, 1, (ar), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_op); } ll_define_primitive_end ll_define_primitive(activation_record, _ar_argc, 1, (ar), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(ll_THIS->_argc)); } ll_define_primitive_end ll_define_primitive(activation_record, _ar_type, 1, (ar), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_type); } ll_define_primitive_end ll_define_primitive(activation_record, _ar_type_offset, 1, (ar), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_type_offset); } ll_define_primitive_end ll_define_primitive(activation_record, _ar_meth, 1, (ar), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_meth); } ll_define_primitive_end ll0.13/src/ll/assert.c0100744000175200017560000000157207230471056015121 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_assert_c__ #define __rcs_id_ll_assert_c__ static const char __rcs_id_ll_assert_c[] = "$Id: assert.c,v 1.2 2001/01/15 03:44:46 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "assert.h" #include static int _abort_code = 0; void __ll_assert_1(const char *name, const char *expr, int code, const char *file, int line, const char *func) { _abort_code = code; fprintf(stderr, "\nll: %s, assertion: \"%s\", file: \"%s\", line: %d, func: \"%s\"", name, expr, file, line, func ? func : "" ); } void __ll_assert_2(const char *format, ...) { va_list(vap); va_start(vap,format); if ( format && format[0] ) { fprintf(stderr, ", msg: "); vfprintf(stderr, format, vap); } fprintf(stderr, "\n"); va_end(vap); if ( _abort_code ) ll_abort(); _abort_code = 0; } ll0.13/src/ll/assert.h0100744000175200017560000000411407262415714015125 0ustar stephensstephens#ifndef _ll_ASSERT_H #define _ll_ASSERT_H /* $Id: assert.h,v 1.5 2001/02/05 23:46:28 stephens Exp $ */ #include "ll/config.h" enum ll_assert { #ifndef ll_ASSERT_ENABLE ll_ASSERT_ENABLE = 1, #endif ll_assert_disable = 0, ll_assert_enable = ll_ASSERT_ENABLE, ll_assert_general = ll_assert_enable, ll_assert_init = ll_assert_enable, ll_assert_lookup = ll_assert_enable, ll_assert_mem = ll_assert_enable, ll_assert_stack = ll_assert_enable, ll_assert_ir = ll_assert_enable, ll_assert_bc = ll_assert_enable, ll_assert_env = ll_assert_enable, ll_assert_sig = ll_assert_enable, ll_assert_type = ll_assert_enable, ll_assert_prim = ll_assert_enable, ll_assert_fixnum = ll_assert_enable, ll_assert_locative = ll_assert_enable, ll_assert_flonum = ll_assert_enable, ll_assert_ref = ll_assert_enable, ll_assert_ }; #include void __ll_assert_1(const char *name, const char *expr, int value, const char *file, int line, const char *func); void __ll_assert_2(const char *format, ...); #ifndef __GCC__ #define __FUNCTION__ 0 #endif #define _ll_assert(T,ES,E,M,C)do {if ( ll_assert_##T > 0 && !(E)) { __ll_assert_1(#T, ES, (C), __FILE__, __LINE__, __FUNCTION__); __ll_assert_2 M; } }while(0) #if defined(NDEBUG) || defined(NASSERT) #define ll_assert_msg(T,E,M) ((void)0) #define ll_assert(T,E) ((void)0) #else #define ll_assert_msg(T,E,M)_ll_assert(T,#E,E,M,1) #define ll_assert(T,E)_ll_assert(T,#E,E,(0),1) #endif #define ll_warn_msg(T,E,M)_ll_assert(T,#E,E,M,0) #define ll_warn(T,E)_ll_assert(T,#E,E,(0),0) #if ll_ASSERT_IS_WARN #undef ll_assert_msg #define ll_assert_msg ll_warn_msg #undef ll_assert #define ll_assert ll_warn #endif #define ll_assert_fixnum(E) ll_assert_msg(fixnum,ll_ISA_fixnum(E),("%s = %s", #E, ll_po(E))) #define ll_assert_locative(E) ll_assert_msg(locative,ll_ISA_locative(E),("%s = %s", #E, ll_po(E))) #define ll_assert_flonum(E) ll_assert_msg(flonum,ll_ISA_flonum(E),("%s = %s", #E, ll_po(E))) #define ll_assert_ref(E) ll_assert_msg(ref,ll_ISA_ref(E),("%s = %s", #E, ll_po(E))) #endif ll0.13/src/ll/bc.pl0100644000175200017560000000441607001133120014353 0ustar stephensstephens $isns = [ { name => "lit", nargs => 1, body => '%S(LIT(%1));' }, { name => "arg", nargs => 1, body => '%S(ARG(%1));' }, { name => "set_arg", nargs => 1, body => 'ARG(%1) = %R;' }, { name => "save", nargs => 1, body => 'SAVE(%1);' }, { name => "set_loc", nargs => 1, body => 'LOC(%1) = %R;' }, { name => "loc", nargs => 1, body => '%S(LOC(%1));' }, { name => "glo", nargs => 1, body => '%S(GLO(%1));' }, { name => "set_glo", nargs => 1, body => 'GLO(%1) = %R;' }, { name => "call", nargs => 1, body => '%S(CALL(%1));' }, { name => "tail_call", nargs => 1, body => 'TAIL_CALL(%1);' }, { name => "rtn", nargs => 0, body => 'return %R; ' } ]; $op_imm = 8; $bc = 1; sub p_bc { my($i,$suf) = @_; print " bc_$i->{name}$suf = $bc,\n"; $bc ++; } print "enum bc {\n"; foreach $i ( @$isns ) { if ( $i->{nargs} ) { p_bc($i); $bc --; $i->{imm} = $op_imm if ( ! defined($i->{imm}) ); foreach $j ( 0..$i->{imm} ) { p_bc($i, "_$j"); } p_bc($i, "_B1"); p_bc($i, "_B2"); p_bc($i, "_B3"); p_bc($i, "_B4"); } else { p_bc($i); } print "\n"; } print "}\n"; print q@ #ifdef USE_METER unsigned char this_op, prev_op; extern unsigned long meter[256][256]; #define METER(OP) (prev_op = this_op, this_op = OP, meter[0][this_op] ++, meter[prev_op][this_op] ++, this_op) #else #define METER(OP) OP #endif again: switch ( METER(FETCH()) ) { @; sub p_body { my($i,$sub,$q,$pre) = @_; my($x); $x = $i->{body}; $x =~ s/%1/$sub/g; $x =~ s/%([0-9]+)/oparg$1/g; $x =~ s/%S/PUSH/g; $x =~ s/%R/POP()/g; foreach $j ( 2..$i->{nargs} ) { $pre .= " int oparg$j = FETCH4();\n" } print " case bc_$i->{name}$q:\n"; print " {\n $pre\n" if ( $pre ); print " $x\n"; print " }\n" if ( $pre ); print " goto again;\n\n"; } foreach $i ( @$isns ) { print "\n /* $i->{name} */\n"; if ( $i->{nargs} ) { foreach $j ( 0..$i->{imm} ) { p_body($i, $j, "_$j"); } p_body($i, "oparg1", "_B1", "int oparg1 = FETCH1();"); p_body($i, "oparg1", "_B2", "int oparg1 = FETCH2();"); p_body($i, "oparg1", "_B3", "int oparg1 = FETCH3();"); p_body($i, "oparg1", "_B4", "int oparg1 = FETCH4();"); } else { p_body($i, ""); } } print q@ default: abort(); } @; 1; ll0.13/src/ll/bcode.h0100644000175200017560000000073406775453127014713 0ustar stephensstephens#ifndef _ll_bcode_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_bcode_h__ #define __rcs_id_ll_bcode_h__ static const char __rcs_id_ll_bcode_h[] = "$Id: bcode.h,v 1.7 1999/10/02 19:00:39 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _ll_bcode_h typedef enum ll_bc { _ll_bc_NULL = 0, #ifndef ll_bc_def #define ll_bc_def(X,NARGS,SM,NSA) ll_bc_##X, #include "ll/bcs.h" #endif _ll_bc_LAST } ll_bc; #ifndef ll_bc #define ll_bc(X,NARGS,SM,NSA) ll_bc_##X #endif #endif ll0.13/src/ll/bcompile.c0100764000175200017560000013573607623404170015425 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_bcompile_c__ #define __rcs_id_ll_bcompile_c__ static const char __rcs_id_ll_bcompile_c[] = "$Id: bcompile.c,v 1.31 2003/02/15 09:29:28 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "bcode.h" #include "bcompile.h" #include "assert.h" #ifndef ll_BC_EMIT_DEBUGS int ll_BC_EMIT_DEBUG = 0; #endif /***************************************************************************/ /* byte-code-method construction */ /* The byte-code-method object is created with a byte-code string, a constants vector, a properties list and an optional environment vector. The byte-code string and properties list are constant and stored in the top-level method's constant vector. The environment vector is created in the enclosing method. Nested byte-code-methods share a constants vector with the top-level byte-code-method. The first element of the constants vector is a vector of global symbol referenced. The second element of the constants vector is a vector of global symbol bindings initialized to be all #f. The 'glo instruction indexes into the global symbol table and attempts to get a binding object to store in the global symbol bindings table. The 'glo instruction is then rewritten as 'glo_. The 'glo_ instruction indexes directly into the global symbol bindings table, since the binding has already been resolved by 'glo. The remaining constant vector elements are all the unique constants (quoted values) referenced by the entire top-level method. The top-level byte-code constant vector can be written out to a file for reloading a later date. */ /***************************************************************************/ ll_define_primitive(_ir,_write_port,3,(obj,port,op),_0()) { ll_format(ll_ARGV[1], "#<~N ~W ~S ~S>", 4, ll_TYPE(ll_SELF), ll_SELF, ll_THIS->_formals, ll_THIS->_body); } ll_define_primitive_end ll_define_primitive(_ir,_write_ir,2,(obj,port),_0()) { ll_format(ll_ARGV[1], "'slots ~S 'formals ~S ", 2, ll_THIS->_slots, ll_THIS->_formals); ll_format(ll_ARGV[1], " 'max-n-locals ~S 'n-locals ~S 'env-length ~S\n", 3, ll_THIS->_max_n_locals, ll_THIS->_n_locals, ll_THIS->_env_length); if ( ! ll_nullQ(ll_THIS->_scope) ) { ll_format(ll_ARGV[1], " 'scope (\n", 0); ll_LIST_LOOP(ll_THIS->_scope, x); { ll_format(ll_ARGV[1], " ~S\n", 1, x); } ll_LIST_LOOP_END; ll_format(ll_ARGV[1], " )\n", 0); } if ( ! ll_nullQ(ll_THIS->_imports) ) { ll_format(ll_ARGV[1], " 'imports (\n", 0); ll_LIST_LOOP(ll_THIS->_imports, x); { ll_format(ll_ARGV[1], " ~S\n", 1, x); } ll_LIST_LOOP_END; ll_format(ll_ARGV[1], " )\n", 0); } if ( ! ll_nullQ(ll_THIS->_env) ) { ll_format(ll_ARGV[1], " 'env (\n", 0); ll_LIST_LOOP(ll_THIS->_env, x); { ll_format(ll_ARGV[1], " ~S\n", 1, x); } ll_LIST_LOOP_END; ll_format(ll_ARGV[1], " )\n", 0); } if ( ! ll_nullQ(ll_THIS->_body) ) { ll_format(ll_ARGV[1], " 'body (\n", 0); ll_LIST_LOOP(ll_THIS->_body, x); { ll_format(ll_ARGV[1], " ~S\n", 1, x); } ll_LIST_LOOP_END; ll_format(ll_ARGV[1], " )\n", 0); } } ll_define_primitive_end #define IR ll_SELF ll_define_primitive(_ir,_ir_code,1,(ir),_1(no_side_effect,"#t")) { ll_return(ll_THIS->_code); } ll_define_primitive_end ll_define_primitive(_ir,_ir_globals,1,(ir),_1(no_side_effect,"#t")) { ll_tail_call(ll_o(vector_ref), 2, (ll_THIS->_consts, ll_make_fixnum(0))); } ll_define_primitive_end ll_define_primitive(_ir,_ir_global_bindings,1,(ir),_1(no_side_effect,"#t")) { ll_tail_call(ll_o(vector_ref), 2, (ll_THIS->_consts, ll_make_fixnum(1))); } ll_define_primitive_end ll_define_primitive(_ir,_ir_consts,1,(ir),_1(no_side_effect,"#t")) { ll_return(ll_THIS->_consts); } ll_define_primitive_end ll_define_primitive(_ir,_ir_scope,1,(ir),_1(no_side_effect,"#t")) { ll_return(ll_THIS->_scope); } ll_define_primitive_end ll_define_primitive(_ir,_ir_formals,1,(ir),_1(no_side_effect,"#t")) { ll_return(ll_THIS->_formals); } ll_define_primitive_end ll_define_primitive(_ir,_ir_body,1,(ir),_1(no_side_effect,"#t")) { ll_return(ll_THIS->_body); } ll_define_primitive_end ll_define_primitive(_ir,locative_properties,1,(ir),_1(no_side_effect,"#t")) { if ( ! ll_unbox_boolean(ll_THIS->_properties) ) { if ( ll_unbox_boolean(ll_THIS->_parent) ) { ll_setf(ll_THIS, _properties, ll_call(ll_o(properties), 1, (ll_THIS->_parent))); } } if ( ! ll_unbox_boolean(ll_THIS->_properties) ) { ll_setf(ll_THIS, _properties, ll_nil); } ll_return(ll_make_locative(&ll_THIS->_properties)); } ll_define_primitive_end ll_define_primitive(_ir,_ir_set_propE,3,(ir,prop,value),_0()) { _ll_assq_set(&ll_THIS->_props, ll_ARGV[1], ll_ARGV[2]); } ll_define_primitive_end ll_define_primitive(_ir,_ir_root_lambda,1,(ir),_1(no_side_effect,"#t")) { if ( ll_unbox_boolean(ll_THIS->_car_posQ) ) { ll_tail_call(ll_o(_ir_root_lambda), 1, (ll_THIS->_parent)); } else { ll_return(IR); } } ll_define_primitive_end ll_define_primitive(_ir,_ir_allocate_local,1,(ir),_0()) { if ( ll_unbox_boolean(ll_THIS->_car_posQ) ) { ll_tail_call(ll_o(_ir_allocate_local), 1, (ll_call(ll_o(_ir_root_lambda), 1,(IR)))); } else { ll_v x; ll_setf(ll_THIS, _n_locals, ll_call(ll_o(_ADD), 2, (ll_THIS->_n_locals, ll_make_fixnum(1)))); x = ll_THIS->_n_locals; if ( ll_unbox_fixnum(ll_THIS->_max_n_locals) < ll_unbox_fixnum(x) ) { ll_setf(ll_THIS, _max_n_locals, x); ll_write_barrier_pure(ll_SELF); } ll_return(x); } } ll_define_primitive_end ll_define_primitive(_ir,_ir_allocate_global,2,(ir,global),_0()) { ll_v globals = ll_call(ll_o(_ir_globals), 1, (ll_SELF)); ll_v x = ll_call(ll_o(vector_length), 1, (globals)); ll_call(ll_o(append_oneE), 2, (globals, ll_ARGV[1])); globals = ll_call(ll_o(_ir_global_bindings), 1, (ll_SELF)); ll_call(ll_o(append_oneE), 2, (globals, ll_f)); ll_return(x); } ll_define_primitive_end ll_define_primitive(_ir,_ir_allocate_export,2,(ir,var),_0()) { ll_v x = ll_ARGV[1]; if ( ll_unbox_boolean(ll_THIS->_car_posQ) ) { ll_v save_x = x; /* ** If we need to export a local from a sub car-pos lambda, ** allocate an anonymous export vector slot. */ if ( ll_EQ(var_type(x), ll_s(local)) ) { x = ll_listn(5, ll_undef, ll_undef, ll_f, ll_f, ll_f); } ll_call(ll_o(_ir_allocate_export), 2, (ll_call(ll_o(_ir_root_lambda), 1, (IR)), x)); /* Copy the environment index back to our requested var */ set_var_closed_overQ(save_x, var_closed_overQ(x)); } else { /* Allocate and remember a slot in our environment vector */ set_var_closed_overQ(x, ll_THIS->_env_length); ll_THIS->_env_length = ll_call(ll_o(_ADD), 2, (ll_THIS->_env_length, ll_make_fixnum(1))); ll_write_barrier_SELF(); /* Append to the environment list */ /* ** We keep the environment list in reverse environment vector order ** because we build the environment vector on the stack. */ ll_THIS->_env = ll_cons(x, ll_THIS->_env); ll_write_barrier_SELF(); } } ll_define_primitive_end ll_define_primitive(_ir,initialize,2,_(ir,body,args),_0()) { ll_THIS->_body = ll_ARGV[1]; ll_THIS->_formals = ll_ARGC >= 3 ? ll_ARGV[2] : ll_nil; ll_THIS->_slots = ll_ARGC >= 4 ? ll_ARGV[3] : ll_nil; ll_THIS->_parent = ll_ARGC >= 5 ? ll_ARGV[4] : ll_f; ll_THIS->_car_posQ = ll_ARGC >= 6 ? ll_ARGV[5] : ll_f; ll_THIS->_properties = ll_nil; ll_write_barrier_SELF(); /* ** Create a properties list for the child method. ** e.g. documentation, debugging support, etc. */ ll_THIS->_props = ll_listn(3, ll_cons(ll_s(formals), ll_THIS->_formals), ll_cons(ll_s(slots), ll_THIS->_slots), ll_cons(ll_s(body), ll_THIS->_body) ); ll_write_barrier_SELF(); if ( ll_unbox_boolean(ll_THIS->_parent) ) { ll_v root_lambda = ll_call(ll_o(_ir_root_lambda), 1, (ll_THIS->_parent)); ll_THIS->_consts = ll_call(ll_o(_ir_consts), 1, (root_lambda)); ll_write_barrier_SELF(); } else { ll_THIS->_consts = ll_call(ll_o(make), 1, (ll_type(mutable_vector))); ll_write_barrier_SELF(); /* globals */ ll_call(ll_o(append_oneE), 2, (ll_THIS->_consts, ll_call(ll_o(make), 1, (ll_type(mutable_vector))))); /* global bindings */ ll_call(ll_o(append_oneE), 2, (ll_THIS->_consts, ll_call(ll_o(make), 1, (ll_type(mutable_vector))))); } if ( ll_unbox_boolean(ll_THIS->_car_posQ) ) { ll_v root_lambda = ll_call(ll_o(_ir_root_lambda), 1, (ll_THIS->_parent)); ll_THIS->_code = ll_call(ll_o(_ir_code), 1, (root_lambda)); } else { ll_THIS->_code = ll_call(ll_o(make), 1, (ll_type(mutable_string))); } ll_THIS->_scope = ll_nil; ll_THIS->_rest_argQ = ll_f; ll_THIS->_env = ll_nil; ll_THIS->_imports = ll_nil; ll_write_barrier_SELF(); ll_THIS->_env_length = ll_make_fixnum(0); ll_write_barrier_SELF(); ll_THIS->_n_locals = ll_make_fixnum(0); ll_write_barrier_SELF(); ll_THIS->_max_n_locals = ll_make_fixnum(0); ll_write_barrier_SELF(); { ll_v x, entry; int i; /* Scan slots and add to scope */ /* Do slots first so formals will override slots */ i = 0; x = ll_THIS->_slots; while ( ! ll_nullQ(x) ) { ll_v var, type, index; var = ll_car(x); type = ll_s(slot); index = ll_make_fixnum(i); entry = ll_listn(5, var, type, index, ll_f, ll_f); ll_THIS->_scope = ll_cons(entry, ll_THIS->_scope); ll_write_barrier_SELF(); i ++; x = ll_cdr(x); } /* Scan formals and add to scope */ /* ** IMPLEMENT: If there is only a rest-arg and a slot is referenced ** be sure for force checking for at least one argument, namely "self". */ x = ll_THIS->_formals; i = 0; while ( ! ll_nullQ(x) ) { ll_v var, type, index; if ( ll_unbox_boolean(ll_call(ll_o(symbolQ), 1, (x))) ) { /* a restarg is not really an arg but actually a local */ ll_THIS->_rest_argQ = x; ll_write_barrier_SELF(); var = x; type = ll_s(local); index = ll_f; x = ll_nil; } else { var = ll_car(x); /* If this lambda is car-position, the argument is actually ** in a local slot, allocated by the root lambda. */ if ( ll_unbox_boolean(ll_THIS->_car_posQ) ) { type = ll_s(local); index = ll_f; } else { type = ll_s(arg); index = ll_make_fixnum(i); } x = ll_cdr(x); i ++; } entry = ll_listn(5, var, type, index, ll_f, ll_f); ll_THIS->_scope = ll_cons(entry, ll_THIS->_scope); ll_write_barrier_SELF(); } ll_THIS->_argc = ll_make_fixnum(i); ll_write_barrier_SELF(); } /* Begin scoping and rewrite rules */ ll_call(ll_o(_ir_compile1_body), 1, (IR)); ll_return(IR); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(_ir,_ir_var_scope,2,_(ir,var,close_over),_0()) { ll_v var = ll_ARGV[1]; ll_v x; ll_v type; ll_v index = ll_f; ll_v close_over = ll_ARGC > 2 ? ll_ARGV[2] : ll_f; int i; /* Look up a scope in the cache */ x = ll_assq(var, ll_THIS->_scope); if ( ll_unbox_boolean(x) ) { type = var_type(x); /* If it's not a global */ if ( ll_NE(type, ll_s(glo)) ) { /* Are we going to close it over? */ if ( ll_unbox_boolean(close_over) ) { /* If not already closed over */ if ( ! ll_unbox_boolean(var_closed_overQ(x)) ) { ll_call(ll_o(_ir_allocate_export), 2, (ll_SELF, x)); } } else if ( ll_EQ(var_type(x), ll_s(local)) && ! ll_unbox_boolean(var_referencedQ(x)) ) { /* If it's a local that has not been referenced yet, allocate local space */ ll_v index = ll_call(ll_o(_ir_allocate_local), 1, (IR)); set_var_index(x, index); } /* mark it as referenced */ set_var_referencedQ(x, ll_t); } ll_return(x); } /* ** Now look in parent: */ if ( ll_unbox_boolean(ll_THIS->_parent) ) { /* Are we a car-pos lambda? */ if ( ll_unbox_boolean(ll_THIS->_car_posQ) ) { /* Simply do a lookup without closing-over */ x = ll_call(ll_o(_ir_var_scope), 3, (ll_THIS->_parent, var, close_over)); } else { ll_v co; /* ** Pass the close-over flag so we can force the defining scope to ** close-over it (put it into it's exported environment). */ x = ll_call(ll_o(_ir_var_scope), 3, (ll_THIS->_parent, var, ll_t)); type = var_type(x); if ( ll_NE(type, ll_s(glo)) ) { /* Did our parent return a closed-over value? */ co = var_closed_overQ(x); if ( ll_unbox_boolean(co) ) { /* ** Scope it here as being in the environment vector that our parent ** created for us. But mark it as being not closed-over by our ** child lambdas. */ x = ll_listn(5, var_name(x), ll_s(env), co, ll_f, ll_t); /* ll_format(ll_undef, " in env ~S\n", 1, x); */ ll_THIS->_imports = ll_cons(x, ll_THIS->_imports); ll_write_barrier_SELF(); } } } } /* Not found: must be global */ if ( ! ll_unbox_boolean(x) ) { index = ll_call(ll_o(_ir_allocate_global), 2, (ll_SELF, var)); x = ll_listn(5, var, ll_s(glo), index, ll_f, ll_t); } /* Add to our scope list */ ll_THIS->_scope = ll_cons(x, ll_THIS->_scope); ll_write_barrier_SELF(); ll_return(x); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(_ir,_ir_const_index,2,(ir,c), _0()) { int i; /* Search constant vector for an equal? member */ /* Skip over globals and global bindings */ i = 2; ll_VECTOR_LOOP_FROM(ll_THIS->_consts, x, i); { if ( ll_equalQ(ll_ARGV[1], x) ) ll_return(ll_make_fixnum(i)); i ++; } ll_VECTOR_LOOP_END; /* i == (length (%ir-consts ir)) */ ll_call(ll_o(append_oneE), 2, (ll_THIS->_consts, ll_ARGV[1])); // ll_format(ll_undef, "~O %ir-const-index: ~S [~S]\n", 3, ll_SELF, ll_ARGV[1], ll_make_fixnum(i)); ll_return(ll_make_fixnum(i)); } ll_define_primitive_end ll_define_primitive(_ir,__ir_emit,2,(ir,c), _0()) { ll_v x; static ll_v _ll_bc_defs; if ( ! ll_INITIALIZED(_ll_bc_defs) ) { static struct { const char *name; int code; } x[] = { #ifndef ll_bc_def #define ll_bc_def(X,NARGS,SM,NSA) { #X, (int) ll_bc_##X }, #include "ll/bcs.h" #endif { 0 } }; int i; _ll_bc_defs = ll_nil; for ( i = 0; x[i].name; i ++ ) { // fprintf(stderr, "ll_bc(%s) = %d\n", x[i].name, x[i].code); _ll_bc_defs = ll_cons(ll_cons(_ll_make_symbol_(_ll_escape_symbol(x[i].name)), ll_make_char(x[i].code)), _ll_bc_defs); } } /* Find the byte-code for the symbolic name */ x = _ll_assq_to_front(&_ll_bc_defs, ll_ARGV[1]); if ( ll_unbox_boolean(x) ) { x = ll_cdr(x); } else { _ll_error(ll_fe(bytecode), 1, ll_s(bytecode), ll_ARGV[1]); } ll_tail_call(ll_o(append_oneE), 2, (ll_THIS->_code, x)); } ll_define_primitive_end ll_define_primitive(_ir,_ir_emit,2,(ir,c), _0()) { if ( ll_BC_EMIT_DEBUG ) { ll_format(ll_undef, "~O: emit: ~S : ~S\n", 3, ll_SELF, ll_call(ll_o(_ir_emit_pos), 1, (ll_SELF)), ll_ARGV[1]); } ll_tail_call(ll_o(__ir_emit), 2, (ll_SELF, ll_ARGV[1])); } ll_define_primitive_end ll_define_primitive(_ir,_ir_emit_pos,1,(ir),_1(no_side_effect,"#t")) { ll_tail_call(ll_o(string_length), 1, (ll_THIS->_code)); } ll_define_primitive_end ll_define_primitive(_ir,__ir_emit_with_int,3,(ir,c,i), _0()) { long x = ll_unbox_fixnum(ll_ARGV[2]); ll_v i; ll_assert_msg(ir,x >= 0,("bad op argument value: %ld", (long) x)); ll_call(ll_o(__ir_emit), 2, (ll_SELF, ll_ARGV[1])); i = ll_call(ll_o(_ir_emit_pos), 1, (ll_SELF)); ll_call(ll_o(append_oneE), 2, (ll_THIS->_code, ll_make_char(x & 0xff))); ll_call(ll_o(append_oneE), 2, (ll_THIS->_code, ll_make_char((x >> 8) & 0xff))); ll_call(ll_o(append_oneE), 2, (ll_THIS->_code, ll_make_char((x >> 16) & 0xff))); ll_call(ll_o(append_oneE), 2, (ll_THIS->_code, ll_make_char((x >> 24) & 0xff))); ll_return(i); } ll_define_primitive_end ll_define_primitive(_ir,_ir_emit_with_int,3,(ir,c,i), _0()) { if ( ll_BC_EMIT_DEBUG ) { ll_v x = ll_ARGV[2]; if ( ll_EQ(ll_ARGV[1], ll_s(glo)) ) { x = ll_call(ll_o(vector_ref), 2, (ll_call(ll_o(_ir_globals), 1, (ll_SELF)), ll_ARGV[2])); } else if ( ll_EQ(ll_ARGV[1], ll_s(slot)) ) { x = ll_call(ll_o(vector_ref), 2, (ll_THIS->_consts, ll_ARGV[2])); } ll_format(ll_undef, "~O: emit: ~S : ~S ~S\n", 4, ll_SELF, ll_call(ll_o(_ir_emit_pos), 1, (ll_SELF)), ll_ARGV[1], x); } ll_tail_call(ll_o(__ir_emit_with_int), 3, (ll_SELF, ll_ARGV[1], ll_ARGV[2])); } ll_define_primitive_end ll_define_primitive(_ir,_ir_emit_constant,2,(ir,c), _0()) { ll_v i = ll_call(ll_o(_ir_const_index), 2, (ll_SELF, ll_ARGV[1])); if ( ll_BC_EMIT_DEBUG ) { ll_format(ll_undef, "~O: emit: ~S : '~S [~S]\n", 4, ll_SELF, ll_call(ll_o(_ir_emit_pos), 1, (ll_SELF)), ll_ARGV[1], i); } ll_tail_call(ll_o(__ir_emit_with_int), 3, (ll_SELF, ll_s(const), i)); } ll_define_primitive_end ll_define_primitive(_ir,_ir_emit_patch,3,(ir,ploc,dloc), _0()) { size_t i = ll_unbox_fixnum(ll_ARGV[1]); long x = ll_unbox_fixnum(ll_ARGV[2]); if ( ll_BC_EMIT_DEBUG ) { ll_format(ll_undef, "~O: emit-patch: ~S ~S : delta ~S\n", 4, ll_SELF, ll_ARGV[1], ll_ARGV[2], ll_make_fixnum(x)); } ll_call(ll_o(string_setE), 3, (ll_THIS->_code, ll_make_fixnum(i), ll_make_char(x & 0xff))); ll_call(ll_o(string_setE), 3, (ll_THIS->_code, ll_make_fixnum(i + 1), ll_make_char((x >> 8) & 0xff))); ll_call(ll_o(string_setE), 3, (ll_THIS->_code, ll_make_fixnum(i + 2), ll_make_char((x >> 16) & 0xff))); ll_tail_call(ll_o(string_setE), 3, (ll_THIS->_code, ll_make_fixnum(i + 3), ll_make_char((x >> 24) & 0xff))); } ll_define_primitive_end ll_define_primitive(_ir,_ir_emit_patch_relative,3,(ir,ploc,dloc), _0()) { size_t i = ll_unbox_fixnum(ll_ARGV[1]); long x = ll_unbox_fixnum(ll_ARGV[2]) - (i + 4); ll_tail_call(ll_o(_ir_emit_patch), 3, (ll_SELF, ll_ARGV[1], ll_make_fixnum(x))); } ll_define_primitive_end #undef IR /**********************************************************************/ /* 1st pass: ** 1. Translate (%method ( . ) . ) into ir. ** 2. Determine variable scope. ** 3. Allocate locals. */ ll_define_primitive(_ir,_ir_compile1_body,1,(ir), _0()) { ll_v newbody = ll_nil, *n = &newbody; ll_LIST_LOOP(ll_THIS->_body, x); { /* ** Remember the number of locals for us here since ** each car-pos lambda can share parts of the local variable space. */ ll_v n_locals_save = ll_THIS->_n_locals; *n = ll_cons(ll_call(ll_o(_ir_compile1), 3, (x, ll_SELF, ll_f)), ll_nil); n = &ll_CDR(*n); ll_THIS->_n_locals = n_locals_save; ll_write_barrier_SELF(); } ll_LIST_LOOP_END; ll_THIS->_body = newbody; ll_write_barrier_SELF(); } ll_define_primitive_end #define SELF ll_SELF #define IR ll_ARGV[1] #define CAR_POSQ ll_ARGV[2] ll_define_primitive(constant,_ir_compile1,3,(self,ir,car_posQ), _0()) { ll_assert_ref(IR); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(_ir,_ir_compile1,3,(self,ir,car_posQ), _0()) { ll_assert_ref(IR); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(symbol,_ir_compile1,3,(self,ir,car_posQ), _0()) { ll_assert_ref(IR); /* induce variable scoping */ ll_call(ll_o(_ir_var_scope), 2, (IR, SELF)); ll_return(ll_SELF); } ll_define_primitive_end /* R5RS 5.2.2. Internal Definitions */ static ll_v _ll_scan_for_body_defines(ll_v body) { #define APPEND_BEGIN(x) ll_v x = ll_nil, *x##p = &x #define APPEND(x,V) (x##p = &ll_CDR(*x##p = ll_cons((V), ll_nil))) APPEND_BEGIN(vars); APPEND_BEGIN(inits); APPEND_BEGIN(sets); /* Scan for beginning (define ...) forms */ ll_LIST_LOOP(body, x); { /* Is it a (define ) form? */ if ( ll_pairQ(x) && ll_eqQ(ll_car(x), ll_s(define)) ) { ll_v var = ll_cadr(x); ll_v init = ll_caddr(x); ll_v set = ll_listn(3, ll_s(setE), var, init); if ( 0 ) { ll_format(ll_undef, "body define: (define ~S ~S)\n", 2, var, init); } APPEND(vars, var); APPEND(inits, ll_undef); APPEND(sets, set); /* Skip it in the body */ body = ll_cdr(body); } else { /* Stop scanning for (define ...) */ break; } } ll_LIST_LOOP_END; #undef APPEND_BEGIN #undef APPEND /* Did we get any (define ...)? */ if ( ! ll_nullQ(vars) ) { ll_v x; /* (lambda (define ) ... . (lambda (letrec (( ) ...) . )) */ /* Put the real body after the set! expressions */ *setsp = body; x = ll_cons(ll_cons(ll_s(lambda), ll_cons(vars, sets)), inits); /* The new body is a letrec */ body = ll_cons(x, ll_nil); if ( 0 ) { ll_format(ll_undef, "body defines=~S\n", 1, body); } } return body; } ll_define_primitive(pair,_ir_compile1,3,(self,ir,car_posQ), _0()) { ll_v car = ll_THIS->_car; ll_v x = ll_THIS->_cdr; ll_v expr; ll_assert_ref(IR); if ( 0 ) { ll_call(ll_o(print_frame), 1, (ll_AR)); } // ll_format(ll_undef, "%ir-compile1 ~S\n", 1, ll_SELF); /* Handle special forms. */ if ( ll_EQ(car, ll_s(quote)) ) { /* (quote ...) */ expr = ll_SELF; } else if ( ll_EQ(car, ll_s(_make_locative)) ) { /* (%make-locative (quote )) */ ll_v var = ll_car(ll_cdr(ll_car(x))); if ( ll_unbox_boolean(ll_call(ll_o(symbolQ), 1, (var))) ) { /* Mark the var as closed over, because we need a locative */ ll_call(ll_o(_ir_var_scope), 3, (IR, var, ll_t)); } else { _ll_error(ll_ee(syntax), 1, ll_s(form), ll_SELF); } ll_assert_ref(IR); expr = ll_SELF; } else if ( ll_EQ(car, ll_s(lambda)) ) { /* (lambda . ) -> (%add-method (make ) (%method () . )) */ ll_v slots = ll_nil; ll_v formals = ll_car(x); ll_v body = ll_cdr(x); ll_v newir; body = _ll_scan_for_body_defines(body); newir = ll_call(ll_o(make), 6, (ll_type(_ir), body, formals, slots, IR, CAR_POSQ)); ll_assert_ref(IR); /* ** If the lambda is in car-position. it will be inlined into the enclosing ** ir's code vector. */ if ( ll_unbox_boolean(CAR_POSQ) ) { expr = newir; } else { /* Rewrite */ /* (lambda . ) -> (%add-method (make ) <%ir>) */ expr = ll_cons(ll_s(_add_method), ll_cons(ll_s(LTobjectGT), ll_cons(ll_cons(ll_s(make), ll_cons(ll_s(LToperationGT), ll_nil)), ll_cons(newir, ll_nil)))); ll_assert_ref(IR); /* Recompile */ expr = ll_call(ll_o(_ir_compile1), 3, (expr, IR, CAR_POSQ)); ll_assert_ref(IR); } } else if ( ll_EQ(car, ll_s(_method)) ) { /* (%method ( . ) . ) */ ll_v fa = ll_car(x); ll_v body = ll_cdr(x); ll_v formals = ll_car(fa); ll_v slots = ll_cdr(fa); ll_v newir; body = _ll_scan_for_body_defines(body); ll_assert_ref(IR); /* method constructors are never car-pos */ newir = ll_call(ll_o(make), 6, (ll_type(_ir), body, formals, slots, IR, ll_f)); ll_assert_ref(IR); expr = newir; } else { /* ( . ) */ ll_v prefix = ll_undef; ll_v *n = &expr; ll_v op_in_car_pos = ll_t, args_in_car_pos = ll_f; int op_is_constant = 0; x = ll_SELF; if ( ll_EQ(car, ll_s(setE)) || ll_EQ(car, ll_s(define)) ) { /* (set! ) */ /* (define ??) */ ll_v var = ll_car(ll_cdr(x)); if ( 0 ) { ll_format(ll_undef, "scope: (~S ~S ...)\n", 2, car, var); } if ( ll_unbox_boolean(ll_call(ll_o(symbolQ), 1, (var))) ) { /* Close over the var. */ ll_call(ll_o(_ir_var_scope), 3, (IR, var, ll_t)); ll_assert_ref(IR); op_is_constant = 1; op_in_car_pos = ll_f; /* Use ({set!|define} ...) literally */ prefix = car; } else { _ll_error(ll_ee(syntax), 1, ll_s(form), ll_SELF); } } else if ( ll_EQ(car, ll_s(if)) ) { /* If: (if ) is in car-pos ** Then: is not car_pos, but and are! */ op_in_car_pos = ll_f; args_in_car_pos = CAR_POSQ; /* Use (if ...) literally */ prefix = car; } else if ( ll_EQ(car, ll_s(super)) ) { /* (super (|#f) . ) */ /* Use (super ...) literally */ prefix = ll_s(super); } /* Handle prefix. */ if ( ll_NE(prefix, ll_undef) ) { *n = ll_cons(prefix, ll_nil); n = &ll_CDR(*n); x = ll_cdr(x); } ll_assert_ref(IR); /* is in car-position */ { ll_v op = ll_car(x); if ( op_is_constant ) { if ( 0 ) { ll_format(ll_undef, "op-constant: ~S\n", 1, op); } } else { op = ll_call(ll_o(_ir_compile1), 3, (op, IR, op_in_car_pos)); } *n = ll_cons(op, ll_nil); n = &ll_CDR(*n); x = ll_cdr(x); ll_assert_ref(IR); } /* might be in car-position */ ll_LIST_LOOP(x, q); { ll_v qc1 = ll_call(ll_o(_ir_compile1), 3, (q, IR, args_in_car_pos)); *n = ll_cons(qc1, ll_nil); n = &ll_CDR(*n); ll_assert_ref(IR); } ll_LIST_LOOP_END; } ll_return(expr); } ll_define_primitive_end #undef CAR_POSQ /**********************************************************************/ /* ** 2nd pass: ** 1. fold constants. ** 2. emit code. */ /**********************************************************************/ ll_define_primitive(object,_ir_compile2_debug_expr,2,(self,ir), _0()) { ll_assert_ref(IR); /* NOTHING */ } ll_define_primitive_end ll_define_primitive(pair,_ir_compile2_debug_expr,2,(self,ir), _0()) { ll_assert_ref(IR); ll_call(ll_o(_ir_emit_constant), 2, (IR, ll_SELF)); ll_call(ll_o(_ir_emit), 2, (IR, ll_s(_bcCdebug_expr))); ll_tail_call(ll_o(_ir_emit), 2, (IR, ll_s(pop))); } ll_define_primitive_end ll_define_primitive(_ir,_ir_compile2_debug_expr,2,(self,ir), _0()) { ll_v expr; ll_assert_ref(IR); expr = ll_cons(ll_s(closure), ll_cons(ll_THIS->_formals, ll_THIS->_body)); ll_call(ll_o(_ir_emit_constant), 2, (IR, expr)); ll_call(ll_o(_ir_emit), 2, (IR, ll_s(_bcCdebug_expr))); ll_tail_call(ll_o(_ir_emit), 2, (IR, ll_s(pop))); } ll_define_primitive_end /**********************************************************************/ #define CAR_POSQ ll_THIS_ISA(_ir, IR)->_car_posQ #define TAIL_POSQ ll_ARGV[2] ll_define_primitive(constant,_ir_compile2,3,(self,ir,tail_posQ), _0()) { ll_assert_ref(IR); ll_call(ll_o(_ir_emit_constant), 2, (IR, SELF)); if ( ll_unbox_boolean(TAIL_POSQ) ) { ll_tail_call(ll_o(_ir_emit), 2, (IR, ll_s(rtn))); } } ll_define_primitive_end /* ** Compile into code to generate a value for an exports vector. */ ll_define_primitive(pair,_ir_compile2_export,2,(self,ir), _0()) { ll_v x = ll_SELF; ll_v var = ll_car(x); ll_v type = var_type(x); ll_v index = var_index(x); ll_v co = var_closed_overQ(x); ll_assert_ref(IR); /* slot ref */ if ( ll_EQ(type, ll_s(slot)) ) { /* Create a const containing the global var name */ index = ll_call(ll_o(_ir_const_index), 2, (IR, var)); } else if ( ll_EQ(type, ll_s(glo)) ) { abort(); } /* undef export is a local from a car-pos sub lambda */ if ( ll_EQ(type, ll_undef) ) { ll_tail_call(ll_o(_ir_compile2), 3, (ll_undef, IR, ll_f)); } else { if ( ll_unbox_boolean(index) ) { ll_call(ll_o(_ir_emit_with_int), 3, (IR, type, index)); } else { ll_call(ll_o(_ir_emit), 2, (IR, type)); } /* ** arg and local values are stored directly into the exports vector. ** so put the value, not a locative to the arg or local in the exports vector. */ if ( ll_EQ(type, ll_s(arg)) || ll_EQ(type, ll_s(local)) ) { ll_tail_call(ll_o(_ir_emit), 2, (IR, ll_s(contents))); } } } ll_define_primitive_end void _ll_gdb_stop_at() { } /* ** Compiles a symbol into an instruction that generates a locative. ** to the variable. */ ll_define_primitive(symbol,_ir_compile2_loc,3,(self,ir,tail_posQ), _0()) { ll_v x = ll_call(ll_o(_ir_var_scope), 2, (IR, SELF)); ll_v var = SELF; ll_v type = var_type(x); ll_v index = var_index(x); ll_v co = var_closed_overQ(x); _ll_gdb_stop_at(); if ( 0 ) { ll_format(ll_undef, "~O: compile2-loc: ~S\n", 2, IR, x); } ll_assert_ref(IR); /* If it's closed over */ if ( ll_unbox_boolean(co) ) { /* Get the locative to the exports[slots] value */ ll_call(ll_o(_ir_emit_with_int), 3, (IR, ll_s(export), co)); /* ** If the closed-over variable is an argument or a local ** the value is stored directly in the exported environment ** vector. */ if ( ! (ll_EQ(type, ll_s(arg)) || ll_EQ(type, ll_s(local))) ) { ll_call(ll_o(_ir_emit), 2, (IR, ll_s(contents))); } } /* slot ref */ else if ( ll_EQ(type, ll_s(slot)) ) { /* Create a const containing the slot name */ index = ll_call(ll_o(_ir_const_index), 2, (IR, var)); /* Emit code to create locative to slot. */ ll_call(ll_o(_ir_emit_with_int), 3, (IR, type, index)); } /* glo ref */ else if ( ll_EQ(type, ll_s(glo)) ) { ll_call(ll_o(_ir_emit_with_int), 3, (IR, type, index)); ll_call(ll_o(_ir_emit), 2, (IR, ll_s(glo_loc))); } else { /* * ref */ if ( ll_unbox_boolean(index) ) { ll_call(ll_o(_ir_emit_with_int), 3, (IR, type, index)); } else { ll_call(ll_o(_ir_emit), 2, (IR, type)); } } if ( ll_unbox_boolean(TAIL_POSQ) ) { ll_tail_call(ll_o(_ir_emit), 2, (IR, ll_s(rtn))); } } ll_define_primitive_end ll_define_primitive(symbol,_ir_compile2_setE,3,(self,ir,tail_posQ), _0()) { ll_v x = ll_call(ll_o(_ir_var_scope), 2, (IR, SELF)); ll_v type = var_type(x); ll_assert_ref(IR); /* glo ref */ if ( ll_EQ(type, ll_s(glo)) ) { ll_v index = var_index(x); ll_call(ll_o(_ir_emit_with_int), 3, (IR, type, index)); ll_call(ll_o(_ir_emit), 2, (IR, ll_s(glo_set))); } else { /* ** 1. Compile code to create a locative to on the stack, ** 2. Compile code to set the value of the locative on the stack. */ ll_call(ll_o(_ir_compile2_loc), 3, (SELF, IR, ll_f)); ll_call(ll_o(_ir_emit), 2, (IR, ll_s(set_contents))); } /* ** If we are a tail-pos (set! ...) expression, ** emit code to return an unspecified value. */ if ( ll_unbox_boolean(TAIL_POSQ) ) { ll_tail_call(ll_o(_ir_emit), 2, (IR, ll_s(rtn))); } } ll_define_primitive_end ll_define_primitive(symbol,_ir_compile2,3,(self,ir,tail_posQ), _0()) { ll_v x = ll_call(ll_o(_ir_var_scope), 2, (IR, SELF)); ll_v type = var_type(x); ll_assert_ref(IR); if ( 0 ) { ll_BC_EMIT_DEBUG ++; } /* glo ref */ if ( ll_EQ(type, ll_s(glo)) ) { ll_v index = var_index(x); ll_call(ll_o(_ir_emit_with_int), 3, (IR, type, index)); ll_call(ll_o(_ir_emit), 2, (IR, ll_s(glo_get))); } else { /* ** 1. Compile code to create a locative to on the stack, ** 2. Compile code to get the value of the locative on the stack. */ ll_call(ll_o(_ir_compile2_loc), 3, (SELF, IR, ll_f)); ll_call(ll_o(_ir_emit), 2, (IR, ll_s(contents))); } /* Compile code to return if this is tail pos. */ if ( ll_unbox_boolean(TAIL_POSQ) ) { ll_call(ll_o(_ir_emit), 2, (IR, ll_s(rtn))); } if ( 0 ) { ll_BC_EMIT_DEBUG --; } } ll_define_primitive_end ll_define_primitive(list,_ir_compile2_body,3,(body,ir,tail_posQ), _0()) { ll_v x = ll_SELF; ll_assert_ref(IR); if ( ll_nullQ(x) ) { /* (lambda ) => (lambda (if #f #f)) */ ll_tail_call(ll_o(_ir_compile2), 3, (ll_unspec, IR, TAIL_POSQ)); } else { /* Compile the first body sexprs as non tail-pos */ ll_v x_cdr, e; int found_docstring = 0; x_cdr = ll_cdr(x); while ( ! ll_nullQ(x_cdr) ) { e = ll_car(x); if ( 0 ) { ll_format(ll_undef, "~O: compile2-body: ~S\n", 2, IR, e); } /* The first non-tail body string is documentation. */ if ( ! found_docstring && ll_unbox_boolean(ll_call(ll_o(stringQ), 1, (e))) ) { found_docstring ++; ll_call(ll_o(_ir_set_propE), 3, (IR, ll_s(doc), e)); } else if ( ll_unbox_boolean(ll_call(ll_o(constantQ), 1, (e))) ) { /* A non-tail body constant is ignored. */ } else { #ifndef DEBUG_EXPR #define DEBUG_EXPR 1 #endif if ( DEBUG_EXPR ) { ll_call(ll_o(_ir_compile2_debug_expr), 2, (e, IR)); } /* Must be a regular expression. */ ll_call(ll_o(_ir_compile2), 3, (e, IR, ll_f)); /* Discard each non tail-pos result */ ll_call(ll_o(_ir_emit), 2, (IR, ll_s(pop))); } x = x_cdr; x_cdr = ll_cdr(x_cdr); } /* Compile the last body sexpr as tail-pos */ e = ll_car(x); if ( DEBUG_EXPR ) { ll_call(ll_o(_ir_compile2_debug_expr), 2, (e, IR)); } ll_tail_call(ll_o(_ir_compile2), 3, (e, IR, TAIL_POSQ)); } } ll_define_primitive_end ll_define_primitive(_ir,_ir_compile2_body,3,(self,ir,tail_posQ), _0()) { /* ** If we are not car-pos lambda ** our tail body expr is always tail-pos. ** E.g.: (lambda (foo) (outer-lambda) (not-tail-pos) (lambda (bar) (this-lambda) (not-tail-pos) (tail-pos) )) ** If we are car-pos, ** our tail body expr is tail-pos only if we are tail-pos. ** E.g.: (lambda (foo) (outer-lambda) (not-tail-pos) ((lambda (bar) (not-tail-pos) (tail-pos) ) 'bar-value) ) */ ll_assert_ref(IR); if ( ! ll_unbox_boolean(ll_THIS->_car_posQ) ) { TAIL_POSQ = ll_t; #if 0 /* Compile our body in our own code context */ ll_THIS->_code = ll_call(ll_o(make), 1, (ll_type(string))); ll_write_barrier_SELF(); #endif { ll_v car; if ( ! ll_nullQ(ll_THIS->_body) && ll_pairQ(car = ll_car(ll_THIS->_body)) && ((car = ll_car(car)), ll_EQ(car, ll_s(_bcCdebug)) || ll_EQ(car, ll_s(_bcCdebug_off))) ) { /* (%bc:debug ) */ ll_call(ll_o(_ir_emit), 2, (IR, car)); ll_call(ll_o(_ir_emit), 2, (IR, ll_s(pop))); } } /* Emit stack probe code. */ ll_THIS->_probe_pos = ll_call(ll_o(_ir_emit_with_int), 3, (ll_SELF, ll_s(probe), ll_BOX_fixnum(0))); /* Emit local save code */ if ( ll_unbox_fixnum(ll_THIS->_max_n_locals) > 0 ) { ll_call(ll_o(_ir_emit_with_int), 3, (ll_SELF, ll_s(locals), ll_THIS->_max_n_locals)); } if ( ll_unbox_boolean(ll_THIS->_rest_argQ) ) { /* Emit rest-arg code */ ll_v var; var = ll_assq(ll_THIS->_rest_argQ, ll_THIS->_scope); if ( ll_unbox_boolean(var_referencedQ(var)) ) { /* Code to check no of args and push a list of args on the stack */ ll_call(ll_o(_ir_emit_with_int), 3, (ll_SELF, ll_s(nargs_rest), ll_THIS->_argc)); /* Code to set the rest-arg cell */ ll_call(ll_o(_ir_compile2_setE), 3, (ll_THIS->_rest_argQ, ll_SELF, ll_f)); /* Pop set! result. */ ll_call(ll_o(_ir_emit), 2, (ll_SELF, ll_s(pop))); } else { /* Code to check no of args */ ll_call(ll_o(_ir_emit_with_int), 3, (ll_SELF, ll_s(nargs_rest_), ll_THIS->_argc)); } } else { /* Emit arg check */ ll_call(ll_o(_ir_emit_with_int), 3, (ll_SELF, ll_s(nargs), ll_THIS->_argc)); } /* Emit exported environment code */ if ( ! ll_nullQ(ll_THIS->_env) ) { /* The environment list is in reverse environment index order. */ /* We push the environment values on the stack in order. */ ll_LIST_LOOP(ll_THIS->_env, x); { if ( ll_BC_EMIT_DEBUG ) { ll_format(ll_undef, " ~O create-env ~S\n", 2, ll_SELF, x); } ll_call(ll_o(_ir_compile2_export), 2, (x, ll_SELF)); } ll_LIST_LOOP_END; ll_call(ll_o(_ir_emit_with_int), 3, (ll_SELF, ll_s(make_exports), ll_THIS->_env_length)); } } /* Compile our body exprs */ ll_call(ll_o(_ir_compile2_body), 3, (ll_THIS->_body, IR, TAIL_POSQ)); /* Backpatch stack probe code */ if ( ! ll_unbox_boolean(ll_THIS->_car_posQ) ) { int max_stack_depth; max_stack_depth = _ll_bc_max_stack_depth(ll_THIS_ISA(string, ll_THIS->_code)->_array); // fprintf(stderr, "ll: bc: max_stack_depth %d\n", max_stack_depth); max_stack_depth += 2; ll_call(ll_o(_ir_emit_patch), 3, (ll_SELF, ll_THIS->_probe_pos, ll_make_fixnum(max_stack_depth))); } } ll_define_primitive_end ll_define_primitive(_ir,_ir_compile2,3,(self,ir,tail_posQ), _0()) { ll_assert_ref(IR); /* self is the child ir, ir is the parent ir. */ /* Child's body is compiled in its own context. */ /* Code to generate child is compile in parent context. */ /* Compile the child's body */ ll_call(ll_o(_ir_compile2_body), 3, (ll_SELF, ll_SELF, TAIL_POSQ)); /* ** If the child is not car-pos, create code to make the child's method. ** If the child is car-pos, it's code has been inlined in parent method. */ if ( ! ll_unbox_boolean(ll_THIS->_car_posQ) ) { /* Store the compiled code as a const */ ll_v new_code = ll_THIS->_code; ll_v make_method = ll_s(make_method); /* Emit code in parent to create the method */ /* Does this method need an environment? ask the parent to give to us */ if ( ! ll_nullQ(ll_THIS->_imports) ) { ll_call(ll_o(_ir_emit), 2, (IR, ll_s(exports))); make_method = ll_s(make_method_env); } /* Push the child's properties on the stack. */ ll_call(ll_o(_ir_emit_constant), 2, (IR, ll_THIS->_props)); /* Push the child's code vector on the stack */ ll_call(ll_o(_ir_emit_constant), 2, (IR, new_code)); /* Emit code in the parent to create the child's method */ ll_call(ll_o(_ir_emit), 2, (IR, make_method)); } } ll_define_primitive_end ll_define_primitive(pair,_ir_compile2,3,(self,ir,tail_posQ), _0()) { ll_v car = ll_THIS->_car; ll_v x = ll_THIS->_cdr; int length = ll_unbox_fixnum(ll_call(ll_o(length), 1, (ll_SELF))); int tail_posQ = ll_unbox_boolean(TAIL_POSQ); ll_assert_ref(IR); // ll_format(ll_undef, "%ir-compile2 ~S\n", 1, ll_SELF); if ( ll_EQ(car, ll_s(quote)) ) { /* (quote ) */ emit_constant: ll_call(ll_o(_ir_emit_constant), 2, (IR, ll_car(x))); if ( tail_posQ ) { ll_tail_call(ll_o(_ir_emit), 2, (IR, ll_s(rtn))); } } else if ( ll_EQ(car, ll_s(_make_locative)) ) { /* (%make-locative (quote )) */ ll_v var = ll_car(ll_cdr(ll_car(x))); /* Compile the locative expression */ ll_tail_call(ll_o(_ir_compile2_loc), 3, (var, IR, TAIL_POSQ)); } else if ( ll_EQ(car, ll_s(setE)) ) { /* (set! ) */ if ( 0 ) { ll_BC_EMIT_DEBUG = 1; } ll_v var = ll_car(x); ll_v value = ll_car(ll_cdr(x)); /* Compile the value expression */ ll_call(ll_o(_ir_compile2), 3, (value, IR, ll_f)); /* Compile the locative expression */ ll_tail_call(ll_o(_ir_compile2_setE), 3, (var, IR, TAIL_POSQ)); } else if ( ll_EQ(car, ll_s(define)) ) { /* (define ...) */ ll_v var = ll_car(x); ll_v values = ll_cdr(x); ll_v value = ll_car(values); ll_v b = ll_call(ll_o(_ir_var_scope), 2, (IR, var)); /* If is global, rewrite as: ** (%define ' ...) */ if ( ll_EQ(var_type(b), ll_s(glo)) ) { x = ll_cons(ll_s(_define), ll_cons(ll_quote(var), values)); ll_tail_call(ll_o(_ir_compile2), 3, (x, IR, TAIL_POSQ)); } else { /* Compile the value expression */ ll_call(ll_o(_ir_compile2), 3, (value, IR, ll_f)); /* Compile the locative expression */ ll_tail_call(ll_o(_ir_compile2_setE), 3, (var, IR, TAIL_POSQ)); } } else if ( ll_EQ(car, ll_s(if)) ) { /* (if []) */ ll_v pred, true_expr, false_expr; pred = ll_car(x); x = ll_cdr(x); true_expr = ll_car(x); x = ll_cdr(x); false_expr = ll_nullQ(x) ? ll_unspec : ll_car(x); if ( ll_unbox_boolean(ll_call(ll_o(_ir_constantQ), 2, (pred, IR))) ) { pred = ll_call(ll_o(eval), 1, (pred)); if ( ll_unbox_boolean(pred) ) { /* Compile true branch */ ll_call(ll_o(_ir_compile2), 3, (true_expr, IR, TAIL_POSQ)); } else { /* Compile false branch */ ll_call(ll_o(_ir_compile2), 3, (false_expr, IR, TAIL_POSQ)); } } else { ll_v ifpos, jmppos, falsepos, endpos; /* Compile predicate */ ll_call(ll_o(_ir_compile2), 3, (pred, IR, ll_f)); /* Emit jf ins */ ifpos = ll_call(ll_o(_ir_emit_with_int), 3, (IR, ll_s(jf), ll_make_fixnum(0))); /* Compile true branch */ ll_call(ll_o(_ir_compile2), 3, (true_expr, IR, TAIL_POSQ)); if ( ! tail_posQ ) { /* Emit jmp ins to after false branch */ /* Don't bother if tail_pos because true branch will return immediately. */ jmppos = ll_call(ll_o(_ir_emit_with_int), 3, (IR, ll_s(jmp), ll_make_fixnum(0))); } /* false branch begins here. */ falsepos = ll_call(ll_o(_ir_emit_pos), 1, (IR)); /* Compile false branch */ ll_call(ll_o(_ir_compile2), 3, (false_expr, IR, TAIL_POSQ)); /* Find the end of the false branch */ endpos = ll_call(ll_o(_ir_emit_pos), 1, (IR)); /* Patch jf, jmp */ ll_call(ll_o(_ir_emit_patch_relative), 3, (IR, ifpos, falsepos)); if ( ! tail_posQ ) { /* Don't bother patching, jmppos because it wasn't emited. */ ll_call(ll_o(_ir_emit_patch_relative), 3, (IR, jmppos, endpos)); } } ll_return(ll_SELF); } else if ( ll_EQ(car, ll_s(_method)) ) { /* (%method ( . ) . ) */ ll_return(IR); } else { /* ( . ) */ /* Is op a car-pos lambda? */ if ( ll_unbox_boolean(ll_call(ll_o(_irQ), 1, (car))) ) { ll_v car_ir = car; ll_v formals = ll_call(ll_o(_ir_formals), 1, (car_ir)); ll_v args = x; ll_v body = ll_call(ll_o(_ir_body), 1, (car_ir)); if ( 0 ) { ll_format(ll_undef, "%ir: car-pos-lambda\n\tformals ~S\n\t", 1, ll_SELF); } /* is a car-pos lambda */ /* ((lambda . ) . ) */ /* Do args in reverse order, storing results in locals */ ll_call(ll_o(_ir_compile2_carpos_args), 4, (formals, IR, args, car_ir)); /* Compile the car_ir's body inline, in the car_ir's context */ ll_call(ll_o(_ir_compile2_body), 3, (body, car_ir, TAIL_POSQ)); } else { ll_v call; if ( ll_EQ(car, ll_s(super)) ) { /* (super . ) */ call = tail_posQ ? ll_s(tail_call_super) : ll_s(call_super); /* The stack will be . */ /* We will pop and then call _ll_call_superv(,,ARGC). Therefore the value is not really a part of the arg list. */ //length --; //ll_assert(ir,length >= 0); x = ll_THIS->_cdr; } else { call = tail_posQ ? ll_s(tail_call) : ll_s(call); x = ll_SELF; } /* Emit code for special ops. */ if ( ll_EQ(car, ll_s(_bcCdebug)) || ll_EQ(car, ll_s(_bcCdebug_off)) || ll_EQ(car, ll_s(_bcCdebug_expr)) ) { ll_call(ll_o(_ir_emit), 2, (IR, car)); } else { /* Emit code for . in reverse order, storing results on stack */ ll_call(ll_o(_ir_compile2_args), 4, (x, IR, ll_f, ll_f)); /* Emit call or tail-call */ ll_call(ll_o(_ir_emit_with_int), 3, (IR, call, ll_make_fixnum(length - 1))); } } } ll_return(ll_SELF); } ll_define_primitive_end /* Emit code for argument list in reverse order */ ll_define_primitive(null,_ir_compile2_args,4,(self,ir,tail_posQ,pop), _1(no_side_effect,"#t")) { ll_assert_ref(IR); } ll_define_primitive_end ll_define_primitive(pair,_ir_compile2_args,4,(self,ir,tail_posQ,pop), _0()) { ll_assert_ref(IR); ll_call(ll_o(_ir_compile2_args), 4, (ll_THIS->_cdr, ll_ARGV[1], ll_ARGV[2], ll_ARGV[3])); ll_call(ll_o(_ir_compile2), 3, (ll_THIS->_car, ll_ARGV[1], ll_ARGV[2])); if ( ll_unbox_boolean(ll_ARGV[3]) ) { ll_tail_call(ll_o(_ir_emit), 2, (IR, ll_s(pop))); } } ll_define_primitive_end /****************************/ #define FORMALS ll_ARGV[0] #define ARGS ll_ARGV[2] #define CAR_IR ll_ARGV[3] ll_define_primitive(null,_ir_compile2_carpos_args,4,(formals,ir,args,car_ir), _1(no_side_effect,"#t")) { ll_assert_ref(IR); if ( ! ll_nullQ(ARGS) ) { ll_return(_ll_error(ll_ee(argument), 1, ll_s(nargs), ll_undef)); } } ll_define_primitive_end ll_define_primitive(symbol,_ir_compile2_carpos_args,4,(formals,ir,args,car_ir), _0()) { /* formals is the name of the rest arg */ ll_v varname, var; ll_assert_ref(IR); varname = FORMALS; var = ll_assq(varname, ll_call(ll_o(_ir_scope), 1, (CAR_IR))); if ( ll_unbox_boolean(var_referencedQ(var)) ) { /* Compile the argument expressions in reverse order */ ll_call(ll_o(_ir_compile2_args), 4, (ARGS, IR, ll_f, ll_f)); /* Emit isn to create a list from args */ ll_call(ll_o(_ir_emit_with_int), 3, (IR, ll_s(list), ll_call(ll_o(length), 1, (ARGS)))); /* Emit isn to set to the rest arg */ ll_tail_call(ll_o(_ir_compile2_setE), 3, (CAR_IR, varname, ll_f)); } else { /* Compile the argument expressions in reverse order, popping the results */ ll_tail_call(ll_o(_ir_compile2_args), 4, (ARGS, IR, ll_f, ll_t)); } } ll_define_primitive_end ll_define_primitive(pair,_ir_compile2_carpos_args,4,(formals,ir,args,car_ir), _0()) { ll_assert_ref(IR); /* Compile remaining argument expressions in reverse order */ ll_call(ll_o(_ir_compile2_carpos_args), 4, (ll_THIS->_cdr, IR, ll_cdr(ARGS), CAR_IR)); /* Do this one now */ { ll_v varname, var, value; varname = ll_THIS->_car; var = ll_assq(varname, ll_call(ll_o(_ir_scope), 1, (CAR_IR))); value = ll_car(ll_ARGV[2]); /* Compile the argument expressions in reverse order */ ll_call(ll_o(_ir_compile2), 3, (value, IR, ll_f)); if ( ll_unbox_boolean(var_referencedQ(var)) ) { /* Emit isn to create a locative to the rest arg */ ll_tail_call(ll_o(_ir_compile2_setE), 3, (varname, CAR_IR, ll_f)); } else { /* Emit pop result */ ll_tail_call(ll_o(_ir_emit), 2, (IR, ll_s(pop))); } } } ll_define_primitive_end #undef formals #undef args #undef car_ir /**********************************************************************/ ll_define_primitive(_ir,_ir_method,1,(ir),_0()) { ll_v meth = ll_undef; if ( ll_BC_EMIT_DEBUG > 1 ) { ll_format(ll_undef, "%ir-method: before compile2: (ir ~S)\n", 1, ll_SELF); } /* Do constant folding. */ if ( ! ll_unbox_boolean(ll_call(ll_o(property), 2, (IR, ll_s(no_const_folding)))) ) { //ll_format(ll_undef, "const folding ~S\n", 1, ll_THIS->_body); ll_call(ll_o(_ir_const_fold), 2, ((IR), (IR))); } else { //ll_format(ll_undef, "NO const folding ~S\n", 1, ll_THIS->_body); } /**********************************************************************/ /* Begin emiting code */ ll_call(ll_o(_ir_compile2_body), 3, (ll_SELF, ll_SELF, ll_t)); // abort(); if ( ll_BC_EMIT_DEBUG > 2 ) { ll_format(ll_undef, "%ir-method: after compile2: (ir ~S)\n", 1, ll_SELF); } // ll_DEBUG(trace) = ll_make_fixnum(1); /**********************************************************************/ /* Create a method for the byte-code */ meth = ll_call(ll_o(make), 4, (ll_type(byte_code_method), ll_THIS->_code, ll_THIS->_consts, ll_THIS->_props)); // ll_DEBUG(trace) = ll_make_fixnum(0); ll_return(meth); } ll_define_primitive_end ll_define_primitive(_ir,_ir_operation,1,(ir), _0()) { ll_v op, meth; op = ll_call(ll_o(make), 1, (ll_type(operation))); meth = ll_call(ll_o(_ir_method), 1, (ll_SELF)); ll_tail_call(ll_o(_add_method), 3, (ll_type(object), op, meth)); } ll_define_primitive_end /**********************************************************************/ ll0.13/src/ll/bcompile.h0100644000175200017560000000315406735677674015443 0ustar stephensstephens#ifndef _ll_BCOMPILE_H #define _ll_BCOMPILE_H /* A var scope binding is ** ** ( [arg|slot|env|glo] ) */ #define var_name(x) ll_car(x) /* The name of the binding */ #define var_type(x) ll_cadr(x) /* The type of binding: local a temporary value located on the stack. ll_ARGV[-var_index(x)] a non-closed over restarg or car-pos lambda's arguments are of this type of binding. arg an argument value located on the stack. ll_ARGV[var_index(x)] slot a slot value named var_name(x). exp a value in our exported environment vector. exp[var_index(x)] closed-over arguments and restargs are placed in the exported environment by the lambda's preamble. env a value located directly in our imported environment vector. env[var_index(x)] arguments from a parent lambda that are closed-over are located directly in the exported environment vector. env-loc a value referenced by a locative in our imported environment vector. *env[var_index(x)] glo a global value named var_name(x). */ #define var_index(x) ll_caddr(x) #define set_var_index(x,y) ll_set_caddrE(x,y) /* The location of the binding: ** For a arg type: the index is off the frame pointer, for a exp or env type the index is off the exported or emported environment vector. */ #define var_closed_overQ(x) ll_cadddr(x) #define set_var_closed_overQ(x,y) ll_set_cadddrE(x,y) /* The position in our exports vector, #f if not closed-over */ #define var_referencedQ(x) ll_caddddr(x) #define set_var_referencedQ(x,y) ll_set_caddddrE(x,y) /* Is the variable referenced? */ #endif ll0.13/src/ll/binding.c0100744000175200017560000000630607230472653015236 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_binding_c__ #define __rcs_id_ll_binding_c__ static const char __rcs_id_ll_binding_c[] = "$Id: binding.c,v 1.8 2001/01/15 03:59:39 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /***********************************************************************/ ll_define_primitive(binding, initialize, 2, (binding, symbol), _0()) { ll_THIS->_symbol = ll_ARGV[1]; ll_THIS->_locative = ll_f; ll_THIS->_value = ll_undef; ll_THIS->_macro = ll_f; ll_THIS->_properties = ll_nil; ll_write_barrier_SELF(); ll_tail_call_super(ll_o(initialize), ll_f, 1, (ll_SELF)); } ll_define_primitive_end /**************************************************************************/ ll_define_primitive(binding, _write_shallow_contents, 2, (obj, port), _0()) { ll_format(ll_ARGV[1], "~S 'locative ~S 'macro ~S 'properties ~S", 4, ll_THIS->_symbol, ll_THIS->_locative, ll_THIS->_macro, ll_THIS->_properties); } ll_define_primitive_end /**************************************************************************/ ll_define_primitive(binding, binding_symbol, 1, (binding), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_symbol); } ll_define_primitive_end /**************************************************************************/ ll_define_primitive(binding, binding_value, 1, (binding), _1(no_side_effect,"#t")) { if ( ! ll_unbox_boolean(ll_THIS->_locative) ) { ll_return(_ll_undefined_variable_error(ll_THIS->_symbol)); } ll_return(*ll_unbox_locative(ll_THIS->_locative)); } ll_define_primitive_end ll_define_primitive(binding, set_binding_valueE, 2, (binding, value), _0()) { if ( ll_unbox_boolean(ll_call(ll_o(property), 2, (ll_SELF, ll_s(readonly)))) ) { /* IMPLEMENT: handle proper error */ ll_return(_ll_readonly_variable_error(ll_THIS->_symbol)); } if ( ! ll_unbox_boolean(ll_THIS->_locative) ) { ll_THIS->_locative = ll_make_locative(&ll_THIS->_value); ll_write_barrier_SELF(); } *ll_unbox_locative(ll_THIS->_locative) = ll_ARGV[1]; /* WRITE BARRIER */ } ll_define_primitive_end ll_define_primitive(binding, locative_binding_value, 1, (binding), _1(no_side_effect,"#t")) { if ( ! ll_unbox_boolean(ll_THIS->_locative) ) { ll_return(_ll_undefined_variable_error(ll_THIS->_symbol)); } if ( ll_unbox_boolean(ll_call(ll_o(property), 2, (ll_SELF, ll_s(readonly)))) ) { /* IMPLEMENT: handle proper error */ ll_return(_ll_readonly_variable_error(ll_THIS->_symbol)); } ll_return(ll_THIS->_locative); } ll_define_primitive_end /**************************************************************************/ ll_define_primitive(binding, binding_macro, 1, (binding), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_macro); } ll_define_primitive_end ll_define_primitive(binding, set_binding_macroE, 2, (binding, value), _0()) { ll_THIS->_macro = ll_ARGV[1]; ll_write_barrier_SELF(); } ll_define_primitive_end /**************************************************************************/ ll_define_primitive(binding, locative_properties, 1, (binding), _1(no_side_effect,"#t")) { ll_return(ll_make_locative(&ll_THIS->_properties)); } ll_define_primitive_end /**************************************************************************/ ll0.13/src/ll/bmethod.c0100764000175200017560000005043307623404277015253 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_bmethod_c__ #define __rcs_id_ll_bmethod_c__ static const char __rcs_id_ll_bmethod_c[] = "$Id: bmethod.c,v 1.28 2003/02/15 09:30:39 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "ll/config.h" #include "call_int.h" #include "bcode.h" #include #include "assert.h" #ifndef ll_BC_RUN_DEBUG int ll_BC_RUN_DEBUG = 0; #endif #ifndef ll_BC_DUMP int ll_BC_DUMP = 0; #endif /*******************************************************************/ /* The byte-code method interpreter */ typedef unsigned char bc_t; const char *_ll_bc_name(int bc) { static const char *__ll_bc_name[] = { "", #ifndef ll_bc_def #define ll_bc_def(X,NARGS,SM,NSA) #X, #include "ll/bcs.h" #endif "LAST", 0 }; if ( bc < 0 || bc >= (sizeof(__ll_bc_name)/sizeof(__ll_bc_name[0])) - 2 ) { static char buf[32]; sprintf(buf, "((ll_bc)%d)", bc); return buf; } return __ll_bc_name[bc]; } int _ll_bc_nargs(int bc) { static int __ll_bc_nargs[] = { 0, #ifndef ll_bc_def #define ll_bc_def(X,NARGS,SM,NSA) NARGS, #include "ll/bcs.h" #endif 0, }; if ( bc < 0 || bc >= (sizeof(__ll_bc_nargs)/sizeof(__ll_bc_nargs[0])) - 2 ) { return -1; } return __ll_bc_nargs[bc]; } #define GET_1() *(pc ++) #define GET_4() (pc+=4,(long)pc[-4]|((long)pc[-3]<<8)|((long)pc[-2]<<16)|((long)pc[-1]<<24)) #define maxnargs 4 int _ll_bc_get_args(bc_t **_bc, long args[]) { bc_t *pc = *_bc; int nargs; nargs = _ll_bc_nargs(GET_1()); { int i; ll_assert(bc,0 <= nargs && nargs < maxnargs); for ( i = 0; i < nargs; i ++ ) { args[i] = GET_4(); } } *_bc = pc; return nargs; } int _ll_bc_stack_motion(bc_t **_bc) { int bcode = **_bc; long args[maxnargs]; int nargs = _ll_bc_get_args(_bc, args); int sm = 0; #define ARG(X) args[X] switch ( bcode ) { case 0: break; #ifndef ll_bc_def #define ll_bc_def(N,NARGS,SM,NSA) case ll_bc_##N: sm = SM; break; #include "ll/bcs.h" #endif default: ll_assert_msg(bc,0,("bad bc %d", bcode)); } #undef ARG return sm; } int _ll_bc_max_stack_depth(bc_t *pc) { int depth = 0, max_depth = 0; while ( *pc ) { int sm = _ll_bc_stack_motion(&pc); depth += sm; ll_assert(bc,"depth >= 0"); if ( max_depth < depth ) max_depth = depth; } //fprintf(stderr, "_ll_bcs_max_stack_depth() = %ld\n", (long) max_depth); return max_depth; } int _ll_bc_nsa(bc_t **_bc) { int bcode = **_bc; long args[maxnargs]; int nargs = _ll_bc_get_args(_bc, args); int sm = 0; #define ARG(X) args[X] switch ( bcode ) { case 0: break; #ifndef ll_bc_def #define ll_bc_def(N,NARGS,SM,NSA) case ll_bc_##N: sm = NSA; break; #include "ll/bcs.h" #endif default: ll_assert_msg(bc,0,("bad bc %d", bcode)); } #undef ARG return sm; } /*******************************************************************/ static int prompt(const char *pr) { int c; int result = 0; char cmd[16]; again: fflush(stderr); fprintf(stderr, "\n %s Hit enter to continue, 'q' to stop tracing, 'd' to debug: ", pr); fflush(stderr); cmd[0] = '\0'; fgets(cmd, sizeof(cmd), stdin); switch ( cmd[0] ) { case 'q': case 'Q': case '\0': result = 1; break; case 'd': case 'D': ll_call(ll_o(debugger), 0, ()); goto again; break; default: break; } return result; } //#define CODE ((bc_t*) _ll_ptr_string(METH->_code)) #define CODE ((bc_t*) ll_THIS_ISA(string, METH->_code)->_array) #define _CONSTS METH->_consts #define CONSTS ll_THIS_ISA(vector, _CONSTS)->_array #define ll_V(X) (ll_THIS_ISA(vector,(X))->_array) int _ll_bc_dump(bc_t **_pc, int *stack_depth, ll_v meth, int show_stack_args) { bc_t *pc, *pc_save; int bcode; char buf[128], *bp = buf; long args[maxnargs]; int i, nargs; ll_v port = ll_undef; ll_v op_arg = ll_undef; #define METH ll_THIS_ISA(method,meth) pc = *_pc; if ( pc == 0 ) { pc = CODE; } pc_save = pc; bcode = *pc; sprintf(bp, "BC: %08p: %04u : %08p : %03d : %12s", (void*) ll_UNBOX_ref(METH->_code), pc - CODE, (void*) _ll_val_sp, stack_depth ? *stack_depth : 0, (const char*) _ll_bc_name(bcode)); bp = strchr(bp, '\0'); /* Print the code args. */ nargs = _ll_bc_get_args(&pc, args); for ( i = 0; i < nargs; i ++ ) { sprintf(bp, " %ld", (long) (args[i])); bp = strchr(bp, '\0'); } ll_write_string(port, buf, (size_t) -1); /* Get the symbolic opcode arguments */ if ( bcode == ll_bc_const ) { op_arg = CONSTS[args[0]]; } else if ( bcode == ll_bc_slot ) { op_arg = CONSTS[args[0]]; } else if ( bcode == ll_bc_glo ) { op_arg = ll_V(CONSTS[0])[args[0]]; } else if ( bcode == ll_bc_glo_ ) { op_arg = ll_V(CONSTS[1])[args[0]]; } else if ( bcode == ll_bc_jf || bcode == ll_bc_jmp ) { long offset = (pc - CODE) + args[0]; op_arg = ll_BOX_fixnum(offset); } if ( stack_depth ) { bc_t *tmp = pc_save; *stack_depth += _ll_bc_stack_motion(&tmp); } if ( show_stack_args ) { /* Print stack args. */ nargs = _ll_bc_nsa(&pc_save); ll_write_string(port, "\t|", 2); for ( i = 0; i < nargs; i ++ ) { ll_format(port, " ~O", 1, _ll_val_sp[i]); } } /* Print the opcode arguments */ if ( ll_NE(op_arg, ll_undef) ) { ll_format(port, " [~O]", 1, op_arg); } ll_write_string(port, "\n", 1); *_pc = pc; #undef METH return bcode; } /********************************************************************/ ll_define_primitive(byte_code_method, _dump, 1, (bmeth), _0()) { #define METH ll_THIS_ISA(method, ll_SELF) int lines = 0; int stack_depth = 0; bc_t *pc = 0; ll_format(ll_undef, "\nBC: method ~W: consts ~S\n", 2, ll_SELF, _CONSTS); do { int bcode; lines ++; if ( lines > 24 ) { if ( prompt("BC: dump: ") ) break; lines = 0; } bcode = _ll_bc_dump(&pc, &stack_depth, ll_SELF, 0); if ( bcode == 0 ) break; } while ( 1 ); prompt("BC: dump DONE: "); #undef METH } ll_define_primitive_end /*******************************************************************/ /* Find the offset of slot s in type t */ static int _ll_slot_offset(ll_v t, ll_v s) { if ( 0 ) { ll_format(ll_undef, "_ll_slot_offset(~S, ~S) in ~S\n", 3, t, s, ll_THIS_ISA(type,t)->_slots); } ll_LIST_LOOP(ll_THIS_ISA(type,t)->_slots, x); { ll_v slot_name = ll_car(x); if ( ll_EQ(slot_name, s) ) { ll_v st; if ( ll_BC_RUN_DEBUG ) { ll_format(ll_undef, "_ll_slot_offset(~S, ~S) => ~S\n", 3, t, s, x); } /* Does the slot have a specific type? */ if ( ! ll_nullQ(st = ll_cdr(ll_cdr(x))) ) { _ll_error(ll_ee(invalid_slot), 4, ll_s(reason), ll_s(bad_type), ll_s(type), t, ll_s(slot), s, ll_s(slot_type), st); return -1; } return ll_unbox_fixnum(ll_car(ll_cdr(x))); } } ll_LIST_LOOP_END; _ll_error(ll_ee(invalid_slot), 3, ll_s(reason), ll_s(not_found), ll_s(type), t, ll_s(slot), s); return -1; } /* Find the global binding for int x */ static ll_v _ll_global_binding(int index, ll_v *consts) { ll_v binding; //ll_format(ll_undef, "bc: global bindings = ~S\n", 1, consts[1]); if ( ! ll_unbox_boolean(binding = ll_V(consts[1])[index]) ) { //ll_format(ll_undef, "bc: global names = ~S\n", 1, consts[0]); ll_V(consts[1])[index] = binding = ll_call(ll_o(_binding_or_error), 2, (ll_call(ll_o(SenvironmentS), 0, ()), ll_V(consts[0])[index])); } return(binding); } /*******************************************************************/ #ifndef ll_BC_METER #define ll_BC_METER 1 #endif #if ll_BC_METER unsigned long _ll_bc_meter[_ll_bc_LAST + 1][_ll_bc_LAST]; /* ** _ll_bc_meter[0][0] => total bytecodes executed. ** _ll_bc_meter[0][x] => total x bytecodes executed. ** _ll_bc_meter[x + 1][y] => total x before y executed. ** _ll_bc_meter[1][y] => total y at beginning. ** _ll_bc_meter[x + 1][0] => total x at beginning. */ static void _ll_bc_meter_dump(FILE *file, int small) { int i, j; fprintf(file, "BC: METER 1.0\n"); if ( small ) { for ( i = 0; i < sizeof(_ll_bc_meter)/sizeof(_ll_bc_meter[0]); i ++ ) { fprintf(file, "%d %s\n", i, _ll_bc_name(i)); } fprintf(file, "%4s ", ""); for ( i = 0; i < sizeof(_ll_bc_meter[0])/sizeof(_ll_bc_meter[0][0]); i ++ ) { fprintf(file, "%4d ", i); } fprintf(file, "\n"); } for ( i = 0; i < sizeof(_ll_bc_meter)/sizeof(_ll_bc_meter[0]); i ++ ) { if ( small ) { fprintf(file, "%4d ", i); } for ( j = 0; j < sizeof(_ll_bc_meter[0])/sizeof(_ll_bc_meter[0][0]); j ++ ) { unsigned long x = _ll_bc_meter[i][j]; if ( small ) { const char *s; if ( x > 1000000 ) { x /= 100000; s = "M"; } else if ( x > 1000 ) { x /= 100; s = "K"; } else if ( x > 100 ) { x /= 10; s = "C"; } else if ( x > 10 ) { x /= 1; s = "D"; } else { x *= 10; s = " "; } fprintf(file, "%d.%d%s ", (int) x / 10, (int)x % 10, s); } else { fprintf(file, "%lu ", x); } } fprintf(file, "\n"); } } #endif ll_define_primitive(object, llCdump_meter, 0, (), _1(no_side_effect,"#t")) { #if ll_BC_METER FILE *fp; const char *fn = "/tmp/llbcmeter"; if ( (fp = fopen(fn, "w")) ) { _ll_bc_meter_dump(fp, 1); fclose(fp); } else { fprintf(stderr, "BC: METER cannot write to '%s'\n", fn); } #else fprintf(stderr, "BC: METER: not enabled: try \"ll_BC_METER=1\" in config.mak\n"); #endif } ll_define_primitive_end /*******************************************************************/ static void _ll_make_bmethod(ll_v consts); static void _ll_make_bmethod_env(ll_v consts); static int bcCdebugClines; int _ll_bc_debug = 0; ll_v _ll_debug_expr_, *_ll_debug_expr = &_ll_debug_expr_; ll_define_primitive(object, _bmethod_apply, 0, _(args), _0()) { bc_t *pc; ll_v exports = ll_undef; ll_v *locals = 0; char *SLOTS = ll_UNBOX_ref(ll_SELF); short bcCdebug = ll_BC_RUN_DEBUG; ll_v debug_expr = ll_f; #if ll_BC_METER int bcode_last, bcode; #endif #ifndef ll_BC_DEBUG_EXPR #define ll_BC_DEBUG_EXPR 1 #endif #if ll_BC_DEBUG_EXPR ll_v *prev_debug_expr = _ll_debug_expr; _ll_debug_expr = &debug_expr; #endif // bcCdebug = 1; SLOTS += ll_UNBOX_fixnum(ll_AR_TYPE_OFFSET); #define METH ll_THIS_ISA(method, ll_AR_METH) #define ENV ll_THIS_ISA(vector, METH->_env)->_array #define EXPORTS ll_THIS_ISA(vector, exports)->_array restart: pc = CODE; #if ll_BC_METER bcode = 0; #endif #define SET_4(X) (*(pc ++) = (X), *(pc ++) = (X) >> 8, *(pc ++) = (X) >> 16, *(pc ++) = (X) >> 24) next_isn: #define break goto next_isn /*****************************************************************/ /* debug support */ _ll_ASSERT_STACKS(); #if 0 if ( *pc == ll_bc_slot ) { _ll_bc_debug = 1; } #endif if ( _ll_bc_debug ) { bcCdebug = _ll_bc_debug; _ll_bc_debug = 0; } if ( bcCdebug ) { if ( bcCdebugClines == 20 || *pc == 0 ) { if ( prompt("BC: RUN: ") ) { bcCdebug = 0; } bcCdebugClines = 0; } bcCdebugClines ++; if ( bcCdebug == 1 ) { bcCdebug ++; ll_format(ll_undef, "\nBC: method ~W type-offset ~W\n", 2, ll_AR_METH, ll_AR_TYPE_OFFSET); } { bc_t *pc_tmp = pc; _ll_bc_dump(&pc_tmp, 0, ll_AR_METH, 1); } } #if ll_BC_METER bcode_last = bcode; bcode = GET_1(); _ll_bc_meter[bcode_last + 1][bcode] ++; _ll_bc_meter[0][bcode] ++; _ll_bc_meter[0][0] ++; #if 0 if ( _ll_bc_meter[0][0] % 4000 == 0 ) { //_ll_bc_meter_dump(stderr, 1); prompt("BC: METER"); } #endif switch ( bcode ) { #else switch ( GET_1() ) { #endif /*****************************************************************/ /* NO-OP */ case ll_bc(nop,0,0,0): break; /*****************************************************************/ /* Debugging support */ case ll_bc(_bcCdebug,0,1,0): bcCdebug ++; _ll_PUSH(ll_unspec); break; case ll_bc(_bcCdebug_off,0,1,0): bcCdebug --; _ll_PUSH(ll_unspec); break; case ll_bc(_bcCdebug_expr,0,0,1): #if ll_BC_DEBUG_EXPR debug_expr = #endif _ll_PEEK(); _ll_PEEK() = ll_unspec; break; /*****************************************************************/ /* non-tail-recursive return, rtn value is on the stack */ case ll_bc(rtn,0,-1,1): { ll_v x = _ll_POP(); #if ll_BC_DEBUG_EXPR _ll_debug_expr = prev_debug_expr; #endif ll_return(x); } break; /*****************************************************************/ /* stack mgmt */ case ll_bc(probe,1,0,0): { long x = GET_4(); _ll_VS_PROBE(x); } break; case ll_bc(locals,1,ARG(0),0): (void) _ll_PUSHN(GET_4()); locals = (ll_v*) _ll_val_sp; break; case ll_bc(pop,0,-1,1): /* v | */ (void) _ll_POP(); break; /*****************************************************************/ /* arg count checking */ case ll_bc(nargs,1,0,0): /* */ { int nargs = GET_4(); if ( ll_ARGC != nargs ) { _ll_argc_error(); } } break; /*****************************************************************/ /* restarg count checking/construction */ case ll_bc(nargs_rest,1,1,ARG(0)): /* ... arg[nargs] ... arg[argc] | (args[nargs] ...) */ { int nargs = GET_4(); if ( ll_ARGC < nargs ) { _ll_argc_error(); } _ll_PUSH(ll_listv(ll_ARGC - nargs, ll_ARGV + nargs)); } break; case ll_bc(nargs_rest_,1,0,ARG(0)): /* | */ { int nargs = GET_4(); if ( ll_ARGC < nargs ) { _ll_argc_error(); } } break; case ll_bc(list,1,1 - ARG(0), ARG(0)): /* l1 l2 ... ln | */ { int len = GET_4(); ll_v list; list = ll_listv(len, (ll_v*) _ll_val_sp); _ll_POPN(len); _ll_PUSH(list); } break; /*****************************************************************/ /* jump relative if false */ case ll_bc(jf,1,-1,1): { long dist = GET_4(); if ( ! ll_unbox_boolean(_ll_POP()) ) { pc += dist; } } break; /*****************************************************************/ /* jump relative */ case ll_bc(jmp,1,0,0): { long dist = GET_4(); pc += dist; } break; /*****************************************************************/ /* constant */ case ll_bc(const,1,1,0): /* | const[i] */ _ll_PUSH(CONSTS[GET_4()]); break; /*****************************************************************/ /* locative */ case ll_bc(contents,0,0,1): /* locative | *contents */ _ll_PEEK() = *ll_UNBOX_locative(_ll_PEEK()); break; case ll_bc(set_contents,0,-1,2): /* locative value | # */ { ll_v *loc = ll_UNBOX_locative(_ll_POP()); *loc = _ll_PEEK(); ll_write_barrier(loc); _ll_PEEK() = ll_unspec; } break; /*****************************************************************/ /* exported env */ case ll_bc(make_exports,1,-ARG(0),ARG(0)): /* loc1 .. locn | */ { size_t size = GET_4(); ll_assert(bc,ll_EQ(exports,ll_undef)); exports = _ll_make_copy_vector((ll_v*) _ll_val_sp, size); (void) _ll_POPN(size); } break; case ll_bc(exports,0,1,0): /* | */ ll_assert(bc, ll_NE(exports, ll_undef)); _ll_PUSH(exports); break; case ll_bc(export,1,1,0): /* | exports[n] */ _ll_PUSH(ll_make_locative(&EXPORTS[GET_4()])); break; /*****************************************************************/ /* Create a method closure */ case ll_bc(make_method,0,-1,2): /* | */ _ll_make_bmethod(_CONSTS); break; case ll_bc(make_method_env,0,-2,3): /* | */ _ll_make_bmethod_env(_CONSTS); break; /*****************************************************************/ /* environment */ case ll_bc(env,1,1,0): /* | &env[i] */ _ll_PUSH(ll_make_locative(&ENV[GET_4()])); break; /*****************************************************************/ /* local */ case ll_bc(local,1,1,0): /* | &locals[i] */ _ll_PUSH(ll_make_locative(&locals[GET_4()])); break; /*****************************************************************/ /* arg */ case ll_bc(arg,1,1,0): /* | &ll_ARGV[i] */ _ll_PUSH(ll_make_locative(&ll_ARGV[GET_4()])); break; /*****************************************************************/ /* slot */ case ll_bc(slot,1,1,0): { int index = _ll_slot_offset(ll_AR_TYPE, CONSTS[GET_4()]); /* LOCK(); */ pc -= 4; *(pc - 1) = ll_bc_slot_; SET_4(index); /* UNLOCK(); */ _ll_PUSH(ll_make_locative(&SLOTS[index])); } break; case ll_bc(slot_,1,1,0): _ll_PUSH(ll_make_locative(SLOTS + GET_4())); break; /*****************************************************************/ /* global */ case ll_bc(glo,1,1,0): { ll_v loc = _ll_global_binding(GET_4(), CONSTS); /* LOCK(); */ /* glo(g) -> glo_(%make-locative g) */ *(pc - 5) = ll_bc_glo_; /* UNLOCK(); */ _ll_PUSH(loc); } break; case ll_bc(glo_,1,1,0): { int index = GET_4(); _ll_PUSH(ll_V(CONSTS[1])[index]); } break; case ll_bc(glo_get,0,0,1): /* binding | value */ { _ll_callv(ll_o(binding_value), 1); } break; case ll_bc(glo_loc,0,0,1): /* binding | locative */ { _ll_callv(ll_o(locative_binding_value), 1); } break; case ll_bc(glo_set,0,-1,1): /* binding value | #u */ { _ll_callv(ll_o(set_binding_valueE), 2); } break; /*****************************************************************/ /* call */ case ll_bc(call,1,- ARG(0),ARG(0) + 1): /* op args ... | rtn */ { ll_v op = _ll_POP(); _ll_callv(op, GET_4()); #if ll_BC_DEBUG_EXPR _ll_debug_expr = &debug_expr; #endif } break; case ll_bc(tail_call,1,- ARG(0),ARG(0) + 1): /* op args ... | rtn */ { ll_v op = _ll_POP(); #if ll_BC_DEBUG_EXPR *(_ll_debug_expr = prev_debug_expr) = debug_expr; #endif _ll_tail_callv(op, GET_4()); } break; case ll_bc(call_super,1,-1 - ARG(0),ARG(0) + 1): /* super op args ... | rtn */ { ll_v super = _ll_POP(); ll_v op = _ll_PEEK(); _ll_PEEK() = ll_SELF; _ll_call_superv(op, super, GET_4()); #if ll_BC_DEBUG_EXPR _ll_debug_expr = &debug_expr; #endif } break; case ll_bc(tail_call_super,1,-1 - ARG(0),ARG(0) + 1): /* super op args ... | rtn */ { ll_v super = _ll_POP(); ll_v op = _ll_PEEK(); _ll_PEEK() = ll_SELF; #if ll_BC_DEBUG_EXPR *(_ll_debug_expr = prev_debug_expr) = debug_expr; #endif _ll_tail_call_superv(op, super, GET_4()); } break; default: _ll_error(ll_fe(bytecode), 1, ll_s(bytecode), ll_make_char(pc[-1])); } } ll_define_primitive_end #undef break #undef METH /********************************************************************/ ll_define_primitive(byte_code_method, initialize, 3, _(self,code,consts,rest), _0()) { _ll_tsa_method *x; x = ll_THIS_ISA(method, ll_SELF); x->_func = _ll_prim_func_name(object,_bmethod_apply); x->_formals = ll_f; x->_properties = ll_nil; x->_code = ll_ARGV[1]; x->_consts = ll_ARGV[2]; if ( ll_ARGC >= 4 ) { x->_properties = ll_ARGV[3]; } if ( ll_ARGC >= 5 ) { x->_env = ll_ARGV[4]; } if ( ll_BC_DUMP ) { ll_call(ll_o(_dump), 1, (ll_SELF)); } ll_return(ll_SELF); } ll_define_primitive_end /********************************************************************/ static void _ll_make_bmethod(ll_v consts) { /* stack: | */ ll_v x = _ll_allocate_type(ll_type(byte_code_method)); _ll_tsa_method *m = ll_THIS_ISA(method,x); m->_func = _ll_prim_func_name(object,_bmethod_apply); m->_formals = ll_f; m->_consts = consts; m->_code = _ll_POP(); m->_properties = _ll_PEEK(); if ( ll_BC_DUMP ) { ll_call(ll_o(_dump), 1, (x)); } _ll_PEEK() = x; } static void _ll_make_bmethod_env(ll_v consts) { /* stack: | */ ll_v x = _ll_allocate_type(ll_type(byte_code_method)); _ll_tsa_method *m = ll_THIS_ISA(method,x); m->_func = _ll_prim_func_name(object,_bmethod_apply); m->_formals = ll_s(args); m->_consts = consts; m->_code = _ll_POP(); m->_properties = _ll_POP(); m->_env = _ll_PEEK(); if ( ll_BC_DUMP ) { ll_call(ll_o(_dump), 1, (x)); } _ll_PEEK() = x; } /********************************************************************/ ll0.13/src/ll/bool.c0100744000175200017560000000113407230471345014546 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_bool_c__ #define __rcs_id_ll_bool_c__ static const char __rcs_id_ll_bool_c[] = "$Id: bool.c,v 1.8 2001/01/15 03:47:49 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" ll_define_primitive(object, not, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(! ll_unbox_boolean(ll_SELF))); } ll_define_primitive_end ll_INIT(bool,100,"#t, #f") { ll_set_g(__t, _ll_allocate_type(ll_type(boolean))); ll_set_g(__f, _ll_allocate_type(ll_type(boolean))); _ll_set_object_nameE(ll_t, "#t"); _ll_set_object_nameE(ll_f, "#f"); return 0; } ll0.13/src/ll/cadr.c0100744000175200017560000000225507230471346014532 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_cadr_c__ #define __rcs_id_ll_cadr_c__ static const char __rcs_id_ll_cadr_c[] = "$Id: cadr.c,v 1.4 2001/01/15 03:47:50 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /*********************************************************/ #define _ll_CADR(_X,_Y) \ __inline ll_v ll_c##_X##_Y##r(ll_v p) { return ll_c##_X##r(ll_c##_Y##r(p)); } \ __inline void ll_set_c##_X##_Y##rE(ll_v p, ll_v v) { ll_set_c##_X##rE(ll_c##_Y##r(p), v); } \ __inline ll_v ll_locative_c##_X##_Y##r(ll_v p) { return ll_locative_c##_X##r(ll_c##_Y##r(p)); } \ ll_define_primitive(pair, c##_X##_Y##r, 1, (pair), _1(no_side_effect,"#t")) \ { \ ll_return(ll_c##_X##r(ll_THIS->_c##_Y##r)); \ } \ ll_define_primitive_end \ \ ll_define_primitive(pair, set_c##_X##_Y##rE, 2, (pair, v), _1(no_side_effect,"#t")) \ { \ ll_set_c##_X##rE(ll_THIS->_c##_Y##r, ll_ARGV[1]); \ } \ ll_define_primitive_end \ \ ll_define_primitive(pair, locative_c##_X##_Y##r, 1, (pair), _1(no_side_effect,"#t")) \ { \ ll_return(ll_locative_c##_X##r(ll_THIS->_c##_Y##r)); \ } \ ll_define_primitive_end #include "ll/cadr.h" #undef _ll_CADR /*********************************************************/ ll0.13/src/ll/cadr.h0100644000175200017560000000247306735677700014553 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_cadr_h__ #define __rcs_id_ll_cadr_h__ static const char __rcs_id_ll_cadr_h[] = "$Id: cadr.h,v 1.2 1999/06/28 13:59:28 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #ifndef _ll_CADR #define _ll_CADR(A,D) ll_v ll_c##A##D##r(ll_v x); #endif _ll_CADR(a,a) _ll_CADR(a,d) _ll_CADR(d,a) _ll_CADR(d,d) _ll_CADR(aa,a) _ll_CADR(aa,d) _ll_CADR(ad,a) _ll_CADR(ad,d) _ll_CADR(da,a) _ll_CADR(da,d) _ll_CADR(dd,a) _ll_CADR(dd,d) _ll_CADR(aaa,a) _ll_CADR(aaa,d) _ll_CADR(aad,a) _ll_CADR(aad,d) _ll_CADR(ada,a) _ll_CADR(ada,d) _ll_CADR(add,a) _ll_CADR(add,d) _ll_CADR(daa,a) _ll_CADR(daa,d) _ll_CADR(dad,a) _ll_CADR(dad,d) _ll_CADR(dda,a) _ll_CADR(dda,d) _ll_CADR(ddd,a) _ll_CADR(ddd,d) _ll_CADR(aaaa,a) _ll_CADR(aaaa,d) _ll_CADR(aaad,a) _ll_CADR(aaad,d) _ll_CADR(aada,a) _ll_CADR(aada,d) _ll_CADR(aadd,a) _ll_CADR(aadd,d) _ll_CADR(adaa,a) _ll_CADR(adaa,d) _ll_CADR(adad,a) _ll_CADR(adad,d) _ll_CADR(adda,a) _ll_CADR(adda,d) _ll_CADR(addd,a) _ll_CADR(addd,d) _ll_CADR(daaa,a) _ll_CADR(daaa,d) _ll_CADR(daad,a) _ll_CADR(daad,d) _ll_CADR(dada,a) _ll_CADR(dada,d) _ll_CADR(dadd,a) _ll_CADR(dadd,d) _ll_CADR(ddaa,a) _ll_CADR(ddaa,d) _ll_CADR(ddad,a) _ll_CADR(ddad,d) _ll_CADR(ddda,a) _ll_CADR(ddda,d) _ll_CADR(dddd,a) _ll_CADR(dddd,d) #undef _ll_CADR /*********************************************************/ ll0.13/src/ll/call.c0100744000175200017560000000316607262415714014540 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_call_c__ #define __rcs_id_ll_call_c__ static const char __rcs_id_ll_call_c[] = "$Id: call.c,v 1.3 2001/02/05 23:49:37 stephens Exp $"; #endif #endif /* __rcs_id__ */ /*************************************************************************/ #include "ll.h" #include "call.h" #include "call_int.h" #include "assert.h" /*************************************************************************/ /* argument -> value stack transfer */ #define __ll_ARGS(N,A)_ll_ARGS(N,A) #define _ll_args_def(N) \ void _ll_args##N(__ll_ARGS_DECL(N,ll_v)) \ { \ _ll_ASSERT_STACKS(); \ __ll_ARGS(N,(__ll_ARGS_NAMES(N))); \ _ll_ASSERT_STACKS(); \ } _ll_args_def(0) _ll_args_def(1) _ll_args_def(2) _ll_args_def(3) _ll_args_def(4) _ll_args_def(5) _ll_args_def(6) _ll_args_def(7) _ll_args_def(8) _ll_args_def(9) _ll_args_def(10) #undef _ll_args_def /*************************************************************************/ ll_v _ll_callv_f(ll_v op, int argc) { _ll_ASSERT_STACKS(); _ll_callv(op, argc); { ll_v x = _ll_POP(); //_ll_VS_POP(); _ll_ASSERT_STACKS(); return x; } } ll_v _ll_call_superv_f(ll_v op, ll_v super, int argc) { _ll_ASSERT_STACKS(); _ll_call_superv(op, super, argc); { ll_v x = _ll_POP(); //_ll_VS_POP(); _ll_ASSERT_STACKS(); return x; } } int _ll_tail_callv_f(ll_v op, int argc) { _ll_ASSERT_STACKS(); _ll_tail_callv(op, argc); } int _ll_tail_call_superv_f(ll_v op, ll_v super, int argc) { _ll_ASSERT_STACKS(); _ll_tail_call_superv(op, super, argc); } /*************************************************************************/ ll0.13/src/ll/call.h0100644000175200017560000000644307001132745014534 0ustar stephensstephens#ifndef _ll_call_h #define _ll_call_h /* $Id: call.h,v 1.3 1999/10/13 16:40:05 stephensk Exp $ */ /* Copyright (c) 1999, Kurt A. Stephens, ION, Inc. */ #include "ll.h" #include "stack.h" /***********************************************/ /* The method lookup subprimitives */ void _ll_lookup(), _ll_lookup_super(ll_v super); /*************************************************************************/ /* user-level messaging macros */ #if ll_USE_INLINE_CALL_MACROS /***********************************************/ #include "call_int.h" #define ll_POP() ({ ll_v __t = _ll_POP(); _ll_VS_POP(); __t; }) #define ll_call(OP,ARGC,ARGS) ({ _ll_ARGS(ARGC,ARGS); _ll_callv((OP), (ARGC)); ll_POP(); _}) #define ll_call_super(OP,SUPER,ARGC,ARGS) ({ _ll_ARGS(ARGC,ARGS); _ll_call_superv(OP,SUPER,ARGC); ll_POP(); }) /* Tail-calls with inline args */ #define ll_tail_call(OP,ARGC,ARGS) do{ _ll_ARGS(ARGC,ARGS); _ll_tail_callv((OP),(ARGC));}while(0) #define ll_tail_call_super(OP,SUPER,ARGC,ARGS) do{ _ll_ARGS(ARGC,ARGS); _ll_tail_call_superv((OP),(SUPER),(ARGC));}while(0) /***********************************************/ #else /***********************************************/ /* Use functions for calling. */ /***********************************************/ /* arg list helpers */ #define __ll_ARGS_NAMES0 #define __ll_ARGS_NAMES1 _1 #define __ll_ARGS_NAMES2 _1,_2 #define __ll_ARGS_NAMES3 _1,_2,_3 #define __ll_ARGS_NAMES4 _1,_2,_3,_4 #define __ll_ARGS_NAMES5 _1,_2,_3,_4,_5 #define __ll_ARGS_NAMES6 _1,_2,_3,_4,_5,_6 #define __ll_ARGS_NAMES7 _1,_2,_3,_4,_5,_6,_7 #define __ll_ARGS_NAMES8 _1,_2,_3,_4,_5,_6,_7,_8 #define __ll_ARGS_NAMES9 _1,_2,_3,_4,_5,_6,_7,_8,_9 #define __ll_ARGS_NAMES10 _1,_2,_3,_4,_5,_6,_7,_8,_9,_10 #define __ll_ARGS_NAMES(N)__ll_ARGS_NAMES##N #define __ll_ARGS_DECL0(T) #define __ll_ARGS_DECL1(T)T _1 #define __ll_ARGS_DECL2(T)T _1,T _2 #define __ll_ARGS_DECL3(T)T _1,T _2,T _3 #define __ll_ARGS_DECL4(T)T _1,T _2,T _3,T _4 #define __ll_ARGS_DECL5(T)T _1,T _2,T _3,T _4,T _5 #define __ll_ARGS_DECL6(T)T _1,T _2,T _3,T _4,T _5,T _6 #define __ll_ARGS_DECL7(T)T _1,T _2,T _3,T _4,T _5,T _6,T _7 #define __ll_ARGS_DECL8(T)T _1,T _2,T _3,T _4,T _5,T _6,T _7,T _8 #define __ll_ARGS_DECL9(T)T _1,T _2,T _3,T _4,T _5,T _6,T _7,T _8,T _9 #define __ll_ARGS_DECL10(T)T _1,T _2,T _3,T _4,T _5,T _6,T _7,T _8,T _9,T _10 #define __ll_ARGS_DECL(N,T)__ll_ARGS_DECL##N(T) #define _ll_args_decl(N) _ll_args##N(__ll_ARGS_DECL(N,ll_v)) void _ll_args_decl(0), _ll_args_decl(1), _ll_args_decl(2), _ll_args_decl(3), _ll_args_decl(4), _ll_args_decl(5), _ll_args_decl(6), _ll_args_decl(7), _ll_args_decl(8), _ll_args_decl(9), _ll_args_decl(10); #define _ll_args(ARGC,ARGS) _ll_args##ARGC ARGS ll_v _ll_callv_f(ll_v op, int argc); ll_v _ll_call_superv_f(ll_v op, ll_v super, int argc); int _ll_tail_callv_f(ll_v op, int argc); int _ll_tail_call_superv_f(ll_v op, ll_v super, int argc); #define ll_call(OP,ARGC,ARGS) (_ll_args(ARGC,ARGS), _ll_callv_f((OP),(ARGC))) #define ll_call_super(OP,SUPER,ARGC,ARGS) (_ll_args(ARGC,ARGS), _ll_call_superv_f((OP),(SUPER),(ARGC))) #define ll_tail_call(OP,ARGC,ARGS) do{_ll_args(ARGC,ARGS); return _ll_tail_callv_f((OP),(ARGC)); }while(0) #define ll_tail_call_super(OP,SUPER,ARGC,ARGS) do{_ll_args(ARGC,ARGS); return _ll_tail_call_superv_f((OP),(SUPER),(ARGC)); }while(0) #endif #endif ll0.13/src/ll/call_int.h0100664000175200017560000001370707623404327015421 0ustar stephensstephens#ifndef _ll_call_int_h #define _ll_call_int_h /* $Id: call_int.h,v 1.5 2003/02/15 09:31:03 stephens Exp $ */ /* Copyright (c) 1999, Kurt A. Stephens, ION, Inc. */ #include "ll/stack.h" /***********************************************/ /* ll_call() and ll_call_super() take a parenthesized arg list that are pushed on to the stack in reverse order because the stack grows downward. */ #define _ll_ARGS0()_ll_VS_PROBE(1) /* Leave room for return value! */ #define _ll_ARGS1(_1)_ll_VS_PROBE(1);_ll_PUSH(_1) #define _ll_ARGS2(_1,_2)_ll_VS_PROBE(2);_ll_PUSH(_2);_ll_PUSH(_1) #define _ll_ARGS3(_1,_2,_3)_ll_VS_PROBE(3);_ll_PUSH(_3);_ll_PUSH(_2);_ll_PUSH(_1) #define _ll_ARGS4(_1,_2,_3,_4)_ll_VS_PROBE(4);_ll_PUSH(_4);_ll_PUSH(_3);_ll_PUSH(_2);_ll_PUSH(_1) #define _ll_ARGS5(_1,_2,_3,_4,_5)_ll_VS_PROBE(5);_ll_PUSH(_5);_ll_PUSH(_4);_ll_PUSH(_3);_ll_PUSH(_2);_ll_PUSH(_1) #define _ll_ARGS6(_1,_2,_3,_4,_5,_6)_ll_VS_PROBE(6);_ll_PUSH(_6);_ll_PUSH(_5);_ll_PUSH(_4);_ll_PUSH(_3);_ll_PUSH(_2);_ll_PUSH(_1) #define _ll_ARGS7(_1,_2,_3,_4,_5,_6,_7)_ll_VS_PROBE(7);_ll_PUSH(_7);_ll_PUSH(_6);_ll_PUSH(_5);_ll_PUSH(_4);_ll_PUSH(_3);_ll_PUSH(_2);_ll_PUSH(_1) #define _ll_ARGS8(_1,_2,_3,_4,_5,_6,_7,_8)_ll_VS_PROBE(8);_ll_PUSH(_8);_ll_PUSH(_7);_ll_PUSH(_6);_ll_PUSH(_5);_ll_PUSH(_4);_ll_PUSH(_3);_ll_PUSH(_2);_ll_PUSH(_1) #define _ll_ARGS9(_1,_2,_3,_4,_5,_6,_7,_8,_9)_ll_VS_PROBE(9);_ll_PUSH(_9);_ll_PUSH(_8);_ll_PUSH(_7);_ll_PUSH(_6);_ll_PUSH(_5);_ll_PUSH(_4);_ll_PUSH(_3);_ll_PUSH(_2);_ll_PUSH(_1) #define _ll_ARGS10(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10)_ll_VS_PROBE(10);_ll_PUSH(_10);_ll_PUSH(_9);_ll_PUSH(_8);_ll_PUSH(_7);_ll_PUSH(_6);_ll_PUSH(_5);_ll_PUSH(_4);_ll_PUSH(_3);_ll_PUSH(_2);_ll_PUSH(_1) #define _ll_ARGS(N,A)_ll_ARGS##N##A /* ** Tail-recursion is implemented in C as follows: ** ** CALL: ** 1. Push the arguments on the value stack in reverse order. Stack pointer is the new argument vector. ** 2. Push a new activation record with the procedure and the number of arguments. ** 3. Keep calling the top activation record's function if it returns !0. ** 4. Pop the activation record. ** 5. Return value is on the top of the value stack. ** ** RETURN(X): ** 1. Reset the stack pointer to the end of the current argument vector. ** 2. Push the value X on the stack. ** 3. Return 0 to force the caller's loop (CALL #3) to terminate. ** ** TAIL-CALL: ** 1. Push the arguments on the value stack in reverse order. ** Stack: | NARG1 | NARG2 | .... | ARGV0 | ARGV1 | .... ** ^ SP ^ ARGV ** 2. Reset the stack pointer to the end of the current argument vector. ** 3. Copy the new arguments by pushing them on the value stack in reverse order. ** 4. Reuse the current activation record to store the new activation record. ** 5. Return 1 to force the caller to process the new activation record (this forces the C stack to unwind) ** ** ** Note: you cannot pass a reference to a C stack allocated object to a tail call. ** Example: DO NOT DO THE FOLLOWING: ll_define_primitive(object, foo, 0, (), _0()) { _ll_tsa_pair cons_on_stack; ll_v c = ll_make_ref(&cons_on_stack); ... ll_tail_call(ll_o(bar), 1, (c)); } ll_define_primitive_end */ /***********************************************/ #define __ll_call_method_func(METH) \ (ll_THIS_ISA(method,(METH))->_func)() #define __ll_tail_call_method_func(METH) \ return(__ll_call_method_func(METH)) #define __ll_lookup_begin(OP,ARGC,LOOKUP) \ do { \ { register ll_v __ll_op = (OP); \ register int __ll_argc = (ARGC); \ _ll_AR_PROBE(1); \ (-- _ll_ar_sp)->super_object._isa = ll_type(activation_record); \ ll_AR_OP = __ll_op; \ ll_AR_ARGC = __ll_argc; } \ ll_AR_ARGV = (ll_v*) _ll_val_sp; \ ll_AR_TYPE = _ll_ar_sp[1]._type; \ /* Remember current implementer type for _ll_lookup_super(#f) */ \ ll_AR_DB_AT_RTN = ll_f; \ LOOKUP #if 0 #define __ll_lookup_end() \ ll_AR_OP = ll_AR_TYPE = ll_AR_METH = ll_AR_DB_AT_RTN = ll_undef; \ ll_AR_ARGV = 0; \ ++ _ll_ar_sp; \ _ll_AR_POP(); \ _ll_ar_sp->super_object._isa = ll_type(undefined); \ }while(0) #else #define __ll_lookup_end() \ ++ _ll_ar_sp; \ }while(0) #endif #define __ll_callv(OP,ARGC,LOOKUP) \ __ll_lookup_begin(OP,ARGC,LOOKUP); \ while ( __ll_call_method_func(ll_AR_METH) ) ; \ __ll_lookup_end() /* stack contains: rcvr arg ... */ #define _ll_callv(OP,ARGC)__ll_callv(OP,ARGC,_ll_lookup()) #define _ll_SUPER_EXTRA_ARGC 0 /* 1 */ /* stack contains: self arg ... */ #define _ll_call_superv(OP,SUPER,ARGC)do{__ll_callv(OP,(ARGC + _ll_SUPER_EXTRA_ARGC),_ll_lookup_super(SUPER));}while(0) /* Tail call with args already in place (forwarding call) */ #define ___ll_tail_callv(OP,ARGC,LOOKUP) \ do { \ ll_AR_OP = (OP); \ ll_AR_ARGC = (ARGC); \ ll_AR_ARGV = (ll_v*) _ll_val_sp; \ LOOKUP; \ return 1; \ }while(0) #define __ll_tail_callv(OP,ARGC)___ll_tail_callv(OP,ARGC,_ll_lookup()) /* ** Tail-call with args to be moved into place: ** 1. Remember end of the argument list. ** 2. Unwind the value stack pointer to the previous frame (pop current argument vector) ** 3. Probe the stack. ** 4. Repush the argument list */ #define _ll_tail_callv(OP,ARGC) \ do { \ ll_v __op = (OP); \ register int __argc = (ARGC); \ { int ___argc = __argc; \ const ll_v *__p = ((ll_v*) _ll_val_sp) + __argc; \ _ll_val_sp = ll_ARGV + ll_ARGC; \ _ll_VS_POP(); \ _ll_VS_PROBE(___argc); \ while ( ___argc -- ) \ _ll_PUSH(*(-- __p)); \ } \ __ll_tail_callv(__op,__argc); \ } while(0) /* ** Super tail-call with args to be moved into place. */ #define _ll_tail_call_superv(OP,SUPER,ARGC) \ do { \ ll_v __op = (OP); \ register int __argc = (ARGC); \ { int ___argc = __argc; \ const ll_v *__p = ((ll_v*) _ll_val_sp) + __argc; \ _ll_val_sp = ll_ARGV + ll_ARGC; \ _ll_VS_POP(); \ _ll_VS_PROBE(___argc); \ while ( ___argc -- ) \ _ll_PUSH(*(-- __p)); \ } \ ___ll_tail_callv(__op,(__argc + _ll_SUPER_EXTRA_ARGC),_ll_lookup_super(SUPER)); \ } while(0) /*************************************************************************/ #endif ll0.13/src/ll/catch.c0100744000175200017560000001020007230472733014671 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_catch_c__ #define __rcs_id_ll_catch_c__ static const char __rcs_id_ll_catch_c[] = "$Id: catch.c,v 1.16 2001/01/15 04:00:27 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /* is a subtype of . It provides the basics for error handling in ll. A catch object is added to a specified type as a method using an anonymous operation. This anonymous operation is later applied to an object of the specified type. When the catch's operation is applied to an object of the type specified (this object is the "thrown value") for the catch, execution resumes at the catch handle procedure or thrown value is returned from (catch). This allows catches to be created for specific error types to behandled by the proper bodies. For example: (catch (lambda (the-catch) ; The catch body (do-this) (do-that) (the-catch "throw this value") (this-is-never-done) ) (lambda (the-value-thrown) ; The catch procedure (do-something the-value-thrown))) The (catch ?) method */ void _ll_begin_catch(ll_v c) { _ll_tsa_catch *x = ll_THIS_ISA(catch, c); x->_previous_catch = ll_g(_current_catch); /* Remember current stack depths */ _ll_get_stack_depth(&x->_value_sp); /* Make the catch valid */ x->_validQ = ll_t; ll_set_g(_current_catch, c); } static ll_v _ll_invalidate_catch(ll_v c) { _ll_tsa_catch *x = ll_THIS_ISA(catch, c); ll_v pc = x->_previous_catch; x->_previous_catch = ll_f; x->_value = ll_f; /* This is faster than it looks */ _ll_remove_method(x->_type, x->_op); return pc; } ll_v _ll_end_catch(ll_v c) { _ll_tsa_catch *x = ll_THIS_ISA(catch, c); ll_v value = x->_value; ll_v cc = ll_g(_current_catch); x->_validQ = ll_f; /* Invalidate every catch between the current catch ** and the catch we are longjmping to. */ while ( ll_NE(cc, c) ) { /* ** If we've reached the bottom of the catch chain, ** something has been screwed up. */ if ( ll_EQ(cc, ll_f) ) { _ll_error(ll_fe(catch), 2, ll_s(catch), ll_f, ll_s(reason), ll_s(catch_chain_corrupted)); abort(); } cc = _ll_invalidate_catch(cc); } /* Restore stack pointers */ _ll_set_stack_depth(&x->_value_sp); /* Make cc prev catch the current catch */ ll_set_g(_current_catch, _ll_invalidate_catch(c)); return value; } /* ** This should never be called directly. */ ll_define_primitive(object, _catch_apply, 0, _(value), _0()) { ll_v the_catch = ll_AR_METH; _ll_tsa_catch *x = ll_THIS_ISA(catch, the_catch); ll_v validQ = x->_validQ; ll_v value = ll_ARGC ? ll_ARGV[0] : ll_unspec; /* ** Check if the catch has been thrown to before. */ x->_validQ = ll_f; if ( ll_EQ(validQ, ll_f) ) { ll_return(_ll_error(ll_ee(catch), 2, ll_s(catch), the_catch, ll_s(reason), ll_s(already_thrown_to))); } x->_value = value; longjmp(x->__jb, 1); } ll_define_primitive_end /* */ ll_define_primitive(type, catch, 1, _(body,caught), _0()) { ll_v rtn = ll_undef; ll_CATCH_BEGIN(ll_SELF,c); /* call the body with the catch */ rtn = ll_call(ll_ARGV[1], 1, (c)); ll_CATCH_VALUE(v); /* if we have a catch body: */ if ( ll_ARGC >= 3 ) { /* call it with the caught value */ ll_tail_call(ll_ARGV[2], 1, (v)); } else { /* rtn the caught value */ rtn = v; } ll_CATCH_END; ll_return(rtn); } ll_define_primitive_end ll_v _ll_make_catch(ll_v type, ll_v *xp) { ll_v op; ll_v x = _ll_allocate_type(ll_type(catch)); _ll_tsa_catch *t = ll_THIS_ISA(catch, x); /* Copy ::%catch-apply */ *(_ll_tsa_primitive*)t = *ll_THIS_ISA(primitive, ll_p(object, _catch_apply)); ll_SLOTS(x)[0] = ll_type(catch); /* Fix isa */ /* Remember what type and op this catch was associated with */ t->_type = type; t->_op = _ll_make_operation(); t->_value = ll_undef; /* No value yet! */ t->_validQ = ll_f; /* Not valid until setjmp() */ /* This is faster than it looks */ _ll_add_method(t->_type, t->_op, x); *xp = x; return t->_op; } ll_INIT(catch,120,"catch") { ll_set_g(_current_catch, ll_f); return 0; } ll0.13/src/ll/cfold.c0100744000175200017560000001406507230471347014713 0ustar stephensstephens#include "ll.h" #include "bcompile.h" /**********************************************************************/ #define IR ll_ARGV[1] ll_define_primitive(object,_ir_constantQ, 2, (self, ir), _0()) { ll_tail_call(ll_o(constantQ), 1, (ll_SELF)); } ll_define_primitive_end ll_define_primitive(symbol,_ir_constantQ, 2, (self, ir), _0()) { ll_v x; /* "if" is a synactic primitive and is never evaled. */ if ( ll_EQ(ll_SELF, ll_s(if)) ) { x = ll_t; } else { ll_v s = ll_call(ll_o(_ir_var_scope), 2, (IR, ll_SELF)); ll_v type = var_type(s); //ll_format(ll_undef, "%ir-constant? ~S => ~S\n", 2, ll_SELF, s); /* ** If the symbol is bound to a global readonly value. ** get the value and quote it. */ /* glo ref */ if ( ll_EQ(type, ll_s(glo)) ) { x = ll_call(ll_o(property), 2, (ll_SELF, ll_s(readonly))); } else { x = ll_f; } } ll_return(x); } ll_define_primitive_end ll_define_primitive(pair,_ir_constantQ, 2, (self, ir), _1(no_side_effect,"#t")) { /* Quoted forms are always constants. */ if ( ll_EQ(ll_THIS->_car, ll_s(quote)) ) { ll_return(ll_t); } ll_return(ll_f); } ll_define_primitive_end /**********************************************************************/ /* ** Begin folding expressions, by returning new expressions ** if constant folding can be applied. */ ll_define_primitive(object,_ir_const_fold, 2, (self, ir), _1(no_side_effect,"#t")) { /* Most expression objects cannot be folded. */ ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(symbol,_ir_const_fold, 2, (self, ir), _0()) { ll_v x = ll_call(ll_o(_ir_var_scope), 2, (IR, ll_SELF)); ll_v type = var_type(x); /* ** If the symbol is bound to a global readonly value. ** get the value and quote it. */ /* glo ref */ if ( ll_EQ(type, ll_s(glo)) ) { x = ll_call(ll_o(property), 2, (ll_SELF, ll_s(readonly))); if ( ll_unbox_boolean(x) ) { x = ll_call(ll_o(_get), 1, (ll_SELF)); // ll_format(ll_undef, "%ir-const-fold glo ~S -> ~S\n", 2, ll_SELF, x); ll_return(ll_quote(x)); } } /* Otherwise leave it alone. */ ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(pair,_ir_const_fold, 2, (self, ir), _0()) { ll_v self = ll_SELF; ll_v result = ll_SELF; int all_consts = 1; // ll_format(ll_undef, "%ir-const-fold ~S =>\n", 1, self); /* ** Special case: ** Quoted forms are always left alone. */ if ( ll_EQ(ll_THIS->_car, ll_s(quote)) ) { goto result; } /* ** Special case: ** Skip over var in (define var ...) and (set! var ...) and ** attempt to fold ... constants. */ else if ( ll_EQ(ll_THIS->_car, ll_s(define)) || ll_EQ(ll_THIS->_car, ll_s(setE)) ) { ll_v values = ll_cdr(ll_THIS->_cdr); ll_LIST_LOOP_REF(values, x); { *x = ll_call(ll_o(_ir_const_fold), 2, (*x, IR)); } ll_LIST_LOOP_END; goto result; } /* Handle (if ) */ else if ( ll_EQ(ll_THIS->_car, ll_s(if)) ) { ll_v x, cond, tbranch; x = ll_THIS->_cdr; cond = ll_car(x); x = ll_cdr(x); tbranch = ll_car(x); x = ll_cdr(x); /* Attempt to fold */ cond = ll_call(ll_o(_ir_const_fold), 2, (cond, IR)); /* If is a constant, */ if ( ll_unbox_boolean(ll_call(ll_o(_ir_constantQ), 2, (cond, IR))) ) { if ( ll_unbox_boolean(cond) ) { /* ** If cond is true,, ** (if ...) => */ result = tbranch; } else if ( ! ll_nullQ(x) ) { /* ** If cond is false, ** (if ) => */ result = ll_car(x); } else { /* ** If cond is false, ** (if ) => */ result = ll_unspec; } goto result; } /* FALL THROUGH */ } /* ** General case: ** Attempt to fold an operation and arguments. */ ll_LIST_LOOP_REF(ll_SELF, x); { ll_v cv; cv = ll_call(ll_o(_ir_const_fold), 2, (*x, IR)); /* Was the result of the constant fold a constant? */ if ( ! ll_unbox_boolean(ll_call(ll_o(_ir_constantQ), 2, (cv, IR))) ) { /* Not all the expr elements were constants. */ all_consts = 0; } *x = cv; } ll_LIST_LOOP_END; // ll_format(ll_undef, " %ir-const-fold mapped => ~S\n", 1, ll_SELF); { ll_v x; ll_v op, args; ll_v type, meth, no_side_effect; if ( ! all_consts ) { /* We need to compile it further, because the expression could not be entirely folded. */ goto result; } /* All are constants */ /* Evaluate the op expression. */ x = ll_THIS->_car; op = ll_call(ll_o(eval_no_const_fold), 1, (x)); // ll_format(ll_undef, "%ir-const-fold ~S: op ~S => ~S\n", 3, self, x, op); args = ll_THIS->_cdr; /* lookup op */ if ( ll_nullQ(args) ) { type = ll_type(object); } else { ll_v rcvr; /* Eval the rcvr, so we can get an actual type. */ x = ll_car(args); rcvr = ll_call(ll_o(eval_no_const_fold), 1, (x)); // ll_format(ll_undef, "%ir-const-fold ~S: rcvr ~S => ~S\n", 3, self, x, rcvr); type = ll_TYPE(rcvr); } meth = ll_call(ll_o(lookup), 2, (type, op)); // ll_format(ll_undef, "%ir-const-fold ~S: type ~S, op ~S => meth ~S\n", 4, self, type, op, meth); /* If the method has no side-effect, evaluate it now. */ if ( ll_unbox_boolean(meth) ) { no_side_effect = ll_call(ll_o(property), 2, (meth, ll_s(no_side_effect))); if ( ll_unbox_boolean(no_side_effect) ) { // ll_format(ll_undef, "%ir-const-fold ~S: ~S no-side-effect => ~S\n", 3, self, op, meth); result = ll_call(ll_o(eval_no_const_fold), 1, (ll_SELF)); result = ll_quote(result); } } } result: // ll_format(ll_undef, "%ir-const-fold ~S: result ~S\n", 2, self, result); ll_return(result); } ll_define_primitive_end ll_define_primitive(_ir,_ir_const_fold, 2, (self,ir), _0()) { ll_LIST_LOOP_REF(ll_THIS->_body, x); { *x = ll_call(ll_o(_ir_const_fold), 2, (*x, ll_SELF)); } ll_LIST_LOOP_END; ll_return(ll_SELF); } ll_define_primitive_end #undef IR /***************************************************************************/ ll0.13/src/ll/char.c0100744000175200017560000000502707230471350014531 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_char_c__ #define __rcs_id_ll_char_c__ static const char __rcs_id_ll_char_c[] = "$Id: char.c,v 1.8 2001/01/15 03:47:52 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include /*************************************************************************/ int ll_unbox_char(ll_v x) { _ll_typecheck(ll_type(char), &x); return ll_UNBOX_char(x); } /*************************************************************************/ ll_v _ll_char_table[ll_MAX_char + 1]; ll_INIT(char,140,"all objects") { int i; for ( i = 0; i < 0x100; i ++ ) { ll_v x = _ll_allocate_type(ll_type(char)); ll_THIS_ISA(char, x)->_value = ll_make_fixnum(i); ll_write_barrier_pure(x); _ll_char_table[i] = x; ll_write_root(&_ll_char_table[i]); } return 0; } ll_define_primitive(char,char_upcase,1,(char), _1(no_side_effect,"#t")) { int x = ll_UNBOX_char(ll_SELF); ll_return(ll_make_char(toupper(x))); } ll_define_primitive_end ll_define_primitive(char,char_downcase,1,(char), _1(no_side_effect,"#t")) { int x = ll_UNBOX_char(ll_SELF); ll_return(ll_make_char(tolower(x))); } ll_define_primitive_end ll_define_primitive(char,char__integer,1,(char), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_value); } ll_define_primitive_end ll_define_primitive(fixnum,integer__char,1,(self), _1(no_side_effect,"#t")) { _ll_rangecheck(ll_s(integer), &ll_SELF, 0, ll_MAX_char); ll_return(ll_make_char(ll_UNBOX_fixnum(ll_SELF))); } ll_define_primitive_end #ifdef tolower #undef tolower #endif #define CHAR_TYPE_PRED(NAME,OP) \ ll_define_primitive(char,char_##NAME##Q,1,(char), _1(no_side_effect,"#t")) \ { \ int x = ll_UNBOX_char(ll_SELF); \ ll_return(ll_make_boolean(OP)); \ } \ ll_define_primitive_end CHAR_TYPE_PRED(alphabetic,isalpha(x)) CHAR_TYPE_PRED(numeric,isdigit(x)) CHAR_TYPE_PRED(whitespace,isspace(x)) CHAR_TYPE_PRED(upper_case,isupper(x)) CHAR_TYPE_PRED(lower_case,islower(x)) #undef CHAR_TYPE_PRED #define CHAR_CMP_PRED(NAME,OP) \ ll_define_primitive(char,char##NAME##Q,2,(char1,char2), _1(no_side_effect,"#t")) \ { \ ll_return(ll_make_boolean(ll_UNBOX_char(ll_SELF) OP ll_unbox_char(ll_ARGV[1]))); \ } \ ll_define_primitive_end \ ll_define_primitive(char,char_ci##NAME##Q,2,(char1,char2), _1(no_side_effect,"#t")) \ { \ ll_return(ll_make_boolean(tolower(ll_UNBOX_char(ll_SELF)) OP tolower(ll_unbox_char(ll_ARGV[1])))); \ } \ ll_define_primitive_end CHAR_CMP_PRED(AS,==) CHAR_CMP_PRED(LT,<) CHAR_CMP_PRED(GT,>) CHAR_CMP_PRED(LE,<=) CHAR_CMP_PRED(GE,>=) #undef CHAR_CMP_PRED ll0.13/src/ll/config.mak0100664000175200017560000000035007336071337015412 0ustar stephensstephens# $Id: config.mak,v 1.5 2001/08/13 07:27:52 stephens Exp $ HAS_READLINE=1 HAS_HISTORY=1 ll_ASSERT_ENABLE=1 ll_v_WORD=1 ll_USE_GC=0 ll_USE_GC_BOEHM=0 ll_USE_GC_TREADMILL=0 ll_USE_LCACHE=1 ll_BC_RUN_DEBUG=0 ll_BC_DUMP=0 ll_BC_METER=1 ll0.13/src/ll/config.pl0100644000175200017560000000027107001134370015237 0ustar stephensstephens#$Id: config.pl,v 1.1 1999/10/13 16:53:12 stephensk Exp $ print "/* DO NOT MODIFY! Generated by config.pl. */\n"; while (<>) { /^\s*([^#=]+)=(.*)/ && print "#define $1 $2"; } 1; ll0.13/src/ll/cons.c0100744000175200017560000001234307230471352014557 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_cons_c__ #define __rcs_id_ll_cons_c__ static const char __rcs_id_ll_cons_c[] = "$Id: cons.c,v 1.14 2001/01/15 03:47:54 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /*************************************************************************/ /* type queries */ ll_define_primitive(pair,immutable_type,1,(pair), _1(no_side_effect,"#t")) { ll_return(ll_type(pair)); } ll_define_primitive_end ll_define_primitive(pair,mutable_type,1,(pair), _1(no_side_effect,"#t")) { ll_return(ll_type(mutable_pair)); } ll_define_primitive_end /*************************************************************************/ /* Initialization */ ll_define_primitive(pair,initialize,3,(self, car, cdr),_0()) { ll_THIS->_car = ll_ARGV[1]; ll_THIS->_cdr = ll_ARGV[2]; ll_write_barrier_SELF(); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(object,cons,2,(car, cdr),_0()) { ll_tail_call(ll_o(make), 3, (ll_type(mutable_pair), ll_SELF, ll_ARGV[1])); } ll_define_primitive_end /*************************************************************************/ ll_define_primitive(pair,make_immutable,1,(pair),_0()) { ll_TYPE_ref(ll_SELF) = ll_type(pair); ll_write_barrier_SELF(); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(pair,make_mutable,1,(pair),_0()) { ll_SELF = ll_cons(ll_THIS->_car, ll_THIS->_cdr); ll_return(ll_SELF); } ll_define_primitive_end /*************************************************************************/ ll_define_primitive(pair,car,1,(pair),_1(no_side_effect,"#t")) { ll_return(ll_THIS->_car); } ll_define_primitive_end ll_define_primitive(pair,cdr,1,(pair),_1(no_side_effect,"#t")) { ll_return(ll_THIS->_cdr); } ll_define_primitive_end /*************************************************************************/ ll_define_primitive(mutable_pair,locative_car,1,(pair),_1(no_side_effect,"#t")) { ll_return(ll_make_locative(&ll_THIS->super_pair._car)); } ll_define_primitive_end ll_define_primitive(mutable_pair,locative_cdr,1,(pair),_1(no_side_effect,"#t")) { ll_return(ll_make_locative(&ll_THIS->super_pair._cdr)); } ll_define_primitive_end ll_define_primitive(mutable_pair,set_carE,2,(pair, new_car),_0()) { ll_THIS->super_pair._car = ll_ARGV[1]; ll_write_barrier_SELF(); } ll_define_primitive_end ll_define_primitive(mutable_pair,set_cdrE,2,(pair, new_cdr),_0()) { ll_THIS->super_pair._cdr = ll_ARGV[1]; ll_write_barrier_SELF(); } ll_define_primitive_end /*************************************************************************/ __inline ll_v _ll_cons(ll_v type, ll_v a, ll_v d) { ll_v x = _ll_allocate_type(type); ll_SLOTS(x)[1] = a; ll_SLOTS(x)[2] = d; ll_write_barrier_pure(x); return x; } ll_v _ll_car(ll_v x) { return ll_SLOTS(x)[1]; } ll_v _ll_cdr(ll_v x) { return ll_SLOTS(x)[2]; } /*************************************************************/ ll_v ll_cons(ll_v a, ll_v d) { return _ll_cons(ll_type(mutable_pair), a, d); } ll_v ll_immutable_cons(ll_v a, ll_v d) { return _ll_cons(ll_type(pair), a, d); } int ll_pairQ(ll_v x) { ll_v x_type = ll_TYPE(x); if ( ll_EQ(x_type, ll_type(mutable_pair)) || ll_EQ(x_type, ll_type(pair)) ) { return 1; } else { return ll_unbox_boolean(ll_call(ll_o(pairQ), 1, (x))); } } ll_v ll_car(ll_v x) { ll_v x_type = ll_TYPE(x); if ( ll_EQ(x_type, ll_type(mutable_pair)) || ll_EQ(x_type, ll_type(pair)) ) { return ll_CAR(x); } else { return ll_call(ll_o(car), 1, (x)); } } ll_v ll_cdr(ll_v x) { ll_v x_type = ll_TYPE(x); if ( ll_EQ(x_type, ll_type(mutable_pair)) || ll_EQ(x_type, ll_type(pair)) ) { return ll_CDR(x); } else { return ll_call(ll_o(cdr), 1, (x)); } } void ll_set_carE(ll_v x, ll_v v) { ll_v x_type = ll_TYPE(x); if ( ll_EQ(x_type, ll_type(mutable_pair)) ) { ll_CAR(x) = v; ll_write_barrier_pure(x); } else { ll_call(ll_o(set_carE), 2, (x, v)); } } void ll_set_cdrE(ll_v x, ll_v v) { ll_v x_type = ll_TYPE(x); if ( ll_EQ(x_type, ll_type(mutable_pair)) ) { ll_CDR(x) = v; ll_write_barrier_pure(x); } else { ll_call(ll_o(set_cdrE), 2, (x, v)); } } ll_v ll_locative_car(ll_v x) { ll_v x_type = ll_TYPE(x); if ( ll_EQ(x_type, ll_type(mutable_pair)) ) { return(ll_make_locative(&ll_CAR(x))); } else { return(ll_call(ll_o(locative_car), 1, (x))); } } ll_v ll_locative_cdr(ll_v x) { ll_v x_type = ll_TYPE(x); if ( ll_EQ(x_type, ll_type(mutable_pair)) ) { return(ll_make_locative(&ll_CDR(x))); } else { return(ll_call(ll_o(locative_cdr), 1, (x))); } } /*************************************************************************/ /* conviences */ ll_define_primitive(object, safe_car, 1, (x), _0()) /* Returns the car or #f.*/ { ll_return(ll_f); } ll_define_primitive_end ll_define_primitive(object, safe_cdr, 1, (x), _0()) /* Returns the cdr or #f.*/ { ll_return(ll_f); } ll_define_primitive_end ll_define_primitive(pair, safe_car, 1, (x), _0()) /* Returns the car or #f.*/ { ll_return(ll_THIS->_car); } ll_define_primitive_end ll_define_primitive(pair, safe_cdr, 1, (x), _0()) /* Returns the cdr or #f.*/ { ll_return(ll_THIS->_cdr); } ll_define_primitive_end /*************************************************************************/ ll0.13/src/ll/constant.c0100744000175200017560000000215507230471353015447 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_ll_constant_c__ #define __rcs_id_ll_constant_c__ static const char __rcs_id_ll_constant_c[] = "$Id: constant.c,v 1.4 2001/01/15 03:47:55 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /**************************************************************************/ ll_define_primitive(constant, clone, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end /**************************************************************************/ /* mutable/immutable */ ll_define_primitive(constant, immutableQ, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_t); } ll_define_primitive_end ll_define_primitive(object, immutableQ, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_f); } ll_define_primitive_end ll_define_primitive(immutable, immutableQ, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_t); } ll_define_primitive_end ll_define_primitive(mutable, immutableQ, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_f); } ll_define_primitive_end /**************************************************************************/ ll0.13/src/ll/cops.h0100644000175200017560000000061107022070413014550 0ustar stephensstephens/* $Id: cops.h,v 1.2 1999/12/04 01:40:27 stephensk Exp $ */ #ifndef ROP #define ROP(X,Y)BOP(X,Y) #endif #ifndef UOP #define UOP(X,Y)BOP(X,Y) #endif #ifdef INT_OPS UOP(bnot,~) BOP(bor,|) BOP(band,&) BOP(bxor,^) #undef INT_OPS #else BOP(ADD,+) BOP(SUB,-) BOP(MUL,*) BOP(DIV,/) UOP(NEG,-) ROP(EQ,==) ROP(NE,!=) ROP(LT,<) ROP(GT,>) ROP(LE,<=) ROP(GE,>=) #endif #undef BOP #undef UOP #undef ROP ll0.13/src/ll/debug.c0100744000175200017560000000172607230472734014713 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_debug_c__ #define __rcs_id_ll_debug_c__ static const char __rcs_id_ll_debug_c[] = "$Id: debug.c,v 1.7 2001/01/15 04:00:28 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include #include /* strchr() */ #include void _ll_DEBUG_PRINT(const char *format, ...) { static int newline = 1; va_list vap; va_start(vap, format); if ( newline ) { fprintf(stderr, "ll: debug: "); } newline = (strchr(format, '\0')[-1]) == '\n'; vfprintf(stderr, format, vap); fflush(stderr); va_end(vap); } ll_INIT(debug,20,"C level debugging") { static struct { int gi; } x[] = { #ifndef ll_DEBUG_def #define ll_DEBUG_def(X) { _ll_g(_ll_DEBUG_SYM(X)) }, #include "ll/debugs.h" #endif { -1 } }; int i; for ( i = 0; x[i].gi != -1; i ++ ) { _ll_gi(x[i].gi) = ll_make_fixnum(0); } return 0; } /***************************************************************************/ ll0.13/src/ll/debugger.c0100764000175200017560000003244507623404405015411 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_debugger_c__ #define __rcs_id_ll_debugger_c__ static const char __rcs_id_ll_debugger_c[] = "$Id: debugger.c,v 1.11 2003/02/15 09:31:49 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /* a simple debugger */ ll_define_primitive(activation_record, print_frame, 1, _(self,port), _0()) { /* Print a stack backtrace */ ll_v port = ll_ARGC >= 2 ? ll_ARGV[1] : ll_undef; // ll_THIS->_db_at_rtn, port = ll_format(port, " ~S: (~N", 2, ll_make_fixnum(_ll_ar_sp_bottom - (ll_activation_record*) ll_UNBOX_ref(ll_SELF)), ll_THIS->_op); { size_t i = 0, l = ll_THIS->_argc; ll_v meth, formals; meth = ll_THIS->_meth; formals = ll_NE(meth, ll_undef) ? ll_call(ll_o(method_formals), 1, (meth)) : ll_undef; for ( i = 0; i < l; i ++ ) { ll_v formal; if ( ll_NE(formals, ll_undef) && ! ll_nullQ(formals) ) { if ( ll_unbox_boolean(ll_call(ll_o(symbolQ), 1, (formals))) ) { formal = ll_make_fixnum(i); formals = ll_undef; } else { formal = ll_car(formals); formals = ll_cdr(formals); } } else { formal = ll_make_fixnum(i); } ll_format(port, " #|~S|#~F ~N", 2, formal, ll_THIS->_argv[i]); } } ll_format(port, ")\n ~N ~N\n", 2, ll_THIS->_type, ll_THIS->_meth ); } ll_define_primitive_end /* (print-backtrace ? ? ?) */ ll_define_primitive(activation_record, print_backtrace, 1, _(ar,depth), _0()) { /* Print a stack backtrace */ ll_activation_record *ar = (void*) ll_UNBOX_ref(ll_SELF); int n; ll_activation_record *mark = ll_ARGC >= 3 ? ll_UNBOX_ref(ll_ARGV[2]) : 0; ll_v port = ll_ARGC >= 4 ? ll_ARGV[3] : ll_undef; if ( ll_ARGC >= 2 ) { n = ll_unbox_fixnum(ll_ARGV[1]); } else { n = -1; } while ( n != 0 && ar != _ll_ar_sp_bottom ) { ll_format(port, ar == mark ? "=> " : " ", 0); ll_call(ll_o(print_frame), 2, (ll_make_ref(ar), port)); ar ++; if ( n > 0 ) n --; } } ll_define_primitive_end ll_define_primitive(activation_record, get_arg, 2, (db,var), _0()) { /* Returns a locative to a argument on the stack, var can be an integer or a variable name. */ int i = -1, l = ll_THIS->_argc; do { /* If a numeric idenitifier is specified, make sure its in range. */ while ( ll_ISA_fixnum(ll_ARGV[1]) ) { i = ll_UNBOX_fixnum(ll_ARGV[1]); if ( ! (0 <= i && i < l) ) { ll_ARGV[1] = _ll_range_error(ll_s(var), ll_ARGV[1], 0, l - 1); } goto found_arg; } /* Must have been a formal name. */ if ( i == -1 ) { ll_v meth, formals; /* Special keywords */ if ( ll_EQ(ll_ARGV[1], ll_s(_m)) ) { ll_return(ll_make_locative(&ll_THIS->_meth)); } else if ( ll_EQ(ll_ARGV[1], ll_s(_t)) ) { ll_return(ll_make_locative(&ll_THIS->_type)); } else if ( ll_EQ(ll_ARGV[1], ll_s(_d)) ) { ll_return(ll_make_locative(&ll_THIS->_db_at_rtn)); } else if ( ll_EQ(ll_ARGV[1], ll_s(_o)) ) { ll_return(ll_make_locative(&ll_THIS->_op)); } meth = ll_THIS->_meth; formals = ll_NE(meth, ll_undef) ? ll_call(ll_o(method_formals), 1, (meth)) : ll_undef; for ( i = 0; i < l; i ++ ) { ll_v formal; if ( ll_NE(formals, ll_undef) && ! ll_nullQ(formals) ) { if ( ll_unbox_boolean(ll_call(ll_o(symbolQ), 1, (formals))) ) { if ( ll_EQ(formals, ll_ARGV[1]) ) { goto found_arg; } } else { formal = ll_car(formals); if ( ll_EQ(formal, ll_ARGV[1]) ) { goto found_arg; } formals = ll_cdr(formals); } } } ll_ARGV[1] = _ll_undefined_variable_error(ll_ARGV[1]); } } while (1); found_arg: ll_return(ll_make_locative(&ll_THIS->_argv[i])); } ll_define_primitive_end /*********************************************************************/ ll_define_primitive(debugger, locative_properties, 1, (db), _1(no_side_effect,"#t")) { ll_return(ll_make_locative(&ll_THIS->_properties)); } ll_define_primitive_end /* (initialize ? ? ?) */ ll_define_primitive(debugger, initialize, 1, _(db,args), _0()) { ll_v ar = ll_ARGC >= 2 ? ll_ARGV[1] : ll_make_ref(_ll_ar_sp + 1); ll_THIS->_top_of_ar_stack = ar; ll_THIS->_current_ar = ll_THIS->_top_of_ar_stack; ll_THIS->_properties = ll_ARGC >= 3 ? ll_ARGV[2] : ll_nil; ll_THIS->_error = ll_ARGC >= 4 ? ll_ARGV[3] : ll_f; ll_write_barrier_SELF(); /* Make properties = (error-values ) if value == nil */ if ( ll_nullQ(ll_THIS->_properties) && ll_unbox_boolean(ll_THIS->_error) ) { ll_THIS->_properties = ll_call(ll_o(properties), 1, (ll_THIS->_error)); } //ll_format(ll_undef, ":initialize ar = ~S\n", 1,ll_ARGV[1]); //ll_format(ll_undef, ":initialize = ~S\n", 1, ll_SELF); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(debugger, _write_shallow_contents, 2, (obj, port), _0()) { ll_format(ll_ARGV[1], "current-ar ~S top-of-ar-stack ~S properties ~S error ~S", 4, ll_THIS->_current_ar, ll_THIS->_top_of_ar_stack, ll_THIS->_properties, ll_THIS->_error); } ll_define_primitive_end #if 0 ll_define_primitive(object, db, 0, (), _0()) { ll_return(ll_fluid(ll_s(db))); } ll_define_primitive_end #endif ll_define_macro(object, db, 0, _(args)) { ll_v fdb = ll_listn(2, ll_s(fluid), ll_s(db)); if ( ll_ARGC == 0 ) { /* (db) => (fluid db) */ ll_return(fdb); } else { /* (db . ) => ( (fluid db) . ) */ ll_v op, args; op = ll_ARGV[0]; /* (db (get|set) . ) => ((get|set) (fluid db) (quote ) . = 2 ) { ll_tail_call(ll_THIS->_exit, 1, (ll_ARGV[1])); } else { ll_tail_call(ll_THIS->_exit, 0, ()); } } ll_define_primitive_end ll_define_primitive(debugger, get_loc, 2, (db,var), _0()) { ll_tail_call(ll_o(get_arg), 2, (ll_THIS->_current_ar, ll_ARGV[1])); } ll_define_primitive_end ll_define_primitive(debugger, get, 2, (db,var), _0()) { ll_v loc; loc = ll_call(ll_o(get_arg), 2, (ll_THIS->_current_ar, ll_ARGV[1])); ll_tail_call(ll_o(contents), 1, (loc)); } ll_define_primitive_end ll_define_primitive(debugger, set, 3, (db,var,value), _0()) { ll_v loc; loc = ll_call(ll_o(get_arg), 2, (ll_THIS->_current_ar, ll_ARGV[1])); ll_tail_call(ll_o(set_contentsE), 2, (loc, ll_ARGV[2])); } ll_define_primitive_end ll_define_primitive(debugger, bt, 1, _(db,depth), _0()) { ll_v depth = ll_ARGC >= 2 ? ll_ARGV[1] : ll_BOX_fixnum(-1); ll_tail_call(ll_o(print_backtrace), 3, (ll_THIS->_top_of_ar_stack, depth, ll_THIS->_current_ar)); } ll_define_primitive_end ll_define_primitive(debugger, pf, 1, (db), _0()) { ll_tail_call(ll_o(print_frame), 1, (ll_THIS->_current_ar)); } ll_define_primitive_end ll_define_primitive(debugger, up, 1, _(db,depth), _0()) { int n = 1; ll_activation_record *ar; if ( ll_ARGC >= 2 ) { n = ll_unbox_fixnum(ll_ARGV[1]); } ar = (ll_activation_record*) ll_UNBOX_ref(ll_THIS->_current_ar); ar += n; if ( (void*) ar < (void*) ll_UNBOX_ref(ll_THIS->_top_of_ar_stack) ) { ar = (void*) ll_UNBOX_ref(ll_THIS->_top_of_ar_stack); } if ( n == 0 || (void*) ar > (void*) _ll_ar_sp_bottom ) { ar = (void*) _ll_ar_sp_bottom; } ll_THIS->_current_ar = ll_make_ref(ar); ll_write_barrier_SELF(); ll_tail_call(ll_o(print_frame), 1, (ll_THIS->_current_ar)); } ll_define_primitive_end ll_define_primitive(debugger, down, 1, _(db,depth), _0()) { int n = 1; ll_activation_record *ar; if ( ll_ARGC >= 2 ) { n = ll_unbox_fixnum(ll_ARGV[1]); } ar = (ll_activation_record*) ll_UNBOX_ref(ll_THIS->_current_ar); ar -= n; if ( n == 0 || (void*) ar < (void*) ll_UNBOX_ref(ll_THIS->_top_of_ar_stack) ) { ar = (void*) ll_UNBOX_ref(ll_THIS->_top_of_ar_stack); } if ( (void*) ar > (void*) _ll_ar_sp_bottom ) { ar = (void*) _ll_ar_sp_bottom; } ll_THIS->_current_ar = ll_make_ref(ar); ll_write_barrier_SELF(); ll_tail_call(ll_o(print_frame), 1, (ll_THIS->_current_ar)); } ll_define_primitive_end ll_define_primitive(debugger, error, 1, (db), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_error); } ll_define_primitive_end ll_define_primitive(debugger, help, 1, (db), _0()) { ll_format(ll_undef, "\n\ ==================================================================\n\ \nDebugger help:\n\ Current error: ~S\n\ Properties: ~S\n\ \n\ (top-level)\n\ \tReturn to the top-level.\n\ (db error)\n\ \tGet the error that envoked the debugger.\n\ (db exit ??)\n\ \tReturn from debugger with .\n\ (db bt ?n?)\n\ \tPrint a stack backtrace n frames long.\n\ (db pf)\n\ \tPrint the current stack frame.\n\ (db up ?n?)\n\ \tGo up the stack n frames. (db up 0) goes to the root stack frame.\n\ (db down ?n?)\n\ \tGo down the stack n frames. (db down 0) goes to the top stack frame.\n\ (db get var)\n\ \tGet the argument named 'var' from current stack frame.\n\ (db set var value)\n\ \tSet the argument named 'var' from current stack frame with 'value'.\n\ (db help)\n\ \tThis help message.\n\ ==================================================================\n\ \n\ ", 2, ll_THIS->_error, ll_THIS->_properties); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(activation_record, debugger, 1, _(ar, props), _0()) { ll_v ar, props, db; ar = ll_SELF; props = ll_ARGC >= 2 ? ll_ARGV[1] : ll_nil; db = ll_call(ll_o(make), 3, (ll_type(debugger), ar, props)); //ll_format(ll_undef, ":debugger db = ~S\n", 1, db); ll_tail_call(ll_o(debug), 1, (db)); } ll_define_primitive_end ll_define_primitive(object, debugger, 0, _(ar), _0()) { ll_v props = ll_ARGC >= 1 ? ll_SELF : ll_nil; ll_tail_call(ll_o(debugger), 2, (ll_make_ref(_ll_ar_sp + 1), props)); } ll_define_primitive_end ll_define_primitive(error, debugger, 1, (err), _0()) { ll_v db; //ll_DEBUG_SET(trace, ll_make_fixnum(2)); //ll_format(ll_undef, ":debugger self = ~S\n", 1, ll_SELF); //ll_format(ll_undef, ":debugger self->ar = ~S\n", 1, ll_THIS->_ar); db = ll_call(ll_o(make), 4, (ll_type(debugger), ll_THIS->_ar, ll_THIS->_properties, ll_SELF)); //ll_format(ll_undef, ":debugger db = ~S\n", 1, db); ll_tail_call(ll_o(debug), 1, (db)); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(debugger, debug, 1, (db), _0()) { /* The debugger loop */ ll_v expr, def = ll_unspec, result = ll_unspec; ll_v port = ll_undef; ll_v exit = ll_undef; /* Begin debugger session */ port = ll_format(port, "ll debugger: type '(db help)' for help.\n", 0); /* Print the return action prompt */ def = ll_call(ll_o(property), 2, (ll_SELF, ll_s(return_default))); if ( ll_unbox_boolean(def) ) { def = ll_cdr(def); } else { def = ll_unspec; } expr = ll_call(ll_o(property), 2, (ll_SELF, ll_s(return_action))); if ( ll_unbox_boolean(expr) ) { expr = ll_cdr(expr); ll_format(port, "Use (db exit ) to ~A (default is ~S)\n", 2, expr, def); } else if ( ll_NE(def, ll_unspec) ) { expr = ll_unspec; ll_format(port, "Use (db exit ) to return control (default is ~S)\n", 1, def); } /* Begin a catch for this (db exit) */ ll_CATCH_BEGIN(ll_type(object), exit); { ll_THIS->_exit = exit; ll_write_barrier_SELF(); ll_THIS->_level = ll_fluid(ll_s(dbClevel)); ll_write_barrier_SELF(); /* (let-fluid ( (db self) (db:level level + 1) ( ) ... */ ll_let_fluid(); { /* Bind (fluid db) to this debugger. */ ll_bind_fluid(ll_s(db), ll_SELF); ll_THIS->_level = ll__ADD(ll_THIS->_level, ll_make_fixnum(1)); ll_write_barrier_SELF(); /* Bind (fluid db:level) to this debugger level. */ ll_bind_fluid(ll_s(dbClevel), ll_THIS->_level); /* Prompt and read an expression until eof */ while ( expr = ll_call(ll_o(llCtop_levelCprompt_read_eval), 2, (ll_s(ll_debug), ll_THIS->_level)), ll_NE(expr,ll_eos) ) result = expr; } ll_let_fluid_END(); } ll_CATCH_VALUE(thrown); { /* (db exit ) was called. */ result = thrown; } ll_CATCH_END; /* If result was not specified return default. */ if ( ll_eqQ(result, ll_unspec) ) { result = def; } /* Return result back to caller. */ ll_return(result); } ll_define_primitive_end /************************************************************************/ ll_v _ll_debug_at_rtn(ll_v *rtnval) { ll_v ar, db, props; /* Disable debug at this activation record. */ ll_AR_DB_AT_RTN = ll_f; ar = ll_make_ref(_ll_ar_sp); props = ll_listn(1, ll_cons(ll_s(return_default), *rtnval)); db = ll_call(ll_o(make), 3, (ll_type(debugger), ar, props)); *rtnval = ll_call(ll_o(debug), 1, (db)); return *rtnval; } /************************************************************************/ ll_INIT(debugger,270,"") { ll_bind_fluid(ll_s(db), ll_f); ll_bind_fluid(ll_s(dbClevel), ll_make_fixnum(0)); return 0; } /************************************************************************/ ll0.13/src/ll/defs.pl0100744000175200017560000000433007262415714014731 0ustar stephensstephens# $Id: defs.pl,v 1.4 2001/02/05 23:51:45 stephens Exp $ $args = join(" ", $0, @ARGV); %defs = (); %def_files = (); $source_lines = 0; if ( $ARGV[0] =~ /^--?s/ ) { $source_lines ++; shift; } $n = shift; $def = shift; #print STDERR "n = '$n', def = '$def'\n"; print "/* DO NOT MODIFY! Generated by $args */\n"; $file = ''; $line = 1; LINE: while ( <> ) { #print STDERR "$_"; #print STDERR $_ if ( /$n/ ); chomp; $line ++; if ( s/^#(line)?\s*([0-9]+)(\s*"([^"]*)")?// ) { $file = $4 if ( $4 ); $line = $2; } else { $line ++; } while ( $_ ne '' ) { if ( s/^$n\s*[(]//o ) { $x = ''; my $in_paren = 1; while ( $in_paren ) { if ( $_ eq '' ) { $_ = <>; last LINE if ( ! defined $_ ); chomp; ++ $line; print STDERR "more paren: $file:$line\n"; } s/^([^()"]+|[()"])//; my $app = $1; #print STDERR "app='$app'\n"; if ( $app eq '"' ) { my $in_quote = 1; while ( $in_quote ) { if ( $_ eq '' ) { $_ = <>; last LINE if ( ! defined $_ ); ++ $line; #print STDERR "more string: $file:$line\n"; } s/^(.|\n)//s; my $c = $1; $in_quote -- if ( $c eq '"' && $app !~ /\\$/s ); $in_quote = 0 if ( $c eq '' ); $app .= $c; } } else { $app =~ s/\s+//g; } #print STDERR "$file: x = '$x', app = '$app'\n"; $x .= $app; $in_paren ++ if ( $app eq '(' ); $in_paren -- if ( $app eq ')' ); $in_paren = 0 if ( $app eq '' ); } $x =~ s/\)$//; $defs{$x} = 1; $def_files{$x} .= ' ' . $file . ':' . $line; #print STDERR "$file: $x\n"; } else { s/^\w+|.//; #print STDERR "$_"; } } } @defs = sort keys %defs; #print STDERR join(" ", @defs), "\n"; foreach $x ( @defs ) { @xfiles = split(/ /, $def_files{$x}); $xfiles = ''; ($file, $line) = split(/:/, $xfiles[1]); if ( $source_lines ) { print "#line $line \"$file\"\n"; %xfiles = (); foreach $f ( @xfiles ) { ($file, $line) = split(/:/, $f); $xfiles{$file} ++; } $xfiles = join(" ", sort(keys(%xfiles))); $xfiles = "\t\t/*$xfiles */"; } print "$def($x)"; print $xfiles if ( $xfiles ); print "\n"; } print "#undef $def\n"; 1; ll0.13/src/ll/defs.sh0100644000175200017560000000120507001132745014714 0ustar stephensstephens#!/bin/sh # $Id: defs.sh,v 1.6 1999/10/13 16:40:05 stephensk Exp $ o="$$" f='' t='' tmp="$$.tmp" opts= while [ $# -gt 0 ] do case "$1" in -) var="$2"; val="$3"; shift 2 eval "$var='$val'" ;; *) echo ${CPP} ${CFLAGS} "-D$f=$f" "-D$t=$t" "$1" 1>&2 if ${CPP} ${CFLAGS} "-D$f=$f" "-D$t=$t" "$1" then true else echo "$(CPP) errors" 1>&2 rm $tmp exit 1 fi ;; esac shift done > $tmp echo "$0: file: $tmp" 1>&2 perl defs.pl $opts "$f" "$t" < $tmp > "${o}n" if cmp -s "${o}n" "${o}" then true else echo "${o} changed" cp "${o}n" "${o}" fi rm "${o}n" $tmp ll0.13/src/ll/doc.c0100744000175200017560000000340307262415714014364 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_doc_c__ #define __rcs_id_ll_doc_c__ static const char __rcs_id_ll_doc_c[] = "$Id: doc.c,v 1.3 2001/02/05 23:49:40 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /********************************************************************/ ll_define_primitive(object, llCdoc, 1, (o), _1(doc,"Returns the documentation string for an object.")) /* Returns a documentation string for a variable name */ { ll_return(ll_f); } ll_define_primitive_end ll_define_primitive(object, set_llCdocE, 2, (self, doc), _1(doc,"Sets the documentation string for an object.")) { ll_return(ll_f); } ll_define_primitive_end ll_define_primitive(properties_mixin, llCdoc, 1, (self), _1(doc,"Returns the documentation string for an object.")) /* Returns a documentation string for a variable name */ { ll_v b = ll_call(ll_o(property), 2, (ll_SELF, ll_s(doc))); ll_tail_call(ll_o(safe_cdr), 1, (b)); } ll_define_primitive_end ll_define_primitive(properties_mixin, set_llCdocE, 2, (self, docstr), _1(doc,"Sets the documentation string for an object.")) { ll_tail_call(ll_o(set_propertyE), 3, (ll_SELF, ll_s(doc), ll_ARGV[1])); } ll_define_primitive_end ll_define_primitive(properties_mixin, append_llCdocE, 2, (self, docstr), _1(doc,"Append to the documentation string for an object.")) { ll_v doc = ll_call(ll_o(llCdoc), 1, (ll_SELF)); if ( ! ll_unbox_boolean(doc) ) { doc = ll_ARGV[1]; } else { ll_v str = _ll_make_string("\n\n", 2); doc = ll_call(ll_o(string_append), 3, (doc, str, ll_ARGV[1])); } ll_tail_call(ll_o(set_llCdocE), 2, (ll_SELF, doc)); } ll_define_primitive_end /********************************************************************/ ll0.13/src/ll/env.c0100764000175200017560000003176107623404627014423 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_env_c__ #define __rcs_id_ll_env_c__ static const char __rcs_id_ll_env_c[] = "$Id: env.c,v 1.19 2003/02/15 09:34:15 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "assert.h" #include /* memset() */ /***********************************************************************/ /* global variables */ #if ll_g_GLOBAL_VAR #ifndef ll_g_def ll_v #define ll_g_def(N) _ll_gv_##N, #include "ll/globals.h" ll_gv__; static ll_v *_ll_gvp[] = { #define ll_g_def(N) &_ll_gv_##N, #include "ll/globals.h" 0 }; #endif #endif /***********************************************************************/ /* ptrs into the environment vectors */ int _ll_env_bindings_n = _ll_g_; ll_v *_ll_env_bindings; const char *_ll_gn[] = { #ifndef ll_g_def #define ll_g_def(N) #N, #include "ll/globals.h" #endif 0 }; ll_v _ll_env; /* The current global environment */ /***********************************************************************/ static ll_v _uninit; /* An uninitialized value. */ ll_v _ll_global_get(ll_v binding) { _ll_tsa_binding *b = ll_THIS_ISA(binding, binding); if ( ll_NE(b->super_object._isa, _uninit) ) { if ( ll_EQ(b->_locative, _ll_gr(__f)) ) { _ll_undefined_variable_error(b->_symbol); fprintf(stderr, "\nll: FATAL: giving up in _ll_g_get()!\n"); abort(); } } return *ll_unbox_locative(b->_locative); } ll_v _ll_global_set(ll_v binding, ll_v value) { _ll_tsa_binding *b = ll_THIS_ISA(binding, binding); if ( ! ll_unbox_boolean(b->_locative) ) { b->_locative = ll_make_locative(&b->_value); ll_write_barrier_pure(binding); } //fprintf(stderr, "_ll_global_set(%s, %s)\n", ll_po(b->_symbol), ll_po(value)); *ll_unbox_locative(b->_locative) = value; ll_write_barrier(ll_unbox_locative(b->_locative)); return value; } /***********************************************************************/ ll_define_primitive(environment, initialize, 1, (env), _0()) { ll_return(ll_SELF); } ll_define_primitive_end /***********************************************************************/ ll_define_primitive(environment, bindings, 1, (env), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_bindings); } ll_define_primitive_end ll_define_primitive(environment, set_bindingsE, 2, (env, bindings), _0()) { ll_THIS->_bindings = ll_ARGV[1]; ll_write_barrier_SELF(); ll_return(ll_THIS->_bindings); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(environment, clone, 1, (env), _0()) { ll_v x; x = ll_call_super(ll_o(clone), ll_f, 1, (ll_SELF)); ll_call(ll_o(set_bindingsE), 2, (x ,ll_call(ll_o(clone), 1, (ll_THIS->_bindings)))); ll_return(x); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(object, SenvironmentS, 0, (), _1(no_side_effect,"#t")) { ll_return(_ll_env); } ll_define_primitive_end ll_define_primitive(environment, Sset_environmentS, 1, (env), _0()) { ll_v x; _ll_env_bindings = _ll_ptr_vector(ll_THIS->_bindings); _ll_env_bindings_n = _ll_len_vector(ll_THIS->_bindings); x = _ll_env; _ll_env = ll_SELF; ll_return(x); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(environment, _binding, 2, (env, var), _1(no_side_effect,"#t")) { /* Lookup a binding or return #f */ ll_v bindings = ll_THIS->_bindings; size_t i, l = _ll_len_vector(bindings); ll_v *v = _ll_ptr_vector(bindings); for ( i = 0; i < l; i ++ ) { //fprintf(stderr, "_binding_index: %3d %s(%ld) %s(%ld)\n", i, ll_po(v[i]), (unsigned long) v[i], ll_po(ll_ARGV[1]), (unsigned long) ll_ARGV[1]); if ( ll_EQ(ll_THIS_ISA(binding, v[i])->_symbol, ll_ARGV[1]) ) { ll_return(v[i]); } } ll_return(ll_f); } ll_define_primitive_end ll_define_primitive(environment, _binding_or_error, 2, (env, var), _1(no_side_effect,"#t")) { do { ll_v binding = ll_call(ll_o(_binding), 2, (ll_SELF, ll_ARGV[1])); if ( ll_unbox_boolean(binding) ) { ll_return(binding); } else { ll_ARGV[1] = _ll_undefined_variable_error(ll_ARGV[1]); } } while ( 1 ); } ll_define_primitive_end ll_define_primitive(environment, _bind, 2, (env, var), _0()) { /* Lookup a binding or create one */ ll_v binding = ll_call(ll_o(_binding), 2, (ll_SELF, ll_ARGV[1])); /* Didn't find one? Create one. */ if ( ll_EQ(binding, ll_f) ) { ll_v bindings = ll_THIS->_bindings; ll_v index; binding = ll_call(ll_o(make), 2, (ll_type(binding), ll_ARGV[1])); index = ll_call(ll_o(vector_length), 1, (bindings)); ll_call(ll_o(append_oneE), 2, (bindings, binding)); /* A hack to force this environment to become the current environment */ if ( ll_EQ(_ll_env, ll_SELF) ) { ll_call(ll_o(Sset_environmentS), 1, (ll_SELF)); } } ll_return(binding); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(environment, symbol_properties, 2, (env, symbol), _1(no_side_effect,"#t")) { ll_v binding = ll_call(ll_o(_binding), 2, (ll_SELF, ll_ARGV[1])); if ( ll_unbox_boolean(binding) ) { ll_tail_call(ll_o(properties), 1, (binding)); } else { ll_return(ll_nil); } } ll_define_primitive_end ll_define_primitive(environment, set_symbol_propertiesE, 3, (env, symbol, plist), _0()) { ll_v binding = ll_call(ll_o(_bind), 2, (ll_SELF, ll_ARGV[1])); ll_tail_call(ll_o(set_propertiesE), 2, (binding, ll_ARGV[2])); } ll_define_primitive_end ll_define_primitive(environment, symbol_property, 3, (env, symbol, prop), _1(no_side_effect,"#t")) { ll_v binding = ll_call(ll_o(_binding), 2, (ll_SELF, ll_ARGV[1])); if ( ll_unbox_boolean(binding) ) { ll_tail_call(ll_o(property), 2, (binding, ll_ARGV[2])); } else { ll_return(ll_f); } } ll_define_primitive_end ll_define_primitive(environment, set_symbol_propertyE, 4, (env, symbol, prop, value), _0()) { ll_v binding = ll_call(ll_o(_bind), 2, (ll_SELF, ll_ARGV[1])); ll_tail_call(ll_o(set_propertyE), 3, (binding, ll_ARGV[2], ll_ARGV[3])); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(environment, make_readonly, 2, (env, var), _0()) { ll_tail_call(ll_o(_set_symbol_propertyE), 3, (ll_ARGV[1], ll_s(readonly), ll_t)); } ll_define_primitive_end /********************************************************************/ ll_define_primitive(environment, _define, 3, _(env, var, value, doc), _0()) { do { ll_v binding; while ( binding = ll_call(ll_o(_bind), 2, (ll_SELF, ll_ARGV[1])), ll_unbox_boolean(ll_call(ll_o(property), 2, (binding, ll_s(readonly)))) ) { ll_ARGV[1] = _ll_readonly_variable_error(ll_ARGV[1]); } /* If a doc string is specified, add it to the object */ if ( ll_ARGC >= 4 ) { ll_call(ll_o(set_llCdocE), 2, (ll_ARGV[1], ll_ARGV[3])); ll_call(ll_o(set_llCdocE), 2, (ll_ARGV[2], ll_ARGV[3])); } ll_tail_call(ll_o(set_binding_valueE), 2, (binding, ll_ARGV[2])); } while ( 1 ); } ll_define_primitive_end ll_define_primitive(environment, _get, 2, (env, var), _1(no_side_effect,"#t")) { ll_v binding = ll_call(ll_o(_binding_or_error), 2, (ll_SELF, ll_ARGV[1])); ll_tail_call(ll_o(binding_value), 1, (binding)); } ll_define_primitive_end ll_define_primitive(environment, _setE, 3, (env, var, value), _0()) { do { ll_v binding; while ( binding = ll_call(ll_o(_binding_or_error), 2, (ll_SELF, ll_ARGV[1])), ll_unbox_boolean(ll_call(ll_o(property), 2, (binding, ll_s(readonly)))) ) { ll_ARGV[1] = _ll_readonly_variable_error(ll_ARGV[1]); } ll_tail_call(ll_o(_set_binding_valueE), 2, (binding, ll_ARGV[2])); } while ( 1 ); } ll_define_primitive_end ll_define_primitive(environment,_undefine, 2, (env, var), _0()) { ll_tail_call(ll_o(_setE), 3, (ll_SELF, ll_ARGV[1], ll_undef)); } ll_define_primitive_end ll_define_primitive(environment,_make_locative, 2, (env, var), _0()) { ll_v binding = ll_call(ll_o(_binding_or_error), 2, (ll_SELF, ll_ARGV[1])); ll_tail_call(ll_o(locative_binding_value), 1, (binding)); } ll_define_primitive_end /*********************************************************************/ ll_define_primitive(environment,_define_macro,3,(env, var, proc), _0()) { do { ll_v binding; #if 1 while ( binding = ll_call(ll_o(_bind), 2, (ll_SELF, ll_ARGV[1])), ll_unbox_boolean(ll_call(ll_o(property), 2, (binding, ll_s(readonly)))) ) { ll_ARGV[1] = _ll_readonly_variable_error(ll_ARGV[1]); } #endif ll_tail_call(ll_o(set_binding_macroE), 2, (binding, ll_ARGV[2])); } while ( 1 ); } ll_define_primitive_end ll_define_primitive(environment,_macro,2,(env, var), _1(no_side_effect,"#t")) { ll_v binding = ll_call(ll_o(_binding), 2, (ll_SELF, ll_ARGV[1])); if ( ll_unbox_boolean(binding) ) { ll_tail_call(ll_o(binding_macro), 1, (binding)); } else { ll_return(ll_f); } } ll_define_primitive_end /********************************************************************/ ll_define_primitive(symbol,_binding,1,(var), _0()) { ll_tail_call(ll_o(_binding), 2, (_ll_env, ll_SELF)); } ll_define_primitive_end ll_define_primitive(symbol,_get,1,(var), _0()) { ll_tail_call(ll_o(_get), 2, (_ll_env, ll_SELF)); } ll_define_primitive_end ll_define_primitive(symbol,_define,2,_(var,value,doc), _0()) { if ( ll_ARGC >= 3 ) { ll_tail_call(ll_o(_define), 4, (_ll_env, ll_SELF, ll_ARGV[1], ll_ARGV[2])); } else { ll_tail_call(ll_o(_define), 3, (_ll_env, ll_SELF, ll_ARGV[1])); } } ll_define_primitive_end ll_define_primitive(symbol,_macro,1,(var), _0()) { ll_tail_call(ll_o(_macro), 2, (_ll_env, ll_SELF)); } ll_define_primitive_end ll_define_primitive(symbol,_setE,2,(var,value), _0()) { ll_tail_call(ll_o(_setE), 3, (_ll_env, ll_SELF, ll_ARGV[1])); } ll_define_primitive_end ll_define_primitive(symbol,_make_locative,1,(symbol), _0()) { ll_tail_call(ll_o(_make_locative), 2, (_ll_env, ll_SELF)); } ll_define_primitive_end /*******************************************************************/ static ll_v _ll_make_raw_binding() { ll_v *x = ll_malloc(sizeof(_ll_tsa_binding)); _ll_tsa_binding *b = (void*) x; { int i; for ( i = 0; i < sizeof(_ll_tsa_binding)/sizeof(ll_v); i ++ ) { x[i] = _uninit; } /* bind binding to value slot. */ b->_locative = ll_BOX_locative(&b->_value); ll_write_barrier_ptr_pure(x); } return(ll_make_ref(x)); } ll_INIT(env1,10,"create a raw environment") { int i; /* Fill it with some bogus value */ memset(&_uninit, ~0, sizeof(_uninit)); _ll_env_bindings = ll_malloc(sizeof(_ll_env_bindings[0]) * _ll_g_); for ( i = 0; i < _ll_g_; i ++ ) { ll_v x = _ll_env_bindings[i] = _ll_make_raw_binding(); #if ll_g_GLOBAL_VAR _ll_tsa_binding *b = ll_THIS_ISA(binding, x); b->_locative = ll_BOX_locative(_ll_gvp[i]); ll_write_barrier_ptr_pure(b); #endif ll_write_barrier_ptr_pure(_ll_env_bindings); } return 0; } ll_INIT(env2,115,"init globals to undef") { int i; /* Fill in undefined binding values for environment */ for ( i = 0; i < _ll_g_; i ++ ) { ll_v x = _ll_env_bindings[i]; _ll_tsa_binding *b = ll_THIS_ISA(binding, x); ll_TYPE_ref(x) = ll_type(binding); ll_write_barrier(x); if ( ll_EQ(b->_locative, _uninit) ) { //ll_warn_msg(env,!"binding locative changed", ("binding %s: was %s", _ll_gn(i), ll_po_(b->_locative))); b->_locative = ll_make_locative(&b->_value); ll_write_barrier(x); } if ( ll_EQ(*ll_UNBOX_locative(b->_locative), _uninit) ) { //ll_warn_msg(env,!"binding *loc changed", ("binding %s: was %s", _ll_gn(i), ll_po_(*ll_UNBOX_locative(b->_locative)))); *ll_UNBOX_locative(b->_locative) = ll_undef; ll_write_barrier(x); } if ( ll_EQ(b->_value, _uninit) ) { //ll_warn_msg(env,!"binding value changed", ("binding %s: was %s", _ll_gn(i), ll_po_(b->_value))); b->_value = ll_undef; ll_write_barrier(x); } if ( ll_EQ(b->_macro, _uninit) ) { //ll_warn_msg(env,!"binding macro changed", ("binding %s", _ll_gn(i))); b->_macro = ll_f; ll_write_barrier(x); } if ( ll_EQ(b->_properties, _uninit) ) { //ll_warn_msg(env,!"binding properties changed", ("binding %s", _ll_gn(i))); b->_properties = ll_nil; ll_write_barrier(x); } } return 0; } ll_INIT(env3,160,"add the objects to the environment") { int i; /* Fill in symbol in the binding */ for ( i = 0; i < _ll_g_; i ++ ) { ll_v sym = _ll_make_symbol_(_ll_escape_symbol(_ll_gn[i])); ll_v b = _ll_env_bindings[i]; ll_THIS_ISA(binding, b)->_symbol = sym; ll_write_barrier(b); } return 0; } ll_INIT(env4,250,"create the object") { /* Create an environment */ _ll_env = ll_call(ll_o(make), 1, (ll_type(environment))); ll_call(ll_o(set_bindingsE), 2, (_ll_env, _ll_make_vector(_ll_env_bindings, _ll_g_))); ll_call(ll_o(Sset_environmentS), 1, (_ll_env)); return 0; } /*********************************************************************/ ll0.13/src/ll/env.ll0100644000175200017560000000063307001133706014562 0ustar stephensstephens(define-constant (make (list ) (list 'parent 'values 'macros))) (define %ll:value-binding (make )) (define %ll:macro-binding (make )) (add-method (%ll:value-binding ( parent values) (env sym)) (let* ((b (assq (values)))) (if b b (error env sym)))) ll0.13/src/ll/eq.c0100744000175200017560000000747107230471357014235 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_eq_c__ #define __rcs_id_ll_eq_c__ static const char __rcs_id_ll_eq_c[] = "$Id: eq.c,v 1.8 2001/01/15 03:47:59 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" #define X ll_SELF #define Y ll_ARGV[1] /************************************************************************/ ll_define_primitive(object, eqQ, 2, (x, y), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(ll_EQ(X, Y))); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(object, eqvQ, 2, (x, y), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(ll_EQ(X, Y))); } ll_define_primitive_end ll_define_primitive(fixnum, eqvQ, 2, (x, y), _1(no_side_effect,"#t")) { ll_v t2; if ( ll_EQ(ll_ARGV[0], ll_ARGV[1]) ) { ll_return(ll_t); } t2 = ll_TYPE(ll_ARGV[1]); if ( ll_EQ(t2, ll_type(fixnum)) ) { ll_return(ll_make_boolean(ll_unbox_fixnum(ll_SELF) == ll_unbox_fixnum(ll_ARGV[1]))); } else if ( ll_EQ(t2, ll_type(flonum)) ) { ll_return(ll_make_boolean(ll_unbox_fixnum(ll_SELF) == ll_unbox_flonum(ll_ARGV[1]))); } ll_return(ll_f); } ll_define_primitive_end ll_define_primitive(flonum, eqvQ, 2, (x, y), _1(no_side_effect,"#t")) { ll_v t2; if ( ll_EQ(ll_ARGV[0], ll_ARGV[1]) ) { ll_return(ll_t); } t2 = ll_TYPE(ll_ARGV[1]); if ( ll_EQ(t2, ll_type(flonum)) ) { ll_return(ll_make_boolean(ll_unbox_flonum(ll_SELF) == ll_unbox_flonum(ll_ARGV[1]))); } else if ( ll_EQ(t2, ll_type(fixnum)) ) { ll_return(ll_make_boolean(ll_unbox_flonum(ll_SELF) == ll_unbox_fixnum(ll_ARGV[1]))); } ll_return(ll_f); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(constant, equalQ, 2, (x, y), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(ll_EQ(X, Y))); } ll_define_primitive_end ll_define_primitive(symbol, equalQ, 2, (x, y), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(ll_EQ(X, Y))); } ll_define_primitive_end ll_define_primitive(immediate, equalQ, 2, (x, y), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(ll_EQ(X, Y))); } ll_define_primitive_end ll_define_primitive(number, equalQ, 2, (x, y), _1(no_side_effect,"#t")) { __ll_tail_callv(ll_o(eqvQ), 2); } ll_define_primitive_end /****************************************************************************/ ll_define_primitive(object, equalQ, 2, (x, y), _1(no_side_effect,"#t")) { /* Check if they are eq? */ if ( ll_EQ(X, Y) ) ll_return(ll_t); /* First check if the types are the same */ if ( ll_NE(ll_TYPE(X), ll_TYPE(Y)) ) { /* Check if the object's immutable type counterparts are the same */ ll_v t1 = ll_call(ll_o(immutable_type), 1, (ll_ARGV[0])); ll_v t2 = ll_call(ll_o(immutable_type), 1, (ll_ARGV[1])); if ( ll_NE(t1, t2) ) { ll_return(ll_f); } } __ll_tail_callv(ll_o(_equalQ), 2); } ll_define_primitive_end ll_define_primitive(object, _equalQ, 2, (x, y), _1(no_side_effect,"#t")) { size_t i; ll_v *x = ll_SLOTS(X), *y = ll_SLOTS(Y); i = ll_unbox_fixnum(ll_call(ll_o(type_size), 1, (ll_TYPE(X)))) / sizeof(ll_v); x ++; y ++; /* skip slot[0] (isa) because object::equal? already did it */ while ( -- i > 1 ) { if ( ! ll_equalQ(*(x ++), *(y ++)) ) ll_return(ll_f); } X = *x; Y = *y; __ll_tail_callv(ll_o(equalQ), 2); } ll_define_primitive_end /****************************************************************************/ int ll_equalQ(ll_v x, ll_v y) { return ll_unbox_boolean(ll_call(ll_o(equalQ), 2, (x, y))); } int ll_eqvQ(ll_v x, ll_v y) { return ll_unbox_boolean(ll_call(ll_o(eqvQ), 2, (x, y))); } #ifdef ll_eqQ #undef ll_eqQ #endif int ll_eqQ(ll_v x, ll_v y) { return ll_EQ(x, y); } /****************************************************************************/ #undef X #undef Y ll0.13/src/ll/error.c0100744000175200017560000001723407262415714014757 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_error_c__ #define __rcs_id_ll_error_c__ static const char __rcs_id_ll_error_c[] = "$Id: error.c,v 1.17 2001/02/05 23:57:51 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include ll_define_primitive(error, initialize, 2, _(self, value, values), _0()) { ll_call_super(ll_o(initialize), ll_f, 1, (ll_SELF)); ll_THIS->_ar = ll_make_ref(_ll_ar_sp + 1); ll_THIS->_properties = ll_nil; if ( ll_ARGC >= 3 ) { ll_v x = ll_nil, *xp = &x; size_t i; for ( i = 1; i < ll_ARGC - 1; i += 2 ) { if ( ll_EQ(ll_ARGV[i], ll_s(ar)) ) { ll_THIS->_ar = ll_ARGV[i + 1]; } xp = &ll_CDR(*xp = ll_cons(ll_ARGV[i], ll_ARGV[i + 1])); } ll_THIS->_properties = x; } else { ll_THIS->_properties = ll_ARGV[1]; /* a list */ } ll_write_barrier_SELF(); /* Add the debug expr. */ { extern ll_v *_ll_debug_expr; if ( _ll_debug_expr ) { ll_THIS->_properties = ll_cons( ll_cons(ll_s(expr), *_ll_debug_expr), ll_THIS->_properties); } } //ll_format(ll_undef, ":initialize self->ar = ~S\n", 1, ll_THIS->_ar); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(error, error_ar, 1, (err), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_ar); } ll_define_primitive_end ll_define_primitive(error, locative_properties, 1, (err), _1(no_side_effect,"#t")) { ll_return(ll_make_locative(&ll_THIS->_properties)); } ll_define_primitive_end ll_define_primitive(error, _write_shallow_contents, 2, (obj, port), _0()) { #if 0 _ll_tsa_activation_record *ar = ll_THIS_ISA(activation_record, ll_THIS->_ar); ll_format(ll_ARGV[1], "op ~S", 1, ar->_op); if ( ar->_argc ) { ll_format(ll_ARGV[1], " rcvr ~S", 1, ar->_argv[0]); } #endif { int did_one = 0; ll_LIST_LOOP(ll_THIS->_properties, x); { ll_v key = ll_car(x); if ( ll_NE(key, ll_s(return_action)) ) { ll_format(ll_ARGV[1], (did_one ++ ? " ~S" : "~S"), 1, x); } } ll_LIST_LOOP_END; } } ll_define_primitive_end /****************************************************************/ /* Error handler methods */ ll_define_primitive(error, handle_error, 1, (self), _0()) { /* The default for handle-error is print backtrace, envoke the debugger and escape to top-level read-eval-print loop */ ll_v result; ll_let_fluid(); { ll_bind_fluid(ll_s(current_error), ll_SELF); //ll_DEBUG_SET(trace, ll_make_fixnum(2)); fflush(stdout); ll_format(ll_undef, "\nll: ~S\n", 1, ll_SELF); result = ll_call(ll_o(debugger), 1, (ll_SELF)); } ll_let_fluid_END(); ll_tail_call(ll_o(top_level), 1, (result)); } ll_define_primitive_end ll_define_primitive(recoverable_error, handle_error, 1, (self), _0()) { /* Recoverable errors print backtrace, and tail-call the debugger. */ ll_v result; ll_let_fluid(); { ll_bind_fluid(ll_s(current_error), ll_SELF); //ll_DEBUG_SET(trace, ll_make_fixnum(2)); fflush(stdout); ll_format(ll_undef, "\nll: ~S\n", 1, ll_SELF); result = ll_call(ll_o(debugger), 1, (ll_SELF)); } ll_let_fluid_END(); ll_return(result); } ll_define_primitive_end void ll_abort() { static int aborting; if ( ! aborting ) { ++ aborting; ll_call(ll_o(print_backtrace), 1, ll_make_ref(_ll_ar_sp)); fprintf(stderr, "\nll: aborting\n"); } abort(); } ll_define_primitive(fatal_error, handle_error, 1, (self), _0()) { /* Fatal errors print themselves and abort() */ ll_v type = ll_TYPE(ll_SELF); ll_v values = ll_THIS->super_error._properties; fflush(stdout); fprintf(stderr, "\nll: FATAL error: %s", ll_po(type)); fflush(stderr); while ( ! ll_nullQ(values) ) { ll_v v = ll_car(values); ll_v key = ll_car(v); ll_v value = ll_cadr(v); v = ll_cdr(values); fprintf(stderr, " %s %s", ll_po(key), ll_po(value)); fflush(stderr); } fprintf(stderr, "\n"); fflush(stderr); ll_abort(); } ll_define_primitive_end /************************************************************************/ ll_v _ll_error(ll_v type, int nargs, ...) { ll_v rtn = ll_undef; int n; va_list vap; ll_v values = ll_nil, *valuesr = &values; if ( 1 || ll_NE(ll_g(__building_internal_error), ll_f) ) { ll_set_g(__building_internal_error, ll_t); /* Create an assocation list of values for the error */ #define APPEND(key,value) \ valuesr = &ll_CDR(*valuesr = ll_cons(ll_cons(key, value), ll_nil))\ va_start(vap, nargs); n = nargs; while ( n -- ) { ll_v key = va_arg(vap, ll_v); ll_v value = va_arg(vap, ll_v); APPEND(key, value); } va_end(vap); #undef APPEND rtn = ll_call(ll_o(make), 2, (type, values)); ll_set_g(__building_internal_error, ll_f); rtn = ll_call(ll_o(handle_error), 1, (rtn)); return(rtn); } /* Must have generated an error while creating and error object */ fflush(stdout); fprintf(stderr, "\nll: FATAL error: %s op %s rcvr-type %s", ll_po(type), ll_po(ll_AR_OP), ll_po(ll_AR_TYPE)); va_start(vap, nargs); n = nargs; while ( n -- ) { ll_v key = va_arg(vap, ll_v); ll_v value = va_arg(vap, ll_v); fprintf(stderr, " %s %s", ll_po(key), ll_po(value)); } va_end(vap); fprintf(stderr, "\n\nAborting in _ll_error().\n"); fflush(stderr); ll_abort(); return(rtn); } /****************************************************************/ /* Common error constructors */ ll_v _ll_argc_error() { ll_v meth = ll_AR_METH; return(_ll_error( ll_re(arg_count), 4, ll_s(op), ll_AR_OP, ll_s(meth), _ll_ar_sp[1]._meth, ll_s(called_argc), ll_make_fixnum(ll_ARGC), ll_s(expected_argc), ll_call(ll_o(method_minargc), 1, (meth)) )); } ll_v _ll_range_error(ll_v name, ll_v value, long low, long high) { ll_v range = ll_cons(ll_make_fixnum(low), ll_make_fixnum(high)); return(_ll_error(ll_re(range), 4, ll_s(name), name, ll_s(value), value, ll_s(range), range, ll_s(return_action), ll_listn(2, _ll_make_string("specify a value within the range", -1), range) )); } ll_v _ll_rangecheck(ll_v name, ll_v *value, long low, long high) { while ( ! (ll_ISA_fixnum(*value) && low <= ll_UNBOX_fixnum(*value) && ll_UNBOX_fixnum(*value) <= high) ) { *value = _ll_range_error(name, *value, low, high); } return(*value); } ll_v _ll_undefined_variable_error(ll_v name) { return(_ll_error(ll_re(undefined_variable), 3, ll_s(name), name, ll_s(return_action), _ll_make_string("specify a variable name to get.", -1), ll_s(return_default), name )); } ll_v _ll_readonly_variable_error(ll_v name) { return(_ll_error(ll_re(readonly_variable), 2, ll_s(name), name, ll_s(return_action), _ll_make_string("specify a variable name to modify.", -1) )); } ll_v _ll_typecheck_error(ll_v type, ll_v value) { fprintf(stderr, "typecheck-error: %s %s\n", ll_po(type), ll_po(value)); return(_ll_error(ll_re(typecheck), 3, ll_s(type), type, ll_s(value), value, ll_s(return_action), ll_listn(2, _ll_make_string("specify a value of the type ", -1), type) )); } /* typecheck */ ll_define_primitive(object, _bad_typecheck, 2, (self, type), _0()) { ll_return(_ll_typecheck_error(ll_ARGV[1], ll_ARGV[0])); } ll_define_primitive_end ll_v _ll_typecheck(ll_v type, ll_v *value) { ll_v value_type = ll_TYPE(*value); if ( ll_NE(value_type, type) ) { return *value; } else { return *value = (ll_call(ll_call(ll_o(typechecker), 1, (type)), 2, (*value, type))); } } /***********************************************************************/ ll_INIT(error,280,"") { ll_bind_fluid(ll_s(current_error), ll_f); return 0; } /***********************************************************************/ ll0.13/src/ll/fixnum.c0100744000175200017560000001465607230471502015131 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_fixnum_c__ #define __rcs_id_ll_fixnum_c__ static const char __rcs_id_ll_fixnum_c[] = "$Id: fixnum.c,v 1.15 2001/01/15 03:49:22 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /************************************************************************/ long ll_unbox_fixnum(ll_v x) { while ( ! ll_ISA_fixnum(x) ) { x = _ll_typecheck_error(ll_type(fixnum), x); } return ll_UNBOX_fixnum(x); } #define _ll_NUM fixnum #define _ll_NUM_BOX(X)ll_make_fixnum(X) #define _ll_NUM_UNBOX(X)ll_unbox_fixnum(X) #include "num.c" /************************************************************************/ ll_define_primitive(fixnum, oddQ, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(ll_UNBOX_fixnum(ll_SELF) % 2)); } ll_define_primitive_end ll_define_primitive(fixnum, evenQ, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean((ll_UNBOX_fixnum(ll_SELF) % 2) == 0)); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(fixnum, quotient, 2, (n1, n2), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(ll_UNBOX_fixnum(ll_SELF) / ll_unbox_fixnum(ll_ARGV[1]))); } ll_define_primitive_end ll_define_primitive(fixnum, remainder, 2, (n1, n2), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(ll_UNBOX_fixnum(ll_SELF) % ll_unbox_fixnum(ll_ARGV[1]))); } ll_define_primitive_end ll_define_primitive(fixnum, modulo, 2, (n1, n2), _1(no_side_effect,"#t")) { long n1, n2, m; n1 = ll_UNBOX_fixnum(ll_ARGV[0]); n2 = ll_unbox_fixnum(ll_ARGV[1]); m = n1 % n2; if ( ((n2 > 0) ^ (m < 0)) == 0 ) { m = n2 + m; } ll_return(ll_make_fixnum(m)); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(fixnum, _gcd, 2, (n1, n2), _1(no_side_effect,"#t")) { long u, v, r; /* Euclid from Knuth, V2, P.337 */ u = ll_UNBOX_fixnum(ll_ARGV[0]); if ( u < 0 ) u = - u; v = ll_unbox_fixnum(ll_ARGV[1]); if ( v < 0 ) v = - v; while ( v ) { r = u % v; u = v; v = r; } ll_return(ll_make_fixnum(u)); } ll_define_primitive_end ll_define_primitive(integer, _lcm, 2, (n1, n2), _1(no_side_effect,"#t")) { ll_v d = ll_call(ll_o(_gcd), 2, (ll_ARGV[0], ll_ARGV[1])); ll_tail_call(ll_o(abs), 1, (ll_call(ll_o(_MUL), 2, (ll_ARGV[0], (ll_call(ll_o(_DIV), 2, (ll_ARGV[1], d))))))); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(fixnum, numerator, 1, (q), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(fixnum, denominator, 1, (q), _1(no_side_effect,"#t")) { ll_return(ll_BOX_fixnum(1)); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(fixnum, floor, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(fixnum, ceiling, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(fixnum, truncate, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(fixnum, round, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(fixnum, rationalize, 2, (n1, n2), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum((double) ll_UNBOX_fixnum(ll_SELF) / (double) ll_unbox_fixnum(ll_ARGV[1]))); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(fixnum, exact__inexact, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum(ll_UNBOX_fixnum(ll_SELF))); } ll_define_primitive_end ll_define_primitive(fixnum, inexact__exact, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(fixnum, number__string, 1, _(z,radix), _1(no_side_effect,"#t")) { char buf[32], *s = buf + sizeof(buf); int radix = 10; long x = ll_UNBOX_fixnum(ll_SELF); int neg; if ( (neg = x < 0) ) { x = - x; } if ( ll_ARGC >= 2 ) { radix = ll_unbox_fixnum(_ll_rangecheck(ll_s(radix), &ll_ARGV[1], 2, 36)); } *(-- s) = '\0'; do { *(-- s) = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[x % radix]; x /= radix; } while ( x ); if ( neg ) { *(-- s) = '-'; } ll_return(_ll_make_copy_string(s, (size_t) -1)); } ll_define_primitive_end /************************************************************************/ /* numeric and relational subprims */ #define BOP(N,O) \ ll_define_primitive(fixnum, _##N, 2, (n1, n2), _1(no_side_effect,"#t")) \ { \ if ( ll_ISA_fixnum(ll_ARGV[1]) ) { \ ll_return(ll_make_fixnum(ll_UNBOX_fixnum(ll_SELF) O ll_UNBOX_fixnum(ll_ARGV[1]))); \ } else if ( ll_ISA_flonum(ll_ARGV[1]) ) { \ ll_return(ll_make_flonum(ll_UNBOX_fixnum(ll_SELF) O ll_UNBOX_flonum(ll_ARGV[1]))); \ } else { \ ll_return(_ll_typecheck(ll_type(number), &ll_ARGV[1])); \ } \ } \ ll_define_primitive_end #define UOP(N,O) \ ll_define_primitive(fixnum, _##N, 1, (n), _1(no_side_effect,"#t")) \ { \ ll_return(ll_make_fixnum( O ll_UNBOX_fixnum(ll_SELF))); \ } \ ll_define_primitive_end #define ROP(N,OP) \ ll_define_primitive(fixnum, _##N, 2, (n1, n2), _1(no_side_effect,"#t")) \ { \ if ( ll_ISA_fixnum(ll_ARGV[1]) ) { \ ll_return(ll_make_boolean(ll_UNBOX_fixnum(ll_SELF) OP ll_UNBOX_fixnum(ll_ARGV[1]))); \ } else if ( ll_ISA_flonum(ll_ARGV[1]) ) { \ ll_return(ll_make_boolean(ll_UNBOX_fixnum(ll_SELF) OP ll_UNBOX_flonum(ll_ARGV[1]))); \ } else { \ ll_return(_ll_typecheck(ll_type(number), &ll_ARGV[1])); \ } \ } \ ll_define_primitive_end #include "cops.h" /************************************************************************/ /* bitwise operations */ #define BOP(N,O) \ ll_define_primitive(fixnum, _##N, 2, (n1, n2), _1(no_side_effect,"#t")) \ { \ _ll_typecheck(ll_type(fixnum), &ll_ARGV[1]); \ ll_return(ll_make_fixnum(ll_UNBOX_fixnum(ll_SELF) O ll_UNBOX_fixnum(ll_ARGV[1]))); \ } \ ll_define_primitive_end #define UOP(N,O) \ ll_define_primitive(fixnum, _##N, 1, (n), _1(no_side_effect,"#t")) \ { \ ll_return(ll_make_fixnum( O ll_UNBOX_fixnum(ll_SELF))); \ } \ ll_define_primitive_end #define INT_OPS #include "cops.h" /************************************************************************/ ll0.13/src/ll/floatcfg.c0100644000175200017560000000207606775454212015414 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_floatcfg_c__ #define __rcs_id_ll_floatcfg_c__ static const char __rcs_id_ll_floatcfg_c[] = "$Id: floatcfg.c,v 1.4 1999/10/02 19:10:02 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/value.h" #include #include int main(int argc, char **argv) { int i = 0; double max_error = 0; double eps = 0.1; while ( 1.0 + eps != 1.0 && i < 1000 ) { double x = x + eps; ll_v v = ll_BOX_flonum(x); double vx = ll_UNBOX_flonum(v); double v_vx = fabs(v - vx); double error = fabs(1.0 - v / v_vx); eps *= 0.1; i ++; /* fprintf(stderr, "i = %d, eps = %g\n", i, eps); */ if ( 0 ) { printf("x = %.22g, v = %lu, vx = %.22g, v / (v - vx) = %.22g\n", (double) x, (unsigned long) v, (double) vx, (double) error); } if ( max_error < error ) { max_error = error; } } printf("#define ll_FLO_MAX_ERROR %.22g\n", (double) max_error); printf("#define ll_FLO_DIGITS %d\n", (int) (double) - log10(max_error)); return 0; } ll0.13/src/ll/flonum.c0100744000175200017560000000707607230471503015122 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_flonum_c__ #define __rcs_id_ll_flonum_c__ static const char __rcs_id_ll_flonum_c[] = "$Id: flonum.c,v 1.8 2001/01/15 03:49:23 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include #include "ll/floatcfg.h" #include /* strchr, strcat */ /************************************************************************/ float ll_unbox_flonum(ll_v x) { while ( ! ll_ISA_flonum(x) ) { x = _ll_typecheck_error(ll_type(flonum), x); } return ll_UNBOX_flonum(x); } #define _ll_NUM flonum #define _ll_NUM_BOX(X)ll_make_flonum(X) #define _ll_NUM_UNBOX(X)ll_unbox_flonum(X) #include "num.c" /**************************************************************************/ ll_define_primitive(flonum, floor, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(floor(ll_UNBOX_flonum(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(flonum, ceiling, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(ceil(ll_UNBOX_flonum(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(flonum, truncate, 1, (x), _1(no_side_effect,"#t")) { double x = ll_UNBOX_flonum(ll_SELF); if ( x > 0 ) { ll_return(ll_make_fixnum(floor(ll_UNBOX_flonum(ll_SELF)))); } else { ll_return(ll_make_fixnum(ceil(ll_UNBOX_flonum(ll_SELF)))); } ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(flonum, round, 1, (x), _1(no_side_effect,"#t")) { /* IMPLEMENT: CHECK FOR X.5 */ ll_return(ll_make_fixnum(floor(ll_UNBOX_flonum(ll_SELF) + 0.5))); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(flonum, exact__inexact, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(flonum, inexact__exact, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(flonum, number__string, 1, _(z,radix), _1(no_side_effect,"#t")) { char buf[32]; sprintf(buf, "%." ll_STRINGTIZE(ll_FLO_DIGITS) "g", (double) ll_UNBOX_flonum(ll_SELF)); if ( ! (strchr(buf, 'e') || strchr(buf, '.')) ) { strcat(buf, ".0"); } ll_return(_ll_make_copy_string(buf, (size_t) -1)); } ll_define_primitive_end /************************************************************************/ #define BOP(N,O) \ ll_define_primitive(flonum, _##N, 2, (self, x), _1(no_side_effect,"#t")) \ { \ if ( ll_ISA_flonum(ll_ARGV[1]) ) { \ ll_return(ll_make_flonum(ll_UNBOX_flonum(ll_SELF) O ll_UNBOX_flonum(ll_ARGV[1]))); \ } else if ( ll_ISA_fixnum(ll_ARGV[1]) ) { \ ll_return(ll_make_flonum(ll_UNBOX_flonum(ll_SELF) O ll_UNBOX_fixnum(ll_ARGV[1]))); \ } else { \ ll_return(_ll_typecheck(ll_type(number), &ll_ARGV[1])); \ } \ } \ ll_define_primitive_end #define UOP(N,O) \ ll_define_primitive(flonum, _##N, 1, (self), _1(no_side_effect,"#t")) \ { \ ll_return(ll_make_flonum( O ll_UNBOX_flonum(ll_SELF))); \ } \ ll_define_primitive_end #define ROP(N,OP) \ ll_define_primitive(flonum, _##N, 2, (self, x), _1(no_side_effect,"#t")) \ { \ if ( ll_ISA_flonum(ll_ARGV[1]) ) { \ ll_return(ll_make_boolean(ll_UNBOX_flonum(ll_SELF) OP ll_UNBOX_flonum(ll_ARGV[1]))); \ } else if ( ll_ISA_fixnum(ll_ARGV[1]) ) { \ ll_return(ll_make_boolean(ll_UNBOX_flonum(ll_SELF) OP ll_UNBOX_fixnum(ll_ARGV[1]))); \ } else { \ ll_return(_ll_typecheck(ll_type(number), &ll_ARGV[1])); \ } \ } \ ll_define_primitive_end #include "cops.h" /**************************************************************************/ ll0.13/src/ll/fluid.c0100744000175200017560000000734507230471504014725 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_fluid_c__ #define __rcs_id_ll_fluid_c__ static const char __rcs_id_ll_fluid_c[] = "$Id: fluid.c,v 1.12 2001/01/15 03:49:24 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" ll_define_primitive(symbol, Pfluid_bind, 2, (var, value), _0()) { ll_v old_bindings = ll_g(_fluid_bindings); ll_v binding = ll_cons(ll_SELF, ll_cons(ll_ARGV[1], ll_nil)); ll_set_g(_fluid_bindings, ll_cons(binding, ll_g(_fluid_bindings))); ll_return(old_bindings); } ll_define_primitive_end ll_define_primitive(symbol, Pfluid_binding, 1, _(var,top_levelQ), _1(no_side_effect,"#t")) { ll_v x = ll_g(_fluid_bindings); while ( ! ll_nullQ(x) ) { ll_v binding = ll_car(x); if ( ll_EQ(ll_car(binding), ll_SELF) ) { ll_return(binding); } x = ll_cdr(x); } /* insert at (cdr %top-level-fluid_bindings) */ if ( ll_ARGC > 1 ) { ll_v binding = ll_cons(ll_ARGV[0], ll_cons(ll_ARGV[1], ll_nil)); ll_v bindings = ll_cons(binding, ll_CDR(ll_g(_top_level_fluid_bindings))); ll_set_cdrE(ll_g(_top_level_fluid_bindings), bindings); } ll_return(ll_f); } ll_define_primitive_end /*************************************************************************/ ll_define_primitive(symbol, Pfluid, 1, (var), _1(no_side_effect,"#t")) { do { ll_v binding = ll_call(ll_o(Pfluid_binding), 1, (ll_SELF)); if ( ll_unbox_boolean(binding) ) { ll_return(ll_car(ll_cdr(binding))); } else { ll_SELF = _ll_undefined_variable_error(ll_listn(2, ll_s(fluid), ll_SELF)); } } while ( 1 ); } ll_define_primitive_end ll_define_primitive(symbol, set_PfluidE, 2, (var, value), _0()) { do { ll_v binding = ll_call(ll_o(Pfluid_binding), 1, (ll_SELF)); if ( ll_unbox_boolean(binding) ) { ll_tail_call(ll_o(set_carE), 2, (ll_cdr(binding), ll_ARGV[1])); } else { ll_SELF = _ll_undefined_variable_error(ll_listn(2, ll_s(fluid), ll_SELF)); } } while ( 1 ); } ll_define_primitive_end ll_define_primitive(symbol, define_Pfluid, 2, (var, value), _0()) { ll_v binding = ll_call(ll_o(Pfluid_binding), 2, (ll_SELF, ll_ARGV[1])); if ( ll_unbox_boolean(binding) ) { ll_call(ll_o(set_carE), 2, (ll_cdr(binding), ll_ARGV[1])); } ll_return(ll_g(_fluid_bindings)); } ll_define_primitive_end /*********************************************************/ ll_define_macro(symbol,fluid,1,(var)) { /* (fluid ) => (%fluid (quote )) */ ll_return(ll_listn(2, ll_s(Pfluid), ll_listn(2, ll_s(quote), ll_ARGV[0]))); } ll_define_macro_end ll_define_macro(symbol,define_fluid,2,(var,val)) { /* (define-fluid ) => (define-%fluid (quote ) ) */ ll_return(ll_listn(3, ll_s(define_Pfluid), ll_listn(2, ll_s(quote), ll_ARGV[0]), ll_ARGV[1])); } ll_define_macro_end /*************************************************************************/ ll_v ll_bind_fluid(ll_v name, ll_v value) { return ll_call(ll_o(Pfluid_bind), 2, (name, value)); } void ll_unbind_fluid(ll_v prev_bindings) { ll_set_g(_fluid_bindings, prev_bindings); } ll_v ll_fluid(ll_v name) { return ll_call(ll_o(Pfluid), 1, (name)); } void ll_set_fluid(ll_v name, ll_v value) { ll_call(ll_o(set_PfluidE), 2, (name, value)); } void ll_define_fluid(ll_v name, ll_v value) { ll_call(ll_o(define_Pfluid), 2, (name, value)); } /*************************************************************************/ ll_INIT(fluid1,90,"bindings list") { ll_set_g(_fluid_bindings, ll_nil); ll_set_g(_top_level_fluid_bindings, ll_nil); return 0; } ll_INIT(fluid2,255,"top-level fluid bindings") { ll_bind_fluid(ll_s(_top_level_fluid_bindings), ll_f); ll_set_g(_top_level_fluid_bindings, ll_g(_fluid_bindings)); return 0; } /*************************************************************************/ ll0.13/src/ll/format.c0100744000175200017560000001044207230471574015111 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_format_c__ #define __rcs_id_ll_format_c__ static const char __rcs_id_ll_format_c[] = "$Id: format.c,v 1.13 2001/01/15 03:50:20 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include #include static ll_v _ll_formatv(ll_v port, const char *f, size_t fsize, const ll_v *argv, size_t argc) { const char *f_end = f + fsize; const char *b, *e; ll_v trace_save = ll_DEBUG(trace); ll_DEBUG_SET(trace, ll_make_fixnum(0)); if ( ll_EQ(port, ll_undef) ) { port = ll_call(ll_o(current_output_port), 0, ()); } e = f; while ( e < f_end ) { b = e; while ( e < f_end && *e != '~' ) { e ++; } if ( e - b ) ll_write_string(port, b, e - b); if ( e < f_end ) { if ( *e == '~' ) { ll_v x; e ++; switch ( *(e ++) ) { #define GET (argc -- < 0 ? _ll_error(ll_re(format), 1, ll_s(reason), ll_s(too_many_formats)) : *(argv ++)) case 'A': ll_call(ll_o(display), 2, (GET, port)); break; case 'S': ll_call(ll_o(write), 2, (GET, port)); break; case 'O': x = GET; do_shallow: ll_call(ll_o(_write_shallow), 2, (x, port)); break; case 'F': ll_call(ll_o(flush), 1, (port)); break; /* named object */ case 'N': { const char *name; x = GET; name = (char*) ll_po_(x); if ( name ) { ll_write_string(port, name, (size_t) -1); } else { goto do_shallow; } } break; /* weak ptr */ case 'W': { x = GET; do_weak_ptr: if ( ll_ISA_ref(x) ) { char buf[32]; sprintf(buf, "#p%ld", (unsigned long) ll_UNBOX_ref(x)); ll_write_string(port, buf, (size_t) -1); } else { ll_call(ll_o(write), 2, (x, port)); } } break; /* locative */ case 'L': { char buf[32]; sprintf(buf, "#l%ld", (unsigned long) ll_UNBOX_locative(GET)); ll_write_string(port, buf, (size_t) -1); } break; default: return(_ll_error(ll_re(format), 2, ll_s(reason), ll_s(bad_format_char), ll_s(char), ll_make_char(e[-1]))); } } } } if ( argc ) { return(_ll_error(ll_re(format), 1, ll_s(reason), ll_s(too_many_arguments))); } ll_DEBUG_SET(trace, trace_save); return port; } ll_v ll_format(ll_v port, const char *f, int n, ...) { ll_v *v; va_list vap; va_start(vap, n); #if 0 /* ll_C_ARGS_ON_STACK */ v = (void*) vap; #else v = alloca(sizeof(v[0]) * n); { int i; v = alloca(sizeof(v[0]) * n); for ( i = 0; i < n; i ++ ) { v[i] = va_arg(vap, ll_v); } } #endif va_end(vap); return _ll_formatv(port, f, strlen(f), v, n); } /***************************************************************************/ ll_define_primitive(output_port, llCformat, 2, _(self, format, args), _0()) { size_t l = _ll_len_string(ll_ARGV[1]); const char *f = _ll_ptr_string(ll_ARGV[1]); ll_return(_ll_formatv(ll_SELF, f, l, ll_ARGV + 2, ll_ARGC - 2)); } ll_define_primitive_end /***************************************************************************/ ll_define_primitive(char, llCformatCread_macroCweak, 2, (char, port), _0()) { /* Read macro to handle #l and #p */ unsigned long weak = 0; int loc = ll_UNBOX_char(ll_SELF) == 'l'; ll_v c; c = ll_call(ll_o(peek_char), 1, (ll_ARGV[1])); while ( ll_NE(c, ll_eos) ) { int cc = ll_unbox_char(c); if ( ! isdigit(cc) ) break; weak *= 10; weak += cc - '0'; #if 0 fprintf(stderr, " weak got char '%c', weak = %lu\n", (int) cc, (unsigned long) weak); #endif ll_call(ll_o(read_char), 1, (ll_ARGV[1])); c = ll_call(ll_o(peek_char), 1, (ll_ARGV[1])); } if ( weak ) { if ( loc ) { c = ll_make_locative(weak); } else { c = ll_make_ref(weak); } c = ll_listn(2, ll_s(quote), c); c = ll_cons(c, ll_nil); } else { c = ll_nil; } ll_return(c); } ll_define_primitive_end /***************************************************************************/ ll_INIT(format,300,"read macros") { /* Add our read macros */ ll_call(ll_o(llCreadCdefine_macro_char), 2, (ll_make_char('l'), ll_o(llCformatCread_macroCweak))); ll_call(ll_o(llCreadCdefine_macro_char), 2, (ll_make_char('p'), ll_o(llCformatCread_macroCweak))); return 0; } /***************************************************************************/ ll0.13/src/ll/global.h0100644000175200017560000000060206775057504015070 0ustar stephensstephens#ifndef _ll_global_h #define _ll_global_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_global_h__ #define __rcs_id_ll_global_h__ static const char __rcs_id_ll_global_h[] = "$Id: global.h,v 1.3 1999/10/01 07:14:12 stephensk Exp $"; #endif #endif /* __rcs_id__ */ typedef enum _ll_g { #ifndef ll_g_def #define ll_g_def(X) _ll_g_##X, #include "ll/globals.h" #endif _ll_g_ } _ll_g; #endif ll0.13/src/ll/global1.h0100644000175200017560000000102506775057504015151 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_global1_h__ #define __rcs_id_ll_global1_h__ static const char __rcs_id_ll_global1_h[] = "$Id: global1.h,v 1.6 1999/10/01 07:14:12 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define ll_set_g(X,V)ll_g(X) #include "ll.h" #define ll_p_def(T,N,A,B,O)ll_g(LT##T##GT)ll_g(N) #include "ll/prims.h" #define ll_macro_def(T,N,A,B)ll_g(LT##T##GT)ll_g(N)ll_g(ll_mn(N)) #include "ll/macros.h" #define ll_o_def(N)ll_g(N) #include "ll/ops.h" #define ll_deftype(T,N)ll_g(LT##T##GT) #include "ll/types.h" ll0.13/src/ll/init.c0100744000175200017560000000667007230471642014570 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_init_c__ #define __rcs_id_ll_init_c__ static const char __rcs_id_ll_init_c[] = "$Id: init.c,v 1.11 2001/01/15 03:50:58 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include /* strcmp() */ #include "assert.h" #ifdef ll_DEBUG_PRINTF #undef ll_DEBUG_PRINTF #define ll_DEBUG_PRINTF(N,F)(fprintf(stderr, "%s", #N), fprintf(stderr, F), 0) #endif /***************************************************************************/ /* initialize validation */ typedef struct ll_validator { const char *name; void (*func)(void); } ll_validator; static ll_validator validators[20]; static int nvalidators = 0; void _ll_add_validator(const char *name, void *func) { validators[nvalidators].name = name; validators[nvalidators].func = func; nvalidators ++; } ll_v _ll_validate_ref(ll_v x) { ll_v isa; ll_assert_ref(x); ll_assert_ref(isa = ll_TYPE(x)); ll_assert_msg(init,ll_EQ(ll_TYPE(isa),ll_type(type)),("%s isa = %s", ll_po(x), ll_po(isa))); return isa; } void _ll_validate() { int i; for ( i = 0; i < nvalidators; i ++ ) { //fprintf(stderr, "ll: validate %s...", validators[i].name); (validators[i].func)(); //fprintf(stderr, " ok.\n"); } } /***************************************************************************/ int ll_initialized, ll_initializing; static int init_cmp(const void *a, const void *b) { return (*(_ll_init**) a)->pri - (*(_ll_init**) b)->pri; } ll_INIT(libll,1000,"libll complete") { ll_v list, *lp; int i; /* Save arg list. */ list = ll_nil; lp = &list; for ( i = 0; (*_argvp)[i]; ++ i ) { *lp = ll_cons(_ll_make_copy_string((*_argvp)[i], -1), ll_nil); lp = &ll_CDR(*lp); } //ll_g(llCSargvS) = list; /* Save environement list. */ list = ll_nil; lp = &list; for ( i = 0; (*_envp)[i]; ++ i ) { *lp = ll_cons(_ll_make_copy_string((*_envp)[i], -1), ll_nil); lp = &ll_CDR(*lp); } //ll_g(llCSenvS) = list; return 0; } int ll_init(int *argcp, char ***argvp, char ***envp) { int rtn = 0; int print_inits = 1; if ( ! (ll_initialized || ll_initializing) ) { int i; _ll_init *p; int pri_clash = 0; ll_initializing ++; /* Sort initializers by priority. */ for (i = 0; _ll_inits[i]; i ++) ; qsort(_ll_inits, i, sizeof(_ll_inits[0]), init_cmp); for ( i = 0; (p = _ll_inits[i ++]); ) { if ( ! p->name ) { p->name = ""; } if ( ! p->desc ) { p->desc = ""; } if ( _ll_inits[i] && p->pri >= _ll_inits[i]->pri ) { ll_warn_msg(init,p->pri >= _ll_inits[i]->pri,("init(%s)>=init(%s)", p->name, _ll_inits[i]->name)); pri_clash ++; } if ( print_inits ) { fprintf(stderr, "ll: init %5d %-12s (%s) %s:%d... ", p->pri, p->name, p->desc, p->file, p->line); } rtn = (p->func)(argcp, argvp, envp); if ( print_inits ) { fprintf(stderr, "%s\n", rtn ? "FAILED!" : "ok."); } if ( rtn ) { if ( ! print_inits ) { fprintf(stderr, "ll: init %5d %-12s (%s) %s:%d... FAILED!\n", p->pri, p->name, p->desc, p->file, p->line); } break; } _ll_validate(); } ll_assert_msg(init,i > 1,("inits.h might be empty")); ll_assert_msg(init,pri_clash == 0,("%d inits clashed", pri_clash)); ll_initializing --; ll_initialized ++; // ll_call(ll_o(load), 1, (_ll_make_string("lib/ll/test/test.scm", -1))); // ll_call(ll_o(load), 1, (_ll_make_string("${HOME}/.ll_init.scm", -1))); } return rtn; } ll0.13/src/ll/init.h0100664000175200017560000000211307623404434014563 0ustar stephensstephens#ifndef _ll_init_h #define _ll_init_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_init_h__ #define __rcs_id_ll_init_h__ static const char __rcs_id_ll_init_h[] = "$Id: init.h,v 1.3 2003/02/15 09:32:12 stephens Exp $"; #endif #endif /* __rcs_id__ */ extern int ll_initialized; extern int ll_initializing; /* Declarator for the initializer function */ #define ll_INIT_DECL(X) int X (int *_argcp, char ***_argvp, char ***_envp) typedef struct _ll_init { /* Initializer object. */ const char *name; int pri; ll_INIT_DECL((*func)); const char *desc; const char *file; int line; } _ll_init; /* */ ll_INIT_DECL(ll_init); #ifndef _ll_INIT #define _ll_INIT(NAME,PRI,DESC) \ ll_INIT_DECL(_ll_if_##NAME); \ _ll_init _ll_i_##NAME = { \ #NAME, \ PRI, \ &_ll_if_##NAME, \ DESC, \ __FILE__, \ __LINE__ \ }; \ ll_INIT_DECL(_ll_if_##NAME) #endif /* _ll_INIT */ #ifndef ll_INIT #define ll_INIT(NAME,PRI,DESC)_ll_INIT(NAME,PRI,DESC) #endif #ifndef ll_INIT_END #define ll_INIT_END #endif extern _ll_init *_ll_inits[]; #endif ll0.13/src/ll/inits.c0100644000175200017560000000066007001132746014736 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_inits_c__ #define __rcs_id_ll_inits_c__ static const char __rcs_id_ll_inits_c[] = "$Id: inits.c,v 1.2 1999/10/13 16:40:06 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/init.h" #ifndef ll_INIT_def #define ll_INIT_def(N,P,D) extern _ll_init _ll_i_##N; #include "ll/inits.h" _ll_init *_ll_inits[] = { #define ll_INIT_def(N,P,D) &_ll_i_##N, #include "ll/inits.h" 0 }; #endif ll0.13/src/ll/lcache.c0100644000175200017560000000313707010230144015020 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_lcache_c__ #define __rcs_id_ll_lcache_c__ static const char __rcs_id_ll_lcache_c[] = "$Id: lcache.c,v 1.3 1999/11/04 07:06:12 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "lcache.h" void _ll_lookup_w_cache(ll_lcache *c) { struct ll_lcache_elem *p = c->_elems; struct ll_lcache_elem *e = ll_lcache_end(c); ll_v isa = ll_AR_ARGC ? ll_TYPE(ll_AR_ARGV[0]) : ll_type(object); while ( p < e ) { if ( ll_EQ(p->_isa, isa) && ll_EQ(p->_op, ll_AR_OP) ) { /* Has op been assocated with any new types or methods? */ if ( ll_NE(p->_timestamp, ll_THIS_ISA(operation, ll_AR_OP)->_timestamp) ) { goto update_cache; } /* Update hit count. */ p->_hits ++; /* Unload cache. */ ll_AR_METH = p->_meth; ll_AR_TYPE = p->_type; ll_AR_TYPE_OFFSET = p->_off; /* Keep cache sorted by decreasing hits. */ while ( p > c->_elems && p->_hits > (p - 1)->_hits ) { struct ll_lcache_elem temp = *(p - 1); *(p - 1) = *p; *p = temp; p --; } return; } else if ( ll_EQ(p->_op, ll_undef) ) { /* An empty cache slot was found, use it. */ fill_cache: p->_op = ll_AR_OP; p->_isa = isa; update_cache: p->_timestamp = ll_THIS_ISA(operation, ll_AR_OP)->_timestamp; _ll_lookup(); p->_meth = ll_AR_METH; p->_type = ll_AR_TYPE; p->_off = ll_AR_TYPE_OFFSET; p->_hits = 1; return; } /* Try next slot. */ p ++; } /* Reuse last cache slot. */ p --; goto fill_cache; } ll0.13/src/ll/lcache.h0100644000175200017560000000152307010230145015023 0ustar stephensstephens#ifndef _ll_LCACHE_H #define _ll_LCACHE_H /* $Id: lcache.h,v 1.2 1999/11/04 07:06:13 stephensk Exp $ */ #include "value.h" enum { #ifndef ll_lcache_SIZE ll_lcache_SIZE = 4 #endif }; typedef struct ll_lcache { struct ll_lcache_elem { ll_v _op; /* The searched for. */ ll_v _timestamp; /* The 's timestamp when the entry was created. */ ll_v _isa; /* The type that was searched for. */ ll_v _meth; /* The method found. */ ll_v _type; /* The type the method was found in. */ ll_v _off; /* Offset of the implementing type in the searched type. */ unsigned long _hits; /* The number of times this cache slot was hit. */ } _elems[ll_lcache_SIZE]; } ll_lcache; #define ll_lcache_end(L) ((L)->_elems + ll_lcache_SIZE) void _ll_lookup_w_cache(ll_lcache *c); #endif ll0.13/src/ll/lispread.c0100644000175200017560000002362207010230314015404 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_lispread_c__ #define __rcs_id_ll_lispread_c__ static const char __rcs_id_ll_lispread_c[] = "$Id: lispread.c,v 1.13 1999/11/04 07:07:56 stephensk Exp $"; #endif #endif /* __rcs_id__ */ /* ** lispread.c - a generic lisp reader. ** Copyright 1998, 1999 Kurt A. Stephens http://www.acm.org/~stephensk */ /* This lisp reader is very minimal, it does not implement the full Common Lisp syntax. In general it is compliant with the Revised 5 Scheme Report. The ';', '(', ')', '#' and whitespace characters are token terminators. Tokens that are not numbers are assumed to be symbols. This reader does not decaseify symbols before calling STRING_2_SYMBOL. ';' comments are treated as whitespace. Note: the "#!" comment allows lisp files to executable scripts on unix systems that support '#!/usr/local/bin/lisp'. The following synactic structures can be read: Comments ;...\n, #!...\n Quote 'x Lists (a b ...), (a b ... '.' c) Vectors #(a b ...) Characters #\b (#\space and #\newline are not IMPLEMENTED) False #f, #F True #t, #T Unspecified #u, #U (Opt.) Numbers #b0101002, #o1726m #d2349, #x0123456789abcedf, 1234, 1234.00, etc. Strings "...", "\"\\" Symbols asdf, +, etc. To use lispread.c you must defined the following macros and #include "lispread.c" to "glue" it to your code. Macros declared "Opt." are optional. Macro Implementation ========================================================================== VALUE The C type for a lisp value. READ_DECL A C function definition for the lisp read function. Within the body of READ_DECL, the "stream" variable must be bound to a VALUE of the input stream. READ_DECL_END Terminate the read C function definition. Opt. READ_CALL() Call the lisp read function recursively. RETURN(X) Return a VALUE from the READ_DECL function. MALLOC(s) Allocate memory buffer from lisp. REALLOC(p,s) Reallocate a previously MALLOCed buffer from lisp. PEEKC(stream) Peek a C char or EOF from the stream GETC(stream) Read a C char or EOF from the stream EOS The end-of-stream VALUE. CONS(X,Y) Return a new lisp CONS object. IMMUTABLE_CONS(X) Converts pair X to an immutable cons. CAR(CONS) Get the car field of a pair VALUE as in: (car CONS) SET_CDR(CONS,V) Set the cdr field of a pair VALUE as in: (set-cdr! CONS V) SET(LOC,V) Set a local variable as in (set! VARIABLE V). Opt. MAKE_CHAR(I) Create a lisp CHARACTER VALUE from a C integer. LIST_2_VECTOR(X) Convert list VALUE X into a VECTOR VALUE. IMMUTABLE_VECTOR(X) Convert VECTOR VALUE X into an immutable VECTOR VALUE. STRING(char*,int) Create a new lisp STRING VALUE from a MALLOCed buffer. IMMUTABLE_STRING(X) Convert STRING VALUE X to an immutable STRING VALUE. ESCAPE_STRING(X) Return a new STRING VALUE with escaped characters (\\, \") replaced. STRING_2_NUMBER(X) Convert string VALUE X into a NUMBER VALUE, or return F. STRING_2_SYMBOL(X) Convert string VALUE X into a SYMBOL VALUE. SYMBOL(NAME) Return a symbol VALUE for NAME with '_' replaced with '-'. SYMBOL_DOT The "." symbol. CALL_MACRO_CHAR(X) Call the macro character function for the C char X. If the function returns F, continue scanning, otherwise return the CAR of the result. EQ(X,Y) Return non-zero C value if (eq? X Y). NIL The empty list VALUE. T The true VALUE. Opt. F The false VALUE. U The unspecified VALUE. Opt. ERROR(format,...) Raise an error using the printf() format. */ #include /* isspace() */ #ifndef SET #define SET(X,V) ((X) = (V)) #endif static int eat_whitespace_peekchar(VALUE stream) { int c; more_whitespace: while ( (c = PEEKC(stream)) != EOF && isspace(c) ) { #if 0 fprintf(stderr, "eat_whitespace_peekchar(): got '%c'\n", (int) c); fflush(stderr); #endif GETC(stream); } if ( c == ';' ) { #if 0 fprintf(stderr, "eat_whitespace_peekchar(): got '%c'\n", (int) c); fflush(stderr); #endif while ( (c = PEEKC(stream)) != EOF && c != '\n' ) { #if 0 fprintf(stderr, "eat_whitespace_peekchar(): got '%c'\n", (int) c); fflush(stderr); #endif GETC(stream); } goto more_whitespace; } return(c); } READ_DECL { int c; int radix = 10; try_again: c = eat_whitespace_peekchar(stream); if ( c == EOF ) RETURN(EOS); GETC(stream); switch ( c ) { case '\'': RETURN(IMMUTABLE_CONS(CONS(SYMBOL(quote), IMMUTABLE_CONS(CONS(READ_CALL(), NIL))))); case '`': RETURN(IMMUTABLE_CONS(CONS(SYMBOL(quasiquote), IMMUTABLE_CONS(CONS(READ_CALL(), NIL))))); case ',': if ( PEEKC(stream) == '@' ) { GETC(stream); RETURN(IMMUTABLE_CONS(CONS(SYMBOL(unquote_splicing), IMMUTABLE_CONS(CONS(READ_CALL(), NIL))))); } else { RETURN(IMMUTABLE_CONS(CONS(SYMBOL(unquote), IMMUTABLE_CONS(CONS(READ_CALL(), NIL))))); } break; case '(': { VALUE l, lc; l = lc = NIL; while ( (c = eat_whitespace_peekchar(stream)) != EOF ) { VALUE x; if ( c == ')' ) { GETC(stream); break; } SET(x, READ_CALL()); if ( EQ(x, SYMBOL_DOT) ) { if ( EQ(lc, NIL) ) { RETURN(ERROR("expected something before '.' in list")); } SET_CDR(lc, READ_CALL()); IMMUTABLE_CONS(lc); c = eat_whitespace_peekchar(stream); GETC(stream); if ( c != ')' ) { RETURN(ERROR("expected ')': found '%c'", c)); } break; } else { VALUE y = CONS(x, NIL); if ( EQ(lc, NIL) ) { SET(l, y); } else { SET_CDR(lc, y); IMMUTABLE_CONS(lc); } SET(lc, y); IMMUTABLE_CONS(lc); } } IMMUTABLE_CONS(l); RETURN(l); } case '#': hash_again: c = PEEKC(stream); switch ( c ) { case EOF: RETURN(ERROR("eos after '#'")); case '!': while ( (c == PEEKC(stream)) != EOF && c != '\n' ) { GETC(stream); } goto try_again; case '(': RETURN(IMMUTABLE_VECTOR(LIST_2_VECTOR(READ_CALL()))); case '\\': GETC(stream); c = GETC(stream); { const char *charname = 0; /* Handle #\space and #\newline */ if ( tolower(c) == 's' ) { const char *s; charname = " space"; match_charname: s = charname + 2; do { int c2; if ( ! *s ) { //fprintf(stderr, "READ: \#%s => \#%c\n", charname, c); c = charname[0]; break; } c2 = PEEKC(stream); if ( c2 == EOF ) break; if ( tolower(c2) != *(s ++) ) { break; } GETC(stream); } while ( 1 ); } else if ( tolower(c) == 'n' ) { charname = "\nnewline"; goto match_charname; } } if ( c == EOF ) { RETURN(ERROR("eos after '#\\'")); } RETURN(MAKE_CHAR(c)); case 'f': case 'F': GETC(stream); RETURN(F); #ifdef T case 't': case 'T': GETC(stream); RETURN(T); #endif #ifdef U case 'u': case 'U': GETC(stream); RETURN(U); #endif case 'e': case 'E': case 'i': case 'I': GETC(stream); goto hash_again; case 'b': case 'B': GETC(stream); radix = 2; goto read_number; case 'o': case 'O': GETC(stream); radix = 8; goto read_number; case 'd': case 'D': GETC(stream); radix = 10; goto read_number; case 'x': case 'X': GETC(stream); radix = 16; goto read_number; default: #ifdef CALL_MACRO_CHAR { VALUE x; GETC(stream); SET(x, CALL_MACRO_CHAR(c)); if ( EQ(x,F) ) { goto try_again; } else { RETURN(CAR(x)); } } #endif RETURN(ERROR("bad sequence: #%c", c)); } break; case '"': { char *buf; size_t len; len = 0; buf = MALLOC(len + 1); while ( (c = GETC(stream)) != '"' ) { if ( c == EOF ) { RETURN(ERROR("EOS in string")); } buf = REALLOC(buf, len + 2); buf[len ++] = c; if ( c == '\\' ) { if ( (c = GETC(stream)) == EOF ) { RETURN(ERROR("EOS in string")); } buf = REALLOC(buf, len + 2); buf[len ++] = c; } } buf[len] = '\0'; RETURN(IMMUTABLE_STRING(ESCAPE_STRING(STRING(buf, len)))); } read_number: case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case '~': case '!': case '@': case '$': case '%': case '&': case '*': case '_': case '+': case '-': case '=': case ':': case '<': case '>': case '^': case '.': case '?': case '/': case '|': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': { char *buf; size_t len; VALUE s, n; len = 1; buf = MALLOC(len + 1); buf[0] = c; while ( (c = PEEKC(stream)) != EOF && c != ';' && c != '(' && c != ')' && c != '#' && ! isspace(c) ) { GETC(stream); buf = REALLOC(buf, len + 2); buf[len ++] = c; } buf[len] = '\0'; s = STRING(buf, len); n = STRING_2_NUMBER(s, radix); if ( EQ(n, F) ) { RETURN(STRING_2_SYMBOL(s)); } else { RETURN(n); } } break; default: RETURN(ERROR("unexpected character '%c'", c)); } } #ifdef READ_DECL_END READ_DECL_END #endif ll0.13/src/ll/list.c0100744000175200017560000002063407230471701014570 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_list_c__ #define __rcs_id_ll_list_c__ static const char __rcs_id_ll_list_c[] = "$Id: list.c,v 1.11 2001/01/15 03:51:29 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" #include /**********************************************************************/ ll_define_primitive(pair, listQ, 1, (object), _1(no_side_effect,"#t")) { ll_SELF = ll_THIS->_cdr; __ll_tail_callv(ll_o(listQ), 1); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(mutable_pair, __appendE, 2, (list, obj), _0()) { if ( ll_nullQ(ll_THIS->super_pair._cdr) ) { ll_THIS->super_pair._cdr = ll_ARGV[1]; ll_write_barrier_SELF(); } else { ll_SELF = ll_THIS->super_pair._cdr; __ll_tail_callv(ll_o(__appendE), 2); } } ll_define_primitive_end ll_define_primitive(list, _appendE, 2, (list, obj), _0()) { if ( ll_nullQ(ll_SELF) ) { ll_return(ll_ARGV[1]); } else { ll_call(ll_o(__appendE), 2, (ll_SELF, ll_ARGV[1])); } ll_return(ll_SELF); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(object, append, 0, _(lists), _0()) { ll_v x = ll_nil, *xp = &x; int i; if ( ll_ARGC ) { for ( i = 0; i < ll_ARGC - 1; i ++ ) { ll_LIST_LOOP(ll_ARGV[i], e); { xp = &ll_CDR(*xp = ll_cons(e, ll_nil)); } ll_LIST_LOOP_END; } *xp = ll_ARGV[i]; } ll_return(x); } ll_define_primitive_end ll_v _ll_list_reversev(size_t l, const ll_v *v) { ll_v x = ll_nil; while ( l -- ) { x = ll_cons(*(v ++), x); } return x; } ll_define_primitive(list, reverse, 1, (list), _0()) { ll_v to = ll_nil; ll_LIST_LOOP(ll_SELF, x); { to = ll_cons(x, to); } ll_LIST_LOOP_END; ll_return(to); } ll_define_primitive_end ll_define_primitive(list, reverseE, 1, (list), _0()) { ll_v from = ll_SELF; ll_v to = ll_nil; while ( ! ll_nullQ(from) ) { ll_v next = ll_cdr(from); ll_set_cdrE(from, to); to = from; from = next; } ll_return(to); } ll_define_primitive_end ll_define_primitive(pair, list_ref, 2, (list,index), _0()) { do { long i; long l = 0; i = ll_unbox_fixnum(ll_ARGV[1]); ll_LIST_LOOP(ll_SELF, x); { if ( i -- == 0 ) { ll_return(x); } l ++; } ll_LIST_LOOP_END; ll_ARGV[1] = _ll_range_error(ll_s(index), ll_ARGV[1], 0, l - 1); } while(0); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(null, length, 1, (list), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(0)); } ll_define_primitive_end ll_define_primitive(pair, length, 1, (list), _1(no_side_effect,"#t")) { size_t l = 1; ll_v x = ll_THIS->_cdr; while ( ll_NE(x, ll_nil) ) { x = ll_call(ll_o(cdr), 1, (x)); l ++; } ll_return(ll_make_fixnum(l)); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(pair, llCmem, 3, (list, obj, test), _1(no_side_effect,"#t")) { ll_v x; x = ll_THIS->_car; if ( ll_unbox_boolean(ll_call(ll_ARGV[2], 2, (ll_THIS->_car, ll_ARGV[1]))) ) ll_return(ll_SELF); ll_SELF = ll_THIS->_cdr; __ll_tail_callv(ll_o(llCmem), 3); } ll_define_primitive_end ll_define_primitive(null, llCmem, 3, (list, obj, test), _1(no_side_effect,"#t")) { ll_return(ll_f); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(object, memq, 2, (obj, list), _1(no_side_effect,"#t")) { ll_tail_call(ll_o(llCmem), 3, (ll_ARGV[1], ll_ARGV[0], ll_o(eqQ))); } ll_define_primitive_end ll_v ll_memq(ll_v obj, ll_v list) { return(ll_call(ll_o(memq), 2, (obj, list))); } /**********************************************************************/ ll_define_primitive(object, memv, 2, (obj, list), _1(no_side_effect,"#t")) { ll_tail_call(ll_o(llCmem), 3, (ll_ARGV[1], ll_ARGV[0], ll_o(eqvQ))); } ll_define_primitive_end ll_v ll_memv(ll_v obj, ll_v list) { return(ll_call(ll_o(memv), 2, (obj, list))); } /**********************************************************************/ ll_define_primitive(object, member, 2, (obj, list), _1(no_side_effect,"#t")) { ll_tail_call(ll_o(llCmem), 3, (ll_ARGV[1], ll_ARGV[0], ll_o(equalQ))); } ll_define_primitive_end ll_v ll_member(ll_v obj, ll_v list) { return(ll_call(ll_o(member), 2, (obj, list))); } /**********************************************************************/ ll_define_primitive(pair, llCass, 3, (list, obj, test), _1(no_side_effect,"#t")) { ll_v x; x = ll_call(ll_o(car), 1, (ll_THIS->_car)); if ( ll_unbox_boolean(ll_call(ll_ARGV[2], 2, (x, ll_ARGV[1]))) ) ll_return(ll_THIS->_car); ll_SELF = ll_THIS->_cdr; __ll_tail_callv(ll_o(llCass), 3); } ll_define_primitive_end ll_define_primitive(null, llCass, 3, (list, obj, test), _1(no_side_effect,"#t")) { ll_return(ll_f); } ll_define_primitive_end /**********************************************************************/ ll_define_primitive(object, assq, 2, (obj, list), _1(no_side_effect,"#t")) { ll_tail_call(ll_o(llCass), 3, (ll_ARGV[1], ll_ARGV[0], ll_o(eqQ))); } ll_define_primitive_end ll_v ll_assq(ll_v obj, ll_v list) { //fprintf(stderr, "ll_assq sp %p %p %p\n", _ll_val_sp_base, _ll_val_sp, _ll_val_sp_bottom); return(ll_call(ll_o(assq), 2, (obj, list))); } /**********************************************************************/ ll_define_primitive(object, assv, 2, (obj, list), _1(no_side_effect,"#t")) { ll_tail_call(ll_o(llCass), 3, (ll_ARGV[1], ll_ARGV[0], ll_o(eqvQ))); } ll_define_primitive_end ll_v ll_assv(ll_v obj, ll_v list) { return(ll_call(ll_o(assv), 2, (obj, list))); } /**********************************************************************/ ll_define_primitive(object, assoc, 2, (obj, list), _1(no_side_effect,"#t")) { ll_tail_call(ll_o(llCass), 3, (ll_ARGV[1], ll_ARGV[0], ll_o(equalQ))); } ll_define_primitive_end ll_v ll_assoc(ll_v obj, ll_v list) { return(ll_call(ll_o(assoc), 2, (obj, list))); } /**********************************************************************/ ll_define_primitive(list, list__vector, 1, (list), _0()) { size_t i, l = ll_unbox_fixnum(ll_call(ll_o(length), 1, (ll_SELF))); ll_v x = ll_SELF; ll_v *v = ll_malloc(sizeof(v[0]) * l); for ( i = 0; i < l; i ++ ) { v[i] = ll_call(ll_o(car), 1, (x)); x = ll_call(ll_o(cdr), 1, (x)); } ll_return(_ll_make_vector(v, l)); } ll_define_primitive_end ll_define_primitive(vector, vector__list, 1, (vector), _0()) { ll_return(ll_listv(ll_THIS->_length, ll_THIS->_array)); } ll_define_primitive_end ll_define_primitive(object, list, 0, _(elements), _0()) { ll_return(ll_listv(ll_ARGC, ll_ARGV)); } ll_define_primitive_end /*************************************************************/ ll_v ll_listn(int n, ...) { ll_v x = ll_nil, *xp = &x; va_list vap; va_start(vap, n); while ( n -- ) { *xp = ll_cons(va_arg(vap, ll_v), ll_nil); ll_write_barrier_ptr(xp); xp = &ll_CDR(*xp); } va_end(vap); return x; } ll_v ll_listv(int n, const ll_v *v) { ll_v x = ll_nil, *xp = &x; while ( n -- ) { *xp = ll_cons(*(v ++), ll_nil); ll_write_barrier_ptr(xp); xp = &ll_CDR(*xp); } return x; } /*************************************************************/ void _ll_assq_set(ll_v *list, ll_v key, ll_v value) { ll_v *x = list; while ( ll_NE(*x, ll_nil) ) { ll_v a = ll_car(*x); if ( ll_EQ(ll_CAR(a), key) ) { /* Replace existing entry */ ll_set_cdrE(a, value); return; } x = &ll_CDR(*x); } /* Add a new entry! */ *list = ll_cons(ll_cons(key, value), *list); } ll_v _ll_assq_delete(ll_v *x, ll_v key) { while ( ll_NE(*x, ll_nil) ) { ll_v a = ll_car(*x); if ( ll_EQ(ll_CAR(a), key) ) { /* Remove existing entry */ *x = ll_cdr(*x); ll_write_barrier_ptr(x); return a; } x = &ll_CDR(*x); } return ll_f; } ll_v _ll_assq_to_front(ll_v *list, ll_v key) { ll_v x, *xp; x = *(xp = list); while ( ll_NE(x,ll_nil) ) { ll_v a = ll_car(x); if ( ll_EQ(ll_CAR(a), key) ) { /* Move to front */ *xp = ll_cdr(x); ll_write_barrier_ptr(xp); ll_set_cdrE(x, *list); *list = x; ll_write_barrier_ptr(list); return a; } x = *(xp = &ll_CDR(x)); } return ll_f; } /*************************************************************/ ll0.13/src/ll/llt.c0100644000175200017560000000054206677567747014441 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_llt_c__ #define __rcs_id_ll_llt_c__ static const char __rcs_id_ll_llt_c[] = "$Id: llt.c,v 1.4 1999/03/29 03:13:43 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" int main(int argc, char **argv, char **envp) { ll_init(&argc, &argv, &envp); ll_call(ll_o(llCtop_level), 0, ()); return 0; } ll0.13/src/ll/llt.gdb0100644000175200017560000000074407001132746014720 0ustar stephensstephens# $Id: llt.gdb,v 1.7 1999/10/13 16:40:06 stephensk Exp $ #break _ll_pf__ir__ir_const_index #break _ll_pf_byte_code_method_initialize #break main #break abort #break _ll_pf__bmethod_apply_C_object #break _ll_error #break _ll_vs_push #break _ll_ar_push #break _ll_vs_pop #break _ll_ar_pop #break _ll_pf_activation_record__print_backtrace #break _ll_pf_activation_record__print_frame #break _ll_pf_debugger_initialize #break _ll_pf_object_debugger #break _ll_pf_error_debugger run ll0.13/src/ll/load.c0100744000175200017560000000465007230471754014544 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_load_c__ #define __rcs_id_ll_load_c__ static const char __rcs_id_ll_load_c[] = "$Id: load.c,v 1.11 2001/01/15 03:52:12 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include #include /* access(), R_OK */ ll_define_primitive(input_port,load,1,(port), _0()) { ll_v result = ll_undef; ll_v port = ll_SELF; ll_v exprs = ll_nil; /* Read all exprs */ { ll_v *ep = &exprs; ll_v expr = ll_undef; #ifndef ll_LOAD_ONE #define ll_LOAD_ONE 1 #endif while ( (expr = ll_call(ll_o(read), 1, (port))), ll_NE(expr, ll_eos) ) { #if ll_LOAD_ONE //ll_format(ll_undef, " load: ~S\n", 1, expr); result = ll_call(ll_o(eval), 1, (expr)); #else *ep = ll_cons(expr, ll_nil); ep = &ll_CDR(*ep); #endif } } #if ll_LOAD_ONE == 0 /* Evaluate them all */ result = ll_call(ll_o(eval_list), 1, (exprs)); #endif ll_return(result); } ll_define_primitive_end ll_define_primitive(string,load,1,(file), _0()) { ll_v result = ll_undef; ll_v path = ll_SELF; ll_v port; const char *file = _ll_ptr_string(path); /* Scan in directories for readable file, if filename is not absolute. */ if ( file[0] != '/' ) { ll_v x; if ( access(file, R_OK) < 0 ) { ll_v dir = ll_g(llCSload_pathS); ll_LIST_LOOP(dir, x); { char buf[1024]; sprintf(buf, "%s/%s", _ll_ptr_string(x), file); if ( access(buf, R_OK) >= 0 ) { path = _ll_make_copy_string(buf, -1); } } ll_LIST_LOOP_END; } } port = ll_call(ll_o(open_input_file), 1, (path)); result = ll_call(ll_o(load), 1, (port)); ll_call(ll_o(close_input_port), 1, (port)); ll_return(result); } ll_define_primitive_end /***************************************************************************/ ll_INIT(load_path,900,"initializing ll:*load-path*") { const char *path = getenv("LL_LOAD_PATH"); ll_v list = ll_nil; ll_v *lp = &list; /* Initialize ll:*load-path* from LL_LOAD_PATH envvar. */ if ( path ) { int path_sep = strchr(path, ';') ? ';' : ':'; const char *b, *e; e = path; while ( *(b = e) ) { while ( *e && *e != path_sep ) { ++ e; } *lp = ll_cons(_ll_make_copy_string(b, e - b), ll_nil); lp = &ll_CDR(*lp); if ( *e ) { ++ e; } } } ll_g(llCSload_pathS) = list; #if 0 ll_format(ll_undef, "~S=~S\n", 2, ll_s(llCSload_pathS), list); #endif return 0; } ll0.13/src/ll/locative.c0100744000175200017560000000200107230472075015414 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_locative_c__ #define __rcs_id_ll_locative_c__ static const char __rcs_id_ll_locative_c[] = "$Id: locative.c,v 1.6 2001/01/15 03:53:33 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /************************************************************************/ ll_v * ll_unbox_locative(ll_v x) { while ( ! ll_ISA_locative(x) ) { x = _ll_typecheck_error(ll_type(locative), x); } return ll_UNBOX_locative(x); } /************************************************************************/ ll_define_primitive(locative,contents, 1, (locative), _1(no_side_effect,"#t")) { ll_return(*ll_UNBOX_locative(ll_SELF)); } ll_define_primitive_end ll_define_primitive(locative,locative_contents, 1, (locative), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(locative,set_contentsE,2,(locative,value), _0()) { ll_v *loc = ll_UNBOX_locative(ll_SELF); *loc = ll_ARGV[1]; ll_write_barrier(loc); } ll_define_primitive_end ll0.13/src/ll/lookup.c0100664000175200017560000002117607336071337015141 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_lookup_c__ #define __rcs_id_ll_lookup_c__ static const char __rcs_id_ll_lookup_c[] = "$Id: lookup.c,v 1.18 2001/08/13 07:26:28 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" #include "assert.h" #include "sig.h" /* ll_sig_service */ /*************************************************************************/ /* ** _ll_add_method() is in here with _ll_lookup() because the two are so interdependent. */ void _ll_add_method(ll_v type, ll_v op, ll_v meth) { _ll_tsa_type *t = ll_THIS_ISA(type, type); _ll_tsa_operation *o = ll_THIS_ISA(operation, op); if ( ll_EQ(meth, ll_f) ) { _ll_remove_method(type, op); goto done; } /* For the first time OR already a lambda? */ if ( ll_EQ(o->_lambdaQ, ll_undef) || ll_NE(o->_lambdaQ, ll_f) ) { if ( ll_NE(o->_lambda_type, ll_undef) && ll_NE(o->_lambda_type, type) ) { /* ** A lambda method already exists for this op. ** keep the old op->meth assoc by forcing storage into ** the old cache-type. ** Put the op's lambda? method into cache-type, and continue. ** Add a new entry! */ _ll_tsa_type *ot = ll_THIS_ISA(type, o->_lambda_type); ot->_op_meth_alist = ll_cons(ll_cons(op, o->_lambdaQ), ot->_op_meth_alist); o->_lambda_type = ll_undef; } else { /* ** A lambda method has never been add to this method. ** Don't bother adding to type's op-meth-alist; ** just store the type and the method in the operation. */ o->_lambdaQ = meth; o->_lambda_type = type; /* ** Invalidate op's lookup cache, ** because we don't know what the type offset is yet. */ o->_cache_type = ll_f; goto done; } } /* Invalidate op's lookup cache. */ o->_lambdaQ = o->_cache_type = ll_f; /* Add a new entry or set existing. */ _ll_assq_set(&t->_op_meth_alist, op, meth); done: /* Bump the timestamp */ #if ll_USE_LCACHE o->_timestamp = ll_BOX_fixnum(ll_UNBOX_fixnum(o->_timestamp) + 1); #endif } void _ll_remove_method(ll_v type, ll_v op) { _ll_tsa_type *t = ll_THIS_ISA(type, type); _ll_tsa_operation *o = ll_THIS_ISA(operation, op); /* Invalidate the lookup cache */ o->_cache_type = ll_f; if ( ll_EQ(o->_lambda_type, type) ) { o->_lambdaQ = o->_lambda_type = ll_undef; } else { _ll_assq_delete(&t->_op_meth_alist, op); } } /*************************************************************************/ static int _ll_lookup1(ll_v type) { _ll_tsa_type *t = ll_THIS_ISA(type, type); _ll_tsa_operation *o = ll_THIS_ISA(operation, ll_AR_OP); ll_v x; ll_DEBUG_PRINT(lookup, "_ll_lookup1(op = %s, type = %s)\n", ll_po(ll_AR_OP), ll_po(type)); /* Check for lambda. */ if ( ll_EQ(o->_lambda_type, type) ) { /* Put the method in the current activation record */ ll_AR_METH = o->_lambdaQ; /* Rememeber which type we found the method in */ ll_AR_TYPE = type; return 1; } /* Search type's op-meth map. */ x = _ll_assq_to_front(&t->_op_meth_alist, ll_AR_OP); if ( ll_unbox_boolean(x) ) { /* Put the method in the current activation record */ ll_AR_METH = ll_CDR(x); /* Rememeber which type we found the method in */ ll_AR_TYPE = type; return 1; } /* Not found yet, try supers. */ x = t->_supers; while ( ll_NE(x,ll_nil) ) { if ( _ll_lookup1(ll_CAR(x)) ) return 1; x = ll_CDR(x); } return 0; } static void _ll_get_type_offset(ll_v isa) { _ll_tsa_type *t = ll_THIS_ISA(type,isa); ll_v x; x = _ll_assq_to_front(&t->_type_offset_alist, ll_AR_TYPE); if ( ll_unbox_boolean(x) ) { ll_AR_TYPE_OFFSET = ll_CDR(x); return; } _ll_error(ll_fe(type), 3, ll_s(reason), ll_s(cannot_find_type_offset), ll_s(type), ll_AR_TYPE, ll_s(supertype), isa); } void _ll_print_trace(ll_v super) { size_t i, argc; fprintf(stderr, "ll: trace: "); i = _ll_val_sp_bottom - _ll_val_sp; fprintf(stderr, "%4d ", i); while ( i -- ) { fprintf(stderr, " "); } if ( ll_NE(super, ll_undef) ) { fprintf(stderr, "SUPER: (%s ", ll_po(super)); } else { fprintf(stderr, "("); } fprintf(stderr, "%s", ll_po(ll_AR_OP)); for ( i = 0, argc = ll_AR_ARGC; i < argc; i ++ ) { fprintf(stderr, " %s", ll_po(ll_AR_ARGV[i])); } fprintf(stderr, ") in %s\n", ll_po(_ll_ar_sp[1]._meth)); fflush(stderr); } /***********************************************************************/ ll_v _ll_method_not_found_error() { return(_ll_error(ll_re(method_not_found), 0)); } ll_define_primitive(object, _method_not_found, 0, _(args), _0()) { ll_return(_ll_method_not_found_error()); } ll_define_primitive_end static void _ll_lookup_failed() { /* ** Note: this code should do something like: ** Box up the message and attempt to forward it. */ /* Use the ::%method-not-found method to generate an error. */ ll_AR_TYPE = ll_type(object); ll_AR_TYPE_OFFSET = ll_make_fixnum(0); ll_AR_METH = _ll_p_method_not_found; } /***********************************************************************/ static __inline void _ll_lookup_op_check(void) { #if 0 if ( ! ll_initializing ) { #endif ll_v op_type; ll_assert_ref(ll_AR_OP); while ( op_type = ll_TYPE(ll_AR_OP), (ll_NE(op_type, ll_type(operation)) && ll_NE(op_type, ll_type(settable_operation)) && ll_NE(op_type, ll_type(locatable_operation))) ) { ll_AR_OP = _ll_typecheck_error(ll_type(operation), ll_AR_OP); } #if 0 } #endif } void _ll_lookup() { /* service any async signals */ ll_sig_service(); { _ll_tsa_operation *op; ll_v isa = ll_AR_ARGC ? ll_TYPE(ll_AR_ARGV[0]) : ll_type(object); ll_assert_ref(isa); ll_assert_msg(lookup,0 <= ll_AR_ARGC, ("corrupted ar?")); ll_assert_msg(lookup,ll_AR_ARGC <= 256, ("corrupted ar?")); if ( ll_DEBUG(trace) ) { _ll_print_trace(ll_undef); } _ll_lookup_op_check(); op = ll_THIS_ISA(operation,ll_AR_OP); ll_DEBUG_PRINT(lookup, "_ll_lookup(op = %s, isa = %s)\n", ll_po(ll_AR_OP), ll_po(isa)); /* Is the cache valid? */ if ( ! ll_EQ(op->_cache_type, isa) ) { /* If not, do full lookup */ if ( ! _ll_lookup1(isa) ) { /* We did not find a method */ _ll_lookup_failed(); return; } /* Figure out the type offset */ _ll_get_type_offset(isa); /* Fill cache */ op->_cache_type = isa; op->_cache_impl = ll_AR_TYPE; op->_cache_offset = ll_AR_TYPE_OFFSET; op->_cache_method = ll_AR_METH; ll_DEBUG_PRINT(lookup, "_ll_lookup(op = %s, isa = %s, imp = %s, meth = %s)\n", ll_po(ll_AR_OP), ll_po(isa), ll_po(ll_AR_TYPE), ll_po(ll_AR_METH)); return; } /* Load from cache */ ll_AR_TYPE = op->_cache_impl; ll_AR_TYPE_OFFSET = op->_cache_offset; ll_AR_METH = op->_cache_method; ll_DEBUG_PRINT(lookup, "_ll_lookup(op = %s, isa = %s, imp = %s, meth = %s): CACHED\n", ll_po(ll_AR_OP), ll_po(isa), ll_po(ll_AR_TYPE), ll_po(ll_AR_METH)); } } void _ll_lookup_super(ll_v super) { /* service any async signals */ ll_sig_service(); { _ll_tsa_operation *op; ll_v isa = ll_AR_ARGC ? ll_TYPE(ll_AR_ARGV[0]) : ll_type(object); ll_assert_ref(isa); ll_assert_ref(super); if ( ll_DEBUG(trace) ) { _ll_print_trace(super); } _ll_lookup_op_check(); op = ll_THIS_ISA(operation,ll_AR_OP); /* ** If super is #f, begin lookup in the previous activation record's ** implementor's supertypes. */ if ( ll_EQ(super,ll_f) ) { ll_v x; for ( x = ll_THIS_ISA(type,ll_AR_TYPE)->_supers; ll_NE(x, ll_nil); x = ll_CDR(x) ) { if ( _ll_lookup1(ll_CAR(x)) ) goto get_offset; } goto not_found; } else { /* Lookup within the specified supertypes */ if ( ! _ll_lookup1(super) ) { not_found: /* We did not find a method */ _ll_lookup_failed(); return; } } get_offset: _ll_get_type_offset(isa); } } /***********************************************************************/ ll_v __ll_lookup(ll_v type, ll_v op, ll_v super) { ll_v phony_object[1] = { type }; ll_v meth; ll_assert_ref(op); _ll_VS_PROBE(1); _ll_PUSH(ll_make_ref(phony_object)); __ll_lookup_begin(op, 1, (ll_NE(super, ll_undef) ? _ll_lookup_super(super) :_ll_lookup())); meth = ll_AR_METH; __ll_lookup_end(); _ll_POP(); _ll_VS_POP(); return meth; } ll_define_primitive(type, lookup, 2, _(type,op,super), _1(no_side_effect,"#t")) { ll_v type = ll_SELF; ll_v op = ll_ARGV[1]; ll_v super = ll_ARGC >= 3 ? ll_ARGV[2] : ll_undef; ll_v meth = __ll_lookup(type, op, super); if ( ll_EQ(meth, _ll_p_method_not_found) ) { meth = ll_f; } ll_return(meth); } ll_define_primitive_end /***********************************************************************/ ll0.13/src/ll/macro.c0100744000175200017560000001113507262415714014721 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_macro_c__ #define __rcs_id_ll_macro_c__ static const char __rcs_id_ll_macro_c[] = "$Id: macro.c,v 1.17 2001/02/05 23:49:42 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" /*********************************************************/ /* A simple macro expander */ ll_define_primitive(object,macro_expand_1,1,(obj), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end /*********************************************************/ ll_define_primitive(pair,macro_expand_list,1,(obj), _1(no_side_effect,"#t")) { ll_return(ll_cons(ll_call(ll_o(macro_expand), 1, (ll_THIS->_car)), ll_call(ll_o(macro_expand_list), 1, (ll_THIS->_cdr)))); } ll_define_primitive_end ll_define_primitive(null,macro_expand_list,1,(obj), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end /*********************************************************/ ll_define_primitive(pair,macro_expand_1,1,(obj), _1(no_side_effect,"#t")) { ll_v macro; /* Special forms */ if ( ll_EQ(ll_THIS->_car, ll_s(quote)) ) { /* (quote x) => (quote x) */ ll_return(ll_SELF); } else if ( ((ll_EQ(ll_THIS->_car, ll_s(setE)) || ll_EQ(ll_THIS->_car, ll_s(define))) && ll_unbox_boolean(ll_call(ll_o(symbolQ), 1, (ll_car(ll_THIS->_cdr))))) || ll_EQ(ll_THIS->_car, ll_s(lambda)) || ll_EQ(ll_THIS->_car, ll_s(_method)) ) { /* (set! ...) */ /* (define ...) */ /* (lambda . ) => `(lambda . ,(macro-expand-list )) */ /* (%method ( . ) . ) => `(%method ( . ) . ,(macro-expand-list )) */ ll_v x = ll_THIS->_cdr; ll_return(ll_cons(ll_THIS->_car, ll_cons(ll_car(x), ll_call(ll_o(macro_expand_list), 1, (ll_cdr(x)))))); } /* Look up a macro */ if ( ll_unbox_boolean(ll_call(ll_o(symbolQ), 1, (ll_THIS->_car))) ) { macro = ll_call(ll_o(_macro), 2, (ll_call(ll_o(SenvironmentS), 0, ()), ll_THIS->_car)); /* Does the first arg respond to the macro? */ if ( ll_unbox_boolean(macro) ) { ll_v t; /* Determine type of macro rcvr. */ t = ll_nullQ(ll_THIS->_cdr) ? ll_type(object) : ll_TYPE(ll_car(ll_THIS->_cdr)); /* Do a lookup. */ t = ll_call(ll_o(lookup), 2, (t, macro)); /* If macro rcvr doesn't respond to macro op, don't call it. */ if ( ! ll_unbox_boolean(t) ) { macro = ll_f; } } } else { macro = ll_f; } if ( ! ll_unbox_boolean(macro) ) { /* If it's not a macro, expand all the items in the sexpr. */ ll_tail_call(ll_o(macro_expand_list), 1, (ll_SELF)); } else { /* If it's a macro, create a argument list of all the items */ /* What is our argument length? */ size_t l = 0; /* Find out the size of the tmp array, so we can probe the stack. */ { ll_v x = ll_THIS->_cdr; for ( ; ! ll_nullQ(x); x = ll_cdr(x) ) { l ++; } _ll_VS_PROBE(l); } /* Map the list into the tmp array */ { ll_v x = ll_THIS->_cdr; for ( ; ! ll_nullQ(x); x = ll_cdr(x) ) { _ll_PUSH(ll_car(x)); } } /* Reverse */ { ll_v *v = (ll_v*) _ll_val_sp; int i, j; for ( i = l, j = 0; -- i > j; j ++ ) { ll_v t = v[i]; v[i] = v[j]; v[j] = t; } } /* Apply the macro to the arguments */ /* Do a tail call with the current stack */ _ll_tail_callv(macro, l); } } ll_define_primitive_end /*********************************************************/ ll_define_primitive(object,macro_expand,1,(obj), _1(no_side_effect,"#t")) { ll_v x, y = ll_SELF; /* (macro-expand x) calls (let ((y (macro-expand-1 x))) (set! x y)) until (equal? x y) */ // ll_format(ll_undef, "macro-expand: ~S\n", 1, y); do { x = y; y = ll_call(ll_o(macro_expand_1), 1, (x)); } while ( ! ll_equalQ(x, y) ); // ll_format(ll_undef, "macro-expand: RESULT: ~S => ~S\n", 2, ll_SELF, y); ll_return(y); } ll_define_primitive_end /*********************************************************/ ll_INIT(macro,260,"system") { /* Install the macro definitions */ struct { ll_v macro_op; ll_v macro_name; } x[] = { #ifndef ll_macro_def #define ll_macro_def(TYPE,NAME,NARGS,ARGS) { ll_o(ll_mn(NAME)), ll_s(NAME) }, #include "ll/macros.h" #endif { 0 } }; int i; ll_v env = ll_call(ll_o(SenvironmentS), 0, ()); for ( i = 0; x[i].macro_op; i ++ ) { ll_call(ll_o(_define_macro), 3, (env, x[i].macro_name, x[i].macro_op)); } return 0; } /*********************************************************/ ll0.13/src/ll/map.c0100664000175200017560000000647107623404627014407 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_map_c__ #define __rcs_id_ll_map_c__ static const char __rcs_id_ll_map_c[] = "$Id: map.c,v 1.13 2003/02/15 09:34:15 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" ll_define_primitive(operation, apply, 2, _(proc, list, lists), _0()) { /* 6.4. Control features (apply ... ) procedure must be a procedure and must be a list. Calls with the elements of the list (append (list ...) ) as the actual arguments. */ int i = ll_ARGC - 1; int l = 0; _ll_VS_PROBE(ll_ARGC); if ( ! ll_nullQ(ll_ARGV[i]) ) { ll_v args; /* Determine stack probe. */ for ( args = ll_ARGV[i], l = 0; ! ll_nullQ(args); args = ll_cdr(args), l ++ ) { /* NOTHING */ } _ll_VS_PROBE(l + i); /* Push 's elements on to the stack in reverse order */ for ( args = ll_ARGV[i]; ! ll_nullQ(args); args = ll_cdr(args) ) { /* Leave 's car on stack */ _ll_PUSH(args); _ll_callv(ll_o(car), 1); } /* Then reverse them */ { ll_v *v = (ll_v *) _ll_val_sp; int j, k; for ( j = l, k = 0; -- j > k; k ++ ) { ll_v t = v[j]; v[j] = v[k]; v[k] = t; } } } else { _ll_VS_PROBE(i); } /* Now push ... in reverse order */ while ( -- i > 0 ) { _ll_PUSH(ll_ARGV[i]); l ++; } /* tail-call */ { ll_v op = ll_SELF; _ll_tail_callv(op, l); } } ll_define_primitive_end ll_define_primitive(operation, for_each, 2, _(proc, list, lists), _0()) { /* While there are elements in the lists; */ while ( ! ll_nullQ(ll_ARGV[1]) ) { /* ** Push each list's car in reverse order so they are on the stack in ** proper argument order. */ _ll_VS_PROBE(ll_ARGC); { int i; for ( i = ll_ARGC; -- i > 0 ; ) { /* Get the car of the list; leave result on stack */ _ll_PUSH(ll_ARGV[i]); _ll_callv(ll_o(car), 1); /* Advance the list */ ll_ARGV[i] = ll_cdr(ll_ARGV[i]); } } /* Call the proc with the car's of the lists on the stack */ { int argc = ll_ARGC - 1; /* ll_ARGC is side-effected within _ll_callv() */ ll_v op = ll_SELF; _ll_callv(op, argc); _ll_POP(); /* discard result */ //_ll_VS_POP(); } } } ll_define_primitive_end ll_define_primitive(operation, map, 2, _(proc, list, lists), _0()) { ll_v result = ll_nil, *xp = &result; /* While there are elements in the lists; */ while ( ! ll_nullQ(ll_ARGV[1]) ) { /* ** Push each list's car in reverse order so they are on the stack in ** proper argument order. */ _ll_VS_PROBE(ll_ARGC); { int i; for ( i = ll_ARGC; -- i > 0 ; ) { /* Get the car of the list; leave result on stack */ _ll_PUSH(ll_ARGV[i]); _ll_callv(ll_o(car), 1); /* Advance the list */ ll_ARGV[i] = ll_cdr(ll_ARGV[i]); } } /* Call the proc with the car's of the lists on the stack */ { int i = ll_ARGC - 1; /* ll_ARGC is side-effected within _ll_callv()! */ ll_v op = ll_SELF; _ll_callv(op, i); } /* Cons the result */ { ll_v x = _ll_POP(); _ll_VS_POP(); *xp = ll_cons(x, ll_nil); } xp = &ll_CDR(*xp); } ll_return(result); } ll_define_primitive_end ll0.13/src/ll/mem.c0100644000175200017560000000347307001130646014370 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_mem_c__ #define __rcs_id_ll_mem_c__ static const char __rcs_id_ll_mem_c[] = "$Id: mem.c,v 1.6 1999/10/13 16:21:58 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/ll.h" #include "assert.h" /************************************************************************/ #ifdef ll_malloc #undef ll_malloc #endif //#define ll_malloc_limit (10 * 1024) static ll_v _ll_out_of_memory_error() { return _ll_error(ll_fe(out_of_memory), 0); } void *ll_malloc(size_t s) { void *p; #ifdef ll_malloc_limit ll_assert_msg(mem,s < ll_malloc_limit,("possible ::size corruption?")); #endif if ( ! (p = _ll_malloc(s)) ) { _ll_out_of_memory_error(); } return p; } #ifdef ll_realloc #undef ll_realloc #endif void *ll_realloc(void *p, size_t s) { #ifdef ll_malloc_limit ll_assert_msg(mem,s < ll_malloc_limit,("possible ::size corruption?")); #endif if ( ! (p = _ll_realloc(p, s)) ) { _ll_out_of_memory_error(); } return p; } #ifdef ll_free #undef ll_free #endif void ll_free(void *p) { _ll_free(p); } ll_INIT(gc,0,"GC system") { _ll_gc_init(_argcp,_argvp,_envp); return 0; } /************************************************************************/ ll_define_primitive(object, _gcollect, 0, (), _0()) { ll_gcollect(); } ll_define_primitive_end /************************************************************************/ #if 0 #ifdef malloc #undef malloc #endif void *malloc(size_t size) { return size ? ll_malloc(size) : 0; } #ifdef realloc #undef realloc #endif void *realloc(void *ptr, size_t size) { return ptr ? ll_realloc(ptr, size) : malloc(size); } #ifdef free #undef free #endif void free(void *ptr) { if ( ptr ) ll_free(ptr); } #ifdef calloc #undef calloc #endif void *calloc(size_t x, size_t y) { return malloc(x * y); } #endif ll0.13/src/ll/meth.c0100764000175200017560000000340607623404627014563 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_meth_c__ #define __rcs_id_ll_meth_c__ static const char __rcs_id_ll_meth_c[] = "$Id: meth.c,v 1.11 2003/02/15 09:34:15 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /***************************************************************************/ ll_define_primitive(method, method_formals, 1, (meth), _1(no_side_effect,"#t")) { if ( ! ll_unbox_boolean(ll_THIS->_formals) ) { ll_v x = ll_call(ll_o(property), 2, (ll_SELF, ll_s(formals))); if ( ll_unbox_boolean(x) ) { ll_THIS->_formals = ll_cdr(x); } else { ll_THIS->_formals = ll_s(args); } } ll_return(ll_THIS->_formals); } ll_define_primitive_end ll_define_primitive(method, method_minargc, 1, (meth), _1(no_side_effect,"#t")) { int i = 0; ll_v x; ll_call(ll_o(method_formals), 1, (ll_SELF)); x = ll_THIS->_formals; while ( ll_pairQ(x) ) { i ++; x = ll_cdr(x); } ll_return(ll_make_fixnum(i)); } ll_define_primitive_end ll_define_primitive(method, locative_properties, 1, (meth), _1(no_side_effect,"#t")) { ll_return(ll_make_locative(&ll_THIS->_properties)); } ll_define_primitive_end ll_define_primitive(method, method_properties, 1, (meth), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_properties); } ll_define_primitive_end ll_define_primitive(method, method_code, 1, (meth), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_code); } ll_define_primitive_end ll_define_primitive(method, method_consts, 1, (meth), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_consts); } ll_define_primitive_end ll_define_primitive(method, method_env, 1, (meth), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_env); } ll_define_primitive_end /***************************************************************************/ ll0.13/src/ll/named.c0100744000175200017560000000444107262415714014706 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_named_c__ #define __rcs_id_ll_named_c__ static const char __rcs_id_ll_named_c[] = "$Id: named.c,v 1.9 2001/02/05 23:49:44 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" static struct { const char *n; ll_v v; } map[128]; static int map_n; static char *get_buf() { static char buf[8][32]; static int bufi; return buf[bufi = (bufi + 1) % (sizeof(buf)/sizeof(buf[0]))]; } const char *ll_po_(ll_v x) { int i; for ( i = 0; i < map_n; i ++ ) { if ( ll_EQ(map[i].v, x) ) return map[i].n; } if ( ll_initialized ) { for ( i = 0; i < _ll_env_bindings_n; i ++ ) { ll_v binding = _ll_env_bindings[i]; ll_v loc = ll_THIS_ISA(binding, binding)->_locative; if ( ll_ISA_locative(loc) && ll_EQ(*ll_UNBOX_locative(loc), x) ) { ll_v sym = ll_THIS_ISA(binding, binding)->_symbol; return _ll_ptr_string(ll_THIS_ISA(symbol, sym)->_name); } } } return 0; } const char *ll_po(ll_v x) { char *n; ll_v isa = ll_TYPE(x); if ( ll_EQ(x, ll_t) ) { return "#t"; } else if ( ll_EQ(x, ll_f) ) { return "#f"; } else if ( ll_EQ(x, ll_undef) ) { return "#u"; } else if ( ll_EQ(x, ll_unspec) ) { return "#s"; } else if ( ll_EQ(x, ll_nil) ) { return "()"; } else if ( ll_EQ(isa, ll_type(fixnum)) ) { sprintf(n = get_buf(), "%ld", (long) ll_unbox_fixnum(x)); } else if ( ll_EQ(isa, ll_type(char)) ) { sprintf(n = get_buf(), "#\\%c", (int) ll_unbox_char(x)); } else if ( ll_EQ(isa, ll_type(string)) || ll_EQ(isa, ll_type(mutable_string)) ) { n = _ll_ptr_string(x); sprintf(n = get_buf(), "\"%s\"", n ? n : ""); } else if ( ll_EQ(isa, ll_type(symbol)) ) { n = (char*) _ll_name_symbol(x); if ( n ) { sprintf(n = get_buf(), "'%s", n); } else { goto other; } } else if ( ! (n = (char*) ll_po_(x)) ) { const char *tn; other: tn = ll_po_(isa); if ( tn ) { sprintf(n = get_buf(), "#<%s #p%lu>", tn, (unsigned long) ll_UNBOX_ref(x)); return n; } sprintf(n = get_buf(), "#<# #p%lu>", (unsigned long) ll_UNBOX_ref(isa), (unsigned long) ll_UNBOX_ref(x)); } return n; } void _ll_set_object_nameE(ll_v x, const char *name) { map[map_n].n = name; map[map_n].v = x; map_n ++; } ll0.13/src/ll/num.c0100744000175200017560000001047007230472102014405 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_num_c__ #define __rcs_id_ll_num_c__ static const char __rcs_id_ll_num_c[] = "$Id: num.c,v 1.6 2001/01/15 03:53:38 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include #ifndef _ll_NUM #error Must define _ll_NUM #endif #ifndef _ll_NUM_BOX #error Must define _ll_NUM_BOX #endif #ifndef _ll_NUM_UNBOX #error Must define _ll_NUM_UNBOX #endif /************************************************************************/ ll_define_primitive(_ll_NUM, initialize, 1, _(self,args), _1(no_side_effect,"#t")) { ll_return(_ll_NUM_BOX(0)); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(_ll_NUM, abs, 1, (z), _1(no_side_effect,"#t")) { ll_return(_ll_NUM_UNBOX(ll_SELF) < 0 ? _ll_NUM_BOX(- _ll_NUM_UNBOX(ll_SELF)) : ll_SELF); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(_ll_NUM, zeroQ, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(! _ll_NUM_UNBOX(ll_SELF))); } ll_define_primitive_end ll_define_primitive(_ll_NUM, positiveQ, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(_ll_NUM_UNBOX(ll_SELF) > 0)); } ll_define_primitive_end ll_define_primitive(_ll_NUM, negativeQ, 1, (x), _1(no_side_effect,"#t")) { ll_return(ll_make_boolean(_ll_NUM_UNBOX(ll_SELF) < 0)); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(_ll_NUM, exp, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum(exp((double) _ll_NUM_UNBOX(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(_ll_NUM, log, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum(log((double) _ll_NUM_UNBOX(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(_ll_NUM, sin, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum(sin((double) _ll_NUM_UNBOX(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(_ll_NUM, cos, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum(sin((double) _ll_NUM_UNBOX(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(_ll_NUM, tan, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum(tan((double) _ll_NUM_UNBOX(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(_ll_NUM, asin, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum(asin((double) _ll_NUM_UNBOX(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(_ll_NUM, acos, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum(asin((double) _ll_NUM_UNBOX(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(_ll_NUM, atan, 1, _(y,x), _1(no_side_effect,"#t")) { if ( ll_ARGC == 1 ) { ll_return(ll_make_flonum(atan((double) _ll_NUM_UNBOX(ll_SELF)))); } else if ( ll_ARGC == 2 ) { ll_v xt = ll_TYPE(ll_ARGV[1]); double x; if ( ll_EQ(xt, ll_type(fixnum)) ) { x = ll_unbox_fixnum(ll_ARGV[1]); } else if ( ll_EQ(xt, ll_type(flonum)) ) { x = ll_unbox_flonum(ll_ARGV[1]); } else { ll_return(_ll_typecheck(ll_type(real), &ll_ARGV[1])); } ll_return(ll_make_flonum(atan2((double) _ll_NUM_UNBOX(ll_SELF), x))); } } ll_define_primitive_end /************************************************************************/ ll_define_primitive(_ll_NUM, sqrt, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_flonum(sqrt((double) _ll_NUM_UNBOX(ll_SELF)))); } ll_define_primitive_end ll_define_primitive(_ll_NUM, expt, 2, (z1,z2), _1(no_side_effect,"#t")) { ll_v z2t = ll_TYPE(ll_ARGV[1]); if ( ll_EQ(z2t, ll_type(fixnum)) ) { ll_return(_ll_NUM_BOX(pow((double) _ll_NUM_UNBOX(ll_SELF), (double) ll_unbox_fixnum(ll_ARGV[1])))); } else if ( ll_EQ(z2t, ll_type(flonum)) ) { ll_return(ll_make_flonum(pow((double) _ll_NUM_UNBOX(ll_SELF), (double) ll_unbox_flonum(ll_ARGV[1])))); } else { ll_return(_ll_typecheck(ll_type(number), &ll_ARGV[1])); } } ll_define_primitive_end /************************************************************************/ ll_define_primitive(_ll_NUM, magnitude, 1, (z), _1(no_side_effect,"#t")) { ll_return(_ll_NUM_UNBOX(ll_SELF) < 0 ? _ll_NUM_BOX(- _ll_NUM_UNBOX(ll_SELF)) : ll_SELF); } ll_define_primitive_end /************************************************************************/ #undef _ll_NUM #undef _ll_NUM_BOX #undef _ll_NUM_UNBOX ll0.13/src/ll/number.c0100744000175200017560000001054107230472103015076 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_number_c__ #define __rcs_id_ll_number_c__ static const char __rcs_id_ll_number_c[] = "$Id: number.c,v 1.10 2001/01/15 03:53:39 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" /************************************************************************/ ll_define_primitive(object, ADD, 0, _(x), _1(no_side_effect,"#t")) { ll_v x; if ( ll_ARGC == 0 ) { x = ll_make_fixnum(0); } else { int i; x = ll_ARGV[0]; for ( i = 1; i < ll_ARGC; i ++ ) { x = ll_call(ll_o(_ADD), 2, (x, ll_ARGV[i])); } } ll_return(x); } ll_define_primitive_end ll_define_primitive(object, MUL, 0, _(x), _1(no_side_effect,"#t")) { ll_v x; if ( ll_ARGC == 0 ) { x = ll_make_fixnum(1); } else { int i; x = ll_ARGV[0]; for ( i = 1; i < ll_ARGC; i ++ ) { x = ll_call(ll_o(_MUL), 2, (x, ll_ARGV[i])); } } ll_return(x); } ll_define_primitive_end ll_define_primitive(number, SUB, 1, _(x,y), _1(no_side_effect,"#t")) { if ( ll_ARGC == 1 ) { ll_tail_call(ll_o(_NEG), 1, (ll_SELF)); } else { int i; ll_v x = ll_ARGV[1]; for ( i = 2; i < ll_ARGC; i ++ ) { x = ll_call(ll_o(_ADD), 2, (x, ll_ARGV[i])); } ll_tail_call(ll_o(_SUB), 2, (ll_SELF, x)); } } ll_define_primitive_end ll_define_primitive(number, DIV, 1, _(x,y), _1(no_side_effect,"#t")) { if ( ll_ARGC == 1 ) { ll_tail_call(ll_o(_DIV), 2, (ll_make_fixnum(1), ll_SELF)); } else { int i; ll_v x = ll_ARGV[1]; for ( i = 2; i < ll_ARGC; i ++ ) { x = ll_call(ll_o(_MUL), 2, (x, ll_ARGV[i])); } ll_tail_call(ll_o(_DIV), 2, (ll_SELF, x)); } } ll_define_primitive_end /************************************************************************/ ll_define_primitive(object, gcd, 0, _(n), _1(no_side_effect,"#t")) { if ( ll_ARGC == 0 ) { ll_return(ll_make_fixnum(0)); } else { /* From Knuth, v. 2, p. 341 */ int k = ll_ARGC - 1; ll_v d = ll_ARGV[k]; while ( k >= 0 ) { k --; d = ll_call(ll_o(_gcd), 2, (ll_ARGV[k], d)); } ll_return(d); } } ll_define_primitive_end ll_define_primitive(object, lcm, 0, _(n), _1(no_side_effect,"#t")) { if ( ll_ARGC == 0 ) { ll_return(ll_make_fixnum(1)); } else { int k = ll_ARGC - 1; ll_v d = ll_ARGV[k]; while ( k >= 0 ) { k --; d = ll_call(ll_o(_lcm), 2, (ll_ARGV[k], d)); } ll_return(d); } } ll_define_primitive_end /************************************************************************/ ll_define_primitive(real, real_part, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(real, imag_part, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(0)); } ll_define_primitive_end ll_define_primitive(real, magnitude, 1, (z), _1(no_side_effect,"#t")) { __ll_tail_callv(ll_o(abs), 1); } ll_define_primitive_end ll_define_primitive(real, angle, 1, (z), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(0)); } ll_define_primitive_end /************************************************************************/ #define ROP(LT) \ ll_define_primitive(number, LT, 2, _(x, y, z), _1(no_side_effect,"#t")) \ { \ int i; \ for ( i = 1; i < ll_ARGC; i ++ ) { \ ll_v x = ll_call(ll_o(_##LT), 2, (ll_ARGV[i - 1], ll_ARGV[i])); \ if ( ll_EQ(x, ll_f) ) \ ll_return(ll_f); \ } \ ll_return(ll_t); \ } \ ll_define_primitive_end ROP(LT) ROP(GT) ROP(LE) ROP(GE) ROP(EQ) #undef ROP /************************************************************************/ ll_define_primitive(number, max, 2, _(z1,z2,z3), _1(no_side_effect,"#t")) { ll_v x = ll_SELF; int i; for ( i = 1; i < ll_ARGC; i ++ ) { if ( ll_unbox_boolean(ll_call(ll_o(_GT), 2, (ll_ARGV[i], x))) ) { x = ll_ARGV[i]; } } ll_return(x); } ll_define_primitive_end ll_define_primitive(number, min, 2, _(z1,z2,z3), _1(no_side_effect,"#t")) { ll_v x = ll_SELF; int i; for ( i = 1; i < ll_ARGC; i ++ ) { if ( ll_unbox_boolean(ll_call(ll_o(_LT), 2, (ll_ARGV[i], x))) ) { x = ll_ARGV[i]; } } ll_return(x); } ll_define_primitive_end /************************************************************************/ #define BOP(N,O) ll_v ll__##N(ll_v x, ll_v y) { return(ll_call(ll_o(_##N), 2, (x, y))); } #define UOP(N,O) ll_v ll__##N(ll_v x) { return(ll_call(ll_o(_##N), 1, (x))); } #include "cops.h" ll0.13/src/ll/objdump.c0100644000175200017560000000474406676212142015265 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_objdump_c__ #define __rcs_id_ll_objdump_c__ static const char __rcs_id_ll_objdump_c[] = "$Id: objdump.c,v 1.3 1999/03/24 16:35:46 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/ll.h" #define GET_PORT(I) \ ll_v port = ll_ARGC > (I) ? ll_ARGV[I] : ll_call(ll_o(Scurrent_output_portS), 0, ()) ll_define_primitive(immediate, llCobj_dump, 1, _(obj, port), _0()) { GET_PORT(1); ll_tail_call(ll_o(_write_shallow), 2, (ll_SELF, port)); } ll_define_primitive_end ll_define_primitive(type, llC_obj_dump, 4, (super,obj,port,visited), _0()) { ll_v type = ll_ARGV[0]; ll_v port = ll_ARGV[2]; ll_v obj = ll_ARGV[1]; ll_v obj_type = ll_TYPE(obj); ll_v *visited = ll_UNBOX_locative(ll_ARGV[3]); /* Visit supers first, so we get an in slot ordering */ if ( ll_eqQ(ll_memq(type, *visited), ll_f) ) { *visited = ll_cons(type, *visited); /* Do our supers first */ ll_LIST_LOOP(ll_THIS->_supers, super); { ll_call(ll_o(llC_obj_dump), 4, (super, obj, port, ll_ARGV[3])); } ll_LIST_LOOP_END; } { ll_v type_offset, slots_size; const char *obj_base = (const char*) ll_UNBOX_ref(obj); type_offset = ll_assq(type, ll_call(ll_o(type_type_offset_alist), 1, (obj_type))); type_offset = ll_cdr(type_offset); slots_size = ll_THIS->_slots_size; ll_format(port, " ~S\t~S\t~S\n", 3, type, type_offset, slots_size); ll_LIST_LOOP(ll_THIS->_slots, slot); { ll_v slot_name = ll_car(slot); ll_v slot_offset = ll_car(ll_cdr(slot)); ll_v slot_type = ll_cdr(ll_cdr(slot)); size_t offset = ll_unbox_fixnum(type_offset) + ll_unbox_fixnum(slot_offset); ll_format(port, " ~S\t~S\t", 2, slot_name, ll_make_fixnum(offset)); /* No slot type? Print shallow */ if ( ll_EQ(slot_type, ll_nil) ) { ll_format(port, "~O\n", 1, * (ll_v*) (obj_base + offset)); } else { /* Print as ptr */ char buf[32]; sprintf(buf, "#p%p\n", * (void**) (obj_base + offset)); ll_format(port, buf, 0); } } ll_LIST_LOOP_END; } } ll_define_primitive_end ll_define_primitive(object, llCobj_dump, 1, _(obj, port), _0()) { ll_v visited = ll_nil; ll_v obj = ll_SELF; ll_v obj_type = ll_TYPE(ll_SELF); GET_PORT(1); ll_format(port, "#<\n~S ~W ~S\n", 3, obj_type, obj, ll_call(ll_o(type_size), 1, (obj_type))); ll_call(ll_o(llC_obj_dump), 4, (obj_type, obj, port, ll_make_locative(&visited))); ll_format(port, ">\n", 0); } ll_define_primitive_end ll0.13/src/ll/object.c0100744000175200017560000000670407230472104015063 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_object_c__ #define __rcs_id_ll_object_c__ static const char __rcs_id_ll_object_c[] = "$Id: object.c,v 1.7 2001/01/15 03:53:40 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /***********************************************************/ /* Oaklisp 2.2 Operations on Objects Type */ ll_define_primitive(object, get_type, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_TYPE(ll_SELF)); } ll_define_primitive_end /***********************************************************/ /* Oaklisp 2.5 Type Predicates */ ll_define_primitive(object, is_aQ, 2, (object, type), _1(no_side_effect,"#t")) { /* IMPLEMENT */ } ll_define_primitive_end ll_define_primitive(type, subtypeQ, 2, (type1, type2), _1(no_side_effect,"#t")) { /* IMPLEMENT */ } ll_define_primitive_end /***********************************************************/ /* Oaklisp 2.3 Operations on Types */ ll_define_primitive(object, initialize, 1, _(object,args), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end /***********************************************************/ /* Direct slot access */ ll_define_primitive(object, __slot, 2, (object, slot_index), _1(no_side_effect,"#t")) { ll_return(ll_SLOTS(ll_SELF)[ll_unbox_fixnum(ll_ARGV[1])]); } ll_define_primitive_end ll_define_primitive(object, __slotE, 3, (object, slot_index, value), _0()) { ll_SLOTS(ll_SELF)[ll_unbox_fixnum(ll_ARGV[1])] = ll_ARGV[2]; ll_return(ll_SELF); } ll_define_primitive_end /***********************************************************/ /* Object mutablity */ ll_define_primitive(object, immutable_type, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_TYPE(ll_SELF)); } ll_define_primitive_end ll_define_primitive(object, mutable_type, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_TYPE(ll_SELF)); } ll_define_primitive_end ll_define_primitive(immediate, make_immutable, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end /* Do we really want all objects to respond to make-immutable? */ ll_define_primitive(object, make_immutable, 1, (object), _0()) { ll_TYPE_ref(ll_SELF) = ll_call(ll_o(immutable_type), 1, (ll_SELF)); } ll_define_primitive_end /***********************************************************/ /* Object cloning */ ll_define_primitive(object, initialize_clone, 2, (object, src), _0()) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(object, clone, 1, (object), _0()) { ll_v t = ll_TYPE(ll_SELF); size_t size = ll_unbox_fixnum(ll_call(ll_o(type_size), 1, (t))); ll_v x = _ll_allocate_type(t); memcpy(ll_UNBOX_ref(x), ll_UNBOX_ref(ll_SELF), size); ll_tail_call(ll_o(initialize_clone), 2, (x, ll_SELF)); } ll_define_primitive_end ll_define_primitive(object, initialize_clone_mutable, 2, (object, src), _0()) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(object, clone_mutable, 1, (object), _0()) { ll_v t = ll_call(ll_o(mutable_type), 1, (ll_SELF)); size_t size = ll_unbox_fixnum(ll_call(ll_o(type_size), 1, (t))); ll_v x = _ll_allocate_type(t); memcpy(ll_UNBOX_ref(x), ll_UNBOX_ref(ll_SELF), size); ll_tail_call(ll_o(initialize_clone_mutable), 2, (x, ll_SELF)); } ll_define_primitive_end /***********************************************************/ /* Value tags */ ll_define_primitive(object, _get_tag, 1, (object), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(ll_TAG(ll_SELF))); } ll_define_primitive_end ll0.13/src/ll/op.c0100744000175200017560000001636407306120263014236 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_op_c__ #define __rcs_id_ll_op_c__ static const char __rcs_id_ll_op_c[] = "$Id: op.c,v 1.18 2001/06/02 08:15:47 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "op.h" #include "assert.h" #include /* strncmp */ /************************************************************************/ ll_define_primitive(operation,initialize,1,_(op,lambdaQ), _0()) { ll_THIS->_lambdaQ = ll_ARGC == 2 ? ll_ARGV[1] : ll_undef; ll_THIS->_immutableQ = ll_f; ll_THIS->_properties = ll_nil; #if ll_USE_LCACHE ll_THIS->_timestamp = ll_BOX_fixnum(0); #endif ll_write_barrier_SELF(); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(operation, locative_properties, 1, (self), _1(no_side_effect,"#t")) /* Access properties. */ { ll_return(ll_make_locative(&ll_THIS->_properties)); } ll_define_primitive_end static __inline void _ll_init_operation(_ll_tsa_operation *x) { x->_lambdaQ = x->_lambda_type = x->_cache_type = x->_cache_impl = x->_cache_offset = x->_cache_method = ll_undef; x->_immutableQ = ll_f; x->_properties = ll_nil; #if ll_USE_LCACHE x->_timestamp = ll_BOX_fixnum(0); #endif ll_write_barrier_pure(x); } ll_v _ll_make_operation() { ll_v o = _ll_allocate_type(ll_type(operation)); _ll_tsa_operation *x = ll_THIS_ISA(operation, o); _ll_init_operation(x); return o; } /************************************************************************/ ll_define_primitive(settable_operation,initialize,1,(op), _0()) { ll_THIS->_setter = ll_call(ll_o(make), 1, (ll_type(operation))); ll_write_barrier_SELF(); ll_tail_call_super(ll_o(initialize), ll_f, 1, (ll_SELF)); } ll_define_primitive_end ll_define_primitive(settable_operation,getter,1,(op), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(settable_operation,locative_setter,1,(op), _1(no_side_effect,"#t")) { ll_return(ll_make_locative(&ll_THIS->_setter)); } ll_define_primitive_end ll_define_primitive(settable_operation,setter,1,(op), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_setter); } ll_define_primitive_end ll_define_primitive(settable_operation,set_setterE,2,(op,setter), _0()) { ll_THIS->_setter = ll_ARGV[1]; ll_write_barrier_SELF(); } ll_define_primitive_end ll_v _ll_make_settable_operation() { ll_v o = _ll_allocate_type(ll_type(settable_operation)); _ll_tsa_settable_operation *x = ll_THIS_ISA(settable_operation, o); _ll_init_operation((void*) x); #define SETTER(X) ll_THIS_ISA(settable_operation, (X))->_setter SETTER(o) = _ll_make_operation(); ll_write_barrier_pure(x); return o; } /************************************************************************/ ll_define_primitive(locatable_operation,initialize,1,(op), _0()) { ll_THIS->_locater = ll_call(ll_o(make), 1, (ll_type(operation))); ll_write_barrier_SELF(); ll_tail_call_super(ll_o(initialize), ll_f, 1, (ll_SELF)); } ll_define_primitive_end ll_define_primitive(locatable_operation,locater,1,(op), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_locater); } ll_define_primitive_end ll_define_primitive(locatable_operation,locative_locater,1,(op), _1(no_side_effect,"#t")) { ll_return(ll_make_locative(&ll_THIS->_locater)); } ll_define_primitive_end ll_define_primitive(locatable_operation,set_locaterE,2,(op,locater), _0()) { ll_THIS->_locater = ll_ARGV[1]; } ll_define_primitive_end ll_v _ll_make_locatable_operation() { ll_v o = _ll_allocate_type(ll_type(locatable_operation)); _ll_tsa_locatable_operation *x = ll_THIS_ISA(locatable_operation, o); _ll_init_operation((void*) x); SETTER(o) = _ll_make_operation(); #define LOCATER(X) ll_THIS_ISA(locatable_operation, (X))->_locater LOCATER(o) = _ll_make_operation(); ll_write_barrier_pure(x); return o; } /************************************************************************/ /* initialization */ static int is_locater_of(const char *nj, const char *ni) { if ( strncmp(nj, "locative_", 9) == 0 ) { nj += 9; while ( *nj && *ni ) { /* If nj ends with '', okay */ if ( ni[0] == '\0' ) { break; } /* Match rest of string */ if ( *nj != *ni ) return 0; nj ++; ni ++; } return 1; } return 0; } static int is_setter_of(const char *nj, const char *ni) { if ( nj[0] == 's' && nj[1] == 'e' && nj[2] == 't' && nj[3] == '_' ) { nj += 4; while ( *nj && *ni ) { /* If nj ends with '!', okay */ if ( nj[0] == '!' && nj[1] == '\0' && ni[0] == '\0' ) { break; } /* Match rest of string */ if ( *nj != *ni ) return 0; nj ++; ni ++; } return 1; } return 0; } static int _ll_validate_op() { int i; const char *ni; _ll_op *x = _ll_ops; for ( i = 0; (ni = x[i].name); i ++ ) { ll_v gop = _ll_gi(x[i].gi); ll_v xop = x[i].op; ll_v isa; ll_assert_msg(init,ll_EQ(gop, xop),("operation \"%s\": gop = %s, xop = %s", x[i].name, ll_po(gop), ll_po(xop))); isa = _ll_validate_ref(x[i].op); /* fprintf(stderr, "%s ", ni); */ ll_assert_msg(init,ll_EQ(isa,ll_type(operation)) || ll_EQ(isa,ll_type(settable_operation)) || ll_EQ(isa,ll_type(locatable_operation)),("isa = %s", ll_po(isa))); } return 0; } ll_INIT(op1,180,"create and install the objects") { int i, j, k; const char *ni, *nj, *nk; _ll_op *x = _ll_ops; /* Scan for set-!, pairs */ for ( i = 0; (ni = x[i].name); i ++ ) { for ( j = 0; (nj = x[j].name); j ++ ) { if ( is_locater_of(nj, ni) ) { //fprintf(stderr, "%s is a \n", ni); //fprintf(stderr, "%s is (locater %s)\n", nj, ni); x[i].op = _ll_make_locatable_operation(); ll_write_root(&x[i].op); //ll_assert(init,! ll_INITIALIZED(x[j].op)); x[j].op = LOCATER(x[i].op); ll_write_root(&x[j].op); for ( k = 0; (nk = x[k].name); k ++ ) { if ( is_setter_of(nk, ni) ) { //fprintf(stderr, "%s is (setter %s)\n", nk, ni); //ll_assert(init,! ll_INITIALIZED(x[k].op)); x[k].op = SETTER(x[i].op); ll_write_root(&x[i].op); break; } } } } for ( j = 0; (nj = x[j].name); j ++ ) { if ( is_setter_of(nj, ni) ) { if ( ! ll_INITIALIZED(x[i].op) ) { //fprintf(stderr, "'%s is a \n", ni); x[i].op = _ll_make_settable_operation(); ll_write_root(&x[i].op); ll_assert(init,! ll_INITIALIZED(x[j].op)); //fprintf(stderr, "%s is (setter %s)\n", nj, ni); x[j].op = SETTER(x[i].op); ll_write_root(&x[j].op); } break; } } } for ( i = 0; (ni = x[i].name); i ++ ) { /* Everything else is simple */ if ( ! ll_INITIALIZED(x[i].op) ) { //fprintf(stderr, "'%s is an \n", ni); x[i].op = _ll_make_operation(); ll_write_root(&x[i].op); } _ll_gi(x[i].gi) = x[i].op; //_ll_global_set(_ll_gi(x[i].gi), x[i].op); // fprintf(stderr, "%s = %ld ", ni, (unsigned long) _ll_gi(x[i].gi)); } /* Add validator */ _ll_add_validator("op", &_ll_validate_op); return 0; } ll_INIT(op2,320,"make op vars readonly") { int i; const char *ni; _ll_op *x = _ll_ops; /* Make op vars readonly. */ for ( i = 0; (ni = x[i].name); i ++ ) { ll_v sym; sym = _ll_make_symbol_(_ll_escape_symbol(ni)); ll_call(ll_o(set_propertyE), 3, (sym, ll_s(readonly), ll_t)); } return 0; } ll0.13/src/ll/op.h0100644000175200017560000000063607001134620014227 0ustar stephensstephens#ifndef _ll_op_h #define _ll_op_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_op_h__ #define __rcs_id_ll_op_h__ static const char __rcs_id_ll_op_h[] = "$Id: op.h,v 1.3 1999/10/13 16:55:44 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/value.h" /* ll_v */ #include "ll/global.h" /* _ll_g */ typedef struct _ll_op { const char *name; _ll_g gi; ll_v op; } _ll_op; extern _ll_op _ll_ops[]; #endif ll0.13/src/ll/op1.h0100644000175200017560000000056606775057504014340 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_op1_h__ #define __rcs_id_ll_op1_h__ static const char __rcs_id_ll_op1_h[] = "$Id: op1.h,v 1.4 1999/10/01 07:14:12 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define ll_p_def(T,N,A,B,O)ll_o(N) #include "ll/prims.h" #ifndef ll_e_NAME #define ll_e_NAME(N,S)N##_##S #endif #define _ll_deftype(T,MT)ll_o(T##Q) #include "ll/types.h" ll0.13/src/ll/ops.c0100644000175200017560000000055207001135051014401 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_ops_c__ #define __rcs_id_ll_ops_c__ static const char __rcs_id_ll_ops_c[] = "$Id: ops.c,v 1.1 1999/10/13 16:58:17 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/op.h" #include "ll/global.h" _ll_op _ll_ops[] = { #ifndef ll_o_def #define ll_o_def(X) { #X, _ll_g_##X }, #include "ll/ops.h" #endif { 0 } }; ll0.13/src/ll/port.c0100744000175200017560000001651707230472174014613 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_port_c__ #define __rcs_id_ll_port_c__ static const char __rcs_id_ll_port_c[] = "$Id: port.c,v 1.16 2001/01/15 03:54:36 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include #include #include /******************************************************************/ /* (current-output-port) */ ll_define_primitive(object, current_output_port, 0, (), _1(no_side_effect,"#t")) { ll_return(ll_g(_current_output_port)); } ll_define_primitive_end ll_define_primitive(output_port, set_current_output_port, 1, (port), _0()) { ll_set_g(_current_output_port, ll_SELF); } ll_define_primitive_end /******************************************************************/ /* (current-input-port) */ ll_define_primitive(object, current_input_port, 0, (), _1(no_side_effect,"#t")) { ll_return(ll_g(_current_input_port)); } ll_define_primitive_end ll_define_primitive(input_port, set_current_input_port, 1, (port), _0()) { ll_set_g(_current_input_port, ll_SELF); } ll_define_primitive_end /******************************************************************/ /* (current-error-port) */ ll_define_primitive(object, current_error_port, 0, (), _1(no_side_effect,"#t")) { ll_return(ll_g(_current_error_port)); } ll_define_primitive_end ll_define_primitive(output_port, set_current_error_port, 1, (port), _0()) { ll_set_g(_current_error_port, ll_SELF); } ll_define_primitive_end /******************************************************************/ ll_define_primitive(port, initialize, 2, _(port, impl, close_ident), _0()) { ll_call_super(ll_o(initialize), ll_f, 1, (ll_SELF)); ll_THIS->_impl = (FILE*) ll_ARGV[1]; ll_THIS->_close = ll_ARGC >= 3 ? ll_ARGV[2] : ll_f; ll_THIS->_ident = ll_ARGC >= 4 ? ll_ARGV[3] : ll_f; ll_write_barrier_SELF(); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(port, port_impl, 1, (port), _1(no_side_effect,"#t")) { ll_return((ll_v) ll_THIS->_impl); } ll_define_primitive_end ll_define_primitive(port, port_ident, 1, (port), _1(no_side_effect,"#t")) { ll_return(ll_THIS->_ident); } ll_define_primitive_end /******************************************************************/ #define GET_FP FILE* FP = ll_THIS->_impl ll_define_primitive(port, flush, 1, (port), _0()) { GET_FP; if ( FP ) { fflush(FP); } } ll_define_primitive_end ll_define_primitive(port, _close_port, 1, (port), _0()) { if ( ll_unbox_boolean(ll_THIS->_close) && ll_THIS->_impl ) { GET_FP; ll_THIS->_impl = 0; ll_THIS->_close = ll_f; ll_write_barrier_SELF(); if ( FP ) { fclose(FP); } } } ll_define_primitive_end #undef GET_FP #define GET_FP FILE* FP = ll_THIS->super_port._impl /******************************************************************/ ll_define_primitive(input_port, read_char, 1, (port), _0()) { GET_FP; int c; ll_return(FP && ((c = fgetc(FP)) != EOF) ? ll_make_char(c) : ll_eos); } ll_define_primitive_end ll_define_primitive(input_port, peek_char, 1, (port), _0()) { GET_FP; int c; if ( FP && ((c = fgetc(FP)) != EOF) ) { ungetc(c, FP); ll_return(ll_make_char(c)); } else { ll_return(ll_eos); } } ll_define_primitive_end /******************************************************************/ ll_define_primitive(output_port, _output_string, 2, (port, string), _0()) { GET_FP; size_t count; count = FP ? fwrite(_ll_ptr_string(ll_ARGV[1]), _ll_len_string(ll_ARGV[1]), sizeof(char), FP) : -1; ll_return(ll_make_fixnum(count)); } ll_define_primitive_end ll_define_primitive(output_port, _output_char, 2, (port, c), _0()) { GET_FP; if ( FP ) putc(ll_unbox_char(ll_ARGV[1]), FP); } ll_define_primitive_end /******************************************************************/ ll_v ll_write_string(ll_v port, const char *v, size_t l) { if ( ll_EQ(port, ll_undef) ) { port = ll_call(ll_o(current_output_port), 0, ()); } if ( l == (size_t) -1 ) { l = strlen(v); } #if 1 { _ll_tsa_string _str; ll_v str = ll_make_ref(&_str); ll_TYPE_ref(str) = ll_type(string); _str._length = l; _str._array = (void*) v; ll_call(ll_o(_output_string), 2, (port, str)); } #else { ll_v str; str = ll_call(ll_o(make), 3, (ll_type(string), ll_make_fixnum(l), ll_BOX_PTR(v))); ll_call(ll_o(_output_string), 2, (port, str)); } #endif return port; } /******************************************************************/ /* 6.6.1. Ports */ ll_define_primitive(string, _open_file, 2, (filename, mode), _0()) { const char *filename, *mode; FILE *fp; ll_v impl; ll_v type; filename = _ll_ptr_string(ll_SELF); mode = _ll_ptr_string(ll_ARGV[1]); type = strchr(mode, 'w') ? ll_type(output_port) : ll_type(input_port); if ( (fp = fopen(filename, mode)) ) { impl = (ll_v) fp; } else { ll_return(_ll_error(ll_re(file_open), 4, ll_s(name), ll_SELF, ll_s(mode), ll_ARGV[1], ll_s(code), ll_make_fixnum(errno), ll_s(reason), _ll_make_string(strerror(errno), -1) )); } ll_tail_call(ll_o(make), 4, (type, impl, ll_t, ll_SELF)); } ll_define_primitive_end ll_define_primitive(string, open_input_file, 1, (filename), _0()) { ll_v mode = _ll_make_string("rb", 2); ll_tail_call(ll_o(_open_file), 2, (ll_SELF, mode)); } ll_define_primitive_end ll_define_primitive(string, open_output_file, 1, (filename), _0()) { ll_v mode = _ll_make_string("wb", 2); ll_tail_call(ll_o(_open_file), 2, (ll_SELF, mode)); } ll_define_primitive_end ll_define_primitive(input_port, close_input_port, 1, (port), _0()) { ll_tail_call(ll_o(_close_port), 1, (ll_SELF)); } ll_define_primitive_end ll_define_primitive(output_port, close_output_port, 1, (port), _0()) { ll_tail_call(ll_o(_close_port), 1, (ll_SELF)); } ll_define_primitive_end /***************************************************************************/ /* These could probably be defined in scheme. * IMPLEMENT: use unwind-protect. */ ll_define_primitive(string,call_with_input_file,2,(file,proc),_0()) { ll_v result = ll_undef; ll_v port = ll_call(ll_o(open_input_file), 1, (ll_SELF)); result = ll_call(ll_ARGV[1], 1, (port)); ll_call(ll_o(close_input_port), 1, (port)); ll_return(result); } ll_define_primitive_end ll_define_primitive(string,call_with_output_file,2,(file,proc),_0()) { ll_v result = ll_undef; ll_v port = ll_call(ll_o(open_output_file), 1, (ll_SELF)); result = ll_call(ll_ARGV[1], 1, (port)); ll_call(ll_o(close_output_port), 1, (port)); ll_return(result); } ll_define_primitive_end /******************************************************************/ ll_INIT(port,220,"eos-object, stdio ports") { ll_set_g(__eos, ll_call(ll_o(make), 1, (ll_type(eof_object)))); _ll_set_object_nameE(ll_eos, "#"); ll_set_g(_current_input_port, ll_call(ll_o(make), 4, (ll_type(input_port), (ll_v) stdin, ll_f, ll_s(SstdinS)))); _ll_set_object_nameE(ll_g(_current_input_port), "#< stdin>"); ll_set_g(_current_output_port, ll_call(ll_o(make), 4, (ll_type(output_port), (ll_v) stdout, ll_f, ll_s(SstdoutS)))); _ll_set_object_nameE(ll_g(_current_output_port), "#< stdout>"); ll_set_g(_current_error_port, ll_call(ll_o(make), 4, (ll_type(output_port), (ll_v) stderr, ll_f, ll_s(SstderrS)))); _ll_set_object_nameE(ll_g(_current_error_port), "#< stderr>"); return 0; } #undef FP ll0.13/src/ll/posix.c0100744000175200017560000000155507230472225014762 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_posix_c__ #define __rcs_id_ll_posix_c__ static const char __rcs_id_ll_posix_c[] = "$Id: posix.c,v 1.7 2001/01/15 03:55:01 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include ll_define_primitive(object,posixCabort,0,(), _0()) { abort(); } ll_define_primitive_end ll_define_primitive(object,posixCexit,0,(), _0()) { exit(0); } ll_define_primitive_end ll_define_primitive(fixnum,posixCexit,1,(rtncode), _0()) { exit(ll_unbox_fixnum(ll_SELF)); } ll_define_primitive_end ll_define_primitive(string,posixCsystem,1,(cmd), _0()) { const char *str = ll_THIS->_array; ll_return(ll_make_fixnum(system(str))); } ll_define_primitive_end ll_define_primitive(string,posixCchdir,1,(dir), _0()) { const char *str = ll_THIS->_array; ll_return(ll_make_fixnum(chdir(str))); } ll_define_primitive_end ll0.13/src/ll/prim.c0100744000175200017560000000764107262415714014576 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_prim_c__ #define __rcs_id_ll_prim_c__ static const char __rcs_id_ll_prim_c[] = "$Id: prim.c,v 1.13 2001/02/06 00:00:08 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include /* strcat() */ /*************************************************************************/ void _ll_initialize_primitive(ll_v x, ll_func prim, const char *name, ll_v formals, ll_v props) { _ll_tsa_method *m = ll_THIS_ISA(method,x); m->_func = prim; m->_formals = formals; m->_code = _ll_make_symbol_(name); m->_properties = props; } ll_v _ll_make_primitive(ll_func prim, const char *name, ll_v formals, ll_v props) { ll_v x = _ll_allocate_type(ll_type(primitive)); _ll_initialize_primitive(x, prim, name, formals, props); return x; } /***************************************************************************/ ll_define_primitive(object, _identity, 1, _(self,args), _2(no_side_effect,"#t", doc,"Always returns receiver.")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(object, _true, 0, _(args), _2(no_side_effect, "#t", doc, "Always returns true.")) { ll_return(ll_t); } ll_define_primitive_end ll_define_primitive(object, _false, 0, _(args), _2(no_side_effect,"#t", doc, "Always returns false.")) { ll_return(ll_f); } ll_define_primitive_end /***************************************************************************/ ll_INIT(prim1,190,"create the methods") { int i, j; _ll_prim *x = _ll_prims; for ( i = 0; x[i].prim; i ++ ) { char buf[256]; ll_v type, op, prim; ll_v formals = ll_nil, props = ll_nil; strcpy(buf, "<"); strcat(buf, _ll_escape_symbol(x[i].prim->_type)); strcat(buf, ">:"); strcat(buf, _ll_escape_symbol(x[i].prim->_op)); #if 0 fprintf(stderr, "%s\n", buf); #endif type = _ll_gi(x[i].type); op = _ll_gi(x[i].op); { const char *name; ll_v *xp; /* formals */ for ( xp = &formals, j = 0; (name = x[i].prim->_formals[j]); j ++ ) { ll_v sym = _ll_make_symbol_(_ll_escape_symbol(name)); if ( (! x[i].prim->_formals[j + 1]) && x[i].prim->_restarg ) { *xp = sym; } else { *xp = ll_cons(sym, ll_nil); xp = &ll_CDR(*xp); } } /* props */ for ( xp = &props, j = 0; (name = x[i].prim->_props[j]); j ++ ) { const char *value_str = x[i].prim->_props_values[j]; ll_v value = ll_undef; ll_assert(prim,value_str); if ( strcmp(value_str, "#t") == 0) { value = ll_t; } else if ( strcmp(value_str, "#f") == 0 ) { value = ll_f; } else { value = _ll_make_string(value_str, -1); } *xp = ll_cons(ll_cons(_ll_make_symbol_(_ll_escape_symbol(name)), value), ll_nil); xp = &ll_CDR(*xp); } } prim = _ll_make_primitive( x[i].prim->_func, buf, formals, props); x[i].prim->_prim = prim; } return 0; } ll_INIT(prim2,210,"install the methods") { int i; _ll_prim *x = _ll_prims; /* Install the primitive methods in their respective types. */ for ( i = 0; x[i].prim; i ++ ) { ll_v type, op, prim, meth; type = _ll_gi(x[i].type); op = _ll_gi(x[i].op); prim = x[i].prim->_prim; #if 0 fprintf(stdout, "<%s>:%s\n", x[i].prim->_type, x[i].prim->_op); #endif _ll_add_method(type, op, prim); /* Assert _ll_add_method()/__ll_lookup() behavior. */ meth = __ll_lookup(type, op, ll_undef); ll_assert_msg(lookup,ll_EQ(meth, prim), ("primitive method <%s>:%s lost", x[i].prim->_type, x[i].prim->_op)); } /* Do lookup on all system primitives to make sure. */ for ( i = 0; x[i].prim; ++ i ) { ll_v type, op, prim, meth; type = _ll_gi(x[i].type); op = _ll_gi(x[i].op); prim = x[i].prim->_prim; meth = __ll_lookup(type, op, ll_undef); ll_assert_msg(lookup,ll_EQ(meth, prim), ("primitive method <%s>:%s lost", x[i].prim->_type, x[i].prim->_op)); } return 0; } ll0.13/src/ll/prim.h0100764000175200017560000001543707623404502014601 0ustar stephensstephens#ifndef _ll_prim_h #define _ll_prim_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_prim_h__ #define __rcs_id_ll_prim_h__ static const char __rcs_id_ll_prim_h[] = "$Id: prim.h,v 1.7 2003/02/15 09:32:50 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/value.h" /* ll_v */ #include "ll/global.h" /* _ll_g */ #include "ll/stack.h" /* ll_VS_POP() */ /***********************************************************************/ /* ll_func: method subprimitive function */ #define ll_func_DECL(X) int X(void) typedef ll_func_DECL((*ll_func)); /* if returned !0 { perform a tail-call for the returning procedure } */ /***********************************************************************/ typedef struct ll_primitive { /*@ A primitive descriptor used to initialize a object. */ ll_func _func; /*@ The low-level method hander. */ const char *_type; /*@ The type name for this primitive. */ const char *_op; /*@ The operation name for this primitive. */ const char *_formals[7]; /*@ A list of formal parameter names for this primitive. */ short _restarg; /*@ If non-zero the primitive takes rest args. */ const char *_props[6]; /*@ The name of any properties. */ const char *_props_values[6]; /*@ The values of any properties. */ ll_v _prim; /*@ The reference to the initialized object. */ } ll_primitive; #define ll_prim(TYPE,NAME) _ll_p_##TYPE##_##NAME #define ll_declare_primitive(TYPE,NAME) \ extern ll_primitive ll_prim(TYPE,NAME) extern ll_v _ll_argc_error(); #ifndef ll_define_primitive #define ll_define_primitive(TYPE,NAME,MINNARGS,ARGS,OPTS)_ll_define_primitive(TYPE,NAME,MINNARGS,ARGS,OPTS) #define _ll_FR_MAXNARGS0()0 #define _ll_FR_MAXNARGS1(_1)1 #define _ll_FR_MAXNARGS2(_1,_2)2 #define _ll_FR_MAXNARGS3(_1,_2,_3)3 #define _ll_FR_MAXNARGS4(_1,_2,_3,_4)4 #define _ll_FR_MAXNARGS5(_1,_2,_3,_4,_5)5 #define _ll_FR_MAXNARGS6(_1,_2,_3,_4,_5,_6)6 #define _ll_FR_MAXNARGS0_(_R)-1 #define _ll_FR_MAXNARGS1_(_1,_R)-1 #define _ll_FR_MAXNARGS2_(_1,_2,_R)-1 #define _ll_FR_MAXNARGS3_(_1,_2,_3,_R)-1 #define _ll_FR_MAXNARGS4_(_1,_2,_3,_4,_R)-1 #define _ll_FR_MAXNARGS5_(_1,_2,_3,_4,_5,_R)-1 #define _ll_FR_MAXNARGS6_(_1,_2,_3,_4,_5,_6,_R)-1 #define _ll_FR_MAXNARGS(N,X)_ll_FR_MAXNARGS##N##X #define _ll_FR_NAMES0(){0},0 #define _ll_FR_NAMES1(_1){#_1},0 #define _ll_FR_NAMES2(_1,_2){#_1,#_2},0 #define _ll_FR_NAMES3(_1,_2,_3){#_1,#_2,#_3},0 #define _ll_FR_NAMES4(_1,_2,_3,_4){#_1,#_2,#_3,#_4},0 #define _ll_FR_NAMES5(_1,_2,_3,_4,_5){#_1,#_2,#_3,#_4,#_5},0 #define _ll_FR_NAMES6(_1,_2,_3,_4,_5,_6){#_1,#_2,#_3,#_4,#_5,#_6},0 #define _ll_FR_NAMES0_(_R){#_R},1 #define _ll_FR_NAMES1_(_1,_R){#_1,#_R},1 #define _ll_FR_NAMES2_(_1,_2,_R){#_1,#_2,#_R},1 #define _ll_FR_NAMES3_(_1,_2,_3,_R){#_1,#_2,#_3,#_R},1 #define _ll_FR_NAMES4_(_1,_2,_3,_4,_R){#_1,#_2,#_3,#_4,#_R},1 #define _ll_FR_NAMES5_(_1,_2,_3,_4,_5,_R){#_1,#_2,#_3,#_4,#_5,#_R},1 #define _ll_FR_NAMES6_(_1,_2,_3,_4,_5,_6,_R){#_1,#_2,#_3,#_4,#_5,#_6,#_R},1 #define _ll_FR_NAMES(N,X)_ll_FR_NAMES##N##X /* Property list expansion macros. */ #define _ll_p_PROP_0(){} #define _ll_p_PROP_1(_1,_1v){#_1},{_1v} #define _ll_p_PROP_2(_1,_1v,_2,_2v){#_1,#_2},{_1v,_2v} #define _ll_p_PROP_3(_1,_1v,_2,_2v,_3,_3v){#_1,#_2,#_3},{_1v,_2v,_3v} #define _ll_p_PROP_4(_1,_1v,_2,_2v,_3,_3v,_4,_4v){#_1,#_2,#_3,#_4},{_1v,_2v,_3v,_4v} #define _ll_p_PROP_5(_1,_1v,_2,_2v,_3,_3v,_4,_4v,_5,_5v){#_1,#_2,#_3,#_4,#_5},{_1v,_2v,_3v,_4v,_5v} #define _ll_p_PROP_6(_1,_1v,_2,_2v,_3,_3v,_4,_4v,_5,_5v,_6,_6v){#_1,#_2,#_3,#_4,#_5,#_6},{_1v,_2v,_3v,_4v,_5v,_6v} #define _ll_p_PROP(X)_ll_p_PROP##X /* C symbol for primitive handler function. */ #define _ll_prim_func_name(TYPE,NAME)_ll_pf_##NAME##_C_##TYPE /* Defines the beginning of a primitive method. */ #define _ll_define_primitive(TYPE,NAME,MINNARGS,ARGS,PROPS) \ /* Forward declaration to the primitive handler function. */ \ static ll_func_DECL(_ll_prim_func_name(TYPE,NAME)); \ /* Defines the primitive initializer. */ \ ll_primitive ll_prim(TYPE,NAME) = { \ /* Pointer to the primitive's handler function. */ \ &_ll_prim_func_name(TYPE,NAME), \ /* The type name. */ \ #TYPE, \ /* The operation name. */ \ #NAME, \ /* The formals list and minimum argument count. */ \ _ll_FR_NAMES(MINNARGS,ARGS), \ /* The properties list. */ \ _ll_p_PROP(PROPS) \ }; \ /* Defines the beginning of the sub-primitive handler function. */ \ static ll_func_DECL(_ll_prim_func_name(TYPE,NAME)) \ { \ const char *ll_PRIM_TYPE_NAME = #TYPE; \ const char *ll_PRIM_OP_NAME = #NAME; \ ll_v *_ll_ARGV = ll_ARGV; \ ll_activation_record *_ll_AR = _ll_ar_sp; \ /* The return value. */ \ ll_v __ll_return_val; \ /* Get C-pointer to offset of TYPE block in receiver. */ \ _ll_tsa_##TYPE *ll_THIS = (void*) (((char*) ll_UNBOX_ref(ll_ARGV[0])) - (sizeof(_ll_tsa_##TYPE) - sizeof(_ll_ts_##TYPE)) + ll_UNBOX_fixnum(_ll_ar_sp->_type_offset) ); \ (void) ll_THIS; \ (void) _ll_ARGV; \ (void) _ll_AR; \ /* Check argument count. */ \ if ( (MINNARGS > 0 && ll_ARGC < MINNARGS) || (_ll_FR_MAXNARGS(MINNARGS,ARGS) >= 0 && ll_ARGC > _ll_FR_MAXNARGS(MINNARGS,ARGS)) ) { ll_return(_ll_argc_error()); } \ { #endif extern ll_v _ll_debug_at_rtn(ll_v *rtnval); #ifndef _ll_DB_AT_RTN #define _ll_DB_AT_RTN \ /* Should debugger be invoked? */ \ if ( ll_unbox_boolean(ll_AR_DB_AT_RTN) ) { \ __ll_return_val = _ll_debug_at_rtn(&__ll_return_val); \ } #endif #define ll_return(X)do{__ll_return_val = (X); goto __ll_return; }while(0) /* Ends the primitive handler function. */ #define ll_define_primitive_end \ } \ /* Default return value to unspecified. */ \ __ll_return_val = ll_unspec; \ /* Place for ll_return() to jump to. */ \ __ll_return: \ /* Check if debugger should be envoked now. */ \ _ll_DB_AT_RTN; \ /* Pop arguments off stack. */ \ _ll_val_sp = ll_ARGV + ll_ARGC; \ /* Check if value stack buffer needs to be popped. */ \ _ll_VS_POP(); \ /* Allocate space for return value. */ \ _ll_VS_PROBE(1); \ /* Push return value. */ \ _ll_PUSH(__ll_return_val); \ /* Return to caller. */ \ return 0; \ } /*************************************************************************/ /* primitives */ #define ll_p(TYPE,NAME)ll_prim(TYPE,NAME)._prim ll_declare_primitive(object,_identity); #define _ll_p_identity ll_p(object,_identity) ll_declare_primitive(object,_true); #define _ll_p_true ll_p(object,_true) ll_declare_primitive(object,_false); #define _ll_p_false ll_p(object,_false) ll_declare_primitive(object,_method_not_found); #define _ll_p_method_not_found ll_p(object,_method_not_found) ll_declare_primitive(object,_bad_typecheck); #define _ll_p_typecheck_error ll_p(object,_bad_typecheck) /************************************************************************/ /* Primitive method inits */ typedef struct _ll_prim { _ll_g type; _ll_g op; ll_primitive *prim; } _ll_prim; extern _ll_prim _ll_prims[]; #endif ll0.13/src/ll/prims.c0100644000175200017560000000100707001135051014726 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_prims_c__ #define __rcs_id_ll_prims_c__ static const char __rcs_id_ll_prims_c[] = "$Id: prims.c,v 1.1 1999/10/13 16:58:17 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/prim.h" #ifndef ll_p_def #define ll_p_def(T,O,MINARGC,ARGS,OPTS) \ ll_declare_primitive(T,O); #include "ll/prims.h" #endif _ll_prim _ll_prims[] = { #ifndef ll_p_def #define ll_p_def(T,O,MINARGC,ARGS,OPTS) { _ll_g_LT##T##GT, _ll_g_##O, &ll_prim(T,O) }, #include "ll/prims.h" #endif { 0 } }; ll0.13/src/ll/props.c0100744000175200017560000000314207230473042014753 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_props_c__ #define __rcs_id_ll_props_c__ static const char __rcs_id_ll_props_c[] = "$Id: props.c,v 1.4 2001/01/15 04:01:38 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" ll_define_primitive(properties_mixin, initialize, 1, _(self, args), _0()) { ll_call(ll_o(set_propertiesE), 2, (ll_SELF, ll_nil)); } ll_define_primitive_end ll_define_primitive(properties_mixin, properties, 1, (self), _1(no_side_effect,"#t")) { ll_v ploc = ll_call(ll_o(locative_properties), 1, (ll_SELF)); ll_return(*ll_unbox_locative(ploc)); } ll_define_primitive_end ll_define_primitive(properties_mixin, set_propertiesE, 2, (self, props), _1(no_side_effect,"#t")) { ll_v ploc = ll_call(ll_o(locative_properties), 1, (ll_SELF)); *ll_unbox_locative(ploc) = ll_ARGV[1]; ll_write_barrier(ll_UNBOX_locative(ploc)); } ll_define_primitive_end ll_define_primitive(properties_mixin, property, 2, (self, prop), _1(no_side_effect,"#t")) { ll_v ploc = ll_call(ll_o(locative_properties), 1, (ll_SELF)); ll_return(_ll_assq_to_front(ll_unbox_locative(ploc), ll_ARGV[1])); } ll_define_primitive_end ll_define_primitive(properties_mixin, set_propertyE, 3, (self, prop, value), _0()) { ll_v ploc = ll_call(ll_o(locative_properties), 1, (ll_SELF)); _ll_assq_set(ll_unbox_locative(ploc), ll_ARGV[1], ll_ARGV[2]); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(properties_mixin, unset_propertyE, 2, (self, prop), _0()) { ll_v ploc = ll_call(ll_o(locative_properties), 1, (ll_SELF)); ll_return(_ll_assq_delete(ll_unbox_locative(ploc), ll_ARGV[1])); } ll_define_primitive_end ll0.13/src/ll/read.c0100644000175200017560000000634307022070567014534 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_read_c__ #define __rcs_id_ll_read_c__ static const char __rcs_id_ll_read_c[] = "$Id: read.c,v 1.9 1999/12/04 01:42:15 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include #define EOS ll_eos static int PEEKC(ll_v stream) { ll_v c = ll_call(ll_o(peek_char), 1, (stream)); return ll_EQ(c, ll_eos) ? EOF : ll_unbox_char(c); } static int GETC(ll_v stream) { ll_v c = ll_call(ll_o(read_char), 1, (stream)); return ll_EQ(c, ll_eos) ? EOF : ll_unbox_char(c); } #define EQ(X,Y) ll_EQ(X,Y) static ll_v _ll_make_immutable(ll_v x) { return(ll_call(ll_o(make_immutable), 1, (x))); } #define CONS(X,Y) ll_cons((X),(Y)) #define IMMUTABLE_CONS(X)_ll_make_immutable(X) #define NIL ll_nil #define CAR(X) ll_car(X) #define SET_CDR(X,V) (ll_CDR(X) = V) #define SET(X,V) ((X) = (V)) #define SYMBOL(S) ll_s(S) #define SYMBOL_DOT ll_s(D) #define VALUE ll_v #define READ_DECL static VALUE _ll_read(VALUE stream) #define READ_CALL() _ll_read(stream) #define RETURN(X) return(X) #define F ll_f #define T ll_t #define U ll_undef static char error_buf[128]; #define ERROR(X...) _ll_error(ll_re(read), 1, ll_s(reason), _ll_make_copy_string((sprintf(error_buf, X),error_buf), -1)) #define MALLOC(X) ll_malloc(X) #define REALLOC(X,Y) ll_realloc(X,Y) #define IMMUTABLE_STRING(X) _ll_make_immutable(X) #define ESCAPE_STRING(X) ll_call(ll_o(_string_unescape), 1, (X)) #define STRING(V, L) _ll_make_string((V), (L)) #define LIST_2_VECTOR(X) _ll_make_immutable(ll_call(ll_o(list__vector), 1, ((X)))) #define IMMUTABLE_VECTOR(X)_ll_make_immutable(X) #define STRING_2_NUMBER(X,R) ll_call(ll_o(string__number), 2, ((X), ll_make_fixnum(R))) #define STRING_2_SYMBOL(S) ll_call(ll_o(string__symbol), 1, ((S))) #define MAKE_CHAR(C) ll_make_char(C) /*************************************************************************/ /* # read macro support. */ ll_define_primitive(char, llCreadCundefined_macro_character, 2, (char, port), _0()) { int c = ll_UNBOX_char(ll_SELF); ERROR("bad macro sequence: #%c", c); ll_return(ll_nil); } ll_define_primitive_end ll_define_primitive(char, llCreadCdefine_macro_char, 2, (char, proc), _0()) { int C = ll_UNBOX_char(ll_SELF); ll_tail_call(ll_o(vector_setE), 3, (ll_fluid(ll_s(llCreadCmacro_char_table)), ll_make_fixnum(C), ll_ARGV[1])); } ll_define_primitive_end ll_INIT(read,240,"read macro table") { ll_v v = _ll_make_copy_vector(0, ll_MAX_char + 1); ll_call(ll_o(vector_fillE), 2, (v, ll_o(llCreadCundefined_macro_character))); ll_bind_fluid(ll_s(llCreadCmacro_char_table), v); return 0; } #define CALL_MACRO_CHAR(C) ll_call(ll_call(ll_o(vector_ref), 2, (ll_fluid(ll_s(llCreadCmacro_char_table)), ll_make_fixnum(C))), 2, (ll_make_char(C), stream)) /*************************************************************************/ READ_DECL; /*************************************************************************/ ll_define_primitive(object, read, 0, _(port), _0()) { ll_v port = ll_ARGC >= 1 ? ll_SELF : ll_call(ll_o(current_input_port), 0, ()); ll_return(_ll_read(port)); } ll_define_primitive_end /*************************************************************************/ #include "lispread.c" /*************************************************************************/ ll0.13/src/ll/readline.c0100664000175200017560000001167307623406030015403 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_readline_c__ #define __rcs_id_ll_readline_c__ static const char __rcs_id_ll_readline_c[] = "$Id: readline.c,v 1.7 2003/02/15 09:44:56 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "readline/readline.h" #ifndef HAS_HISTORY #define HAS_HISTORY 1 #endif #if HAS_HISTORY #include "readline/history.h" /* add_history(), ... */ #ifndef ll_HISTORY_FILE #define ll_HISTORY_FILE "~/.llhist" #endif #endif #include #include /*************************************************************************/ /* Completion support */ static char * _ll_completion_generator (text, state) char *text; int state; { static int len; static ll_v symbols; /* not thread safe. */ char *name; /* If this is a new word to complete, initialize now. This includes saving the length of TEXT for efficiency, and initializing the index variable to 0. */ if ( ! state ) { len = strlen(text); symbols = ll_g(_symbols); } /* Return the next name which partially matches from the command list. */ while ( ! ll_nullQ(symbols) ) { ll_v sym = ll_car(symbols); const char *name = (void*) _ll_name_symbol(sym); symbols = ll_cdr(symbols); if (strncmp (name, text, len) == 0) return strcpy(malloc(strlen(name) + 1), name); } /* If no names matched, then return NULL. */ return ((char *)NULL); } static char ** _ll_completion (text, start, end) char *text; int start, end; { char **matches; matches = rl_completion_matches (text, _ll_completion_generator); return (matches); } /*************************************************************************/ ll_define_primitive(readline_port, initialize, 1, (port), _0()) { ll_THIS->_buffer = _ll_make_string(0, 0); ll_write_barrier_SELF(); ll_THIS->_prompt_buffer = _ll_make_string(" ll > ", -1); ll_write_barrier_SELF(); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(readline_port, flush, 1, (port), _0()) { /* NOTHING */ } ll_define_primitive_end ll_define_primitive(readline_port, _close_port, 1, (port), _0()) { /* NOTHING */ } ll_define_primitive_end /******************************************************************/ ll_define_primitive(readline_port, _fill_buffer, 1, (port), _0()) { if ( ll_NE(ll_THIS->_buffer, ll_f) ) { size_t length = _ll_len_string(ll_THIS->_buffer); char *s; if ( length == 0 ) { again: /* Allow conditional parsing of the ~/.inputrc file. */ rl_readline_name = "ll"; /* Tell the completer that we want a crack first. */ rl_attempted_completion_function = (CPPFunction *)_ll_completion; /* Call readline */ s = readline(_ll_ptr_string(ll_THIS->_prompt_buffer)); if ( s ) { if ( *s ) { #if HAS_HISTORY if ( s[0] != '\0' ) { add_history(s); write_history(ll_HISTORY_FILE); } #endif /* append the result to the read buffer */ ll_write_string(ll_THIS->_buffer, s, strlen(s)); /* readline does not terminate with "\n" */ ll_write_string(ll_THIS->_buffer, "\n", 1); } else { goto again; } } else { ll_THIS->_buffer = ll_f; ll_write_barrier_SELF(); } } } } ll_define_primitive_end /******************************************************************/ /* readline as */ ll_define_primitive(readline_port, read_char, 1, (port), _0()) { ll_call(ll_o(_fill_buffer), 1, (ll_SELF)); if ( ll_unbox_boolean(ll_THIS->_buffer) ) { ll_tail_call(ll_o(read_char), 1, (ll_THIS->_buffer)); } else { ll_return(ll_eos); } } ll_define_primitive_end ll_define_primitive(readline_port, peek_char, 1, (port), _0()) { ll_call(ll_o(_fill_buffer), 1, (ll_SELF)); if ( ll_unbox_boolean(ll_THIS->_buffer) ) { ll_tail_call(ll_o(peek_char), 1, (ll_THIS->_buffer)); } else { ll_return(ll_eos); } } ll_define_primitive_end /******************************************************************/ /* readline as */ /* IMPLEMENT: this doesn't quite work yet */ ll_define_primitive(readline_port, _output_string, 2, (port, string), _0()) { size_t count = _ll_len_string(ll_ARGV[1]); ll_THIS->_prompt_buffer = ll_ARGV[1]; ll_write_barrier_SELF(); ll_return(ll_make_fixnum(count)); } ll_define_primitive_end ll_define_primitive(readline_port, _output_char, 2, (port, char), _0()) { char buf[1]; buf[0] = ll_unbox_char(ll_ARGV[1]); ll_write_string(ll_SELF, buf, 1); } ll_define_primitive_end /******************************************************************/ ll_INIT(readline,230,"GNU readline ") { #if HAS_HISTORY /* Initialize the history library */ using_history(); read_history(ll_HISTORY_FILE); #endif ll_set_g(SllCreadlineS, ll_call(ll_o(make), 1, (ll_type(readline_port)))); ll_set_g(SllCinteractive_input_portS, ll_g(SllCreadlineS)); ll_set_g(SllCinteractive_output_portS, ll_g(_current_error_port)); return 0; } /******************************************************************/ ll0.13/src/ll/sig.c0100744000175200017560000001223207262415714014401 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_sig_c__ #define __rcs_id_ll_sig_c__ static const char __rcs_id_ll_sig_c[] = "$Id: sig.c,v 1.8 2001/02/06 00:02:39 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" #include "util/sig.h" #include "assert.h" #include "../util/sig.c" /****************************************************************************/ #define ll_sig_proc(s) (*(ll_v*)((s)->user)) static volatile int _ll_sig_queue_head, _ll_sig_queue_tail; /*@ Index into %_ll_sig_queue%. */ volatile int _ll_sig_pending; /*@ True if signals are pending service. */ #ifndef _ll_sig_queue_len #define _ll_sig_queue_len 32 #endif static volatile sigdef * _ll_sig_queue[_ll_sig_queue_len]; /*@ Queue for signals to be serviced. */ volatile int _ll_sig_disabled; /*@ True if signals are being ignored. */ static void _ll_sig_handler(int sig) { sigdef *s = sigdef_by_sig(sig); int i; #ifdef SIG_UNBLOCK if ( sig == SIG_UNBLOCK ) abort(); #endif if ( _ll_sig_disabled ) return; if ( ! s ) { fprintf(stderr, "_ll_sig_handler(%d): unknown signal\n", sig); return; } /* Check queue for pre-existing signal. */ for ( i = _ll_sig_queue_head; i != _ll_sig_queue_tail; i = (i + 1) % _ll_sig_queue_len ) { if ( _ll_sig_queue[i] == s ) { fprintf(stderr, "_ll_sig_handler(SIG%s): already queued\n", s->name); #ifdef SIGSEGV if ( sig == SIGSEGV ) abort(); #endif return; } } fprintf(stderr, "_ll_sig_handler(SIG%s)\n", s->name); /* Append to tail of queue. */ _ll_sig_disabled ++; /* Avoid reentry. */ _ll_sig_queue[_ll_sig_queue_tail] = s; _ll_sig_queue_tail = (_ll_sig_queue_tail + 1) % _ll_sig_queue_len; _ll_sig_pending ++; _ll_sig_disabled --; /* Check for queue overrun. */ ll_assert_msg(sig,_ll_sig_queue_tail != _ll_sig_queue_head, ("signal queue overrun (length %d)", _ll_sig_queue_len)); } void _ll_sig_service() { if ( _ll_sig_disabled ) return; while ( _ll_sig_queue_head != _ll_sig_queue_tail ) { sigdef *s; /* Remove from head of queue */ _ll_sig_disabled ++; /* Avoid signal during queue processing */ s = _ll_sig_queue[_ll_sig_queue_head]; _ll_sig_queue[_ll_sig_queue_head] = 0; _ll_sig_queue_head = (_ll_sig_queue_head + 1) % _ll_sig_queue_len; _ll_sig_pending --; _ll_sig_disabled --; /* Apply the signal handler proc */ if ( s ) { fprintf(stderr, "\n_ll_sig_service(): SIG%s\n", s->name); ll_call(ll_sig_proc(s), 1, (ll_make_fixnum(s->sig))); } } } /****************************************************************************/ ll_define_primitive(fixnum, llCsignalCget, 1, (sig), _1(doc, "Gets the procedure that receives signal.")) { sigdef *s = sigdef_by_sig(ll_UNBOX_fixnum(ll_SELF)); ll_return(s ? ll_sig_proc(s) : ll_f); } ll_define_primitive_end ll_define_primitive(string, llCsignalCget, 1, (sig), _1(doc, "Gets the procedure that receives the signal.")) { sigdef *s = sigdef_by_name(ll_THIS->_array); ll_return(s ? ll_sig_proc(s) : ll_f); } ll_define_primitive_end ll_define_primitive(symbol, llCsignalCget, 1, (sig), _1(doc, "Gets the procedure that receives the signal.")) { ll_SELF = ll_THIS->_name; __ll_tail_callv(ll_o(llCsignalCget), 1); } ll_define_primitive_end /****************************************************************************/ static ll_v _ll_signal_setE(sigdef *s, ll_v proc) { ll_v prev; if ( s ) { void *handler; prev = ll_sig_proc(s); ll_sig_proc(s) = ll_ARGV[1]; if ( ll_unbox_boolean(ll_ARGV[1]) ) { handler = _ll_sig_handler; } else { handler = SIG_DFL; } signal(s->sig, handler); } else { prev = ll_f; } return prev; } ll_define_primitive(fixnum, llCsignalCsetE, 2, (sig, proc), _1(doc, "Sets handler for signal.")) { ll_return(_ll_signal_setE(sigdef_by_sig(ll_UNBOX_fixnum(ll_SELF)), ll_ARGV[1])); } ll_define_primitive_end ll_define_primitive(string, llCsignalCsetE, 2, (sig, proc), _1(doc, "Sets handler for signal.")) { ll_return(_ll_signal_setE(sigdef_by_name(ll_THIS->_array), ll_ARGV[1])); } ll_define_primitive_end ll_define_primitive(symbol, llCsignalCsetE, 2, (sig, proc), _1(doc, "Sets handler for signal.")) { ll_SELF = ll_THIS->_name; __ll_tail_callv(ll_o(llCsignalCsetE), 2); } ll_define_primitive_end /****************************************************************************/ ll_define_primitive(object,llCsignalCerror, 1, (sig), _1(doc, "Default signal handler; raises a signal error.")) { ll_return(_ll_error(ll_ee(signal), 1, ll_s(signal), ll_SELF)); } ll_define_primitive_end ll_INIT(sig,330,"initialize signal handlers") { int sigs[] = { /* ANSI C: B9. Signals. */ #ifdef SIGABRT SIGABRT, #endif #ifdef SIGFPE SIGFPE, #endif #ifdef SIGINT SIGINT, #endif #ifdef SIGSEGV SIGSEGV, #endif #ifdef SIGTERM SIGTERM, #endif -1 }; int i; for ( i = 0; sigs[i] >= 0; i ++ ) { ll_call(ll_o(llCsignalCsetE), 2, (ll_BOX_fixnum(sigs[i]), ll_o(llCsignalCerror))); } return 0; } /****************************************************************************/ ll0.13/src/ll/sig.h0100744000175200017560000000060107230472366014404 0ustar stephensstephens#ifndef _ll_sig_h #define _ll_sig_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_sig_h__ #define __rcs_id_ll_sig_h__ static const char __rcs_id_ll_sig_h[] = "$Id: sig.h,v 1.3 2001/01/15 03:56:38 stephens Exp $"; #endif #endif /* __rcs_id__ */ void _ll_sig_service(); extern volatile int _ll_sig_pending; #define ll_sig_service() ( _ll_sig_pending ? _ll_sig_service() : (void) 0 ) #endif ll0.13/src/ll/stack.c0100744000175200017560000001701607312334555014730 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_stack_c__ #define __rcs_id_ll_stack_c__ static const char __rcs_id_ll_stack_c[] = "$Id: stack.c,v 1.12 2001/06/15 04:06:06 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include #ifndef ll_STACK_DEBUG #define ll_STACK_DEBUG 0 #endif #define ll_VS_SIZE 1024 #define ll_AR_SIZE 256 #ifndef ll_VS_SIZE #define ll_VS_SIZE 32 #endif #ifndef ll_AR_SIZE #define ll_AR_SIZE 16 #endif /**************************************************************************/ /* value stack; used for arguments and return values */ volatile ll_v *_ll_val_sp, /* Current location in the stack buffer*/ *_ll_val_sp_bottom, /* The bottom of the stack buffer */ *_ll_val_sp_base; /* The base address of stack buffer */ /**************************************************************************/ /* activation record stack */ volatile ll_activation_record *_ll_ar_sp, /* Current activation record. */ *_ll_ar_sp_bottom, /* Bottom of stack */ *_ll_ar_sp_base; /**************************************************************************/ /* Probe the current stack buffer */ void _ll_vs_push(int n) /* Create a new stack buffer on the stack. */ { size_t size; ll_v *sb, *sp; /* ** Allocate at least ll_VS_SIZE, ** Allocate N + 5 (for stack buffer chain storage) + 1 (for possible extras) */ size = n + 7 > ll_VS_SIZE ? n + 7 : ll_VS_SIZE; sb = ll_malloc(sizeof(sb[0]) * size); sp = sb + size; /* Save old stack buffer pointers */ sp -= 5; sp[0] = ll_BOX_locative(sp + 1); /* GUARD */ sp[1] = ll_BOX_locative(_ll_val_sp); sp[2] = ll_BOX_locative(_ll_val_sp_base); sp[3] = ll_BOX_locative(_ll_val_sp_bottom); sp[4] = ll_BOX_locative(sp + 4); /* GUARD */ if ( ll_STACK_DEBUG ) { fprintf(stderr, "\nll: _ll_vs_push: SAVE: %p %p %p\n", (void*) _ll_val_sp_base, (void*) _ll_val_sp, (void*) _ll_val_sp_bottom); } if ( _ll_val_sp ) { _ll_ASSERT_STACKS(); } /* Start using new stack buffer */ _ll_val_sp = _ll_val_sp_bottom = sp; _ll_val_sp_base = sb; /* Always keep an extra around. */ //_ll_PUSH(ll_undef); //_ll_PEEK() = _ll_BOX //_ll_PUSH(ll_undef); if ( ll_STACK_DEBUG ) { fprintf(stderr, "ll: _ll_vs_push: %6d: %p %p %p\n", n, (void*) _ll_val_sp_base, (void*) _ll_val_sp, (void*) _ll_val_sp_bottom); } _ll_ASSERT_VAL_STACK(); } void _ll_vs_pop() /* pop the current stack buffer */ { /* ** Imagine a method context with the following: ** 1. Arguments near _ll_val_sp_base. ** 2. Locals on a separate stack buffer because lack of space. ** After _ll_val_sp = ll_ARGV + ll_ARGC (the locals and argument pop operation). ** _ll_val_sp doesn't reside in the current stack buffer. ** We need to keep popping stack buffers, until we reach the target ** stack buffer that contains _ll_val_sp after pop./ */ if ( ll_STACK_DEBUG ) { fprintf(stderr, "\n"); } do { ll_v *sp = (ll_v*) _ll_val_sp_bottom; if ( ll_STACK_DEBUG ) { fprintf(stderr, "ll: _ll_vs_pop: %p %p %p\n", (void*) _ll_val_sp_base, (void*) _ll_val_sp, (void*) _ll_val_sp_bottom); } ll_assert(stack, sp); /* Restore old stack pointers. */ // _ll_val_sp = ll_UNBOX_locative(sp[1]); _ll_val_sp_base = ll_UNBOX_locative(sp[2]); _ll_val_sp_bottom = ll_UNBOX_locative(sp[3]); ll_assert(stack, _ll_val_sp_base); ll_assert(stack, _ll_val_sp_bottom); if ( ll_STACK_DEBUG ) { fprintf(stderr, "ll: _ll_vs_pop: RESTORE: %p %p %p\n", (void*) _ll_val_sp_base, (void*) _ll_val_sp, (void*) _ll_val_sp_bottom); } } while ( ! (_ll_val_sp_base <= _ll_val_sp && _ll_val_sp <= _ll_val_sp_bottom) ); _ll_ASSERT_STACKS(); } /**************************************************************************/ /* Probe the current activation record stack buffer */ void _ll_ar_push(int n) { size_t size; ll_activation_record *sb, *sp; size = n + 1 > ll_AR_SIZE ? n + 1 : ll_AR_SIZE; sb = ll_malloc(sizeof(sb[0]) * size); sp = sb + size; -- sp; if ( ll_STACK_DEBUG ) { fprintf(stderr, "\nll: _ll_ar_push: SAVE: %p %p %p\n", (void*) _ll_ar_sp_base, (void*) _ll_ar_sp, (void*) _ll_ar_sp_bottom); } /* Save old stack pointers. */ { void **vp = (void**) sp; assert(sizeof(*sp) >= sizeof(*vp) * 5); vp[0] = ((void**) vp) + 1; /* GUARD. */ vp[1] = (void*) _ll_ar_sp; vp[2] = (void*) _ll_ar_sp_base; vp[3] = (void*) _ll_ar_sp_bottom; vp[4] = ((void**) vp) + 4; /* GUARD. */ } /* Start using new stack buffer. */ _ll_ar_sp = _ll_ar_sp_bottom = sp; _ll_ar_sp_base = sb; if ( ll_STACK_DEBUG ) { fprintf(stderr, "ll: _ll_ar_push: %6d: %p %p %p\n", n, (void*) _ll_ar_sp_base, (void*) _ll_ar_sp, (void*) _ll_ar_sp_bottom); } _ll_ASSERT_AR_STACK(); } void _ll_ar_pop() /* pop the current stack buffer */ { void **vp = (void**) _ll_ar_sp_bottom; /* Restore old stack pointers. */ _ll_ar_sp = vp[1]; _ll_ar_sp_base = vp[2]; _ll_ar_sp_bottom = vp[3]; if ( ll_STACK_DEBUG ) { fprintf(stderr, "\nll: _ll_ar_pop: RESTORE: %p %p %p\n", _ll_ar_sp_base, _ll_ar_sp, _ll_ar_sp_bottom); } _ll_ASSERT_STACKS(); } /**************************************************************************/ /* These routines save/restore all global stacks for catch and call/cc */ void _ll_get_stack_depth(ll_v *depths) { assert(ll_CATCH_SAVES >= 7); depths[0] = ll_BOX_locative(_ll_val_sp); depths[1] = ll_BOX_locative(_ll_ar_sp); depths[2] = ll_BOX_locative(_ll_val_sp_base); depths[3] = ll_BOX_locative(_ll_ar_sp_base); depths[4] = ll_BOX_locative(_ll_val_sp_bottom); depths[5] = ll_BOX_locative(_ll_ar_sp_bottom); /* Save fluid bindings */ depths[6] = ll_g(_fluid_bindings); } void _ll_set_stack_depth(const ll_v *depths) { _ll_val_sp = (void*) ll_UNBOX_locative(depths[0]); _ll_ar_sp = (void*) ll_UNBOX_locative(depths[1]); _ll_val_sp_base = (void*) ll_UNBOX_locative(depths[2]); _ll_ar_sp_base = (void*) ll_UNBOX_locative(depths[3]); _ll_val_sp_bottom = (void*) ll_UNBOX_locative(depths[4]); _ll_ar_sp_bottom = (void*) ll_UNBOX_locative(depths[5]); /* Restore fluid bindings */ ll_set_g(_fluid_bindings, depths[6]); } /**************************************************************************/ ll_INIT(stack,110,"activation record and value stacks") { /* Value stack: allocate stack buffer and push dummy element */ _ll_vs_push(1); /* Activation record stack: allocate stack buffer and push dummy element. */ _ll_ar_push(1); _ll_ar_sp --; _ll_ar_sp->super_object._isa = ll_type(activation_record); _ll_ar_sp->_type = ll_type(object); _ll_ar_sp->_type_offset = ll_make_fixnum(0); _ll_ar_sp->_op = _ll_ar_sp->_meth = ll_undef; _ll_ar_sp->_argc = 0; _ll_ar_sp->_db_at_rtn = ll_f; /* Value stack: Push dummy element */ _ll_PUSH(ll_undef); /* Activation record stack: initialize dummy element. */ _ll_ar_sp->_argv = (ll_v*) _ll_val_sp; /* Note: fluid binding stack is initialized after nil object. */ return 0; } /**************************************************************************/ #ifdef _ll_PUSH #undef _ll_PUSH #endif void _ll_PUSH(ll_v x) { *(-- _ll_val_sp) = x; _ll_ASSERT_STACKS(); //fprintf(stderr, "_ll_PUSH(): %p %p %p\n", _ll_val_sp_base, _ll_val_sp, _ll_val_sp_bottom ); } #ifdef _ll_POP #undef _ll_POP #endif ll_v _ll_POP() { ll_v x; //fprintf(stderr, "_ll_POP(): %p %p %p\n", _ll_val_sp_base, _ll_val_sp, _ll_val_sp_bottom ); x = *(_ll_val_sp++); _ll_ASSERT_STACKS(); return x; } /**************************************************************************/ ll0.13/src/ll/stack.h0100744000175200017560000001007607262415714014735 0ustar stephensstephens#ifndef _ll_stack_h #define _ll_stack_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_stack_h__ #define __rcs_id_ll_stack_h__ static const char __rcs_id_ll_stack_h[] = "$Id: stack.h,v 1.2 2001/02/06 00:01:10 stephens Exp $"; #endif #endif /* __rcs_id__ */ /****************************************************************************/ /* activation stack */ typedef struct _ll_tsa_activation_record ll_activation_record; /****************************************************************************/ /* activation protocol */ /* Use two stacks to make proper tail recursion more efficient. 1. Activation record stack: Contains: 1.1. the operation sent: op 1.2. the argument list vector with the receiver at 0: argv, argc 1.3. the method found: meth 1.4. the type the method was found in: type 1.5. the offset from address of the receiver to the ivar block for the type the method was found in: type_offset 2. Values stack: for both arguments and return values. Both stack grow from high addresses to low addresses. Eventually, will implement stack buffers for call/cc. */ /****************************************************************************/ /* The activation record stack */ extern volatile ll_activation_record *_ll_ar_sp, *_ll_ar_sp_bottom, *_ll_ar_sp_base; #define ll_AR ll_make_ref(_ll_ar_sp) #define ll_AR_ARGC (_ll_ar_sp->_argc) #define ll_AR_ARGV (_ll_ar_sp->_argv) #define ll_AR_OP (_ll_ar_sp->_op) #define ll_AR_TYPE (_ll_ar_sp->_type) #define ll_AR_TYPE_OFFSET (_ll_ar_sp->_type_offset) #define ll_AR_METH (_ll_ar_sp->_meth) #define ll_AR_DB_AT_RTN (_ll_ar_sp->_db_at_rtn) #define ll_ARGC ll_AR_ARGC #define ll_ARGV ll_AR_ARGV #define ll_SELF ll_ARGV[0] #define ll_RCVR ll_SELF #define _ll_AS_CHECK(N) 0 /* push and pop activation record stack buffers. */ extern void _ll_ar_push(int n); extern void _ll_ar_pop(); #define _ll_AR_PROBE(N) if ( _ll_ar_sp - (N) < _ll_ar_sp_base ) _ll_ar_push(N) #define _ll_AR_POP() if ( _ll_ar_sp >= _ll_ar_sp_bottom ) _ll_ar_pop(); /****************************************************************************/ /* The value stack */ extern volatile ll_v *_ll_val_sp, *_ll_val_sp_base, *_ll_val_sp_bottom; #define _ll_PEEK()(*_ll_val_sp) #if 0 #define _ll_POP()(*(_ll_val_sp++)) #define _ll_PUSH(X)(*(--_ll_val_sp)=(X)) #else ll_v _ll_POP(); void _ll_PUSH(ll_v x); #endif #define _ll_POPN(N)(*(_ll_val_sp+=(N))) #define _ll_PUSHN(N)(_ll_val_sp-=(N)) /* push and pop value stack buffers. */ extern void _ll_vs_push(int n); extern void _ll_vs_pop(); /* <= because we might need an extra for implied self in _ll_call_superv() */ #define _ll_VS_PROBE(N) if ( _ll_val_sp - (N) <= _ll_val_sp_base ) _ll_vs_push(N) #define _ll_VS_POP() if ( ! (_ll_val_sp_base <= _ll_val_sp && _ll_val_sp <= _ll_val_sp_bottom) ) _ll_vs_pop() #if 1 #include "ll/assert.h" #define _ll_ASSERT_VAL_STACK() \ ll_assert_msg(stack, ll_UNBOX_locative(_ll_val_sp_bottom[0]) == _ll_val_sp_bottom + 1, ("%p %p %p value stack guard corrupted", _ll_val_sp_base, _ll_val_sp, _ll_val_sp_bottom)); \ ll_assert_msg(stack, ll_UNBOX_locative(_ll_val_sp_bottom[4]) == _ll_val_sp_bottom + 4, ("%p %p %p value stack guard corrupted", _ll_val_sp_base, _ll_val_sp, _ll_val_sp_bottom)); \ ll_assert_msg(stack, _ll_val_sp_base <= _ll_val_sp && _ll_val_sp <= _ll_val_sp_bottom, ("%p %p %p value stack buffer over/underrun", _ll_val_sp_base, _ll_val_sp, _ll_val_sp_bottom)) #define _ll_ASSERT_AR_STACK() \ ll_assert_msg(stack, ((void**)_ll_ar_sp_bottom)[0] == ((void**)_ll_ar_sp_bottom) + 1, ("%p %p %p vaar stack guard corrupted", _ll_ar_sp_base, _ll_ar_sp, _ll_ar_sp_bottom)); \ ll_assert_msg(stack, ((void**)_ll_ar_sp_bottom)[4] == ((void**)_ll_ar_sp_bottom) + 4, ("%p %p %p ar stack guard corrupted", _ll_ar_sp_base, _ll_ar_sp, _ll_ar_sp_bottom)); \ ll_assert_msg(stack, _ll_ar_sp_base <= _ll_ar_sp && _ll_ar_sp <= _ll_ar_sp_bottom, ("%p %p %p ar stack buffer over/underrun", _ll_ar_sp_base, _ll_ar_sp, _ll_ar_sp_bottom)) #define _ll_ASSERT_STACKS() _ll_ASSERT_VAL_STACK(); _ll_ASSERT_AR_STACK() #else #define _ll_ASSERT_AR_STACK() #define _ll_ASSERT_VAL_STACK() #define _ll_ASSERT_STACKS() #endif #endif ll0.13/src/ll/string.c0100744000175200017560000002352207230472500015120 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_string_c__ #define __rcs_id_ll_string_c__ static const char __rcs_id_ll_string_c[] = "$Id: string.c,v 1.16 2001/01/15 03:57:52 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" /* __ll_tail_callv */ #include #include #include /***************************************************************************/ #define _ll_VEC string #define _ll_VEC_ELEM_TYPE char #define _ll_VEC_COMPUTE_SIZE(v) (v ? strlen(v) : 0) #define _ll_VEC_TERM 1 #define _ll_VEC_TERM_VALUE '\0' #define _ll_VEC_UNBOX_VALUE(X) ll_unbox_char(X) #define _ll_VEC_BOX_VALUE(X) ll_make_char(X) #include "vec.c" /***************************************************************************/ /* K&R A2.5.3 Character Constants */ static const char C_char_escapes[] = "n\nt\tv\vb\br\rf\fa\a\\\\\"\"\'\'"; ll_define_primitive(string, _string_escape, 1, (str), _1(no_side_effect,"#t")) { unsigned char *v = ll_THIS->_array; size_t l = ll_THIS->_length; char *b = alloca(l * 4 + 1); char *p = b; while ( l -- ) { int c = *(v ++); { const char *m = C_char_escapes; while ( *m ) { if ( c == m[1] ) { *(p ++) = '\\'; c = m[0]; goto got_c; } m += 2; } } if ( ! (0x20 <= c && c <= 0x7e) ) { /* Did not find escape char */ *(p ++) = '\\'; *(p ++) = "01234567"[(c >> 6) & 7]; *(p ++) = "01234567"[(c >> 3) & 7]; c = "01234567"[c & 7]; } got_c: *(p ++) = c; } *p = '\0'; ll_return(_ll_make_copy_string(b, p - b)); } ll_define_primitive_end ll_define_primitive(string, _string_unescape, 1, (str), _1(no_side_effect,"#t")) { unsigned char *v = ll_THIS->_array; size_t l = ll_THIS->_length; char *b = alloca(l + 1); char *p = b; #define PEEK() (l ? *v : EOF) #define READ() (l ? (l --, *(v ++)) : EOF) while ( l ) { int c = PEEK(); if ( c == '\\' ) { READ(); switch ( c = READ() ) { case EOF: ll_return(ll_f); /* IMPLEMENT RAISE ERROR */ break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': { int d; int ndigits = 0; c = c - '0'; while ( ndigits < 3 && (d = PEEK()) && '0' <= d && d <= '7' ) { READ(); c *= 8; c += d - '0'; ndigits ++; } } break; case 'x': case 'X': { int d; int ndigits = 0; c = 0; while ( ndigits < 2 && (d = PEEK()) != EOF ) { if ( '0' <= d && d <= '9' ) { READ(); c *= 16; c += d - '0'; } else if ( 'a' <= d && d <= 'f' ) { READ(); c *= 16; c += d - 'a' + 10; } else if ( 'A' <= d && d <= 'F' ) { READ(); c *= 16; c += d - 'A' + 10; } else { break; } ndigits ++; } } break; default: { const char *m = C_char_escapes; while ( *m ) { if ( c == m[0] ) { c = m[1]; goto got_c; } m += 2; } } ll_return(ll_f); break; } } else { c = READ(); } got_c: *(p ++) = c; } *p = '\0'; ll_return(_ll_make_copy_string(b, p - b)); } ll_define_primitive_end ll_define_primitive(string, string__symbol, 1, (str), _1(no_side_effect,"#t")) { ll_tail_call(ll_o(make), 2, (ll_type(symbol), ll_SELF)); } ll_define_primitive_end ll_define_primitive(string, string__number, 1, _(str,radix), _1(no_side_effect,"#t")) { char *v = ll_THIS->_array; size_t l = ll_THIS->_length; double acc = 0; int radix; int neg = 0; int has_sign = 0; int has_digits = 0; int has_radix = 0; int has_hash_digit = 0; int has_dot = 0; int has_exp = 0; int has_exact = 0; int is_float = 0; int exponent = 0; int c; if ( ll_ARGC >= 2 ) { radix = ll_unbox_fixnum(ll_ARGV[1]); if ( ! (0 < radix && radix <= 36) ) { ll_return(ll_f); } } else { radix = 10; } if ( PEEK() == '+' ) { READ(); has_sign = 1; } else if ( PEEK() == '-' ) { READ(); has_sign = 1; neg = 1; } else if ( PEEK() == '#' ) { READ(); while ( l ) { c = PEEK(); switch ( c ) { case 'b': case 'B': radix = 2; /* FALL THROUGH */ check_for_radix: if ( has_radix ) { ll_return(ll_f); } has_radix = 1; READ(); break; case 'o': case 'O': radix = 8; goto check_for_radix; case 'd': case 'D': radix = 10; goto check_for_radix; case 'x': case 'X': radix = 16; goto check_for_radix; /* #e exact specifier */ case 'e': case 'E': if ( has_exact ) { ll_return(ll_f); } has_exact = 'e'; READ(); break; /* #i inexact specifier */ case 'i': case 'I': if ( has_exact ) { ll_return(ll_f); } has_exact = 'i'; READ(); break; /* Unknown # specifier */ default: ll_return(ll_f); } } } while ( l ) { c = READ(); /* [0-9] */ if ( isdigit(c) ) { c -= '0'; } else if ( c == '#' ) { c = 0; has_hash_digit = 1; } else if ( isalpha(c) ) { if ( islower(c) ) { /* [a-z] */ c -= 'a' - 10; } else { /* [A-Z] */ c -= 'A' - 10; } /* a '_' within a digit string is padding */ } else if ( (has_digits || has_radix) && c == '_' ) { continue; } else if ( c == '.' ) { if ( has_dot || has_radix ) ll_return(ll_f); has_dot = 1; is_float = 1; continue; } else if ( tolower(c) == 'e' ) { if ( has_exp || has_radix ) ll_return(ll_f); has_exp = 1; is_float = 1; { int exp_neg = 0; int e = 0; c = READ(); if ( c == '-' ) { exp_neg = 1; c = READ(); } else if ( c == '+' ) { c = READ(); } while ( l ) { if ( isdigit(c) ) { e *= 10; e += c - '0'; } else { return ll_f; } } if ( exp_neg ) e = - e; exponent += e; break; } #if 0 } else if ( isspace(c) ) { continue; #endif } else { ll_return(ll_f); } /* c is within the radix? */ if ( 0 <= c && c < radix ) { acc *= radix; acc += c; has_digits = 1; if ( has_dot ) { exponent --; } } else { ll_return(ll_f); } } /* If we didn't get any digits, it's not a number */ if ( l || ! has_digits ) { ll_return(ll_f); } /* Handle sign */ if ( neg ) { acc = - acc; } /* Was it 15##? Make it float */ if ( has_hash_digit ) { is_float = 1; } /* Is is a float */ if ( is_float ) { acc *= pow(radix, exponent); /* fprintf(stderr, "string->number: %.22g == %.22g\n", (double) acc, (double) ll_unbox_flonum(ll_make_flonum(acc))); */ ll_return(ll_make_flonum(acc)); } /* Check for overflow */ if ( (long) acc != (long) ll_unbox_fixnum(ll_make_fixnum((long) acc)) ) { ll_return(ll_f); } ll_return(ll_make_fixnum((long) acc)); } ll_define_primitive_end #undef PEEK #undef READ /***************************************************************************/ /* string as input port */ ll_define_primitive(mutable_string, read_char, 1, (port), _0()) { if ( ll_THIS->super_string._length ) { ll_THIS->super_string._length --; ll_return(ll_make_char(*(ll_THIS->super_string._array ++))); } else { ll_return(ll_eos); } } ll_define_primitive_end ll_define_primitive(mutable_string, peek_char, 1, (port), _0()) { if ( ll_THIS->super_string._length ) { ll_return(ll_make_char(*(ll_THIS->super_string._array))); } else { ll_return(ll_eos); } } ll_define_primitive_end /***************************************************************************/ /* string as output-port */ ll_define_primitive(mutable_string, _output_string, 2, (port, string), _0()) { size_t count = _ll_len_string(ll_ARGV[1]); ll_call(ll_o(string_appendE), 2, (ll_SELF, ll_ARGV[1])); ll_return(ll_make_fixnum(count)); } ll_define_primitive_end ll_define_primitive(mutable_string, _output_char, 2, (port, char), _0()) { ll_tail_call(ll_o(append_oneE), 2, (ll_SELF, ll_ARGV[1])); } ll_define_primitive_end /***************************************************************************/ #define CHAR_CMP_PRED(NAME,OP) \ ll_define_primitive(string,string##NAME##Q,2,(string1,string2), _1(no_side_effect,"#t")) \ { \ size_t i, l; \ const char *v; \ _ll_typecheck(ll_type(string), &ll_ARGV[1]); \ l = ll_THIS_ISA(string, ll_ARGV[1])->_length; \ v = ll_THIS_ISA(string, ll_ARGV[1])->_array; \ for ( i = 0; i < ll_THIS->_length && i < l; i ++) { \ if ( ! (ll_THIS->_array[i] OP v[i]) ) { \ ll_return(ll_f); \ } \ } \ ll_return(ll_make_boolean(ll_THIS->_length OP l)); \ } \ ll_define_primitive_end \ ll_define_primitive(string,string_ci##NAME##Q,2,(string1,string2), _1(no_side_effect,"#t")) \ { \ size_t i, l; \ const char *v; \ _ll_typecheck(ll_type(string), &ll_ARGV[1]); \ l = ll_THIS_ISA(string, ll_ARGV[1])->_length; \ v = ll_THIS_ISA(string, ll_ARGV[1])->_array; \ for ( i = 0; i < ll_THIS->_length && i < l; i ++) { \ if ( ! (tolower(ll_THIS->_array[i]) OP tolower(v[i])) ) { \ ll_return(ll_f); \ } \ } \ ll_return(ll_make_boolean(ll_THIS->_length OP l)); \ } \ ll_define_primitive_end CHAR_CMP_PRED(AS,==) CHAR_CMP_PRED(LT,<) CHAR_CMP_PRED(GT,>) CHAR_CMP_PRED(LE,<=) CHAR_CMP_PRED(GE,>=) #undef CHAR_CMP_PRED /***************************************************************************/ #define X ll_SELF #define Y ll_ARGV[1] ll_define_primitive(string, equalQ, 2, (x, y), _1(no_side_effect,"#t")) { size_t l; if ( ll_EQ(X, Y) ) ll_return(ll_t); if ( ll_NE(ll_TYPE(X), ll_TYPE(Y)) ) { ll_v tc = ll_call(ll_o(stringQ), 1, (ll_ARGV[1])); if ( ! ll_unbox_boolean(tc) ) ll_return(tc); } l = ll_THIS->_length; if ( l != ll_unbox_fixnum(ll_call(ll_o(string_length), 1, (Y))) ) ll_return(ll_f); if ( l ) { char *x, *y; x = ll_THIS->_array; y = ll_THIS_ISA(string, Y)->_array; while ( -- l > 0 ) { if ( *(x ++) != *(y ++) ) ll_return(ll_f); } } ll_return(ll_t); } ll_define_primitive_end #undef X #undef Y ll0.13/src/ll/symbol.c0100744000175200017560000001420407262415714015125 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_symbol_c__ #define __rcs_id_ll_symbol_c__ static const char __rcs_id_ll_symbol_c[] = "$Id: symbol.c,v 1.16 2001/02/05 23:49:45 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "symbol.h" #include #include /************************************************************************/ #define HASH_EXTERN static #include "hash/charP_hash.c" #define HASH(X)_ll_symbol_##X #define HASH_KEY const char* #define HASH_KEY_HASH(X) strhash(X) #define HASH_KEY_EQUAL(X,Y) (X[0] == Y[0] && strcmp(X,Y)==0) #define HASH_KEY_SET(X,Y)((X)=(Y),ll_write_barrier(&(X))) #define HASH_DATA ll_v #define HASH_DATA_SET(X,Y)((X)=(Y),ll_write_barrier(&(X))) #define HASH_MALLOC(X) ll_malloc(X) #define HASH_REALLOC(X,Y) ll_realloc(X,Y) #define HASH_FREE(X) ll_free(X) #include "hash/hash.c" #include "hash/hash_end.def" /************************************************************************/ static _ll_symbol_Table _symtable, *symtable = &_symtable; static void symtable_init(int size) { static int symtable_inited; if ( ! symtable_inited ) { symtable_inited = 1; _ll_symbol_TableInit(symtable, size); } } void _ll_intern_symbol(ll_v sym, ll_v str) { const char *name = _ll_ptr_string(str); ll_set_g(_symbols, ll_cons(sym, ll_g(_symbols))); _ll_symbol_TablePush(symtable, name, sym); } ll_v _ll_interned_symbol_(const char *name) { ll_v *x; x = _ll_symbol_TableGet(symtable, name); return x ? *x : ll_f; } ll_v _ll_interned_symbol(ll_v str) { const char *name = _ll_ptr_string(str); return _ll_interned_symbol_(name); } static struct strmap { const char *in; const char *out; } _smap[] = { { "NEG", "neg" }, #define BOP(N,O) { #N, #O }, { "EQ", "=" }, #include "cops.h" { "AS", "=" }, { "__", "->" }, { "_", "-" }, { "P", "%" }, { "C", ":" }, { "D", "." }, { "Q", "?" }, { "E", "!" }, { "S", "*" }, { " ", "-" }, { 0 , 0 } }; static const char *strprefix(const char *str, const char *pre) { while ( *pre ) { if ( *pre != *str ) return 0; pre ++; str ++; } return str; } const char *_ll_escape_symbol(const char *in) { static char buf[128]; char *out = buf; restart: while ( *in == '_' ) { *(out ++) = '%'; in ++; } while ( *in ) { if ( *in == '_' || isupper(*in) ) { struct strmap *map = _smap; while ( map->in ) { const char *e; if ( (e = strprefix(in, map->in)) ) { const char *t = map->out; in = e; while ( *t ) { *(out ++) = *(t ++); } if ( ! isalnum(out[-1]) ) goto restart; goto next_in; } map ++; } } *(out ++) = *(in ++); next_in: ; } *out = '\0'; return buf; } static ll_v _ll_allocate_symbol(ll_v str) { ll_v sym; _ll_tsa_symbol *x; sym = _ll_allocate_type(ll_type(symbol)); x = ll_THIS_ISA(symbol, sym); x->_name = str; x->_properties = ll_nil;; return sym; } ll_v _ll_make_symbol(ll_v str) { const char *name; if ( ll_unbox_boolean(str) ) { name = _ll_ptr_string(str); } else { name = 0; } return _ll_make_symbol_(name); } ll_v _ll_make_symbol_(const char *name) { ll_v sym, str; if ( ! (name && *name) ) { /* gensym: not interned. */ sym = _ll_allocate_symbol(ll_f); } else { if ( *name == '\001' ) { name = _ll_escape_symbol(name + 1); } sym = _ll_interned_symbol_(name); if ( ll_EQ(sym,ll_f) ) { str = _ll_make_copy_string(name, -1); sym = _ll_allocate_symbol(str); _ll_intern_symbol(sym, str); } } return sym; } ll_define_primitive(symbol, symbol__string, 1, (sym), _1(no_side_effect,"#t")) { ll_THIS->_name = ll_call(ll_o(make_immutable), 1, (ll_THIS->_name)); ll_write_barrier_SELF(); ll_return(ll_THIS->_name); } ll_define_primitive_end ll_define_primitive(symbol, initialize, 1, _(sym,name), _0()) { ll_v sym; ll_THIS->_name = ll_ARGC >= 2 ? ll_ARGV[1] : ll_f; ll_THIS->_properties = ll_ARGC >= 3 ? ll_ARGV[2] : ll_nil; ll_write_barrier_SELF(); if ( ll_NE(ll_THIS->_name, ll_f) ) { /* Look for an interned symbol of the same name */ sym = _ll_interned_symbol(ll_THIS->_name); if ( ll_NE(sym, ll_f) ) { ll_return(sym); } /* Save a copy of the name and intern ourselves */ ll_THIS->_name = ll_call(ll_o(clone), 1, (ll_THIS->_name)); ll_write_barrier_SELF(); _ll_intern_symbol(ll_SELF, ll_THIS->_name); } ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(symbol, locative_properties, 1, (self), _1(no_side_effect,"#t")) /* Access properties. */ { ll_return(ll_make_locative(&ll_THIS->_properties)); } ll_define_primitive_end ll_define_primitive(object, _gensym, 0, (), _0()) /* Generates a unique uninterned symbol. */ { ll_tail_call(ll_o(make), 1, (ll_type(symbol))); } ll_define_primitive_end ll_define_primitive(object, llChashstats, 0, (), _0()) /* Dumps symbol hash table stats */ { _ll_symbol_TableStats(symtable, stderr); } ll_define_primitive_end /********************************************************************/ const char *_ll_name_symbol(ll_v v) { ll_v t = ll_TYPE(v); if ( ll_eqQ(t, ll_type(symbol)) ) { _ll_tsa_symbol *x = ll_THIS_ISA(symbol,v); return ll_NE(x->_name, ll_f) ? _ll_ptr_string(x->_name) : 0; } else { return _ll_ptr_string(ll_call(ll_o(symbol__string), 1, (v))); } } /********************************************************************/ ll_INIT(symbol,150,"create interned symbols") { int i; ll_DEBUG_PRINT(initCCsymbol, "BEGIN\n"); ll_set_g(_symbols, ll_nil); /* Compute number of initial interned symbols. */ for ( i = 0; _ll_symbols[i].name; i ++ ) { /* NOTHING */ } symtable_init(i * 2); for ( i = 0; _ll_symbols[i].name; i ++ ) { const char *sname = _ll_escape_symbol(_ll_symbols[i].name); *(_ll_symbols[i].vp) = _ll_make_symbol_(sname); ll_write_root(_ll_symbols[i].vp); ll_DEBUG_PRINT(initCCsymbol, " '%s' => (string->symbol \"%s\") => %p\n", _ll_symbols[i].name, sname, ll_UNBOX_ref(*(_ll_symbols[i].vp))); } ll_DEBUG_PRINT(initCCsymbol, "END\n"); return 0; } /********************************************************************/ /* EOF */ ll0.13/src/ll/symbol.h0100644000175200017560000000063007001134473015116 0ustar stephensstephens#ifndef _ll_symbol_h #define _ll_symbol_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_symbol_h__ #define __rcs_id_ll_symbol_h__ static const char __rcs_id_ll_symbol_h[] = "$Id: symbol.h,v 1.3 1999/10/13 16:54:19 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/value.h" /* ll_v */ typedef struct _ll_symbol { const char *name; ll_v *vp; } _ll_symbol; extern _ll_symbol _ll_symbols[]; #endif ll0.13/src/ll/symbol1.h0100644000175200017560000000063306775454234015223 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_symbol1_h__ #define __rcs_id_ll_symbol1_h__ static const char __rcs_id_ll_symbol1_h[] = "$Id: symbol1.h,v 1.7 1999/10/02 19:10:20 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #define _ll_deftype_slot(T,N,S)ll_s(S) #include "ll/types.h" #define ll_g_def(N)ll_s(N) #include "ll/globals.h" #define ll_bc_def(N,NARGS,SM,NSA)ll_s(N) #include "ll/bcs.h" ll0.13/src/ll/symbols.c0100644000175200017560000000072307001135052015271 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_symbols_c__ #define __rcs_id_ll_symbols_c__ static const char __rcs_id_ll_symbols_c[] = "$Id: symbols.c,v 1.1 1999/10/13 16:58:18 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/symbol.h" ll_v #ifndef ll_s_def #define ll_s_def(X) _ll_s_##X, #include "ll/symbols.h" #endif _ll_s_; _ll_symbol _ll_symbols[] = { #ifndef ll_s_def #define ll_s_def(X) { #X, &_ll_s_##X }, #include "ll/symbols.h" #endif { 0 } }; ll0.13/src/ll/syntax.c0100764000175200017560000004463307623404627015163 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_syntax_c__ #define __rcs_id_ll_syntax_c__ static const char __rcs_id_ll_syntax_c[] = "$Id: syntax.c,v 1.18 2003/02/15 09:34:15 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /*********************************************************/ ll_v ll_quote(ll_v x) { return ll_cons(ll_s(quote), ll_cons(x, ll_nil)); } #define APPEND_BEGIN(x) ll_v x = ll_nil, *x##p = &x #define APPEND(x,V) (x##p = &ll_CDR(*x##p = ll_cons((V), ll_nil))) #define INSERT(x,V) (x = ll_cons((V), x)) /**********************************************************************/ /* 4.2. Derived expression types */ /**********************************************************************/ /* 4.2.1. Conditionals */ ll_define_macro(pair,cond,1,_(clause1,clause2)) { ll_v expr = ll_unspec, *t = &expr; size_t i; ll_v temp = ll_f; for ( i = 0; i < ll_ARGC; ) { ll_v clause = ll_ARGV[i ++]; ll_v test = ll_car(clause); ll_v body = ll_cdr(clause); int need_test_value = 0; if ( i == ll_ARGC && ll_eqQ(test, ll_s(else)) ) { /* (cond (else ...)) ==> (begin ...) */ body = ll_cons(ll_s(begin), body); *t = ll_cons(body, ll_nil); break; } else if ( ll_nullQ(body) ) { /* (cond () ...) ==> (begin (set! ) (if (cond ...))) */ if ( ! ll_unbox_boolean(temp) ) { temp = ll_call(ll_o(_gensym), 0, ()); } need_test_value = 1; body = temp; } else if ( ll_eqQ(ll_car(body), ll_s(EQGT)) ) { /* (cond ( => ) ...) ==> (begin (set! ) (if ( ) (cond ...))) */ body = ll_cdr(body); if ( ! ll_unbox_boolean(temp) ) { temp = ll_call(ll_o(_gensym), 0, ()); } need_test_value = 1; body = ll_listn(2, ll_car(body), temp); } else { /* (cond ( ...) ...) => (if (begin ...) (cond ...)) */ body = ll_cons(ll_s(begin), body); } { ll_v x; ll_v *next_t; if ( need_test_value ) { ll_v y; ll_v test2; if ( ! ll_unbox_boolean(temp) ) { temp = ll_call(ll_o(_gensym), 0, ()); } test2 = test; test = temp; x = ll_listn(3, ll_s(if), test, body); next_t = &ll_CDR(ll_CDR(ll_CDR(x))); y = ll_listn(3, ll_s(begin), ll_listn(3, ll_s(setE), temp, test2), x); x = y; } else { x = ll_listn(3, ll_s(if), test, body); next_t = &ll_CDR(ll_CDR(ll_CDR(x))); } *t = ll_cons(x, ll_nil); t = next_t; } } expr = ll_car(expr); if ( ll_unbox_boolean(temp) ) { expr = ll_listn(3, ll_s(let), ll_listn(1, ll_listn(2, temp, ll_undef)), expr); } ll_return(expr); } ll_define_macro_end ll_define_macro(object,_eqvQ_or,1,_(value,test1)) { if ( ll_ARGC == 1 ) { ll_return(ll_f); } else if ( ll_ARGC == 2 ) { ll_return(ll_listn(3, ll_s(eqvQ), ll_ARGV[0], ll_quote(ll_ARGV[1]))); } else { ll_return(ll_listn(4, ll_s(if), ll_listn(3, ll_s(eqvQ), ll_ARGV[0], ll_quote(ll_ARGV[1])), ll_t, ll_cons(ll_s(_eqvQ_or), ll_cons(ll_ARGV[0], ll_listv(ll_ARGC - 2, ll_ARGV + 2))))); } } ll_define_macro_end ll_define_macro(object,case,2,_(key,clause1,clause2)) { ll_v expr = ll_unspec, *t = &expr; size_t i; ll_v temp; temp = ll_call(ll_o(_gensym), 0, ()); for ( i = 1; i < ll_ARGC; ) { ll_v clause = ll_ARGV[i ++]; ll_v test = ll_car(clause); ll_v body = ll_cdr(clause); if ( i == ll_ARGC && ll_eqQ(test, ll_s(else)) ) { /* (case (else ...)) ==> (begin ...) */ body = ll_cons(ll_s(begin), body); *t = ll_cons(body, ll_nil); break; } else if ( ll_nullQ(body) ) { /* (case () ...) ==> #t */ body = ll_unspec; } else { /* (case ( ...) ...) => (if (begin ...) (cond ...)) */ body = ll_cons(ll_s(begin), body); } { ll_v x; ll_v *next_t; test = ll_cons(ll_s(_eqvQ_or), ll_cons(temp, test)); x = ll_listn(3, ll_s(if), test, body); next_t = &ll_CDR(ll_CDR(ll_CDR(x))); *t = ll_cons(x, ll_nil); t = next_t; } } expr = ll_car(expr); expr = ll_listn(3, ll_s(let), ll_listn(1, ll_listn(2, temp, ll_ARGV[0])), expr); ll_return(expr); } ll_define_macro_end ll_define_macro(object,and,0,_(exprs)) { if ( ll_ARGC == 0 ) { /* (and) => #t */ ll_return(ll_t); } else if ( ll_ARGC == 1 ) { /* (and test) => test */ ll_return(ll_ARGV[0]); } else { /* (and test1 test2 ...) => (if test1 (and test2 ...) #f)) */ ll_return(ll_listn(4, ll_s(if), ll_ARGV[0], ll_cons(ll_s(and), ll_listv(ll_ARGC - 1, ll_ARGV + 1)), ll_f)); } } ll_define_macro_end ll_define_macro(object,or,0,_(exprs)) { if ( ll_ARGC == 0 ) { /* (or) => #f */ ll_return(ll_f); } else if ( ll_ARGC == 1 ) { /* (or test) => test */ ll_return(ll_ARGV[0]); } else { /* (or test1 test2 ...) => (let ((x test1)) (if x x (or test2 ...))) */ ll_v sym = ll_call(ll_o(_gensym), 0, ()); ll_return(ll_listn(3, ll_s(let), ll_listn(1, ll_listn(2, sym, ll_ARGV[0])), ll_listn(4, ll_s(if), sym, sym, ll_cons(ll_s(or), ll_listv(ll_ARGC - 1, ll_ARGV + 1))))); } } ll_define_macro_end /**********************************************************************/ /* R5RS 4.2.2. Binding constructs */ ll_define_macro(list,let,1,_(bindings,body)) { APPEND_BEGIN(vars); APPEND_BEGIN(inits); ll_v body = ll_listv(ll_ARGC - 1, ll_ARGV + 1); /* Split vars and inits into separate lists */ ll_LIST_LOOP(ll_ARGV[0], x); { ll_v var = ll_car(x); ll_v init = ll_car(ll_cdr(x)); APPEND(vars, var); APPEND(inits, init); } ll_LIST_LOOP_END; ll_return(ll_cons(ll_cons(ll_s(lambda), ll_cons(vars, body)), inits)); } ll_define_macro_end ll_define_macro(list,letS,1,_(bindings,body)) { if ( ll_nullQ(ll_ARGV[0]) ) { /* (let* () ...) => (let () ...) */ ll_return(ll_cons(ll_s(let), ll_listv(ll_ARGC, ll_ARGV))); } else { /* (let* ((name1 init1) (name2 init2) ...) body1 body2 ...) => (let ((name1 init1)) (let* ((name2 init2) ...) body1 body2 ...)) */ ll_v body = ll_listv(ll_ARGC - 1, ll_ARGV + 1); ll_return(ll_listn(3, ll_s(let), ll_listn(1, ll_car(ll_ARGV[0])), ll_cons(ll_s(letS), ll_cons(ll_cdr(ll_ARGV[0]), body)))); } } ll_define_macro_end ll_define_macro(list,letrec,1,_(bindings,body)) { APPEND_BEGIN(vars); APPEND_BEGIN(inits); APPEND_BEGIN(body); /* Split vars and inits into separate lists */ ll_LIST_LOOP(ll_ARGV[0], x); { ll_v var = ll_car(x); ll_v init = ll_car(ll_cdr(x)); APPEND(vars, var); APPEND(inits, ll_undef); APPEND(body, ll_listn(3, ll_s(setE), var, init)); } ll_LIST_LOOP_END; *bodyp = ll_listv(ll_ARGC - 1, ll_ARGV + 1); ll_return(ll_cons(ll_cons(ll_s(lambda), ll_cons(vars, body)), inits)); } ll_define_macro_end /**********************************************************************/ /* R5RS 4.2.3. Sequencing */ ll_define_macro(object,begin,0,_(body)) { /* (begin . ) => ((lambda () . )) */ if ( ll_ARGC == 0 ) { ll_return(ll_unspec); } else if ( ll_ARGC == 1 ) { ll_return(ll_ARGV[0]); } else { ll_return(ll_listn(1, ll_cons(ll_s(lambda), ll_cons(ll_nil, ll_listv(ll_ARGC, ll_ARGV))))); } } ll_define_macro_end /**********************************************************************/ /* R5RS 4.2.4. Iteration */ ll_define_macro(list,do,2,_(bindings,test,body)) { APPEND_BEGIN(nbindings); APPEND_BEGIN(steps); ll_v test = ll_car(ll_ARGV[1]); ll_v exprs = ll_cdr(ll_ARGV[1]); /* Split vars and inits into separate lists */ ll_LIST_LOOP(ll_ARGV[0], x); { ll_v var, init, step; var = ll_car(x); x = ll_cdr(x); init = ll_car(x); x = ll_cdr(x); APPEND(nbindings, ll_listn(2, var, init)); if ( ! ll_nullQ(x) ) { step = ll_car(x); x = ll_cdr(x); step = ll_listn(3, ll_s(setE), var, step); //ll_format(ll_undef, "do step ~S\n", 1, step); INSERT(steps, step); } } ll_LIST_LOOP_END; //ll_format(ll_undef, "do steps ~S\n", 1, steps); { ll_v loop_name, loop_def, body, x; ll_v branch, loop, loop_call; loop_name = ll_call(ll_o(_gensym), 0, ()); loop_call = ll_cons(loop_name, ll_nil); body = ll_listv(ll_ARGC - 2, ll_ARGV + 2); body = ll_call(ll_o(append), 3, (body, steps, ll_cons(loop_call, ll_nil))); //ll_format(ll_undef, "do body + steps + loop_call ~S\n", 1, body); body = ll_cons(ll_s(begin), body); //ll_format(ll_undef, "do body ~S\n", 1, body); exprs = ll_cons(ll_s(begin), exprs); branch = ll_listn(4, ll_s(if), test, exprs, body); loop_def = ll_listn(3, ll_s(lambda), ll_nil, branch ); loop_def = ll_listn(3, ll_s(setE), loop_name, loop_def); //ll_format(ll_undef, "do loop_def = ~S\n", 1, loop_def); loop = ll_listn(4, ll_s(let), ll_listn(1, ll_listn(2, loop_name, ll_f)), loop_def, loop_call); x = ll_listn(3, ll_s(let), nbindings, loop); //ll_format(ll_undef, "do -> ~S\n", 1, x); ll_return(x); } } ll_define_macro_end ll_define_macro(symbol,let,2,_(variable,bindings,body)) { APPEND_BEGIN(vars); APPEND_BEGIN(inits); ll_v var = ll_ARGV[0], body; /* Split vars and inits into separate lists */ ll_LIST_LOOP(ll_ARGV[1], x); { ll_v var = ll_car(x); ll_v init = ll_car(ll_cdr(x)); x = ll_cdr(x); APPEND(vars, var); APPEND(inits, init); } ll_LIST_LOOP_END; body = ll_listv(ll_ARGC - 2, ll_ARGV + 2); { ll_v x; ll_v lambda; lambda = ll_cons(ll_s(lambda), ll_cons(vars, body)); x = ll_listn(4, ll_s(let), ll_listn(1, ll_listn(2, var, ll_undef)), ll_listn(3, ll_s(setE), var, lambda), ll_cons(var, inits)); ll_return(x); } } ll_define_macro_end /**********************************************************************/ /* R5RS 4.2.5. Delayed evaluation */ /* IMPLEMENT: Delay */ /**********************************************************************/ /* R5RS 4.2.6. Quasiquotation */ ll_define_macro(object, quasiquote, 1, (template)) { ll_tail_call(ll_o(_quasiquote_expand), 2, (ll_SELF, ll_make_fixnum(0))); } ll_define_macro_end ll_define_primitive(object, _quasiquote_expand, 2, (template, level), _1(no_side_effect,"#t")) { ll_return(ll_quote(ll_SELF)); } ll_define_primitive_end ll_define_primitive(constant, _quasiquote_expand, 2, (template, level), _1(no_side_effect,"#t")) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(pair, _quasiquote_expand, 2, (template, level), _1(no_side_effect,"#t")) { ll_v level = ll_ARGV[1]; if ( ll_EQ(ll_THIS->_car, ll_s(quasiquote)) ) { level = ll__ADD(level, ll_make_fixnum(1)); } else if ( ll_EQ(ll_THIS->_car, ll_s(unquote)) ) { level = ll__SUB(level, ll_make_fixnum(1)); } else if ( ll_EQ(ll_THIS->_car, ll_s(unquote_splicing)) ) { level = ll__SUB(level, ll_make_fixnum(1)); } if ( ll_eqvQ(ll_ARGV[1], ll_make_fixnum(0)) ) { if ( ll_EQ(ll_THIS->_car, ll_s(unquote)) ) { /* `, -> */ ll_return(ll_car(ll_THIS->_cdr)); } else if ( ll_pairQ(ll_THIS->_car) && ll_eqQ(ll_car(ll_THIS->_car), ll_s(unquote_splicing)) ) { /* `((unquote-splicing ) . rest) */ ll_v x = ll_car(ll_cdr(ll_THIS->_car)); ll_return(ll_listn(3, ll_s(append), x, ll_call(ll_o(_quasiquote_expand), 2, (ll_THIS->_cdr, ll_ARGV[1])))); } } ll_return(ll_listn(3, ll_s(cons), ll_call(ll_o(_quasiquote_expand), 2, (ll_THIS->_car, level)), ll_call(ll_o(_quasiquote_expand), 2, (ll_THIS->_cdr, level)))); } ll_define_macro_end ll_define_primitive(vector, _quasiquote_expand, 2, (template, level), _1(no_side_effect,"#t")) { ll_v x; x = ll_call(ll_o(vector__list), 1, (ll_SELF)); x = ll_call(ll_o(_quasiquote_expand), 2, (x, ll_ARGV[1])); ll_return(ll_listn(2, ll_s(list__vector), x)); } ll_define_macro_end /*********************************************************/ /* R5RS 5.2. Definitions */ ll_define_macro(pair,define,1,_(formals,body)) { /* (define ( . ) . ) => (define (lambda . ) */ ll_v sym = ll_car(ll_ARGV[0]); ll_v formals = ll_cdr(ll_ARGV[0]); ll_v body = ll_listv(ll_ARGC - 1, ll_ARGV + 1); ll_return(ll_listn(3, ll_s(define), sym, ll_cons(ll_s(lambda), ll_cons(formals, body)))); } ll_define_macro_end /*********************************************************/ /* Oaklisp settable operations * (set! ( . ) ) */ ll_define_macro(pair,setE,2,(expr,value)) { /* (set! ( . ) ) => ((setter ) . ) */ /* Macro-expand ( . ) first to handle things like ** (set! (fluid x) v) => ((setter %fluid) 'x v) */ ll_v expr = ll_call(ll_o(macro_expand), 1, (ll_SELF)); ll_v op = ll_car(expr); ll_v args = ll_cdr(expr); APPEND_BEGIN(x); APPEND(x, ll_listn(2, ll_s(setter), op)); while ( ! ll_nullQ(args) ) { APPEND(x, ll_car(args)); args = ll_cdr(args); } APPEND(x, ll_ARGV[1]); ll_return(x); } ll_define_macro_end /*********************************************************/ /* Oaklisp locatives * (make-locative ) */ ll_define_macro(symbol,make_locative,1,(sym)) { /* (make-locative ) => (%make-locative (quote )) */ ll_return(ll_listn(2, ll_s(_make_locative), ll_quote(ll_ARGV[0]))); } ll_define_macro_end ll_define_macro(pair,make_locative,1,(expr)) { /* (make-locative (contents )) => */ if ( ll_EQ(ll_THIS->_car, ll_s(contents)) ) { ll_return(ll_car(ll_THIS->_cdr)); } else { /* (make-locative ( . )) => ((locater ) . ) */ /* Macro-expand ( . ) first to handle things like ** (make-locative (fluid x)) => ((locater %fluid) 'x) */ ll_v expr = ll_call(ll_o(macro_expand), 1, (ll_SELF)); ll_v op = ll_car(expr); ll_v args = ll_cdr(expr); APPEND_BEGIN(x); APPEND(x, ll_listn(2, ll_s(locater), op)); while ( ! ll_nullQ(args) ) { APPEND(x, ll_car(args)); args = ll_cdr(args); } ll_return(x); } } ll_define_macro_end ll_define_macro(pair,contents,1,(expr)) { /* (contents (make-locative )) => */ if ( ll_EQ(ll_THIS->_car, ll_s(make_locative)) ) { ll_return(ll_car(ll_THIS->_cdr)); } else { ll_return(ll_listn(2, ll_s(contents), ll_call(ll_o(macro_expand), 1, (ll_SELF)))); } } ll_define_macro_end ll_define_macro(pair,set_contentsE,1,_(expr,value)) { ll_v rest = ll_listv(ll_ARGC - 1, ll_ARGV + 1); /* (set-contents! (make-locative ) ) => (set! )*/ if ( ll_EQ(ll_THIS->_car, ll_s(make_locative)) ) { ll_return(ll_cons(ll_s(setE), ll_cons(ll_car(ll_THIS->_cdr), rest))); } else { ll_return(ll_cons(ll_s(set_contentsE), ll_call(ll_o(macro_expand_list), 1, (ll_cons(ll_SELF, rest))))); } } ll_define_macro_end /*********************************************************/ /* Macro definition macros */ ll_define_macro(symbol,define_macro,2,(sym,value)) { /* (define-macro ) => (%define-macro (quote ) ) */ ll_return(ll_listn(3, ll_s(_define_macro), ll_quote(ll_ARGV[0]), ll_ARGV[1])); } ll_define_macro_end ll_define_macro(symbol,macro,1,(sym)) { /* (macro ) => (%macro (quote )) */ ll_return(ll_listn(2, ll_s(_macro), ll_quote(ll_ARGV[0]))); } ll_define_macro_end ll_define_macro(pair,define_macro,1,_(formals,body)) { /* (define-macro ( . ) . ) => (define-macro (lambda . ) */ ll_v sym = ll_car(ll_ARGV[0]); ll_v formals = ll_cdr(ll_ARGV[0]); ll_v body = ll_listv(ll_ARGC - 1, ll_ARGV + 1); ll_return(ll_listn(3, ll_s(define_macro), sym, ll_cons(ll_s(lambda), ll_cons(formals, body)))); } ll_define_macro_end /*********************************************************/ /* Oaklisp * (add-method ( ( . ) . ) . ) */ ll_define_macro(pair,add_method,1,_(formals,body)) { /* (add-method ( ( . ) . ) . ) => (%add-method (%method ( . ) . )) */ ll_v op = ll_car(ll_ARGV[0]); ll_v x; ll_v ts = ll_car(x = ll_cdr(ll_ARGV[0])); ll_v type = ll_car(ts); ll_v slots = ll_cdr(ts); ll_v formals = ll_cdr(x); ll_v body = ll_listv(ll_ARGC - 1, ll_ARGV + 1); ll_return(ll_listn(4, ll_s(_add_method), type, op, ll_cons(ll_s(_method), ll_cons(ll_cons(formals, slots), body)))); } ll_define_macro_end /*********************************************************/ /* Quickies for number operations */ ll_define_macro(object,ADD,0,_(x)) { /* (+) => 0 */ /* (+ ) => x */ /* (+ ) => (%+ ) */ /* (+ ) => (%+ (%+ )) */ if ( ll_ARGC == 0 ) { ll_return(ll_make_fixnum(0)); } else { ll_v x; int i = ll_ARGC; x = ll_ARGV[-- i]; while ( i ) { x = ll_listn(3, ll_s(_ADD), ll_ARGV[-- i], x); } ll_return(x); } } ll_define_macro_end ll_define_macro(object,SUB,1,_(z,y)) { /* (- ) => (%neg x) */ /* (- . ) = (%- (+ . )) */ if ( ll_ARGC == 1 ) { ll_return(ll_listn(2, ll_s(_NEG), ll_ARGV[0])); } else { ll_return(ll_listn(3, ll_s(_SUB), ll_ARGV[0], ll_cons(ll_s(ADD), ll_listv(ll_ARGC - 1, ll_ARGV + 1)))); } } ll_define_macro_end ll_define_macro(object,MUL,0,_(x)) { /* (*) => 1 */ /* (* ) => x */ /* (* ) = (%* ) */ if ( ll_ARGC == 0 ) { ll_return(ll_make_fixnum(1)); } else { ll_v x; int i = ll_ARGC; x = ll_ARGV[-- i]; while ( i ) { x = ll_listn(3, ll_s(_MUL), ll_ARGV[-- i], x); } ll_return(x); } } ll_define_macro_end ll_define_macro(object,DIV,1,_(z,y)) { /* (/ ) => (%/ 1 x) */ /* (/ . ) = (%/ (* . )) */ if ( ll_ARGC == 1 ) { ll_return(ll_listn(3, ll_s(_DIV), ll_make_fixnum(1), ll_ARGV[0])); } else { ll_return(ll_listn(3, ll_s(_DIV), ll_ARGV[0], ll_cons(ll_s(MUL), ll_listv(ll_ARGC - 1, ll_ARGV + 1)))); } } ll_define_macro_end /*********************************************************/ #undef APPEND_BEGIN #undef APPEND #undef INSERT ll0.13/src/ll/test.gdb0100644000175200017560000000021006663227047015104 0ustar stephensstephens# $Id: test.gdb,v 1.2 1999/02/19 09:25:59 stephensk Exp $ break main break abort break _ll_error #break exit #break _ll_init_symbol run ll0.13/src/ll/testold.c0100644000175200017560000000333506676212143015277 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_ll_testold_c__ #define __rcs_id_ll_testold_c__ static const char __rcs_id_ll_testold_c[] = "$Id: testold.c,v 1.3 1999/03/24 16:35:47 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" static void print_v(int argc, ll_v *argv) { int i = 0; printf("#%d(", argc); if ( i < argc ) { do { printf("%d", (int) ll_unbox_fixnum(argv[i])); if ( ++ i < argc ) { printf(" "); } else { break; } } while ( 1 ); } printf(")\n"); } ll_define_primitive(object,x,0,_(),_0()) printf("x: "); print_v(ll_ARGC, ll_ARGV); printf("ar_sp = %p, val_sp = %p, c_sp = %p\n", _ll_ar_sp, _ll_val_sp, alloca(0)); ll_return(0); ll_define_primitive_end ll_define_primitive(object,y,0,_(),_0()) printf("y: "); print_v(ll_ARGC, ll_ARGV); printf("ar_sp = %p, val_sp = %p, c_sp = %p\n", _ll_ar_sp, _ll_val_sp, alloca(0)); ll_return(1); ll_define_primitive_end static ll_v a = ll_make_fixnum(1), b = ll_make_fixnum(2), c = ll_make_fixnum(3), d = ll_make_fixnum(4); ll_declare_primitive(object,foo); ll_declare_primitive(object,bar); ll_declare_primitive(object,baz); ll_define_primitive(object,foo,0,_(),_0()) ll_call(ll_prim(object,x),1,(ll_call(ll_prim(object,y),2,(a, b)))); ll_tail_call(ll_prim(object,baz),2,(b, c)); ll_define_primitive_end ll_define_primitive(object,bar,0,_(),_0()) ll_call(ll_prim(object,y),3,(a, b, c)); ll_tail_call(ll_prim(object,baz),1,(c)); ll_define_primitive_end ll_define_primitive(object,baz,0,_(),_0()) ll_call(ll_prim(object,y),2,(b, c)); ll_tail_call(ll_prim(object,foo),1,(d)); ll_define_primitive_end int main(int argc, char **argv) { ll_init(&argc, &argv); ll_call(ll_prim(object,foo),1,(0)); return 0; } ll0.13/src/ll/toplevel.c0100664000175200017560000001217207623404627015457 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_toplevel_c__ #define __rcs_id_ll_toplevel_c__ static const char __rcs_id_ll_toplevel_c[] = "$Id: toplevel.c,v 1.7 2003/02/15 09:34:15 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" /****************************************************************************/ /* A simple history mechanism */ static void _save_expr(ll_v expr) { ll_set_fluid(ll_s(llCtop_levelCexprs), ll_cons( ll_cons(ll_fluid(ll_s(llCtop_levelCprompt_id)), expr), ll_fluid(ll_s(llCtop_levelCexprs)))); } ll_define_primitive(char, llCtop_levelCread_macroCexpr, 2, (char, port), _0()) { ll_v index; index = ll_call(ll_o(read), 1, (ll_ARGV[1])); ll_LIST_LOOP(ll_fluid(ll_s(llCtop_levelCexprs)), x); { if ( ll_eqvQ(ll_car(x), index) ) { ll_return(ll_cons(ll_cdr(x), ll_nil)); } } ll_LIST_LOOP_END; ll_return(ll_nil); } ll_define_primitive_end static void _save_result(ll_v expr) { ll_set_fluid(ll_s(llCtop_levelCresults), ll_cons( ll_cons(ll_fluid(ll_s(llCtop_levelCprompt_id)), expr), ll_fluid(ll_s(llCtop_levelCresults)))); } ll_define_primitive(char, llCtop_levelCread_macroCresult, 2, (char, port), _0()) { ll_v index; index = ll_call(ll_o(read), 1, (ll_ARGV[1])); ll_LIST_LOOP(ll_fluid(ll_s(llCtop_levelCresults)), x); { if ( ll_eqvQ(ll_car(x), index) ) { ll_return(ll_cons(ll_cdr(x), ll_nil)); } } ll_LIST_LOOP_END; ll_return(ll_nil); } ll_define_primitive_end /****************************************************************************/ ll_define_primitive(object, top_level, 0, _(result), _0()) { /* Continues within the innermost (ll:top-level) read-eval-print loop, or begins a new top-level. */ ll_v toplevel = ll_fluid(ll_s(llCtop_levelCrestart)); ll_v result = ll_ARGC ? ll_ARGV[0] : ll_unspec; if ( ll_unbox_boolean(toplevel) ) { ll_tail_call(toplevel, 1, (result)); } else { ll_tail_call(ll_o(llCtop_level), 0, ()); } } ll_define_primitive_end ll_define_primitive(object,llCtop_levelCprompt_read_eval, 0, _(prompts), _0()) { /* Prompt the user on the ll:interactive-output-port, read an expression from ll:interactive-input-port, evaluate it and print the result on ll:interactive-output-port. */ ll_v expr = ll_undef, result = ll_undef; ll_v prompt_port = ll_undef, input_port, output_port; ll_v prompt_id; prompt_id = ll__ADD(ll_fluid(ll_s(llCtop_levelCprompt_id)), ll_make_fixnum(1)); ll_set_fluid(ll_s(llCtop_levelCprompt_id), prompt_id); prompt_port = _ll_make_string(0, 0); input_port = ll_g(SllCinteractive_input_portS); output_port = ll_g(SllCinteractive_output_portS); { ll_v prompt_string = _ll_make_string(0, 0); /* Format the prompt */ if ( ll_ARGC == 0 ) { ll_format(prompt_string, " ll ~S> ", 1, prompt_id); } else if ( ll_ARGC == 1 ) { ll_format(prompt_string, " ~S ~S> ", 2, ll_ARGV[0], prompt_id); } else if ( ll_ARGC >= 2 ) { ll_format(prompt_string, " ~S~S ~S> ", 3, ll_ARGV[0], ll_ARGV[1], prompt_id); } if ( ll_unbox_boolean(ll_call(ll_o(readline_portQ), 1, (input_port))) ) { prompt_port = input_port; } else { prompt_port = output_port; } ll_call(ll_o(_output_string), 2, (prompt_port, prompt_string)); ll_call(ll_o(flush), 1, (prompt_port)); } expr = ll_call(ll_o(read), 1, (input_port)); if ( ll_EQ(expr, ll_eos) ) { result = ll_eos; } else { /* Evaluate the expression */ _save_expr(expr); result = ll_call(ll_o(eval), 1, (expr)); /* Print the result */ if ( ll_NE(result, ll_unspec) ) { ll_call(ll_o(write), 2, (result, output_port)); ll_call(ll_o(newline), 1, (output_port)); } /* Save the result */ _save_result(result); } ll_return(result); } ll_define_primitive_end ll_define_primitive(object,llCtop_level,0,(), _0()) { int errors = 0; ll_v result = ll_unspec; do { ll_v restart = ll_undef; ll_CATCH_BEGIN(ll_type(object), restart); { errors = 0; ll_let_fluid(); { ll_v expr; ll_bind_fluid(ll_s(llCtop_levelCrestart), restart); ll_bind_fluid(ll_s(llCtop_levelClevel), ll__ADD(ll_fluid(ll_s(llCtop_levelClevel)), ll_make_fixnum(1))); /* Prompt and read an expression until eof */ while ( expr = ll_call(ll_o(llCtop_levelCprompt_read_eval), 1, (ll_s(ll))), ll_NE(expr, ll_eos) ) result = expr; } ll_let_fluid_END(); } ll_CATCH_VALUE(v); { errors = 1; _save_result(ll_undef); } ll_CATCH_END; } while ( errors ); ll_return(result); } ll_define_primitive_end ll_INIT(toplevel,290,"definitions, read macros") { ll_bind_fluid(ll_s(llCtop_levelClevel), ll_make_fixnum(0)); ll_bind_fluid(ll_s(llCtop_levelCrestart), ll_f); ll_bind_fluid(ll_s(llCtop_levelCprompt_id), ll_make_fixnum(0)); ll_bind_fluid(ll_s(llCtop_levelCexprs), ll_nil); ll_bind_fluid(ll_s(llCtop_levelCresults), ll_nil); /* Add our read macros */ ll_call(ll_o(llCreadCdefine_macro_char), 2, (ll_make_char('^'), ll_o(llCtop_levelCread_macroCexpr))); ll_call(ll_o(llCreadCdefine_macro_char), 2, (ll_make_char('V'), ll_o(llCtop_levelCread_macroCresult))); return 0; } ll0.13/src/ll/trace.c0100744000175200017560000000377607230472506014727 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_trace_c__ #define __rcs_id_ll_trace_c__ static const char __rcs_id_ll_trace_c[] = "$Id: trace.c,v 1.7 2001/01/15 03:57:58 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" /* ** This should never be called. */ ll_define_primitive(object, __trace_method_apply, 0, _(args), _0()) { ll_AR_METH = ll_THIS_ISA(trace_method, ll_AR_METH)->_meth; _ll_print_trace(ll_undef); __ll_tail_call_method_func(ll_AR_METH); } ll_define_primitive_end ll_define_primitive(trace_method,initialize,3,(self,type,op), _0()) { ll_v isa = ll_SLOTS(ll_SELF)[0]; /* Copy ::%trace_method-apply */ *(_ll_tsa_primitive*)ll_THIS = *ll_THIS_ISA(primitive, ll_p(object, __trace_method_apply)); ll_SLOTS(ll_SELF)[0] = isa; /* Fix isa */ /* Remember who to forward to */ ll_THIS->_type = ll_ARGV[1]; ll_THIS->_op = ll_ARGV[2]; ll_write_barrier_SELF(); ll_THIS->_meth = ll_call(ll_o(lookup), 2, (ll_THIS->_type, ll_THIS->_op)); ll_write_barrier_SELF(); ll_call(ll_o(_add_method), 3, (ll_THIS->_type, ll_THIS->_op, ll_SELF)); ll_return(ll_SELF); } ll_define_primitive_end /****************************************************************************/ ll_define_primitive(type, trace, 2, (type, op), _0()) { ll_tail_call(ll_o(make), 3, (ll_type(trace_method), ll_SELF, ll_ARGV[1])); } ll_define_primitive_end /****************************************************************************/ ll_define_primitive(method, _untrace, 1, (self), _1(no_side_effect,"#t")) { /* DO NOTHING */ } ll_define_primitive_end ll_define_primitive(trace_method, _untrace, 1, (self), _0()) { ll_tail_call(ll_o(_add_method), 3, (ll_THIS->_type, ll_THIS->_op, ll_THIS->_meth)); } ll_define_primitive_end ll_define_primitive(type, untrace, 2, (type, op), _0()) { ll_v meth = ll_call(ll_o(lookup), 2, (ll_SELF, ll_ARGV[1])); ll_tail_call(ll_o(_untrace), 1, (meth)); } ll_define_primitive_end /****************************************************************************/ ll0.13/src/ll/type.c0100664000175200017560000004216707623404553014613 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_type_c__ #define __rcs_id_ll_type_c__ static const char __rcs_id_ll_type_c[] = "$Id: type.c,v 1.19 2003/02/15 09:33:31 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" #include "assert.h" #include /* strcmp() */ /*************************************************************************/ /* type bootstrapping. */ typedef struct ll_typedef_slot { const char *type; size_t _sizeof; const char *name; size_t offset; } ll_typedef_slot; typedef struct ll_typedef { const char *name; struct ll_typedef *type; struct ll_typedef *supers[4]; ll_typedef_slot slots[20]; ll_v *_type; _ll_g _typetest_op; _ll_g _global_index; short visited; size_t _sizeof; size_t _sizeof_all; int _type_supers_n; struct ll_typedef *_type_supers[16]; size_t _type_offsets[16]; } ll_typedef; /*******************************************************************/ #define _ll_deftype(N,T) static ll_typedef _ll_td_##N; #include "ll/types.h" #define _ll_deftype(N,T) static ll_typedef _ll_td_##N = { #N, &_ll_td_##T, #define _ll_deftype_supers(N) { #define _ll_deftype_super(N,T) &_ll_td_##T, #define _ll_deftype_supers_end(N) 0 }, #define _ll_deftype_slots(N) { #define _ll_deftype_slot(N,T,S) { #T, sizeof(T), #S, ll_OFFSET_OF(_ll_ts_##N, _##S) }, #define _ll_deftype_slots_end(N) { 0 } }, #define _ll_deftype_end(N) 0, _ll_g_##N##Q, _ll_g_LT##N##GT }; #include "ll/types.h" static ll_typedef *_types[] = { #define _ll_deftype(N,T) &_ll_td_##N, #include "ll/types.h" 0 }; /***************************************************************************/ static void _ll_init_type_size(ll_typedef *t, ll_typedef *s) { int i; if ( s->visited ) return; s->visited = 1; for ( i = 0; s->supers[i]; i ++ ) { _ll_init_type_size(t, s->supers[i]); } t->_type_offsets[t->_type_supers_n] = t->_sizeof_all; t->_type_supers[t->_type_supers_n] = s; t->_type_supers_n ++; t->_sizeof_all += s->_sizeof; } static ll_typedef *_ll_td_for_type(ll_v type) { ll_typedef **t; for ( t = _types; *t; t ++ ) { if ( ll_EQ(*((*t)->_type), type) ) return *t; } return 0; } static int _ll_td_slot_offset(ll_typedef *t, ll_typedef *o, const char *name) { int i, j; for ( i = 0; i < t->_type_supers_n; i ++ ) { if ( t->_type_supers[i] == o ) { for ( j = 0; o->slots[j].type; j ++ ) { if ( name[0] == o->slots[j].name[0] && strcmp(name, o->slots[j].name) == 0 ) { // fprintf(stderr, "slot offset: %s %s %s = %d\n", t->name, o->name, name, t->_type_offsets[i] + o->slots[j].offset); return t->_type_offsets[i] + o->slots[j].offset; } } } } fprintf(stderr, "_ll_td_slot_offset(%s, %s, %s): FAILED\n", t->name, o->name, name); abort(); return -1; } static ll_v *_ll_slot(ll_v x, ll_v type, const char *name) { char *v = ll_UNBOX_ref(x); ll_v isa = ll_TYPE(x); return (ll_v*)(v + _ll_td_slot_offset(_ll_td_for_type(isa), _ll_td_for_type(type), name)); } #define SLOT(X,T,N) *_ll_slot(X,T,#N) static int _type_size_index; #define VARS \ ll_typedef **t, **t2; \ ll_typedef_slot *s; \ int i; \ ll_INIT(type1,30,"calculate type slot sizes and offsets") { VARS for ( t = _types; *t; t ++ ) { size_t t_sizeof = 0; ll_assert_msg(init,(*t)->slots[(sizeof((*t)->slots)/sizeof((*t)->slots[0]))-1].name == 0, ("ll_typedef.slots[] too small")); for ( s = (*t)->slots; s->type; s ++ ) { /* Make sure the C struct is layed out like the ll structure */ ll_assert_msg(init,s->offset == t_sizeof, ("sizeof(_ll_tsa_%s) != calculated size; multiple inheritance?", (*t)->name)); /* s->_offset = t_sizeof; */ t_sizeof += s->_sizeof; } (*t)->_sizeof = t_sizeof; /* printf("%s _sizeof = %lu\n", (*t)->name, (*t)->_sizeof); */ } return 0; } ll_INIT(type2,40,"calculate type total sizes") { VARS for ( t = _types; *t; t ++ ) { for ( t2 = _types; *t2; t2 ++ ) { (*t2)->visited = 0; } (*t)->_sizeof_all = 0; (*t)->_type_supers_n = 0; _ll_init_type_size((*t), (*t)); if ( ll_DEBUG(initCtype) ) { _ll_DEBUG_PRINT("%s _sizeof_all = %lu { ", (*t)->name, (*t)->_sizeof_all); for ( i = 0; i < (*t)->_type_supers_n; i ++ ) { _ll_DEBUG_PRINT(" %s @ %ld, ", (*t)->_type_supers[i]->name, (*t)->_type_offsets[i]); } _ll_DEBUG_PRINT("}\n"); } } return 0; } ll_INIT(type3,50,"allocate type objects; initialize type variables and globals; get the slot index for the ::size slot") { VARS; for ( t = _types; *t; t ++ ) { ll_v tt = ll_make_ref(ll_malloc((*t)->type->_sizeof_all)); _ll_gi((*t)->_global_index) = tt; ll_write_barrier(&_ll_gi((*t)->_global_index)); (*t)->_type = &_ll_gi((*t)->_global_index); ll_write_root(*t); } _type_size_index = _ll_td_slot_offset(&_ll_td_type, &_ll_td_type, "size") / sizeof(ll_v); return 0; } ll_INIT(type4,60,"slots: isa, size, slots_size") { VARS; for ( t = _types; *t; t ++ ) { ll_v tt = *((*t)->_type); ll_typedef *mt = (*t)->type; ll_SLOTS(tt)[0] = *((*t)->type->_type); ll_write_barrier_pure(tt); SLOT(tt, ll_type(type), size) = ll_make_fixnum((*t)->_sizeof_all); SLOT(tt, ll_type(type), slots_size) = ll_make_fixnum((*t)->_sizeof); } return 0; } ll_INIT(type5,130,"slots: supers, type-offset-alist") { VARS; for ( t = _types; *t; t ++ ) { ll_v tt = *((*t)->_type); ll_typedef *mt = (*t)->type; ll_SLOTS(tt)[0] = *((*t)->type->_type); SLOT(tt, ll_type(type), supers) = ll_nil; SLOT(tt, ll_type(type), slots) = ll_nil; SLOT(tt, ll_type(type), op_meth_alist) = ll_nil; SLOT(tt, ll_type(type), type_offset_alist) = ll_nil; SLOT(tt, ll_type(type), top_wiredQ) = ll_f; SLOT(tt, ll_type(type), immutableQ) = ll_f; SLOT(tt, ll_type(type), tester) = _ll_gi((*t)->_typetest_op); ll_write_barrier_pure(tt); SLOT(tt, ll_type(type), coercer) = _ll_make_operation(); ll_write_barrier_pure(tt); SLOT(tt, ll_type(type), typechecker) = _ll_make_operation(); ll_write_barrier_pure(tt); SLOT(tt, ll_type(type), properties) = ll_nil; ll_write_barrier_pure(tt); /* supers */ { ll_v x = ll_nil, *xp = &x; for ( i = 0; (*t)->supers[i]; i ++ ) { *xp = ll_immutable_cons(*((*t)->supers[i]->_type), ll_nil); ll_write_barrier(xp); xp = &ll_CDR(*xp); } SLOT(tt, ll_type(type), supers) = x; ll_write_barrier_pure(tt); } /* type-offset-alist */ { ll_v x = ll_nil, *xp = &x; for ( i = 0; i < (*t)->_type_supers_n; i ++ ) { ll_v a = ll_immutable_cons(*((*t)->_type_supers[i]->_type), ll_make_fixnum((*t)->_type_offsets[i])); *xp = ll_cons(a, ll_nil); ll_write_barrier(xp); xp = &ll_CDR(*xp); } SLOT(tt, ll_type(type), type_offset_alist) = x; ll_write_barrier_pure(tt); } } return 0; } ll_INIT(type6,170,"slots: slots") { VARS; for ( t = _types; *t; t ++ ) { ll_v tt = *((*t)->_type); ll_typedef *mt = (*t)->type; /* slots */ { ll_typedef_slot *slot; ll_v x = ll_nil, *xp = &x; for ( i = 0; (slot = &(*t)->slots[i])->type; i ++ ) { ll_v slot_name, slot_offset, slot_type; ll_v slot_item; slot_name = _ll_make_symbol_(_ll_escape_symbol(slot->name)); slot_offset = ll_make_fixnum(slot->offset); /* Don't add slot types for non ll_v types */ if ( strcmp(slot->type, "ll_v") ) { slot_type = _ll_make_symbol_(slot->type); } else { slot_type = ll_nil; } /* a type's slots' item: ( . ) */ slot_item = ll_immutable_cons(slot_name, ll_immutable_cons(slot_offset, slot_type)); /* Add to list */ *xp = ll_immutable_cons(slot_item, ll_nil); xp = &ll_CDR(*xp); } /* set the slots */ SLOT(tt, ll_type(type), slots) = x; ll_write_barrier_pure(tt); } } return 0; } ll_INIT(type7,200,"add type query, coercer, and typechecker methods") { VARS; for ( t = _types; *t; t ++ ) { ll_v tt = *((*t)->_type); ll_v op; /* Do false first so object? is true for ! */ /* ((type X) tester) => #t or #f */ op = _ll_gi((*t)->_typetest_op); SLOT(tt, ll_type(type), tester) = op; ll_write_barrier_pure(tt); _ll_add_method(ll_type(object), op, _ll_p_false); _ll_add_method(tt, op, _ll_p_true); /* (((type X) coercer) X) => X or error */ op = SLOT(tt, ll_type(type), coercer); _ll_add_method(tt, op, _ll_p_identity); /* (((type X) typechecker) X) => X or error */ op = SLOT(tt, ll_type(type), typechecker); _ll_add_method(ll_type(object), op, _ll_p_typecheck_error); _ll_add_method(tt, op, _ll_p_identity); } return 0; } ll_INIT(type8,310,"make type vars readonly") { VARS; for ( t = _types; *t; t ++ ) { const char *sname; ll_v sym; { char buf[256]; buf[255] = '\0'; sprintf(buf, "LT%sGT", (*t)->name); assert(buf[255] == '\0'); sname = _ll_escape_symbol(buf); } sym = _ll_make_symbol_(sname); ll_call(ll_o(set_propertyE), 3, (sym, ll_s(readonly), ll_t)); } return 0; } #undef VARS /*************************************************************************/ ll_v _ll_allocate_type(ll_v type) { size_t size; ll_v x; ll_assert_ref(type); size = ll_unbox_fixnum(ll_SLOTS(type)[_type_size_index]); if ( ! size ) { return _ll_error(ll_e(uninstantiable,error), 1, ll_s(type), type); } x = ll_make_ref(ll_malloc(size)); ll_SLOTS(x)[0] = type; // ll_write_barrier(x); return x; } /*************************************************************************/ #if 0 #define DBX(X) \ fprintf(stderr, "%s:%d: %p: <%s>:%s: %s = %p\n", __FILE__, __LINE__, (void*) _ll_val_sp, ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME, #X, (void*) X) #else #define DBX(X) do{}while(0) #endif ll_define_primitive(type,_init_type_offset_alist,2,(type, src), _0()) { DBX(ll_SELF); ll_v src = ll_ARGV[1]; /* Not already scanned src into our type-offset-alist? */ if ( ll_EQ(ll_assq(src, ll_THIS->_type_offset_alist), ll_f) ) { /* Do src's supers first */ ll_v src_supers = ll_call(ll_o(type_supers), 1, (src)); ll_LIST_LOOP(src_supers, super); { ll_call(ll_o(_init_type_offset_alist), 2, (ll_SELF, super)); } ll_LIST_LOOP_END; /* Add */ DBX(ll_SELF); ll_THIS->_type_offset_alist = ll_cons(ll_immutable_cons(src, ll_THIS->_size), ll_THIS->_type_offset_alist); ll_write_barrier_SELF(); /* Increment our size based on the src slot-size */ DBX(ll_SELF); ll_THIS->_size = ll__ADD(ll_THIS->_size, ll_call(ll_o(type_slots_size), 1, (src))); ll_write_barrier_SELF(); } DBX(ll_SELF); } ll_define_primitive_end ll_define_primitive(type,initialize,3,_(self,supertypes,slot_names,doc), _0()) { DBX(ll_SELF); ll_call_super(ll_o(initialize), ll_f, 1, (ll_SELF)); /* copy supers */ { ll_v supers = ll_nil, *xp = &supers; ll_LIST_LOOP(ll_ARGV[1], super); { *xp = ll_immutable_cons(super, ll_nil); /* WRITE BARRIER */ xp = &ll_CDR(*xp); } ll_LIST_LOOP_END; ll_THIS->_supers = ll_ARGV[1]; ll_write_barrier_SELF(); } /* copy and compute slot offsets, and slots size */ DBX(ll_SELF); { ll_v slots = ll_nil, *xp = &slots; size_t offset = 0; ll_LIST_LOOP(ll_ARGV[2], slot_def); { ll_v slot_name, slot_offset; ll_v slot_item; slot_name = slot_def; slot_offset = ll_make_fixnum(offset); offset += sizeof(ll_v); slot_item = ll_immutable_cons(slot_name, ll_immutable_cons(slot_offset, ll_nil)); *xp = ll_immutable_cons(slot_item, ll_nil); /* WRITE BARRIER */ xp = &ll_CDR(*xp); } ll_LIST_LOOP_END; ll_THIS->_slots = slots; ll_THIS->_slots_size = ll_make_fixnum(offset); ll_write_barrier_SELF(); } /* We'll fill this in later */ ll_THIS->_size = ll_make_fixnum(0); ll_write_barrier_SELF(); /* A new type as no methods */ ll_THIS->_op_meth_alist = ll_nil; /* We'll fill this in later */ ll_THIS->_type_offset_alist = ll_nil; /* It's not top wired and it's not immutable */ ll_THIS->_top_wiredQ = ll_f; ll_THIS->_immutableQ = ll_f; /* Create anon coerce and type-check ops */ DBX(ll_SELF); ll_THIS->_tester = _ll_make_operation(); ll_write_barrier_SELF(); ll_THIS->_coercer = _ll_make_operation(); ll_write_barrier_SELF(); ll_THIS->_typechecker = _ll_make_operation(); ll_THIS->_properties = ll_nil; ll_write_barrier_SELF(); /* Remember any documentation. */ if ( ll_ARGC >= 4 ) { ll_call(ll_o(set_llCdocE), 2, (ll_SELF, ll_ARGV[3])); } /* Fill in the size and type offset alist */ DBX(ll_SELF); ll_call(ll_o(_init_type_offset_alist), 2, (ll_SELF, ll_SELF)); /* Add methods for coerce and type-check ops */ DBX(ll_SELF); _ll_add_method(ll_SELF, ll_THIS->_coercer, _ll_p_identity); _ll_add_method(ll_SELF, ll_THIS->_typechecker, _ll_p_identity); DBX(ll_SELF); ll_return(ll_SELF); } ll_define_primitive_end /*************************************************************************/ ll_define_primitive(type,make,1,_(type,args), _0()) { /* Get the instance's size */ size_t _size; ll_v instance; ll_assert_fixnum(ll_THIS->_size); _size = ll_unbox_fixnum(ll_THIS->_size); if ( _size < sizeof(ll_v) ) { ll_return(_ll_error(ll_e(uninstantiable,error), 1, ll_s(type), ll_SELF)); } /* Allocate an instance */ instance = ll_make_ref(ll_malloc(_size)); /* Set the instance's isa slot */ ll_SLOTS(instance)[0] = ll_SELF; /* WRITE BARRIER */ /* Clear the instance's slots */ { size_t i; for ( i = 1; i < _size / sizeof(ll_v); i ++ ) { ll_SLOTS(instance)[i] = ll_undef; } } if ( 0 ) { extern int _ll_bc_debug; _ll_bc_debug = 1; } /* (make ...) -> (initialize ...) */ ll_SELF = instance; __ll_tail_callv(ll_o(initialize),ll_ARGC); } ll_define_primitive_end /*************************************************************************/ ll_define_primitive(type, locative_properties, 1, (self), _2(no_side_effect, "#t", doc, "Returns a locative to the type's properties list.")) { ll_return(ll_make_locative(&ll_THIS->_properties)); } ll_define_primitive_end ll_define_primitive(type,type_size, 1, (type), _2(no_side_effect,"#t", doc, "Returns the size, in bytes, of an instance.")) { ll_return(ll_THIS->_size); } ll_define_primitive_end ll_define_primitive(type,type_slots_size, 1, (type), _2(no_side_effect, "#t", doc, "Return the number of slots for an instance.")) { ll_return(ll_THIS->_slots_size); } ll_define_primitive_end ll_define_primitive(type,type_supers, 1, (type), _2(no_side_effect,"#t", doc, "Returns a list of supertypes.")) { ll_return(ll_THIS->_supers); } ll_define_primitive_end ll_define_primitive(type,type_slots, 1, (type), _2(no_side_effect, "#t", doc, "Returns a list of slot descriptors.")) { ll_return(ll_THIS->_slots); } ll_define_primitive_end ll_define_primitive(type,type_op_meth_alist, 1, (type), _2(no_side_effect, "#t", doc, "Returns an alist of operation and methods.")) { ll_return(ll_THIS->_op_meth_alist); } ll_define_primitive_end ll_define_primitive(type,type_type_offset_alist, 1, (type), _2(no_side_effect, "#t", doc, "Returns an alist of type and type offsets.")) { ll_return(ll_THIS->_type_offset_alist); } ll_define_primitive_end ll_define_primitive(type,top_wiredQ, 1, (type), _2(no_side_effect, "#t", doc, "Return true if the type is top-wired.")) { ll_return(ll_THIS->_top_wiredQ); } ll_define_primitive_end ll_define_primitive(type,immutableQ, 1, (type), _2(no_side_effect, "#t", doc, "Return true if the type is immutable.")) { ll_return(ll_THIS->_immutableQ); } ll_define_primitive_end ll_define_primitive(type,tester, 1, (type), _2(no_side_effect,"#t", doc, "Returns the type's tester operation.")) { if ( ! ll_unbox_boolean(ll_THIS->_tester) ) { ll_v op = _ll_make_operation(); ll_THIS->_tester = op; _ll_add_method(ll_type(object), op, _ll_p_false); _ll_add_method(ll_SELF, op, _ll_p_true); } ll_return(ll_THIS->_tester); } ll_define_primitive_end ll_define_primitive(type,coercer, 1,(type), _2(no_side_effect,"#t", doc, "Returns the type's coercer operation.")) { ll_return(ll_THIS->_coercer); } ll_define_primitive_end ll_define_primitive(type,typechecker, 1,(type), _2(no_side_effect,"#t", doc, "Returns the type's typechecker operation.")) { ll_return(ll_THIS->_typechecker); } ll_define_primitive_end /*************************************************************************/ ll_define_primitive(type,_add_method, 3, (type, op, meth), _1(doc, "Added a method implementation for an operation to the type.")) { _ll_add_method(ll_SELF, ll_ARGV[1], ll_ARGV[2]); ll_return(ll_ARGV[1]); } ll_define_primitive_end ll_define_primitive(type,remove_method, 2, (type, op), _1(doc, "Removes a method implementation for an operation from the type.")) { _ll_remove_method(ll_SELF, ll_ARGV[1]); } ll_define_primitive_end /*************************************************************************/ ll0.13/src/ll/type.h0100644000175200017560000000173406775100043014603 0ustar stephensstephens#ifndef _ll_type_h #define _ll_type_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_type_h__ #define __rcs_id_ll_type_h__ static const char __rcs_id_ll_type_h[] = "$Id: type.h,v 1.26 1999/10/01 09:34:27 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define __ll_t_paste2(N,T)N##T #define _ll_t_paste2(N,T)__ll_t_paste2(N,T) #define _ll_t_typedef(N) struct N; typedef struct N N; #define _ll_deftype(N,T) \ _ll_t_typedef(_ll_t_paste2(_ll_ts_,N)) \ _ll_t_typedef(_ll_t_paste2(_ll_tsa_,N)) #include "ll/types.h" #undef _ll_t_typedef #define _ll_deftype(N,T) struct _ll_t_paste2(_ll_ts_,N) { #define _ll_deftype_slot(N,T,S) T _ll_t_paste2(_,S); #define _ll_deftype_end(N) }; #include "ll/types.h" #define _ll_deftype(N,T) struct _ll_t_paste2(_ll_tsa_,N) { #define _ll_deftype_super(T,S) _ll_t_paste2(_ll_tsa_,S) _ll_t_paste2(super_,S); #define _ll_deftype_slot(N,T,S) T _ll_t_paste2(_,S); #define _ll_deftype_end(N) }; #include "ll/types.h" #undef __ll_t_paste2 #undef _ll_t_paste2 #endif ll0.13/src/ll/types.h0100744000175200017560000007262207306120276014774 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_types_h__ #define __rcs_id_ll_types_h__ static const char __rcs_id_ll_types_h[] = "$Id: types.h,v 1.9 2001/06/02 08:15:58 stephens Exp $"; #endif #endif /* __rcs_id__ */ #ifndef _ll_deftype #define _ll_deftype(N,T) #endif #ifndef ll_deftype #define ll_deftype(N,T)_ll_deftype(N,T) #endif #ifndef _ll_deftype_supers #define _ll_deftype_supers(N) #endif #ifndef ll_deftype_supers #define ll_deftype_supers(N)_ll_deftype_supers(N) #endif #ifndef _ll_deftype_super #define _ll_deftype_super(N,T) #endif #ifndef ll_deftype_super #define ll_deftype_super(N,T)_ll_deftype_super(N,T) #endif #ifndef _ll_deftype_supers_end #define _ll_deftype_supers_end(N) #endif #ifndef ll_deftype_supers_end #define ll_deftype_supers_end(N)_ll_deftype_supers_end(N) #endif #ifndef _ll_deftype_slots #define _ll_deftype_slots(N) #endif #ifndef ll_deftype_slots #define ll_deftype_slots(N)_ll_deftype_slots(N) #endif #ifndef _ll_deftype_slot #define _ll_deftype_slot(N,T,S) #endif #ifndef ll_deftype_slot #define ll_deftype_slot(N,T,S)_ll_deftype_slot(N,T,S) #endif #ifndef _ll_deftype_slots_end #define _ll_deftype_slots_end(N) #endif #ifndef ll_deftype_slots_end #define ll_deftype_slots_end(N)_ll_deftype_slots_end(N) #endif #ifndef _ll_deftype_option #define _ll_deftype_option(T,O,V) #endif #ifndef ll_deftype_option #define ll_deftype_option(T,O,V)_ll_deftype_option(T,O,V) #endif #ifndef _ll_deftype_end #define _ll_deftype_end(N) #endif #ifndef ll_deftype_end #define ll_deftype_end(N)_ll_deftype_end(N) #endif /******************************************************************/ /* objects can perform property methods. */ ll_deftype(properties_mixin,type) ll_deftype_supers(properties_mixin) ll_deftype_supers_end(properties_mixin) ll_deftype_slots(properties_mixin) ll_deftype_slots_end(properties_mixin) ll_deftype_end(properties_mixin) /******************************************************************/ /* is the root of all instantiable objects */ ll_deftype(object,type) ll_deftype_supers(object) ll_deftype_supers_end(object) ll_deftype_slots(object) ll_deftype_slot(object,ll_v,isa) ll_deftype_slots_end(object) ll_deftype_option(object,top_wiredQ,"#t") ll_deftype_end(object) /* objects are the type of all objects */ ll_deftype(type,type) ll_deftype_supers(type) ll_deftype_super(type,object) ll_deftype_super(type,properties_mixin) ll_deftype_supers_end(type) ll_deftype_slots(type) ll_deftype_slot(type,ll_v,supers) /* A list of super types. */ ll_deftype_slot(type,ll_v,slots) /* A list of ( . ) */ ll_deftype_slot(type,ll_v,size) /* The size of this object. */ ll_deftype_slot(type,ll_v,slots_size) /* The size of this type's slot block. */ ll_deftype_slot(type,ll_v,op_meth_alist) /* A map of ( . ) */ ll_deftype_slot(type,ll_v,type_offset_alist) /* A map of ( . ) */ ll_deftype_slot(type,ll_v,top_wiredQ) /* The type is top-wired by the internals. */ ll_deftype_slot(type,ll_v,immutableQ) /* The type is immutable. No methods can be added, removed or changed. */ ll_deftype_slot(type,ll_v,tester) /* ? */ ll_deftype_slot(type,ll_v,coercer) /* (coercer ) */ ll_deftype_slot(type,ll_v,typechecker) /* (typechecker ) */ ll_deftype_slot(type,ll_v,properties) /* Additional properties. */ ll_deftype_slots_end(type) ll_deftype_option(type,top_wiredQ,"#t") ll_deftype_end(type) /******************************************************************/ /* an object of the type returns #t when sent immutable? */ ll_deftype(immutable,type) ll_deftype_supers(immutable) ll_deftype_supers_end(immutable) ll_deftype_slots(immutable) ll_deftype_slots_end(immutable) ll_deftype_end(immutable) /* an object of the type returns #f when send immutable? */ ll_deftype(mutable,type) ll_deftype_supers(mutable) ll_deftype_supers_end(mutable) ll_deftype_slots(mutable) ll_deftype_slots_end(mutable) ll_deftype_end(mutable) /******************************************************************/ /* an object of the type is compiled as a literal value */ ll_deftype(constant,type) ll_deftype_supers(constant) ll_deftype_super(constant,immutable) ll_deftype_supers_end(constant) ll_deftype_slots(constant) ll_deftype_slots_end(constant) ll_deftype_end(constant) /* an object of the type does not require storage in the heap */ ll_deftype(immediate,type) ll_deftype_supers(immediate) ll_deftype_super(immediate,constant) ll_deftype_supers_end(immediate) ll_deftype_slots(immediate) ll_deftype_slots_end(immediate) ll_deftype_end(immediate) /* Only one object of the type exists. */ ll_deftype(singleton,type) ll_deftype_supers(singleton) ll_deftype_supers_end(singleton) ll_deftype_slots(singleton) ll_deftype_slots_end(singleton) ll_deftype_end(singleton) /******************************************************************/ ll_deftype(pointer,type) ll_deftype_supers(pointer) ll_deftype_super(pointer,immediate) ll_deftype_super(pointer,object) ll_deftype_supers_end(pointer) ll_deftype_slots(pointer) ll_deftype_slots_end(pointer) ll_deftype_end(pointer) ll_deftype(locative,type) ll_deftype_supers(locative) ll_deftype_super(locative,immediate) ll_deftype_super(locative,object) ll_deftype_supers_end(locative) ll_deftype_slots(locative) ll_deftype_slots_end(locative) ll_deftype_end(locative) /******************************************************************/ /* is a mixin of all objects that are applicable. Currently the only instantiable type is */ ll_deftype(procedure,type) ll_deftype_supers(procedure) ll_deftype_supers_end(procedure) ll_deftype_slots(procedure) ll_deftype_slots_end(procedure) ll_deftype_end(procedure) /* objects of the type are the only objects that can be in the car-position of a function call. i.e. (car '(foo bar)). the value of "car" is a object. */ ll_deftype(operation,type) ll_deftype_supers(operation) ll_deftype_super(operation,procedure) ll_deftype_super(operation,object) ll_deftype_super(operation,properties_mixin) ll_deftype_supers_end(operation) ll_deftype_slots(operation) ll_deftype_slot(operation,ll_v,lambdaQ) /* A method if a method has been added to only one type. */ ll_deftype_slot(operation,ll_v,lambda_type) /* The for the lambda? */ ll_deftype_slot(operation,ll_v,cache_type) /* The that the last full search was tried against. */ ll_deftype_slot(operation,ll_v,cache_impl) /* The that implemented the last found. */ ll_deftype_slot(operation,ll_v,cache_offset) /* The offset of the cache-impl in cache-type. */ ll_deftype_slot(operation,ll_v,cache_method) /* The of the last cached lookup. */ ll_deftype_slot(operation,ll_v,immutableQ) /* If true, no methods can be added or removed. */ ll_deftype_slot(operation,ll_v,properties) /* Additional properties. */ #if ll_USE_LCACHE ll_deftype_slot(operation,ll_v,timestamp) /* Incremented if method is added or removed. */ #endif ll_deftype_slots_end(operation) ll_deftype_option(operation,top_wiredQ,"#t") ll_deftype_end(operation) /* are objects that respond to the "setter" operation. For example "car" is a ; (setter car) returns "set-car!". "(set! (car foo) bar)" macro expands to "((setter car) foo bar)" */ ll_deftype(settable_operation,type) ll_deftype_supers(settable_operation) ll_deftype_super(settable_operation,operation) ll_deftype_supers_end(settable_operation) ll_deftype_slots(settable_operation) ll_deftype_slot(settable_operation,ll_v,setter) ll_deftype_slots_end(settable_operation) ll_deftype_end(settable_operation) /* are objects that respond to the "locater" operation. For example "car" is a ; (locator car) returns "locative-car". "(make-locative (car foo))" macro expands to "((locater car) foo)" */ ll_deftype(locatable_operation,type) ll_deftype_supers(locatable_operation) ll_deftype_super(locatable_operation,settable_operation) ll_deftype_supers_end(locatable_operation) ll_deftype_slots(locatable_operation) ll_deftype_slot(locatable_operation,ll_v,locater) ll_deftype_slots_end(locatable_operation) ll_deftype_end(locatable_operation) /******************************************************************/ /* The object, #u, is used for all uninitalized values */ ll_deftype(undefined,type) ll_deftype_supers(undefined) ll_deftype_super(undefined,constant) ll_deftype_super(undefined,object) ll_deftype_supers_end(undefined) ll_deftype_slots(undefined) ll_deftype_slots_end(undefined) ll_deftype_end(undefined) /* The object is used for all Scheme procedures and primitives that do not have a specified return value */ ll_deftype(unspecified,type) ll_deftype_supers(unspecified) ll_deftype_super(unspecified,constant) ll_deftype_super(unspecified,object) ll_deftype_supers_end(unspecified) ll_deftype_slots(unspecified) ll_deftype_slots_end(unspecified) ll_deftype_end(unspecified) /******************************************************************/ /* objects are allocated on a stack during each object application. */ ll_deftype(activation_record,type) ll_deftype_supers(activation_record) ll_deftype_super(activation_record,object) ll_deftype_supers_end(activation_record) ll_deftype_slots(activation_record) ll_deftype_slot(activation_record,ll_v,op) /* The searched for. */ ll_deftype_slot(activation_record,int,argc) /* Argument list length; if argc == 0, rcvr's is assumed to be . */ ll_deftype_slot(activation_record,ll_v*,argv) /* Argument list; argv[0] is the rcvr. */ ll_deftype_slot(activation_record,ll_v,type) /* The type the method was found in. */ ll_deftype_slot(activation_record,ll_v,type_offset) /* The offset of type's ivar block in the rcvr */ ll_deftype_slot(activation_record,ll_v,meth) /* The method that was found by the lookup */ ll_deftype_slot(activation_record,ll_v,db_at_rtn) /* Envoke the debugger when this frame is returned from */ ll_deftype_slots_end(activation_record) ll_deftype_option(activation_record,top_wiredQ,"#t") ll_deftype_end(activation_record) #if 0 /* objects are used to manage the value and activation record stacks. */ ll_deftype(stack_buffer,type) ll_deftype_supers(stack_buffer) ll_deftype_super(stack_buffer,object) ll_deftype_supers_end(stack_buffer) ll_deftype_slots(stack_buffer) ll_deftype_slot(stack_buffer,ll_v,prev) /* The before us. */ ll_deftype_slot(stack_buffer,ll_v,size) /* The size of this buffer. */ ll_deftype_slot(stack_buffer,ll_v,elements) /* The holding the elements of the stack. */ ll_deftype_slot(stack_buffer,ll_v*,top) /* The index into the elements. */ ll_deftype_slots_end(stack_buffer) ll_deftype_option(stack_buffer,top_wiredQ,"#t") ll_deftype_end(stack_buffer) #endif /******************************************************************/ /* objects are the code that is assocated for a and pair. */ ll_deftype(method,type) ll_deftype_supers(method) ll_deftype_super(method,object) ll_deftype_super(method,properties_mixin) ll_deftype_supers_end(method) ll_deftype_slots(method) ll_deftype_slot(method,ll_func,func) ll_deftype_slot(method,ll_v,formals) ll_deftype_slot(method,ll_v,code) ll_deftype_slot(method,ll_v,properties) /* Various options */ ll_deftype_slot(method,ll_v,consts) /* A vector containing constant values */ ll_deftype_slot(method,ll_v,env) /* The environment vector */ ll_deftype_slots_end(method) ll_deftype_option(method,top_wiredQ,"#t") ll_deftype_end(method) /* objects are objects that are implemented in C */ ll_deftype(primitive,type) ll_deftype_supers(primitive) ll_deftype_super(primitive,method) ll_deftype_supers_end(primitive) ll_deftype_slots(primitive) ll_deftype_slots_end(primitive) ll_deftype_end(primitive) /* objects are objects that are implemented as byte code instructions */ ll_deftype(byte_code_method,type) ll_deftype_supers(byte_code_method) ll_deftype_super(byte_code_method,method) ll_deftype_supers_end(byte_code_method) ll_deftype_slots(byte_code_method) ll_deftype_slots_end(byte_code_method) ll_deftype_end(byte_code_method) /* objects are methods that do one-way escapes to (catch ...) handlers */ ll_deftype(catch,type) ll_deftype_supers(catch) ll_deftype_super(catch,method) ll_deftype_supers_end(catch) ll_deftype_slots(catch) ll_deftype_slot(catch,ll_v,type) ll_deftype_slot(catch,ll_v,op) ll_deftype_slot(catch,ll_v,previous_catch) ll_deftype_slot(catch,ll_v,validQ) ll_deftype_slot(catch,ll_v,value) #ifndef ll_CATCH_SAVES #define ll_CATCH_SAVES 7 #endif /* See stack.c */ ll_deftype_slot(catch,ll_v,value_sp) ll_deftype_slot(catch,ll_v,ar_sp) ll_deftype_slot(catch,ll_v,value_sp_base) ll_deftype_slot(catch,ll_v,ar_sp_base) ll_deftype_slot(catch,ll_v,value_sp_bottom) ll_deftype_slot(catch,ll_v,ar_sp_bottom) ll_deftype_slot(catch,ll_v,fluid_bindings) ll_deftype_slot(catch,jmp_buf,_jb) ll_deftype_slots_end(catch) ll_deftype_end(catch) /* A prints a synopsis of the application when they are invoked. */ ll_deftype(trace_method,type) ll_deftype_supers(trace_method) ll_deftype_super(trace_method,method) ll_deftype_supers_end(trace_method) ll_deftype_slots(trace_method) ll_deftype_slot(trace_method,ll_v,type) ll_deftype_slot(trace_method,ll_v,op) ll_deftype_slot(trace_method,ll_v,meth) ll_deftype_slots_end(trace_method) ll_deftype_end(trace_method) /******************************************************************/ /* There are two objects: #t, the true value, #f the false value. */ ll_deftype(boolean,type) ll_deftype_supers(boolean) ll_deftype_super(boolean,constant) ll_deftype_super(boolean,object) ll_deftype_supers_end(boolean) ll_deftype_slots(boolean) ll_deftype_slots_end(boolean) ll_deftype_end(boolean) /******************************************************************/ /* There is only one object (eof-object) */ ll_deftype(eof_object,type) ll_deftype_supers(eof_object) ll_deftype_super(eof_object,constant) ll_deftype_super(eof_object,object) ll_deftype_supers_end(eof_object) ll_deftype_slots(eof_object) ll_deftype_slots_end(eof_object) ll_deftype_end(eof_object) /******************************************************************/ /* objects are all objects */ ll_deftype(number,type) ll_deftype_supers(number) ll_deftype_super(number,constant) ll_deftype_super(number,object) ll_deftype_supers_end(number) ll_deftype_slots(number) ll_deftype_slots_end(number) ll_deftype_end(number) /* exact and inexact mixins */ ll_deftype(exact,type) ll_deftype_supers(exact) ll_deftype_supers_end(exact) ll_deftype_slots(exact) ll_deftype_slots_end(exact) ll_deftype_end(exact) ll_deftype(inexact,type) ll_deftype_supers(inexact) ll_deftype_supers_end(inexact) ll_deftype_slots(inexact) ll_deftype_slots_end(inexact) ll_deftype_end(inexact) ll_deftype(complex,type) ll_deftype_supers(complex) ll_deftype_super(complex,number) ll_deftype_supers_end(complex) ll_deftype_slots(complex) ll_deftype_slots_end(complex) ll_deftype_end(complex) ll_deftype(real,type) ll_deftype_supers(real) ll_deftype_super(real,complex) ll_deftype_supers_end(real) ll_deftype_slots(real) ll_deftype_slots_end(real) ll_deftype_end(real) ll_deftype(rational,type) ll_deftype_supers(rational) ll_deftype_super(rational,real) ll_deftype_supers_end(rational) ll_deftype_slots(rational) ll_deftype_slots_end(rational) ll_deftype_end(rational) ll_deftype(integer,type) ll_deftype_supers(integer) ll_deftype_super(integer,rational) ll_deftype_supers_end(integer) ll_deftype_slots(integer) ll_deftype_slots_end(integer) ll_deftype_end(integer) /* Actual number implementation */ /* Fixnum are immediate values with a #b00 low tag */ ll_deftype(fixnum,type) ll_deftype_supers(fixnum) ll_deftype_super(fixnum,immediate) ll_deftype_super(fixnum,exact) ll_deftype_super(fixnum,integer) ll_deftype_supers_end(fixnum) ll_deftype_slots(fixnum) ll_deftype_slots_end(fixnum) ll_deftype_end(fixnum) /* are immediate values with a #b10 low tag */ ll_deftype(flonum,type) ll_deftype_supers(flonum) ll_deftype_super(flonum,immediate) ll_deftype_super(flonum,inexact) ll_deftype_super(flonum,real) ll_deftype_supers_end(flonum) ll_deftype_slots(flonum) ll_deftype_slots_end(flonum) ll_deftype_end(flonum) /******************************************************************/ /* objects respond to (map ... ) and the like. */ ll_deftype(sequence,type) ll_deftype_supers(sequence) ll_deftype_super(sequence,immutable) ll_deftype_supers_end(sequence) ll_deftype_slots(sequence) ll_deftype_slots_end(sequence) ll_deftype_end(sequence) ll_deftype(mutable_sequence,type) ll_deftype_supers(mutable_sequence) ll_deftype_super(mutable_sequence,mutable) ll_deftype_super(mutable_sequence,sequence) ll_deftype_supers_end(mutable_sequence) ll_deftype_slots(mutable_sequence) ll_deftype_slots_end(mutable_sequence) ll_deftype_end(mutable_sequence) /******************************************************************/ /* objects are the empty list (the object) and any object */ ll_deftype(list,type) ll_deftype_supers(list) ll_deftype_super(list,sequence) ll_deftype_supers_end(list) ll_deftype_slots(list) ll_deftype_slots_end(list) ll_deftype_end(list) ll_deftype(mutable_list,type) ll_deftype_supers(mutable_list) ll_deftype_super(mutable_list,mutable_sequence) ll_deftype_super(mutable_list,list) ll_deftype_supers_end(mutable_list) ll_deftype_slots(mutable_list) ll_deftype_slots_end(mutable_list) ll_deftype_end(mutable_list) /******************************************************************/ ll_deftype(null,type) ll_deftype_supers(null) ll_deftype_super(null,list) ll_deftype_super(null,singleton) ll_deftype_super(null,object) ll_deftype_supers_end(null) ll_deftype_slots(null) ll_deftype_slots_end(null) ll_deftype_end(null) ll_deftype(pair,type) ll_deftype_supers(pair) ll_deftype_super(pair,list) ll_deftype_super(pair,object) ll_deftype_supers_end(pair) ll_deftype_slots(pair) ll_deftype_slot(pair,ll_v,car) ll_deftype_slot(pair,ll_v,cdr) ll_deftype_slots_end(pair) ll_deftype_end(pair) ll_deftype(mutable_pair,type) ll_deftype_supers(mutable_pair) ll_deftype_super(mutable_pair,mutable_list) ll_deftype_super(mutable_pair,pair) ll_deftype_supers_end(mutable_pair) ll_deftype_slots(mutable_pair) ll_deftype_slots_end(mutable_pair) ll_deftype_end(mutable_pair) /******************************************************************/ /* objects are the elements of objects. */ ll_deftype(char,type) ll_deftype_supers(char) ll_deftype_super(char,constant) ll_deftype_super(char,object) ll_deftype_supers_end(char) ll_deftype_slots(char) ll_deftype_slot(char,ll_v,value) ll_deftype_slots_end(char) ll_deftype_end(char) /******************************************************************/ /* objects are vectors of objects */ ll_deftype(string,type) ll_deftype_supers(string) ll_deftype_super(string,constant) ll_deftype_super(string,sequence) ll_deftype_super(string,object) ll_deftype_supers_end(string) ll_deftype_slots(string) ll_deftype_slot(string,char*,array) ll_deftype_slot(string,size_t,length) ll_deftype_slots_end(string) ll_deftype_end(string) ll_deftype(mutable_string,type) ll_deftype_supers(mutable_string) ll_deftype_super(mutable_string,mutable_sequence) ll_deftype_super(mutable_string,string) ll_deftype_supers_end(mutable_string) ll_deftype_slots(mutable_string) ll_deftype_slots_end(mutable_string) ll_deftype_end(mutable_string) /******************************************************************/ /* objects are vectors of any */ ll_deftype(vector,type) ll_deftype_supers(vector) ll_deftype_super(vector,sequence) ll_deftype_super(vector,object) ll_deftype_supers_end(vector) ll_deftype_slots(vector) ll_deftype_slot(vector,ll_v*,array) ll_deftype_slot(vector,size_t,length) ll_deftype_slots_end(vector) ll_deftype_end(vector) ll_deftype(mutable_vector,type) ll_deftype_supers(mutable_vector) ll_deftype_super(mutable_vector,mutable_sequence) ll_deftype_super(mutable_vector,vector) ll_deftype_supers_end(mutable_vector) ll_deftype_slots(mutable_vector) ll_deftype_slots_end(mutable_vector) ll_deftype_end(mutable_vector) /******************************************************************/ /* are immutable names such that: (define s1 "aname") (define s2 (string-copy s1)) (eq? (string->symbol s1) (string->symbol s2)) is always #t */ ll_deftype(symbol,type) ll_deftype_supers(symbol) ll_deftype_super(symbol,object) ll_deftype_super(symbol,properties_mixin) ll_deftype_supers_end(symbol) ll_deftype_slots(symbol) ll_deftype_slot(symbol,ll_v,name) ll_deftype_slot(symbol,ll_v,properties) ll_deftype_slots_end(symbol) ll_deftype_end(symbol) /******************************************************************/ /* objects are used for extern input and output. */ ll_deftype(port,type) ll_deftype_supers(port) ll_deftype_super(port,sequence) ll_deftype_super(port,object) ll_deftype_supers_end(port) ll_deftype_slots(port) ll_deftype_slot(port,FILE*,impl) ll_deftype_slot(port,ll_v,close) ll_deftype_slot(port,ll_v,ident) ll_deftype_slots_end(port) ll_deftype_end(port) ll_deftype(input_port,type) ll_deftype_supers(input_port) ll_deftype_super(input_port,port) ll_deftype_supers_end(input_port) ll_deftype_slots(input_port) ll_deftype_slots_end(input_port) ll_deftype_end(input_port) ll_deftype(output_port,type) ll_deftype_supers(output_port) ll_deftype_super(output_port,mutable_sequence) ll_deftype_super(output_port,port) ll_deftype_supers_end(output_port) ll_deftype_slots(output_port) ll_deftype_slots_end(output_port) ll_deftype_end(output_port) #if 0 ll_deftype(io_port,type) ll_deftype_supers(io_port) ll_deftype_super(io_port,input_port) ll_deftype_super(io_port,output_port) ll_deftype_supers_end(io_port) ll_deftype_slots(io_port) ll_deftype_slots_end(io_port) ll_deftype_end(io_port) #endif /******************************************************************/ ll_deftype(readline_port,type) ll_deftype_supers(readline_port) ll_deftype_super(readline_port,input_port) ll_deftype_supers_end(readline_port) ll_deftype_slots(readline_port) ll_deftype_slot(readline_port,ll_v,buffer) ll_deftype_slot(readline_port,ll_v,prompt_buffer) ll_deftype_slot(readline_port,ll_v,prompt_port) ll_deftype_slots_end(readline_port) ll_deftype_end(readline_port) /******************************************************************/ /* objects contain all global bindings and macro definitions. */ ll_deftype(environment,type) ll_deftype_supers(environment) ll_deftype_super(environment,object) ll_deftype_supers_end(environment) ll_deftype_slots(environment) ll_deftype_slot(environment,ll_v,bindings) /* A vector of objects */ ll_deftype_slots_end(environment) ll_deftype_end(environment) /* objects are stored in the object's binding slot. The contain the variables global value, macro function, and property list. */ ll_deftype(binding,type) ll_deftype_supers(binding) ll_deftype_super(binding,object) ll_deftype_super(binding,properties_mixin) ll_deftype_supers_end(binding) ll_deftype_slots(binding) ll_deftype_slot(binding,ll_v,symbol) /* The binding's symbol key */ ll_deftype_slot(binding,ll_v,value) /* The binding's internal value */ ll_deftype_slot(binding,ll_v,locative) /* The binding's value locative */ ll_deftype_slot(binding,ll_v,macro) /* The binding's macro expander */ ll_deftype_slot(binding,ll_v,properties) /* The binding's properties list */ ll_deftype_slots_end(binding) ll_deftype_option(binding,top_wiredQ,"#t") ll_deftype_end(binding) /******************************************************************/ /* objects are generated upon internal and user error conditions */ ll_deftype(error,type) ll_deftype_supers(error) ll_deftype_super(error,object) ll_deftype_super(error,properties_mixin) ll_deftype_supers_end(error) ll_deftype_slots(error) ll_deftype_slot(error,ll_v,ar) /* The activation record that created the error */ ll_deftype_slot(error,ll_v,properties) /* The properties of the error. */ ll_deftype_slots_end(error) ll_deftype_end(error) /* Fatal errors will always report and kill the current application. */ ll_deftype(fatal_error,type) ll_deftype_supers(fatal_error) ll_deftype_super(fatal_error,error) ll_deftype_supers_end(fatal_error) ll_deftype_slots(fatal_error) ll_deftype_slots_end(fatal_error) ll_deftype_end(fatal_error) /* Recoverable errors will invoke the debugger and return back to the error creator. */ ll_deftype(recoverable_error,type) ll_deftype_supers(recoverable_error) ll_deftype_super(recoverable_error,error) ll_deftype_supers_end(recoverable_error) ll_deftype_slots(recoverable_error) ll_deftype_slots_end(recoverable_error) ll_deftype_end(recoverable_error) /* ll_e() error types */ #ifndef ll_e_def #define _ll_deftype_simple(NAME,SUPER) \ ll_deftype(NAME,type) \ ll_deftype_supers(NAME) \ ll_deftype_super(NAME,SUPER) \ ll_deftype_supers_end(NAME) \ ll_deftype_slots(NAME) \ ll_deftype_slots_end(NAME) \ ll_deftype_end(NAME) #define _ll_e_def(NAME,SUPER) _ll_deftype_simple(NAME,SUPER) #define ll_e_def(NAME,SUPER) _ll_e_def(ll_e_NAME(NAME,SUPER),SUPER) #include "ll/errors.h" #undef _ll_deftype_simple #undef _ll_e_def #endif /******************************************************************/ /* <%ir> objects are created by the byte-code compiler to represent lexical closures and binding contours. */ ll_deftype(_ir,type) ll_deftype_supers(_ir) ll_deftype_super(_ir,object) ll_deftype_super(_ir,properties_mixin) ll_deftype_supers_end(_ir) ll_deftype_slots(_ir) /* Inputs */ ll_deftype_slot(_ir,ll_v,formals) /* A formal parameter list (last cdr may be the rest-arg) */ ll_deftype_slot(_ir,ll_v,slots) /* A list of slot names (instance variables) */ ll_deftype_slot(_ir,ll_v,body) /* A list of sexprs */ ll_deftype_slot(_ir,ll_v,parent) /* Our lexical parent %ir object */ /* Computed slots */ ll_deftype_slot(_ir,ll_v,rest_argQ) /* The name of our rest-arg */ ll_deftype_slot(_ir,ll_v,env) /* The exported environment */ ll_deftype_slot(_ir,ll_v,env_length) /* The length of our exported environment */ ll_deftype_slot(_ir,ll_v,imports) /* The imported environment */ ll_deftype_slot(_ir,ll_v,argc) /* The number of arguments, minus the rest-arg */ ll_deftype_slot(_ir,ll_v,n_locals) /* The number of locals, we need */ ll_deftype_slot(_ir,ll_v,max_n_locals) /* The maximum number of locals we need for us and our car-pos lambdas */ ll_deftype_slot(_ir,ll_v,probe_pos) /* The position of the stack xsprobe instruction. */ ll_deftype_slot(_ir,ll_v,scope) /* A list of variable scopes */ ll_deftype_slot(_ir,ll_v,car_posQ) /* Are we a car-position lambda? */ ll_deftype_slot(_ir,ll_v,environment) /* The environment we are compiling in. */ /* Internal state */ ll_deftype_slot(_ir,ll_v,properties) /* Compilation options. */ /* Outputs */ ll_deftype_slot(_ir,ll_v,consts) /* A vector containing all constant values. */ ll_deftype_slot(_ir,ll_v,code) /* A string containing all our byte-code. */ ll_deftype_slot(_ir,ll_v,props) /* An assoc for the methods properties. */ ll_deftype_slots_end(_ir) ll_deftype_end(_ir) /******************************************************************/ ll_deftype(debugger,type) ll_deftype_supers(debugger) ll_deftype_super(debugger,object) ll_deftype_super(debugger,properties_mixin) ll_deftype_supers_end(debugger) ll_deftype_slots(debugger) ll_deftype_slot(debugger,ll_v,properties) /* Current debugger state. */ ll_deftype_slot(debugger,ll_v,error) /* The error that envoked the debugger, if any. */ ll_deftype_slot(debugger,ll_v,top_of_ar_stack) /* The top activation record this debugger can see. */ ll_deftype_slot(debugger,ll_v,current_ar) /* The current activation record. */ ll_deftype_slot(debugger,ll_v,exit) /* The to stop the debugger's interaction loop. */ ll_deftype_slot(debugger,ll_v,level) /* The debugger level. */ ll_deftype_slots_end(debugger) ll_deftype_end(debugger) /******************************************************************/ #if 0 ll_deftype(recursion_lock,type) ll_deftype_supers(recursion_lock) ll_deftype_super(recursion_lock,object) ll_deftype_supers_end(recursion_lock) ll_deftype_slots(recursion_lock) ll_deftype_slots_end(recursion_lock) ll_deftype_end(recursion_lock) #endif /******************************************************************/ #undef _ll_deftype #undef ll_deftype #undef _ll_deftype_supers #undef ll_deftype_supers #undef _ll_deftype_super #undef ll_deftype_super #undef _ll_deftype_supers_end #undef ll_deftype_supers_end #undef _ll_deftype_slots #undef ll_deftype_slots #undef _ll_deftype_slot #undef ll_deftype_slot #undef _ll_deftype_slots_end #undef ll_deftype_slots_end #undef _ll_deftype_option #undef ll_deftype_option #undef _ll_deftype_end #undef ll_deftype_end ll0.13/src/ll/undef.c0100644000175200017560000000064506775057505014734 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_undef_c__ #define __rcs_id_ll_undef_c__ static const char __rcs_id_ll_undef_c[] = "$Id: undef.c,v 1.5 1999/10/01 07:14:13 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" ll_INIT(undef,70,"undefined and unspecified value") { ll_set_g(__undef, _ll_allocate_type(ll_type(undefined))); ll_set_g(__unspec, _ll_allocate_type(ll_type(unspecified))); return 0; } ll0.13/src/ll/value.h0100644000175200017560000001333306775454241014750 0ustar stephensstephens#ifndef _ll_value_h #define _ll_value_h #ifndef __rcs_id__ #ifndef __rcs_id_ll_value_h__ #define __rcs_id_ll_value_h__ static const char __rcs_id_ll_value_h[] = "$Id: value.h,v 1.7 1999/10/02 19:10:25 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ll/config.h" #if ll_v_WORD /*************************************************************************/ /* ** Use a low 2-bit tag. ** ** 33222222222211111111110000000000 ** 10987654321098765432109876543210 ** -------------------------------- ** fixnum |00 ** locative |01 ** flonum |10 ** boxed object |11 ** */ typedef unsigned long ll_v; /***********************************************************************/ /* eq? */ #define ll_EQ(X,Y)((X)==(Y)) /***********************************************************************/ /* tag extraction */ #define ll_TAG(X) ((X)&3) /***********************************************************************/ /* fixnum */ #define ll_TAG_fixnum 0 #define ll_BOX_fixnum(X)(((long)(X))<<2) #define ll_make_fixnum(X)ll_BOX_fixnum(X) #define ll_UNBOX_fixnum(X)(((long)(X))>>2) long ll_unbox_fixnum(ll_v x); /* #define ll_unbox_fixnum(X)ll_UNBOX_fixnum(X) */ #define ll_ISA_fixnum(X)(ll_TAG(X)==ll_TAG_fixnum) #define ll_TYPE_fixnum(X) ll_type(fixnum) #define ll_MIN_fixnum (((long)~0UL)>>2) #define ll_MAX_fixnum ((long)(~0UL>>2)) /***********************************************************************/ /* locative */ #define ll_TAG_locative 1 #define ll_BOX_locative(X)(((unsigned long)(X))+ll_TAG_locative) #define ll_make_locative(X)ll_BOX_locative(X) #define ll_UNBOX_locative(X)((ll_v*)((X)-ll_TAG_locative)) /* #define ll_unbox_locative(X)ll_UNBOX_locative(X) */ ll_v *ll_unbox_locative(ll_v x); #define ll_ISA_locative(X)(ll_TAG(X)==ll_TAG_locative) #define ll_TYPE_locative(X) ll_type(locative) /***********************************************************************/ /* flonum */ #define ll_TAG_flonum 2 #ifdef i386 static __inline ll_v ll_BOX_flonum(float x) { ll_v v = * (ll_v*) &x; v &= ~ 3UL; v |= ll_TAG_flonum; return v; } static __inline float ll_UNBOX_flonum(ll_v x) { x &= ~ 3UL; return *(float*) &x; } #else #error flonum only implemented for i386 #endif #define ll_make_flonum(X)ll_BOX_flonum(X) float ll_unbox_flonum(ll_v x); /* #define ll_unbox_flonum(X)ll_UNBOX_flonum(X) */ #define ll_ISA_flonum(X)(ll_TAG(X)==ll_TAG_flonum) #define ll_TYPE_flonum(X) ll_type(flonum) /***********************************************************************/ /* boxed object reference */ #define ll_TAG_ref 3 #define ll_BOX_ref(X)(((unsigned int)(X))+ll_TAG_ref) #define ll_make_ref(X)ll_BOX_ref(X) #define ll_UNBOX_ref(X)((void*)((X)-ll_TAG_ref)) #define ll_unbox_ref(X)ll_UNBOX_ref(X) #define ll_ISA_ref(X)(ll_TAG(X)==ll_TAG_ref) #define ll_TYPE_ref(X)(ll_SLOTS(X)[0]) /***********************************************************************/ #define ll_TYPE(X)(ll_ISA_ref(X)?ll_TYPE_ref(X):ll_ISA_fixnum(X)?ll_TYPE_fixnum(X):ll_ISA_flonum(X)?ll_TYPE_flonum(X):ll_TYPE_locative(X)) /***********************************************************************/ #define ll_SLOTS(X) ((ll_v*)(ll_UNBOX_ref(X))) /***********************************************************************/ #else /*************************************************************************/ /* ** Use the ct_v value. */ #include "ct/cv.h" typedef ct_v ll_v; /* ** ll_v._t ----------> ct_t_user()->[0] --------> ll_tsa_type* ** ll_v._u._voidP ---> ll_tsa_*; */ /***********************************************************************/ /* eq? */ #define ll_EQ(X,Y)cv_v_eq(&(X), &(Y)) /***********************************************************************/ /* tag extraction */ #define ll_TAG(X) ((X)._t) /***********************************************************************/ /* fixnum */ #define ll_TAG_fixnum ct_t_long #define ll_BOX_fixnum(X)ct_v_long(X) #define ll_make_fixnum(X)ll_BOX_fixnum(X) #define ll_UNBOX_fixnum(X)ct_v_UNBOX(X,long) #define ll_unbox_fixnum(X)ll_UNBOX_fixnum(X) #define ll_ISA_fixnum(X)(ll_TAG(X)==ll_TAG_fixnum) #define ll_TYPE_fixnum(X) ll_type(fixnum) #define ll_MIN_fixnum (((long)~0UL)>>1) #define ll_MAX_fixnum ((long)(~0UL>>1)) /***********************************************************************/ /* locative */ #define ll_TAG_locative ct_t_voidP #define ll_BOX_locative(X)ct_v_voidP(X) #define ll_make_locative(X)ll_BOX_locative(X) #define ll_UNBOX_locative(X)((ll_v*)((ct_v_UNBOX(X,voidP)))) #define ll_unbox_locative(X)ll_UNBOX_locative(X) #define ll_ISA_locative(X)(ll_TAG(X)==ll_TAG_locative) #define ll_TYPE_locative(X) ll_type(locative) /***********************************************************************/ /* flonum */ #define ll_TAG_flonum ct_t_double #define ll_BOX_flonum(X)ct_v_double(X) #define ll_UNBOX_flonum(X)ct_v_UNBOX(X, double) #define ll_make_flonum(X)ll_BOX_flonum(X) #define ll_unbox_flonum(X)ll_UNBOX_flonum(X) #define ll_ISA_flonum(X)(ll_TAG(X)==ll_TAG_flonum) #define ll_TYPE_flonum(X) ll_type(flonum) /***********************************************************************/ /* boxed object reference */ #define ll_TAG_ref 3 #define ll_BOX_ref(X)ct_v_ptr(X, ((ll_v*)(X))->_u._voidP); #define ll_make_ref(X)ll_BOX_ref(X) #define ll_UNBOX_ref(X)ct_v_UNBOX(X, voidP) #define ll_unbox_ref(X)ll_UNBOX_ref(X) #define ll_ISA_ref(X)(ll_TAG(X)==ll_TAG_ref) #define ll_TYPE_ref(X)(ll_SLOTS(X)[0]) /*************************************************************************/ #define ll_TYPE(X) _ll_v_type(&X) /*************************************************************************/ #endif #define _ll_THIS_ISA(T,X) ((_ll_tsa_##T*)ll_UNBOX_ref(X)) #define ll_THIS_ISA(T,X)_ll_THIS_ISA(T,X) /***********************************************************************/ #endif ll0.13/src/ll/vec.c0100744000175200017560000003321007230472511014364 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_vec_c__ #define __rcs_id_ll_vec_c__ static const char __rcs_id_ll_vec_c[] = "$Id: vec.c,v 1.17 2001/01/15 03:58:01 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" #ifndef _ll_VEC #error Must define _ll_VEC #endif #ifndef _ll_VEC_ELEM_TYPE #error Must define _ll_VEC_ELEM_TYPE #endif #ifndef PASTE2 #define _PASTE2(X,Y)X##Y #define PASTE2(X,Y)_PASTE2(X,Y) #endif #ifndef PASTE3 #define _PASTE3(X,Y,Z)X##Y##Z #define PASTE3(X,Y,Z)_PASTE2(X,Y,Z) #endif #define _ll_VEC_MUTABLE PASTE2(mutable_,_ll_VEC) #define _ll_VEC_SUPER PASTE2(super_,_ll_VEC) #define __ll_VEC_NAME(VEC,NAME)_ll_##NAME##_##VEC #define _ll_VEC_NAME(VEC,NAME)__ll_VEC_NAME(VEC,NAME) #ifndef _ll_VEC_TERM #define _ll_VEC_TERM 0 #endif #ifndef _ll_VEC_BOX_VALUE #define _ll_VEC_BOX_VALUE(X) (X) #endif #ifndef _ll_VEC_UNBOX_VALUE #define _ll_VEC_UNBOX_VALUE(X) (X) #endif #ifndef _ll_VEC_TERM_VALUE #define _ll_VEC_TERM_VALUE 0 #endif #ifndef _ll_VEC_UNDEF_VALUE #define _ll_VEC_UNDEF_VALUE 0 #endif #ifndef _ll_VEC_ELEM_EQUAL #define _ll_VEC_ELEM_EQUAL(X,Y)((X)==(Y)) #endif /************************************************************************/ /* type queries */ ll_define_primitive(_ll_VEC,immutable_type,1,(_ll_VEC),_1(no_side_effect,"#t")) { ll_return(ll_type(_ll_VEC)); } ll_define_primitive_end ll_define_primitive(_ll_VEC,mutable_type,1,(_ll_VEC),_1(no_side_effect,"#t")) { ll_return(ll_type(_ll_VEC_MUTABLE)); } ll_define_primitive_end /************************************************************************/ /* Immutable vec */ ll_define_primitive(_ll_VEC,initialize,1,_(_ll_VEC,length_fill), _0()) { /* Check for size */ if ( ll_ARGC >= 2 ) { ll_THIS->_length = ll_unbox_fixnum(ll_ARGV[1]); } else { ll_THIS->_length = 0; } ll_THIS->_array = 0; ll_write_barrier_SELF(); /* (initialize ??) */ //ll_call_super(ll_o(initialize), ll_f, 1, (ll_SELF)); /* Allocate _array. */ ll_call(ll_o(deepen), 1, (ll_SELF)); /* Check for fill */ if ( ll_ARGC >= 3 ) { //fprintf(stderr, "vec::initialize %d %lu %s\n", ll_ARGC, ll_THIS->_length, ll_po(ll_ARGV[2])); { size_t i = ll_THIS->_length; _ll_VEC_ELEM_TYPE fill = _ll_VEC_UNBOX_VALUE(ll_ARGV[2]); _ll_VEC_ELEM_TYPE *V = ll_THIS->_array; while ( i -- ) { V[i] = fill; } ll_write_barrier(V); } } ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(fixnum,PASTE2(make_,_ll_VEC),1,_(size,fill), _0()) { //ll_call(ll_o(debugger), 0, ()); /* stack is now : ? */ if ( ll_ARGC == 1 ) { ll_tail_call(ll_o(make), 2, (ll_type(_ll_VEC_MUTABLE), ll_ARGV[0])); } else { ll_tail_call(ll_o(make), 3, (ll_type(_ll_VEC_MUTABLE), ll_ARGV[0], ll_ARGV[1])); } #if 0 _ll_VS_PROBE(1); _ll_PUSH(ll_type(_ll_VEC_MUTABLE)); /* stack is now : ? */ __ll_tail_callv(ll_o(make), ll_ARGC + 1); #endif } ll_define_primitive_end ll_define_primitive(object, _ll_VEC, 0, _(elements), _0()) { size_t l = ll_ARGC; ll_v v = ll_call(ll_o(make), 2, (ll_type(_ll_VEC_MUTABLE), ll_make_fixnum(l))); _ll_VEC_ELEM_TYPE *V = ll_THIS_ISA(_ll_VEC,v)->_array; while ( l -- > 0 ) { V[l] = _ll_VEC_UNBOX_VALUE(ll_ARGV[l]); } ll_return(v); } ll_define_primitive_end ll_define_primitive(_ll_VEC,PASTE2(_ll_VEC,_ref),2,(_ll_VEC, index), _1(no_side_effect,"#t")) { long i; _ll_rangecheck(ll_s(index), &ll_ARGV[1], 0, ll_THIS->_length - 1); i = ll_UNBOX_fixnum(ll_ARGV[1]); ll_return(_ll_VEC_BOX_VALUE(ll_THIS->_array[i])); } ll_define_primitive_end ll_define_primitive(_ll_VEC,PASTE2(_ll_VEC,_length),1,(_ll_VEC), _1(no_side_effect,"#t")) { ll_return(ll_make_fixnum(ll_THIS->_length)); } ll_define_primitive_end ll_define_primitive(_ll_VEC,_ptr,1,(_ll_VEC), _0()) { ll_return((ll_v) ll_THIS->_array); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(_ll_VEC,clone,1,(_ll_VEC), _0()) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(_ll_VEC,initialize_clone_mutable,2,(_ll_VEC, src),_0()) { ll_tail_call(ll_o(deepen), 1, (ll_SELF)); } ll_define_primitive_end ll_define_primitive(_ll_VEC_MUTABLE,initialize_clone,2,(_ll_VEC, src), _0()) { ll_tail_call(ll_o(deepen), 1, (ll_SELF)); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(_ll_VEC,make_immutable,1,(_ll_VEC), _0()) { ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(_ll_VEC_MUTABLE,make_immutable,1,(_ll_VEC), _0()) { ll_TYPE_ref(ll_SELF) = ll_type(_ll_VEC); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(_ll_VEC,make_mutable,1,(_ll_VEC), _0()) { ll_SELF = ll_call_super(ll_o(clone), ll_f, 0, ()); ll_TYPE_ref(ll_SELF) = ll_type(_ll_VEC_MUTABLE); ll_tail_call(ll_o(deepen), 1, (ll_SELF)); } ll_define_primitive_end ll_define_primitive(_ll_VEC_MUTABLE,make_mutable,1,(_ll_VEC), _0()) { ll_return(ll_SELF); } ll_define_primitive_end /************************************************************************/ ll_define_primitive(_ll_VEC_MUTABLE,PASTE2(_ll_VEC,_fillE),2,(_ll_VEC,fill), _0()) { size_t i = ll_THIS->_ll_VEC_SUPER._length; _ll_VEC_ELEM_TYPE *V = ((_ll_VEC_ELEM_TYPE *)(ll_THIS->_ll_VEC_SUPER._array)); while ( i -- > 0 ) { V[i] = _ll_VEC_UNBOX_VALUE(ll_ARGV[1]); } ll_write_barrier_pure(V); } ll_define_primitive_end ll_define_primitive(_ll_VEC,PASTE2(_ll_VEC,_append),1,_(_ll_VEC,sequences), _0()) { ll_SELF = ll_call(ll_o(make_mutable), 1, (ll_SELF)); __ll_tail_callv(ll_o(PASTE2(_ll_VEC,_appendE)),ll_ARGC); } ll_define_primitive_end ll_define_primitive(object,PASTE2(_ll_VEC,_append),0,(), _0()) { ll_tail_call(ll_o(make), 1, (ll_type(_ll_VEC))); } ll_define_primitive_end ll_define_primitive(_ll_VEC,reverse,1,(_ll_VEC), _0()) { ll_SELF = ll_call(ll_o(clone), 1, (ll_SELF)); ll_TYPE_ref(ll_SELF) = ll_type(_ll_VEC_MUTABLE); ll_tail_call(ll_o(reverseE), 1, (ll_SELF)); } ll_define_primitive_end ll_define_primitive(_ll_VEC,_equalQ,2,(_ll_VEC,_ll_VEC), _1(no_side_effect,"#t")) { size_t l1, l2; _ll_VEC_ELEM_TYPE *v1, *v2; l1 = ll_THIS->_length; /* XXX: typechecking */ l2 = ll_THIS_ISA(_ll_VEC, ll_ARGV[1])->_length; if ( l1 != l2 ) { ll_return(ll_f); } v1 = (ll_THIS->_array); /* XXX: typechecking */ v2 = (ll_THIS_ISA(_ll_VEC, ll_ARGV[1])->_array); while ( l1 && l2 ) { if ( ! _ll_VEC_ELEM_EQUAL(*v1, *v2) ) ll_return(ll_f); v1 ++; v2 ++; l1 --; l2 --; } ll_return(ll_f); } ll_define_primitive_end /****************************************************************************/ /* mutable vector */ #if _ll_VEC_ELEM_TYPE != ll_v ll_define_primitive(_ll_VEC_MUTABLE,PASTE3(locative_,_ll_VEC,_ref),2,(_ll_VEC, index), _1(no_side_effect,"#t")) { long i; _ll_rangecheck(ll_s(index), &ll_ARGV[1], 0, ll_THIS->_length - 1); i = ll_UNBOX_fixnum(ll_ARGV[1]); ll_return(ll_BOX_locative(&ll_THIS->_array[i])); } ll_define_primitive_end #endif ll_define_primitive(_ll_VEC_MUTABLE,PASTE2(_ll_VEC,_setE),3,(_ll_VEC, index, value), _0()) { long i; _ll_rangecheck(ll_s(index), &ll_ARGV[1], 0, ll_THIS->_ll_VEC_SUPER._length - 1); i = ll_UNBOX_fixnum(ll_ARGV[1]); ll_THIS->_ll_VEC_SUPER._array[i] = _ll_VEC_UNBOX_VALUE(ll_ARGV[2]); ll_write_barrier(ll_THIS->_ll_VEC_SUPER._array); } ll_define_primitive_end ll_define_primitive(_ll_VEC,deepen,1,(_ll_VEC), _0()) { size_t s; _ll_VEC_ELEM_TYPE *v; s = ll_THIS->_length; v = ll_malloc(sizeof(v[0]) * (s + _ll_VEC_TERM)); if ( (ll_THIS->_array) ) { memcpy(v, (ll_THIS->_array), sizeof(v[0]) * (s + _ll_VEC_TERM)); } else { size_t i; for ( i = 0; i < s; i ++ ) { v[i] = _ll_VEC_UNDEF_VALUE; } #if _ll_VEC_TERM != 0 v[i] = _ll_VEC_TERM_VALUE; #endif } ll_write_barrier(v); ll_THIS->_array = v; ll_write_barrier_SELF(); ll_return(ll_SELF); } ll_define_primitive_end ll_define_primitive(_ll_VEC_MUTABLE,set_lengthE,2,(_ll_VEC, length), _0()) { size_t s; long ns; _ll_VEC_ELEM_TYPE *v, *nv; s = ll_THIS->_ll_VEC_SUPER._length; v = (ll_THIS->_ll_VEC_SUPER._array); _ll_rangecheck(ll_s(index), &ll_ARGV[1], 0, ll_MAX_fixnum); ns = ll_UNBOX_fixnum(ll_ARGV[1]); if ( ns > s ) { nv = ll_malloc(sizeof(nv[0]) * (ns + _ll_VEC_TERM)); if ( v ) memcpy(nv, v, sizeof(nv[0]) * ns); while ( s < ns ) { nv[s ++] = _ll_VEC_UNDEF_VALUE; } #if _ll_VEC_TERM != 0 nv[ns] = _ll_VEC_TERM_VALUE; #endif ll_write_barrier(nv); ll_THIS->_ll_VEC_SUPER._array = nv; } ll_THIS->_ll_VEC_SUPER._length = ll_ARGV[1]; ll_write_barrier_SELF(); } ll_define_primitive_end ll_define_primitive(_ll_VEC_MUTABLE,append_oneE,2,(_ll_VEC, obj), _0()) { size_t s; _ll_VEC_ELEM_TYPE *v, *nv; s = ll_THIS->_ll_VEC_SUPER._length; v = (ll_THIS->_ll_VEC_SUPER._array); nv = ll_malloc(sizeof(nv[0]) * (s + 1 + _ll_VEC_TERM)); if ( v ) { memcpy(nv, v, sizeof(nv[0]) * s); } nv[s] = _ll_VEC_UNBOX_VALUE(ll_ARGV[1]); ll_write_barrier(nv); #if _ll_VEC_TERM != 0 nv[s + 1] = _ll_VEC_TERM_VALUE; #endif ll_write_barrier(nv); ll_THIS->_ll_VEC_SUPER._array = nv; ll_THIS->_ll_VEC_SUPER._length = s + 1; ll_write_barrier_SELF(); } ll_define_primitive_end ll_define_primitive(_ll_VEC_MUTABLE,PASTE2(_ll_VEC,_appendE),1,_(_ll_VEC,sequences), _0()) { size_t s; _ll_VEC_ELEM_TYPE *v; int i; s = ll_THIS->_ll_VEC_SUPER._length; for ( i = 1; i < ll_ARGC; i ++ ) { _ll_typecheck(ll_type(_ll_VEC), &ll_ARGV[i]); s += ll_unbox_fixnum(ll_call(ll_o(PASTE2(_ll_VEC,_length)), 1, (ll_ARGV[i]))); } if ( s != ll_THIS->_ll_VEC_SUPER._length ) { v = ll_malloc(sizeof(v[0]) * (s + _ll_VEC_TERM)); if ( ll_THIS->_ll_VEC_SUPER._array ) { memcpy(v, (ll_THIS->_ll_VEC_SUPER._array), sizeof(v[0]) * (s + _ll_VEC_TERM)); ll_write_barrier_pure(v); } ll_THIS->_ll_VEC_SUPER._array = v; ll_write_barrier_SELF(); v += ll_THIS->_ll_VEC_SUPER._length; for ( i = 1; i < ll_ARGC; i ++ ) { size_t es = ll_unbox_fixnum(ll_call(ll_o(PASTE2(_ll_VEC,_length)), 1, (ll_ARGV[i]))); _ll_VEC_ELEM_TYPE *ev = _ll_VEC_NAME(_ll_VEC,ptr)(ll_ARGV[i]); memcpy(v, ev, sizeof(v[0]) * (es)); ll_write_barrier_pure(ll_THIS->_ll_VEC_SUPER._array); v += es; } ll_THIS->_ll_VEC_SUPER._length = s; ll_write_barrier_SELF(); } ll_return(ll_SELF); } ll_define_primitive_end /***************************************************************************/ ll_define_primitive(_ll_VEC_MUTABLE,reverseE,1,(_ll_VEC), _0()) { size_t len = ll_THIS->_ll_VEC_SUPER._length; _ll_VEC_ELEM_TYPE *v1 = (ll_THIS->_ll_VEC_SUPER._array), *v2; v2 = v1 + len - 1; while ( v1 < v2 ) { _ll_VEC_ELEM_TYPE tmp = *v1; *v1 = *v2; *v2 = tmp; v1 ++; v2 --; } ll_return(ll_SELF); } ll_define_primitive_end /***************************************************************************/ ll_define_primitive(_ll_VEC,PASTE2(_sub,_ll_VEC),3,(_ll_VEC,start,end), _1(no_side_effect,"#t")) { long start, end; size_t len = ll_THIS->_length; _ll_VEC_ELEM_TYPE *v = (ll_THIS->_array); /* 0 <= start < len */ _ll_rangecheck(ll_s(start), &ll_ARGV[1], 0, len); start = ll_UNBOX_fixnum(ll_ARGV[1]); end = ll_unbox_fixnum(ll_ARGV[2]); if ( end < start ) { end = start; } /* The subvector should be of same mutality */ { ll_v vec = _ll_VEC_NAME(_ll_VEC,make)(v + start, end - start); ll_TYPE_ref(vec) = ll_TYPE_ref(ll_SELF); ll_return(vec); } } ll_define_primitive_end ll_define_primitive(_ll_VEC,PASTE2(sub,_ll_VEC),3,(_ll_VEC,start,end), _1(no_side_effect,"#t")) { ll_SELF = ll_call(ll_o(PASTE2(_sub,_ll_VEC)), 3, (ll_SELF, ll_ARGV[1], ll_ARGV[2])); ll_TYPE_ref(ll_SELF) = ll_type(_ll_VEC_MUTABLE); ll_tail_call(ll_o(deepen), 1, (ll_SELF)); } ll_define_primitive_end /***************************************************************************/ ll_v _ll_VEC_NAME(_ll_VEC,make)(_ll_VEC_ELEM_TYPE *v, size_t s) { ll_v x = _ll_allocate_type(ll_type(_ll_VEC_MUTABLE)); _ll_VEC_NAME(_ll_VEC,ts) *self = (void*) &(ll_SLOTS(x)[1]); self->_array = v; #ifdef _ll_VEC_COMPUTE_SIZE if ( s == (size_t) -1 ) s = _ll_VEC_COMPUTE_SIZE(v); #endif self->_length = s; return x; } ll_v _ll_VEC_NAME(_ll_VEC,make_copy)(const _ll_VEC_ELEM_TYPE *v, size_t s) { _ll_VEC_ELEM_TYPE *nv; #ifdef _ll_VEC_COMPUTE_SIZE if ( s == (size_t) -1 ) s = _ll_VEC_COMPUTE_SIZE(v); #endif nv = ll_malloc(sizeof(nv[0]) * (s + _ll_VEC_TERM)); if ( v ) { memcpy(nv, v, sizeof(nv[0]) * s); } else { size_t i; for ( i = 0; i < s; i ++ ) { nv[i] = _ll_VEC_UNDEF_VALUE; } } #if _ll_VEC_TERM != 0 nv[s] = _ll_VEC_TERM_VALUE; #endif return _ll_VEC_NAME(_ll_VEC,make)(nv, s); } _ll_VEC_ELEM_TYPE *_ll_VEC_NAME(_ll_VEC,ptr)(ll_v x) { _ll_VEC_NAME(_ll_VEC,tsa) *self; ll_v type = ll_TYPE(x); if ( ll_EQ(type, ll_type(_ll_VEC)) || ll_EQ(type, ll_type(_ll_VEC_MUTABLE)) ) { self = ll_THIS_ISA(_ll_VEC, x); return (self->_array); } else { return (void*) ll_call(ll_o(_ptr), 1, (x)); } return 0; } size_t _ll_VEC_NAME(_ll_VEC,len)(ll_v x) { _ll_VEC_NAME(_ll_VEC,tsa) *self; ll_v type = ll_TYPE(x); if ( ll_EQ(type, ll_type(_ll_VEC)) || ll_EQ(type, ll_type(_ll_VEC_MUTABLE)) ) { self = ll_THIS_ISA(_ll_VEC, x); return self->_length; } else { return ll_unbox_fixnum(ll_call(ll_o(PASTE2(_ll_VEC,_length)), 1, (x))); } return 0; } #undef _ll_VEC_MUTABLE #undef _ll_VEC_SUPER #undef _ll_VEC #undef _ll_VEC_NAME #undef __ll_VEC_NAME #undef _ll_VEC_TERM #undef _ll_VEC_TERM_VALUE #ifdef _ll_VEC_COMPUTE_SIZE #undef _ll_VEC_COMPUTE_SIZE #endif #undef _ll_VEC_BOX_VALUE #undef _ll_VEC_UNBOX_VALUE #undef _ll_VEC_ELEM_EQUAL ll0.13/src/ll/vec.h0100644000175200017560000000122306663227050014374 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_ll_vec_h__ #define __rcs_id_ll_vec_h__ static const char __rcs_id_ll_vec_h[] = "$Id: vec.h,v 1.2 1999/02/19 09:26:00 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define __ll_VEC_NAME(VEC,NAME)_ll_##NAME##_##VEC #define _ll_VEC_NAME(VEC,NAME)__ll_VEC_NAME(VEC,NAME) ll_v _ll_VEC_NAME(_ll_VEC,make)(_ll_VEC_ELEM_TYPE *v, size_t s); _ll_VEC_ELEM_TYPE *_ll_VEC_NAME(_ll_VEC,ptr)(ll_v x); size_t _ll_VEC_NAME(_ll_VEC,len)(ll_v x); ll_v _ll_VEC_NAME(_ll_VEC,make_copy)(const _ll_VEC_ELEM_TYPE *v, size_t s); #undef _ll_VEC #undef _ll_VEC_ELEM_TYPE #undef _ll_VEC_NAME #undef __ll_VEC_NAME #undef _ll_VEC_ELEM_TYPE ll0.13/src/ll/vector.c0100764000175200017560000000270607623406030015120 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_vector_c__ #define __rcs_id_ll_vector_c__ static const char __rcs_id_ll_vector_c[] = "$Id: vector.c,v 1.8 2003/02/15 09:44:56 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "call_int.h" /* __ll_tail_callv() */ #define _ll_VEC vector #define _ll_VEC_ELEM_TYPE ll_v #define _ll_VEC_UNDEF_TYPE ll_undef #define _ll_VEC_ELEM_EQUAL(X,Y) ll_equalQ((X), (Y)) #include "vec.c" #define X ll_SELF #define Y ll_ARGV[1] /* ** Reimplement equal? here to make it tail-recurse on the last pair ** of elements. */ ll_define_primitive(vector, _ref0, 1, (v), _1(no_side_effect,"#t")) { ll_return(ll_BOX_locative(ll_THIS->_array)); } ll_define_primitive_end ll_define_primitive(vector, equalQ, 2, (x, y), _1(no_side_effect,"#t")) { size_t l; if ( ll_EQ(X, Y) ) ll_return(ll_t); if ( ll_NE(ll_TYPE(X), ll_TYPE(Y)) ) { ll_v tc = ll_call(ll_o(vectorQ), 1, (ll_ARGV[1])); if ( ! ll_unbox_boolean(tc) ) ll_return(tc); } l = ll_THIS->_length; if ( l != ll_unbox_fixnum(ll_call(ll_o(vector_length), 1, (Y))) ) ll_return(ll_f); if ( l ) { ll_v *x, *y; x = ll_THIS->_array; y = ll_unbox_locative(ll_call(ll_o(_ref0), 1, (Y))); while ( -- l > 0 ) { if ( ! ll_equalQ(*(x ++), *(y ++)) ) ll_return(ll_f); } X = *x; Y = *y; __ll_tail_callv(ll_o(equalQ), 2); } else { ll_return(ll_t); } } ll_define_primitive_end #undef X #undef Y ll0.13/src/ll/write.c0100664000175200017560000002360007336071337014754 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_ll_write_c__ #define __rcs_id_ll_write_c__ static const char __rcs_id_ll_write_c[] = "$Id: write.c,v 1.21 2001/08/13 07:25:34 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "ll.h" #include "ll/floatcfg.h" #include /* strchr, strcat */ #if 0 /* ** Use a hidden class to avoid recursion during display. ** If an escape procedure gets called the object will still be a ** recursion-lock. Need a restoreation stack or something. ** Maybe a list of ( . ) pairs. */ ll_define_primitive(recursion_lock, _write_port, 3, (obj, port, op), _0()) { ll_format(ll_ARGV[1], "~W", 1, ll_SELF); } ll_define_primitive_end ll_define_primitive(recursion_lock, _write_shallow, 2, _(obj, port, rest), _0()) { ll_format(ll_ARGV[1], "~W", 1, ll_SELF); } ll_define_primitive_end #define ll_RECURSION_LOCK() { ll_v _old_type = ll_SLOTS(ll_SELF)[0]; ll_SLOTS(ll_SELF)[0] = ll_type(recursion_lock); { #define ll_RECURSION_UNLOCK() } ll_SLOTS(ll_SELF)[0] = _old_type; } #else #define ll_RECURSION_LOCK() { #define ll_RECURSION_UNLOCK() } #endif ll_define_primitive(boolean, _write_port, 3, (obj, port, op), _0()) { if ( ll_EQ(ll_SELF, ll_f) ) { ll_write_string(ll_ARGV[1], "#f", 2); } else { ll_write_string(ll_ARGV[1], "#t", 2); } } ll_define_primitive_end ll_define_primitive(undefined, _write_port, 3, (obj, port, op), _0()) { ll_write_string(ll_ARGV[1], "#u", 2); } ll_define_primitive_end ll_define_primitive(unspecified, _write_port, 3, (obj, port, op), _0()) { ll_write_string(ll_ARGV[1], "#", -1); } ll_define_primitive_end ll_define_primitive(eof_object, _write_port, 3, (obj, port, op), _0()) { ll_write_string(ll_ARGV[1], "#e", 2); } ll_define_primitive_end ll_define_primitive(fixnum, _write_port, 3, (obj, port, op), _0()) { char buf[32]; sprintf(buf, "%ld", (long) ll_unbox_fixnum(ll_SELF)); ll_write_string(ll_ARGV[1], buf, (size_t) -1); } ll_define_primitive_end ll_define_primitive(flonum, _write_port, 3, (obj, port, op), _0()) { char buf[32]; sprintf(buf, "%." ll_STRINGTIZE(ll_FLO_DIGITS) "g", (double) ll_unbox_flonum(ll_SELF)); if ( ! (strchr(buf, 'e') || strchr(buf, '.')) ) { strcat(buf, ".0"); } ll_write_string(ll_ARGV[1], buf, (size_t) -1); } ll_define_primitive_end /********************************************************************/ ll_define_primitive(locative, _write_port, 3, (obj, port, op), _0()) { ll_format(ll_ARGV[1], "#", 1, ll_SELF); } ll_define_primitive_end /********************************************************************/ ll_define_primitive(pair, _write_cdr, 3, (obj, port, op), _0()) { ll_RECURSION_LOCK(); ll_write_string(ll_ARGV[1], " ", 1); ll_call(ll_o(_write_port), 3, (ll_THIS->_car, ll_ARGV[1], ll_ARGV[2])); ll_call(ll_o(_write_cdr), 3, (ll_THIS->_cdr, ll_ARGV[1], ll_ARGV[2])); ll_RECURSION_UNLOCK(); } ll_define_primitive_end ll_define_primitive(null, _write_cdr, 3, (obj, port, op), _0()) { } ll_define_primitive_end ll_define_primitive(object, _write_cdr, 3, (obj, port, op), _0()) { ll_write_string(ll_ARGV[1], " . ", 3); ll_tail_call(ll_o(_write_port), 3, (ll_SELF, ll_ARGV[1], ll_ARGV[2])); } ll_define_primitive_end /********************************************************************/ ll_define_primitive(null, _write_port, 3, (obj, port, op), _0()) { ll_write_string(ll_ARGV[1], "()", 2); } ll_define_primitive_end ll_define_primitive(pair, _write_port, 3, (obj, port, op), _0()) { ll_v x; ll_RECURSION_LOCK(); #if 1 if ( ll_pairQ(ll_THIS->_cdr) && ll_nullQ(ll_cdr(ll_THIS->_cdr)) ) { ll_v x = ll_car(ll_THIS->_cdr); if ( ll_EQ(ll_THIS->_car, ll_s(quote)) ) { ll_write_string(ll_ARGV[1], "'", 1); ll_tail_call(ll_o(_write_port), 3, (x, ll_ARGV[1], ll_ARGV[2])); } else if ( ll_EQ(ll_THIS->_car, ll_s(quasiquote)) ) { ll_write_string(ll_ARGV[1], "`", 1); ll_tail_call(ll_o(_write_port), 3, (x, ll_ARGV[1], ll_ARGV[2])); } else if ( ll_EQ(ll_THIS->_car, ll_s(unquote)) ) { ll_write_string(ll_ARGV[1], ",", 1); ll_tail_call(ll_o(_write_port), 3, (x, ll_ARGV[1], ll_ARGV[2])); } else if ( ll_EQ(ll_THIS->_car, ll_s(unquote_splicing)) ) { ll_write_string(ll_ARGV[1], ",@", 2); ll_tail_call(ll_o(_write_port), 3, (x, ll_ARGV[1], ll_ARGV[2])); } } #endif ll_write_string(ll_ARGV[1], "(", 1); ll_call(ll_o(_write_port), 3, (ll_THIS->_car, ll_ARGV[1], ll_ARGV[2])); ll_call(ll_o(_write_cdr), 3, (ll_THIS->_cdr, ll_ARGV[1], ll_ARGV[2])); ll_write_string(ll_ARGV[1], ")", 1); ll_RECURSION_UNLOCK(); } ll_define_primitive_end /********************************************************************/ ll_define_primitive(vector, _write_port, 3, (obj, port, op), _0()) { size_t i, l ; ll_RECURSION_LOCK(); l = ll_THIS->_length; ll_write_string(ll_ARGV[1], "#(", 2); if ( l ) { i = 0; do { ll_v *v = ll_THIS->_array; ll_call(ll_o(_write_port), 3, (v[i], ll_ARGV[1], ll_ARGV[2])); if ( ++ i < l ) { ll_write_string(ll_ARGV[1], " ", 1); } else { break; } } while ( 1 ); } ll_write_string(ll_ARGV[1], ")", 1); ll_RECURSION_UNLOCK(); } ll_define_primitive_end /****************************************************************/ ll_define_primitive(char, _write, 2, (obj, port), _0()) { char buf[4] = "#\\x"; buf[2] = ll_unbox_fixnum(ll_THIS->_value); ll_write_string(ll_ARGV[1], buf, 3); } ll_define_primitive_end ll_define_primitive(char, _display, 2, (obj, port), _0()) { ll_tail_call(ll_o(_output_char), 2, (ll_ARGV[1], ll_SELF)); } ll_define_primitive_end /****************************************************************/ ll_define_primitive(string, _write, 2, (obj, port), _0()) { ll_write_string(ll_ARGV[1], "\"", 1); ll_call(ll_o(_output_string), 2, (ll_ARGV[1], ll_call(ll_o(_string_escape), 1, (ll_SELF)))); ll_write_string(ll_ARGV[1], "\"", 1); } ll_define_primitive_end ll_define_primitive(string, _display, 2, (obj, port), _0()) { ll_tail_call(ll_o(_output_string), 2, (ll_ARGV[1], ll_SELF)); } ll_define_primitive_end /****************************************************************/ ll_define_primitive(symbol, _write_port, 3, (obj, port, op), _0()) { if ( ll_EQ(ll_THIS->_name, ll_f) ) { ll_tail_call(ll_o(_write_shallow), 2, (ll_SELF, ll_ARGV[1])); } else { ll_tail_call(ll_o(_display), 2, (ll_THIS->_name, ll_ARGV[1])); } } ll_define_primitive_end /****************************************************************/ ll_define_primitive(method, _write_shallow_contents, 2, (obj, port), _0()) { ll_v port = ll_ARGV[1]; if ( ll_unbox_boolean(ll_call(ll_o(symbolQ), 1, (ll_THIS->_code))) ) { ll_format(port, "~S", 1, ll_THIS->_code); } else { ll_format(port, "~W", 1, ll_SELF); } } ll_define_primitive_end /****************************************************************/ /* ** If the object is named */ ll_define_primitive(object, _write_shallow_contents, 2, (obj, port), _0()) { ll_v port = ll_ARGV[1]; const char *named = (void*) ll_po_(ll_SELF); if ( named ) { ll_write_string(port, named, strlen(named)); } else { ll_format(port, "~W", 1, ll_SELF); } } ll_define_primitive_end ll_define_primitive(immediate, _write_shallow, 2, _(obj, port, rest), _0()) { ll_tail_call(ll_o(_write_port), 3, (ll_SELF, ll_ARGV[1], ll_o(_write))); } ll_define_primitive_end ll_define_primitive(constant, _write_shallow, 2, _(obj, port, rest), _0()) { ll_tail_call(ll_o(_write_port), 3, (ll_SELF, ll_ARGV[1], ll_o(_write))); } ll_define_primitive_end ll_define_primitive(null, _write_shallow, 2, _(obj, port, rest), _0()) { ll_tail_call(ll_o(_write_port), 3, (ll_SELF, ll_ARGV[1], ll_o(_write))); } ll_define_primitive_end ll_define_primitive(symbol, _write_shallow, 2, _(obj, port, rest), _0()) { if ( ll_unbox_boolean(ll_THIS->_name) ) { ll_write_string(ll_ARGV[1], "'", 1); ll_tail_call(ll_o(_write_port), 3, (ll_SELF, ll_ARGV[1], ll_o(_write))); } else { ll_tail_call_super(ll_o(_write_shallow), ll_f, 2, (ll_SELF, ll_ARGV[1])); } } ll_define_primitive_end ll_define_primitive(object, _write_shallow, 2, _(obj, port, rest), _0()) { ll_v port = ll_ARGV[1]; ll_write_string(port, "#<", 2); { const char *str = ll_po(ll_TYPE(ll_SELF)); ll_write_string(port, str, strlen(str)); } ll_write_string(port, " ", 1); ll_call(ll_o(_write_shallow_contents), 2, (ll_SELF, port)); ll_write_string(port, ">", 1); } ll_define_primitive_end /****************************************************************/ ll_define_primitive(object, _write, 2, (obj, port), _0()) { ll_tail_call(ll_o(_write_shallow), 2, (ll_SELF, ll_ARGV[1])); } ll_define_primitive_end ll_define_primitive(object, _display, 2, (obj, port), _0()) { ll_tail_call(ll_o(_write_shallow), 2, (ll_SELF, ll_ARGV[1])); } ll_define_primitive_end /****************************************************************/ ll_define_primitive(object, _write_port, 3, (obj, port, op), _0()) { ll_tail_call(ll_ARGV[2], 2, (ll_SELF, ll_ARGV[1])); } ll_define_primitive_end /****************************************************************/ #define GET_PORT(I) \ ll_v port = ll_ARGC > (I) ? ll_ARGV[I] : ll_call(ll_o(current_output_port), 0, ()) ll_define_primitive(object, write, 1, _(obj, port), _0()) { GET_PORT(1); ll_tail_call(ll_o(_write_port), 3, (ll_ARGV[0], port, ll_o(_write))); } ll_define_primitive_end ll_define_primitive(object, display, 1, _(obj, port), _0()) { GET_PORT(1); ll_tail_call(ll_o(_write_port), 3, (ll_ARGV[0], port, ll_o(_display))); } ll_define_primitive_end /****************************************************************/ ll_define_primitive(object, newline, 0, _(port), _0()) { GET_PORT(0); ll_call(ll_o(_output_char), 2, (port, ll_make_char('\n'))); } ll_define_primitive_end ll_define_primitive(char, write_char, 1, _(char, port), _0()) { GET_PORT(1); ll_call(ll_o(_output_char), 2, (port, ll_SELF)); } ll_define_primitive_end #undef GET_PORT ll0.13/src/util/0042755000175200017560000000000007623406402014020 5ustar stephensstephensll0.13/src/util/CVS/0042755000175200017560000000000007564511513014457 5ustar stephensstephensll0.13/src/util/CVS/Root0100664000175200017560000000006107336072175015322 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/util/CVS/Repository0100644000175200017560000000002207236675453016560 0ustar stephensstephenshome/ion/src/util ll0.13/src/util/CVS/Entries0100664000175200017560000000347107564511513016015 0ustar stephensstephens/ConfigInfo.c/1.9/Tue Jan 4 06:22:24 2000// /ConfigInfo.h/1.4/Mon Apr 5 19:04:21 1999// /Makefile/1.15/Tue Jan 4 06:22:24 2000// /Makefile.use/1.2/Fri Feb 19 09:26:46 1999// /PKG/1.7/Fri May 7 12:30:05 1999// /bitset.h/1.1/Fri Jan 7 09:39:13 2000// /charset.c/1.2/Thu Sep 30 18:53:44 1999// /charset.h/1.1/Thu Apr 22 05:45:47 1999// /enum.c/1.8/Thu Jan 13 14:03:55 2000// /enum.h/1.7/Thu Jan 13 13:58:11 2000// /errlist.h/1.5/Thu Jan 13 11:22:31 2000// /errlist.pl/1.6/Tue Oct 26 23:41:37 1999// /file.h/1.4/Thu Feb 1 06:22:18 2001// /host.c/1.2/Tue Jan 4 06:22:24 2000// /host.h/1.3/Tue Jan 4 06:34:47 2000// /lockfile.c/1.6/Tue Jan 4 06:22:24 2000// /lockfile.h/1.3/Wed Jun 9 05:43:23 1999// /lockfile_main.c/1.1/Wed Jun 9 05:43:31 1999// /mem.c/1.2/Fri Feb 19 09:26:47 1999// /mem.h/1.5/Mon Jun 28 14:04:14 1999// /midi.h/1.1/Wed Oct 13 17:30:44 1999// /outbuf.c/1.3/Tue Jan 4 06:22:24 2000// /outbuf.h/1.2/Thu Sep 30 18:49:28 1999// /path.c/1.5/Mon Jun 28 14:04:14 1999// /path.h/1.2/Fri Feb 19 09:26:47 1999// /port.c/1.2/Tue Jan 4 06:22:24 2000// /port.h/1.3/Tue Jan 4 06:34:47 2000// /prime.c/1.6/Thu Jan 13 13:29:50 2000// /prime.h/1.3/Thu Jan 13 13:25:04 2000// /rc4.c/1.4/Wed May 10 03:55:22 2000// /rc4.h/1.4/Wed May 10 03:55:22 2000// /setenv.c/1.3/Mon Apr 5 19:04:22 1999// /setenv.h/1.3/Mon Apr 5 19:04:22 1999// /sig.c/1.2/Tue Jan 4 05:53:51 2000// /sig.h/1.2/Tue Jan 4 05:53:51 2000// /sigs.pl/1.4/Tue Jan 4 05:53:51 2000// /ssprintf.c/1.2/Tue Jan 4 06:22:24 2000// /ssprintf.h/1.1/Thu Apr 22 05:07:25 1999// D/test//// /refcntptr.cc/1.1/Thu Apr 5 20:23:33 2001// /memcpy.h/1.1/Fri Apr 6 03:05:28 2001// /refcntptr.hh/1.3/Thu Apr 19 18:54:30 2001// /nurbs.h/1.1/Sun Apr 22 21:53:39 2001// /nurbs.c/1.2/Mon Aug 6 14:17:27 2001// /GUMakefile/1.1/Mon Aug 13 07:28:19 2001// /file.c/1.5/Wed Nov 13 18:00:50 2002// ll0.13/src/util/test/0042755000175200017560000000000007326751166015011 5ustar stephensstephensll0.13/src/util/test/CVS/0042755000175200017560000000000007336072175015441 5ustar stephensstephensll0.13/src/util/test/CVS/Root0100664000175200017560000000006107336072175016301 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/util/test/CVS/Repository0100644000175200017560000000002707236675453017544 0ustar stephensstephenshome/ion/src/util/test ll0.13/src/util/test/CVS/Entries0100644000175200017560000000013607236675453016777 0ustar stephensstephens/ConfigTest.c/1.1/Fri May 7 13:29:31 1999// /ConfigTest.cfg/1.1/Fri May 7 13:29:31 1999// D ll0.13/src/util/test/ConfigTest.c0100644000175200017560000000225006714565273017216 0ustar stephensstephensstatic char *_version_id = "$Id: ConfigTest.c,v 1.1 1999/05/07 13:29:31 stephensk Exp $"; #include "ConfigInfo.h" #include "config.h" #include #include #include /* isspace() */ #include "sqldummy.c" int main(int argc, char **argv, char **env) { ConfigInfo *config; passthru_config_init(argc, argv, env); config = passthru_config(); { char buf[1024]; while ( gets(buf) ) { char *key = buf; char **rec; if ( key[0] == 'p' ) { char *user, *password; while ( ! isspace(*key) ) key ++; while ( isspace(*key) ) key ++; user = key; while ( ! isspace(*key) ) key ++; *(key ++) = '\0'; while ( isspace(*key) ) key ++; password = key; while ( ! isspace(*key) ) key ++; *(key ++) = '\0'; printf("user = '%s', password = '%s'\n", user, password); rec = (char **) passthru_map_login(user, password); } else { rec = ConfigInfo_getRowForKey(config, 0, key); } if ( rec ) { int i; for ( i = 0; rec[i]; i ++ ) { printf("\"%s\"\t", rec[i]); } printf("\n"); } else { fprintf(stderr, "No record for '%s'\n", buf); } } } return 0; } ll0.13/src/util/test/ConfigTest.cfg0100644000175200017560000000005406714565273017533 0ustar stephensstephens#ConfigTest.cfg config1 1 2 3 config2 1 2 3 ll0.13/src/util/ConfigInfo.c0100644000175200017560000005104607034310640016200 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_util_ConfigInfo_c__ #define __rcs_id_util_ConfigInfo_c__ static const char __rcs_id_util_ConfigInfo_c[] = "$Id: ConfigInfo.c,v 1.9 2000/01/04 06:22:24 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "ConfigInfo.h" #include #include #include /* isspace() */ #include #include #include #include #ifdef __NeXT__ #include /* open, read, close */ #endif #include #include #include #ifdef MEMDEBUG #include "memdebug/memdebug.h" #endif ConfigInfoError ConfigInfoError_OK = "OK", ConfigInfoError_CannotStat = "Cannot stat file", ConfigInfoError_CannotAlloc = "Cannot allocate memory", ConfigInfoError_CannotOpen = "Cannot open file", ConfigInfoError_CannotRead = "Cannot read file", ConfigInfoError_; ConfigInfoError ConfigInfo_dump(ConfigInfo *c, FILE *fp, ConfigInfo *style, int depth) /* Dumps the config ^c^ to ^fp^, using ^style^'s lexical controls. Recurses to ^depth^, or to bottom of config chain if ^depth^ < 0. */ { if ( ! style ) { static ConfigInfo defaultStyle; defaultStyle.fieldSep = "\t"; defaultStyle.recordSep = "\n"; defaultStyle.commentBegin = "#"; defaultStyle.commentEnd = defaultStyle.recordSep; style = &defaultStyle; } while ( c ) { int i; fprintf(fp, "%sfrom %s%s", style->commentBegin ? style->commentBegin : "", c->from_where ? c->from_where : "", style->commentEnd ? style->commentEnd : ""); for ( i = 0; i < c->nconfigs; i ++ ) { int j; for ( j = 0; j < c->nfields[i]; ) { fwrite(c->configs[i][j], 1, strlen(c->configs[i][j]), fp); if ( ++ j < c->nfields[i] ) { fwrite(style->fieldSep, 1, strlen(style->fieldSep), fp); } } fwrite(style->recordSep, 1, strlen(style->recordSep), fp); } if ( depth > 0 ) { depth --; } if ( depth == 0 ) break; c = c->chain; } return ConfigInfoError_OK; } ConfigInfoError ConfigInfo_destroy(ConfigInfo *c) /* Destroys storage assocated with ^c^. */ { if ( ! c ) return ConfigInfoError_OK; if ( c->from_where ) { free(c->from_where); c->from_where = 0; } if ( c->configs ) { int i; for ( i = 0; i < c->nconfigs; i ++ ) { int j; /* Free externally allocated config data */ for ( j = 0; j < c->nfields[i]; j ++ ) { #if 1 if ( ! (c->buf <= c->configs[i][j] && c->configs[i][j] < c->buf + c->bufsize) ) { fprintf(stderr, "ConfigInfo_destroy(%p): freeing external string at [%d][%d] '%s'\n", c, i, j, c->configs[i][j]); free(c->configs[i][j]); } #endif c->configs[i][j] = 0; } free(c->configs[i]); c->configs[i] = 0; c->nfields[i] = 0; } free(c->configs); c->configs = 0; } c->nconfigs = 0; if ( c->nfields ) { free(c->nfields); c->nfields = 0; } if ( c->buf ) { memset(c->buf, 0, c->bufsize); free(c->buf); c->buf = 0; } c->bufsize = 0; c->instance_id = 0; return ConfigInfoError_OK; } ConfigInfoError ConfigInfo_free(ConfigInfo *c, int free_chain) /* Destroy storage assocated with ^c^ and frees ^c^. Recurses on all chains if ^free_chain^ is non-zero. */ { while ( c ) { ConfigInfo *chain; chain = c->chain; ConfigInfo_destroy(c); memset(c, 0, sizeof(*c)); free(c); if ( ! free_chain ) { break; } c = chain; } return ConfigInfoError_OK; } static int strprefix(const char *str, const char *pre) { if ( ! pre ) return 0; while ( *pre ) { if ( *str != *pre ) return 0; str ++; pre ++; } return 1; } ConfigInfoError ConfigInfo_initFromBuffer(ConfigInfo *c, char *buf, size_t bufsize) { ConfigInfoError result = ConfigInfoError_OK; int commentEndIsRecordSep; int i, j; char *s, *next_line; char *bufend; #define return(X) do { result = (X); goto rtn; } while(0) c->buf = buf; c->bufsize = bufsize != (size_t) -1 ? bufsize : strlen(buf) + 1; c->chain = 0; bufend = c->buf + c->bufsize; if ( ! c->recordSep ) { c->recordSep = "\n"; } if ( ! c->fieldSep ) { c->fieldSep = "\t"; } if ( ! c->commentEnd ) { c->commentEnd = c->recordSep; } commentEndIsRecordSep = ! strcmp(c->commentEnd, c->recordSep); /* Count the number of lines so we can guesstimate the length of c->configs */ for ( s = c->buf, i = 0; *s; ) { if ( strprefix(s, c->recordSep) ) { s += strlen(c->recordSep); i ++; } else { s ++; } } /* Allocate the config buffer */ if ( (c->configs = calloc(sizeof(c->configs[0]), (i + 1))) == 0 ) { return ConfigInfoError_CannotAlloc; } /* Allocate the nfields buffer */ if ( (c->nfields = calloc(sizeof(c->nfields[0]), (i + 1))) == 0 ) { return ConfigInfoError_CannotAlloc; } /* Skip header records */ for ( s = c->buf, i = c->skipHeaderRecords; i && s < bufend; ) { if ( strprefix(s, c->recordSep) ) { s += strlen(c->recordSep); i --; } else { s ++; } } /* Begin parsing each config */ for ( i = 0; *s && s < bufend; s = next_line ) { char *t; /* Skip leading whitespace */ if ( c->skipLeadingWhiteSpace ) { while ( *s && isspace(*s) ) s ++; } /* Find next_line */ next_line = s; while ( *next_line && next_line < bufend ) { if ( strprefix(next_line, c->recordSep) ) { next_line += strlen(c->recordSep); break; } next_line ++; } /* Skip trailing whitespace */ if ( c->skipTrailingWhiteSpace ) { t = next_line; t -= strlen(c->recordSep); while ( t > s ) { if ( isspace(*t) ) { char *dst = t; const char *src = c->recordSep; while ( *src ) *(dst ++) = *(src ++); t --; } else { break; } } } /* Skip comment only lines */ #define SKIP_COMMENTS(s,E) if ( strprefix(s, c->commentBegin) ) { (void) (E); s += strlen(c->commentBegin); while ( *s && ! strprefix(s, c->commentEnd) ) s ++; if ( *s && ! commentEndIsRecordSep ) { s += strlen(c->commentEnd); } } SKIP_COMMENTS(s,0) /* Skip blank lines */ if ( c->skipBlankRecords && strprefix(s, c->recordSep) ) { s += strlen(c->recordSep); continue; } /* Count the number of field separators to g */ for ( t = s, j = 1; *t && ! strprefix(t, c->recordSep); ) { SKIP_COMMENTS(t,0) else if ( strprefix(t, c->fieldSep) ) { t += strlen(c->fieldSep); j ++; } else { t ++; } } if ( c->maxFields && j > c->maxFields ) { j = c->maxFields; } c->nfields[i] = j; /* Allocate an array for the fields */ if ( (c->configs[i] = calloc(sizeof(c->configs[0][0]), (j + 1))) == 0 ) { return(ConfigInfoError_CannotAlloc); } /* Parse out the fields */ for ( t = s, j = 1, c->configs[i][0] = t; *t && ! strprefix(t, c->recordSep) ; ) { if ( j == c->nfields[i] ) { while ( *t && ! strprefix(t, c->recordSep) ) { SKIP_COMMENTS(t,*t = '\0') else t ++; } break; } SKIP_COMMENTS(t,*t = '\0') if ( strprefix(t, c->fieldSep) ) { *t = '\0'; t += strlen(c->fieldSep); c->configs[i][j ++] = t; } else { t ++; } } if ( strprefix(t, c->recordSep) ) { *t = '\0'; t += strlen(c->recordSep); } s = t; c->configs[i][j] = 0; c->nfields[i] = j; i ++; } c->nconfigs = i; if ( c->from_where ) { c->from_where = strcpy(ConfigInfo_MALLOC(strlen(c->from_where) + 1), c->from_where); } { static int instance_id = 0; c->instance_id = ++ instance_id; } /* ConfigInfo_dump(c, stderr, 0, 0); */ rtn: if ( result != ConfigInfoError_OK ) { ConfigInfo_destroy(c); } #undef return return result; } ConfigInfoError ConfigInfo_initFromFile(ConfigInfo *c, const char *file) { ConfigInfoError result = ConfigInfoError_OK; int fd = -1; char *buf; size_t bufsize; #define return(X) do { result = (X); goto rtn; } while(0) /* Determine the size of the parse buffer */ { struct stat s; if ( stat(file, &s) == -1 ) { return(ConfigInfoError_CannotStat); } bufsize = s.st_size; } /* Allocate the parse buffer */ if ( (buf = malloc(sizeof(buf[0]) * (bufsize + 1))) == 0 ) { return(ConfigInfoError_CannotAlloc); } /* Open the file and read into the parse buffer */ if ( (fd = open(file, O_RDONLY)) >= 0 ) { size_t r; size_t bufi = 0; size_t bufs = bufsize; bufsize = 0; while ( (r = read(fd, buf + bufi, bufs)) > 0 ) { bufi += r; bufs -= r; bufsize += r; } if ( bufsize > 0 ) { buf[bufsize] = '\0'; } else { return(ConfigInfoError_CannotRead); } close(fd); fd = -1; } else { return(ConfigInfoError_CannotOpen); } c->from_where = (char*) file; result = ConfigInfo_initFromBuffer(c, buf, bufsize + 1); rtn: if ( result != ConfigInfoError_OK ) { if ( fd != -1 ) close(fd); } #undef return return result; } ConfigInfoError ConfigInfo_initFromValueArray(ConfigInfo *c, const char **values) { char *buf; size_t bufsize; char *s, *t; char **v; bufsize = 0; v = (char **) values; while ( (t = *(v ++)) ) { bufsize += strlen(t) + 3; while ( (t = *(v ++)) ) { bufsize += strlen(t) + 3; } } c->fieldSep = "\02"; c->recordSep = "\01"; c->commentBegin = c->commentEnd = 0; c->maxFields = 0; if ( (buf = malloc(sizeof(buf[0]) * (bufsize + 1))) == 0 ) { return(ConfigInfoError_CannotAlloc); } s = buf; v = (char **) values; while ( (t = *(v ++)) ) { assert(s < buf + bufsize); strcpy(s, t); while ( (t = *(v ++)) ) { assert(s < buf + bufsize); strcat(s, c->fieldSep); strcat(s, t); s = strchr(s, '\0'); } strcat(s, c->recordSep); s = strchr(s, '\0'); } assert(s < buf + bufsize); *s = '\0'; if ( ! c->from_where ) c->from_where = "values"; return ConfigInfo_initFromBuffer(c, buf, -1); } ConfigInfoError ConfigInfo_initFromValues(ConfigInfo *c, ...) { const char *t; va_list vap; int nvalues = 0; const char **values = 0; ConfigInfoError error = ConfigInfoError_OK; va_start(vap, c); while ( (t = va_arg(vap, char*)) ) { nvalues ++; while ( (t = va_arg(vap, char*)) ) { nvalues ++; } nvalues ++; /* null term */ } va_end(vap); nvalues ++; /* null term */ values = malloc(sizeof(values[0]) * nvalues); va_start(vap, c); nvalues = 0; while ( (t = va_arg(vap, char*)) ) { values[nvalues ++] = t; while ( (t = va_arg(vap, char*)) ) { values[nvalues ++] = t; } values[nvalues ++] = t; } va_end(vap); values[nvalues ++] = t; error = ConfigInfo_initFromValueArray(c, values); free(values); return error; } ConfigInfoError ConfigInfo_initFromEnvironment(ConfigInfo *c, const char **env) { ConfigInfoError error = ConfigInfoError_OK; char *buf; size_t bufsize; int i; char *s; bufsize = 1; for ( i = 0; env[i]; i ++ ) { bufsize += strlen(env[i]) + 1; } if ( (buf = malloc(sizeof(buf[0]) * (bufsize + 1))) == 0 ) { return(ConfigInfoError_CannotAlloc); } c->commentBegin = c->commentEnd = 0; c->fieldSep = "="; c->recordSep = "\01"; c->maxFields = 2; for ( s = buf, i = 0; env[i]; i ++ ) { assert(s < buf + bufsize); strcpy(s, env[i]); strcat(s, c->recordSep); s = strchr(s, '\0'); } assert(s < buf + bufsize); assert(s == buf + bufsize - 1); c->from_where = "environment"; error = ConfigInfo_initFromBuffer(c, buf, bufsize); return error; } const char *ConfigInfo_ARGV0 = "*argv0*", *ConfigInfo_ARGV = "*argv*", *ConfigInfo_ARGV0_BASENAME = "*argv0-basename*"; ConfigInfoError ConfigInfo_initFromArgv(ConfigInfo *c, int argc, const char **argv, const char *opts) { char *buf; size_t bufsize; int i; char *s; const char *argv0_basename; if ( ! opts ) opts = ""; argv0_basename = (argv0_basename = strrchr(argv[0], '/')) ? argv0_basename + 1 : argv[0]; bufsize = 0; bufsize += strlen(ConfigInfo_ARGV) + 3; bufsize += strlen(ConfigInfo_ARGV0) + strlen(argv[0]) + 3; bufsize += strlen(ConfigInfo_ARGV0_BASENAME) + strlen(argv0_basename) + 3; for ( i = 0; i < argc && argv[i]; i ++ ) { bufsize += (strlen(argv[i]) + 3) * 2; } if ( (buf = malloc(sizeof(buf[0]) * (bufsize + 1))) == 0 ) { return(ConfigInfoError_CannotAlloc); } c->fieldSep = "\02"; c->recordSep = "\01"; c->commentBegin = c->commentEnd = 0; c->maxFields = 0; s = buf; strcpy(s, ConfigInfo_ARGV0); strcat(s, c->fieldSep); strcat(s, argv[0]); strcat(s, c->recordSep); s = strchr(s, '\0'); strcpy(s, ConfigInfo_ARGV0_BASENAME); strcat(s, c->fieldSep); strcat(s, argv0_basename); strcat(s, c->recordSep); s = strchr(s, '\0'); for ( i = 1; i < argc && argv[i]; i ++ ) { const char *arg = argv[i]; const char *t; assert(s < buf + bufsize); /* Does the arg start with '-'? */ if ( *arg != '-' ) break; /* It might be a switch */ /* Skip extra '-' */ arg ++; if ( *arg == '-' ) arg ++; /* Not a switch */ if ( ! *arg ) break; /* Look for "--[" ... "]" */ if ( arg[0] == '[' && arg[1] == '\0' ) { i ++; while ( i < argc && argv[i] && strcmp(argv[i], "]") != 0 ) { strcat(s, argv[i]); if ( ++ i < argc ) { strcat(s, c->fieldSep); } } } else /* Look for "--?option=value" */ if ( (t = strchr(arg, '=')) ) { strncpy(s, arg, t - arg); s += t - arg; strcpy(s, c->fieldSep); strcat(s, t + 1); } else { strcpy(s, arg); strcat(s, c->fieldSep); /* Is a a single op char? */ if ( arg[1] == '\0' && strchr(opts, arg[0]) ) { strcat(s, "1"); } else { /* Must be "--?option" "value" */ i ++; if ( i < argc && argv[i] ) { strcat(s, argv[i]); } } } strcat(s, c->recordSep); s = strchr(s, '\0'); } /* Store remaining args in *argv* */ strcpy(s, ConfigInfo_ARGV); s = strchr(s, '\0'); for ( ; i < argc && argv[i]; i ++ ) { assert(s < buf + bufsize); strcpy(s, c->fieldSep); strcat(s, argv[i]); s = strchr(s, '\0'); } strcpy(s, c->recordSep); s = strchr(s, '\0'); assert(s < buf + bufsize); c->from_where = "argv"; return ConfigInfo_initFromBuffer(c, buf, -1); } int ConfigInfo_getRowIndexForKey(ConfigInfo *c, int keyfield, const char *key, ConfigInfo **fc) { if ( fc ) { *fc = 0; } if ( key ) while ( c ) { int i; for ( i = 0; i < c->nconfigs; i ++ ) { if ( keyfield < c->nfields[i] && strcmp(c->configs[i][keyfield], key) == 0 ) { if ( fc ) *fc = c; return i; } } c = c->chain; } return -1; } const char **ConfigInfo_getRowForKey(ConfigInfo *c, int keyfield, const char *key) { ConfigInfo *fc = 0; int i = ConfigInfo_getRowIndexForKey(c, keyfield, key, &fc); if ( i >= 0 && fc ) { return (const char **) fc->configs[i]; } return 0; } const char *ConfigInfo_getValue1(ConfigInfo *c, const char *key) { if ( key && c ) { int i; int keyfield = 0; for ( i = 0; i < c->nconfigs; i ++ ) { if ( keyfield < c->nfields[i] && strcmp(c->configs[i][keyfield], key) == 0 ) { return c->configs[i][1]; } } } return 0; } const char *ConfigInfo_getValue(ConfigInfo *c, const char *key) { const char **row; return (const char *) ((row = ConfigInfo_getRowForKey(c, 0, key)) ? row[1] : 0); } const char *ConfigInfo_getValueOr(ConfigInfo *c, const char *key, const char *alt) { const char *value = ConfigInfo_getValue(c, key); return value ? value : alt; } int ConfigInfo_strToIntValue(const char *value) { if ( value ) { int c; while ( *value && isspace(*value) ) value ++; c = tolower(value[0]); if ( c == 'y' || c == 't' ) { return -1; } else if ( c == 'n' || c == 'f' ) { return 0; } else if ( *value ) { return atoi(value); } } return 0; } int ConfigInfo_strToBooleanValue(const char *str) { return ConfigInfo_strToIntValue(str); } int ConfigInfo_getIntValue(ConfigInfo *c, const char *key) { return ConfigInfo_strToIntValue(ConfigInfo_getValue(c, key)); } double ConfigInfo_getDoubleValue(ConfigInfo *c, const char *key) { const char *value; return (value = ConfigInfo_getValue(c, key)) ? atof(value) : 0; } int ConfigInfo_getBooleanValue(ConfigInfo *c, const char *key) { return ConfigInfo_strToBooleanValue(ConfigInfo_getValue(c, key)); } /*********************************************************************/ ConfigInfoError ConfigInfo_initFromDefaults(ConfigInfo *options, ConfigInfo *defaults, int argc, char **argv, char **env, ConfigInfo **configp) { ConfigInfo *config = 0; ConfigInfo *defaultConfig = 0, *envConfig = 0, *argvConfig = 0, *fileConfig = 0; static char error_buf[1024]; ConfigInfoError error = ConfigInfoError_OK; const char *opts = ConfigInfo_getValue(options, "opts"); *configp = 0; /* Config search should be Argv -> Configfile -> Env -> Defaults */ /* Defaults */ defaultConfig = defaults; /* Environment */ envConfig = ConfigInfo_MALLOC(sizeof(*envConfig)); memset(envConfig, 0, sizeof(*envConfig)); error = ConfigInfo_initFromEnvironment(envConfig, (const char **) env); if ( error != ConfigInfoError_OK ) { goto rtn; } envConfig->chain = defaults; config = envConfig; /* Config chain is now: env, defaults */ /* Argv */ argvConfig = ConfigInfo_MALLOC(sizeof(*argvConfig)); memset(argvConfig, 0, sizeof(*argvConfig)); error = ConfigInfo_initFromArgv(argvConfig, argc, (const char **) argv, opts); if ( error != ConfigInfoError_OK ) { goto rtn; } /* Config chain: argv, environment, defaults */ argvConfig->chain = envConfig; config = argvConfig; /* config file */ { const char *configfile; const char *basename; const char *template; char filename[1024]; /* Check for option configfile name override */ configfile = ConfigInfo_getValue(config, "configfile"); /* fprintf(stderr, "configfile = '%s'\n", configfile); */ if ( ! (configfile && *configfile) ) { /* Try to get the name of a config file */ basename = ConfigInfo_getValueOr(options, "configfile/basename", ConfigInfo_ARGV0_BASENAME); basename = ConfigInfo_getValueOr(config, basename, ""); template = ConfigInfo_getValueOr(options, "configfile/template", "configfile"); template = ConfigInfo_getValueOr(config, template, ""); sprintf(filename, template, basename); configfile = filename; } if ( *configfile ) { if ( ConfigInfo_getIntValue(config, "debug") ) { fprintf(stderr, "Loading config... \"%s\" ", configfile); fflush(stderr); } /* Allocate */ fileConfig = ConfigInfo_MALLOC(sizeof(*fileConfig)); memset(fileConfig, 0, sizeof(*fileConfig)); /* Fill in scanning options and defaults */ fileConfig->recordSep = ConfigInfo_getValueOr(options, "configfile/recordSep", "\n"); fileConfig->fieldSep = ConfigInfo_getValueOr(options, "configfile/fieldSep", "\t"); fileConfig->commentBegin = ConfigInfo_getValueOr(options, "configfile/commentBegin", "#"); fileConfig->commentEnd = ConfigInfo_getValueOr(options, "configfile/commentEnd", fileConfig->recordSep); fileConfig->skipLeadingWhiteSpace = ConfigInfo_strToBooleanValue(ConfigInfo_getValueOr(options, "configfile/skipLeadingWhiteSpace", "1")); fileConfig->skipTrailingWhiteSpace = ConfigInfo_strToBooleanValue(ConfigInfo_getValueOr(options, "configfile/skipTrailingWhiteSpace", "1")); fileConfig->skipBlankRecords = ConfigInfo_strToBooleanValue(ConfigInfo_getValueOr(options, "configfile/skipBlankRecords", "1")); fileConfig->maxFields = ConfigInfo_strToIntValue(ConfigInfo_getValueOr(options, "configfile/maxFields", "0")); if ( (error = ConfigInfo_initFromFile(fileConfig, configfile)) != ConfigInfoError_OK ) { sprintf(error_buf, "%s: Cannot read configfile \"%s\"\n", error, configfile); error = error_buf; goto rtn; } fileConfig->chain = envConfig; argvConfig->chain = fileConfig; config = argvConfig; /* Config chain is now: argv, configfile, environment, defaults */ if ( ConfigInfo_getIntValue(config, "debug") ) { fprintf(stderr, "done.\n"); fflush(stderr); } } } rtn: if ( error != ConfigInfoError_OK ) { ConfigInfo_free(argvConfig, 0); ConfigInfo_free(envConfig, 0); ConfigInfo_free(defaultConfig, 0); ConfigInfo_free(fileConfig, 0); config = 0; } *configp = config; return error; } /* EOF */ ll0.13/src/util/ConfigInfo.h0100644000175200017560000001133206702204465016207 0ustar stephensstephens#ifndef _ConfigInfo_h #define _ConfigInfo_h #ifndef __rcs_id__ #ifndef __rcs_id_util_ConfigInfo_h__ #define __rcs_id_util_ConfigInfo_h__ static const char __rcs_id_util_ConfigInfo_h[] = "$Id: ConfigInfo.h,v 1.4 1999/04/05 19:04:21 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include /* size_t */ #include /* FILE */ #define ConfigInfo_MALLOC(X) malloc(X) #define ConfigInfo_REALLOC(X,Y) realloc(X,Y) #define ConfigInfo_FREE(X) free(X) typedef struct ConfigInfo { /* Contains the state for a ConfigInfo node. */ /*

Configuration Data
*/ char ***configs; /* Configurations are records containing any number of fields; generally configs[i][0] is the key for finding a configuration value. */ int *nfields; /* The number of fields for a configs[i]. */ int nconfigs; /* The number of rows in configs */ void **user; /* User-row data */ /*

Memory
*/ char *buf; /* Buffer allocated for initialization; all config values are within this buffer. */ size_t bufsize; /* The size of buf. */ /*

Lexical Controls
*/ const char *commentBegin; /* The string that begins a comment. */ const char *commentEnd; /* The string that ends a comment. */ const char *fieldSep; /* The string that delimits a field. */ const char *recordSep; /* The string that delimits a record. */ int skipLeadingWhiteSpace; /* If !0, skip any leading whitespace chars. */ int skipTrailingWhiteSpace; /* If !0, skip any leading whitespace chars. */ int skipBlankRecords; /* If !0, skip any records with no fields. */ int skipHeaderRecords; /* If !0, skip this number of records at the beginning. */ int maxFields; /* Specifies the max number of fields. */ /*

Search Chain
*/ struct ConfigInfo *chain; /* The next node to search if a search failed. ConfigInfo nodes can be chained to allow different configuration sources, like command line options, environment variables, default configurations and configuration files seem like one configuration. */ /*

Initialization
*/ char *from_where; /* Where is this ConfigInfo from? */ int instance_id; /* Each ConfigInfo struct gets a unique id when initialized. Use this to determine if a configuration has been reinitialized. */ } ConfigInfo; /* */ typedef const char *ConfigInfoError; extern ConfigInfoError ConfigInfoError_OK, ConfigInfoError_CannotStat, ConfigInfoError_CannotAlloc, ConfigInfoError_CannotOpen, ConfigInfoError_CannotRead; #if 0 ConfigInfoError ConfigInfo_setUserData(ConfigInfo *c, int row, void *ptr); void *ConfigInfo_userData(ConfigInfo *c, int row, void *ptr); #endif ConfigInfoError ConfigInfo_dump(ConfigInfo *c, FILE *fp, ConfigInfo *style, int depth); ConfigInfoError ConfigInfo_destroy(ConfigInfo *c); ConfigInfoError ConfigInfo_free(ConfigInfo *c, int free_chain); ConfigInfoError ConfigInfo_initFromBuffer(ConfigInfo *c, char *buf, size_t bufsize); ConfigInfoError ConfigInfo_initFromValueArray(ConfigInfo *c, const char **values); ConfigInfoError ConfigInfo_initFromValues(ConfigInfo *c, ...); ConfigInfoError ConfigInfo_initFromFile(ConfigInfo *c, const char *file); ConfigInfoError ConfigInfo_initFromEnvironment(ConfigInfo *c, const char **env); extern const char *ConfigInfo_ARGV0, *ConfigInfo_ARGV; ConfigInfoError ConfigInfo_initFromArgv(ConfigInfo *c, int argc, const char **argv, const char *opts); int ConfigInfo_getRowIndexForKey(ConfigInfo *c, int keyfield, const char *key, ConfigInfo **cfound); const char **ConfigInfo_getRowForKey(ConfigInfo *c, int keyfield, const char *key); const char *ConfigInfo_getValue1(ConfigInfo *c, const char *key); const char *ConfigInfo_getValue(ConfigInfo *c, const char *key); /* same as ConfigInfo_getRowForKey(c, 0, key)[1] */ const char *ConfigInfo_getValueOr(ConfigInfo *c, const char *key, const char *or); /* same as ConfigInfo_getRowForKey(c, 0, key)[1] */ ConfigInfoError ConfigInfo_initFromDefaults(ConfigInfo *options, ConfigInfo *defaults, int argc, char **argv, char **env, ConfigInfo **configp); int ConfigInfo_strToIntValue(const char *str); #define ConfigInfo_strToInt ConfigInfo_strToIntValue int ConfigInfo_strToBooleanValue(const char *str); #define ConfigInfo_strToBoolean ConfigInfo_strToBooleanValue int ConfigInfo_getIntValue(ConfigInfo *c, const char *key); double ConfigInfo_getDoubleValue(ConfigInfo *c, const char *key); int ConfigInfo_getBooleanValue(ConfigInfo *c, const char *key); #endif ll0.13/src/util/Makefile0100644000175200017560000000207107034310640015445 0ustar stephensstephens# $Id: Makefile,v 1.15 2000/01/04 06:22:24 stephensk Exp $ INCLS += .. H_FILES = \ path.h \ ConfigInfo.h \ enum.h \ setenv.h \ sig.h \ signals.h \ errlist.h \ prime.h \ lockfile.h \ rc4.h \ ssprintf.h \ outbuf.h \ file.h \ host.h \ port.h C_FILES = \ path.c \ ConfigInfo.c \ enum.c \ setenv.c \ sig.c \ errlist.c \ prime.c \ lockfile.c \ rc4.c \ ssprintf.c \ outbuf.c \ file.c \ host.c \ port.c ################################################################# include $(MAKS)/pre.mak ################################################################# # Create LIB_NAME:=ionutil include $(MAKS)/lib.mak ################################################################# # Basic include $(MAKS)/basic.mak ################################################################# signals.h : sigs.pl perl sigs.pl < /usr/include/sys/signal.h > $@ ################################################################# errlist.c : errlist.pl perl errlist.pl < /usr/include/sys/errno.h > $@ ################################################################# ll0.13/src/util/Makefile.use0100644000175200017560000000012606663227126016254 0ustar stephensstephens# $Id: Makefile.use,v 1.2 1999/02/19 09:26:46 stephensk Exp $ LIBS:=ionutil $(LIBS) ll0.13/src/util/PKG0100644000175200017560000000037106714556315014371 0ustar stephensstephensNAME=util VERSION=0.4 RCS_ID="$Id: PKG,v 1.7 1999/05/07 12:30:05 stephensk Exp $" DESC="A C library with path, mem, and other functions." CHANGES_RELEASES="0.4 0.3 0.2 0.1" CATEGORY="Development Tools" REQUIRES_PKGS="../maks" REQUIRES_OTHERS="perl" ll0.13/src/util/bitset.h0100644000175200017560000000131007035332101015440 0ustar stephensstephens#ifndef BITSET_H #define BITSET_H /* $Id: bitset.h,v 1.1 2000/01/07 09:39:13 stephensk Exp $ */ /* Bitset ops. */ typedef unsigned int bitset_t; #ifndef bitset_BITS_PER_BYTE #define bitset_BITS_PER_BYTE 8 #endif #define bitset_ELEM_BSIZE (sizeof(bitset_t) * bitset_BITS_PER_BYTE) #define bitset_ELEM_LEN(S) (S / bitset_ELEM_BSIZE) #define bitset_MASK (bitset_ELEM_BSIZE-1) #define bitset_SHIFT (sizeof(bitset_t) == 4 ? 5 : 4) #define bitset_BIT(i) (1<<((i)&bitset_MASK)) #define bitset_OFF(i) ((i)>>bitset_SHIFT) #define bitset_get(bs, i) (bs[bitset_OFF(i)] & bitset_BIT(i)) #define bitset_set(bs, i) (bs[bitset_OFF(i)] |= bitset_BIT(i)) #define bitset_clr(bs, i) (bs[bitset_OFF(i)] &= ~bitset_BIT(i)) #endif ll0.13/src/util/charset.c0100644000175200017560000001073306774730670015631 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_misc_charset_c__ #define __rcs_id_misc_charset_c__ static const char __rcs_id_misc_charset_c[] = "$Id: charset.c,v 1.2 1999/09/30 18:53:44 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include /* strchr() */ #include /* isdigit(), isxdigit(), isprint(), iscntrl() */ #include "charset.h" #define PUTC(x) (*(s ++) = (x)) #define GETC() (*s ? *(s ++) : -1) #define PEEKC() (*s ? *s : -1) #define UNGETC(c) (*(-- s)) #define MATCHC(X) ({ if ( PEEKC() != (X) ) goto SYNTAX_ERROR; GETC(); }) #define PEEKCMATCHC(X) (PEEKC() == (X) ? (GETC(), 1) : 0) static const char escape_chars[] = "n\nr\rt\tf\fb\ba\av\ve\033"; int getc_escaped(char **_s) { unsigned char *s = (unsigned char *)*_s; int c; c = GETC(); if ( c == '\\' ) { const char *r; c = GETC(); if ( (r = strchr(escape_chars, c)) && ((r - escape_chars) % 2 == 0) ) { c = r[1]; } else if ( '0' <= c && c <= '7' ) { /* \012 -> \n */ int n = c; int ndigits = 0; c = 0; do { c <<= 3; c += n - '0'; ndigits ++; } while ( ndigits < 3 && (n = PEEKC(), '0' <= n && n <= '7' && GETC()) ); } else if ( tolower(c) == 'x' ) { /* \xff -> 0xff */ int n; int ndigits = 0; c = 0; while ( ndigits < 2 && (n = PEEKC(), isxdigit(n) && GETC()) ) { c <<= 4; c += isdigit(n) ? n - '0' : 'a' <= n && n <= 'f' ? n - 'a' + 10 : n - 'A' + 10; ndigits ++; } if ( ! ndigits ) { goto SYNTAX_ERROR; } } else if ( tolower(c) == 'c' ) { /* \cC -> Control-C */ c = GETC(); c &= 0x1F; /* leave bottom 5 bits */ } if ( c < 0 || c >= (UCHAR_MAX+1) ) { return -2; } } *_s = (char*) s; return c; SYNTAX_ERROR: *_s = (char*) s; return -2; } #define GETC_ESCAPED() ({ int c = getc_escaped((char **)&s); if ( c < 0 ) goto SYNTAX_ERROR; c; }) int putc_escaped(char **_s, int i) { char *s = *_s; char *r; if ( isprint(i) && isascii(i) && ! iscntrl(i) ) { PUTC(i); } else if ( (r = strchr(escape_chars, i)) && ((r - escape_chars) % 2 == 1) ) { PUTC('\\'); PUTC(r[-1]); } else { PUTC('\\'); PUTC(((i >> 6) & 0x7) + '0'); PUTC(((i >> 3) & 0x7) + '0'); PUTC(((i >> 0) & 0x7) + '0'); } *_s = (char*) s; return 0; } int charset_compile(charset *cs, char **_s) { unsigned char *s = (unsigned char*) *_s; short invert = 0; int c; charset_CLEAR(*cs); MATCHC('['); invert = PEEKCMATCHC('^'); while ( (c = PEEKC()) >= 0 && c != ']' ) { c = GETC_ESCAPED(); charset_SET(cs,c); if ( PEEKCMATCHC('-') ) { int oc = GETC_ESCAPED(); if ( c > oc ) { int t; t = c; c = oc; oc = t; } while ( c <= oc ) { charset_SET(cs,c); c ++; } } } MATCHC(']'); if ( invert ) { charset_INVERT(cs); } *_s = (char*) s; return 0; SYNTAX_ERROR: *_s = (char*) s; return -2; } int charset_print(charset *cs, char **_s) { char *s = *_s; int i, j; int invert; PUTC('['); if ( (invert = charset_MATCH(cs,(UCHAR_MAX+1))) ) { PUTC('^'); charset_INVERT(cs); /* Temporarly invert */ } for ( i = 0; i < (UCHAR_MAX+1); i ++ ) { if ( charset_MATCH(cs,i) ) { if ( i == '^' || i == '-' ) { PUTC('\\'); PUTC(i); } else { putc_escaped(&s, i); } for ( j = i + 1; j < (UCHAR_MAX+1); j ++ ) { if ( ! charset_MATCH(cs,j) ) break; } if ( j - i > 3 ) { i = j - 1; PUTC('-'); putc_escaped(&s, i); } } } if ( invert ) { charset_INVERT(cs); /* revert */ } PUTC(']'); *_s = (char*) s; return 0; } #undef GETC #undef PEEKC #undef UNGETC #undef MATCHC #undef PEEKCMATCHC #undef GETC_ESCAPED #ifdef TEST int main(int argc, char **argv) { int i; /* printf("sizeof(charset) = %d\n", (int) sizeof(charset)); */ for ( i = 1; i < argc; i ++ ) { char *t; if ( strcmp(argv[i], "-e") == 0 ) { i ++; for ( t = argv[i]; *t; ) { int c; unsigned char *s = t; c = getc_escaped(&t); printf("%s -> %d\n", s, c); } } else if ( strcmp(argv[i], "-c") == 0 ) { i ++; for ( t = argv[i]; *t; ) { unsigned char *s = t; charset cs; char buf[1024], *b = buf; if ( charset_compile(&cs,&t) < 0 ) { printf("syntax error at %s in %s\n", t, s); } else { charset_print(&cs,&b); } printf("%s -> %s\n", s, buf); } } } return 0; } #endif ll0.13/src/util/charset.h0100644000175200017560000000165706707533613015635 0ustar stephensstephens#ifndef _charset_h #ifndef __rcs_id__ #ifndef __rcs_id_misc_charset_h__ #define __rcs_id_misc_charset_h__ static const char __rcs_id_misc_charset_h[] = "$Id: charset.h,v 1.1 1999/04/22 05:45:47 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _charset_h #ifndef BITS_PER_CHAR #define BITS_PER_CHAR 8 #endif #ifndef UCHAR_MAX #define UCHAR_MAX 255 #endif typedef unsigned char charset[(UCHAR_MAX+1+1+BITS_PER_CHAR-1)/BITS_PER_CHAR]; #define charset_CLEAR(cs) bzero(cs, sizeof(charset)) #define charset_SET(cs,x) ((*(cs))[(x)/BITS_PER_CHAR]|=(1<<((x)%BITS_PER_CHAR))) #define charset_MATCH(cs,x) ((*(cs))[(x)/BITS_PER_CHAR]&(1<<((x)%BITS_PER_CHAR))) #define charset_INVERT(cs) do { \ int i; \ for ( i = 0; i < sizeof(charset); i ++ ) (*(cs))[i] ^= ~ 0; \ } while(0) int getc_escaped(char **_s); int putc_escaped(char **_s, int i); int charset_compile(charset *cs, char **_s); int charset_print(charset *cs, char **_s); #endif ll0.13/src/util/enum.c0100644000175200017560000000655607037355513015144 0ustar stephensstephens/* Copyright (c) 1998, 1999 Kurt A. Stephens and Ion, Inc. */ #ifndef __rcs_id__ #ifndef __rcs_id_util_enum_c__ #define __rcs_id_util_enum_c__ static const char __rcs_id_util_enum_c[] = "$Id: enum.c,v 1.8 2000/01/13 14:03:55 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "enum.h" #include #include #include int C_enum_str_to_value(const C_enum *table, const char *name, size_t name_len, long *result) { int i; if ( ! name ) return 0; if ( name_len == (size_t) -1 ) name_len = strlen(name); for ( i = 0; table[i].name; i ++ ) { if ( strncmp(table[i].name, name, name_len) == 0 && table[i].name[name_len] == '\0' ) { *result = table[i].value; return 1; } } return 0; } int C_enum_str_to_or_value(const C_enum *table, const char *name, size_t name_len, long *resultp) { long result = 0; const char *s; const char *e; if ( ! name ) return 0; if ( name_len == (size_t) -1 ) name_len = strlen(name); s = name; e = name + name_len; while ( s < e ) { long eresult = 0; const char *t; /* Scan for '|' or end of s */ for ( t = s; t != e; ++ t ) { if ( *t == '|' ) { break; } } if ( C_enum_str_to_value(table, s, t - s, &eresult) ) { result |= eresult; } else { return 0; } s = t + 1; } *resultp = result; return 1; } const char * C_enum_value_to_str(const C_enum *table, long value) { int i; for ( i = 0; table[i].name; ++ i ) { if ( table[i].value == value ) { return table[i].name; } } return 0; } const char * C_enum_or_value_to_str(const C_enum *table, long value, char *buf, size_t buf_len) { if ( value == 0 ) { /* There might be an enum of 0! */ return C_enum_value_to_str(table, value); } else { int i; /* table[i] */ char *bp; /* Current buf write position. */ int new_buf; /* Was the buf allocated by us? */ /* Calculate buf_len if not specified. */ if ( ! buf_len ) { buf_len = table[i].name ? strlen(table[i].name) + 1 : 16; } /* Allocate buffer if not specified. */ if ( ! buf ) { new_buf = 1; buf = malloc(buf_len); } else { new_buf = 0; } /* Initialize buffer and buffer pointer. */ buf[0] = '\0'; bp = buf; /* While value still has bits: */ while ( value ) { for ( i = 0; table[i].name; ++ i ) { /* If value has enum value's bits? */ if ( (value & table[i].value) == table[i].value ) { size_t len = (bp - buf); size_t name_len = strlen(table[i].name); size_t new_len = len + name_len + 2; /* Resize buffer if possible. */ if ( new_len > buf_len ) { if ( new_buf ) { buf = realloc(buf, new_len); bp = buf + len; } else { /* Buffer to small! */ return 0; } } /* Append trailing '|'. */ if ( buf[0] ) { *(bp ++) = '|'; } /* Append table[i].name. */ { const char *s = table[i].name; while ( *s ) { *(bp ++) = *(s ++); } } /* Remove enum value bits from value. */ value &= ~table[i].value; /* Try more values. */ goto next_value; } /* Try next enum value. */ } /* An enum value for values bits was not found. */ return 0; /* ERROR */ next_value: /* Try more values. */ (void) 0; } *bp = '\0'; return buf; } } ll0.13/src/util/enum.h0100644000175200017560000000142607037354763015146 0ustar stephensstephens/* Copyright (c) 1998, 1999 Kurt A. Stephens and Ion, Inc. */ #ifndef _util_enum_h #define _util_enum_h #ifndef __rcs_id__ #ifndef __rcs_id_util_enum_h__ #define __rcs_id_util_enum_h__ static const char __rcs_id_util_enum_h[] = "$Id: enum.h,v 1.7 2000/01/13 13:58:11 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include /* size_t */ typedef struct C_enum { const char *name; long value; } C_enum; int C_enum_str_to_value(const C_enum *table, const char *name, size_t name_len, long *result); int C_enum_str_to_or_value(const C_enum *table, const char *name, size_t name_len, long *resultp); const char * C_enum_value_to_str(const C_enum *table, long value); const char * C_enum_or_value_to_str(const C_enum *table, long value, char *buf, size_t buf_len); #endif ll0.13/src/util/errlist.h0100644000175200017560000000027007037332567015660 0ustar stephensstephens#ifndef _util_errlist_h #define _util_errlist_h #include #ifndef Linux #ifndef NeXT extern const char * const sys_errlist[]; extern int sys_nerr; #endif #endif #endif ll0.13/src/util/errlist.pl0100644000175200017560000000125407005436061016034 0ustar stephensstephens#!/bin/perl # $Id: errlist.pl,v 1.6 1999/10/26 23:41:37 stephensk Exp $ @errs = (); while ( <> ) { #print; if ( m@^\s*#define\s+E(\w+)\s+([0-9]+)(\s+/\*\s*(.*)\s*(\*/))?@ ) { $name = $1; $err = $2; $comment = $4; $comment =~ s/\s+$//g; $errs[$err] = $comment; } } print "/* DO NOT MODIFY! Generated by $0 ", join(" ", @ARGV), " */\n"; print "#ifndef sun\n"; print "#ifndef NeXT\n"; print "const char *sys_errlist[] = {\n"; foreach $err ( 0 .. $#errs ) { if ( ! $errs[$err] ) { $errs[$err] = "Error $err"; } print '"', $errs[$err], '", ', "\n"; } print " 0\n};\n"; print "int sys_nerr = ", $#errs + 1, ";\n"; print "#endif\n"; print "#endif\n"; 1; ll0.13/src/util/file.h0100644000175200017560000000237407236200232015102 0ustar stephensstephens#ifndef _util_file_h #define _util_file_h #ifndef __rcs_id__ #ifndef __rcs_id_util_file_h__ #define __rcs_id_util_file_h__ static const char __rcs_id_util_file_h[] = "$Id: file.h,v 1.4 2001/02/01 06:22:18 ion Exp $"; #endif #endif /* __rcs_id__ */ #ifdef __cplusplus extern "C" { #endif #include /* FILE */ #include /* time_t */ time_t file_mtime(const char *fname); size_t file_size(const char *file); typedef long pos_t; int file_touch(const char *file); int file_mode_masked(const char *fname, int euid, int egid); int file_executable(const char *fname); int file_in_path(const char *argv, const char *PATH, char *buf); char *FILE_get_line_at_pos(FILE *fp, int linesize, pos_t pos, size_t *lenp, pos_t *line_pos); int FILE_print_line_at_pos(FILE *fp, int linesize, pos_t pos, pos_t *line_pos, FILE *out); int file_print_line_at_pos(const char *file, int linesize, pos_t pos, pos_t *line_pos, FILE *out); char *FILE_read_from_end(FILE *file, size_t *buflenp, pos_t *posp); char *file_read_from_end(const char *file, size_t *buflenp, pos_t *bufposp); char *FILE_get_line_at_end(FILE *fp, size_t *bufsize, pos_t *lineposp); char *file_get_line_at_end(const char *file, size_t *bufsize, pos_t *lineposp); #ifdef __cplusplus } #endif #endif ll0.13/src/util/host.c0100644000175200017560000000213107034310640015123 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_util_host_c__ #define __rcs_id_util_host_c__ static const char __rcs_id_util_host_c[] = "$Id: host.c,v 1.2 2000/01/04 06:22:24 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "host.h" #include #include /* MAXHOSTNAMELEN */ int hostname_matches_hostent(const char *h, const struct hostent *he) { int i; if ( strcmp(h, he->h_name) == 0 ) return 1; for ( i = 0; he->h_aliases[i]; i ++ ) { if ( strcmp(h, he->h_aliases[i]) == 0 ) return 1; } return 0; } int hostname_matches_hostname(const char *h1, const char *h2) { struct hostent *he1, *he2; char hostname[MAXHOSTNAMELEN + 1]; if ( ! (h1 && *h1) ) { if ( gethostname(hostname, sizeof(hostname)) ) return 0; h1 = hostname; } if ( ! (h2 && *h2) ) { if ( gethostname(hostname, sizeof(hostname)) ) return 0; h2 = hostname; } if ( strcmp(h1, h2) == 0 ) return 1; if ( ! (he1 = gethostbyname(h1)) ) return 0; if ( ! (he2 = gethostbyname(h2)) ) return 0; return strcmp(he1->h_name, he2->h_name) == 0; } ll0.13/src/util/host.h0100644000175200017560000000051707034312207015137 0ustar stephensstephens/* $Id: host.h,v 1.3 2000/01/04 06:34:47 stephensk Exp $ */ #ifndef _util_host_h #define _util_host_h #include #ifdef __cplusplus extern "C" { #endif int hostname_matches_hostent(const char *h, const struct hostent *he); int hostname_matches_hostname(const char *h1, const char *h2); #ifdef __cplusplus } #endif #endif ll0.13/src/util/lockfile.c0100644000175200017560000001322607034310640015745 0ustar stephensstephens/* $Id: lockfile.c,v 1.6 2000/01/04 06:22:24 stephensk Exp $ */ #include "lockfile.h" #include #include #include #include #include #include #include #include #include #include #include #include "errlist.h" #ifdef MEMDEBUG #include "memdebug/memdebug.h" #endif /* NOT THREAD-SAFE */ const char *lockfile_progname = ""; /* The program name for lockfile contents. */ /* A lockfile list entry. */ typedef struct lockfile_stat { struct lockfile_stat *next; char *file; int locks; } lockfile_stat; /* A list of lockfiles aquired by this process. */ static lockfile_stat *lockfile_stats; /* Has lockfile_atexit been installed into atexit? */ static int lockfile_atexit_installed; void lockfile_release_all() { lockfile_stat *l = lockfile_stats; while ( l ) { lockfile_stat *ln = l->next; unlink(l->file); free(l->file); free(l); l = ln; } } int lockfile_unlock_at_exit = 1; void lockfile_atexit() { if ( lockfile_unlock_at_exit ) { lockfile_release_all(); } } static void lockfile_stat_add(const char *file) { lockfile_stat *l; l = malloc(sizeof(*l)); l->file = strcpy(malloc(strlen(file) + 1), file); l->locks = 1; l->next = lockfile_stats; lockfile_stats = l; /* Install an atexit handler to unaquire all lockfiles this process has created. */ if ( ! lockfile_atexit_installed ) { lockfile_atexit_installed ++; atexit(lockfile_atexit); } } static lockfile_stat **lockfile_stat_find(const char *file) { lockfile_stat **l = &lockfile_stats; while ( *l ) { if ( strcmp(file, (*l)->file) == 0 ) { return l; } l = &((*l)->next); } return 0; } int lockfile_mode = 0666; /* The error handler. */ int lockfile_error_default(const char *file, const char *msg) { fprintf(stderr, "lockfile '%s': %s\n", file, msg); return 0; } int (*lockfile_error)(const char *file, const char *msg) = lockfile_error_default; int lockfile_acquire(const char *file, int retries, int wait) { lockfile_stat **l; int rtnval = 0; int nretries = 0; if ( retries < 0 ) { retries = 10; } if ( wait < 0 ) { wait = 60; } /* Has this process already acquired the lockfile? */ if ( (l = lockfile_stat_find(file)) ) { /* Increment lock count. */ (*l)->locks ++; /* Success. */ return 0; } else { int fd; char buf[1024]; int lockfile_read = 0; char msg[1024]; int broke_lock = 0; buf[0] = '\0'; while ( 1 ) { /* Attempt to create the file atomically. */ fd = open(file, O_RDWR|O_CREAT|O_EXCL, 0666); if ( fd < 0 ) { /* Couldn't create the file atomically. */ /* It already existed and was not created by our process id. */ if ( errno == EEXIST ) { /* Read the contents of the lockfile for the error msg. */ if ( ! lockfile_read ) { size_t rlen; fd = open(file, O_RDONLY); rlen = read(fd, buf, sizeof(buf) - 1); /* Remove newline. */ if ( rlen > 0 && rlen != (size_t) -1 ) buf[rlen - 1] = '\0'; close(fd); lockfile_read = 1; sprintf(msg, "acquired by '%s'", buf); if ( (rtnval = lockfile_error(file, msg)) ) return rtnval; } /* Sleep if retries are left. */ if ( -- retries > 0 ) { nretries ++; if ( nretries == 1 ) { sprintf(msg, "sleeping for %d secs for %d times", wait, retries + 1); if ( (rtnval = lockfile_error(file, msg)) ) return rtnval; } /* Sleep for a while then retry */ sleep(wait); } /* If out of retries, attempt to break the lock. */ if ( retries <= 0 ) { if ( ! broke_lock ) { if ( (rtnval = lockfile_error(file, "attempting to break lock")) ) return rtnval; /* Attempt one retry after breaking the lock. */ broke_lock ++; retries = 1; unlink(file); } else { /* Out of retries. */ if ( (rtnval = lockfile_error(file, "giving up")) ) return rtnval; /* Failure! */ return -1; } } } else { /* Failed to create the lockfile for some other reason. */ sprintf(msg, "cannot create: %s", sys_errlist[errno]); if ( (rtnval = lockfile_error(file, msg)) ) return rtnval; /* Failure! */ return -1; } } else { /* Fill the lockfile with hostname, username, programname, and process id */ char hostname[64]; char username[64]; struct passwd *pw; strcpy(hostname, "localhost"); gethostname(hostname, sizeof(hostname) - 1); strcpy(username, ""); if ( (pw = getpwuid(geteuid())) ) { memset(username, 0, sizeof(username)); strncpy(username, pw->pw_name, sizeof(username) - 1); } sprintf(buf, "%s %s %s %d\n", hostname, username, lockfile_progname, getpid()); write(fd, buf, strlen(buf)); /* Add it to our process's list of lockfiles */ lockfile_stat_add(file); close(fd); /* Chmod to default mode */ chmod(file, lockfile_mode); /* Success! */ return 0; } } } } int lockfile_release(const char *file) { lockfile_stat **lp; /* Has this process acquired the lockfile? */ if ( (lp = lockfile_stat_find(file)) ) { lockfile_stat *l = *lp; /* Decrement lock count. */ if ( -- l->locks == 0 ) { lockfile_stat *ln = l->next; /* Delete the lockfile. */ unlink(l->file); /* Free and remove the lockfile list entry. */ free(l->file); free(l); *lp = ln; } } else { int rtnval; /* This process has not acquired the lockfile, so it cannot release it. */ if ( (rtnval = lockfile_error(file, "not acquired")) ) return rtnval; return -1; } return 0; } ll0.13/src/util/lockfile.h0100644000175200017560000000141506727377373015777 0ustar stephensstephens#ifndef _util_lockfile_h #define _util_lockfile_h /* $Id: lockfile.h,v 1.3 1999/06/09 05:43:23 stephensk Exp $ */ /* Options */ extern const char *lockfile_progname; extern int lockfile_mode; /* Lockfile creation perms */ extern int lockfile_unlock_at_exit; /* Release lockfiles at exit? */ /* Error handling. */ extern int (*lockfile_error)(const char *file, const char *msg); int lockfile_error_default(const char *file, const char *msg); /* Prints "lockfile '': " to stderr; returns 0. */ /* Acquire/Release. */ int lockfile_acquire(const char *file, int retries, int wait); int lockfile_release(const char *file); /* Release all lockfiles. */ void lockfile_release_all(); void lockfile_atexit(); /* lockfile_release_all() if lockfile_unlock_at_exit. */ #endif ll0.13/src/util/lockfile_main.c0100644000175200017560000000166506727377403016777 0ustar stephensstephens/* $Id: lockfile_main.c,v 1.1 1999/06/09 05:43:31 stephensk Exp $ */ #include "lockfile.h" #include #include #include #include int main(int argc, char **argv) { int errors = 0; int i; lockfile_progname = argv[0]; lockfile_unlock_at_exit = 0; switch ( argv[1] && argv[1][0] == '-' ? argv[1][1] : 0 ) { case 'l': case 'a': for ( i = 2; i < argc; i ++ ) { if ( lockfile_acquire(argv[i], 60, 10) ) { errors ++; } } break; case 'u': case 'r': for ( i = 2; i < argc; i ++ ) { if ( unlink(argv[i]) ) { fprintf(stderr, "%s: cannot unlink: '%s'\n", argv[0], argv[i]); errors ++; } } break; default: fprintf(stderr, "%s: bad option: '%s'\n", argv[0], argv[1]); errors ++; /* FALL THROUGH */ case 'h': case '?': fprintf(stderr, "%s: USAGE: %s [-lock|-unlock] files...\n", argv[0], argv[0]); break; } return errors; } ll0.13/src/util/mem.c0100644000175200017560000000611206663227127014745 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_util_mem_c__ #define __rcs_id_util_mem_c__ static const char __rcs_id_util_mem_c[] = "$Id: mem.c,v 1.2 1999/02/19 09:26:47 stephensk Exp $"; #endif #endif /* __rcs_id__ */ /* ** Unrolled memcpy */ void memcpy_fast(char *_dst, const char *_src, unsigned int _len) { if ( _len == 0 ) return; #define MEMSET_4() *(long*)_dst = *(long*)_src; _dst += sizeof(long); _src += sizeof(long) #define MEMSET_1() *(_dst ++) = *(_src ++) /* Align to 4 dword */ switch ( ((unsigned int) _dst) & 3 ) { case 1: if ( _len -- <= 0 ) return; MEMSET_1(); case 2: if ( _len -- <= 0 ) return; MEMSET_1(); case 3: if ( _len -- <= 0 ) return; MEMSET_1(); } /* Do blocks of 64 bytes */ while ( _len >= 64 ) { MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); _len -= 64; } /* Do remaining dwords */ switch ( _len / 4 ) { case 16: MEMSET_4(); case 15: MEMSET_4(); case 14: MEMSET_4(); case 13: MEMSET_4(); case 12: MEMSET_4(); case 11: MEMSET_4(); case 10: MEMSET_4(); case 9: MEMSET_4(); case 8: MEMSET_4(); case 7: MEMSET_4(); case 6: MEMSET_4(); case 5: MEMSET_4(); case 4: MEMSET_4(); case 3: MEMSET_4(); case 2: MEMSET_4(); case 1: MEMSET_4(); case 0: break; } /* Do remaining bytes */ switch ( _len & 3 ) { case 3: MEMSET_1(); case 2: MEMSET_1(); case 1: MEMSET_1(); case 0: break; } #undef MEMSET_4 #undef MEMSET_1 } /* ** Unrolled memset */ void memset_fast(unsigned char *_dst, int val, unsigned int _len) { unsigned long _val; if ( _len == 0 ) return; _val = val; _val |= _val << 8 | _val << 16 | _val << 24; #define MEMSET_4() (* ((unsigned long*) _dst)) = _val; _dst += sizeof(unsigned long) #define MEMSET_1() *(_dst ++) = _val; /* Align to 4 dword */ switch ( ((unsigned int) _dst) & 3 ) { case 1: if ( _len -- <= 0 ) return; MEMSET_1(); case 2: if ( _len -- <= 0 ) return; MEMSET_1(); case 3: if ( _len -- <= 0 ) return; MEMSET_1(); } /* Do blocks of 64 bytes */ while ( _len >= 64 ) { MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); MEMSET_4(); _len -= 64; } /* Do remaining dwords */ switch ( _len / 4 ) { case 16: MEMSET_4(); case 15: MEMSET_4(); case 14: MEMSET_4(); case 13: MEMSET_4(); case 12: MEMSET_4(); case 11: MEMSET_4(); case 10: MEMSET_4(); case 9: MEMSET_4(); case 8: MEMSET_4(); case 7: MEMSET_4(); case 6: MEMSET_4(); case 5: MEMSET_4(); case 4: MEMSET_4(); case 3: MEMSET_4(); case 2: MEMSET_4(); case 1: MEMSET_4(); case 0: break; } /* Do remaining bytes */ switch ( _len & 3 ) { case 3: MEMSET_1(); case 2: MEMSET_1(); case 1: MEMSET_1(); case 0: break; } #undef MEMSET_4 #undef MEMSET_1 } ll0.13/src/util/mem.h0100644000175200017560000000107706735700336014755 0ustar stephensstephens/* Copyright (c) 1998, 1999 Kurt A. Stephens and Ion, Inc. */ #ifndef _util_mem_h #define _util_mem_h #ifndef __rcs_id__ #ifndef __rcs_id_util_mem_h__ #define __rcs_id_util_mem_h__ static const char __rcs_id_util_mem_h[] = "$Id: mem.h,v 1.5 1999/06/28 14:04:14 stephensk Exp $"; #endif #endif /* __rcs_id__ */ void memcpy_fast(void *, const void *, unsigned int); void memset_fast(void *, int, unsigned int); #ifdef memcpy #undef memcpy #endif #define memcpy(x,y,z) memcpy_fast(x,y,z) #ifdef memset #undef memset #endif #define memset(x,y,z) memset_fast(x,y,z) #endif ll0.13/src/util/midi.h0100644000175200017560000000352307001140704015077 0ustar stephensstephens /* NAME, CODE, BYTES, PATTERN, COMMENT */ MIDI(NOTE_OFF, "\x80\x00\x00", 3, "1000cccc 0nnnnnnn 0vvvvvvv", "") MIDI(NOTE_ON, "\x90\x00\x00", 3, "1001cccc 0nnnnnnn 0vvvvvvv", "") MIDI(KEY_PRESSURE, "\xA0\x00\x00", 3, "1010cccc 0nnnnnnn 0aaaaaaa", "") MIDI(CONTROL_CNG, "\xB0\x00\x00", 3, "1011cccc 0xxxxxxx 0yyyyyyy", "") MIDI(CC_RESET, "\xB0\x79\x00", 3, "1011cccc", "") MIDI(LOCAL_CNTRL, "\xB0\x7A\x00", 3, "1011cccc @@@@@@@@ 0xxxxxxx", "") MIDI(ALL_NOTES_OFF, "\xB0\x7B\x00", 3, "1011cccc", "") MIDI(OMNI_MODE_OFF, "\xB0\x7C\x00", 3, "1011cccc", "") MIDI(OMNI_MODE_ON, "\xB0\x7D\x00", 3, "1011cccc", "") MIDI(MONO_MODE_ON, "\xB0\x7E\x00", 3, "1011cccc @@@@@@@@ 0vvvvvvv", "") MIDI(POLY_MODE_ON, "\xB0\x7F\x00", 3, "1011cccc", "") MIDI(PROGRAM_CNG, "\xC0", 2, "1100cccc 0ppppppp", "") MIDI(CH_PRESSURE, "\xD0", 2, "1101cccc 0aaaaaaa", "") MIDI(PITCHBEND, "\xE0", 3, "1110cccc 0xxxxxxx 0XXXXXXX", "") MIDI(SYSEX, "\xF0", MIDI_EOX(), "11110000 ...", "") MIDI(MTC_1_4th, "\xF1", "") MIDI(SONG_PTR, "\xF2\x00\x00", 3, "11110010 0xxxxxxx 0XXXXXXX", "") MIDI(SONG_SEL, "\xF3\x00", 2, "11110011 0xxxxxxx", "") MIDI(UNDEF1, "\xF4", "") MIDI(UNDEF2, "\xF5", "") MIDI(TUNE_REQ, "\xF6", "") MIDI(EOX, "\xF7", "") MIDI(TIMING_CLK, "\xF8", 1, "") MIDI(UNDEF3, "\xF9", "") MIDI(START, "\xFA", 1, "") MIDI(CONTINUE, "\xFB", 1, "") MIDI(STOP, "\xFC", 1, "") MIDI(UNDEF4, "\xFD", "") MIDI(ACTIVE_SENSING, "\xFE", 1, "") MIDI(SYS_RESET, "\xFF", 1, "") ll0.13/src/util/outbuf.c0100644000175200017560000000345507034310640015464 0ustar stephensstephens/* $Id: outbuf.c,v 1.3 2000/01/04 06:22:24 stephensk Exp $ */ #include "outbuf.h" #include #ifdef MEMDEBUG #include "memdebug/memdebug.h" #endif #include /* memmove */ int outbuf_write(outbuf *ob, const void *buf, size_t size) { int rtn = 0; if ( ! ob ) return -1; if ( ! size ) return 0; if ( ! buf ) return -1; /* allocate buffer */ if ( ! ob->buf ) { if ( ob->size < size ) ob->size = size; ob->buf = malloc(ob->size + 1); /* resize buffer? */ } else if ( ob->size < ob->len + size ) { ob->size = ob->len + size; ob->buf = realloc(ob->buf, ob->size + 1); } /* Append to buffer */ memcpy(ob->buf + ob->len, buf, size); ob->len += size; ob->buf[ob->len] = '\0'; return rtn; } int outbuf_flush(outbuf *ob) { int rtn = 0; if ( ! ob ) return 0; /* nothing to flush */ if ( ! ob->len ) return 0; /* nothing to flush */ /* Don't call flush recursively */ if ( ! ob->flushing ) { ob->flushing ++; if ( ob->flush ) { /* Make a copy of the buffer to allow re-entry into ob_write(), during ob->flush() */ size_t oblen = ob->len; char *buf_copy = malloc(ob->len + 1); memcpy(buf_copy, ob->buf, ob->len + 1); if ( ! (rtn = (ob->flush)(ob, buf_copy, ob->len)) ) { /* Remove flushed portion from front */ size_t l = ob->len - oblen; memmove(ob->buf, ob->buf + oblen, l); ob->len = l; ob->buf[ob->len] = '\0'; ob->failed_flush = 0; } else { ob->failed_flush ++; } free(buf_copy); } ob->flushing --; } return rtn; } int outbuf_destroy(outbuf *ob) { int rtn = 0; if ( ! ob ) return 0; if ( ob->destroy ) { if ( ! (rtn = ob->destroy(ob)) ) return rtn; } if ( ob->buf ) { free(ob->buf); ob->buf = 0; } return rtn; } ll0.13/src/util/outbuf.h0100644000175200017560000000132606774730270015503 0ustar stephensstephens/* $Id: outbuf.h,v 1.2 1999/09/30 18:49:28 stephensk Exp $ */ #ifndef _util_outbuf_h #define _util_outbuf_h #include /* size_t */ typedef struct outbuf { int (*flush)(struct outbuf *ob, void *buf, size_t size); /* flush method. Can modify buf. */ int (*destroy)(struct outbuf *ob); /* destroy method. */ void *data[4]; /* user data. */ char *buf; /* the buffered data. */ size_t len; /* length of current buf contents. */ size_t size; /* size of buf. */ int failed_flush; /* no. of failed flush ops. */ int flushing; /* currently flushing? */ } outbuf; int outbuf_write(outbuf *ob, const void *buf, size_t size); int outbuf_flush(outbuf *ob); int outbuf_destroy(outbuf *ob); #endif ll0.13/src/util/path.c0100644000175200017560000000506106735700336015123 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_util_path_c__ #define __rcs_id_util_path_c__ static const char __rcs_id_util_path_c[] = "$Id: path.c,v 1.5 1999/06/28 14:04:14 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "util/path.h" #include #include const char *path_sep = "/"; const char *path_cwd = "."; const char *path_file(const char *p) { const char *s; s = strrchr(p, path_sep[0]); if ( s ) { s ++; } else { s = p; } return s; } const char *path_dir(const char *p, char *buf) { const char *s; s = strrchr(p, path_sep[0]); if ( s ) { const char *r = p; char *t = buf; while ( r < s ) { *(t ++) = *(r ++); } *t = '\0'; } else { strcpy(buf, path_cwd); } return buf; } const char *path_absolute(const char *p, char *buf) { if ( p[0] == path_sep[0] ) { return p; } else { strcpy(buf, path_cwd); if ( ! strrchr(buf, path_sep[0]) ) { strcat(buf, path_sep); } strcat(buf, p); return buf; } } const char *path_suffix(const char *p) { const char *s; s = strrchr(path_file(p), '.'); return s; } const char *path_no_suffix(const char *p, char *buf) { const char *s; s = path_suffix(p); if ( s ) { strncpy(buf, p, s - p); buf[s - p] = '\0'; return buf; } else { return p; } } char *path_simplify(const char *p, char *buf) { const char *s; char *t; t = buf; s = p; while ( *s ) { /* replace "//" with "/" */ if ( s[0] == path_sep[0] && s[1] == path_sep[0] ) { s ++; } else /* replace "./" with "" */ if ( (s == p || s[-1] == path_sep[0]) && s[0] == '.' && s[1] == path_sep[0] ) { s += 2; } else { *(t ++) = *(s ++); } } *t = '\0'; /* replace "//../" where != ".." with "" */ t = buf; s = buf; while ( *s ) { if ( s[0] == path_sep[0] && s[1] == '.' && s[2] == '.' && s[3] == path_sep[0] ) { if ( s - buf >= 3 && ! ( s[-3] == path_sep[0] && s[-2] == '.' && s[-1] == '.' ) ) { t = (char*) s - 1; s += 3; while ( t > buf && *t != path_sep[0] ) { t --; } } else { *(t ++) = *(s ++); *(t ++) = *(s ++); } } *(t ++) = *(s ++); } *t = '\0'; return buf; } const char *path_2_dos(const char *s, char *buf) { char *p = buf; if ( s[0] == path_sep[0] && s[1] == path_sep[0] && isalpha(s[2]) && s[3] == path_sep[0] ) { *(p ++) = toupper(s[2]); *(p ++) = ':'; *(p ++) = '\\'; s += 4; } while ( *s ) { *(p ++) = *s == path_sep[0] ? '\\' : toupper(*s); s ++; } *p = '\0'; return buf; } ll0.13/src/util/path.h0100644000175200017560000000121306663227127015125 0ustar stephensstephens#ifndef _util_path_h #ifndef __rcs_id__ #ifndef __rcs_id_util_path_h__ #define __rcs_id_util_path_h__ static const char __rcs_id_util_path_h[] = "$Id: path.h,v 1.2 1999/02/19 09:26:47 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _util_path_h extern const char *path_sep; /* defaults to "/" */ extern const char *path_cwd; /* defaults to "." */ const char *path_file(const char *s); const char *path_dir(const char *s, char *buf); const char *path_absolute(const char *s, char *buf); const char *path_suffix(const char *s); const char *path_no_suffix(const char *s, char *buf); const char *path_2_dos(const char *s, char *buf); #endif ll0.13/src/util/port.c0100644000175200017560000000161007034310640015133 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_util_port_c__ #define __rcs_id_util_port_c__ static const char __rcs_id_util_port_c[] = "$Id: port.c,v 1.2 2000/01/04 06:22:24 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "port.h" #include #include #include #include int port_by_name(const char *port, const char *proto) { if ( isdigit(*port) ) { return atoi(port); } else { struct servent *se; char service[64]; if ( ! (proto && *proto) ) { const char *r; /* parse "service/protocol"? */ if ( (r = strchr(port, '/')) ) { strncpy(service, port, r - port); service[r - port] = 0; port = service; proto = r + 1; /* Default to "tcp" */ if ( ! *proto ) { proto = "tcp"; } } else { proto = "tcp"; } } if ( ! (se = getservbyname(port, proto)) ) return 0; return se->s_port; } } ll0.13/src/util/port.h0100644000175200017560000000035407034312207015145 0ustar stephensstephens/* $Id: port.h,v 1.3 2000/01/04 06:34:47 stephensk Exp $ */ #ifndef _util_port_h #define _util_port_h #ifdef __cplusplus extern "C" { #endif int port_by_name(const char *port, const char *proto); #ifdef __cplusplus } #endif #endif ll0.13/src/util/prime.c0100644000175200017560000001041607037351516015301 0ustar stephensstephens/* $Id: prime.c,v 1.6 2000/01/13 13:29:50 stephensk Exp $ */ #include "prime.h" #ifdef UNIT_TEST #include #endif #include #include #ifdef MEMDEBUG #include "memdebug/memdebug.h" #endif #ifndef EXTERN #define EXTERN #endif struct prime_list { prime_t x; struct prime_list *next; }; static struct prime_list pl_3 = { 3 }, pl_2 = { 2, &pl_3 }, *pl = &pl_2, *pl_last = &pl_3; static const prime_t *prime_new(prime_t x) { struct prime_list *p; #ifdef UNIT_TEST assert(pl_last->x != x); /* Do a simple verification of the primality of x. */ { prime_t y = x / 2; while ( y >= 2 ) { assert( x % y ); y --; } } fprintf(stderr, "%lu is prime\n", (unsigned long) x); #endif p = malloc(sizeof(*p)); p->x = x; p->next = 0; pl_last->next = p; pl_last = p; return &(p->x); } EXTERN const prime_t *prime_next(const prime_t *x) /* Returns the next prime > ^x^. ^x^ must be a result returned from prime_*(). */ { struct prime_list *p = (struct prime_list *) x; if ( ! p ) return 0; if ( p->next ) { return &(p->next->x); } else { prime_t y; assert(p == pl_last); #ifdef UNIT_TEST fprintf(stderr, "prime_next(%lu)\n", (unsigned long) *x); #endif y = p->x + 2; #ifdef UNIT_TEST /* Make sure y is not even. */ assert(y % 2 != 0); #endif for ( p = &pl_3; p; ) { if ( y % p->x == 0 ) { /* y is not prime, try y + 2. */ y += 2; p = &pl_3; continue; } else { /* y might be prime, see if y is multiple of next prime. */ p = p->next; } } /* y must be prime */ return prime_new(y); } } EXTERN const prime_t *prime_le(prime_t x) /* Returns a prime <= ^x^. */ { #ifdef UNIT_TEST fprintf(stderr, "prime_le(%lu)\n", (unsigned long) x); #endif if ( x < 2 ) return 0; while ( pl_last->x < x ) { prime_next(&(pl_last->x)); } { struct prime_list *p, *pp = pl; for ( p = pp->next; p; pp = p, p = p->next ) { if ( p->x > x ) { return &pp->x; } } abort(); } } EXTERN const prime_t *prime_q(prime_t x) /* Returns a prime if ^x^ is prime, 0 if ^x^ is not prime. */ { if ( x == pl_last->x ) { return &(pl_last->x); } else if ( x > pl_last->x ) { prime_le(x); } { struct prime_list *p; for ( p = pl; p; p = p->next ) { if ( p->x == x ) { /* x is prime. */ return &p->x; } } return 0; } } EXTERN const prime_t *prime_ge(prime_t x) /* Returns a prime number greater than or equal to ^x^. */ { #ifdef UNIT_TEST fprintf(stderr, "prime_ge(%lu)\n", (unsigned long) x); #endif while ( pl_last->x < x ) { prime_next(&(pl_last->x)); } { struct prime_list *p; for ( p = pl; p; p = p->next ) { if ( p->x >= x ) { return &(p->x); } } abort(); } } EXTERN prime_t *prime_factors(prime_t x) { int nfactors = 0; prime_t *factors = malloc(sizeof(factors[0]) * (nfactors + 1)); prime_t *f = pl; #ifdef UNIT_TEST prime_t x_save = x; #endif /* ** For each prime f < x: */ for ( f = pl; *f <= x; f = prime_next(f) ) { /* ** If x is divisible by f, ** append f to factors list. */ while ( x % *f == 0 ) { factors = realloc(factors, sizeof(factors[0]) * (nfactors + 2)); factors[nfactors ++] = *f; x /= *f; } } factors[nfactors] = 0; #ifdef UNIT_TEST { int i; prime_t product = 1; x = x_save; for ( i = 0; factors[i]; ++ i ) { product *= factors[i]; } assert(product == x); } #endif return factors; } #undef EXTERN #ifdef UNIT_TEST int main(int argc, char **argv) { #define Pi(X) {prime_t _X = (X); printf("%s = %lu\n", #X, (unsigned long) _X);} Pi(*prime_le(1024)); Pi(*prime_ge(1024)); Pi(*prime_le(512)); Pi(*prime_ge(512)); { int i, j; prime_t xs[] = { 678, 231, 148, 829, 818, 131, 512, 569, 126, 1025 }; for ( i = 1; i < sizeof(xs)/sizeof(xs[0]); ++ i ) { prime_t x = xs[i]; prime_t *factors = prime_factors(x); printf("factors(%lu) = { ", (unsigned long) x); for ( j = 0; factors[j]; ++ j ) { printf("%lu%s ", (unsigned long) factors[j], factors[j + 1] ? "," : ""); } printf("}\n"); free(factors); } } return 0; } #endif ll0.13/src/util/prime.h0100644000175200017560000000060407037351060015276 0ustar stephensstephens#ifndef _util_prime_h #define _util_prime_h /* $Id: prime.h,v 1.3 2000/01/13 13:25:04 stephensk Exp $ */ #ifndef prime_t typedef unsigned long prime_t; #endif const prime_t * prime_le(prime_t x); const prime_t * prime_ge(prime_t x); const prime_t * prime_q(prime_t x); const prime_t * prime_next(const prime_t *p); prime_t * prime_factors(prime_t x); /* must free() result. */ #endif ll0.13/src/util/rc4.c0100644000175200017560000000225007106156652014653 0ustar stephensstephens#include "rc4.h" /* $Id: rc4.c,v 1.4 2000/05/10 03:55:22 stephensk Exp $ */ RC4_EXPORT int rc4_init(rc4_state *s, const char *_key, size_t keylen) { int i; int temp1, temp2, temp3, temp4; int i1, i2; const unsigned char *key = (const unsigned char *) _key; for ( i = 0; i < 256; i ++ ) s->_state[i] = i; s->_x = s->_y = 0; i1 = i2 = 0; for ( i = 0; i < 256; i ++ ) { int ch = key[i1]; temp4 = (ch + s->_state[i] + i2) & 255; temp1 = s->_state[temp4]; temp2 = s->_state[i]; temp3 = (i1 + 1) % keylen; s->_state[i] = temp1; s->_state[i2] = temp2; i1 = temp3; i2 = temp4; } return 0; } RC4_EXPORT int rc4_crypt(rc4_state *s, char *_data, size_t datalen) { int i; unsigned char *data = (unsigned char *) _data; for ( i = 0; i < datalen; i ++ ) { int temp1, temp2; s->_x ++; /* SAME AS: s->_x = (s->_x + 1) & 255; */ s->_y += s->_state[s->_x]; /* SAME AS: s->_y = (s->_y + s->_state[s->_x]) & 255; */ temp1 = s->_state[s->_x]; s->_state[s->_x] = temp2 = s->_state[s->_y]; s->_state[s->_y] = temp1; data[i] ^= s->_state[(temp1 + temp2) & 255]; } return 0; } ll0.13/src/util/rc4.h0100644000175200017560000000061707106156652014665 0ustar stephensstephens#ifndef _rc4_h #define _rc4_h /* $Id: rc4.h,v 1.4 2000/05/10 03:55:22 stephensk Exp $ */ #include typedef struct rc4_state { unsigned char _state[256]; unsigned char _x, _y; } rc4_state; #ifndef RC4_EXPORT #define RC4_EXPORT #endif RC4_EXPORT int rc4_init(rc4_state *s, const char *key, size_t keylen); RC4_EXPORT int rc4_crypt(rc4_state *s, char *data, size_t datalen); #endif ll0.13/src/util/setenv.c0100644000175200017560000000244506702204466015473 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_util_setenv_c__ #define __rcs_id_util_setenv_c__ static const char __rcs_id_util_setenv_c[] = "$Id: setenv.c,v 1.3 1999/04/05 19:04:22 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include #include "setenv.h" extern char **environ; void setenv(const char *name, const char *value) { size_t name_len, value_len; int i; char *e, *v; static int realloc_environ = 0; if ( ! (name && *name && value && *value) ) return; name_len = strlen(name); value_len = strlen(value); for ( i = 0; (e = environ[i]); i ++ ) { if ( strncmp(e, name, name_len) == 0 && e[name_len] == '=' ) { v = e + name_len + 1; if ( strlen(v) <= value_len ) { strcpy(v, value); return; } else { break; } } } if ( ! e ) { if ( realloc_environ ) { environ = realloc(environ, sizeof(environ[0]) * (i + 2)); } else { char **new_environ = malloc(sizeof(environ[0]) * (i + 2)); memcpy(new_environ, environ, sizeof(environ[0]) * i); environ = new_environ; realloc_environ ++; } environ[i + 1] = 0; } /* This might leak mem */ e = malloc(name_len + value_len + 2); strcpy(e, name); strcpy(e + name_len, "="); strcpy(e + name_len + 1, value); environ[i] = e; } ll0.13/src/util/setenv.h0100644000175200017560000000057106702204466015476 0ustar stephensstephens#ifndef _util_setenv_h #define _util_setenv_h #ifndef __rcs_id__ #ifndef __rcs_id_util_setenv_h__ #define __rcs_id_util_setenv_h__ static const char __rcs_id_util_setenv_h[] = "$Id: setenv.h,v 1.3 1999/04/05 19:04:22 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #ifndef setenv #define setenv ion_setenv #endif void setenv (const char *name, const char *value); #endif ll0.13/src/util/sig.c0100644000175200017560000000250107034305357014742 0ustar stephensstephens#include "sig.h" #include #include /* isdigit() */ #include /* atoi */ static sigdef sigdefs[] = { #define signal_def(N,S,D) { #N, S, D }, #include "signals.h" { 0, -1, 0 } }; sigdef *sigdef_begin() { return sigdefs; } sigdef *sigdef_end() { return sigdefs + sizeof(sigdefs)/sizeof(sigdefs[0]) - 1; } sigdef *sigdef_by_name(const char *name) { int i; if ( ! name ) return 0; if ( strncasecmp(name, "SIG", 3) == 0 ) { name += 3; } if ( isdigit(*name) ) { int sig = atoi(name); for ( i = 0; sigdefs[i].name; i ++ ) { if ( sigdefs[i].sig == sig ) return &sigdefs[i]; } } else { for ( i = 0; sigdefs[i].name; i ++ ) { if ( strcasecmp(sigdefs[i].name, name) == 0 ) return &sigdefs[i]; } } return 0; } sigdef *sigdef_by_sig(int sig) { int i; for ( i = 0; sigdefs[i].name; i ++ ) { if ( sigdefs[i].sig == sig ) return &sigdefs[i]; } return 0; } sigdef *sigdef_max_sig(void) { int i; sigdef *m = &sigdefs[0]; for ( i = 1; sigdefs[i].name; i ++ ) { if ( sigdefs[i].sig > m->sig ) m = &sigdefs[i]; } return m; } sigdef *sigdef_min_sig(void) { int i; sigdef *m = &sigdefs[0]; for ( i = 1; sigdefs[i].name; i ++ ) { if ( sigdefs[i].sig < m->sig ) m = &sigdefs[i]; } return m; } ll0.13/src/util/sig.h0100644000175200017560000000053407034305357014753 0ustar stephensstephens#ifndef _util_sig_h #define _util_sig_h #include typedef struct sigdef { const char *name; int sig; const char *desc; void *user[4]; } sigdef; sigdef *sigdef_by_name(const char *signame); sigdef *sigdef_by_sig(int sig); sigdef *sigdef_begin(); sigdef *sigdef_end(); sigdef *sigdef_min_sig(); sigdef *sigdef_max_sig(); #endif ll0.13/src/util/sigs.pl0100644000175200017560000000102507034305357015316 0ustar stephensstephens#!/bin/perl # $Id: sigs.pl,v 1.4 2000/01/04 05:53:51 stephensk Exp $ print "/* DO NOT MODIFY: Created by perl $0 @ARGV */\n"; while ( <> ) { #print; if ( m@^\s*#define\s+SIG([A-Z0-9]+)\s+(\S+)(\s+/\*\s*(.*)\s*(\*/))?@ ) { $name = $1; $sig = $2; $comment = $4; $comment =~ s/^\s+//; $comment =~ s/\s+$//; if ( $sig !~ /[()]/ && $comment ne '' ) { print "#ifdef SIG$name\n"; print "signal_def($name,SIG$name,\"$comment\") /* $sig */\n"; print "#endif\n"; } } } print "#undef signal_def\n"; 1; ll0.13/src/util/ssprintf.c0100644000175200017560000000373707034310640016033 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_util_ssprintf_c__ #define __rcs_id_util_ssprintf_c__ static const char __rcs_id_util_path_c[] = "$Id: ssprintf.c,v 1.2 2000/01/04 06:22:24 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include #include #include #include "ssprintf.h" char *ssprintf(char *str, const char *format, ...) { size_t len; size_t flen; len = str ? strlen(str) : 0; /* Calc append length */ flen = strlen(format); { const char *f; va_list vap; va_start(vap, format); f = format; while ( *f ) { if ( *f == '%' ) { int l = 0; int w = 0; int more = 0; f ++; do { int fw = 0; more = 0; switch ( *(f ++) ) { case 's': fw = strlen(va_arg(vap, char*)); break; case '*': fw = va_arg(vap, int); break; case 'l': l ++; more = 1; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': w *= 10; w += f[-1] - '0'; more = 1; break; case '-': case '+': case '.': more = 1; break; case 'f': case 'g': case 'e': (void) va_arg(vap, double); fw = 32; break; case 'd': case 'u': case 'o': case 'x': case 'c': if ( l ) { (void) va_arg(vap, int); } else { (void) va_arg(vap, long); } flen += 32; break; case 'p': (void) va_arg(vap, void*); fw = 32; break; case '\0': break; case '%': break; default: abort(); break; } if ( fw < w ) { fw = w; } flen += fw; } while ( more && *f ); } else { f ++; } } va_end(vap); } /* re/alloc buffer */ if ( str ) { str = realloc(str, len + flen + 1); } else { str = malloc(flen + 1); } /* append to buffer */ { va_list vap; va_start(vap, format); vsprintf(str + len, format, vap); va_end(vap); } return str; } ll0.13/src/util/ssprintf.h0100644000175200017560000000052106707527215016042 0ustar stephensstephens#ifndef _util_ssprintf_h #define _util_ssprintf_h #ifndef __rcs_id__ #ifndef __rcs_id_util_ssprintf_h__ #define __rcs_id_util_ssprintf_h__ static const char __rcs_id_util_ssprintf_h[] = "$Id: ssprintf.h,v 1.1 1999/04/22 05:07:25 stephensk Exp $"; #endif #endif /* __rcs_id__ */ char *ssprintf(char *, const char *format, ...); #endif ll0.13/src/util/nurbs.c0100664000175200017560000000562207333523367015327 0ustar stephensstephens/* $Id: nurbs.c,v 1.2 2001/08/06 11:15:39 stephens Exp $ */ /* Author: kurtstephens@acm.org 2001/08/06 */ #ifndef _util_NURBS_H #include "nurbs.h" #endif #include //#include NURBS(EXPORT) int NURBS(_check_pi)(const NURBS(NURBS_T) *n, int i) { assert(i >= 0); assert(i < n->nv); return i; } NURBS(EXPORT) int NURBS(_check_ui)(const NURBS(NURBS_T) *n, int i) { assert(i >= 0); assert(i < n->nu); return i; } #define deg_ (n->degree) #define nv n->nv #define vdim n->vdim #define P(i) (n->v + n->voff + n->vskip * NURBS(_check_pi)(n, (i))) #define W(i) (n->w + n->woff + n->wskip * NURBS(_check_pi)(n, (i)))[0] #define U(i) (n->u[NURBS(_check_ui)(n, (i))]) #ifndef NURBS_EXPORT #define NURBS_EXPORT #endif NURBS(EXPORT) NURBS(T) NURBS(_min_knot)(NURBS(NURBS_T) *n) { return n->u[0]; } NURBS(EXPORT) NURBS(T) NURBS(_max_knot)(NURBS(NURBS_T) *n) { return n->u[n->nu - n->degree]; } NURBS(EXPORT) int NURBS(_find_span) (NURBS(NURBS_T) *n, NURBS(T) u) { if ( u >= U(nv) ) return nv - 1 ; if ( u <= U(deg_) ) return deg_ ; { int low = 0 ; int high = nv + 1 ; int mid; while ( mid = (low + high) / 2, u < U(mid) || u >= U(mid + 1) ) { if ( u < U(mid) ) high = mid ; else low = mid ; } return mid ; } } NURBS(EXPORT) void NURBS(_basis_funs) (NURBS(NURBS_T) *n, NURBS(T) u, int i, NURBS(T) *N) { NURBS(T)* left = (NURBS(T)*) alloca(2 * (deg_+1) * sizeof(NURBS(T))) ; NURBS(T)* right = &left[deg_ + 1] ; int j; N[0] = 1.0 ; for ( j = 1; j <= deg_ ; ++ j ) { int r; NURBS(T) saved = 0.0; left[j] = u - U(i + 1 - j) ; right[j] = U(i + j) - u ; for ( r = 0 ; r < j; ++ r ) { NURBS(T) temp = N[r] / (right[r + 1] + left[j - r]) ; N[r] = saved + right[r + 1] * temp ; saved = left[j - r] * temp ; } N[j] = saved ; } } NURBS(EXPORT) void NURBS(_basis_funs_der)(NURBS(NURBS_T) *n, NURBS(T) u, int i, int d, NURBS(T) *funs) { } NURBS(EXPORT) NURBS(T) * NURBS(_eval) (NURBS(NURBS_T) *n, NURBS(T) u, NURBS(T) *p) { int span = NURBS(_find_span)(n, u); NURBS(T) *Nb = (NURBS(T) *) alloca(sizeof(Nb[0]) * (deg_ + 1)); int i, j; NURBS(T) w; NURBS(_basis_funs)(n, u, span, Nb); i = deg_; for ( j = 0; j < vdim; ++ j ) { p[j] = Nb[i] * P(span - deg_ + i)[j] * (n->w ? W(span - deg_ + i) : 1); } if ( n->w ) { w = Nb[i] * W(span - deg_ + i); } for ( -- i; i >= 0; -- i ) { for ( j = 0; j < vdim; ++ j ) { p[j] += Nb[i] * P(span - deg_ + i)[j] * (n->w ? W(span - deg_ + i) : 1); } if ( n->w ) { w += Nb[i] * W(span - deg_ + i); } } /* Homogenous division. */ if ( n->w ) { for ( j = 0; j < vdim; ++ j ) { p[j] /= w; } } return p; } NURBS(EXPORT) NURBS(T) * NURBS(_eval_der)(NURBS(NURBS_T) *n, NURBS(T) u, int d, NURBS(T) *p) { return p; } #undef deg_ #undef nv #undef vdim #undef P #undef W #undef U ll0.13/src/util/refcntptr.hh0100644000175200017560000000511407267632146016356 0ustar stephensstephens#ifndef _util_REFCNTPTR_HH #define _util_REFCNTPTR_HH #ifndef refcntptr_DEBUG #define refcntptr_DEBUG 0 #endif #if refcntptr_DEBUG #define refcntptr_DEBUG_PRINT(X) printf X #else #define refcntptr_DEBUG_PRINT(X)(void)0 #endif #include /* assert(_refcnt) */ /* Class with refcnt support. */ #define refcntptr_STRINGTIZE_(T)#T #define refcntptr_STRINGTIZE(T)refcntptr_STRINGTIZE_(T) #define refcntptr_(T)T #define refcntptr_PASTE_(A,B)A##B #define refcntptr_PASTE(A,B)refcntptr_PASTE_(A,B) /* Declare ref count manipulation glue. */ #define refcntptr_DECL(T) \ void __ref(refcntptr_(T)*); \ void __deref(refcntptr_(T)*); \ extern "C" refcntptr_(T)* refcntptr_PASTE(T,_ref)(refcntptr_(T)* __p); \ extern "C" void refcntptr_PASTE(T,_deref)(refcntptr_(T)* __p); /* Defines support for refcntptr in T. */ #define refcntptr_CLASS(T) \ private: \ unsigned long _refcnt; \ public: \ virtual void __deref_delete(void); \ void __ref(void) { ++ _refcnt; assert(_refcnt); } \ void __deref(void) \ { \ if ( _refcnt <= 1 ) { \ refcntptr_DEBUG_PRINT(("(%s*)%p delete\n", refcntptr_STRINGTIZE(T), this)); \ this->__deref_delete(); \ } else { \ -- _refcnt; \ } \ } /* Defines ref count manipulation glue. */ #define refcntptr_DEF(SCOPE,T) \ SCOPE void __ref(refcntptr_(T)* __p) { if ( __p ) __p->__ref(); } \ SCOPE void __deref(refcntptr_(T)* __p) { if ( __p ) __p->__deref(); } \ refcntptr_(T)* refcntptr_PASTE(T,_ref)(refcntptr_(T)* __p) { __ref(__p); return __p; } \ void refcntptr_PASTE(T,_deref)(refcntptr_(T)* __p) { __deref(__p); } template class refcntptr { private: T *_p; public: refcntptr () : _p(0) { }; refcntptr (T* ptr) { __ref(_p = ptr); } refcntptr (const refcntptr &x) { __ref(_p = x._p); } ~refcntptr () { __deref(_p); } refcntptr& operator = (T* p) { __ref(p); __deref(_p); _p = p; return *this; } refcntptr& operator = (const refcntptr& x) { return (*this) = x._p; } operator void* () const { return (void*) _p; } operator int () const { return (int) _p; } operator T* () const { return _p; } int operator ! () const { return ! (int) _p; } T& operator *() const { return *_p; } T* operator ->() const { return _p; } int operator == (T* ptr) const { return _p == ptr; } int operator == (const refcntptr &x) const { return *this == x._p; } int operator != (T* ptr) const { return _p != ptr; } int operator != (const refcntptr &x) const { return *this != x._p; } int operator < (T* ptr) { return _p < ptr; } int operator < (const refcntptr &x) const { return *this < x._p; } }; #endif ll0.13/src/util/refcntptr.cc0100644000175200017560000000242507263152105016332 0ustar stephensstephens#include "refcntptr.hh" #ifdef UNIT_TEST #include class Cons; inline void __ref(Cons *t); inline void __deref(Cons *t); typedef refcntptr ref; #define Ref const ref & class Cons { private: friend void __ref(Cons *t); friend void __deref(Cons *t); unsigned long _refcnt; void __ref() { #ifdef _refcntptr_DEBUG fprintf(stderr,"(Cons*)%p->__ref()\n", this); #endif ++ _refcnt; } void __deref() { #ifdef _refcntptr_DEBUG fprintf(stderr,"(Cons*)%p->__deref()\n", this); #endif if ( -- _refcnt <= 0 ) { delete this; } } ref _car; ref _cdr; public: Cons() : _refcnt(0) { }; Cons(const ref &car, const ref &cdr) : _refcnt(0), _car(car), _cdr(cdr) { }; ~Cons() { #ifdef _refcntptr_DEBUG fprintf(stderr, "delete (Cons*)%p\n"); #endif } void _print(Ref x) { if ( x ) { x->print(); } else { fprintf(stderr, "nil"); } } void print() { fprintf(stderr, "("); _print(_car); fprintf(stderr, " . "); _print(_cdr); fprintf(stderr, ")"); } }; inline void __ref(Cons *t) { if ( t ) t->__ref(); } inline void __deref(Cons *t) { if ( t ) t->__deref(); } int main(int argc, char **argv) { ref x; ref y = new Cons(); ref z = new Cons(x, y); z->print(); return 0; } #endif ll0.13/src/util/memcpy.h0100644000175200017560000000071107263231170015453 0ustar stephensstephens#ifndef _util_MEMCPY_H #define _util_MEMCPY_H #ifdef __cplusplus #include /* Typesafe memcpy handles assignment properly. */ template inline void _typesafe_memcpy(T1 *_dst, const T2 *_src, size_t _size) { assert(_size % sizeof(*_dst) == 0); _size /= sizeof(*_dst); while ( _size -- >= 0 ) { *(_dst ++) = *(_src ++); } } #define memcpy(A,B,C) _typesafe_memcpy(A,B,C) #else #include #endif #endif ll0.13/src/util/nurbs.h0100644000175200017560000000206707270651343015326 0ustar stephensstephens#ifndef _util_NURBS_H #define _util_NURBS_H #ifndef NURBS_T #define NURBS_T double #endif #define __NURBS(X)NURBS_##X #define _NURBS(X)__NURBS(X) #define NURBS(X)_NURBS(X) typedef struct NURBS(NURBS_T) { short degree; int nv; NURBS(T) *v; short vdim; short vskip; short voff; NURBS(T) *w; short wskip; short woff; int nu; NURBS(T) *u; /* Length must be nv + (degree * 2) - 2. */ } NURBS(NURBS_T); #ifndef NURBS_IMPORT #define NURBS_IMPORT /* extern */ #endif NURBS(IMPORT) NURBS(T) NURBS(_min_knot)(NURBS(NURBS_T) *n); NURBS(IMPORT) NURBS(T) NURBS(_max_knot)(NURBS(NURBS_T) *n); NURBS(IMPORT) int NURBS(_find_span) (NURBS(NURBS_T) *n, NURBS(T) u); NURBS(IMPORT) void NURBS(_basis_funs) (NURBS(NURBS_T) *n, NURBS(T) u, int span, NURBS(T) *funs); NURBS(IMPORT) void NURBS(_basis_funs_der)(NURBS(NURBS_T) *n, NURBS(T) u, int span, int d, NURBS(T) *funs); NURBS(IMPORT) NURBS(T) *NURBS(_eval) (NURBS(NURBS_T) *n, NURBS(T) u, NURBS(T) *r); NURBS(IMPORT) NURBS(T) *NURBS(_eval_der)(NURBS(NURBS_T) *n, NURBS(T) u, int d, NURBS(T) *r); #endif ll0.13/src/util/GUMakefile0100664000175200017560000000202407335700623015711 0ustar stephensstephens# $Id: GUMakefile,v 1.1 2001/08/13 07:28:19 stephens Exp $ PROJECT=util# ########################################################################### INCLUDE_DIRS += .. ########################################################################### NAME:=util# H_FILES = \ path.h \ ConfigInfo.h \ enum.h \ setenv.h \ sig.h \ signals.h \ errlist.h \ prime.h \ lockfile.h \ rc4.h \ ssprintf.h \ outbuf.h \ file.h \ host.h \ port.h C_FILES = \ path.c \ ConfigInfo.c \ enum.c \ setenv.c \ sig.c \ errlist.c \ prime.c \ lockfile.c \ rc4.c \ ssprintf.c \ outbuf.c \ file.c \ host.c \ port.c #DEPENDS_ON:=signals.h errlist.c# include $(GUM)/lib ################################################################# signals.h : sigs.pl perl sigs.pl < /usr/include/sys/signal.h > $@ ################################################################# errlist.c : errlist.pl perl errlist.pl < /usr/include/sys/errno.h > $@ ################################################################# GARBAGE+=signals.h errlist.c# ll0.13/src/util/file.c0100664000175200017560000002677307564512117015124 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_util_file_c__ #define __rcs_id_util_file_c__ static const char __rcs_id_util_file_c[] = "$Id: file.c,v 1.5 2002/11/13 18:00:50 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "util/file.h" #include #include #include #include #include #include #include #include #include #include #include #include "util/path.h" static void write_error(const char *s) { write(2, s, strlen(s)); } static void *xmalloc(size_t s) { void *ptr = malloc(s); if ( ! ptr ) { write_error("out of memory in "); write_error(__FILE__); write_error("\n"); abort(); } return ptr; } time_t file_mtime(const char *fname) { struct stat s; #if 0 fprintf(stderr, "file_mtime(\"%s\")\n", fname); #endif return stat(fname, &s) == 0 ? (time_t) s.st_mtime : (time_t) 0; } int file_mode_masked(const char *fname, int euid, int egid) { struct stat s; int mask; if ( euid < 0 ) euid = geteuid(); if ( egid < 0 ) egid = getegid(); if ( stat(fname, &s) ) return 0; mask = euid == s.st_uid ? S_IRWXU : 0; mask |= egid == s.st_gid ? S_IRWXG : 0; mask |= (euid != s.st_uid && egid != s.st_gid) ? S_IRWXO : 0; return s.st_mode & mask; } int file_executable(const char *fname) { #if defined(WIN32) { const char *suffix = path_suffix(fname); return suffix && (strcasecmp(suffix, ".exe") == 0 || strcasecmp(suffix, ".con") == 0 || strcasecmp(suffix, ".bat") == 0 || strcasecmp(suffix, ".dll") == 0); } #else return file_mode_masked(fname, -1, -1) & (S_IXUSR|S_IXGRP|S_IXOTH); #endif } static int progname_try(char *buf) { #if 0 fprintf(stderr, "progname_try(\"%s\")\n", buf); #endif #if defined(_WIN32) || defined(WINNT) /* Try .exe */ strcat(buf, ".exe"); if ( file_mtime(buf) ) { return 1; } /* Try .com */ strcpy(strchr(buf, 0) - 4, ".com"); if ( file_mtime(buf) ) { return 1; } /* Try .dll */ strcpy(strchr(buf, 0) - 4, ".dll"); if ( file_mtime(buf) ) { return 1; } /* Try .bat */ strcpy(strchr(buf, 0) - 4, ".bat"); if ( file_mtime(buf) ) { return 1; } *(strchr(buf, 0) - 4) = 0; #else /* Try filename alone */ if ( file_executable(buf) ) { return 1; } #endif return 0; } int file_in_path(const char *argv0, const char *PATH, char *buf) { char dir_sep[] = "/"; if ( ! (argv0[0] == '/' || argv0[0] == '\\') ) { if ( (PATH || (PATH = getenv("PATH"))) && *PATH ) { const char *p, *pe, *pn; int path_sep = ':'; if ( strchr(PATH, ';') ) path_sep = ';'; for ( p = PATH, pe = PATH; *p; p = pn) { if ( (pe = strchr(p, path_sep)) ) { pn = pe + 1; } else { pe = strchr(p, '\0'); pn = ""; } if ( *p ) { strncpy(buf, p, pe - p); buf[pe - p] = 0; strcat(buf, dir_sep); strcat(buf, argv0); if ( progname_try(buf) ) return 1; } #if 0 fprintf(stderr, "pn = '%s'\n", pn); #endif } } } strcpy(buf, argv0); if ( progname_try(buf) ) return 1; strcpy(buf, argv0); return 0; } size_t file_size(const char *file) { struct stat s; return stat(file, &s) ? 0 : s.st_size; } int file_touch(const char *file) { int fd; if ( (fd = open(file, O_RDWR, 0644)) >= 0 ) { char buf[1]; size_t bytes = sizeof(buf); buf[0] = 0; lseek(fd, 0, SEEK_SET); bytes = read(fd, buf, bytes); lseek(fd, 0, SEEK_SET); bytes = write(fd, buf, bytes); lseek(fd, 0, SEEK_END); close(fd); return 0; } return -1; } char *FILE_get_line_at_pos(FILE *fp, int linesize, pos_t pos, size_t *lenp, pos_t *line_pos) { /* ** Read a buffer twice the expected maximum linesize to handle ** hopefully to get a beginning and ending newline bounding the ** file position (pos) wanted. */ size_t bufsize = linesize * 2 + 3; /* The buffer read. */ char *buf = xmalloc(bufsize + 1); /* The size of the buffer read. */ pos_t readpos; /* Where the read began. */ do { /* Where to begin reading lines from. */ if ( pos < linesize ) { /* Dont read before beginning of file! */ readpos = 0; } else { readpos = pos - linesize; } /* Read a buffer and terminate it. */ fseek(fp, readpos, SEEK_SET); bufsize = fread(buf, 1, bufsize, fp); buf[bufsize] = '\0'; /* Guard. */ { /* Buffer begin/end */ const char *bb = buf, *be = buf + bufsize; /* Position wanted within the buffer. */ const char *pp = bb + (pos - readpos); /* Line begin/end */ const char *lb = bb, *le; /* Find beginning of first line. */ if ( readpos > 0 ) { while ( *lb != '\n' ) { if ( lb == be ) { /* Beginning of first line not found. */ goto bigger; } ++ lb; } /* Skip newline. */ ++ lb; } do { /* Find end of current line. */ le = lb; while ( *le != '\n' ) { if ( le == be ) { /* End of line not found. */ goto bigger; } ++ le; } /* Skip newline. */ ++ le; /* ** If found end of line and ** the position wanted is within the line found. */ if ( lb <= pp && pp < le ) { /* Return beginning of line position. */ if ( line_pos ) *line_pos = readpos + (lb - bb); /* ** Got the line. ** Shrink buffer. */ bufsize = le - lb; memmove(buf, lb, bufsize); buf = realloc(buf, bufsize + 1); buf[bufsize] = '\0'; #if 0 fprintf(stderr, "line = '%s'\n", buf); #endif /* Return buffer and length. */ if ( lenp ) { *lenp = bufsize; } return buf; } /* Try next line. */ lb = le; } while ( lb != be ); } /* Try again with a larger buffer. */ bigger: bufsize *= 2; buf = realloc(buf, bufsize); } while ( 1 ); /* Give up. */ free(buf); return 0; } int FILE_print_line_at_pos(FILE *fp, int linesize, pos_t pos, pos_t *line_pos, FILE *out) { int result = 0; size_t len; pos_t new_line_pos = line_pos ? *line_pos : -1; char *line = FILE_get_line_at_pos(fp, linesize, pos, &len, &new_line_pos); if ( ! line ) { result = -1; } else { /* Do not print any lines that we all ready printed. */ if ( ! (line_pos && *line_pos == new_line_pos) ) { fprintf(out, "%lu\t", (unsigned long) new_line_pos); fwrite(line, 1, len, out); } free(line); } if ( line_pos ) *line_pos = new_line_pos; return result; } int file_print_line_at_pos(const char *file, int linesize, pos_t pos, pos_t *line_pos, FILE *out) { int result = 0; FILE *fp; if ( ! (fp = fopen(file, "r")) ) { result = -1; } else { result = FILE_print_line_at_pos(fp, linesize, pos, line_pos, out); fclose(fp); } return result; } static const char *_file = ""; /* for debugging. */ #if 0 #define PDEBUG(X) fprintf X #else #define PDEBUG(X) #endif char *FILE_read_from_end(FILE *fp, size_t *buflenp, pos_t *posp) { static const char _funcname[] = "FILE_read_from_end"; char *buf; size_t buflen = 1024; /* Arbitrary bufsize. */ long savepos; if ( buflenp && *buflenp ) { buflen = *buflenp; } buf = (char*) xmalloc(sizeof(buf[0]) * (buflen + 1)); memset(buf, 0, sizeof(buf[0]) * (buflen + 1)); /* Save current pos. */ savepos = ftell(fp); /* ** If buflen is bigger than the file's size, ** read from beginning as much as possible. */ if ( fseek(fp, - (long) buflen, SEEK_END) ) { #if 0 fprintf(stderr, "%s('%s'): fseek(%ld, SEEK_END) error.\n", _funcname, _file, - (long) buflen); #endif clearerr(fp); fseek(fp, 0, SEEK_SET); } /* Remember where read started from. */ if ( posp ) { *posp = (pos_t) ftell(fp); } /* Read and remember the actual size read. */ buflen = fread(buf, sizeof(buf[0]), buflen, fp); /* Check for read error. */ if ( buflen == 0 && ferror(fp) ) { fprintf(stderr, "%s('%s'): read error.\n", _funcname, _file); clearerr(fp); free(buf); buf = 0; } /* Restore fp pos. */ fseek(fp, savepos, SEEK_SET); if ( buf ) { /* Realloc buf. */ buf = realloc(buf, sizeof(buf[0]) * (buflen + 1)); /* Null terminate. */ buf[buflen] = '\0'; } #if 0 fprintf(stderr, "%s('%s'): return '%s', buflen %ld.\n", _funcname, _file, buf, (long) buflen ); #endif if ( buflenp ) *buflenp = buflen; return buf; } char *file_read_from_end(const char *file, size_t *buflenp, pos_t *posp) { FILE *fp; char *buf; _file = file; if ( ! (fp = fopen(file, "r")) ) return 0; buf = FILE_read_from_end(fp, buflenp, posp); fclose(fp); return buf; } char *FILE_get_line_at_end(FILE *fp, size_t *buflenp, pos_t *posp) { char *buf = 0; size_t buflen = 1024; char *line = 0; /* The line found. */ pos_t pos = 0; /* The position in the file the line was found. */ char *b, *e; /* Search range in buffer. */ static const char _funcname[] = "FILE_get_line_at_end"; if ( buflenp && *buflenp ) { buflen = *buflenp; } do { if ( buf ) free(buf); buf = FILE_read_from_end(fp, &buflen, &pos); if ( ! buf ) break; /* ** If buflen is 0, ** the file is empty. */ if ( buflen == 0 ) { PDEBUG((stderr, "%s('%s'): file is empty\n", _funcname, _file)); line = 0; break; } /* Begin scanning backwards for a newline before last line. */ e = buf + buflen; /* end of buffer (hence, end of possible line). */ b = e - 1; /* beginning of possible line. */ /* Skip trailing newline only if it exists. */ if ( *b == '\n' ) { b --; } else { PDEBUG((stderr, "%s('%s'): no trailing newline found.\n", _funcname, _file)); } /* Find newline before trailing newline. */ while ( b >= buf ) { if ( *b == '\n' ) { line = b + 1; PDEBUG((stderr, "%s('%s'): found previous newline.\n", _funcname, _file)); break; } -- b; } /* ** If no newline was found and ** if buf starts at beginning of file, ** the buf is the first line. */ if ( (! line) && pos == 0 ) { PDEBUG((stderr, "%s('%s'): read entire file.\n", _funcname, _file)); line = buf; break; } /* ** Try growing buflen until a complete line is read. */ } while ( (! line) && (buflen *= 2) ); if ( line ) { assert(buf); /* ** The line's start position is offset from ** the buffer's start position by the offset of the line ** in the buffer. Got it? */ pos += (line - buf); /* ** Resize buf to only contain the line. */ buflen = e - line; memmove(buf, line, sizeof(buf[0]) * buflen); buf = realloc(buf, sizeof(buf[0]) * (buflen + 1)); buf[buflen] = '\0'; line = buf; /* ** Pass back bufsize and line pos. */ if ( buflenp ) *buflenp = buflen; if ( posp ) *posp = pos; } else { /* Done with buf. */ if ( buf ) free(buf); } PDEBUG((stderr, "%s('%s'): return '%s': buflen %ld pos %ld\n", _funcname, _file, line ? line : "", (long) buflen, (long) pos)); return line; } char *file_get_line_at_end(const char *file, size_t *buflenp, pos_t *posp) { FILE *fp; char *buf; _file = file; /* for debugging. */ if ( ! (fp = fopen(file, "r")) ) { fprintf(stderr, "file_get_line_at_end('%s'): cannot open: %s\n", file, strerror(errno)); fflush(stderr); return 0; } buf = FILE_get_line_at_end(fp, buflenp, posp); fclose(fp); _file = ""; /* for debugging. */ return buf; } ll0.13/src/util/file.c.~1.5.~0100664000175200017560000002677307564511522016077 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_util_file_c__ #define __rcs_id_util_file_c__ static const char __rcs_id_util_file_c[] = "$Id: file.c,v 1.5 2002/11/13 18:00:50 stephens Exp $"; #endif #endif /* __rcs_id__ */ #include "util/file.h" #include #include #include #include #include #include #include #include #include #include #include #include "util/path.h" static void write_error(const char *s) { write(2, s, strlen(s)); } static void *xmalloc(size_t s) { void *ptr = malloc(s); if ( ! ptr ) { write_error("out of memory in "); write_error(__FILE__); write_error("\n"); abort(); } return ptr; } time_t file_mtime(const char *fname) { struct stat s; #if 0 fprintf(stderr, "file_mtime(\"%s\")\n", fname); #endif return stat(fname, &s) == 0 ? (time_t) s.st_mtime : (time_t) 0; } int file_mode_masked(const char *fname, int euid, int egid) { struct stat s; int mask; if ( euid < 0 ) euid = geteuid(); if ( egid < 0 ) egid = getegid(); if ( stat(fname, &s) ) return 0; mask = euid == s.st_uid ? S_IRWXU : 0; mask |= egid == s.st_gid ? S_IRWXG : 0; mask |= (euid != s.st_uid && egid != s.st_gid) ? S_IRWXO : 0; return s.st_mode & mask; } int file_executable(const char *fname) { #if defined(WIN32) { const char *suffix = path_suffix(fname); return suffix && (strcasecmp(suffix, ".exe") == 0 || strcasecmp(suffix, ".con") == 0 || strcasecmp(suffix, ".bat") == 0 || strcasecmp(suffix, ".dll") == 0); } #else return file_mode_masked(fname, -1, -1) & (S_IXUSR|S_IXGRP|S_IXOTH); #endif } static int progname_try(char *buf) { #if 0 fprintf(stderr, "progname_try(\"%s\")\n", buf); #endif #if defined(_WIN32) || defined(WINNT) /* Try .exe */ strcat(buf, ".exe"); if ( file_mtime(buf) ) { return 1; } /* Try .com */ strcpy(strchr(buf, 0) - 4, ".com"); if ( file_mtime(buf) ) { return 1; } /* Try .dll */ strcpy(strchr(buf, 0) - 4, ".dll"); if ( file_mtime(buf) ) { return 1; } /* Try .bat */ strcpy(strchr(buf, 0) - 4, ".bat"); if ( file_mtime(buf) ) { return 1; } *(strchr(buf, 0) - 4) = 0; #else /* Try filename alone */ if ( file_executable(buf) ) { return 1; } #endif return 0; } int file_in_path(const char *argv0, const char *PATH, char *buf) { char dir_sep[] = "/"; if ( ! (argv0[0] == '/' || argv0[0] == '\\') ) { if ( (PATH || (PATH = getenv("PATH"))) && *PATH ) { const char *p, *pe, *pn; int path_sep = ':'; if ( strchr(PATH, ';') ) path_sep = ';'; for ( p = PATH, pe = PATH; *p; p = pn) { if ( (pe = strchr(p, path_sep)) ) { pn = pe + 1; } else { pe = strchr(p, '\0'); pn = ""; } if ( *p ) { strncpy(buf, p, pe - p); buf[pe - p] = 0; strcat(buf, dir_sep); strcat(buf, argv0); if ( progname_try(buf) ) return 1; } #if 0 fprintf(stderr, "pn = '%s'\n", pn); #endif } } } strcpy(buf, argv0); if ( progname_try(buf) ) return 1; strcpy(buf, argv0); return 0; } size_t file_size(const char *file) { struct stat s; return stat(file, &s) ? 0 : s.st_size; } int file_touch(const char *file) { int fd; if ( (fd = open(file, O_RDWR, 0644)) >= 0 ) { char buf[1]; size_t bytes = sizeof(buf); buf[0] = 0; lseek(fd, 0, SEEK_SET); bytes = read(fd, buf, bytes); lseek(fd, 0, SEEK_SET); bytes = write(fd, buf, bytes); lseek(fd, 0, SEEK_END); close(fd); return 0; } return -1; } char *FILE_get_line_at_pos(FILE *fp, int linesize, pos_t pos, size_t *lenp, pos_t *line_pos) { /* ** Read a buffer twice the expected maximum linesize to handle ** hopefully to get a beginning and ending newline bounding the ** file position (pos) wanted. */ size_t bufsize = linesize * 2 + 3; /* The buffer read. */ char *buf = xmalloc(bufsize + 1); /* The size of the buffer read. */ pos_t readpos; /* Where the read began. */ do { /* Where to begin reading lines from. */ if ( pos < linesize ) { /* Dont read before beginning of file! */ readpos = 0; } else { readpos = pos - linesize; } /* Read a buffer and terminate it. */ fseek(fp, readpos, SEEK_SET); bufsize = fread(buf, 1, bufsize, fp); buf[bufsize] = '\0'; /* Guard. */ { /* Buffer begin/end */ const char *bb = buf, *be = buf + bufsize; /* Position wanted within the buffer. */ const char *pp = bb + (pos - readpos); /* Line begin/end */ const char *lb = bb, *le; /* Find beginning of first line. */ if ( readpos > 0 ) { while ( *lb != '\n' ) { if ( lb == be ) { /* Beginning of first line not found. */ goto bigger; } ++ lb; } /* Skip newline. */ ++ lb; } do { /* Find end of current line. */ le = lb; while ( *le != '\n' ) { if ( le == be ) { /* End of line not found. */ goto bigger; } ++ le; } /* Skip newline. */ ++ le; /* ** If found end of line and ** the position wanted is within the line found. */ if ( lb <= pp && pp < le ) { /* Return beginning of line position. */ if ( line_pos ) *line_pos = readpos + (lb - bb); /* ** Got the line. ** Shrink buffer. */ bufsize = le - lb; memmove(buf, lb, bufsize); buf = realloc(buf, bufsize + 1); buf[bufsize] = '\0'; #if 0 fprintf(stderr, "line = '%s'\n", buf); #endif /* Return buffer and length. */ if ( lenp ) { *lenp = bufsize; } return buf; } /* Try next line. */ lb = le; } while ( lb != be ); } /* Try again with a larger buffer. */ bigger: bufsize *= 2; buf = realloc(buf, bufsize); } while ( 1 ); /* Give up. */ free(buf); return 0; } int FILE_print_line_at_pos(FILE *fp, int linesize, pos_t pos, pos_t *line_pos, FILE *out) { int result = 0; size_t len; pos_t new_line_pos = line_pos ? *line_pos : -1; char *line = FILE_get_line_at_pos(fp, linesize, pos, &len, &new_line_pos); if ( ! line ) { result = -1; } else { /* Do not print any lines that we all ready printed. */ if ( ! (line_pos && *line_pos == new_line_pos) ) { fprintf(out, "%lu\t", (unsigned long) new_line_pos); fwrite(line, 1, len, out); } free(line); } if ( line_pos ) *line_pos = new_line_pos; return result; } int file_print_line_at_pos(const char *file, int linesize, pos_t pos, pos_t *line_pos, FILE *out) { int result = 0; FILE *fp; if ( ! (fp = fopen(file, "r")) ) { result = -1; } else { result = FILE_print_line_at_pos(fp, linesize, pos, line_pos, out); fclose(fp); } return result; } static const char *_file = ""; /* for debugging. */ #if 0 #define PDEBUG(X) fprintf X #else #define PDEBUG(X) #endif char *FILE_read_from_end(FILE *fp, size_t *buflenp, pos_t *posp) { static const char _funcname[] = "FILE_read_from_end"; char *buf; size_t buflen = 1024; /* Arbitrary bufsize. */ long savepos; if ( buflenp && *buflenp ) { buflen = *buflenp; } buf = (char*) xmalloc(sizeof(buf[0]) * (buflen + 1)); memset(buf, 0, sizeof(buf[0]) * (buflen + 1)); /* Save current pos. */ savepos = ftell(fp); /* ** If buflen is bigger than the file's size, ** read from beginning as much as possible. */ if ( fseek(fp, - (long) buflen, SEEK_END) ) { #if 0 fprintf(stderr, "%s('%s'): fseek(%ld, SEEK_END) error.\n", _funcname, _file, - (long) buflen); #endif clearerr(fp); fseek(fp, 0, SEEK_SET); } /* Remember where read started from. */ if ( posp ) { *posp = (pos_t) ftell(fp); } /* Read any remember the actual size read. */ buflen = fread(buf, sizeof(buf[0]), buflen, fp); /* Check for read error. */ if ( buflen == 0 && ferror(fp) ) { fprintf(stderr, "%s('%s'): read error.\n", _funcname, _file); clearerr(fp); free(buf); buf = 0; } /* Restore fp pos. */ fseek(fp, savepos, SEEK_SET); if ( buf ) { /* Realloc buf. */ buf = realloc(buf, sizeof(buf[0]) * (buflen + 1)); /* Null terminate. */ buf[buflen] = '\0'; } #if 0 fprintf(stderr, "%s('%s'): return '%s', buflen %ld.\n", _funcname, _file, buf, (long) buflen ); #endif if ( buflenp ) *buflenp = buflen; return buf; } char *file_read_from_end(const char *file, size_t *buflenp, pos_t *posp) { FILE *fp; char *buf; _file = file; if ( ! (fp = fopen(file, "r")) ) return 0; buf = FILE_read_from_end(fp, buflenp, posp); fclose(fp); return buf; } char *FILE_get_line_at_end(FILE *fp, size_t *buflenp, pos_t *posp) { char *buf = 0; size_t buflen = 1024; char *line = 0; /* The line found. */ pos_t pos = 0; /* The position in the file the line was found. */ char *b, *e; /* Search range in buffer. */ static const char _funcname[] = "FILE_get_line_at_end"; if ( buflenp && *buflenp ) { buflen = *buflenp; } do { if ( buf ) free(buf); buf = FILE_read_from_end(fp, &buflen, &pos); if ( ! buf ) break; /* ** If buflen is 0, ** the file is empty. */ if ( buflen == 0 ) { PDEBUG((stderr, "%s('%s'): file is empty\n", _funcname, _file)); line = 0; break; } /* Begin scanning backwards for a newline before last line. */ e = buf + buflen; /* end of buffer (hence, end of possible line). */ b = e - 1; /* beginning of possible line. */ /* Skip trailing newline only if it exists. */ if ( *b == '\n' ) { b --; } else { PDEBUG((stderr, "%s('%s'): no trailing newline found.\n", _funcname, _file)); } /* Find newline before trailing newline. */ while ( b >= buf ) { if ( *b == '\n' ) { line = b + 1; PDEBUG((stderr, "%s('%s'): found previous newline.\n", _funcname, _file)); break; } -- b; } /* ** If no newline was found and ** if buf starts at beginning of file, ** the buf is the first line. */ if ( (! line) && pos == 0 ) { PDEBUG((stderr, "%s('%s'): read entire file.\n", _funcname, _file)); line = buf; break; } /* ** Try growing buflen until a complete line is read. */ } while ( (! line) && (buflen *= 2) ); if ( line ) { assert(buf); /* ** The line's start position is offset from ** the buffer's start position by the offset of the line ** in the buffer. Got it? */ pos += (line - buf); /* ** Resize buf to only contain the line. */ buflen = e - line; memmove(buf, line, sizeof(buf[0]) * buflen); buf = realloc(buf, sizeof(buf[0]) * (buflen + 1)); buf[buflen] = '\0'; line = buf; /* ** Pass back bufsize and line pos. */ if ( buflenp ) *buflenp = buflen; if ( posp ) *posp = pos; } else { /* Done with buf. */ if ( buf ) free(buf); } PDEBUG((stderr, "%s('%s'): return '%s': buflen %ld pos %ld\n", _funcname, _file, line ? line : "", (long) buflen, (long) pos)); return line; } char *file_get_line_at_end(const char *file, size_t *buflenp, pos_t *posp) { FILE *fp; char *buf; _file = file; /* for debugging. */ if ( ! (fp = fopen(file, "r")) ) { fprintf(stderr, "file_get_line_at_end('%s'): cannot open: %s\n", file, strerror(errno)); fflush(stderr); return 0; } buf = FILE_get_line_at_end(fp, buflenp, posp); fclose(fp); _file = ""; /* for debugging. */ return buf; } ll0.13/src/maks/0042755000175200017560000000000007326751162014004 5ustar stephensstephensll0.13/src/maks/CVS/0042755000175200017560000000000007336072176014441 5ustar stephensstephensll0.13/src/maks/CVS/Root0100664000175200017560000000006107336072176015301 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/maks/CVS/Repository0100644000175200017560000000002207236675452016535 0ustar stephensstephenshome/ion/src/maks ll0.13/src/maks/CVS/Entries0100644000175200017560000000056207262562005015764 0ustar stephensstephens/fixpound.pl/1.2/Fri Feb 19 09:26:01 1999// /tool.mak/1.7/Tue Mar 21 08:21:48 2000// /tools.mak/1.5/Thu Sep 9 04:59:21 1999// D/bin//// D/opengl//// D/os//// D/win32//// /PKG/1.2/Tue Apr 3 18:51:56 2001// /lib.mak/1.6/Tue Apr 3 18:51:56 2001// /pre.mak/1.10/Tue Apr 3 18:51:56 2001// /use.mak/1.4/Tue Apr 3 18:51:56 2001// /basic.mak/1.9/Wed Apr 4 09:09:10 2001// ll0.13/src/maks/bin/0042755000175200017560000000000007326751162014554 5ustar stephensstephensll0.13/src/maks/bin/CVS/0042755000175200017560000000000007336072176015211 5ustar stephensstephensll0.13/src/maks/bin/CVS/Root0100664000175200017560000000006107336072176016051 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/maks/bin/CVS/Repository0100644000175200017560000000002607236675452017311 0ustar stephensstephenshome/ion/src/maks/bin ll0.13/src/maks/bin/CVS/Entries0100644000175200017560000000011607236675452016543 0ustar stephensstephens/mak/1.2/Mon Jun 28 14:03:33 1999// /mak.bat/1.3/Mon Jun 28 14:03:33 1999// D ll0.13/src/maks/bin/mak0100644000175200017560000000064206735700265015245 0ustar stephensstephens#!/bin/sh HOME=`cd "$HOME" && pwd` if [ -z "$DEV_ROOT" ] then DEV_ROOT="${HOME}/src" fi DEV_ROOT=`cd "$DEV_ROOT" && pwd` export DEV_ROOT if [ -z "$MAKS" ] then MAKS='/home/stephens/src/maks' fi MAKS=`cd "$MAKS" && pwd` export MAKS if [ -z "$MAKE_ARCH" ] then MAKE_ARCH=`uname` fi export MAKE_ARCH echo "HOME=$HOME" echo "DEV_ROOT=$DEV_ROOT" echo "MAKS=$MAKS" echo "MAKE_ARCH=$MAKE_ARCH" exec make ${1+"$@"} ll0.13/src/maks/bin/mak.bat0100644000175200017560000000015206735700265016006 0ustar stephensstephens@REM $Id: mak.bat,v 1.3 1999/06/28 14:03:33 stephensk Exp $ @sh %MAKS%\bin\mak %1 %2 %3 %4 %5 %6 %7 %8 %9 ll0.13/src/maks/opengl/0042755000175200017560000000000007326751162015270 5ustar stephensstephensll0.13/src/maks/opengl/CVS/0042755000175200017560000000000007336072176015725 5ustar stephensstephensll0.13/src/maks/opengl/CVS/Root0100664000175200017560000000006107336072176016565 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/maks/opengl/CVS/Repository0100644000175200017560000000003107236675452020021 0ustar stephensstephenshome/ion/src/maks/opengl ll0.13/src/maks/opengl/CVS/Entries0100644000175200017560000000013007322242246017236 0ustar stephensstephens/Makefile/1.2/Fri Feb 19 09:26:02 1999// /Makefile.use/1.5/Mon Jul 9 05:44:06 2001// D ll0.13/src/maks/opengl/Makefile0100644000175200017560000000011306663227052016715 0ustar stephensstephens# $Id: Makefile,v 1.2 1999/02/19 09:26:02 stephensk Exp $ all : clean : ll0.13/src/maks/opengl/Makefile.use0100744000175200017560000000073007322242246017511 0ustar stephensstephens# $Id: Makefile.use,v 1.5 2001/07/07 04:12:11 stephens Exp $ #OPENGL_ROOT:=$(APPS)/dev# OPENGL_LIBDIR:=$(OPENGL_ROOT)# OPENGL_INCL:=$(OPENGL_ROOT)# MAKS_ARCH=$(MAKE_ARCH)# ifneq "$(strip $(findstring WIN,$(MAKS_ARCH)))" "" USE:=$(MAKS)/win32 include $(MAKS)/use.mak OPENGL_LIBS := opengl32 glu32 glut32 m # endif ifneq "$(strip $(findstring Linux,$(MAKS_ARCH)))" "" OPENGL_LIBS := GL GLU glut m # endif INCLS:=$(INCLS) $(OPENGL_INCL)# LIBS:=$(OPENGL_LIBS) $(LIBS)# ll0.13/src/maks/os/0042755000175200017560000000000007326751162014425 5ustar stephensstephensll0.13/src/maks/os/CVS/0042755000175200017560000000000007336072176015062 5ustar stephensstephensll0.13/src/maks/os/CVS/Root0100664000175200017560000000006107336072176015722 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/maks/os/CVS/Repository0100644000175200017560000000002507236675452017161 0ustar stephensstephenshome/ion/src/maks/os ll0.13/src/maks/os/CVS/Entries0100644000175200017560000000021207236675452016411 0ustar stephensstephens/CYGWIN.mak/1.1/Thu Jan 13 11:24:09 2000// /CYGWIN_98-4.10.mak/1.1/Thu Jan 13 11:24:09 2000// /Linux.mak/1.1/Thu Jan 13 11:24:10 2000// D ll0.13/src/maks/os/CYGWIN.mak0100644000175200017560000000013007037332731016100 0ustar stephensstephens# $Id: CYGWIN.mak,v 1.1 2000/01/13 11:24:09 stephensk Exp $ # CYGWIN (generic) exe=.exe ll0.13/src/maks/os/CYGWIN_98-4.10.mak0100644000175200017560000000016407037332731017007 0ustar stephensstephens# $Id: CYGWIN_98-4.10.mak,v 1.1 2000/01/13 11:24:09 stephensk Exp $ # CYGWIN_98-4.10 include $(MAKS)/os/CYGWIN.mak ll0.13/src/maks/os/Linux.mak0100644000175200017560000000011507037332732016203 0ustar stephensstephens# $Id: Linux.mak,v 1.1 2000/01/13 11:24:10 stephensk Exp $ # Linux-specifics ll0.13/src/maks/win32/0042755000175200017560000000000007326751162014746 5ustar stephensstephensll0.13/src/maks/win32/CVS/0042755000175200017560000000000007336072176015403 5ustar stephensstephensll0.13/src/maks/win32/CVS/Root0100664000175200017560000000006107336072176016243 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/maks/win32/CVS/Repository0100644000175200017560000000003007236675452017476 0ustar stephensstephenshome/ion/src/maks/win32 ll0.13/src/maks/win32/CVS/Entries0100644000175200017560000000013007236675452016731 0ustar stephensstephens/Makefile/1.2/Fri Feb 19 09:26:02 1999// /Makefile.use/1.2/Fri Feb 19 09:26:02 1999// D ll0.13/src/maks/win32/Makefile0100644000175200017560000000011306663227052016373 0ustar stephensstephens# $Id: Makefile,v 1.2 1999/02/19 09:26:02 stephensk Exp $ all : clean : ll0.13/src/maks/win32/Makefile.use0100644000175200017560000000014506663227052017173 0ustar stephensstephens# $Id: Makefile.use,v 1.2 1999/02/19 09:26:02 stephensk Exp $ LIBS := kernel32 user32 gdi32 $(LIBS) ll0.13/src/maks/PKG0100744000175200017560000000031607262415714014343 0ustar stephensstephensNAME=maks VERSION=0.2 DESC="A Makefile library. Handles automatic header file dependencies and interpackage dependencies." CATEGORY="Development Tools" REQUIRES_PKGS="../bin" REQUIRES_OTHERS="gnumake sh" ll0.13/src/maks/basic.mak0100744000175200017560000001046707262562266015567 0ustar stephensstephens# $Id: basic.mak,v 1.9 2001/04/04 09:09:10 stephens Exp $ Makefile=Makefile Makefile.use=Makefile.use ########################################################################## # Suffix translation rules # SWIG SWIG.swig=swig $(SWIG_C_FILES_GEN) : $(GEN_FILE_DIR)/$(notdir %)_swig$(c) : %$(swig) $(foreach w,$(SWIG_WRAPPER),$(SWIG.swig) -$w $(SWIG_WRAPPER_$w) -o $(GEN_FILE_DIR)/$(notdir $*)_swig_$(w)$(c) $<;) touch $(GEN_FILE_DIR)/$(notdir $*)_swig$(c) # C %$(c):%$(o) $(C_O_FILES_GEN) : $(O_FILE_DIR)/$(notdir %)$(o) : %$(c) $(COMPILE.c) $< -o $(O_FILE_DIR)/$(notdir $*)$(o) $(C_GEN_O_FILES_GEN) : $(O_FILE_DIR)/%$(o) : $(GEN_FILE_DIR)/%$(c) $(COMPILE.c) $< -o $(O_FILE_DIR)/$*$(o) # C++ %$(cc):%$(o) $(CC_O_FILES_GEN) : $(O_FILE_DIR)/$(notdir %)$(o) : %$(cc) $(COMPILE.cc) $< -o $(O_FILE_DIR)/$(notdir $*)$(o) # yacc %$(y):%$(o) %$(y):%$(c) ifeq "$(strip $(MACHTYPE))" "i586-pc-cygwin32" YACC+= -S '$(CYGFS)/share/bison.simple' else YACC=bison --yacc endif $(Y_C_FILES_GEN) : $(GEN_FILE_DIR)/$(notdir %)$(c) : %.y $(CP) $*$(y) $(GEN_FILE_DIR)/$(notdir $*)$(y) cd $(GEN_FILE_DIR) && $(YACC) -d $(notdir $*)$(y) $(MV) $(GEN_FILE_DIR)/y.tab.c $(GEN_FILE_DIR)/$(notdir $*)$(c) $(MV) $(GEN_FILE_DIR)/y.tab.h $(GEN_FILE_DIR)/$(notdir $*).yh # Java ifneq "$(strip $(JAVA_FILES_ALL))" "" ifeq "$(strip $(JAVA_TIMESTAMP))" "" JAVA_TIMESTAMP=$(JAVA_CLASS_FILE_DIR)/../.jc endif $(JAVA_TIMESTAMP) : $(JAVA_FILES_ALL) '$(JAVAC)' $(JAVACFLAGS) -d $(JAVA_CLASS_FILE_DIR) $(JAVA_FILES_ALL) $(TOUCH) $@ PRODUCTS+=$(JAVA_TIMESTAMP) GARBAGE_DIRS+=$(JAVA_CLASS_FILE_DIR) endif #DIRS += $(GEN_FILE_DIR) ########################################################################## EARLY_TARGETS+= USE_ALL DIRS $(Y_C_FILES_GEN) DEPS ########################################################################## all : $(EARLY_TARGETS) $(PRODUCTS) $(TARGETS) @$(MSG) Made $@ ########################################################################## # Autodependencies # Header deps #$(O_FILES_GEN) : $(H_FILES) DEP_FILE_DIR:=$(O_FILE_DIR) make_dep = $(ECHO) "Making include deps for $<"; $(SHELL) -ec 'o="$(notdir $*)$(o)"; od="$(O_FILE_DIR)/$$o"; d="$(DEP_FILE_DIR)/$(notdir $*).d"; $(CC) -MM $(CPPFLAGS) $< | sed -e "s@$$o[ ]*:@$$od : $(Makefile) $(Makefile.use) @g" > $$d; [ -s $$d ] || rm -f $$d' C_D_FILES += $(_C_FILES_ALL:%.c=$(DEP_FILE_DIR)/$(notdir %).d) $(C_D_FILES) : $(DEP_FILE_DIR)/$(notdir %).d : %.c $(make_dep) CC_D_FILES += $(_CC_FILES_ALL:%.cc=$(DEP_FILE_DIR)/$(notdir %).d) $(CC_D_FILES) : $(DEP_FILE_DIR)/$(notdir %).d : %.cc @$(make_dep) DEPS+= $(C_D_FILES) $(CC_D_FILES) # Disable deps DEPS:= DEPS : DIRS $(DEPS) .PHONY : DEPS GARBAGE+= $(DEPS) GENERATED_DIRS+= $(DEP_FILE_DIR) GARBAGE_DIRS+= $(DEP_FILE_DIR) ifeq "$(strip $(__DISABLE_DEPS__))" "" EARLY_TARGETS+= DEPS ifneq "$(strip $(DEPS))" "" $(DEPS) : $(DEP_FILE_DIR) -include $(DEPS) endif endif ########################################################################## # Use USE_ALL : @for f in $(USE_ALL) . ; \ do \ [ "$$f" = . ] && break; \ $(ECHO) "Using '$$f'" ;\ $(MAKE) -C "$$f" > /dev/null ; \ done .PHONY : USE_ALL ########################################################################## # Directories DIRS+= $(GENERATED_DIRS) $(OUTPUT_DIRS) DIRS:=$(sort $(DIRS)) $(DIRS) : $(MKDIRS) $@ DIRS : $(DIRS) .PHONY : DIRS ########################################################################## # Clean GARBAGE += $(O_FILES_GEN) GARBAGE += $(C_FILES_GEN) GARBAGE += $(PRODUCTS) GARBAGE += core *.core #GARBAGE += *.o clean : rm -f $(filter-out .,$(sort $(GARBAGE))) rm -rf $(filer-out .,$(sort $(GARBAGE_DIRS))) @$(MSG) Made $@ cleanproducts : rm -f $(PRODUCTS) veryclean : clean rm -rf $(filter-out .,$(sort $(GENERATED_DIRS) $(GARBAGE_VERY_DIRS))) @$(MSG) Made $@ archiveclean : veryclean @$(MSG) Made $@ .PHONY : clean veryclean archiveclean cleanproducts ########################################################################## # Archive archive : tgz tgz : archiveclean pwd=`pwd`;dname=`basename $$pwd`;cd ..; $(TAR) -cvf - "$$dname" | $(GZIP) > "$$dname.tgz" .PHONY : archive tgz ######################################################################### # Variable make ifdef vm _vm : $(foreach f,$(vm), $($(f))) @$(MSG) Made $(vm): $< .PHONY : _vm endif ########################################################################## # EOF ll0.13/src/maks/fixpound.pl0100644000175200017560000000025406663227051016167 0ustar stephensstephens# $Id: fixpound.pl,v 1.2 1999/02/19 09:26:01 stephensk Exp $ while ( <> ) { chop; if ( /^#/ ) { print "/* ", $_, "*/\n"; } else { print $_, "\n"; } } ll0.13/src/maks/lib.mak0100744000175200017560000000430607262415714015242 0ustar stephensstephens# $Id: lib.mak,v 1.6 2001/04/03 18:42:08 stephens Exp $ # # Usage: # # LIB_NAME:= # include $(MAKS)/lib.mak # # Adds targets to create a library named LIB_NAME from LIB_O_FILES. # LIB_O_FILES defaults to O_FILES. # ############################################################## # Defaults LIB_PREFIX:=lib# LIB_SUFFIX:=.a# LIB:=$(LIB_DIR)/$(LIB_PREFIX)$(LIB_NAME)$(LIB_SUFFIX)# ifeq "$(strip $(LIB_O_FILES))" "" LIB_O_FILES:=$(O_FILES)# endif ifeq "$(strip $(LIB_LIB_FLAGS))" "" LIB_LIB_FLAGS:=$(LIB_FLAGS) endif ifeq "$(strip $(LIB_LIBS))" "" LIB_LIBS:=$(LIBS) endif ############################################################## # Target ifneq "$(strip $(LIB_DYNAMIC))" "" LIB_DLL_SUFFIX=.dll# LIB_DLL:=$(LIB_DIR)/$(LIB_NAME)$(LIB_DLL_SUFFIX)# LIB_DLL_DEF:=$(LIB_DIR)/$(LIB_NAME).def# ifneq "$(strip $(SWIG2DEF))" "" LIB_SWIG2DEF:=perl $(MAKS)/../bin/swig2def.pl $(SWIG2DEF) > $(LIB_DLL_DEF)# LIB_DEF:=--def $(LIB_DLL_DEF)# else LIB_SWIG2DEF:=true# LIB_DEF:=--output-def $(LIB_DLL_DEF)# endif $(LIB_DLL) $(LIB) : $(LIB_O_FILES) $(LIB_SWIG2DEF) dllwrap --verbose --output-lib $(LIB) $(LIB_DEF) --dllname $(LIB_DLL) $(LIB_O_FILES) $(LIB_LIB_FLAGS) $(foreach l,$(LIB_LIBS),-l'$(l)') else LIB_DLL:=# $(LIB) : $(LIB_O_FILES) -$(RM) $@ $(AR) cr $@ $(LIB_O_FILES) endif $(LIB_DLL) $(LIB) : LIB:=$(LIB) $(LIB_DLL) $(LIB) : LIB_O_FILES:=$(LIB_O_FILES) $(LIB_DLL) $(LIB) : LIB_DLL:=$(LIB_DLL) $(LIB_DLL) $(LIB) : LIB_DLL_DEF:=$(LIB_DLL_DEF) $(LIB_DLL) $(LIB) : LIB_SWIG2DEF:=$(LIB_SWIG2DEF) $(LIB_DLL) $(LIB) : LIB_DEF:=$(LIB_DEF) $(LIB_DLL) $(LIB) : LIB_LIB_FLAGS:=$(LIB_LIB_FLAGS) $(LIB_DLL) $(LIB) : LIB_LIBS:=$(LIB_LIBS) ############################################################## # Alias .PHONY : $(LIB_NAME) $(LIB_NAME) : $(LIB) ############################################################## # Exports LOCAL_LIBS:=$(LOCAL_LIBS) $(LIB)# LIB_PRODUCTS:=$(LIB_PRODUCTS) $(LIB) $(LIB_DLL)# PRODUCTS:=$(PRODUCTS) $(LIB) $(LIB_DLL)# libs :: $(LIB_PRODUCTS) @$(MSG) Made $@: $(LIB_PRODUCTS) .PHONY : libs ############################################################## # Reset vars LIB:=# LIB_NAME:=# LIB_O_FILES:=# LIB_DLL:=# SWIG2DEF:=# ############################################################## # EOF ll0.13/src/maks/pre.mak0100744000175200017560000001501307262415714015257 0ustar stephensstephens# $Id: pre.mak,v 1.10 2001/03/17 20:20:04 stephens Exp $ include $(MAKS)/tools.mak ######################################################################### # Variable query ifdef v _v : @$(foreach f,$(v),$(ECHO) "$(f)='$($(f))'"; ) .PHONY : _v endif ######################################################################### # Variable make ifdef vm _vm : endif ######################################################################### # Default targets all : .PHONY : all clean ######################################################################### # Build Options ifndef DEBUG DEBUG=YES endif export DEBUG ifndef OPTIMIZE OPTIMIZE=NO endif export OPTIMIZE ######################################################################### # Disable RCS and SCCS get % : %,v % : RCS/%,v % : s.% % : SCCS/s.% %.mak : %.use : Makefile : ######################################################################### # Config CWD=$(shell pwd) export CWD ifeq "$(strip $(MAKE_ARCH))" "" MAKE_ARCH:=$(shell uname) export MAKE_ARCH endif ifeq "$(strip $(DEV_ROOT))" "" DEV_ROOT:=$(HOME) export DEV_ROOT endif #DEV_ROOT:=$(strip $(shell cd "$(DEV_ROOT)" && pwd)) ######################################################################### # Directories # libraries go in LIB_DIR ifeq "$(strip $(LIB_DIR))" "" LIB_DIR:=$(DEV_ROOT)/lib/$(MAKE_ARCH) export LIB_DIR endif OUTPUT_DIRS+= $(LIB_DIR) # executables go in TOOL_DIR ifeq "$(strip $(TOOL_DIR))" "" TOOL_DIR:=$(DEV_ROOT)/bin/$(MAKE_ARCH) export TOOL_DIR endif OUTPUT_DIRS+= $(TOOL_DIR) ifeq "$(strip $(GEN_FILE_ROOT))" "" GEN_FILE_ROOT:=mak_gen GARBAGE_VERY_DIRS:=$(GARBAGE_VERY_DIRS) $(GEN_FILE_ROOT) endif # test executables go in TEST_DIR ifeq "$(strip $(TEST_DIR))" "" TEST_DIR:=$(GEN_FILE_ROOT)/$(MAKE_ARCH)/t export TEST_DIR endif OUTPUT_DIRS+= $(TEST_DIR) # object files go in O_FILE_DIR ifeq "$(strip $(O_FILE_DIR))" "" O_FILE_DIR:=$(GEN_FILE_ROOT)/$(MAKE_ARCH)/o export O_FILE_DIR endif #VPATH:=$(VPATH) $(O_FILE_DIR)# # Java class files go in JAVA_CLASS_FILE_DIR ifeq "$(strip $(JAVA_CLASS_FILE_DIR))" "" JAVA_CLASS_FILE_DIR:=$(GEN_FILE_ROOT)/jvm export JAVA_CLASS_FILE_DIR endif ifeq "$(DEBUG)" "YES" JAVACFLAGS+=-g CFLAGS+= $(DEBUG_FLAGS) CXXFLAGS+= $(DEBUG_FLAGS) O_FILE_DIR:=$(strip $(O_FILE_DIR)d) endif ifeq "$(OPTIMIZE)" "YES" JAVACFLAGS+=-O CFLAGS+= $(OPTIMIZE_FLAGS) CXXFLAGS+= $(OPTIMIZE_FLAGS) O_FILE_DIR:=$(strip $(O_FILE_DIR)o) endif GENERATED_DIRS+= $(O_FILE_DIR) # # yacc, lex and other tools put there output in GEN_FILE_DIR ifeq "$(strip $(GEN_FILE_DIR))" "" GEN_FILE_DIR:=$(MAKE_ARCH)/g GEN_FILE_DIR:=$(O_FILE_DIR) export GEN_FILE_DIR endif GENERATED_DIRS+= $(GEN_FILE_DIR) #EARLY_TARGETS+= $(DIRS) # Expect to be using some libs generated by us LIB_DIRS+= $(LIB_DIR) ######################################################################### # Suffixes exe= o=.o c=.c cc=.cc y=.y yy=.yy h=.h hh=.h java=.java class=.class swig=.swig ######################################################################### # Default CC options OPTIMIZE_FLAGS+= -O3 DEBUG_FLAGS+= -g CFLAGS+= -Wall ######################################################################### # Target-specifics include $(MAKS)/os/$(MAKE_ARCH).mak ######################################################################### # BUILD_VARS ifndef BUILD_TARGET export BUILD_TARGET:=$(MAKE_ARCH) endif BUILD_VARS+= BUILD_TARGET ifndef BUILD_DATE export BUILD_DATE:=$(shell date) endif BUILD_VARS+= BUILD_DATE ifndef BUILD_HOST export BUILD_HOST:=$(shell hostname) endif BUILD_VARS+= BUILD_HOST ifndef BUILD_USER export BUILD_USER:=$(USER) endif BUILD_VARS+= BUILD_USER ifndef BUILD_ROOT export BUILD_ROOT:=$(CWD) endif BUILD_VARS+= BUILD_ROOT _DEFINES:= $(foreach v,$(BUILD_VARS),-D'$v="$(${v})"' ) DEFINE_FLAGS:=$(DEFINE_FLAGS) $(_DEFINES) ######################################################################### # BUILD_VARS build_vars_h = $(GEN_FILE_DIR)/build_vars.h build_vars_h : $(dir $(build_vars_h)) $(ECHO) '/* DO NOT MODIFY Generated by maks/pre.mak. */' > $(build_vars_h) $(foreach v,$(BUILD_VARS),$(ECHO) '#define $(v) "$($(v))"' >> $(build_vars_h); ) @$(MSG) Made $@ EARLY_TARGETS+= build_vars_h GARBAGE+= $(build_vars_h) ######################################################################### # Defines DEFINE_FLAGS+= $(foreach f,$(DEFINES), -D'$(f)') ######################################################################### # Includes INCLS+= $(O_FILE_DIR) INCL_FLAGS+= $(foreach f,$(INCLS), -I'$(f)') CPPFLAGS+= $(DEFINE_FLAGS) $(INCL_FLAGS) ######################################################################### # Libs LIB_FLAGS+= $(foreach f,$(LIB_DIRS), -L'$(f)') LIB_FLAGS+= $(foreach f,$(LIBS), -l'$(f)') ######################################################################### # version ######################################################################### # yacc Y_FILES_ALL+= $(Y_FILES) $(Y_FILES_GEN) _Y_FILES_ALL=$(notdir $(Y_FILES_ALL)) Y_C_FILES_GEN+= $(_Y_FILES_ALL:%$(y)=$(GEN_FILE_DIR)/$(notdir %)$(c)) C_FILES_GEN+= $(Y_C_FILES_GEN) ######################################################################### # swig SWIG_WRAPPER=tcl8# SWIG_WRAPPER_tcl8=-namespace -module $(notdir $*) SWIG_FILES_ALL+= $(SWIG_FILES) $(SWIG_FILES_GEN) _SWIG_FILES_ALL=$(notdir $(SWIG_FILES_ALL)) SWIG_C_FILES_GEN+= \ $(_SWIG_FILES_ALL:%$(swig)=$(GEN_FILE_DIR)/$(notdir %)_swig$(c)) SWIG_WRAPPER_C_FILES_GEN+= \ $(foreach w,$(SWIG_WRAPPER),$(_SWIG_FILES_ALL:%$(swig)=$(GEN_FILE_DIR)/$(notdir %)_swig_$(w)$(c))) C_FILES_GEN+= $(SWIG_C_FILES_GEN) $(SWIG_WRAPPER_C_FILES_GEN) ######################################################################### # C C_FILES_ALL+= $(C_FILES)# $(C_FILES_GEN) _C_FILES_ALL=$(notdir $(C_FILES_ALL)) C_O_FILES_GEN+= $(_C_FILES_ALL:%$(c)=$(O_FILE_DIR)/$(notdir %)$(o)) C_GEN_O_FILES_GEN+= $(C_FILES_GEN:%$(c)=%$(o)) O_FILES_GEN+= $(C_O_FILES_GEN) $(C_GEN_O_FILES_GEN) ######################################################################### # C++ CC_FILES_ALL+= $(CC_FILES) $(CC_FILES_GEN) _CC_FILES_ALL=$(notdir $(CC_FILES_ALL)) CC_O_FILES_GEN+= $(_CC_FILES_ALL:%$(cc)=$(O_FILE_DIR)/$(notdir %)$(o)) O_FILES_GEN+= $(CC_O_FILES_GEN) ######################################################################### # Java JAVA_FILES_ALL+= $(JAVA_FILES) $(JAVA_FILES_GEN) _JAVA_FILES_ALL=$(notdir $(JAVA_FILES_ALL)) JAVA_CLASS_FILES_GEN+= $(_JAVA_FILES_ALL:%$(java)=$(CLASS_FILE_DIR)/$(notdir %)$(class)) ######################################################################### # Object files O_FILES+= $(O_FILES_GEN) ######################################################################### # Use -include Makefile.use ll0.13/src/maks/tool.mak0100644000175200017560000000316307065630434015447 0ustar stephensstephens# $Id: tool.mak,v 1.7 2000/03/21 08:21:48 stephensk Exp $ ###################################################################### # Defaults TOOL_SUFFIX:=$(exe) _TOOL_DIR:=$(TOOL_DIR) ifneq "$(TOOL_TEST)" "" TOOL_DIR:=$(TEST_DIR) endif TOOL:=$(TOOL_DIR)/$(TOOL_NAME)$(TOOL_SUFFIX) TOOL_DIR:=$(_TOOL_DIR) ifeq "$(strip $(TOOL_MAIN))" "" TOOL_MAIN:=$(TOOL_NAME).c endif ifeq "$(strip $(TOOL_O_FILES))" "" TOOL_O_FILES:=$(TOOL_MAIN) endif TOOL_O_FILES_$(TOOL):=$(TOOL_O_FILES) ifeq "$(strip $(TOOL_LIBS))" "" TOOL_LIBS:=$(LIBS) endif TOOL_LIBS_$(TOOL):=$(TOOL_LIBS) ifeq "$(strip $(TOOL_LIB_FLAGS))" "" TOOL_LIB_FLAGS:=$(LIB_FLAGS) endif TOOL_LIB_FLAGS_$(TOOL):=$(TOOL_LIB_FLAGS) ###################################################################### # Target $(TOOL) : $(TOOL_O_FILES_$(TOOL)) $(LOCAL_LIBS) $(CC) $(CFLAGS) $(CPPFLAGS) -o '$@' $(TOOL_O_FILES_$(@)) $(TOOL_LIB_FLAGS_$(@)) $(foreach l,$(TOOL_LIBS_$(@)),-l'$(l)') # $(CP) $@ $(notdir $@) GARBAGE:=$(GARBAGE) $(notdir $(TOOL)) ###################################################################### # Aliases .PHONY : $(TOOL_NAME) $(notdir $(TOOL)) $(TOOL_NAME) $(notdir $(TOOL)) : $(TOOL) ###################################################################### # Export the target TOOL_PRODUCTS:=$(TOOL_PRODUCTS) $(TOOL) PRODUCTS:=$(PRODUCTS) $(TOOL) tools :: $(TOOL_PRODUCTS) @$(MSG) Made $@: $(TOOL_PRODUCTS) .PHONY : tools ###################################################################### # Reset vars TOOL_NAME:= TOOL_MAIN:= TOOL_O_FILES:= TOOL_LIBS:= TOOL_LIB_FLAGS:= TOOL_TEST:= ###################################################################### # EOF ll0.13/src/maks/tools.mak0100644000175200017560000000032406765637251015640 0ustar stephensstephens# $Id: tools.mak,v 1.5 1999/09/09 04:59:21 stephensk Exp $ ECHO=echo MSG_PREFIX=+++ MSG=$(ECHO) $(MSG_PREFIX) MKDIR=mkdir MKDIRS=$(MKDIR) -p CP=cp CP_RECURSIVE=$(CP) -rp MV=mv TAR=tar GZIP=gzip -9 GUNZIP=gzip -d ll0.13/src/maks/use.mak0100744000175200017560000000075607262415714015275 0ustar stephensstephens# $Id: use.mak,v 1.4 2001/03/21 02:04:14 stephens Exp $ # # Use a package. # # USE:= # include $(MAKS)/use.mak # # A package's Makefile.use contains the names of libraries # and header directories needed to 'USE' the package. # #USE:=$(strip $(shell cd $(USE) && /bin/pwd)) # Canonicalize the name error USE=$(USE) ifeq "$(findstring $(USE),$(USE_ALL))" "" # Include it once USE_ALL:=$(USE_ALL) $(USE) # Keep track of directories we USEd -include $(USE)/Makefile.use endif ll0.13/src/bin/0042755000175200017560000000000007617523360013621 5ustar stephensstephensll0.13/src/bin/CVS/0042755000175200017560000000000007617523360014254 5ustar stephensstephensll0.13/src/bin/CVS/Root0100664000175200017560000000006107336072177015117 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/bin/CVS/Repository0100644000175200017560000000002107236675451016350 0ustar stephensstephenshome/ion/src/bin ll0.13/src/bin/CVS/Entries0100664000175200017560000000474507617523360015617 0ustar stephensstephens/PKG/1.1.1.1/Wed Feb 17 06:33:07 1999// /addcr/1.5/Wed Feb 17 23:02:18 1999// /addrcsid.pl/1.3/Mon Jun 28 13:55:59 1999// /ccinfo/1.1.1.1/Wed Feb 17 06:33:07 1999// /ccloclibs/1.1.1.1/Wed Feb 17 06:33:07 1999// /ctocnl.c/1.2/Fri Feb 19 09:25:26 1999// /cvschroot.pl/1.3/Wed Feb 17 22:29:09 1999// /cvsclean/1.1/Thu Oct 21 00:01:07 1999// /cvsedited/1.1/Wed Oct 13 21:42:43 1999// /cvsfind.pl/1.4/Thu Oct 21 00:01:07 1999// /cvsretag.pl/1.1/Thu Sep 9 06:11:27 1999// /cvsrevhist.pl/1.6/Tue Mar 21 07:13:26 2000// /cwfixlib.pl/1.2/Fri Feb 19 09:25:26 1999// /d2u.pl/1.8/Sun Jan 14 15:40:36 2001// /ecd/1.1.1.1/Wed Feb 17 06:33:07 1999// /fe/1.1.1.1/Wed Feb 17 06:33:08 1999// /findsource/1.1.1.1/Wed Feb 17 06:33:08 1999// /igrep/1.2/Thu Sep 30 18:41:09 1999// /linkdups/1.1.1.1/Wed Feb 17 06:33:07 1999// /locstatic/1.1.1.1/Wed Feb 17 06:33:08 1999// /lsup/1.2/Thu Sep 30 18:49:41 1999// /mergefiles.pl/1.2/Fri Feb 19 09:25:26 1999// /mkindex/1.2/Thu Sep 30 18:41:09 1999// /mvr.pl/1.1/Wed Oct 13 21:42:44 1999// /nmlibs/1.1.1.1/Wed Feb 17 06:33:07 1999// /nmm/1.1.1.1/Wed Feb 17 06:33:07 1999// /objcsyms/1.1.1.1/Wed Feb 17 06:33:08 1999// /sci/1.1.1.1/Wed Feb 17 06:33:08 1999// /scip/1.1.1.1/Wed Feb 17 06:33:08 1999// /si/1.2/Wed Oct 13 17:09:27 1999// /split.c/1.2/Fri Feb 19 09:25:26 1999// /tgz/1.6/Sun Jan 14 15:41:22 2001// /ts/1.2/Tue Mar 21 07:15:07 2000// /whichall/1.1.1.1/Wed Feb 17 06:33:08 1999// /wwwsend/1.1.1.1/Wed Feb 17 06:33:07 1999// D/addcr.t//// D/lib//// /dos2unix.c/1.1/Fri Apr 8 22:48:41 1994// /swig2def.pl/1.1/Tue Apr 3 18:40:06 2001// /uud/1.3/Tue Apr 3 18:51:54 2001// /uudindex/1.3/Tue Apr 3 18:51:55 2001// /ion_open_url/1.3/Fri Jun 15 07:54:32 2001// /cvsadd_r/1.1/Sat Jun 16 07:29:53 2001// /cvsfix.pl/1.2/Mon Jul 9 05:43:56 2001// /which/1.2/Mon Jul 9 05:43:56 2001// /wwwgrab/1.1/Tue Sep 18 02:57:05 2001// /publish.pl/1.12/Sat Oct 20 04:17:56 2001// /ion_make/1.1/Mon Oct 22 00:47:12 2001// /procmailnow/1.1/Thu Nov 8 02:33:54 2001// /ion_vmware/1.5/Sat Dec 1 02:46:24 2001// /ion_emacs/1.3/Mon Apr 22 06:36:58 2002// /ifdu/1.1/Sat May 11 02:32:22 2002// /ifud/1.1/Sat May 11 02:32:22 2002// /lpr/1.2/Tue Oct 1 21:25:24 2002// /wwwgrab.pl/1.2/Tue Oct 1 21:25:34 2002// /ion_startx/1.6/Tue Oct 1 21:26:14 2002// /ion_faxview/1.2/Tue Oct 1 21:26:29 2002// /cuecatlibrary.pl/1.3/Tue Oct 1 21:26:45 2002// /ion_dockstatn/1.1/Tue Oct 1 21:27:22 2002// /ion_getphoto/1.1/Tue Oct 1 21:27:22 2002// /tablefmt.pl/1.1/Sun Aug 11 23:39:56 2002// /cvschrep.pl/1.4/Mon Feb 3 17:46:29 2003// ll0.13/src/bin/addcr.t/0042755000175200017560000000000007364665511015144 5ustar stephensstephensll0.13/src/bin/addcr.t/CVS/0042755000175200017560000000000007364665771015607 5ustar stephensstephensll0.13/src/bin/addcr.t/CVS/Entries0100644000175200017560000000006107364665771017133 0ustar stephensstephens/run/1.1/Wed Feb 17 23:02:18 1999// D/backup//// ll0.13/src/bin/addcr.t/CVS/Root0100664000175200017560000000006107336072177016436 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/bin/addcr.t/CVS/Repository0100644000175200017560000000003107236675451017670 0ustar stephensstephenshome/ion/src/bin/addcr.t ll0.13/src/bin/addcr.t/backup/0042755000175200017560000000000007364665511016411 5ustar stephensstephensll0.13/src/bin/addcr.t/backup/CVS/0042755000175200017560000000000007364665511017044 5ustar stephensstephensll0.13/src/bin/addcr.t/backup/CVS/Root0100644000175200017560000000006107364665511017702 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/bin/addcr.t/backup/CVS/Repository0100644000175200017560000000004007364665511021133 0ustar stephensstephenshome/ion/src/bin/addcr.t/backup ll0.13/src/bin/addcr.t/backup/CVS/Entries0100644000175200017560000000023307364665511020371 0ustar stephensstephens/t1.c/1.2/Fri Feb 19 09:25:27 1999// /t2/1.1.1.1/Wed Feb 17 06:33:08 1999// /t3/1.1.1.1/Wed Feb 17 06:33:08 1999// /t4/1.2/Wed Feb 17 23:02:19 1999/-kb/ D ll0.13/src/bin/addcr.t/backup/t1.c0100644000175200017560000000040406663227007017065 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_backup_t1_c__ #define __rcs_id_backup_t1_c__ static const char __rcs_id_backup_t1_c[] = "$Id: t1.c,v 1.2 1999/02/19 09:25:27 stephensk Exp $"; #endif #endif /* __rcs_id__ */ L1 /* @COPYRIGHT@ Blah ** @COPYRIGHT END@ */ L2 ll0.13/src/bin/addcr.t/backup/t20100644000175200017560000000002406662461244016645 0ustar stephensstephens#!/bin/sh #L1 L2 L3 ll0.13/src/bin/addcr.t/backup/t30100644000175200017560000000005106662461244016646 0ustar stephensstephens#!/usr/local/bin/scheme ; L1 L2 L3 ll0.13/src/bin/addcr.t/backup/t40100644000175200017560000000057306662645173016665 0ustar stephensstephensLèV.textD+Üâ» `.data ,bý|@À.bss€À.stab,% 1:+R.stabstrÆ‹LVRopportobj_writePortbooleanU‰å¡‹P‰ÐÁøƒø~¡‹P‰ÐÁøƒøëèè‰Â‰ÐëÉÃ#f#t‰öU‰åƒìS¡‰Eü‹Eü‹‹J‰ÊÁúJý‹ˉ]ø‹Eü‹Â‹ ll0.13/src/bin/addcr.t/run0100644000175200017560000000021706662645172015667 0ustar stephensstephens#!/bin/sh # Test script for addcr # $Id: run,v 1.1 1999/02/17 23:02:18 stephensk Exp $ # set -x rm t[0-9]* cp backup/* . perl ../addcr t[0-9]* ll0.13/src/bin/lib/0042755000175200017560000000000007326751147014372 5ustar stephensstephensll0.13/src/bin/lib/CVS/0042755000175200017560000000000007336072177015025 5ustar stephensstephensll0.13/src/bin/lib/CVS/Root0100664000175200017560000000006107336072177015665 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/bin/lib/CVS/Repository0100644000175200017560000000002507236675451017122 0ustar stephensstephenshome/ion/src/bin/lib ll0.13/src/bin/lib/CVS/Entries0100644000175200017560000000001307236675451016351 0ustar stephensstephensD/perl//// ll0.13/src/bin/lib/perl/0042755000175200017560000000000007326751147015334 5ustar stephensstephensll0.13/src/bin/lib/perl/CVS/0042755000175200017560000000000007336072177015767 5ustar stephensstephensll0.13/src/bin/lib/perl/CVS/Root0100664000175200017560000000006107336072177016627 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/bin/lib/perl/CVS/Repository0100644000175200017560000000003207236675451020062 0ustar stephensstephenshome/ion/src/bin/lib/perl ll0.13/src/bin/lib/perl/CVS/Entries0100644000175200017560000000001207236675451017312 0ustar stephensstephensD/ion//// ll0.13/src/bin/lib/perl/ion/0042755000175200017560000000000007326751147016121 5ustar stephensstephensll0.13/src/bin/lib/perl/ion/CVS/0042755000175200017560000000000007336072177016554 5ustar stephensstephensll0.13/src/bin/lib/perl/ion/CVS/Root0100664000175200017560000000006107336072177017414 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/bin/lib/perl/ion/CVS/Repository0100644000175200017560000000003607236675451020653 0ustar stephensstephenshome/ion/src/bin/lib/perl/ion ll0.13/src/bin/lib/perl/ion/CVS/Entries0100644000175200017560000000001307236675451020100 0ustar stephensstephensD/_cvs//// ll0.13/src/bin/lib/perl/ion/_cvs/0042755000175200017560000000000007364175364017056 5ustar stephensstephensll0.13/src/bin/lib/perl/ion/_cvs/CVS/0042755000175200017560000000000007364175365017512 5ustar stephensstephensll0.13/src/bin/lib/perl/ion/_cvs/CVS/Root0100664000175200017560000000006107336072177020346 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/bin/lib/perl/ion/_cvs/CVS/Repository0100644000175200017560000000004307236675451021603 0ustar stephensstephenshome/ion/src/bin/lib/perl/ion/_cvs ll0.13/src/bin/lib/perl/ion/_cvs/CVS/Entries0100664000175200017560000000017307364175365021044 0ustar stephensstephens/find.pm/1.9/Sat Jun 2 10:09:00 2001// /entry.pm/1.5/Sat Oct 20 04:17:56 2001// /rlog.pm/1.3/Sat Oct 20 04:17:56 2001// D ll0.13/src/bin/lib/perl/ion/_cvs/entry.pm0100644000175200017560000000210307364175364020544 0ustar stephensstephens#!/usr/local/bin/perl # $Id: entry.pm,v 1.5 2001/10/20 04:17:56 stephens Exp $ package ion::_cvs::entry; #print STDERR "ion::_cvs::entry\n"; @map = ( 'type', 'file', 'revision', 'date', 'extra', 'sticky', 'path', 'Repository', 'Filepath' ); %map = (); foreach $_ ( 0 .. $#map ) { my($s) = $map[$_]; my($c) = substr($s, 0, 1); die "Check @map" if ( $map{$c} ); $map{$c} = $_; $map{$s} = $_; } sub type { $_[0]->[0]; } sub isFile { $_[0]->type() ne 'D'; } sub isDirectory { $_[0]->type() eq 'D'; } sub name { $_[0]->[1]; } sub version { $_[0]->[2]; } sub revision { # alias $_[0]->[2]; } sub date { $_[0]->[3]; } sub other { $_[0]->[4]; } sub sticky { $_[0]->[5]; } sub path { $_[0]->[6]; } sub repository { $_[0]->[7]; } sub fullpath { $_[0]->[8]; } sub rlog { if ( ! defined $_[0]->[9] ) { eval 'use ion::_cvs::rlog;'; $_[0]->[9] = ion::_cvs::rlog($_[0]->fullpath, ($_[1] ? $_[1] : $ion::_cvs::rlog::options)); } } sub clear_rlog { $_[0]->[9] = undef; } sub make { my($x) = @_; bless $x; } 1; ll0.13/src/bin/lib/perl/ion/_cvs/find.pm0100644000175200017560000000634007306135474020324 0ustar stephensstephens#!/usr/local/bin/perl # $Id: find.pm,v 1.9 2001/06/02 10:09:00 stephens Exp $ use ion::_cvs::entry; ######################################################### package ion::_cvs; #print STDERR "ion::_cvs::find\n"; use Cwd; use File::Find; use File::Basename; $debug = 0; $testing = 0; $find::show_funny_entries = 0; $find::all_files = 0; sub read_CVS_Entries { my($dir) = @_; my($in); my($Repository); $in = "$dir/CVS/Repository"; if ( -f $in ) { open($in, "<$in") || die "$in: $!"; $Repository = <$in>; chop $Repository; close($in); } $in = "$dir/CVS/Entries"; if ( -f $in ) { my(@entries); my($line); my($lineno) = 0; open($in, "<$in") || die "$in: $!"; while ( $line = <$in> ) { chomp $line; $lineno ++; my($rec); $rec = [ split('/', $line) ]; if ( $#{$rec} > 0 ) { $rec->[6] = $dir; $rec->[7] = $rec->[0] eq 'D' ? "$Repository/$rec->[1]" : "$Repository/$rec->[1],v"; $rec->[8] = $rec->[6] . '/' . $rec->[1]; #print join('+', $#{$rec}, @{$rec}), "\n"; ion::_cvs::entry::make($rec); #print join('-', $#{$rec}, @{$rec}), "\n"; #die "$in:$lineno:$line" if ( $#{$rec} <= 0 ); push(@entries, $rec); } else { warn "$in:$lineno: funny entry: '$line'\n" if ( $ion::_cvs::find::show_funny_entries ); } } close($in); @entries; } else { 0; } } sub do_entry { my($entry, $proc, $data) = @_; #print join('|', $#{$rec}, @{$rec}), "\n"; &{$proc}($entry, $data); if ( $entry->[0] eq 'D' ) { my($se); foreach $se ( read_CVS_Entries($entry->[8]) ) { &{$proc}($se, $data); do_entry($se, $proc, $data); } } } ######################################################### sub wanted { print STDERR "wanted: $File::Find::name\n" if ( $debug ); if ( $_ eq 'CVS' ) { $File::Find::prune = 1; } else { if ( -d && (-f "$_/CVS/Entries" || -f "../CVS/Entries") ) { #print STDERR "Found dir $File::Find::name\n"; push(@found_files, $File::Find::name); $File::Find::prune = 1; } elsif ( -f ) { #print STDERR "Found file $File::Find::name\n"; push(@found_files, $File::Find::name); } } } sub find { my($proc, $data, @files) = @_; # Collect files under CVS control @found_files = (); my($save_cwd) = getcwd; File::Find::find(\&wanted, @files); chdir($save_cwd) || die "$save_cwd: $!"; ######################################################### #print STDERR "files = (", join("\n\t", @files), ")\n"; my($path); foreach $path ( @found_files ) { my($dir, $file); my($entry); $dir = dirname($path); $file = basename($path); print STDERR "$path:$dir:$file\n" if ( $debug ); if ( -d $path && -f "$path/CVS/Entries" ) { print STDERR "$path is a dir\n" if ( $debug ); foreach $entry ( read_CVS_Entries($path) ) { do_entry($entry, $proc, $data); } } elsif ( $file ne '.' && -f "$dir/CVS/Entries" ) { #print STDERR "Search for $file in $dir/CVS\n"; ENTRY: foreach $entry ( read_CVS_Entries($dir) ) { #print STDERR "Entry name $entry->[1]\n"; if ( $file eq $entry->[1] ) { print STDERR "Found entry for $file in $dir/CVS\n" if ( $debug); do_entry($entry, $proc, $data); last ENTRY; } } } } } 1; ll0.13/src/bin/lib/perl/ion/_cvs/rlog.pm0100644000175200017560000001222407364175364020353 0ustar stephensstephens#!/usr/local/bin/perl # $Id: rlog.pm,v 1.3 2001/10/20 04:17:56 stephens Exp $ package ion::_cvs; ######################################################## $debug = 0; $testing = 0; ######################################################## $RLOG = $ENV{RLOG} if ( ! defined $RLOG ); $RLOG = 'cvs log' if ( ! defined $RLOG ); sub END { unlink($tmp) if ( defined $tmp ); } sub rlog { my($vfile, $opts) = @_; my $vdir = '.'; my($obj) = {}; #my($debug) = 3; $opts = {} if ( ! defined $opts ); $opts->{RLOG} = $RLOG if ( ! defined $opts->{RLOG} ); if ( $opts->{RLOG} =~ /cvs/i ) { $vfile =~ s/,v$//s; ($vdir, $vfile) = ($vfile =~ m@^(.*)/([^/]+)@); } $obj->{vfile} = $vfile; $obj->{revisions} = []; $obj->{revision} = {}; $obj->{symbolic_names} = []; $obj->{sym_name_to_rev} = {}; $obj->{rev_to_sym_names} = {}; $obj->{filter} = $opts->{filter}; ############################################ # Run rlog into temp file my($in) = "rlog" . abs($$) . ".tmp"; $tmp = $in; my($cmd) = qq((cd '$vdir' && $opts->{RLOG} $obj->{filter} '$obj->{vfile}') > $in); #print STDERR "in " . getcwd . ": $cmd\n" if ( 1 || $debug > 0 ); #die "STOP"; if ( system($cmd) ) { unlink($in); return undef; } ############################################ # Slurp in the whole file open($in, "<$in") || die "$cmd: $in: $!"; my(@lines); my($line); my($lineno) = 0; while ( defined ($line = <$in>) ) { chomp $line; print "$vfile: $line\n" if ( $debug > 2 ); push(@lines, $line); } close($in); unlink($tmp); undef $tmp; exit if ( $debug > 3 ); ############################################ # Begin scan $lineno = 0; if ( defined($line = shift @lines) ) { $lineno ++; } ############################################ # Scan header while ( defined $line && ($line !~ /^(-+|=+)$/) ) { if ( $line =~ /^([^:]+):\s*(.*)$/ ) { my($key, $value) = ($1, $2); if ( $key eq 'symbolic names' ) { ############################################ # Scan symbolic names print STDERR "Found symbolic names: $lineno:$line\n" if ( $debug > 1 ); if ( defined($line = shift @lines) ) { $lineno ++; } while ( defined $line && ($line =~ /^\s/) ) { print STDERR "Try sym_name: $lineno:$line\n" if ( $debug > 2 ); if ( $line =~ /^\s+([^\s:]+)\s*:\s*([\.0-9]+)/ ) { print STDERR "Matched sym_name '$1' '$2': $lineno:$line\n" if ( $debug > 1 ); push(@{$obj->{symbolic_names}}, $1); $obj->{sym_name_to_rev}->{$1} = $2; my($a); $a = $obj->{rev_to_sym_names}->{$2}; $a = $obj->{rev_to_sym_names}->{$2} = [] if ( ! defined $a ); push(@{$a}, $1); } if ( defined($line = shift @lines) ) { $lineno ++; } } } else { $key =~ tr/a-zA-Z0-9_/_/c; $value =~ s/\s+$//; print STDERR "Found key='$key' value='$value': $lineno:$line\n" if ( $debug > 2 ); $value = [ split(/\s+/, $value) ]; $obj->{$key} = $value; if ( defined($line = shift @lines) ) { $lineno ++; } } } else { if ( defined($line = shift @lines) ) { $lineno ++; } } } if ( defined($line = shift @lines) ) { $lineno ++; } while ( defined $line && $line !~ /^=+$/ ) { my($v) = {}; ############################################ # Scan 'revision:' print STDERR "Try revision: $lineno:$line\n" if ( $debug > 2); if ( $line =~ s/^revision[ :]// ) { $line =~ s/\s+;?\s*$//; $v->{revision} = $line; push(@{$obj->{revisions}}, $line); $obj->{revision}->{$line} = $v; $v->{symbolic_names} = $obj->{rev_to_sym_names}->{$line} || []; if ( defined($line = shift @lines) ) { $lineno ++; } print STDERR "Matched revision '$v->{revision}': $lineno:$line\n" if ( $debug > 1 ); } print STDERR "After revision '$v->{revision}': $lineno:$line\n" if ( $debug > 1 ); while ( $line =~ /^\s*$/ ) { print STDERR "Eat blank line: $lineno:$line\n" if ( $debug > 1 ); if ( defined($line = shift @lines) ) { $lineno ++; } } ############################################ # Scan ': ;' KEY1: while ( defined $line && $line ne '' ) { $line =~ s/^\s+//; if ( $line =~ s/^([a-zA-Z_]+)\s*:\s*([^;]+)(;|$)// ) { print STDERR "Matched key '$1' '$2': $lineno:$line\n" if ( $debug > 1 ); $v->{$1} = $2; } else { last KEY1; } } if ( defined($line = shift @lines) ) { $lineno ++; } ############################################ # Scan 'branches: ' if ( $line =~ s/^branches:\s*// ) { $line =~ s/\s+$//; $v->{branches} = [ split(/\s/, $line) ]; print STDERR "Matched branches: '$1': $lineno:$line\n" if ( $debug > 1 ); if ( defined($line = shift @lines) ) { $lineno ++; } } ############################################ # Scan comment $v->{comment} = ''; while ( defined $line && ($line !~ /^(-+|=+)$/) ) { $line =~ s/^\s+//; $line =~ s/\s+$//; if ( $line ne '' && $line !~ m@^\s*\*\*\* empty log message \*\*\*\s*$@ ) { $v->{comment} .= $line . "\n"; print STDERR "Comment: $line\n" if ( $debug > 1 ); } if ( defined($line = shift @lines) ) { $lineno ++; } } if ( defined($line = shift @lines) ) { $lineno ++; } } $obj; } 1; ll0.13/src/bin/procmailnow0100755000175200017560000000057407372367422016105 0ustar stephensstephens#!/bin/sh ORGMAIL=/var/spool/mail/$LOGNAME if cd $HOME && test -s $ORGMAIL && lockfile -r0 -l1024 .newmail.lock 2>/dev/null then trap "rm -f .newmail.lock" 1 2 3 13 15 umask 077 lockfile -l1024 -ml cat $ORGMAIL >>.newmail && cat /dev/null >$ORGMAIL lockfile -mu formail -s procmail <.newmail && rm -f .newmail rm -f .newmail.lock fi exit 0 ll0.13/src/bin/ion_emacs0100755000175200017560000000107107460727612015500 0ustar stephensstephens#!/bin/sh # $Id: ion_emacs,v 1.3 2002/04/22 06:36:58 stephens Exp $ #set -x # Attempt to run emacsclient on the filenames passed # If no files are passed then open /dev/null. if [ $# -gt 0 ] then if [ -n "$1" -a ! -f "$1" ] then touch -f "$1" fi emacsclient --no-wait "$@" 2>/dev/null else emacsclient --no-wait "$HOME" 2>/dev/null fi # If emacsclient failed, run emacs. if [ $? != 0 ] then # Use reverse video. __emacs="emacs -bg white -fg black --reverse-video" if [ $# -gt 0 ] then exec $__emacs "$@" else exec $__emacs fi fi ll0.13/src/bin/PKG0100644000175200017560000000034606662461243014163 0ustar stephensstephensNAME=bin VERSION=0.1 DESC="A development script library. Tools for: publishing PKG packages, adding COPYRIGHT and RCS version strings to source files, etc." CATEGORY="Development Tools" REQUIRES_PKGS="" REQUIRES_OTHERS="perl sh" ll0.13/src/bin/addcr0100644000175200017560000002206706662645172014630 0ustar stephensstephens#!/usr/local/bin/perl # @COPYRIGHT@ # # Copyright (c) 1997-1999 Kurt A. Stephens and ION, Inc., All Rights Reserved. # # http://www.acm.org/~stephensk # # Kurt A. Stephens and Ion, Inc. MAKE NO REPRESENTATIONS OR WARRANTIES # ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING # BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR # A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Kurt A. Stephens or Ion, Inc. # SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF # USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. # # $Id: addcr,v 1.5 1999/02/17 23:02:18 stephensk Exp $ # # @COPYRIGHT END@ ($progname = $0) =~ s@^.*[/\\]@@; $progdir = ($0 =~ m@^(.*)[/\\]@) ? $1 : '.'; #print STDERR "progdir = '$progdir', progname = '$progname'\n"; exit(1); @comments = ( [ '/\.(o|obj|lib|a|exe|com|out|bak)$/i || /,v$/i || /~$/ || -B $filename', 0 ], # Ignore object, backup, RCS, emacs backups, and binary files [ '/$backup_suffix$/i', 0 ], # Ignore our backup files [ '/\.([CchHyYlL]+|java)$/i || firstline_() =~ /^\s*(#\s*include|#\s*if|#\s*define|\/\*|\/\/)/', [ '/*', '**', '*/' ] ], [ '/\.(el|scm|ll|lisp)$/i || firstline_() =~ /^\s*;/', [ ';' ] ], [ '/\.(bat)$/i', [ 'REM ' ] ], # DOS BAT files [ '/Makefile.*|(\.(mak|pl|pm|perl|[ck]?sh))$/i || firstline() =~ /^\s*#/', [ '#' ] ] ); foreach $x ( @comments ) { die "$!: Cannot compile $x->[0]" if ( ! ($x->[2] = eval("sub { $x->[0]; }")) ); $x->[1]->[1] = $x->[1]->[0] if ( ! defined($x->[1]->[1]) ); $x->[1]->[2] = '' if ( ! defined($x->[1]->[2]) ); } ################################## sub firstline { local(*F); if ( $_firstline_filename eq $filename ) { return $_firstline; } $_firstline_filename = $filename; open(F, "<$filename") || warn "$!: Cannot open $filename for reading"; $F = ; close(F); chop $F; $_firstline = $F; $F; } sub firstline_ { # Get first non-blank line, skipping first line if it's "#!" local(*F); if ( $_firstline__filename eq $filename ) { return $_firstline_; } $_firstline__filename = $filename; open(F, "<$filename") || warn "$!: Cannot open $filename for reading"; $F = ; #print STDERR "firstline_ = '$F'\n"; $F = if ( $F =~ /^\#\!/ ); #print STDERR "firstline_ = '$F'\n"; chop $F; while ( $F =~ /^\s*$/ ) { $F = ; chop $F; } close(F); $_firstline_ = $F; #print STDERR "firstline_ = '$F'\n"; $F; } ################################## $replacestr = 'COPYRIGHT'; $replacefile = $replacestr; $filename = '.'; $testing = 0; $debug = 0; $backup_suffix = '.acr'; $rm_backup = 0; $dryrun = 0; $usage = 0; $recursive = 0; sub findfile { my($replacedir); $replacedir = ($filename =~ m@^(.*)[/\\]@) ? $1 : '.'; #print STDERR "replacedir = '$replacedir'\n"; while ( ! -r ($FILE = "$replacedir/$replacefile") ) { $replacedir .= "/.."; if ( $replacedir eq './../../../../../../../../../..' ) { die "Cannot locate $replacefile" if ( ! $usage ); return ""; } } $FILE; } sub insertfile { # Begin replace block print OUT $comments->[0], ' @', $replacestr, '@', "\n"; print OUT $comments->[1], "\n"; # Open comment text file open(FILE, "<$FILE") || die "$!: Cannot open $FILE for reading"; # Insert the comment text while ( $line = ) { print OUT $comments->[1], ' ', $line; } close(FILE); # End replace block print OUT $comments->[1], "\n"; print OUT $comments->[1], ' @', $replacestr, ' END@ ', $comments->[2], "\n"; # Copy rest of IN file if ( defined($firstline) ) { print OUT $firstline; $firstline = undef; } while ( $line = ) { print OUT $line; } close(IN); close(OUT); if ( (! $testing) && $rm_backup ) { system('rm', $IN); } print STDERR "$progname: $filename: found and replaced preexisting $replacestr block\n" if ( $debug ); 1; } sub replacestr { local($comments) = @_; local(*IN,*OUT,*FILE); local($line, $firstline); # Find the replacement text file $FILE = findfile(); if ( $dryrun ) { print "$progname: $filename: $FILE: $comment->[0]: $comment->[1]: $comment->[2]\n"; } $_ = $filename; if ( $testing ) { $OUT = $filename . $backup_suffix; $IN = $filename; } else { # We move the file to $IN $OUT = $filename; $IN = $filename . $backup_suffix; if ( -f $IN ) { print STDERR "$progname: backup file $IN already exists\n"; return 0; } if ( ! (-w && -r && -f) ) { print STDERR "$progname: $filename: file not read/write\n"; return 0; } system('mv', $OUT, $IN) && die "$!: Cannot mv $OUT $IN"; } # Open IN and OUT files open(OUT, ">$OUT") || die "$!: Cannot open $OUT for writing"; open(IN, "<$IN") || die "$!: Cannot open $IN for reading"; # Read first line if ( ($line = ) ) { # If first line contains 'DO NOT MODIFY', don't do anything! if ( $line =~ /DO NOT MODIFY/i ) { print STDERR "$progname: $filename: found 'DO NOT MODIFY'\n" if ( $debug ); close(IN); close(OUT); # Restore original file if ( ! $testing ) { system('mv', $IN, $OUT); } return 0; } } while ( $line ) { # Have we found a preexisting replace string if ( $line !~ /@$replacestr@/ ) { # Simply echo to OUT print OUT $line; } else { print STDERR "$progname: $filename: found '\@$replacestr\@'\n" if ( $debug ); # Skip over input comment block while ( ($line = ) ) { if ( $line =~ /@$replacestr END@/ ) { print STDERR "$progname: $filename: found '\@$replacestr END\@' terminator\n" if ( $debug ); return insertfile(); } } # Did not find END terminator! print STDERR "$progname: $filename: did not find '\@$replacestr END\@' terminator\n"; close(IN); close(OUT); open(OUT, ">$OUT") || die "$!: Cannot open $OUT for writing"; open(IN, "<$IN") || die "$!: Cannot open $IN for reading"; while ( ($line = ) ) { if ( $line =~ /@$replacestr@/ ) { return insertfile(); } else { print OUT $line; } } } $line = ; } # We never found a preexisting comment block; # insert $FILE after #! line. print STDERR "$progname: $filename: did not find preexisting $replacestr block\n" if ( $debug ); close(IN); close(OUT); open(OUT, ">$OUT") || die "$!: Cannot open $OUT for writing"; open(IN, "<$IN") || die "$!: Cannot open $IN for reading"; # Skip over first shell script #! line $firstline = ; if ( $firstline =~ /^#!\// ) { print STDERR "$progname: $filename: skipping first line '$firstline'\n" if ( $debug ); print OUT $firstline; $firstline = undef; } insertfile(); } sub getdir { local(*DIR); $DIR = $_[0]; opendir(DIR, $DIR); @DIR = grep(($_ ne '.' && $_ ne '..'), readdir DIR); closedir(DIR); print STDERR "getdir: $DIR: ", join(", ", @DIR), "\n" if ( $debug > 2 ); @DIR; } sub dofile { $filename = $_[0]; $_ = $filename; s@^.*[/\\]@@; # remove directory path print STDERR "$progname: $filename: dofile\n" if ( $debug > 1 ); if ( -r $filename && -w $filename ) { if ( -d $filename ) { my($fuc) = uc($_); if ( $fuc =~ /^CVS/ || $fuc eq 'RCS' || $fuc eq 'SCCS' ) { print STDERR "$progname: $filename: skipping dir\n" if ( 1 || $debug ); } elsif ( $recursive ) { print STDERR "$progname: $filename: recursing\n" if ( $debug ); my($dirname) = $filename; foreach $_ ( getdir($dirname) ) { dofile("$dirname/$_"); } } else { print STDERR "$progname: $filename: skipping\n"; } } else { X: foreach $x ( @comments ) { print STDERR "$progname: $filename: trying $x->[0]\n" if ( $debug > 1); if ( $x->[2] ) { if ( &{$x->[2]}() ) { print STDERR "$progname: $filename: matched $x->[0]\n" if ( $debug > 1); if ( $x->[1] ) { print STDERR "$progname: $filename: not modified\n" if ( ! replacestr($x->[1]) ); } else { print STDERR "$progname: $filename: skipping\n"; } last X; } } else { die "$progname: no proc for $x->[0]\n"; } } } } else { print STDERR "$progname: $filename: cannot read or write\n"; } } sub usage { $usage = 1; print STDERR qq~ $progname: usage: $progname ... $progname replaces \@$replacestr\@ with contents of the $replacefile file. OPTIONS -dryrun Do a dryrun. -debug Enable debugging. -testing Enable testing. -R If directories are specified, they are traversed recursively. -h, -? This usage message. The current $replacefile file is located at ~ . &findfile() . "\n"; exit(0); } #push(@ARGV, '.') if ( ! @ARGV ); foreach ( @ARGV ) { if ( s/^--?// ) { if ( /^[Hh\?]/ ) { &usage; } elsif ( /^dr/ ) { $dryrun ++; } elsif ( /^d/ ) { $debug ++; } elsif ( /^t/ ) { $testing ++; } elsif ( /^(R|rec)/ ) { $recursive ++; } else { print STDERR "$progname: $_: unrecognized option\n"; } } else { dofile($_); } } 1; ll0.13/src/bin/addrcsid.pl0100644000175200017560000000647106735677357015756 0ustar stephensstephens#!/usr/local/bin/perl # $Id: addrcsid.pl,v 1.3 1999/06/28 13:55:59 stephensk Exp $ # # addrcsid.pl ... # # Recursively add $Id: addrcsid.pl,v 1.3 1999/06/28 13:55:59 stephensk Exp $ strings to source files. # Avoids CVS, RCS, and SCCS directories and binary and ',v' files. # # TO DO: # use @comment array from addcr.pl to control comment characters and such # use File::Basename; use File::Find; $progname = basename($0); sub skip_first_lines { $suffix = '.scm' if ( $suffix =~ /^\.(scm|lisp|ll|el)$/i ); # Skip lines until after %{ for yacc files if ( $suffix =~ /^\.[yl]/i ) { LINE: while ( $line = <$in> ) { print $out $line; last LINE if ( $line =~ /^\s*%\{/ ); } } elsif ( $suffix =~ /^\.h/i ) { $line = <$in>; if ( $line =~ /^\s*#\s*if/ ) { print $out $line; $line = <$in>; } } else { $line = <$in>; if ( $line =~ /^\s*\#!/ ) { print $out $line; $line = <$in>; } } $line; } $rcs_id_str = '$Id: addrcsid.pl,v 1.3 1999/06/28 13:55:59 stephensk Exp $'; sub print_rcs_id { if ( $suffix =~ /^\.[ychlm]/i ) { print $out qq~ #ifndef __rcs_id__ #ifndef __rcs_id_${ftoken}__ #define __rcs_id_${ftoken}__ static const char __rcs_id_${ftoken}[] = "$rcs_id_str"; #endif #endif /* __rcs_id__ */ ~; } elsif ( $suffix =~ /^.htm/ ) { print $out qq~ ~; } elsif ( $suffix eq '.java' ) { print $out qq~/* $rcs_id_str */ ~; } else { my($com) = '#'; $com = ';' if ( $suffix =~ /^\.(scm|lisp|ll|el)$/ ); print $out qq~$com $rcs_id_str ~; } } sub do_file { #print STDERR "$progname: do_file($File::Find::dir/$_)\n"; if ( ( -d && /^(CVS|RCS|SCCS)/i ) || /,v$/ ) { $File::Find::prune = 1; } elsif ( -f && -r && ! -B && ( /(\.[a-zA-Z_0-9]+)$/i || /^makefile/i ) ) { local($suffix) = $1; my($found) = 0; local($in, $out); local($line); # In and out files $in = $_; $out = "$_.tmp"; # Generate a C token for the filename local($ftoken) = $File::Find::name; $ftoken = $1 if ( $ftoken =~ m@([^\\/]+[\\/][^\\/]+)$@ ); $ftoken =~ tr/A-Za-z_0-9/_/c; # open files die "$out exists" if ( -e $out ); open($out, ">$out") || die "$out: $!: "; open($in, "<$in") || die "$in: $!: "; skip_first_lines(); while ( $line ) { if ( $line =~ /DO NOT MODIFY/ ) { print STDERR "$progname: DO NOT MODIFY: skipping $File::Find::dir/$_\n"; close($in); close($out); unlink($out); return; } #locate prexisting rcs id block */ if ( $line =~ /^\s*\#\s*ifndef\s+__rcs_id__/ ) { $found = 1; # skip block while ( $line = <$in> && $line !~ m@^\s*\#\s*endif\s*/\*\s*__rcs_id__\s*\*/@ ) { 1; } print_rcs_id(); } print $out $line; $line = <$in>; } close($in); close($out); if ( ! $found ) { open($out, ">$out") || die "$out: $!: "; open($in, "<$in") || die "$in: $!: "; # Skip first lines skip_first_lines(); # Put rcs id print_rcs_id(); # write rest of file while ( $line ) { print $out $line; $line = <$in>; } close($in); close($out); } if ( -w $in ) { unlink($in); rename($out, $in); print STDERR "$progname: $File::Find::dir/$in\n" } else { print STDERR "$progname: $File::Find::dir/$in not writable: result in $File::Find::dir/$out\n"; } } } File::Find::find(\&do_file, @ARGV); 1; ll0.13/src/bin/ccinfo0100644000175200017560000001177606662461243015014 0ustar stephensstephens#!/run/thirdParty/perl5/bin/perl eval 'exec /run/thirdParty/perl5/bin/perl $0 ${1+"$@"}' if 0; $cwd = 0; sub cwd { if ( ! $cwd ) { chop($cwd = `/bin/pwd`); $cwd = simplifyPathname($cwd); #print STDERR "cwd = $cwd\n"; } $cwd; } sub simplifyPathname { my($p) = $_[0]; $p =~ s@^/private/@/@; $p =~ s@//@/@g; $p =~ s@/\./@/@g; while ( $p =~ s@/[^/]+/\.\./@/@ ) { } #print STDERR "simplifyPathname $_[0] -> $p\n"; $p; } #for ( @ARGV ) { # print $_, " => ", simplifyPathname($_), "\n"; #} #exit 0; sub absPathname { my($f) = $_[0]; $f = ($f =~ m@^/@) ? $f : simplifyPathname(cwd() . "/" .$f); #print STDERR "absPathname $_[0] -> $f\n"; $f; } sub filePathname { my($f) = $_[0]; $f = ($f =~ m@([^/]+)$@) ? $1 : $f; #print STDERR "filePathname $_[0] -> $f\n"; $f; } sub suffixPathname { my($f) = $_[0]; $f = ($f =~ m@(\.[^/.]*)$@) ? $1 : ''; #print STDERR "suffixPathname $_[0] -> $f\n"; $f; } sub findFile { my($file,$path) = @_; my($f); if ( $file =~ m@^/@ ) { if ( -r $file ) { return $file; } } else { foreach $d ( @$path ) { $f = $d . '/' . $file; if ( -r $f ) { return $f; } } } 0; } sub expandSoftlink { my($f) = @_; my($l,$linkcount); $linkcount = 40; while ( -l $f && ($l = readlink($f)) ) { # print STDERR "softlink $f -> $l\n"; -- $linkcount || die "$0: $f: Too many levels of symbolic links"; if ( $l =~ m@^/@ ) { $f = $l; } else { $f =~ s@/[^/]+/?$@@; $f .= "/" . $l; } } $f; } sub _objCName { if ( s/^\.objc_class_name_// ) { $_ = '@class ' . $_; } elsif ( m/^\.objc_category_name_([^_]+)_([^_]+)/ ) { $_ = '@category ' . $1 . '(' . $2 . ')'; } $_; } sub _nmInfo { my($x) = @_; my($fp, $f, $suf, $floc, $a); $f = $x->[1]; $fp = $x->[2]; $suf = $x->[0]; $floc = $fp; $a = []; open(NM, "/bin/nm $fp|"); while ( ) { chop; if ( s/^\s+U\s+// ) { _objCName(); push(@$a, [ $suf, $f, $floc, 'refs', 'symb', $_, '' ]); } elsif ( s/^([0-9a-fA-f]+)\s+T\s+// || (s/^([0-9a-fA-f]+)\s+t\s+// && m/^[-+]\[/) ) { _objCName(); push(@$a, [ $suf, $f, $floc, 'defs', 'prog', $_, $1 ]); } elsif ( s/^([0-9a-fA-f]+)\s+D\s+// ) { _objCName(); push(@$a, [ $suf, $f, $floc, 'defs', 'data', $_, $1 ]); } elsif ( s/^([0-9a-fA-f]+)\s+A\s+// ) { _objCName(); push(@$a, [ $suf, $f, $floc, 'defs', 'abs', $_, $1 ]); } elsif ( m@^/([^(]+)[(]([^)]+)[)]@ ) { $module = $2; $suf = suffixPathname($module); $f = $module; $floc = $x->[2] . '@' . $module; push(@$a, [ $x->[0], $x->[1], $x->[2], 'has', $suf, $f, '' ]); } } close(NM); $a; } sub nmInfo { my($fp) = @_; #print STDERR "nmInfo $fp->[2] \n"; _nmInfo($fp); } @ldirs = ('.'); @fdirs = ('/LocalLibrary/Frameworks', '/NextLibrary/Frameworks'); @lfiles = (); @ffiles = (); @archs = (); @infiles = (); $outfile = 0; $doInfo = 1; @argv = @ARGV; shift @argv; while ( $a = shift @argv ) { if ( $a =~ m/^-L(.*)$/ ) { push(@ldirs, $1); } elsif ( $a =~ m/^-l(.*)$/ ) { push(@lfiles, [ 'lib', $1, '' ]); } elsif ( $a eq '-o' ) { $outfile = absPathname(shift @argv); } elsif ( $a eq '-arch' ) { push(@archs, shift @argv); } elsif ( $a eq '-framework' ) { $f = shift @argv; push(@ffiles, [ 'framework', $f, '' ]); } elsif ( $a =~ m/^-[cSE]$/ ) { $doInfo = 0; } elsif ( $a eq '-sectcreate' || $a eq '-segprot' ) { shift @argv; shift @argv; shift @argv; } elsif ( $a !~ m@^-@ && $a =~ m/\.\w+$/ ) { if ( $a =~ m/\.a$/ ) { push(@infiles, [ 'lib', filePathname($a), absPathname($a) ] ); } else { push(@infiles, [ suffixPathname($a), filePathname($a), absPathname($a) ] ); } } } if ( $doInfo ) { foreach $x ( @lfiles ) { my($file) = 'lib' . $x->[1] . '.a'; $x->[2] = absPathname(expandSoftlink(findFile($file, \@ldirs))); if ( $x->[2] ) { push(@infiles, $x); } } push(@ffiles, [ 'framework', 'System' ]); foreach $x ( @ffiles ) { my($file) = $x->[1] . '.framework/' . $x->[1]; $x->[2] = absPathname(expandSoftlink(findFile($file, \@fdirs))); if ( $x->[2] ) { push(@infiles, $x); } } if ( ! $outfile ) { $outfile = 'a.out'; } @info = (); # type name location relation type name location # 0 1 2 3 4 5 6 %defs = (); $datafile="$outfile.ccinfo"; open(FILE,">$datafile") || print STDERR "$0: cannot open $datafile for writing: $!"; for $x ( @infiles ) { print FILE join("\t", 'exe', filePathname($outfile), $outfile, 'links', $x->[0], $x->[1], $x->[2]), "\n"; if ( $x->[2] && ($x->[0] eq 'lib' || $x->[0] eq 'framework' || $x->[0] eq '.o') ) { for $i ( @{nmInfo($x)} ) { push(@info, $i); if ( $i->[3] eq 'defs' ) { $defs{$i->[5]} = $i; } } } } for $i ( @info ) { if ( $i->[3] eq 'refs' ) { if ( $j = $defs{$i->[5]} ) { $i->[4] = $j->[4]; $i->[6] = ''; # $j->[2] . '@' . $j->[6]; } } print FILE join("\t", @{$i}), "\n"; } close(FILE); } exec(@ARGV); ll0.13/src/bin/ccloclibs0100644000175200017560000000576306662461243015507 0ustar stephensstephens#!/run/thirdParty/perl5/bin/perl eval 'exec /run/thirdParty/perl5/bin/perl $0 ${1+"$@"}' if 0; # # This program interprets cc -L and -l linker command lines # a attempts to locate the libraries (lib*.a) in the -L paths specified # for each library file found. a "dir " entry is written # to a "gdbinit" file. # # It also creates a dependency in Makefile.dependencies for the executable # on the libraries. # # Libs files found that are softlinks are resolved. This will # allow you to find source for a library if you install your libraries # in directory a directory by using softlinks instead of copies. # # The last step is to exec the linker command # you can use this in your Makefile by calling 'make "CC=ccloclibs cc"' # sub findFile { my($file,$path) = @_; my($f); if ( $file =~ m@^/@ ) { if ( -r $file ) { return $file; } } else { foreach $d ( @$path ) { $f = $d . '/' . $file; if ( -r $f ) { return $f; } } } 0; } sub expandSoftlink { my($f) = @_; my($l,$linkcount); $linkcount = 40; while ( -l $f && ($l = readlink($f)) ) { # print STDERR "softlink $f -> $l\n"; -- $linkcount || die "$0: $f: Too many levels of symbolic links"; if ( $l =~ m@^/@ ) { $f = $l; } else { $f =~ s@/[^/]+/?$@@; $f .= "/" . $l; } } $f; } sub simplifyPathname { my($p) = $_[0]; $p =~ s@^/private/@/@; $p =~ s@//@/@g; $p =~ s@/\./@/@g; while ( $p =~ s@/[^/]+/\.\./@/@ ) { } #print STDERR "simplifyPathname $_[0] -> $p\n"; $p; } #print @ARGV, "\n"; @ldirs = ('.'); @lfiles = (); $outfile = 'a.out'; $gotLibs = 0; @argv = @ARGV; shift @argv; while ( $a = shift @argv ) { if ( $a =~ m/^-L(.*)$/ ) { push(@ldirs, $1); } elsif ( $a =~ m/^-l(.*)$/ ) { push(@lfiles, $1); $gotLibs ++; } elsif ( $a eq '-o' ) { $outfile = shift @argv; } } if ( $gotLibs ) { %dirs = (); $libs = "LIBS"; $deps = "Makefile.dependencies"; open(LIBS, ">$libs") || print STDERR "$0: cannot open $libs for writing: $!"; open(DEPS, ">$deps") || print STDERR "$0: cannot open $deps for writing: $!"; print DEPS "$outfile : "; foreach $lfile ( @lfiles ) { my($f); $f = simplifyPathname(expandSoftlink(findFile("lib" . $lfile . ".a", \@ldirs))); if ( ! $f ) { $f = simplifyPathname(expandSoftlink(findFile("lib" . $lfile . ".dylib", \@ldirs))); } if ( $f ) { print STDERR "lib $lfile $f\n"; print LIBS "lib $lfile $f\n"; print DEPS "\\\n $f "; $f =~ s@/[^/]*$@@; while ( $f =~ s@/NeXT_[^/]*obj$@@ ) { } $dirs{$f} ++; } else { print STDERR "$0: $lfile: not found\n"; } } print DEPS "\n\n"; close(LIBS); close(DEPS); $gdbinit = "gdbinit"; open(GDBINIT, ">$gdbinit") || print STDERR "$0: cannot open $gdbinit for writing: $!"; foreach $f ( keys(%dirs) ) { print GDBINIT "dir $f\n"; print STDERR "dir $f\n"; } close(GDBINIT); } #print STDERR "$0: ", join(" ", @ARGV), "\n"; exec(@ARGV); ll0.13/src/bin/ctocnl.c0100644000175200017560000000056406663227006015245 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_bin_ctocnl_c__ #define __rcs_id_bin_ctocnl_c__ static const char __rcs_id_bin_ctocnl_c[] = "$Id: ctocnl.c,v 1.2 1999/02/19 09:25:26 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include int main() { int c; while ( (c = getchar()) != EOF ) { putchar(c); if ( c == ';' ) putchar('\n'); } return 0; } ll0.13/src/bin/cvschrep.pl0100764000175200017560000000405007617525365015777 0ustar stephensstephens#!/usr/local/bin/perl # $Id: cvschrep.pl,v 1.4 2003/02/03 17:46:29 stephens Exp $ # =head1 cvschrep.pl - search and replace on CVS control files Does a search for CVS/Repository files under current directory and executes a textual search and replace. =head1 SYNOPSYS cvschrep.pl [ -r|-d|-t ] Esearch> Ereplace> =head1 OPTIONS =head2 -r Do search and replace on CVS/Root file instead of CVS/Repository. =head2 -d Run in debug mode; more information is printed to STDERR. =head2 -t Run in test mode; files are not actually modified. =head1 EXAMPLE If your CVS root and host has changed from 'cvs.foobar.com:/u/cvsroot' to 'cvs.bazfat.com:/home/cvs' you can use: cvschrep.pl -r '@cvs.foobar.com:/u/cvsroot' '@cvs.bazfat.com:/home/cvs' If a subdirectory under CVS root has changed from 'abc/def' to 'abc/xyz': cvschrep.pl -r 'abc/def' 'abc/xyz' =head1 AUTHOR ks.perl@kurtstephens.com =cut use File::Find; $debug = 1; $testing = 0; $keep_backup = 0; $filename = 'Repository'; $from = undef; $to = $undef; while ( @ARGV ) { $_ = shift; if ( /^--?r/ ) { $filename = 'Root'; } elsif ( /^--?d/ ) { ++ $debug; } elsif ( /^--?t/ ) { ++ $testing; } elsif ( ! defined $from ) { $from = $_; } elsif ( ! defined $to ) { $to = $_; last; } } sub wanted { my($file) = $File::Find::name; if ( $File::Find::name =~ m@/CVS/$filename$@o && -f ) { my($in, $out) = ( "$_.tmp", $_ ); my($line); print STDERR "wanted: '$File::Find::name'\n" if ( $testing || $debug ); if ( $testing ) { $in = $out; } else { die "$in exists" if ( -e $in ); system('mv', $out, $in); } open($in, "<$in") || die "$in: $!"; if ( ! $testing ) { open($out, ">$out") || die "$out: $!"; } while ( $line = <$in> ) { $line =~ s/\r//sg; if ( $line =~ s@$from@$to@i ) { print STDERR "$File::Find::name: $line"; } if ( ! $testing ) { print $out $line; } } close($in); if ( ! $testing ) { close($out); unlink($in) if ( ! $keep_backup ); } } } find(\&wanted, @ARGV); 1; ll0.13/src/bin/cvschroot.pl0100644000175200017560000000204606662641265016171 0ustar stephensstephens#!/bin/perl # $Id: cvschroot.pl,v 1.3 1999/02/17 22:29:09 stephensk Exp $ # use File::Find; $debug = 1; $keep_backup = 0; $testing = 0; $delete = 1; #$from = shift; #$to = shift; sub wanted { my($file) = $File::Find::name; if ( $File::Find::name =~ m@/CVS/Root$@ && -f ) { my($in, $out) = ( "$_.tmp", $_ ); my($line); print STDERR "$0: '$File::Find::name'\n" if ( $testing || $debug ); if ( $testing ) { $in = $out; } else { die "$in exists" if ( -e $in ); system('mv', $out, $in); } if ( $delete ) { unlink($out) if ( ! $testing ); unlink($in) if ( ! $keep_backup ); } else { open($in, "<$in") || die "$in: $!"; if ( ! $testing ) { open($out, ">$out") || die "$out: $!"; } # while ( $line = <$in> ) { # if ( $line =~ s@^$from@$to@i ) { # print STDERR "$File::Find::name: $line"; # } # if ( ! $testing ) { # print $out $line; # } # } close($in); if ( ! $testing ) { close($out); unlink($in) if ( ! $keep_backup ); } } } } find(\&wanted, @ARGV); 1; ll0.13/src/bin/cvsclean0100644000175200017560000000054007003453703015324 0ustar stephensstephens#!/bin/sh #$Id: cvsclean,v 1.1 1999/10/21 00:01:07 stephensk Exp $ #cvs() { # echo "cvs $@" #} files="" OIFS="$IFS" IFS="/" while read type file version date sticky do if [ -n "$file" ] then case "$type" in *) if [ ! -f "$file" ] then files="$files$file " fi ;; esac fi done < CVS/Entries IFS="$OIFS" cvs rm $files ll0.13/src/bin/cvsedited0100644000175200017560000000051307001176323015476 0ustar stephensstephens#!/bin/sh # $Id: cvsedited,v 1.1 1999/10/13 21:42:43 stephensk Exp $ tmp=/tmp/$$.tmp set -x find \( -name 'CVS' -prune \) -o \( -type f -print \) "$@" | #> "$tmp" while read f do status="$(cvs status $f | egrep -e '^File: .*Status:')" case "$status" in *Locally*) echo "$f $status" ;; esac done rm -f "$tmp" ll0.13/src/bin/cvsfind.pl0100644000175200017560000000253507003453703015602 0ustar stephensstephens#!/usr/local/bin/perl # $Id: cvsfind.pl,v 1.4 1999/10/21 00:01:07 stephensk Exp $ use File::Basename; use Cwd 'fast_abs_path'; $progdir = fast_abs_path(dirname($0)); push(@INC, $progdir, "$progdir/lib/perl"); print STDERR "@INC\n"; eval 'use ion::_cvs::find;'; ################################################################### $debug = 0; $testing = 0; $sep = "\t"; @print_entries = (); OPT: while ( ($_ = $ARGV[0]) && /^-/ ) { shift; s/^--?//; if ( $_ eq '' ) { last OPT; } elsif ( /^sep/ ) { $sep = shift; } else { FLAG: while ( $_ ne '' ) { if ( /^A/ ) { @print_entries = ( 0 .. $#ion::_cvs::entry::map ); last FLAG; } elsif ( s/^([a-zA-Z]+)$// ) { my $i = $ion::_cvs::entry::map{$1}; die "$1: unknown field: must be one of '@ion::_cvs::entry::map'" if ( ! defined $i ); push(@print_entries, $i); } elsif ( s/^([0-9]+)$// ) { push(@print_entries, $1); } else { last FLAG; } } } } @print_entries = ( 0 .. $#ion::_cvs::entry::map ) if ( ! @print_entries ); ########################################################### @entries = (); ion::_cvs::find(sub { push(@{$_[1]}, $_[0]) }, \@entries, @ARGV); @entries = sort { ($a->fullpath) cmp ($b->fullpath); } @entries; foreach $e ( @entries ) { print join($sep, map($e->[$_], @print_entries)), "\n"; } 1; ll0.13/src/bin/cvsretag.pl0100644000175200017560000000225106765647617016006 0ustar stephensstephens#!/usr/local/bin/perl # $Id: cvsretag.pl,v 1.1 1999/09/09 06:11:27 stephensk Exp $ #use Carp; use File::Basename; use Cwd 'fast_abs_path'; $progdir = fast_abs_path(dirname($0)); push(@INC, $progdir, "$progdir/lib/perl"); eval 'use ion::_cvs::find;'; #eval 'use ion::_cvs::rlog;' || die "$!"; $opts = { }; while ( $_ = $ARGV[0], s/^--?// ) { shift; if ( s/^f([^=]*=)?// ) { $opts->{filter} = $1 ? $_ : shift; } elsif ( s/^s([^=]*=)?// ) { $opts->{show_rev_info} = $1 ? $_ : 1; } } my(@entries); ion::_cvs::find(sub {push(@{$_[1]}, $_[0]); }, \@entries, @ARGV); @entries = sort { $a->fullpath() cmp $b->fullpath() } @entries; my($OUTPUT); $OUTPUT = 'STDOUT'; $opts = {filter => '-h'}; $opts = {}; my($e); foreach $e ( @entries ) { if ( $e->isFile ) { print $e->repository, "\n"; my($rlog) = $e->rlog({}); use Data::Dumper; $Data::Dumper::Purity = 1; $Data::Dumper::Quotekeys = 1; print Dumper($rlog), "\n"; my($sym_name); foreach $sym_name ( @{$rlog->{symbolic_names}} ) { my($rev) = $rlog->{sym_name_to_rev}->{$sym_name}; if ( $rev && $sym_name =~ /^PUBLISH:/ ) { echo $e->repository, " $sym_name => $rev\n"; } } } } 1; ll0.13/src/bin/cvsrevhist.pl0100644000175200017560000000676307065620426016363 0ustar stephensstephens#!/usr/local/bin/perl # $Id: cvsrevhist.pl,v 1.6 2000/03/21 07:13:26 stephensk Exp $ #use Carp; BEGIN { use File::Basename; use Cwd 'fast_abs_path'; $progdir = fast_abs_path(dirname($0)); push(@INC, $progdir, "$progdir/lib/perl"); } use ion::_cvs::find; #eval 'use ion::_cvs::rlog;' || die "$!"; $opts = { }; $errors = 0; $opts->{collapse_comments} = 1; while ( $_ = $ARGV[0], s/^([-+])\1?// ) { my($pos) = $1 eq '-'; shift; if ( s/^f([^=]*=)?// ) { $opts->{filter} = $1 ? $_ : shift; } elsif ( s/^e([^=]*=)?// ) { $opts->{show_empty_entries} = $1 ? $_ : $pos; } elsif ( s/^c([^=]*=)?// ) { $opts->{collapse_comments} = $1 ? $_ : $pos; } elsif ( s/^x([^=]*=)?// ) { $opts->{auto_extend_rev_ranges} = $1 ? $_ : $pos; } elsif ( s/^s([^=]*=)?// ) { $opts->{show_rev_info} = $1 ? $_ : $pos; } } my(@entries); ion::_cvs::find(sub {push(@{$_[1]}, $_[0]); }, \@entries, @ARGV); @entries = sort { $a->fullpath() cmp $b->fullpath() } @entries; my($OUTPUT); $OUTPUT = 'STDOUT'; my($e); my($last_comments); ENTRY: foreach $e ( @entries ) { if ( $e->isFile ) { my($path) = $e->fullpath; $path =~ s@^\./@@; my($filter) = $opts->{filter}; if ( ! defined $filter ) { $filter = "-r:+"; } my($e_rev) = $e->revision; $filter =~ s/\+/$e_rev/g; my($rlog); # If a rev in a rev range does not exists, replace it with '' if ( $opts->{auto_extend_rev_ranges} ) { $rlog = $e->rlog(); if ( ! $rlog ) { $errors ++; next ENTRY; } if ( $filter =~ /-r(\S+)/ ) { my($b,$a) = ($`, $'); my($revs) = $1; if ( $revs =~ /^([^:]*):(.*)$/ ) { my($from, $to) = ($1, $2); if ( ! ($rlog->{revision}->{$from} || $rlog->{sym_name_to_rev}->{$from}) ) { #print STDERR "$path: no from rev '$from'\n"; $from = ''; } if ( ! ($rlog->{revision}->{$to} || $rlog->{sym_name_to_rev}->{$to}) ) { #print STDERR "$path: no to rev '$to'\n"; $to = ''; } $revs = $from . ':' . $to; my ($new_filter); $new_filter = $b . '-r' . $revs . $a; if ( $filter ne $new_filter ) { print STDERR "$path: filter = '$filter', new filter = '$new_filter'\n"; $filter = $new_filter; } } } # Redo log $e->clear_rlog(); } $rlog = $e->rlog({filter => $filter}); if ( ! rlog ) { $errors ++; next ENTRY; } if ( @{$rlog->{revisions}} || $opts->{show_empty_entries} ) { my($rev); if ( $opts->{show_rev_info} ) { print $OUTPUT "$path:\n"; foreach $rev ( @{$rlog->{revisions}} ) { my($r) = $rlog->{revision}->{$rev}; my($r_comments) = " " . join("\n ", split(/\n+/, $r->{comment})) . "\n"; print $OUTPUT " ", join(" ", map($r->{$_}, revision, date, author, state, lines), @{$r->{symbolic_names}}); print $OUTPUT ":\n"; print $OUTPUT $r_comments; } } else { my($comments) = ''; foreach $rev ( @{$rlog->{revisions}} ) { my($r) = $rlog->{revision}->{$rev}; my($r_comments) = " " . join("\n ", split(/\n+/, $r->{comment})) . "\n"; $comments .= $r_comments; } if ( $opts->{collapse_comments} ) { if ( $last_comments ne $comments ) { print $OUTPUT $last_comments, "\n" if ( defined $last_comments ); $last_comments = $comments; } print $OUTPUT $path, ":\n"; } else { print $OUTPUT $path, ":\n"; print $OUTPUT $comments, "\n"; } } } } } if ( $opts->{collapse_comments} ) { print $OUTPUT $last_comments, "\n" if ( defined $last_comments ); } exit($errors); 1; ll0.13/src/bin/cwfixlib.pl0100644000175200017560000000166106663227006015762 0ustar stephensstephens#!/usr/local/bin/perl # $Id: cwfixlib.pl,v 1.2 1999/02/19 09:25:26 stephensk Exp $ sub run { print join(" ", @_), "\n"; system(@_) && die "$!: Could not run " . join(" ", @_); } $lib = shift @ARGV; print "lib = '$lib'\n"; $LIB = $ENV{'LIB'}; $LIB = 'f:/apps/dev/msvc20/bin/lib.exe' if ( ! defined($LIB) ); open(NM, "nm $lib|"); @members = (); @exports = (); while ( ) { chop; if ( /^(.*\.obj):$/ ) { push(@members, $1); } elsif ( /^([0-9]+)\s+T\s+_([a-zA-Z0-9_]+)/ ) { push(@exports, $2); } } close(NM); print "members = ", join(" ", @members), "\n"; print "exports = ", join(" ", @exports), "\n"; $def = $lib; $def =~ m@^([^\\/]+)\.lib$@; $def = "$1.def"; print "def = '$def'\n"; open(DEF, ">$def"); print DEF "EXPORTS\n"; foreach ( @exports ) { print DEF "$_\n"; } close(DEF); &run($LIB, '/LIST', $lib); foreach ( @members ) { s@.*[\\/]@@; &run( $LIB, $lib, "/extract:$_"); } exit(0); 1; ll0.13/src/bin/d2u.pl0100744000175200017560000000570207230344164014642 0ustar stephensstephens#!/usr/bin/perl # $Id: d2u.pl,v 1.8 2001/01/14 15:40:36 stephens Exp $ use File::Find; $save_bak = 0; $dos2unix = 1; $force = 0; $recursive = 1; $try_pattern = '(^Makefile)|(\.([chlym][a-zA-Z]?|make?|gdb|[ck]?sh|p[lm]|ll|scm|def|tcl)$)'; $ignore_pattern = '\.(o|a|obj|lib|exe|com)$'; @files = (); ARG: while ( defined ($_ = shift @ARGV) ) { if ( s/^--?// ) { if ( /^[h?]/ ) { print STDERR qq~ Version: ~ . '$Id: d2u.pl,v 1.8 2001/01/14 15:40:36 stephens Exp $' . qq~ Options: -d[os2unix] Convert dos to unix. Default. -u[nix2dos] Convert unix to dos. -p The file matching pattern. Default: '$try_pattern'. -i The file ingore pattern. Default: '$ignore_pattern'. -r Process recursively. Default. -s Save a backup file. -f Force a conversion. -- End processing options. ~; exit(0); } elsif ( /^d(os2unix)?/ ) { $dos2unix = 1; next ARG; } elsif ( /^u(nix2dos)?/ ) { $dos2unix = 0; next ARG; } elsif ( /^p/ ) { $try_pattern = shift @ARGV; next ARG; } elsif ( /^i/ ) { $ignore_pattern = shift @ARGV; next ARG; } elsif ( /^s/ ) { $save_bak ++; next ARG; } elsif ( /^f/ ) { $force ++; next ARG; } elsif ( /^$/ ) { last ARG; } } # must be a file name push(@files, $_); } push(@files, @ARGV); sub translate { my($dir, $in) = @_; my($out, $mode, $t); if ( ! ( -f $in && -r && -w && -T) ) { return 1; } if ( $in =~ /^(RCS|SCCS|CVS)/i ) { return 1; } $out = "$in.bak"; print STDERR "translate $dir/$in\n"; die "$dir/$out already exists: $!" if ( -e $out ); rename($in, $out) || die "Cannot rename $dir/$in to $dir/$out: $!"; $t = $in; $in = $out; $out = $t; # Rename all dotted cap name to all lowercase if ( $out =~ m@^[A-Z0-9_/.]+\.[A-Z0-9_]+$@ ) { $out =~ y/A-Z/a-z/; } $mode = (stat($in))[2]; open(IN, "<$in") || die "Cannot read $dir/$in: $!"; binmode(IN); open(OUT, ">$out") || die "Cannot write $dir/$out: $!"; binmode(OUT); if ( $dos2unix ) { while ( defined ($t = ) ) { chomp $t; $t =~s/\r$//; print OUT $t, "\n"; } } else { while ( defined ($t = ) ) { chomp $t; $t =~s/\r$//; print OUT $t, "\r\n"; } } close(IN); close(OUT); print STDERR " $dir/$in -> $dir/$out\n"; chmod($out, $mode); unlink($in) if ( ! $save_bak ); 0; } sub wanted { #print STDERR "$0 $File::Find::dir/$_\n"; if ( /^(RCS|SCCS|CVS)/i || ! $recursive ) { $File::Find::prune = 1; return 0; } return 0 if ( -d $_ ); if ( $force || (($try_pattern eq '' || /$try_pattern/oi) && ! ($ignore_pattern ne '' && /$ignore_pattern/oi)) ) { translate($File::Find::dir, $_); } else { print STDERR "ignoring $File::Find::dir/$_\n"; } 0; } push(@files, '.') if ( ! @files ); find(\&wanted, @files); 1; ll0.13/src/bin/ecd0100644000175200017560000000130506662461243014271 0ustar stephensstephens#!/bin/sh #set -x exe="$1" if [ -z "$MAKE" ] then MAKE="${DEV_ROOT}/src/maks/bin/mak" fi prompt=" $exe: Command: " help=" 'return' to compile and debug '$exe' 'q' to quit 'c' to 'make clean' 'r' to complie and run 'd' to delete '!' to run a command 'h' for help " echo -n "$prompt" while read x do read y echo "" case "$x" in h*) echo "$help" ;; c*) $MAKE clean ;; q*|x*) exit 0 ;; d*) rm "$exe.exe" ;; r*) $MAKE && "$exe.exe" ;; !*) echo -n "shell cmd: " read x read y eval $x ;; *) $MAKE && gdb "$exe.exe" -x "$exe.gdb" ;; esac echo "" echo -n "$prompt" done ll0.13/src/bin/fe0100644000175200017560000000027606662461244014137 0ustar stephensstephens#!/bin/sh out="$1" shift filter="$1" shift for f in $* do cmd="$out '$f' | $filter | awk '/^[^:]+:/ { pre = "'$1'"; } { print "'"'$f':"'", pre, "'$0'"; }'" #echo "$cmd" eval $cmd done ll0.13/src/bin/findsource0100644000175200017560000000014706662461244015703 0ustar stephensstephens#!/bin/sh find $* \( \( -name '*.rtf*' -o -name '*.nib' \) -prune -print \) -o \( \! -type d -print \) ll0.13/src/bin/igrep0100644000175200017560000001464606774727305014670 0ustar stephensstephens#!/run/pd/prod/bin/perl # stephensk@acm.org sub usage { print STDERR 'igrep [-nlirwvtuh] ', "\n"; print STDERR ' Version 1.1', "\n"; print STDERR ' options:', "\n"; print STDERR ' -n print line numbers', "\n"; print STDERR ' -l print each filename once', "\n"; print STDERR ' -i case insensitive', "\n"; print STDERR ' -r match pattern as a regexpr, not as a word', "\n"; print STDERR ' -w match pattern as a word, not a regexpr (default)', "\n"; print STDERR ' -v verbose output', "\n"; print STDERR ' -t check if index is up to date', "\n"; print STDERR " -u use index file (default '$indexname')", "\n"; print STDERR " -h this help message", "\n"; exit 1; } &usage if ( @ARGV < 1 ); $indexname = ".mkindex"; $verbose = 0; $matchwords = 1; $regexp = 0; $linenumbers = 0; $listonly = 0; $caseinsensitive = ''; $timecheck = 0; $countlines = 0; while ( @ARGV ) { $arg = shift; $verbose ++ if ( $arg =~ /^-.*v/i ); $matchwords = 0 if ( $arg =~ /^-.*r/i ); $regexp = 1 if ( $arg =~ /^-.*w/i ); $linenumbers = 1 if ( $arg =~ /^-.*n/i ); $listonly = 1 if ( $arg =~ /^-.*l/i ); $caseinsensitive = '(?i)' if ( $arg =~ /^-.*i/i ); $timecheck = 1 if ( $arg =~ /^-.*t/i ); $indexfile = shift if ( $arg =~ /^-.*u/i ); $countlines = 1 if ( $arg =~ /^-.*c/i ); if ( $arg =~ m/^-(\?|h)/i ) { &usage; } else { $pattern = $arg; } } ##################################################################### # Create key and line regexps @subpatterns = grep(length($_), split(/[^_a-zA-Z]+/, $pattern)); $patternIsOneWord = $matchwords && (scalar @subpatterns) == 1 && $caseinsensitive eq '' && ! $regexp; if ( $matchwords ) { if ( ! (scalar @subpatterns) == 1 ) { $pattern =~ s@([_a-zA-Z][_a-zA-Z0-9]*)@(\\B$1\\B)@g; } if ( ! $regexp ) { $pattern =~ s@([.*+()|\\\[\]])@\\$1@g; } $keypattern = '(^' . join('$)|(^', @subpatterns) . '$)'; } else { $keypattern = join('|', @subpatterns); } $pattern = $caseinsensitive . $pattern; $keypattern = $caseinsensitive . $keypattern; print STDERR "patternIsOneWord = '$patternIsOneWord'\n" if ( $verbose ); print STDERR "pattern = '$pattern'\n" if ( $verbose ); print STDERR "keypattern = '$keypattern'\n" if ( $verbose ); ##################################################################### # locate and open index file $index = $indexname; while ( ! -r $index ) { $index = "../$index"; if ( length($index) > 64 ) { die "Cannot find $indexname"; } } print STDERR "index = '$index'\n" if ( $verbose ); open(INDEX, "<$index") || die "Cannot open $index for reading: $!"; $indexM = -M $index; # get the modification time ##################################################################### # Read version string $_ = ; chop; die "expected 'mkindex', found '$_'" if ( $_ !~ /^mkindex /); $version = (split(/ /, $_, 2))[1]; ##################################################################### # Read timestamp $_ = ; chop; die "expected 'timestamp', found '$_'" if ( $_ !~ /^timestamp / ); $timestamp = (split(/ /, $_, 2))[1]; ##################################################################### # Read file table $_ = ; chop; die "expected 'files', found '$_'" if ( $_ !~ /^files / ); $n = (split(/ /, $_, 2))[1]; $files[$n] = undef; # preextend @files = (); print STDERR "nfiles: $n " if ( $verbose ); while ( $n -- ) { $_ = ; chop; print STDERR "$0: warning: $_ is newer than $index\n" if ( $timecheck && -r && -M $_ < $indexM ); push(@files,$_); print STDERR "." if ( $verbose > 1 ); } print STDERR "\n" if ( $verbose ); $_ = ; chop; die "expected blank line" if ( $_ ne ''); print STDERR "files: ", join("\n", @files), "\n" if ( $verbose > 2 ); ##################################################################### # Read index and remember any locations for keys that match the pattern $_ = ; chop; die "expected 'keys', found '$_'" if ( $_ !~ /^keys /); $n = (split(/ /, $_, 2))[1]; print STDERR "nkeys: $n " if ( $verbose ); @keys_matched = (); %filesmatched = (); while ( $n -- ) { $_ = ; chop; ($key, $locs) = split(/ /, $_, 2); if ( $key =~ m/$keypattern/o ) { push(@keys_matched, $key); $lastlineno = -1; foreach $loc ( split(/ /, $locs) ) { ($fileno, $lineno, $pos) = split(/:/, $loc); if ( $lastlineno != $lineno ) { $filesmatched{$fileno} .= "$lineno:$pos "; print STDERR $files[$fileno], ":", $lineno, "\n" if ( $verbose > 2 ); } $lastlineno = $lineno; } print STDERR "*" if ( $verbose > 1 ); last if ( $patternIsOneWord ); } else { print STDERR "." if ( $verbose > 1 ); } } print STDERR " ", scalar @keys_matched, " keys matched\n" if ( $verbose ); print STDERR "keys matched: '", join("', '", @keys_matched), "'\n" if ( keys_matched && $verbose > 1); if ( ! $patternIsOneWord ) { $_ = ; chop; die "expected blank line" if ( $_ ne ''); } #print STDERR "keys: ", join("\n", sort(keys(%index))), "\n" if ( $verbose > 2 ); close(INDEX); ##################################################################### # %getline_cannotopen = (); $getline_FILE_file = ''; sub getline { # file, pos my ($file, $pos) = @_; my ($line); if ( $getline_FILE_file ne $file ) { $getline_FILE_file = $file; close(FILE); if ( ! open(FILE, "<$file") ) { print STDERR "$0: cannot open $file: $!\n" if ( ! $getline_cannotopen{$file} ++ ); return; } } while ( 1 ) { seek(FILE, $pos, 0); read(FILE, $line, 1); last if ( $line eq "\n" ); if ( -- $pos < 0 ) { seek(FILE, 0, 0); last; } } $line = ; chop $line; $line; } # Print each line no that matches sub numerically { $a <=> $b } $linematches = 0; FILE: foreach $fileno ( sort(keys(%filesmatched)) ) { $file = $files[$fileno]; $lastlineno = -1; %locs = (); foreach $loc ( split(/ /, $filesmatched{$fileno}) ) { ($lineno, $pos) = split(/:/, $loc); if ( $lastlineno != $lineno ) { $locs{$lineno} = $pos; } $lastlineno = $lineno; } foreach $lineno ( sort numerically (keys(%locs)) ) { if ( defined($line = &getline($file, $locs{$lineno})) ) { if ( $line =~ m/$pattern/o ) { $linematches ++; if ( $countlines ) { next FILE; } if ( $listonly ) { print $file, "\n"; next FILE; } print $file, ":"; print $lineno, ":" if ( $linenumbers ); print $line, "\n"; } } } } print $linematches, "\n" if ( $countlines ); exit(! $linematches); 0; ll0.13/src/bin/linkdups0100644000175200017560000000120706662461243015370 0ustar stephensstephens#!/bin/sh find . -type f -print | sed 's!\./!!g' > /tmp/$$.names #cat /tmp/$$.names EXEC=echo EXEC= while read f1 do while read f2 do # `/bin/expr length "$f1"` -lt `/bin/expr length "$f2"` if [ "$f1" != "$f2" -a ! \( -h "$f1" -o -h "$f2" \) ] then if /bin/cmp -s "$f1" "$f2" then r2=`expr "$f2" : '\(.*/\).*' '|' "$f2"` r2=`echo "$r2" | sed 's@[^/]*/@../@g'` f1r="$r2$f1" #echo "f1=$f1 f2=$f2 f1r=$f1r" if [ "$f1r" != "$f2" ] then echo "$f2 -> $f1r" /bin/rm -f "$f2" /bin/ln -s "$f1r" "$f2" fi fi fi done < /tmp/$$.names done < /tmp/$$.names ll0.13/src/bin/locstatic0100644000175200017560000000253106662461244015526 0ustar stephensstephens#!/bin/sh -- # -*- perl -*- eval 'exec /run/thirdParty/perl5/bin/perl $0 ${1+"$@"}' if 0; # print "$0: ", join(" ", @ARGV), "\n"; $pat = '\W(static\s+(id|\w+\s*\*)\s[^;(){}]*;)'; #$pat = '(static)'; sub scanFileForStatic { my($file) = @_; my($lineno,$s); #select(STDERR); $| = 1; select(STDOUT); #print STDERR "$file \r"; open(FILE,"<$file") || print STDERR "$0: cannot open $file for reading: $!\n"; $lineno = 0; while ( $lineno ++, $_ = ) { $s .= $_; while ( $s =~ s@$pat@@m ) { $s = $'; print "$file: $lineno: $1\n"; } } while ( $s =~ s@$pat@@m ) { $s = $'; print "$file: $lineno: $1\n"; } close(FILE); 0; } sub readDir { my($dirname) = @_; my(@dirlist); opendir(DIR,"$dirname") || print STDERR "$0: cannot open $dirname for reading: $!\n"; @dirlist = readdir(DIR); closedir(DIR); @dirlist = grep(!($_ eq '.' || $_ eq '..' || $_ eq 'SCCS' || $_ eq 'RCS'), @dirlist); # print STDERR "$0: ", join(" ", @dirlist), "\n"; @dirlist; } sub scanFiles { my(@files) = @_; my($f,$ff); foreach $f ( @files ) { if ( -d $f ) { foreach $ff ( readDir($f) ) { scanFiles("$f/$ff"); } } else { scanFileForStatic($f) if $f =~ m/\.[hmc]$/; } } 0; } # print "$0: ", join(" ", @ARGV), "\n"; scanFiles(@ARGV); 0; ll0.13/src/bin/lsup0100644000175200017560000000040306774730305014521 0ustar stephensstephens#!/bin/sh # $Id: lsup,v 1.2 1999/09/30 18:49:41 stephensk Exp $ # stephensk@acm.org # if [ $# -eq 0 ] then set `pwd` fi while [ $# -gt 0 ] do f="$1" while [ -n "$f" ] do /bin/ls -lagd "$f" f=`/bin/expr "$f" : '\(.*\)/.*'` done shift done ll0.13/src/bin/mergefiles.pl0100644000175200017560000001452506663227006016300 0ustar stephensstephens#!/usr/local/bin/perl # $Id: mergefiles.pl,v 1.2 1999/02/19 09:25:26 stephensk Exp $ # Creates a shell script to merge two directories # based on file modification time and size. # Also generates diffs for files that do not have the same mod time and size # sub ignore_files { grep(! (/\.(o|obj|a|lib|dll|exe|core)$/ || /^\.saves/ || /^CYGWIN/ || /^pilot$/ || /~$/ ), @_); } sub cmd { print "@_\n"; } sub mkdir_p_ { my($dstp) = @_; $dstp =~ s@/[^/]+$@@; cmd("mkdir -p $dstp"); } sub rm_rf { cmd("rm -rf $_[0]"); } sub cp_rp { mkdir_p_($_[1]); cmd("cp -rp @_"); } sub _cp_rp { cmd("#cp -rp @_"); } sub date_str { my($s,$m,$h,$D,$M,$Y,$W,$YD,$dst) = gmtime($_[0]); $s = '0' . $s if ( $s < 10 ); $m = '0' . $m if ( $m < 10 ); $h = '0' . $h if ( $h < 10 ); $Y += 1900; $M ++; $M = '0' . $M if ( $M < 10 ); "$Y/$M/$D-$h:$m:$s"; } sub M_str { my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]); date_str($mtime); } sub get_dir { my(@dir); opendir(DIR, $_[0]) || return ( 0, $! ); @dir = grep($_ ne '.' && $_ ne '..', readdir(DIR)); closedir(DIR); (1, @dir); } sub merge_paths { my(@p) = @_; my(@e) = map(-e $_, @p); my(@f) = map(-f $_, @p); my(@d) = map(-d $_, @p); my(@s) = map(-s $_, @p); my(@M) = map(-M $_, @p); my(@pd) = map((s@/[^/]+@@, $_), @_); my(@pM) = map(-M $_, @pd); my(@d0, @d1); my($delete, $choose) = ( 0, -1 ); #print STDERR "p = ", "@p", "\n"; #print STDERR "e = ", "@e", "\n"; #print STDERR "f = ", "@f", "\n"; #print STDERR "d = ", "@d", "\n"; #print STDERR "s = ", "@s", "\n"; #print STDERR "M = ", "@M", "\n"; if ( ! $e[0] && ! $e[1] ) { # Both do not exist return; } elsif ( $e[0] && ! $e[1] ) { # d0/f0 exists and d1/f1 does not exists # if d0 is older than d1 if ( $pM[0] < $pM[1] ) { cmd("# $p[1] does not exist and $pd[0] is newer than $pd[1]"); $choose = 2; $delete = 1; } else { cmd("# $p[1] does not exist"); $choose = 1; } } elsif ( ! $e[0] && $e[1] ) { if ( $pM[1] < $pM[0] ) { cmd("# $p[0] does not exist and $pd[1] is newer than $pd[0]"); $choose = 1; $delete = 1; } else { cmd("# $p[0] does not exist"); $choose = 2; } } elsif ( $f[0] && $f[1] ) { if ( $M[0] < $M[1] ) { cmd("# $p[0] is newer than $p[1]"); $choose = 1; } elsif ( $M[0] > $M[1] ) { cmd("# $p[1] is newer than $p[0]"); $choose = 2; } elsif ( $s[0] == $s[1] ) { cmd("# $p[0] is the same time and size as $p[1]"); return; } } elsif ( $d[0] && $d[1] ) { my(@d0, @d1); my($f, $f_last); @d0 = get_dir($p[0]); shift @d0; #print STDERR "d0 = @d0\n"; @d1 = get_dir($p[1]); shift @d1; #print STDERR "d1 = @d1\n"; push(@d0, @d1); @d0 = ignore_files(sort(@d0)); F: foreach $f ( @d0 ) { next F if ( $f_last eq $f ); $f_last = $f; merge_paths($p[0] . "/" . $f, $p[1] . "/" . $f); } return; } else { cmd("#!!!! $p[0] is a " . $d[0] ? "dir" : "file" . ", $p[1] is a " . $d[1] ? "dir" : "file"); } my $get_cmd = $choose == -1; while ( $get_cmd ) { print STDERR join("\t", "1[", $p[0], $s[0], M_str($p[0]), "]"), "\n"; print STDERR join("\t", "2[", $p[1], $s[1], M_str($p[1]), "] :", $choose), " > "; $_ = ; chop; $choose = $1 if ( /([0-9]+)/ ); $delete = /d/; if ( $choose == 3 ) { system("diff -r $p[0] $p[1]"); } else { $get_cmd = 0 if ( $choose != -1 ); } } if ( $choose == 0 ) { $get_cmd = 0; } else { $choose --; if ( $delete ) { rm_rf($p[$delete - 1]); } else { cp_rp($p[$choose], $p[1 - $choose]); } } } sub merge_paths3 { # p0, p1, mp my(@p) = @_; my(@e) = map(-e $_, @p); my(@f) = map(-f $_, @p); my(@d) = map(-d $_, @p); my(@s) = map(-s $_, @p); my(@M) = map(-M $_, @p); my(@pd) = map((s@/[^/]+@@, $_), @_); my(@pM) = map(-M $_, @pd); my(@d0, @d1); my($delete, $choose) = ( 0, -1 ); #print STDERR "p = ", "@p", "\n"; #print STDERR "e = ", "@e", "\n"; #print STDERR "f = ", "@f", "\n"; #print STDERR "d = ", "@d", "\n"; #print STDERR "s = ", "@s", "\n"; #print STDERR "M = ", "@M", "\n"; if ( ! $e[0] && ! $e[1] ) { # Both do not exist } elsif ( $e[0] && ! $e[1] ) { # d0/f0 exists and d1/f1 does not exists # if d0 is older than d1 cmd(""); if ( $pM[0] < $pM[1] ) { cmd("# $p[1] does not exist and $pd[0] is newer than $pd[1]"); } else { cmd("# $p[1] does not exist"); } cp_rp($p[0], $p[2]); } elsif ( ! $e[0] && $e[1] ) { cmd(""); if ( $pM[1] < $pM[0] ) { cmd("# $p[0] does not exist and $pd[1] is newer than $pd[0]"); } else { cmd("# $p[0] does not exist"); } cp_rp($p[1], $p[2]); } elsif ( $f[0] && $f[1] ) { cmd(""); if ( $M[0] < $M[1] ) { cmd("# $p[0] is newer than $p[1]"); $choose = 0; } elsif ( $M[0] > $M[1] ) { cmd("# $p[1] is newer than $p[0]"); $choose = 1; } elsif ( $s[0] == $s[1] ) { cmd("# $p[0] is the same time and size as $p[1]"); $choose = 0; cp_rp($p[$choose], $p[2]); return; } cp_rp($p[$choose], $p[2]); _cp_rp($p[1 - $choose], $p[2]); # Do a diff $tmp = "$$.diff"; $cmd = "diff -cd \"$p[1 - $choose]\" \"$p[$choose]\""; system("$cmd > \"$tmp\""); $choose = 0; open(F, "<$tmp"); while ( $_ = ) { chop; if ( ! $choose ) { cmd("# $cmd "); $choose = 1; } cmd("# $_"); } close(F); cmd("##############################################") if ( $choose ); unlink($tmp); } elsif ( $d[0] && $d[1] ) { my(@d0, @d1); my($f, $f_last); my($errors) = 0; @d0 = get_dir($p[0]); if ( ! shift @d0 ) { print STDERR "$p[0]: ", @d0; $errors ++; } else { shift @d0; } @d1 = get_dir($p[1]); if ( ! shift @d1 ) { print STDERR "$p[1]: ", @d1; $errors ++; } if ( $errors ) { return; } push(@d0, @d1); @d0 = ignore_files(sort(@d0)); F: foreach $f ( @d0 ) { next F if ( $f_last eq $f ); $f_last = $f; merge_paths3($p[0] . "/" . $f, $p[1] . "/" . $f, $p[2] . "/" . $f); } } else { cmd(""); cmd("#!!!! $p[0] is a " . $d[0] ? "dir" : "file" . ", $p[1] is a " . $d[1] ? "dir" : "file"); } } cmd("#!/bin/sh"); cmd("# $0 " . join(" ", @ARGV)); cmd("set -x"); #if ( $#ARGV == 3 ) { merge_paths3(@ARGV); #} else { # merge_paths(@ARGV); #} 1; ll0.13/src/bin/mkindex0100644000175200017560000000365506774727305015217 0ustar stephensstephens#!/run/pd/prod/bin/perl # stephensk@acm.org $version = 1.1; $indexname = $index = ".mkindex"; $verbose = 0; while ( @ARGV ) { $arg = shift; $verbose ++ if ( $arg =~ /^-.*v/ ); } # open the index file open(INDEX, ">$index") || die "Cannot open $index for writing: $!"; $INDEX = "INDEX"; # get a list of files from stdin @files = (); while ( <> ) { chop; s@^\./@@; push(@files,$_) if ( -r && -T && ! m@(^|/)$indexname$@o ); } %index = (); print STDERR "$0: indexing ", (scalar @files), " files: " if ( $verbose ); $nentries = 0; $fileindex = -1; foreach ( @files ) { $fileindex ++; $lineno = 0; $pos = 0; open(FILE, "<$_") || next; $nkeys = 0; while ( $line = ) { print STDERR "$line\n" if ( $verbose > 1 ); $lineno ++; while ( $line =~ m/([_a-zA-Z][_a-zA-Z0-9]*)/g ) { $linepos = $pos + (pos $line) - length($1); $index{$1} .= "$fileindex:$lineno:$linepos "; print STDERR "$fileindex:$lineno:$linepos " if ( $verbose > 2 ); $nkeys ++; $nentries ++; } $pos += length($line); } close(FILE); print STDERR "$nkeys " if ( $verbose > 1 ); print STDERR "." if ( $verbose ); } print STDERR "\n" if ( $verbose ); ##################################################################### # Create a unique list of keys @keys = sort(keys(%index)); print STDERR "$0: ", scalar @keys, " unique keys, $nentries citations\n" if ( $verbose ); ##################################################################### # Write version string print $INDEX "mkindex $version\n"; # Write timestamp print $INDEX "timestamp ", time, "\n"; # Write file table print $INDEX "files ", scalar @files, "\n"; print $INDEX join("\n", @files); print $INDEX "\n\n"; # Write index print $INDEX "keys ", scalar @keys, "\n"; foreach ( sort(keys(%index)) ) { print $INDEX "$_ $index{$_}\n"; } print $INDEX "\n\n"; close(INDEX); ##################################################################### 0; ll0.13/src/bin/mvr.pl0100644000175200017560000000331307001176324014744 0ustar stephensstephens#!/usr/bin/perl use File::Find; package mvr; sub wanted { my($dir) = $File::Find::dir; my($old, $new); $old = $new = $_; print STDERR "$dir/$old\n" if ( $mvr::verbose > 1 ); if ( &mvr::match($new) ) { if ( $mvr::interactive ) { print STDERR "mv $dir/$old $dir/$new? [y] "; my($line); $line = ; return 0 if ( $line !~ /y/i ); } print STDERR "mv $dir/$old $dir/$new\n" if ( $mvr::verbose || $mvr::debug ); if ( ! $mvr::debug ) { my($tmp) = "$new.$$"; die "$dir/$tmp exists" if ( -e $tmp ); rename($old, $tmp) || die "mv $dir/$old $dir/$tmp failed: $!"; rename($tmp, $new) || print STDERR "mv $dir/$old $dir/$new: $!\n"; } } 0; } sub mvr { $mvr::debug = 0; $mvr::verbose = 1; $mvr::interactive = 0; while ( defined ($_ = shift @_) ) { if ( s/^--?// ) { while ( s/i(nteractive)?// ) { $mvr::interactive ++; } while ( s/d(ebug)?// ) { $mvr::debug ++; } while ( s/v(erbose)?// ){ $mvr::verbose ++; } if ( s/[h?]// ) { print STDERR qq~ $0 [-dvi] FROM TO Rename all files that match regexpr FROM to TO under the current directory. Options: -d[ebug] Enable debugging, does not actually rename. -i[interactive] Interactive; prompts on stderr for confirmation. -v[erbose] Enable verbose messages. -?|-h[elp] This help message. ~; return 1; } } else { $o = $_; $n = shift @_; if ( defined $n ) { print STDERR "mvr $o $n\n" if ( $verbose ); eval 'sub mvr::match { $_[0] =~ s/^' . $o . '$/' . $n . '/; }'; File::Find::find(\&wanted, '.'); } } } 0; } #print STDERR "$0\n"; if ( $0 =~ m@/mvr.pl$@ ) { mvr(@ARGV); } 1; ll0.13/src/bin/nmlibs0100644000175200017560000000042706662461243015026 0ustar stephensstephens#!/bin/sh if [ -z "$LIBDIRS" ] then LIBDIRS="/lib /usr/lib" fi LIBDIRS="$* $LIBDIRS" for d in $LIBDIRS do (cd $d for f in lib*.a *.o do nm -gp "$f" | awk ' BEGIN { name = "'$d/$f'"; } /^.*:/ { name = "'$d'/" $1; } { print name, $0, "\n"; }' done ) done ll0.13/src/bin/nmm0100755000175200017560000000010006662461243014320 0ustar stephensstephens#!/bin/sh for f do nm "$f" | awk '{ print "'$f'", $0; }' done ll0.13/src/bin/objcsyms0100644000175200017560000000457306662461244015402 0ustar stephensstephens#!perl $tmp || ($tmp = $ENV{'TEMP'}); $tmp || ($tmp = $ENV{'TMP'}); $tmp || ($tmp = '/tmp/'); $symbols = (); $nm = '/bin/nm'; $dumpbin = 'dumpbin'; if ( -e $nm ) { # NeXT eval q@ $libprefix = 'lib'; $libsuffix = '.a'; $frameworksuffix = ''; sub refsym { $v && print STDERR "$0: refsym: $_[0]\n"; print C 'asm(".reference ', $_[0], '");', "\n"; } sub do_ObjC_symbols { open(F,"$nm -gp $_ |") || die "$!: cannot read $_"; while ( ) { if ( /\s+[ATDB]\s+(.objc_(class|category)_name_[a-zA-Z0-9_]+)/ ) { &refsym($1); } } close(F); } @; } else { # WinNT eval q@ $libprefix = ''; $libsuffix = '.lib'; $frameworksuffix = '.lib'; sub refsym { $v && print STDERR "$0: refsym: $_[0]\n"; print C 'asm(".global ', $_[0], '");', "\n"; } sub do_ObjC_symbols { open(F,"$dumpbin /symbols /exports $_ |") || die "$!: cannot read $_"; while ( ) { if ( /\s+External\s+(.objc_(class|category)_name_[a-zA-Z0-9_]+)/ ) { &refsym($1); } } close(F); } @; } @libs = (); @libpaths = ("/usr/lib", "/lib"); @frameworkpaths = ("$NEXT_ROOT/LocalLibrary/Frameworks", "$NEXT_ROOT/NextLibrary/Frameworks"); sub findinpath { $f = shift @_; while ( $_ = shift @_ ) { $ft = $_ . '/' . $f; $v && print "$0: try: $ft\n"; if ( -e $ft ) { $v && print "$0: found: $ft\n"; return $ft; } } 0; } $ObjC = 0; $v = 0; $cf = "$tmp$$.c"; while ( $_ = shift @ARGV ) { push(@args, $_); if ( /^-(o|b|V|include|imacros|idirafter|iprefix|iwithprefix)$/ ) { shift @ARGV; } elsif ( /^-ObjC(++)?$/ ) { $ObjC ++; push(@args, $cf); } elsif ( /^-v$/ ) { $v ++; } elsif ( /^-L(.+)$/ ) { push(@libpaths, $1); } elsif ( /^-l(.+)$/ ) { if ( $ft = &findinpath("$libprefix$1$libsuffix", @libpaths) ) { push(@libs, $ft); } } elsif ( /^-F(.+)$/ ) { push(@frameworkpaths, $1); } elsif ( /^-framework$/ ) { push(@args, $_ = shift @ARGV); if ( $ft = &findinpath("$_.framework/$_$frameworksuffix", @frameworkpaths) ) { push(@libs, $ft); } } } if ( $ObjC ) { open(C,">$cf") || die "$!: cannot create $cf"; &refsym('_main'); # force linking foreach ( @libs ) { &do_ObjC_symbols(); } close(C) || die "$!: cannot close $cf"; push(@args, $cf); } else { $cf = 0; } $v && print STDERR join(" ", @args), "\n"; $errors = system(@args) / 256; $cf && unlink($cf); exit $errors; 1; #PERLEND ll0.13/src/bin/publish.pl0100644000175200017560000004404607364175364015635 0ustar stephensstephens#!/usr/local/bin/perl # $Id: publish.pl,v 1.12 2001/10/20 04:17:56 stephens Exp $ # TO DO # * Fix problems with non "../" REQUIRES_PKGS # ############################################################################## use Carp; use File::Basename; use Cwd; # fastgetcwd use Cwd 'fast_abs_path'; $progdir = fast_abs_path(dirname($0)); push(@INC, $progdir, "$progdir/lib/perl"); eval 'use ion::_cvs::revhist;'; ############################################################################## $time = time(); { my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($time); $sec = '0' . $sec if ( $sec < 10 ); $min = '0' . $min if ( $min < 10 ); $hour = '0' . $hour if ( $hour < 10 ); $mon ++; $mon = '0' . $mon if ( $mon < 10 ); $mday = '0' . $mday if ( $mday < 10 ); $year += 1900; $timestr = "$year/$mon/$mday $hour:$min:$sec"; } ############################################################################## $tmp_root = "/usr/tmp"; $tmp_root = fast_abs_path($tmp_root); $tmp = "$tmp_root/t" . abs($$); mkdir($tmp, 0777) || die "$!: $tmp"; sub END { #print STDERR "in END\n"; system("rm", "-rf", $tmp) if ( $tmp ); } ############################################################################## $sep = '=' x 78; sub basename { my($x) = @_; $x =~ s@^.*[/\\]@@; $x; } sub dirname { my($x) = @_; #print STDERR "dirname('$x') = "; if ( $x !~ s@[/\\][^/\\]+$@@ ) { $x = '.'; } #print STDERR "'$x'\n"; $x; } sub absname { my($x) = @_; #print STDERR "absname('$x') = "; if ( $x !~ m@^([a-zA-Z]:)?[/\\]@ ) { $x = fastgetcwd() . '/' . $x; } #print STDERR "'$x'\n"; $x; } sub unix_path { my($x) = @_; #print STDERR "unix_path('$x') = "; $x =~ y@\\@/@; $x !~ s@^([a-zA-Z]):@//$1@; #print STDERR "'$x'\n"; $x; } sub mkdirs { my($p, $m) = @_; if ( ! defined($m) ) { $m = 0777; } if ( -d $p ) { 1; } else { my($pdir) = dirname($p); if ( ! -d $pdir ) { mkdirs($pdir, $m); } mkdir($p, $m); } } sub appendFileToHandle { my($in,$OUT) = @_; open(__F, "<$in"); while ( $in = <__F> ) { print $OUT $in; } close(__F); } sub readFile { my($r, $l); open(__F, "<$_[0]") || return; $r = ''; while ( $l = <__F> ) { $r .= $l; } close(__F); $r; } sub copyFile { my($src, $dst) = @_; my($l); open($src, "< $src") || die "$src: $!:"; open($dst, "> $dst") || die "$dst: $!:"; while ( $l = <$src> ) { print $dst $l; } close($src); close($dst); } sub copyDir { my ($src, $dst) = @_; my $src = unix_path($src); my $dst = unix_path($dst); mkdirs($dst, 0777); system("sh -c '$tar -C $src -cf - . | $tar -C $dst -x${tar_verbose}f -'") && die "tar: $!"; } sub readVars { my($file, $vars, $stopAtEmptyLine) = @_; $vars = {} if ( ! $vars ); open(F, "<$file") || return; LINE: while ( $_ = ) { chop; s/^\s+//; s/\s+$//; if ( /^\s*#/ ) { next LINE; } if ( $_ eq '' && $stopAtEmptyLine ) { last LINE; } my($key, $value) = (undef, undef); # KEY if ( s/^\s*([A-Za-z_0-9]+)// ) { $key = $1; # ='VALUE' if ( m/^\s*=\s*'([^']*)'\s*$/ ) { #' $value = $1; # ="VALUE" } elsif ( m/^\s*=\s*"([^"]*)"\s*$/ ) { #" $value = $1; # =VALUE } elsif ( m/^\s*=(.*)$/ ) { $value = $1; # [ ]VALUE } elsif ( m/^\s?(.*)$/ ) { $value = $1; } else { print STDERR "$0: unparsed line in $file: $key $_\n"; } } if ( defined($key) && defined($value) ) { $value =~ s/^\s+//; $value =~ s/\s+$//; $vars->{$key} = $value; } } close(F); $vars; } sub readPKG { my($pkg); $pkg = {}; $pkg->{src} = $_[0]; $pkg->{src_abs} = fast_abs_path($pkg->{src}); $pkg->{src_name} = basename($pkg->{src_abs}); $pkg->{src_dir} = dirname($pkg->{src_abs}); # Defaults $pkg->{NAME} = $pkg->{src_name}; $pkg->{README} = "README"; $pkg->{VERSION} = readFile("$pkg->{src}/VERSION"); $pkg->{VERSION} =~ y/\n/ /; $pkg->{VERSION} =~ s/^\s+//; $pkg->{VERSION} =~ s/\s+$//; $pkg->{CVSLOG} = 'CVSLOG'; $pkg->{DESC} = ''; $pkg->{CATEGORY} = ''; $pkg->{REQUIRES_PKGS} = ''; $pkg->{REQUIRES_OTHERS} = ''; $pkg->{MAKE} = 'make'; $pkg->{MAKE_CLEAN} = 'clean veryclean'; $pkg->{subpkgs} = []; $pkg->{parent} = $pkg; $pkg->{root} = $pkg; readVars("$pkg->{src}/PKG", $pkg); die "Package $pkg->{src} has no NAME" if ( $pkg->{NAME} eq '' ); print STDERR " WARNING: $pkg->{src_abs} has no VERSION\n" if ( $pkg->{VERSION} eq '' ); print STDERR " WARNING: $pkg->{src_abs} has no CATEGORY\n" if ( $pkg->{CATEGORY} eq '' ); print STDERR " WARNING: $pkg->{src_abs} has no DESC\n" if ( $pkg->{DESC} eq '' ); $pkg; } sub parsePkg { my($pkg, @more) = @_; my($pcwd); # Determine the copy dst $pkg->{dst} = $pkg->{root}->{dst_root} . "/" . $pkg->{src_name}; # Attempt to cd into package $pcwd = getcwd(); chdir($pkg->{src}) || die "chdir: $!: $pkg->{src}"; # Don't visit a package more than once if ( $pkg->{root}->{parsed}->{$pkg->{src_abs}} ) { return; } $pkg->{root}->{parsed}->{$pkg->{src_abs}} ++; # Add package to parent and root push(@{$pkg->{parent}->{subpkgs}}, $pkg); push(@{$pkg->{root}->{subpkgs_flat}}, $pkg); # Collect the other pkgs #print STDERR "REQUIRES_OTHERS='$pkg->{REQUIRES_OTHERS}'\n"; @others = split(/\s+/, $pkg->{REQUIRES_OTHERS}); $pkg->{others} = [ @others ]; # Add others to root foreach $r ( @others ) { $pkg->{root}->{others_map}->{$r} ++; } @{$pkg->{root}->{others_flat}} = sort(keys(%{$pkg->{root}->{others_map}})); # Collect subpkgs foreach $r ( split(/\s+/, $pkg->{REQUIRES_PKGS}), @more ) { my($subpkg) = readPKG($r); $subpkg->{parent} = $pkg; $subpkg->{root} = $pkg->{root}; parsePkg($subpkg); } # chdir($pcwd) || die "chdir: $!: $pcwd"; } sub copyPkg { my($rpkg) = @_; my($pkg); foreach $pkg ( @{$rpkg->{subpkgs_flat}} ) { # Copy the package into the dst area print STDERR " Copying $pkg->{src_abs} $pkg->{dst}\n"; copyDir($pkg->{src_abs}, $pkg->{dst}); print STDERR " Copying $pkg->{src_abs} $pkg->{dst}: DONE\n\n"; } } sub cleanPkg { my($rpkg) = @_; my($pkg); foreach $pkg ( @{$rpkg->{subpkgs_flat}} ) { # Clean up the dst area if ( -r "$pkg->{dst}/Makefile" ) { print STDERR " Cleaning $pkg->{dst}\n"; $dst = unix_path($pkg->{dst}); system("sh -c 'cd $dst && eval $pkg->{MAKE} __DISABLE_DEPS__=YES $pkg->{MAKE_CLEAN}'"); print STDERR " Cleaning $pkg->{dst}: DONE\n\n"; } } } sub commitPkg { my($rpkg) = @_; my($pkg); if ( defined($CVSROOT) ) { foreach $pkg ( @{$rpkg->{subpkgs_flat}} ) { # Clean up the dst area if ( -d "$pkg->{dst}/CVS" ) { my($msg, $cmd); # Commit print STDERR " Committing $pkg->{dst}\n"; $msg = "PUBLISH_$rpkg->{NAME}$rpkg->{VERSION}"; $cmd = "$CVS commit -m \"$msg\" $pkg->{dst}"; print STDERR " $cmd\n"; system($cmd) && die "$cmd"; print STDERR " Committing $pkg->{dst}: DONE\n\n"; # Tag $msg = "PUBLISH_$rpkg->{NAME}$rpkg->{VERSION}"; $msg =~ tr/A-Za-z0-9_/_/c; print STDERR " Tagging $pkg->{dst} as $msg\n"; $cmd = "$CVS tag "; $cmd .= "-F " if ( $force ); $cmd .= "-c $msg $pkg->{dst}"; print STDERR " $cmd\n"; system($cmd) && die "$cmd"; print STDERR " Tagging $pkg->{dst} as $msg: DONE\n\n"; # Log #print STDERR " Logging CVS versions $pkg->{dst}\n"; #$cmd = "$CVS log -h -N -r$msg $pkg->{dst} > $pkg->{dst}/$pkg->{CVSLOG}"; #print STDERR " $cmd\n"; #system($cmd) && die "$cmd"; #print STDERR " Logging CVS versions $pkg->{dst}: DONE\n\n"; } } } } sub createPkgFiles { my($rootpkg) = @_; foreach $pkg ( @{$rootpkg->{subpkgs_flat}} ) { # Append README $file = "$pkg->{dst}/$pkg->{README}"; if ( $pkg->{README} ne '' && -r $file ) { print dst_README "$pkg->{NAME} $pkg->{VERSION} README\n"; print dst_README "$sep\n"; appendFileToHandle($file, 'dst_README'); } # Append PUB { my(%x); %x = %$pkg; $x{SRC_DIR} = $x{src_abs}; foreach $k ( NAME, VERSION, CATEGORY, DESC, SRC_DIR ) { print PUB $k, " ", $x{$k}, "\n"; delete $x{$k}; } foreach $k ( sort(grep(/^[A-Z_0-9]+$/, keys(%x))) ) { print PUB $k, " ", $x{$k}, "\n"; } print PUB "\n"; } } foreach $r ( @{$rootpkg->{others_flat}} ) { print PUB "OTHER $r\n\n"; } } sub createPkg { my $pkg; $pkg = readPKG($_[0]); print STDERR "Publishing $_[0]\n"; $dst_name = "$pkg->{src_name}$pkg->{VERSION}"; $dst_dir = "$tmp/$dst_name"; $dst_root = "$dst_dir/src"; mkdirs($dst_root, 0777) || die "$dst_root: $!"; $pkg->{dst_root} = $dst_root; $pkg->{parsed} = {}; $pkg->{others_map} = {}; $pkg->{subpkgs_flat} = []; $pkg->{others_flat} = []; ######################################################################### # Recursively parse packages parsePkg($pkg); ######################################################################### # Copy the entire package copyPkg($pkg); ######################################################################### # Clean the entire package cleanPkg($pkg); ######################################################################### # CVS commit the entire package commitPkg($pkg); ######################################################################### # The files we are going to publish $filev = $pkg->{src_name} . $pkg->{VERSION}; $txt = "$PUBLISH_DIR/$filev.txt"; $archive = "$PUBLISH_DIR/$filev.tgz"; $pub = "$PUBLISH_DIR/$filev.pub"; ######################################################################### # Init PUB file die "$pub already exists, try -force option" if ( -f $pub && ! $force ); open(PUB, ">$pub") || die "$pub: $!"; print PUB "NAME $pkg->{NAME}\n"; print PUB "VERSION $pkg->{VERSION}\n"; print PUB "CATEGORY $pkg->{CATEGORY}\n"; print PUB "DESC $pkg->{DESC}\n"; @subpkg_names = map($_->{NAME}, @{$pkg->{subpkgs_flat}}); print PUB "CONTAINS_PKGS ", join(' ', @subpkg_names), "\n"; print PUB "REQUIRES_OTHERS ", join(' ', @{$pkg->{others_flat}}), "\n"; print PUB "DATE $timestr\n"; #print PUB "MD5 $\n"; print PUB "README $txt\n"; print PUB "ARCHIVE $archive\n"; print PUB "\n"; ################################################################## # Init README, TOC files $dst_README = "$dst_dir/README"; open(dst_README, ">$dst_README") || die "$dst_README: $!"; print dst_README "$pkg->{NAME} $pkg->{VERSION} README\n"; print dst_README "$sep\n\n"; ################################################################## # Add GUM_BUILD_ROOT $GUM_BUILD_ROOT = "$pkg->{src_abs}/../GUM_BUILD_ROOT"; if ( -r $GUM_BUILD_ROOT ) { copyFile($GUM_BUILD_ROOT, "$dst_dir/src/GUM_BUILD_ROOT"); } ################################################################## # Add CVS #$ROOT_CVS = "$pkg->{src_abs}/../CVS"; #if ( -r $ROOT_CVS ) { #copyDir($ROOT_CVS, "$dst_dir/src/CVS"); #} ################################################################## # Add copyright $COPYRIGHT = "$pkg->{src_abs}/../COPYRIGHT"; if ( -r $COPYRIGHT ) { copyFile($COPYRIGHT, "$dst_dir/COPYRIGHT"); } appendFileToHandle($COPYRIGHT, dst_README); print dst_README "\n$sep\n\n"; ################################################################## # Add license $LICENSE = "$pkg->{src_abs}/../LICENSE"; if ( -r $LICENSE ) { copyFile($LICENSE, "$dst_dir/LICENSE"); appendFileToHandle($LICENSE, dst_README); print dst_README "\n$sep\n\n"; } ################################################################## # Create CHANGES $dst_CHANGES = "$dst_dir/CHANGES"; print STDERR " Creating CHANGES $dst_CHANGES\n"; open(dst_CHANGES, ">$dst_CHANGES") || die "$dst_CHANGES: $!"; print dst_CHANGES "$pkg->{NAME} $pkg->{VERSION} CHANGES\n"; print dst_CHANGES "$sep\n\n"; close(dst_CHANGES); my($save_cwd) = getcwd; chdir($dst_dir) || die "$dst_dir: $!"; if ( $pkg->{CHANGES_RELEASES} ) { my(@rels) = split(/\s+/, $pkg->{CHANGES_RELEASES}); @rels = map( "PUBLISH_" . $pkg->{NAME} . $_, @rels); @rels = grep( (tr/a-zA-Z0-9_/_/c, 1), @rels); push(@rels, ''); #print STDERR "rels = '", join("' '", @rels), "'\n"; #exit -1; my($r1, $r2); $r2 = shift(@rels); while ( $r1 = $r2, defined($r2 = shift(@rels)) ) { open(dst_CHANGES, ">>$dst_CHANGES") || die "$dst_CHANGES: $!"; print dst_CHANGES "\n$sep\nChanges from release '$r2' to '$r1'\n"; print dst_CHANGES "$sep\n\n"; close(dst_CHANGES); print STDERR " Changes from release '$r2' to '$r1'\n"; $cmd = "perl $progdir/cvsrevhist.pl -f=-r$r2:$r1 . >> $dst_CHANGES"; print STDERR "$cmd\n"; system("sh -c '$cmd'") && die "$cmd: $!"; } } else { $cmd = "perl $progdir/cvsrevhist.pl . >> $dst_CHANGES"; system("sh -c '$cmd'") && die "$cmd: $!"; } chdir($save_cwd) || die "$save_cwd: $!"; print STDERR " Created CHANGES $dst_CHANGES: DONE\n\n"; ################################################################## # Create TOC $dst_TOC = "$dst_dir/TOC"; print STDERR " Creating TOC $dst_TOC\n"; open(dst_TOC, ">$dst_TOC") || die "$dst_TOC: $!"; print dst_TOC "$pkg->{NAME} $pkg->{VERSION} Table of Contents\n"; print dst_TOC "$sep\n"; close(dst_TOC); # Use ls -lagR system("sh -c 'cd $tmp && ls -lagR $dst_name >> $dst_TOC'"); # Fill in the pkg files createPkgFiles($pkg); # Close output files close(PUB); close(dst_README); print STDERR " Created TOC $dst_TOC: DONE.\n\n"; ######################################################################## # Create the external readme print STDERR " Creating README $txt\n"; open(TXT, ">$txt"); appendFileToHandle($dst_README, TXT); print TXT "$sep\n\n"; print dst_TOC "$pkg->{NAME} $pkg->{VERSION} Package Info\n"; print TXT "$sep\n\n"; appendFileToHandle($pub, TXT); print TXT "$sep\n\n"; appendFileToHandle($dst_CHANGES, TXT); print TXT "$sep\n\n"; appendFileToHandle($dst_TOC, TXT); print TXT "$sep\n\n"; close(TXT); print STDERR " Created README $txt: DONE.\n\n"; ######################################################################## # Create archive and finish TOC print STDERR " Creating $pkg->{NAME} archive $archive\n"; system("sh -c '$tar -C $tmp -c${tar_verbose}f - $dst_name | $gzip -9 > $archive'"); print STDERR " Created $pkg->{NAME} archive $archive: DONE.\n\n"; ######################################################################## # Remove the temp directory system("rm", "-rf", $dst_dir); print STDERR "Publishing $_[0]: DONE\n\n"; } ############################################################################## # tar, gzip $tar = 'tar'; $tar_verbose = 'v'; $tar_verbose = ''; $gzip = 'gzip'; # cvs $CVSROOT = $ENV{CVSROOT}; $CVS = $ENV{CVS}; $CVS = 'cvs.exe' if ( ! defined($CVS) ); $PUBLISH_DIR = $ENV{PUBLISH_DIR}; $PUBLISH_DIR = 'd:/data/ion/www/research/pub' if ( ! $PUBLISH_DIR ); ############################################################################## # Parse arguments @pkgs = (); $index = 0; $reldir = ""; $force = 0; while ( $_ = shift @ARGV ) { if ( /^-?-i/ ) { $index = shift; } elsif ( /^-?-f/ ) { $force ++; } elsif ( /^-?-p/ ) { $PUBLISH_DIR = shift; } elsif ( /^-?-r/ ) { $reldir = shift; } else { push(@pkgs, $_); } } ############################################################################## # Create each package foreach $pkg ( @pkgs ) { createPkg($pkg); } ############################################################################## # Create package index sub size_str { "(" . (-s $_[0]) . " bytes)"; } if ( $index ) { #Pkgs by CATEGORY %c = (); if ( $reldir ne '' && $reldir !~ m@[/\\]$@ ) { $reldir .= '/'; } # Read each published pkg's data file foreach $pub ( glob("$PUBLISH_DIR/*.pub") ) { my($pkg) = readVars($pub, undef, 1); # Arrange by CATEGORY $pkg->{CATEGORY} = "UNKNOWN-CATEGORY" if ( $pkg->{CATEGORY} eq '' ); $pkg->{DESC} = "No Description Available. See README." if ( ! $pkg->{DESC} ); $pkg->{pub} = $pub; $pkg->{pub_file} = basename($pub); if ( ! defined($c{$pkg->{CATEGORY}}) ) { $c{$pkg->{CATEGORY}} = [ ]; } push(@{$c{$pkg->{CATEGORY}}}, $pkg); } @cats = sort(keys(%c)); # Open the index file open(INDEX, ">$index") || die "$index: $!"; # List the cats print INDEX "

Package Categories

\n"; print INDEX "
    \n"; $ci = 0; foreach $cat ( @cats ) { $ci ++; print INDEX qq@
  • $cat\n@; } print INDEX "
\n"; # Print each cat $ci = 0; foreach $cat ( @cats ) { $ci ++; print INDEX qq@

$cat

\n@; print INDEX "
\n"; foreach $pkg ( sort { $a->{NAME} cmp $b->{NAME} || $b->{VERSION} <=> $a->{VERSION} } @{$c{$cat}} ) { my($NAME) = uc($pkg->{NAME}); my($VERSION) = $pkg->{VERSION}; my($DESC) = $pkg->{DESC}; my($ARCHIVE) = basename($pkg->{ARCHIVE}); my($README) = basename($pkg->{README}); print INDEX qq@
$NAME $VERSION
$DESC\n@; print INDEX qq@
Date: $pkg->{DATE}\n@; print INDEX qq@
Requires: $pkg->{REQUIRES_OTHERS}\n@ if ( $pkg->{REQUIRES_OTHERS} ne '' ); print INDEX qq@
View README @ . &size_str($pkg->{README}) . "\n"; print INDEX qq@
View package info @ . &size_str($pkg->{pub}) . "\n"; print INDEX qq@
Download $ARCHIVE @ . &size_str($pkg->{ARCHIVE}) . "\n"; print INDEX qq@
\n@; } print INDEX "
\n"; } print INDEX "
\n"; # Close the index file close(INDEX); print STDERR "Created index $index\n"; } 1; ll0.13/src/bin/sci0100644000175200017560000000561506662461244014325 0ustar stephensstephens#!/bin/sh #set -x #exec=/bin/echo exec= force= y='Checkpoint' fs= tarfs= cmd="$1" opts="" shift while /bin/test $# -gt 0 do f="$1" shift case "$f" in -TEST) exec=/bin/echo opts="$opts $f" ;; -f) force=1 opts="$opts $f" ;; -y) y="$1" shift ;; SCCS) ;; .) /bin/ls SCCS | /bin/sed -e '/^s\./!d' -e 's@^s\.@@' | /usr/bin/xargs -n1024 $0 "$cmd" $opts -y "$y" ;; */*) (cd `/bin/expr "$f" : '\(.*\)/.*'` && $0 "$cmd" $opts -y "$y" `/bin/expr "$f" : '.*/\(.*\)'`) ;; *) if /bin/test -d "$f" then if /bin/test -f "SCCS/s.$f.tar" then f="$f.tar" fs="$fs $f" else /bin/ls "$f" | (cd "$f" && /usr/bin/xargs -n1024 $0 "$cmd" $opts -y "$y") fi else fs="$fs $f" fi ;; esac done case "$cmd" in get|ci|edit|editopen|update) _fs="$fs"; fs="" for f in $_fs do if /bin/test -f "SCCS/s.$f" then fs="$fs $f" if /bin/test -n "$force" then /bin/chmod -w "$f" fi else echo "$f: no SCCS/s.$f" fi done ;; esac case "$cmd" in create|ci|edit|editopen|update) _fs="$fs"; fs="" for f in $_fs do if /bin/test -f "SCCS/p.$f" then echo "$f: SCCS/p.$f exists:" `cat SCCS/p.$f` else fs="$fs $f" fi done ;; esac for f in $fs do case "$f" in *.tar) tarfs="$tarfs $f" ;; esac done case "$cmd" in ci|delget|delta|create) for f in $tarfs do d=`/usr/bin/basename $f .tar` $exec /bin/rm -f "$f" $exec /bin/chmod -Rf ugo+wr "$d" $exec tar -cvf - "$d" > "$f" done ;; esac case "$cmd" in ci|create) _fs="$fs"; fs="" for f in $_fs do if /bin/test -r "$f" then fs="$fs $f" else echo "$f: not readable" fi done ;; esac if /bin/test -n "$fs" then case "$cmd" in update) set +x for f in $fs do sf="SCCS/s.$f" /usr/bin/find "$sf" -newer "$f" -print done | /bin/sed -e 's@^SCCS/s\.@@' | /usr/bin/xargs -n1024 $0 get $opts ;; ci|cie) for f in $fs do $exec /bin/mv "$f" "$f.sci.$$" done $exec scc edit $fs for f in $fs do $exec /bin/mv "$f.sci.$$" "$f" done $exec /bin/chmod +w $fs if /bin/test "$cmd" = "cie" then $exec scc deledit "-y$y" $fs else $exec scc delget "-y$y" $fs fi $exec /bin/date > 'CheckpointDate' ;; create|delget|deledit) $exec scc $cmd "-y$y" $fs ;; get|unedit|prs|diffs) $exec scc $cmd $fs ;; co|edit|editopen) $exec scc edit $fs ;; *) /bin/echo "$0: $cmd: bad command" ;; esac case "$cmd" in get|co|edit|create) for f in $tarfs do d=`/usr/bin/basename $f .tar` $exec /bin/rm -rf "$d" $exec tar -xvf "$f" $exec /bin/chmod -Rf ugo+wr "$d" done ;; esac case "$cmd" in editopen) $exec open -a Edit $fs ;; esac fi exit 0 ll0.13/src/bin/scip0100644000175200017560000000640006662461244014476 0ustar stephensstephens#!/run/thirdParty/perl5/bin/perl eval 'exec /run/thirdParty/perl5/bin/perl $0 ${1+"$@"}' if 0; $exec = 0; $y = 'Checkpoint'; @fs = (); @tarfs = (); sub _exec { if ( $exec ) { system(@_); } else { print STDERR @_, "\n"; } } sub warning { print STDERR "$0: ", @_, "\n"; } sub getdir { my($dir) = $_[0]; my(@filenames); opendir(DIR,$dir) || (warning "Can't open $dir: $!\n", return); @filenames = readdir(DIR); closedir(DIR); grep(($_ ne '.' && $_ ne '..'), @filenames); } sub sfile { ( $_[0] =~ m/^(.*/)([^/]+)$/ ) ? "$1SCCS/$_[1].$2" : "SCCS/$_[1].$_[0]"; } sub dofile { if ( -d ) { if ( -f &sfile("$_.tar", 's') ) { $_ .= '.tar'; push(@fs, $_); } else { } } else { push(@fs, $_); } } $cmd = shift; while ( shift ) { if ( $_ eq '-TEST' ) { $exec = 0; } elsif ( $_ eq '-y' ) { $y = shift; } elsif ( $_ eq 'SCCS' || $_ eq 'RCS' ) { } elsif ( $_ eq '.' ) { my(@x) = &getdir('SCCS'); grep((s/^s.//, 1), @x); push(@ARGV, @x); } elsif ( m@/@ ) { } else { if ( -d ) { if ( -f &sfile_("$_.tar", 's') ) { $_ .= '.tar'; push(@fs, $_); } else { $d = $_; for ( &getdir($d) ) { &dofile("$d/$_"); } } } else { push(@fs, $_); } } } if ( $cmd =~ m/^(get|ci|edit|editopen|update)$/ ) { @_fs = @fs; @fs = (); for ( @_fs ) { $sf = &sfile($_, 's'); if ( -f $sf ) { push(@fs, $_); } else { &warning("$_: no $sf"); } } } if ( $cmd =~ m/^(create|ci|edit|editopen|update)$/ ) { @_fs = @fs; @fs = (); for ( @_fs ) { if ( -f &sfile($_, 'p') ) { &warning("$_: is under edit"); } else { push(@fs, $_); } } } @tarfs = (); for ( @fs ) { if ( m/\.tar$/ ) { push(@tarfs, $_); } } if ( $cmd =~ m/^(ci|delget|delta|create)$/ ) { for ( @tarfs ) { m@^(.*)\.tar$@; $d = $1; &_exec('/bin/rm', '-f', $_); &_exec('/bin/chmod', '-Rf', 'ugo+wr', $d); &_exec("tar -cvf - $d > $_"); } } if ( $cmd =~ m/^(ci|create)$/ ) { @_fs = @fs; @fs = (); for ( @_fs ) { if ( -r $_ ) { push(@fs, $_); } else { &warning("$_: not readable"); } } } if ( @fs ) { if ( $cmd eq 'update' ) { for ( @fs ) { $sf = &sfile($_, 's'); if ( (-M $sf) > (-M $_) ) { &warning("$_: is out of date with $sf"); } } } elsif ( $cmd =~ m/^(ci|cie)$/ ) { for ( @fs ) { &_exec('/bin/mv', $_, "$f.sci.$$"); } &_exec('scc', 'edit', @fs); for ( @fs ) { &_exec('/bin/mv', "$f.sci.$$", $_); } &_exec('/bin/chmod', '+w', @fs); &_exec('scc', ( $cmd eq 'cie' ? 'deledit' : 'delget' ), "-y$y", @fs); #$exec /bin/date > 'CheckpointDate' } elsif ( $cmd =~ m/^(create|delget|deledit)$/ ) { &_exec('scc', $cmd, "-y$y", @fs); } elsif ( $cmd =~ m/^(get|unedit)$/ ) { &_exec('scc', $cmd, @fs); } elsif ( $cmd =~ m/^(co|edit|editopen)$/ ) { &_exec('scc', 'edit', @fs); } else { &warning("$cmd: bad command"); } if ( $cmd =~ m/^(get|co|edit|create)$/ ) { for ( @tarfs ) { m@^(.*)\.tar$@; $d = $1; &_exec('/bin/rm', '-rf', $d); &_exec("tar", '-xvf', $_); &_exec('/bin/chmod', '-Rf', 'ugo+wr', $d); } } } 1; ll0.13/src/bin/si0100644000175200017560000000013407001136307014134 0ustar stephensstephens#!/bin/sh #set -x echo '#include "'"$1"'"' | gcc -E - | awk 'NF' | egrep -v -e '^#' | less ll0.13/src/bin/split.c0100644000175200017560000000450606663227006015116 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_bin_split_c__ #define __rcs_id_bin_split_c__ static const char __rcs_id_bin_split_c[] = "$Id: split.c,v 1.2 1999/02/19 09:25:26 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include /* malloc(), free() */ #include /* strlen(), strcpy(), strcat(), strcmp() */ static char *progname; #ifdef BC #include /* O_BINARY */ #include #endif static int dofile(unsigned long fsize, FILE *in, const char *name) { char *fname; int fn; int rtnval = 0; fname = malloc(sizeof(fname[0]) * (strlen(name) + 5)); fn = 0; do { FILE *out; unsigned long bytes_left; { char buf[5]; sprintf(buf, ".%03d", (int) fn ++); strcpy(fname, name); strcat(fname, buf); if ( (out = fopen(fname, "wb")) == 0 ) { fprintf(stderr, "%s: cannot open \"%s\" for writing\n", progname, fname); rtnval = -1; goto rtn; } } bytes_left = fsize; while ( bytes_left ) { int c; if ( (c = getc(in)) == EOF ) { fclose(out); rtnval = 0; goto rtn; } else { putc(c, out); bytes_left --; } } fclose(out); } while ( 1 ); rtn: free(fname); return rtnval; } int main(int argc, char **argv) { int i; char *outname = 0; unsigned long fsize = 1440000UL; int rtnval = 0; progname = argv[0]; #ifdef BC _fmode = O_BINARY; #endif for ( i = 1; i < argc; i ++ ) { if ( argv[i][0] == '-' ) { switch ( argv[i][1] ) { case 's': fsize = atol(argv[i][2] ? argv[i] + 2 : argv[++ i]); break; case 'o': outname = argv[i][2] ? argv[i] + 2 : argv[++ i]; break; default: fprintf(stderr, "%s: bad option \"%s\"\n", progname, argv[i]); break; } } else { FILE *in; char *inname = argv[i]; if ( strcmp(inname, "-") == 0 ) { in = stdin; } else if ( (in = fopen(inname, "rb")) == 0 ) { fprintf(stderr, "%s: cannot open \"%s\" for reading\n", progname, inname); rtnval ++; } if ( outname == 0 ) { char *p; outname = malloc(sizeof(outname[0]) * (strlen(inname) + 2)); strcpy(outname, inname); if ( (p = strrchr(outname, '.')) ) { *p = '\0'; } else { strcat(outname, "."); } } rtnval += dofile(fsize, in, outname); if ( in != stdin ) fclose(in); } } return rtnval; } ll0.13/src/bin/tgz0100744000175200017560000000445607230344242014344 0ustar stephensstephens#!/bin/sh # $Id: tgz,v 1.6 2001/01/14 15:41:22 stephens Exp $ #set -x if [ -z "$TAR" ] then TAR=tar fi if [ -z "$GZIP" ] then GZIP=gzip fi if [ -z "$BZIP" ] then BZIP=bzip2 fi if [ -z "$BUNZIP" ] then BUNZIP=bunzip2 fi if [ -z "$GUNZIP" ] then GUNZIP="$GZIP -d" fi if [ -z "$COMPRESS" ] then COMPRESS=compress fi c= C=. o= tv= s=.tgz x=x #set -x while [ $# -gt 0 ] do case "$1" in -c) c=1 ;; -o) o="$2" shift ;; -s) s="$2" shift ;; -C) C="$2" shift ;; -*) case "$1" in -*t*) tv="${tv}t" x= ;; esac case "$1" in -*v*) tv="${tv}v" ;; esac ;; *) if [ -d "$1" -o -n "$c" ] then d=`expr "$1" : '\(.*\)/[^/]*' '|' '.'` f=`expr "$1" : '.*/\([^/]*\)' '|' "$1"` if [ -z "$o" ] then o="$f$s" fi case "$o" in *.tb2|*.TB2|*.tar.bz2|*_tar.bz2|*_TAR.BZ2) cmd="(cd $d && $TAR -c${tv}f - '$f' ) | (cd '$C' && $BZIP -9 > '$o')" ;; *.tgz|*.TGZ|*.tar.gz|*_TAR.GZ) cmd="(cd $d && $TAR -c${tv}f - '$f' ) | (cd '$C' && $GZIP -9 > '$o')" ;; *.tar|*.TAR|*.gtar|*.GTAR) cmd="(cd $d && $TAR -c${tv}f - '$f' ) | (cd '$C' && cat - > '$o')" ;; *.gz|*.GZ|*.gzip|*.GZIP) cmd="(cd $d && $GZIP -9 -c '$f' ) | (cd '$C' && cat - > '$o')" ;; *.bz|*.BZ|*.bz2|*.BZ2) cmd="(cd $d && $BZIP -9 -c '$f' ) | (cd '$C' && cat - > '$o')" ;; esac echo $cmd eval $cmd o= elif [ -f "$1" ] then if [ -z "$o" ] then o="." fi if [ ! -d "$o" ] then mkdir "$o" fi case "$1" in *.tgz|*.tar.gz|*.TGZ|*.tz|*.TZ) cmd="$GUNZIP < '$1' | (cd '$o' && $TAR -$x${tv}f -)" ;; *.tbz|*.TBZ|*.tar.b2|*.tb2|*.TB2|*_tar.bz2|*_TAR.BZ2) cmd="$BUNZIP -d -c -k '$1' | (cd '$o' && $TAR -$x${tv}f -)" ;; *.bz|*.BZ) cmd="$BUNZIP -d -k '$1'" ;; *.gz|*.GZ) cmd="$GUNZIP -d -c < '$1'" ;; *.tar|*.TAR|*.gtar|*.GTAR) cmd="(cd '$o' && $TAR -$x${tv}f -) < '$1'" ;; *) echo "$0: $1: unknown suffix" 1>&2 cmd="" ;; esac if [ -n "$cmd" ] then echo $cmd eval $cmd fi o= x=x else : fi ;; esac shift done ll0.13/src/bin/ts0100644000175200017560000000316707065620573014175 0ustar stephensstephens#!/bin/sh set -x action="$1" shift [ -z "$GDB" ] && GDB='gdb' target=gdb files='' while [ $# -gt 0 ] do case "$1" in -t) target="$2" shift; ;; *=*) eval "$1" ;; *) files="$files $1" ;; esac shift done for f in $files do pre='cat -' post='' gdbx='' run_in_db() { _app="$1"; shift gdbx="/tmp/gdbx" echo "#Created by $0: DO NOT MODIFY" > $gdbx echo "break main" >> $gdbx echo "run $*" >> $gdbx $GDB $_app -x $gdbx rm $gdbx } case "$target" in *gdb*) _APP="${APP}" gdbx="/tmp/gdbx" echo "#Created by $0: DO NOT MODIFY" > $gdbx do_line() { case "$line" in \#*) echo "$line" >> $gdbx ;; run*) echo "shell echo '$line'" >> $gdbx echo "$line" >> $gdbx echo 'shell echo Hit return' >> $gdbx echo 'shell read line' >> $gdbx ;; *=*) eval "$line" ;; *) echo "shell echo '$line'" >> $gdbx eval echo "shell '$line'" >> $gdbx ;; esac } post='$target $APP -x $gdbx' ;; *time*) do_line() { echo "$line" case "$line" in \#*) ;; *=*) eval "$line" ;; *) eval "$line" ;; esac } run() { eval time $APP "$@" code=$? echo "=== $APP $@: terminated with $code" if [ $code -ne 0 ] then run_in_db $APP "$@" fi } ;; *) echo "$0: unknown target '$target'" 1>&2 ;; esac eval $pre < "$f" | while read line do do_line done [ -n "$gdbx" -a -r "$gdbx" ] && cat $gdbx eval $post donell0.13/src/bin/uud0100744000175200017560000000417207262415712014336 0ustar stephensstephens#!/bin/perl # # scans files for a uuencoded items in files and decodes them to $dir # and adds a line to $db based on the Subject: lines found # $count = 0; $subject = ''; $dir = shift || die("Specify an output directory"); $db = "$dir/images.txt"; @files = (); %subjects = (); %files = (); $again = 0; while ( $again || defined($_ = <>) ) { $again = 0; chop; if ( s/^Subject:\s+// ) { $subject = $_; } elsif ( /^begin\s+(\S+)\s+(\S+)/ ) { $mode = $1; $file = $2; print STDERR "File: $file, Subject: $subject\n"; if ( $file ne '' ) { $str = ''; $nlines = 0; while ( defined($_ = <>) ) { $nlines ++; if ( $nlines % 100 ) { print STDERR "$nlines lines...\r"; } last if /^end/; if ( /^Subject:\s+/ || /^begin\s+(\S+)\s+(\S+)/ ) { print STDERR "WARNING: found $_"; $again ++; last; } next if /[a-z]/; next unless int((((ord() - 32) & 077) + 2) / 3) == int(length() / 4); $str .= unpack('u', $_); } # Remove dir from $file name $file =~ s@^.*/@@; # Add .jpg suffix if needed $file .= "_" . ($count ++) . ".jpg" if ( $file !~ /\.jpg$/ ); # Give it an orignal name if ( 0 ) { while ( -f "$dir/$file" ) { $file =~ s/_([0-9]+)(\.[^\.]+)$//; $suffix = $1; $file .= ($count ++) . $suffix; } } # If the file doesn't already exist if ( ! -f "$dir/$file" ) { # Add an entry to the index push(@files, $file); while ( defined($files{$subject}) ) { $subject =~ s/_([0-9]+)$//; $subject .= '_' . ($1 + 1); } $subjects{$file} = $subject; $files{$subject} = $file; # print "file = $file, mode = $mode, subject = $subject\n"; # Write the file open(F, ">$dir/$file"); binmode(F); print F $str; close(F); #exit(0); } } } } #Append to db $exists = -r $db; open(INDEX, ">>$db"); binmode(INDEX); print INDEX "Filename\tSubject\n" if ( ! $exists ); foreach $file ( sort(@files) ) { $subject = $subjects{$file}; print INDEX "$file\t$subject\n"; } close(INDEX); ########################################################################## 1; ll0.13/src/bin/uudindex0100744000175200017560000000711507262415713015367 0ustar stephensstephens#!/bin/perl # Creates a html index for stuff in $dir listed by $db # Run this after uud. # $dir = shift || "images"; $db = "$dir.txt"; $_html = '.html'; ########################################################################## @fieldnames = (); @fields = (); @records = (); @files = (); %subjects = (); %files = (); #Read db open(INDEX, "<$db"); binmode(INDEX); # First record is the field names $_ = ; chop; @fieldnames = split("\t", $_); $fieldindex = 0; foreach $fieldname ( @fieldnames ) { $fieldindex{$fieldname} = $fieldindex ++; } while ( ) { chop; @fields = split("\t", $_); push(@records, [ @fields ]); } close(INDEX); #Create index.html $menu = "menu_" . $fieldnames[0] . $_html; open(INDEX, ">$dir/index$_html"); binmode(INDEX); print INDEX qq@ None <BODY> <CENTER> This frameset document contains: <UL> <LI> <A HREF="$menu">Menu</A></LI> </UL> </BODY> @; close(INDEX); #Create blank.html open(INDEX, ">$dir/blank$_html"); binmode(INDEX); print INDEX q@ None @; close(INDEX); sub add_suffix { my($x,$s) = @_; $x =~ s/\.[^.]+$//; $x .= $s; $x; } #Create menus $fieldindex = -1; foreach $fieldname ( @fieldnames ) { $fieldindex ++; $menu = "menu_$fieldname$_html"; open(INDEX, ">$dir/$menu"); binmode(INDEX); print INDEX qq~ None ~; # Put a record to select a different column sorting print INDEX qq~~; foreach $fname ( @fieldnames ) { print INDEX qq~~; foreach $field ( @$record ) { print INDEX qq~
$fname~; } print INDEX "\n"; # Sort by Filename and create htmls for each file $fieldindex = $fieldindex{'Filename'}; @records = sort { $a->[$fieldindex] cmp $b->[$fieldindex] } @records; foreach $ri ( 0..$#records ) { $record = $records[$ri]; $image = $record->[0]; $HREF = add_suffix($record->[0], $_html); $prev = $ri > 0 ? add_suffix($records[$ri - 1]->[0], $_html) : undef; $next = $ri <= $#records ? add_suffix($records[$ri + 1]->[0], $_html) : undef; print STDERR "HREF='$HREF', image='$image', prev='$prev', next='$next'\n"; exit(1); if ( $HREF ) { open(HREF,">$HREF") || die "Cannot write '$HREF'"; print HREF qq~ None
$record->[1]

~; if ( $prev ) { print HREF qq~PREV $prev\n~; } if ( $next ) { print HREF qq~NEXT $next\n~; } print HREF qq~


$image\n~; print HREF qq~
~; close(HREF); } } # Sort by current field @records = sort { $a->[$fieldindex] cmp $b->[$fieldindex] } @records; foreach $ri ( 0..$#records ) { $record = $records[$ri]; $HREF = add_suffix($record->[0]. $_html); print INDEX qq~
$field~; } print INDEX "\n"; } print INDEX qq~

~; close(INDEX); } 1; ll0.13/src/bin/which0100744000175200017560000000121207322242234014625 0ustar stephensstephens#!/bin/sh #set -x pathchar=':' if expr index "$PATH" ';' > /dev/null then pathchar=';' fi oIFS="$IFS" for f in ${1+"$@"} do IFS="$pathchar" for d in ${PATH} do IFS="$oIFS" b="$d/$f" t="$b" if [ -x "$t" -a -f "$t" ] then echo "$f: $t" continue 2 fi t="$b.bat" if [ -x "$t" -a -f "$t" ] then echo "$f: $t" continue 2 fi t="$b.com" if [ -x "$t" -a -f "$t" ] then echo "$f: $t" continue 2 fi t="$b.exe" if [ -x "$t" -a -f "$t" ] then echo "$f: $t" continue 2 fi done echo "$f: not found" done IFS="$oIFS" ll0.13/src/bin/whichall0100644000175200017560000000014306662461244015331 0ustar stephensstephens#!/bin/sh for d in `echo $PATH|tr ':' ' '` do if [ -x $d/$1 ] then echo "$d/$1" fi done ll0.13/src/bin/wwwsend0100644000175200017560000000336106662461243015240 0ustar stephensstephens#!/bin/sh # Copyright 1998-1999 Kurt A. Stephens http://www.acm.org/~stephensk # # This script sends an entire directory tree via ftp # It only sends the files that have changed since the last send # by keeping a timestamp file around (wwwsend.ts) # #set -x dat=./wwwsend.dat ldir=www dryrun= override= timestamp= findopts= while [ $# -gt 0 ] do case "$1" in -dryrun) dryrun=1 ;; *=*) override="$override$1;" ;; *) dat="$1" ;; esac shift done echo "$0: Reading $dat" [ -n "$override" ] && eval $override cwd="`pwd`" . $dat || exit 1 [ -n "$override" ] && eval $override cwd="`pwd`" #ldir=$(cd $ldir && pwd) #echo "ldir=$ldir" #exit # Run make if it has a Makefile if [ -f $ldir/Makefile ] then echo "$0: Making $ldir ..." (cd $ldir && make) echo "$0: done."; fi # ftp script: open, login and set binary script=$$.tmp echo "$0: Creating ftp script $script"; cat >$script <>$script # ftp script: copy files [ -z "$timestamp" ] && timestamp="$cwd/wwwsend.ts" [ -f "$timestamp" ] && findopts="-newer '$timestamp' $findopts" (set -x; cd $ldir && eval find . -type f $findopts -print) | while read f do d=`dirname $f` echo "cd $rdir/$d" echo "put $f" done >>$script # ftp script: close and quit cat >>$script <> $timestamp # Cleanup rm $script echo "$0: done." ll0.13/src/bin/ion_startx0100775000175200017560000000165707546411366015752 0ustar stephensstephens#!/bin/sh # $Id: ion_startx,v 1.6 2002/10/01 21:26:14 stephens Exp $ # # trap all output to .startx. exec > "${HOME}/.startx" 2>&1 set -x # Go home. cd "$HOME" # Unexport ION_TERM and ION_TERM_SCREEN because terminal created # under X will not be associated with the console. # This will force the terminal window titles to be redetermined. # ION_TERM='' ION_TERM_SCREEN='' export ION_STARTX_RUNNING='1' # Determine the type of window manager. export ION_XWM="sawfish" # Need to compute this! # Start ssh agent. #eval "`ssh-agent -s`" # Running under docking station? # Use xinerama if ion_dockstatn then set -- -- +xinerama fi # Start X for real now. if [ $# -gt 0 ] then startx "$@" else startx fi # Load SSH agent info. . "${HOME}/.ion_ssh_agent" rm -f "${HOME}/.ion_ssh_agent" # Stop ssh agent. if [ "$SSH_AGENT_PID" != "" ] then eval `ssh-agent -k` fi if [ "$SSH2_AGENT_PID" != "" ] then kill "$SSH2_AGENT_PID" fi ll0.13/src/bin/dos2unix.c0100644000175200017560000000047005551357511015532 0ustar stephensstephens#include int main() { int c; while ( (c = getchar()) != EOF ) { if ( c == '\r' ) { if ( (c = getchar()) == '\n' ) { putchar('\n'); } else { putchar('\r'); if ( c != EOF ) putchar(c); } } else { putchar(c); } } return 0; } ll0.13/src/bin/swig2def.pl0100744000175200017560000000066407262414406015666 0ustar stephensstephens#!/usr/bin/perl use English; $RS = ';'; my $id = 1; print "EXPORTS\n"; while ( <> ) { if ( s/^\s*[a-z_]*extern[a-z_]*\s+((const\s*)?\w+\s*\**\s*\**)//si ) { my $type = $1; print STDERR "line '$_'\n"; $type =~ s/\s+//sg; while ( s/(\w+)//s ) { my $symbol = $1; my $data = (s/[(][^\]]*[)]//s ? '' : 'DATA '); if ( ! $data ) { print "\t$symbol @ $id $data;\n"; ++ $id; } } } } 1; ll0.13/src/bin/.#uud.1.20100744000175200017560000000417207245406670014762 0ustar stephensstephens#!/bin/perl # # scans files for a uuencoded items in files and decodes them to $dir # and adds a line to $db based on the Subject: lines found # $count = 0; $subject = ''; $dir = shift || die("Specify an output directory"); $db = "$dir/images.txt"; @files = (); %subjects = (); %files = (); $again = 0; while ( $again || defined($_ = <>) ) { $again = 0; chop; if ( s/^Subject:\s+// ) { $subject = $_; } elsif ( /^begin\s+(\S+)\s+(\S+)/ ) { $mode = $1; $file = $2; print STDERR "File: $file, Subject: $subject\n"; if ( $file ne '' ) { $str = ''; $nlines = 0; while ( defined($_ = <>) ) { $nlines ++; if ( $nlines % 100 ) { print STDERR "$nlines lines...\r"; } last if /^end/; if ( /^Subject:\s+/ || /^begin\s+(\S+)\s+(\S+)/ ) { print STDERR "WARNING: found $_"; $again ++; last; } next if /[a-z]/; next unless int((((ord() - 32) & 077) + 2) / 3) == int(length() / 4); $str .= unpack('u', $_); } # Remove dir from $file name $file =~ s@^.*/@@; # Add .jpg suffix if needed $file .= "_" . ($count ++) . ".jpg" if ( $file !~ /\.jpg$/ ); # Give it an orignal name if ( 0 ) { while ( -f "$dir/$file" ) { $file =~ s/_([0-9]+)(\.[^\.]+)$//; $suffix = $1; $file .= ($count ++) . $suffix; } } # If the file doesn't already exist if ( ! -f "$dir/$file" ) { # Add an entry to the index push(@files, $file); while ( defined($files{$subject}) ) { $subject =~ s/_([0-9]+)$//; $subject .= '_' . ($1 + 1); } $subjects{$file} = $subject; $files{$subject} = $file; # print "file = $file, mode = $mode, subject = $subject\n"; # Write the file open(F, ">$dir/$file"); binmode(F); print F $str; close(F); #exit(0); } } } } #Append to db $exists = -r $db; open(INDEX, ">>$db"); binmode(INDEX); print INDEX "Filename\tSubject\n" if ( ! $exists ); foreach $file ( sort(@files) ) { $subject = $subjects{$file}; print INDEX "$file\t$subject\n"; } close(INDEX); ########################################################################## 1; ll0.13/src/bin/.#uudindex.1.20100744000175200017560000000711507245406752016013 0ustar stephensstephens#!/bin/perl # Creates a html index for stuff in $dir listed by $db # Run this after uud. # $dir = shift || "images"; $db = "$dir.txt"; $_html = '.html'; ########################################################################## @fieldnames = (); @fields = (); @records = (); @files = (); %subjects = (); %files = (); #Read db open(INDEX, "<$db"); binmode(INDEX); # First record is the field names $_ = ; chop; @fieldnames = split("\t", $_); $fieldindex = 0; foreach $fieldname ( @fieldnames ) { $fieldindex{$fieldname} = $fieldindex ++; } while ( ) { chop; @fields = split("\t", $_); push(@records, [ @fields ]); } close(INDEX); #Create index.html $menu = "menu_" . $fieldnames[0] . $_html; open(INDEX, ">$dir/index$_html"); binmode(INDEX); print INDEX qq@ None <BODY> <CENTER> This frameset document contains: <UL> <LI> <A HREF="$menu">Menu</A></LI> </UL> </BODY> @; close(INDEX); #Create blank.html open(INDEX, ">$dir/blank$_html"); binmode(INDEX); print INDEX q@ None @; close(INDEX); sub add_suffix { my($x,$s) = @_; $x =~ s/\.[^.]+$//; $x .= $s; $x; } #Create menus $fieldindex = -1; foreach $fieldname ( @fieldnames ) { $fieldindex ++; $menu = "menu_$fieldname$_html"; open(INDEX, ">$dir/$menu"); binmode(INDEX); print INDEX qq~ None ~; # Put a record to select a different column sorting print INDEX qq~~; foreach $fname ( @fieldnames ) { print INDEX qq~~; foreach $field ( @$record ) { print INDEX qq~
$fname~; } print INDEX "\n"; # Sort by Filename and create htmls for each file $fieldindex = $fieldindex{'Filename'}; @records = sort { $a->[$fieldindex] cmp $b->[$fieldindex] } @records; foreach $ri ( 0..$#records ) { $record = $records[$ri]; $image = $record->[0]; $HREF = add_suffix($record->[0], $_html); $prev = $ri > 0 ? add_suffix($records[$ri - 1]->[0], $_html) : undef; $next = $ri <= $#records ? add_suffix($records[$ri + 1]->[0], $_html) : undef; print STDERR "HREF='$HREF', image='$image', prev='$prev', next='$next'\n"; exit(1); if ( $HREF ) { open(HREF,">$HREF") || die "Cannot write '$HREF'"; print HREF qq~ None
$record->[1]

~; if ( $prev ) { print HREF qq~PREV $prev\n~; } if ( $next ) { print HREF qq~NEXT $next\n~; } print HREF qq~


$image\n~; print HREF qq~
~; close(HREF); } } # Sort by current field @records = sort { $a->[$fieldindex] cmp $b->[$fieldindex] } @records; foreach $ri ( 0..$#records ) { $record = $records[$ri]; $HREF = add_suffix($record->[0]. $_html); print INDEX qq~
$field~; } print INDEX "\n"; } print INDEX qq~

~; close(INDEX); } 1; ll0.13/src/bin/cvsfix.pl0100644000175200017560000000253407322242234015446 0ustar stephensstephens#!/usr/local/bin/perl # $Id: cvsfix.pl,v 1.2 2001/07/06 07:04:28 stephens Exp $ # use File::Find; $debug = 9; $testing = 0; $keep_backup = 1; $filename = '(Entries|Root|Repository)'; while ( @ARGV ) { $_ = shift @ARGV; if ( /^--?f/ ) { $filename = shift @ARGV; } elsif ( /^--?d/ ) { ++ $debug; } elsif ( /^--?t/ ) { ++ $testing; } elsif ( /^--?[h?]/ ) { print "Removes CRs from CVS files.\n"; } else { push(@ARGV, $_); last; } } sub wanted { my ($file) = $File::Find::name; #print STDERR "$file\n"; if ( $file =~ m@/cvs$@s && -d $_ ) { print STDERR "Directory named: $file\n" if ( $debug > 1 ); if ( ! $testing ) { rename($_, "$_.CVS"); rename("$_.CVS", "CVS"); } } elsif ( $file =~ m@/(CVS|cvs)/(Entries|Root|Repository)$@s ) { my($in, $out) = ( $_, "$_.tmp" ); my($line); print STDERR "Checking: $file\n" if ( $debug > 1 ); open($in, "<$in") || die "$in: $!"; binmode($in); $line = join('', <$in>); close($in); #print STDERR "$line"; if ( $line =~ s/\r//sg ) { print "Had CR: $file\n"; if ( ! $testing ) { rename($in, $out) || die "rename $in $out: $!"; open($in, ">$in") || die "$in: $!"; binmode($in); print $in $line; close($in); #unlink($out) if ( ! $keep_backup ); } } } } find(\&wanted, @ARGV); 1; ll0.13/src/bin/cvsadd_r0100755000175200017560000000030007312605361015312 0ustar stephensstephens#!/bin/sh # $Id: cvsadd_r,v 1.1 2001/06/16 07:29:53 stephens Exp $ # Recursively add files to cvs find "$@" -type d | xargs cvs add find "$@" -type f -o \( -name CVS -prune \) | xargs cvs add ll0.13/src/bin/ion_open_url0100755000175200017560000000026407312337470016231 0ustar stephensstephens#!/usr/bin/perl while ( <> ) { chomp; if ( /^(\w+)URL=(.*)\r?$/ ) { print STDERR "open '$2'\n"; exec('gnome-moz-remote', '--newwin', $2); exit(1); } }ll0.13/src/bin/wwwgrab0100775000175200017560000000013707351534001015212 0ustar stephensstephens#!/bin/sh # $Id: wwwgrab,v 1.1 2001/09/18 02:57:05 stephens Exp $ exec ${PERL:-perl} $0.pl $@ ll0.13/src/bin/ion_make0100755000175200017560000000035507364666220015331 0ustar stephensstephens#!/bin/sh # $Id: ion_make,v 1.1 2001/10/22 00:47:12 stephens Exp $ __cmd="make" if [ -f "GUMakefile" ] then __cmd="$ION_HOME/src/gum/bin/gum" else __cmd="make" fi if [ $# -gt 0 ] then exec "$__cmd" "$@" else exec "$__cmd" fi ll0.13/src/bin/wwwgrab.pl0100775000175200017560000000306007546411316015633 0ustar stephensstephens#!/usr/bin/perl # $Id: wwwgrab.pl,v 1.2 2002/10/01 21:25:34 stephens Exp $ use Socket; sub wwwgrab { $_=@_[0]; $savefilename=@_[1] || '&STDOUT'; if (!$_) { print "Usage: $0 http://www.any.site/location [outputfilename]\n"; print " Where [outputfilename] is the optional filename to create.\n"; print " (ommitting this means that it will mean that the data will be\n"; die " sent to STDOUT. If this file exists, it will be overwritten)\n"; } /http:\/\/([^\/]*)\/*([^ ]*)/; $site = $1; $file = "/".$2; if (!$site) { die "$0: Fatal Error. You appear to have munged your URL address.\nIt must be in the form of http://www.any.site/location\n"; } $_ = $site; /^([^:]*):*([^ ]*)/; $site = $1; $port = $2; $port = 80 unless $port; $hostname = $site; ($sockaddr,$there,$response,$tries) = ("Snc4x8"); $there = pack($sockaddr,2,$port, &getaddress($hostname)); $proto = (getprotobyname ('tcp'))[2]; if (!socket(S,AF_INET,SOCK_STREAM,$proto)) { die "$0: Fatal Error. $!\n"; } if (!connect(S,$there)) { die "$0: Fatal Error. $!\n"; } select(S); $|=1; select(STDOUT); print S "GET $file HTTP/1.0\r\n"; print S "\n"; open(OUT,">".$savefilename) || die "$0: Fatal error. Cannot create $savefilename.\n"; while($line = ) { print OUT $line; } close(S); close(OUT); } sub getaddress { local($host) = @_; local(@ary); @ary = gethostbyname($host); return(unpack("C4",$ary[4])); } while ( @ARGV ) { my $url = shift @ARGV; my $out = shift @ARGV; wwwgrab($url, $out); } 1; ll0.13/src/bin/ifud0100755000175200017560000000033707467101266014474 0ustar stephensstephens#!/bin/sh # Version: $Id: ifud,v 1.1 2002/05/11 02:32:22 stephens Exp $ # Author: kurtstephens@acm.org 2001/10/26 # Bring a network interface down and up again. [ -z "$1" ] && set -- eth0 /sbin/ifdown "$1" /sbin/ifup "$1" ll0.13/src/bin/ifdu0100755000175200017560000000033707467101266014474 0ustar stephensstephens#!/bin/sh # Version: $Id: ifdu,v 1.1 2002/05/11 02:32:22 stephens Exp $ # Author: kurtstephens@acm.org 2001/10/26 # Bring a network interface down and up again. [ -z "$1" ] && set -- eth0 /sbin/ifdown "$1" /sbin/ifup "$1" ll0.13/src/bin/ion_vmware0100755000175200017560000000046207602406446015711 0ustar stephensstephens#!/bin/sh # $Id: ion_vmware,v 1.5 2001/12/01 02:46:24 stephens Exp $ export DISPLAY=":0"; # So VMWARE full-screen works. #"/usr/local/bin/ion_vmware.services" start # Start vmware services exec /iimp/app/p/vmware/prod/bin/vmware ${1+"$@"} #"/usr/local/bin/ion_vmware.services" stop # Stop vmware services ll0.13/src/bin/cuecatlibrary.pl0100775000175200017560000003752407546411425017021 0ustar stephensstephens#!/usr/local/bin/perl # $Id: cuecatlibrary.pl,v 1.3 2002/10/01 21:26:45 stephens Exp $ use DBI; use LWP; use LWP::UserAgent; #use HTML::Parse; #use HTML::FormatText; use Barcode::Cuecat; use Business::ISBN qw(is_valid_checksum); use Date::Manip; use Data::Dumper; use strict; $Date::Manip::DateFormat = 'US'; ####################################################### my $database = 'library'; my $table = 'item'; my $item_lookup = 0; my $item_default = { 'items' => 1, 'owner' => 'kurt', 'item_type' => 'book', }; ####################################################### my $dbh = DBI->connect("DBI:mysql:$database","stephens","foobar") or die("Error! $DBI::ERRSTR\n\n"); my @fields = qw(id id_chain barcode_type barcode item_type items isbn title author editor illustrator price est_price format publisher pub_date edition_desc notes url owner created keyword box); if ( 0 ) { print qq{ CREATE TABLE $table ( id INTEGER PRIMARY KEY AUTO_INCREMENT, id_chain INTEGER, barcode_type VARCHAR(8), barcode VARCHAR(64), item_type VARCHAR(8), items INTEGER, isbn VARCHAR(64), title VARCHAR(255), author VARCHAR(255), editor VARCHAR(255), illustrator VARCHAR(255), price REAL, est_price REAL, format VARCHAR(255), publisher VARCHAR(255), pub_date DATE, edition_desc VARCHAR(32), notes VARCHAR(255), url VARCHAR(255), owner VARCHAR(16), created DATETIME, keyword VARCHAR(255), box VARCHAR(16), ts TIMESTAMP ); }; } ####################################################### my $fields = join(', ', @fields); my @fields_no_id = grep($_ ne 'id', @fields); my $fields_no_id = join(', ', @fields_no_id); my $exists_stmt = "SELECT barcode_type, barcode FROM $table WHERE barcode_type = ? AND barcode = ?"; my $insert_stmt = "INSERT INTO $table ($fields_no_id) VALUES (" . join(', ', ('?') x @fields_no_id) . ')'; my @update_fields = @fields_no_id; @update_fields = grep($_ ne 'barcode', @update_fields); @update_fields = grep($_ ne 'barcode_type', @update_fields); my $exists_sth = $dbh->prepare($exists_stmt) || die($dbh->errstr); my $insert_sth = $dbh->prepare($insert_stmt) || die($dbh->errstr); my $lookup_sth = $dbh->prepare("SELECT $fields FROM $table WHERE (url IS NULL)") || die($dbh->errstr); my $all_sth = $dbh->prepare("SELECT $fields FROM $table") || die($dbh->errstr); sub item_print { my ($item) = @_; # Print it out. print join("\n", map(sprintf("%16s: %s", ucfirst($_), defined $item->{$_} ? "'$item->{$_}'" : 'NULL'), @fields), '', ''); } my $item_inserted = 0; sub item_insert { my ($item) = @_; $insert_sth->execute(map($item->{$_}, @fields_no_id)); # Ugly MYSQL specific code here. $item->{'id'} ||= $dbh->{'mysql_insertid'}; ++ $item_inserted; } sub item_exists { my ($item, $result) = @_; $exists_sth->execute($item->{'barcode_type'}, $item->{'barcode'}); $exists_sth->fetchrow_hashref; } my %update_sth; sub item_update { my ($item) = @_; die("Id not defined") unless $item->{'id'}; my @keys = grep($_ ne 'id', sort keys %$item); my $update_stmt = "UPDATE $table SET " . join(', ', map("$_ = ?", @keys)) . ' WHERE id = ? LIMIT 1'; my @args = ( map($item->{$_}, @keys), $item->{'id'} ); $DB::single = 1; my $update_sth = $update_sth{$update_stmt} ||= $dbh->prepare($update_stmt) || die($dbh->errstr); $update_sth->execute(@args) || warn($update_sth->errstr . ": $update_stmt"); my $count = $update_sth->rows; if ( 0 ) { my $sql = $update_stmt; $sql =~ s/\?/%s/sg; $sql = sprintf($sql, @args); print STDERR "$sql: "; } print STDERR "updated $count rows\n"; $count == 1 ? 1 : 0; } sub item_needs_lookup { $lookup_sth->execute; $lookup_sth->fetchall_arrayref({}); } sub repair { $all_sth->execute(); my $items = $all_sth->fetchall_arrayref({}); for my $item ( @$items ) { print STDERR "isbn=$item->{isbn}\n"; my $repair; for ( values %$item ) { if ( $_ eq 'NULL' || $_ eq '0000-00-00' ) { $_ = undef; $repair = 1; } elsif ( s/^'(.*)'$/$1/s ) { s/\\'/'/sg; # print STDERR "ouch: '$_'\n"; $repair = 1; } } if ( $repair ) { item_update($item); print STDERR "repaired\n"; } } } #repair(); exit(1); ####################################################### my %ese = ( ' ', 'nbsp', '<', 'lt', '>', 'gt', '&', 'amp' ); my $ese_match = '[' . join('', grep($_ ne ' ', keys %ese)) . ']'; sub text_to_sgml_entity # Escape SGML entity. { my $x = join('', @_); $x =~ s/($ese_match)/'&' . $ese{$1} . ';'/sgo; $x; } my %setc = reverse %ese; my $setc_match = '(' . join('', keys %setc) . ')'; sub sgml_entity_to_text { my $x = join(' ', @_); $x =~ s/&($setc_match);/$setc{$1}/sgo; $x; } ####################################################### my $agent = "Lynx/0.1"; ################################################ # Barns & Noble. # my $bn_ua; sub bn_lookup { my ($item) = @_; my $isbn = $item->{'isbn'}; return undef unless $isbn; # Create a user agent object if ( ! $bn_ua ) { $bn_ua = new LWP::UserAgent; $bn_ua->agent($agent . " " . $bn_ua->agent); } my $url = "http://shop.bn.com/bookSearch/isbnInquiry.asp?isbn=$isbn"; # Create a request my $req = new HTTP::Request GET => $url; $req->content_type('application/x-www-form-urlencoded'); # Pass request to the user agent and get a response back my $res = $bn_ua->request($req); my $content = $res->content; $content =~ s/^.*//si; # $DB::single = 1; $content =~ s/.*$//si; $content =~ s///sg; $content =~ s/ / /sgi; # $DB::single = 1; # Hack for multiple authors $content =~ s@\s+(]*author)@; $1@sgi; $content =~ s@]*>@\n@sgi; $content =~ s@]*>@@sgi; # $DB::single = 1; # my $ft = HTML::FormatText->new; $item->{'url'} = $url; my @content = split(/\n/, $content); foreach ( @content ) { s/\ / /g; $_ = sgml_entity_to_text($_); s/^\s+//; s/\s+$//; s/\s+/ /g; } @content = grep(length, @content); my @data = (); foreach ( @content ){ # $_ = $ft->format(parse_html($_)); if ( length ) { #print "BN: $_\n"; push(@data, $_); } last if ( /Edition Desc/i ); } # $DB::single = 1; # Not found. if ( (! length $data[0]) || $data[0] =~ /We are sorry, but the ISBN provided is not in our database|We are sorry, but this ISBN is not in our database/i ) { print STDERR "BN: ISBN not in database\n"; return undef; } $item->{'title'} = $data[0]; $item->{'author'} = $data[1]; # $DB::single = 1; my @editors; while ( $item->{'author'} =~ s/\s+(\w+\s+(\w\.\s+)?\w+)\s+[(]ed[^\)]+[)]\s*/ /i ) { # $DB::single = 1; push(@editors, $1); } $item->{'editor'} = join('; ', @editors) if @editors; my @ills; while ( $item->{'author'} =~ s/\s+(\w+\s+(\w\.\s+)?\w+)\s+[(]il[^\)]+[)]\s*/ /i ) { # $DB::single = 1; push(@ills, $1); } $item->{'illustrator'} = join('; ', @ills) if @ills; foreach ( @data ) { # $DB::single = 1; if ( s/^.*Retail\s+Price\s*:\s*\$([\d\.]+)//i ) { $item->{'price'} = $1; } elsif ( s/^.*Format\s*:\s*//i ) { $item->{'format'} = $_; $item->{'item_type'} = 'book' if $item->{'format'} =~ /\dpp\./; } elsif ( s/^.*Publisher\s*:\s*//i ) { $item->{'publisher'} = $_; } elsif ( s/^.*Pub.+Date\s*:\s*//i ) { $item->{'pub_date'} = $_; } elsif ( s/^.*Edition\s+Desc[^:]*:\s*//i ) { $item->{'edition_desc'} = $_; } } # $DB::single = 1; $item; } ################################################ # Library of Congress zgate cgi. # my $zgate_ua; my $session_id; sub zgate_lookup { my ($item) = @_; my $isbn = $item->{'isbn'}; return undef unless $isbn; # Create a user agent object if ( ! $zgate_ua ) { $zgate_ua = new LWP::UserAgent; $zgate_ua->agent($agent . " " . $zgate_ua->agent); } while ( 1 ) { if ( ! $session_id ) { # Hit INIT URL so we can get a SESSION_ID. my $url = "http://lcweb.loc.gov/cgi-bin/zgstart?ACTION=INIT&FORM_HOST_PORT=/prod/www/data/z3950/locils.html,z3950.loc.gov,7090"; # Create a request my $req = new HTTP::Request GET => $url; $req->content_type('application/x-www-form-urlencoded'); print STDERR "zgate: Getting SESSION_ID\n"; # Pass request to the user agent and get a response back my $res = $zgate_ua->request($req); my $content = $res->content; # $DB::single = 1; ($session_id) = $content =~ / $session_id, "ESNAME" => "F", "ACTION" => "SEARCH", "DBNAME" => "VOYAGER", "MAXRECORDS" => "20", "RECSYNTAX" => "1.2.840.10003.5.10", # "REINIT" => "/cgi-bin/zgate?ACTION=INIT&FORM_HOST_PORT=/prod/www/data/z3950/locils.html,z3950.loc.gov,7090", "USE_1" => "7", # ISBN "TERM_1" => $isbn, ); $url .= '?' . join('&', map("$_=$param{$_}", keys %param)); # Create a request my $req = new HTTP::Request GET => $url; $req->content_type('application/x-www-form-urlencoded'); # Pass request to the user agent and get a response back my $res = $zgate_ua->request($req); my $content = $res->content; # If the session expired, get a new one. if ( $content =~ /session has expired/i ) { $session_id = undef; next; } #$DB::single = 1; $content =~ s@^.*
(.*)
.*$@$1@is; $content =~ s@^.*
(.*)
.*$@$1@is; # $DB::single = 1; $item->{'url'} = $url; my %data; my $key; foreach ( split("\n", $content) ) { if ( s/^([A-Z][^:]+):\s+// ) { $key = lc($1); $data{$key} = $_; } elsif ( $key && s/^\s\s+// ) { s/^\s+//; $data{$key} .= ' ' . $_; } } foreach ( values %data ) { s/^\s+//; s/\s+$//; s/\.$//; } # $DB::single = 1; $item->{'author'} = join(' ', reverse split(/,\s*/, $data{'author'})); $item->{'title'} = $data{'title'}; my $x = $item->{'author'}; $item->{'title'} =~ s@\s*/\s*$x\s*$@@; ($item->{'publisher'}, $item->{'pub_date'}) = $data{'published'} =~ /:\s*(.*),\s+[a-z]?(\d+)/i; $item->{'format'} = $data{'description'}; last; } $item; } ###################################################### sub item_lookup { my ($item) = @_; $DB::single = 1; unless ( $item->{'isbn'} ) { # Is it something with an almost definite ISBN? if ( $item->{'barcode_type'} =~ /(KBD|IBN|IB5|IB2)/i ) { # Normalize ISBN from barcode. $item->{'isbn'} = $item->{'barcode'}; $item->{'isbn'} =~ s/^978//; $item->{'isbn'} =~ s/\-//g; $item->{'isbn'} = substr($item->{'isbn'}, 0, 10); $DB::single = 1; # Validate the ISBN number. my $cs = new Business::ISBN($item->{'isbn'}); if ( ! $cs ) { print STDERR "NOT ISBN: $item->{'isbn'} \n\n"; $item->{'isbn'} = undef; } else { $cs->fix_checksum(); $item->{'isbn'} = $cs->as_string(); $item->{'isbn'} =~ s/\-//g; # Now try to look up using ISBN. } } } my $found; for my $try ( [ 'BN', \&bn_lookup, ], [ 'ZGATE', \&zgate_lookup, ], ) { my ($source, $source_func) = @$try; print STDERR "Trying: $source\n"; my $result = $source_func->({ %$item }); # Merge results if ( $result ) { # Clear up whitespace for my $x ( values %$result ) { chomp($x); $x =~ s/^\s+//s; $x =~ s/\s+$//s; $x =~ s/\s+/ /sg; $x =~ s/;$//sg; } # Delete zero length entries. delete @{$result}{grep(! length($result->{$_}), keys %$result)}; # item_print($result); # $DB::single = 1; foreach ( keys %$result ) { $found = $result; $item->{$_} = $result->{$_} if ! defined($item->{$_}); } } else { print STDERR "$source failed\n"; } } return undef if ! $found; # Normalize pubdate. # '1994' => 'August 1 1994' $item->{'pub_date'} =~ s/^\s*(\d\d\d\d)\s*$/January $1/i; # 'August 1994' => 'August 1 1994' $item->{'pub_date'} =~ s/^\s*([a-z]+)\s+(\d\d\d\d)\s*$/$1 1 $2/i; #$DB::single = 1; # Use ParseDate to parse it. $item->{'pub_date'} = scalar(UnixDate($item->{'pub_date'}, "%Y-%m-%d")) || $item->{'pub_date'} if defined $item->{'pub_date'}; # Print it out. # item_print($item); $item; } if ( 0 ) { for my $isbn ( '1565922204', # '0375505784', ) { my $item = { %$item_default, 'isbn' => $isbn }; item_lookup($item); item_print($item); # print Data::Dumper->new([ $item ], [qw($item)])->Dump; } exit; } sub lookup_items { my $items = item_needs_lookup; # $DB::single = 1; if ( $items ) { for my $item ( @$items ) { print "\n\n============================================\nUPDATING: \n"; item_print($item); # $DB::single = 1; my $tmp = { map(($_, $item->{$_}), 'id', 'barcode_type', 'barcode', 'isbn') }; if ( item_lookup($tmp) ) { print "WITH: \n"; item_print($tmp); my $update = { map(($_, $tmp->{$_}), 'url', 'id', grep((! defined $item->{$_}) && defined $tmp->{$_} && $item->{$_} ne $tmp->{$_}, @update_fields ), ) }; print "CHANGED: \n"; item_print($update); $DB::single = 1; item_update($update); } else { print "NO DATA FOUND\n"; } } } } sub quit { lookup_items() if ( $item_inserted ); exit(0); } ############################################################ # Main loop # sub read_lines { my $bco = new Barcode::Cuecat(); my $line; while ( (print STDERR "\nISBN: "), defined($line = ) ) { chomp($line); next if ( $line =~ /^\s+$/i ); last if ( $line =~ /^\s*q/i ); my $item = { %$item_default }; if ( $line =~ /\./ ) { $bco->scan($line); $item->{'barcode_type'} = $bco->type(); $item->{'barcode'} = $bco->code(); } else { if ( $line =~ /^\s*(N|\\|\+)/i ) { print STDERR "id_chain was '$item_default->{id_chain}'\n"; $item_default->{'id_chain'} = undef; next; } if ( $line =~ /^\s*L/ ) { print STDERR "DOING LOOKUPS:\n"; lookup_items(); } if ( $line =~ /^\s*S/i ) { print STDERR "DEFAULTS:\n"; item_print($item_default); next; } elsif ( $line =~ /^(\w*)=(.*)$/ ) { $item_default->{$1} = $2; next; } else { $item->{'barcode_type'} = 'KBD'; $line =~ s/[^-0-9x]+//gi; $item->{'barcode'} = $line; } } # If in the database, don't add it again my $current_item = item_exists($item); if ( $current_item ) { $item_default->{'id_chain'} = $current_item->{'id_chain'} || $current_item->{'id'}; print "EXISTS: BARCODE: $item->{barcode_type} $item->{barcode}\n\n"; next; } # Insert the item. $item->{'created'} = scalar(UnixDate('now', "%Y-%m-%d %H:%M:%S")) if ! defined $item->{'created'}; item_insert($item); # Chain next book to this one. $item_default->{'id_chain'} ||= $item->{'id'} || $item->{'id_chain'}; # Print the item. item_print($item); print STDERR chr(7); # Dinggggg... } } ################################################################ # Main # # lookup_items();exit(); read_lines();quit(); ################################################################ 1; ll0.13/src/bin/ion_dockstatn0100775000175200017560000000022207546411472016400 0ustar stephensstephens#!/bin/sh # $Id: ion_dockstatn,v 1.1 2002/10/01 21:27:22 stephens Exp $ exec test `/bin/cat /proc/pci | /bin/grep 'VGA' | /usr/bin/wc -l` -eq 2 ll0.13/src/bin/lpr0100775000175200017560000000027507546411304014340 0ustar stephensstephens#!/bin/sh # $Id: lpr,v 1.2 2002/10/01 21:25:24 stephens Exp $ cmd=ion_lpr if [ "$1" = '-L' ] then shift cmd=/usr/bin/lpr fi if [ $# -gt 0 ] then exec $cmd "$@" else exec $cmd fi ll0.13/src/bin/cuecatlibrary.pl.~1.2.~0100775000175200017560000003713107510777247017774 0ustar stephensstephens#!/usr/local/bin/perl # $Id: cuecatlibrary.pl,v 1.2 2002/07/04 07:52:07 stephens Exp $ use DBI; use LWP; use LWP::UserAgent; #use HTML::Parse; #use HTML::FormatText; use Barcode::Cuecat; use Business::ISBN qw(is_valid_checksum); use Date::Manip; use Data::Dumper; use strict; $Date::Manip::DateFormat = 'US'; ####################################################### my $database = 'library'; my $table = 'item'; my $item_lookup = 0; my $item_default = { 'owner' => 'kurt', 'item_type' => 'book', }; ####################################################### my $dbh = DBI->connect("DBI:mysql:$database","stephens","foobar") or die("Error! $DBI::ERRSTR\n\n"); my @fields = qw(id id_chain barcode_type barcode item_type isbn title author editor illustrator price format publisher pub_date edition_desc notes url owner created keyword box); if ( 0 ) { print qq{ CREATE TABLE $table ( id INTEGER PRIMARY KEY AUTO_INCREMENT, id_chain INTEGER, barcode_type VARCHAR(8), barcode VARCHAR(64), item_type VARCHAR(8), isbn VARCHAR(64), title VARCHAR(255), author VARCHAR(255), editor VARCHAR(255), illustrator VARCHAR(255), price REAL, format VARCHAR(255), publisher VARCHAR(255), pub_date DATE, edition_desc VARCHAR(32), notes VARCHAR(255), url VARCHAR(255), owner VARCHAR(16), created DATETIME, keyword VARCHAR(255), box VARCHAR(16), ts TIMESTAMP ); }; } ####################################################### my $fields = join(', ', @fields); my @fields_no_id = grep($_ ne 'id', @fields); my $fields_no_id = join(', ', @fields_no_id); my $exists_stmt = "SELECT barcode_type, barcode FROM $table WHERE barcode_type = ? AND barcode = ?"; my $insert_stmt = "INSERT INTO $table ($fields_no_id) VALUES (" . join(', ', ('?') x @fields_no_id) . ')'; my @update_fields = @fields_no_id; @update_fields = grep($_ ne 'barcode', @update_fields); @update_fields = grep($_ ne 'barcode_type', @update_fields); my $exists_sth = $dbh->prepare($exists_stmt) || die($dbh->errstr); my $insert_sth = $dbh->prepare($insert_stmt) || die($dbh->errstr); my $lookup_sth = $dbh->prepare("SELECT $fields FROM $table WHERE (url IS NULL)") || die($dbh->errstr); my $all_sth = $dbh->prepare("SELECT $fields FROM $table") || die($dbh->errstr); sub item_print { my ($item) = @_; # Print it out. print join("\n", map(sprintf("%16s: %s", ucfirst($_), defined $item->{$_} ? "'$item->{$_}'" : 'NULL'), @fields), '', ''); } my $item_inserted = 0; sub item_insert { my ($item) = @_; $insert_sth->execute(map($item->{$_}, @fields_no_id)); # Ugly MYSQL specific code here. $item->{'id'} ||= $dbh->{'mysql_insertid'}; ++ $item_inserted; } sub item_exists { my ($item, $result) = @_; $exists_sth->execute($item->{'barcode_type'}, $item->{'barcode'}); $exists_sth->fetchrow_hashref; } my %update_sth; sub item_update { my ($item) = @_; die("Id not defined") unless $item->{'id'}; my @keys = grep($_ ne 'id', sort keys %$item); my $update_stmt = "UPDATE $table SET " . join(', ', map("$_ = ?", @keys)) . ' WHERE id = ? LIMIT 1'; my @args = ( map($item->{$_}, @keys), $item->{'id'} ); $DB::single = 1; my $update_sth = $update_sth{$update_stmt} ||= $dbh->prepare($update_stmt) || die($dbh->errstr); $update_sth->execute(@args) || warn($update_sth->errstr . ": $update_stmt"); my $count = $update_sth->rows; if ( 0 ) { my $sql = $update_stmt; $sql =~ s/\?/%s/sg; $sql = sprintf($sql, @args); print STDERR "$sql: "; } print STDERR "updated $count rows\n"; $count == 1 ? 1 : 0; } sub item_needs_lookup { $lookup_sth->execute; $lookup_sth->fetchall_arrayref({}); } sub repair { $all_sth->execute(); my $items = $all_sth->fetchall_arrayref({}); for my $item ( @$items ) { print STDERR "isbn=$item->{isbn}\n"; my $repair; for ( values %$item ) { if ( $_ eq 'NULL' || $_ eq '0000-00-00' ) { $_ = undef; $repair = 1; } elsif ( s/^'(.*)'$/$1/s ) { s/\\'/'/sg; # print STDERR "ouch: '$_'\n"; $repair = 1; } } if ( $repair ) { item_update($item); print STDERR "repaired\n"; } } } #repair(); exit(1); ####################################################### my %ese = ( ' ', 'nbsp', '<', 'lt', '>', 'gt', '&', 'amp' ); my $ese_match = '[' . join('', grep($_ ne ' ', keys %ese)) . ']'; sub text_to_sgml_entity # Escape SGML entity. { my $x = join('', @_); $x =~ s/($ese_match)/'&' . $ese{$1} . ';'/sgo; $x; } my %setc = reverse %ese; my $setc_match = '(' . join('', keys %setc) . ')'; sub sgml_entity_to_text { my $x = join(' ', @_); $x =~ s/&($setc_match);/$setc{$1}/sgo; $x; } ####################################################### my $agent = "Lynx/0.1"; ################################################ # Barns & Noble. # my $bn_ua; sub bn_lookup { my ($item) = @_; my $isbn = $item->{'isbn'}; return undef unless $isbn; # Create a user agent object if ( ! $bn_ua ) { $bn_ua = new LWP::UserAgent; $bn_ua->agent($agent . " " . $bn_ua->agent); } my $url = "http://shop.bn.com/bookSearch/isbnInquiry.asp?isbn=$isbn"; # Create a request my $req = new HTTP::Request GET => $url; $req->content_type('application/x-www-form-urlencoded'); # Pass request to the user agent and get a response back my $res = $bn_ua->request($req); my $content = $res->content; $content =~ s/^.*//si; # $DB::single = 1; $content =~ s/.*$//si; $content =~ s///sg; $content =~ s/ / /sgi; # $DB::single = 1; # Hack for multiple authors $content =~ s@
\s+(]*author)@; $1@sgi; $content =~ s@]*>@\n@sgi; $content =~ s@]*>@@sgi; # $DB::single = 1; # my $ft = HTML::FormatText->new; $item->{'url'} = $url; my @content = split(/\n/, $content); foreach ( @content ) { s/\ / /g; $_ = sgml_entity_to_text($_); s/^\s+//; s/\s+$//; s/\s+/ /g; } @content = grep(length, @content); my @data = (); foreach ( @content ){ # $_ = $ft->format(parse_html($_)); if ( length ) { #print "BN: $_\n"; push(@data, $_); } last if ( /Edition Desc/i ); } # $DB::single = 1; # Not found. if ( (! length $data[0]) || $data[0] =~ /We are sorry, but the ISBN provided is not in our database|We are sorry, but this ISBN is not in our database/i ) { print STDERR "BN: ISBN not in database\n"; return undef; } $item->{'title'} = $data[0]; $item->{'author'} = $data[1]; # $DB::single = 1; my @editors; while ( $item->{'author'} =~ s/\s+(\w+\s+(\w\.\s+)?\w+)\s+[(]ed[^\)]+[)]\s*/ /i ) { # $DB::single = 1; push(@editors, $1); } $item->{'editor'} = join('; ', @editors) if @editors; my @ills; while ( $item->{'author'} =~ s/\s+(\w+\s+(\w\.\s+)?\w+)\s+[(]il[^\)]+[)]\s*/ /i ) { # $DB::single = 1; push(@ills, $1); } $item->{'illustrator'} = join('; ', @ills) if @ills; foreach ( @data ) { # $DB::single = 1; if ( s/^.*Retail\s+Price\s*:\s*\$([\d\.]+)//i ) { $item->{'price'} = $1; } elsif ( s/^.*Format\s*:\s*//i ) { $item->{'format'} = $_; $item->{'item_type'} = 'book' if $item->{'format'} =~ /\dpp\./; } elsif ( s/^.*Publisher\s*:\s*//i ) { $item->{'publisher'} = $_; } elsif ( s/^.*Pub.+Date\s*:\s*//i ) { $item->{'pub_date'} = $_; } elsif ( s/^.*Edition\s+Desc[^:]*:\s*//i ) { $item->{'edition_desc'} = $_; } } # $DB::single = 1; $item; } ################################################ # Library of Congress zgate cgi. # my $zgate_ua; my $session_id; sub zgate_lookup { my ($item) = @_; my $isbn = $item->{'isbn'}; return undef unless $isbn; # Create a user agent object if ( ! $zgate_ua ) { $zgate_ua = new LWP::UserAgent; $zgate_ua->agent($agent . " " . $zgate_ua->agent); } while ( 1 ) { if ( ! $session_id ) { # Hit INIT URL so we can get a SESSION_ID. my $url = "http://lcweb.loc.gov/cgi-bin/zgstart?ACTION=INIT&FORM_HOST_PORT=/prod/www/data/z3950/locils.html,z3950.loc.gov,7090"; # Create a request my $req = new HTTP::Request GET => $url; $req->content_type('application/x-www-form-urlencoded'); print STDERR "zgate: Getting SESSION_ID\n"; # Pass request to the user agent and get a response back my $res = $zgate_ua->request($req); my $content = $res->content; # $DB::single = 1; ($session_id) = $content =~ / $session_id, "ESNAME" => "F", "ACTION" => "SEARCH", "DBNAME" => "VOYAGER", "MAXRECORDS" => "20", "RECSYNTAX" => "1.2.840.10003.5.10", # "REINIT" => "/cgi-bin/zgate?ACTION=INIT&FORM_HOST_PORT=/prod/www/data/z3950/locils.html,z3950.loc.gov,7090", "USE_1" => "7", # ISBN "TERM_1" => $isbn, ); $url .= '?' . join('&', map("$_=$param{$_}", keys %param)); # Create a request my $req = new HTTP::Request GET => $url; $req->content_type('application/x-www-form-urlencoded'); # Pass request to the user agent and get a response back my $res = $zgate_ua->request($req); my $content = $res->content; # If the session expired, get a new one. if ( $content =~ /session has expired/i ) { $session_id = undef; next; } #$DB::single = 1; $content =~ s@^.*
(.*)
.*$@$1@is; $content =~ s@^.*
(.*)
.*$@$1@is; # $DB::single = 1; $item->{'url'} = $url; my %data; my $key; foreach ( split("\n", $content) ) { if ( s/^([A-Z][^:]+):\s+// ) { $key = lc($1); $data{$key} = $_; } elsif ( $key && s/^\s\s+// ) { s/^\s+//; $data{$key} .= ' ' . $_; } } foreach ( values %data ) { s/^\s+//; s/\s+$//; s/\.$//; } # $DB::single = 1; $item->{'author'} = join(' ', reverse split(/,\s*/, $data{'author'})); $item->{'title'} = $data{'title'}; my $x = $item->{'author'}; $item->{'title'} =~ s@\s*/\s*$x\s*$@@; ($item->{'publisher'}, $item->{'pub_date'}) = $data{'published'} =~ /:\s*(.*),\s+[a-z]?(\d+)/i; $item->{'format'} = $data{'description'}; last; } $item; } ###################################################### sub item_lookup { my ($item) = @_; $DB::single = 1; unless ( $item->{'isbn'} ) { # Is it something with an almost definite ISBN? if ( $item->{'barcode_type'} =~ /(KBD|IBN|IB5|IB2)/i ) { # Normalize ISBN from barcode. $item->{'isbn'} = $item->{'barcode'}; $item->{'isbn'} =~ s/^978//; $item->{'isbn'} =~ s/\-//g; $item->{'isbn'} = substr($item->{'isbn'}, 0, 10); $DB::single = 1; # Validate the ISBN number. my $cs = new Business::ISBN($item->{'isbn'}); if ( ! $cs ) { print STDERR "NOT ISBN: $item->{'isbn'} \n\n"; $item->{'isbn'} = undef; } else { $cs->fix_checksum(); $item->{'isbn'} = $cs->as_string(); $item->{'isbn'} =~ s/\-//g; # Now try to look up using ISBN. } } } my $found; for my $try ( [ 'BN', \&bn_lookup, ], [ 'ZGATE', \&zgate_lookup, ], ) { my ($source, $source_func) = @$try; print STDERR "Trying: $source\n"; my $result = $source_func->({ %$item }); # Merge results if ( $result ) { # Clear up whitespace for my $x ( values %$result ) { chomp($x); $x =~ s/^\s+//s; $x =~ s/\s+$//s; $x =~ s/\s+/ /sg; $x =~ s/;$//sg; } # Delete zero length entries. delete @{$result}{grep(! length($result->{$_}), keys %$result)}; # item_print($result); # $DB::single = 1; foreach ( keys %$result ) { $found = $result; $item->{$_} = $result->{$_} if ! defined($item->{$_}); } } else { print STDERR "$source failed\n"; } } return undef if ! $found; # Normalize pubdate. # '1994' => 'August 1 1994' $item->{'pub_date'} =~ s/^\s*(\d\d\d\d)\s*$/January $1/i; # 'August 1994' => 'August 1 1994' $item->{'pub_date'} =~ s/^\s*([a-z]+)\s+(\d\d\d\d)\s*$/$1 1 $2/i; #$DB::single = 1; # Use ParseDate to parse it. $item->{'pub_date'} = scalar(UnixDate($item->{'pub_date'}, "%Y-%m-%d")) || $item->{'pub_date'} if defined $item->{'pub_date'}; # Print it out. # item_print($item); $item; } if ( 0 ) { for my $isbn ( '1565922204', # '0375505784', ) { my $item = { %$item_default, 'isbn' => $isbn }; item_lookup($item); item_print($item); # print Data::Dumper->new([ $item ], [qw($item)])->Dump; } exit; } sub lookup_items { my $items = item_needs_lookup; # $DB::single = 1; if ( $items ) { for my $item ( @$items ) { print "\n\n============================================\nUPDATING: \n"; item_print($item); # $DB::single = 1; my $tmp = { map(($_, $item->{$_}), 'id', 'barcode_type', 'barcode', 'isbn') }; if ( item_lookup($tmp) ) { print "WITH: \n"; item_print($tmp); my $update = { map(($_, $tmp->{$_}), 'url', 'id', grep((! defined $item->{$_}) && defined $tmp->{$_} && $item->{$_} ne $tmp->{$_}, @update_fields ), ) }; print "CHANGED: \n"; item_print($update); $DB::single = 1; item_update($update); } else { print "NO DATA FOUND\n"; } } } } sub quit { lookup_items() if ( $item_inserted ); exit(0); } ############################################################ # Main loop # sub read_lines { my $bco = new Barcode::Cuecat(); my $line; while ( (print STDERR "\nISBN: "), defined($line = ) ) { chomp($line); next if ( $line =~ /^\s+$/i ); last if ( $line =~ /^\s*q/i ); my $item = { %$item_default }; if ( $line =~ /\./ ) { $bco->scan($line); $item->{'barcode_type'} = $bco->type(); $item->{'barcode'} = $bco->code(); } else { if ( $line =~ /^\s*(N|\\)/i ) { print STDERR "id_chain was '$item_default->{id_chain}'\n"; $item_default->{'id_chain'} = undef; next; } if ( $line =~ /^\s*S/i ) { print STDERR "DEFAULTS:\n"; item_print($item_default); next; } elsif ( $line =~ /^(\w*)=(.*)$/ ) { $item_default->{$1} = $2; next; } else { $item->{'barcode_type'} = 'KBD'; $line =~ s/[^-0-9x]+//gi; $item->{'barcode'} = $line; } } # If in the database, don't add it again my $current_item = item_exists($item); if ( $current_item ) { $item_default->{'id_chain'} = $current_item->{'id_chain'} || $current_item->{'id'}; print "EXISTS: BARCODE: $item->{barcode_type} $item->{barcode}\n\n"; next; } # Insert the item. $item->{'created'} = scalar(UnixDate('now', "%Y-%m-%d %H:%M:%S")) if ! defined $item->{'created'}; item_insert($item); # Chain next book to this one. $item_default->{'id_chain'} ||= $item->{'id'} || $item->{'id_chain'}; # Print the item. item_print($item); print STDERR chr(7); # Dinggggg... } } ################################################################ # Main # lookup_items();exit(); read_lines();quit(); ll0.13/src/bin/tablefmt.pl0100775000175200017560000000272307525572714015765 0ustar stephensstephens#!/usr/local/bin/perl use strict; use warnings; use IO::File; sub read_table { my ($file, $table) = @_; $table ||= { }; my $fh = IO::File->new; $fh->open("< $file") || die("Cannot read '$file': $!"); $table->{'file'} = $file; my $get_rec = sub { my $rec = <$fh>; return $rec unless defined $rec; chomp $rec; $rec =~ s/\r//s; $rec = [ split("\t", $rec, 99999) ]; $rec; }; $table->{'fields'} = $get_rec->(); my $rec; while ( defined($rec = $get_rec->()) ) { my $hash = { }; @{$hash}{@{$table->{'fields'}}} = @$rec; push(@{$table->{'records'} ||= [ ]}, $hash); } $table; } sub true { 1; } sub format_table { my ($table, $template, $filter) = @_; $filter ||= sub { my ($rec) = @_; $rec->{'WEDDING'}; }; $filter ||= \&true; for my $rec ( @{$table->{'records'}} ) { if ( $filter->($rec) ) { my $out = $template; $out =~ s/\?([^:]+):([^\?]*)\?/$rec->{$1} ? $2 : ''/seg; $out =~ s/%(\w+)%/$rec->{$1}/seg; print $out; } } } my $template = q{========================================================= %FIRST_NAME% %LAST_NAME% ?WEDDING_GUEST:& %WEDDING_GUEST%? %ADDR1% %ADDR2% %CITY%, %STATE% %PCODE% Home: %H_PHONE% Mobile: %C_PHONE% Work: %W_PHONE% Pager: %P_PHONE% }; for ( @ARGV ) { if ( s/^--?//s ) { if ( s/^t(emplate)?//s ) { $template = shift; } } else { my $table = read_table($_); format_table($table, $template); } } ll0.13/src/bin/argouml0100775000175200017560000000040507577654160015221 0ustar stephensstephens#!/bin/sh # $Id$ JAVA="${JAVA:-/iimp/app/p/java/j2sdk1.4.0/bin/java}" ARGOUML_DIR="${ARGOUML_DIR:-/iimp/app/p/argouml/prod}" #export CLASSPATH="$ARGOUML_DIR:${CLASSPATH}" set -e cd "$ARGOUML_DIR" exec ${JAVA:-java} -jar argouml.jar >"$HOME/.argouml.log" 2>&1 ll0.13/src/bin/lpr.~1.1.~0100755000175200017560000000017607467101266015313 0ustar stephensstephens#!/bin/sh # $Id: lpr,v 1.1 2002/05/11 02:32:22 stephens Exp $ if [ $# -gt 0 ] then exec ion_lpr "$@" else exec ion_lpr fi ll0.13/src/bin/wwwgrab.pl.~1.1.~0100775000175200017560000000304207351534001016572 0ustar stephensstephens#!/usr/bin/perl # $Id: wwwgrab.pl,v 1.1 2001/09/18 02:57:05 stephens Exp $ sub wwwgrab { $_=@_[0]; $savefilename=@_[1] || '&STDOUT'; if (!$_) { print "Usage: $0 http://www.any.site/location [outputfilename]\n"; print " Where [outputfilename] is the optional filename to create.\n"; print " (ommitting this means that it will mean that the data will be\n"; die " sent to STDOUT. If this file exists, it will be overwritten)\n"; } /http:\/\/([^\/]*)\/*([^ ]*)/; $site = $1; $file = "/".$2; if (!$site) { die "$0: Fatal Error. You appear to have munged your URL address.\nIt must be in the form of http://www.any.site/location\n"; } $_ = $site; /^([^:]*):*([^ ]*)/; $site = $1; $port = $2; $port = 80 unless $port; $hostname = $site; ($sockaddr,$there,$response,$tries) = ("Snc4x8"); $there = pack($sockaddr,2,$port, &getaddress($hostname)); $proto = (getprotobyname ('tcp'))[2]; if (!socket(S,AF_INET,SOCK_STREAM,$proto)) { die "$0: Fatal Error. $!\n"; } if (!connect(S,$there)) { die "$0: Fatal Error. $!\n"; } select(S); $|=1; select(STDOUT); print S "GET $file HTTP/1.0\r\n"; print S "\n"; open(OUT,">".$savefilename) || die "$0: Fatal error. Cannot create $savefilename.\n"; while($line = ) { print OUT $line; } close(S); close(OUT); } sub getaddress { local($host) = @_; local(@ary); @ary = gethostbyname($host); return(unpack("C4",$ary[4])); } while ( @ARGV ) { my $url = shift @ARGV; my $out = shift @ARGV; wwwgrab($url, $out); } 1; ll0.13/src/bin/ion_getphoto.~1.1.~0100775000175200017560000000177207546411472017222 0ustar stephensstephens#!/usr/local/bin/perl # $Id: ion_getphoto,v 1.1 2002/10/01 21:27:22 stephens Exp $ # Author: ks@kurtstephens.com 2002/07/05 use strict; use File::Path qw(mkpath); local $" = ', '; my $gphoto2 = 'gphoto2 --camera "Canon PowerShot G2" --port usb'; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my $date = sprintf("%04d_%02d_%02d", $year + 1900, $mon + 1, $mday); my $dir = "/d/home/stephens/lib/image/cannon/$date"; my $dir_output = `$gphoto2 -l`; my @XXXCANON; $dir_output =~ s/ - (\d+CANON)/push(@XXXCANON, $1); '';/esg; die "Cannot find CANON dirs." unless @XXXCANON; #$DB::single = 1; print "CANON dirs = @XXXCANON\n"; #exit 1; my $del = '-D'; $del = ''; my $get_thumbs = '--get-all-thumbnails'; $get_thumbs = ''; for my $XXXCANON ( @XXXCANON ) { print "Downloading $XXXCANON\n"; my $output = `set -x; mkdir -p "$dir" && cd "$dir" && yes | gphoto2 --folder "/DCIM/$XXXCANON" --get-all-files $get_thumbs $del | tee -a /dev/tty`; print $output; } exit; ll0.13/src/bin/ion_faxview.~1.1.~0100775000175200017560000000065707511430713017032 0ustar stephensstephens#!/bin/sh # $Id: ion_faxview,v 1.1 2002/07/05 23:54:51 stephens Exp $ # Author: ks@kurtstephens.com 2002/07/05 #set -x FAX_DIR="${FAX_DIR:-$HOME/priv/fax}" mkdir -p "$FAX_DIR" while [ $# -gt 0 ] do f="$1" fn="`basename $f`" b="`basename $f .tif`" d="$FAX_DIR/$b" if [ ! -d $d ] then mkdir -p "$d" cp -p "$f" "$d" cd "$d" && tiffsplit "$b" "$b." fi cd "$d" && ghfaxviewer "$fn" & shift done exit 0 ll0.13/src/bin/metriconv0100775000175200017560000000074507610702136015551 0ustar stephensstephens#!/usr/local/bin/perl use 5.6.0; use strict; use warnings; use Math::Units qw(convert); sub conv { my ($q) = @_; my ($x1, $u1, $u2) = split(/\s*=>\s*|\s+/, $q, 3); if ( $x1 =~ s@^(\d+)[\-\+](\d+)/(\d+)$@$1@s ) { $x1 += $2 / $3; } $x1 = eval $x1; die $@ if $@; my $x2 = convert($x1, $u1, $u2); print "$x1 $u1 => $x2 $u2\n"; } my $conv = join(' ', @ARGV); if ( length($conv) ) { conv($conv); } else { for my $conv ( <> ) { conv($conv); } } 1; ll0.13/src/bin/ion_faxview0100775000175200017560000000066107546411405016062 0ustar stephensstephens#!/bin/sh # $Id: ion_faxview,v 1.2 2002/10/01 21:26:29 stephens Exp $ # Author: ks@kurtstephens.com 2002/07/05 #set -x FAX_DIR="${FAX_DIR:-$HOME/priv/fax}" mkdir -p "$FAX_DIR" while [ $# -gt 0 ] do f="$1" fn="`basename $f`" b="`basename $f .tif`" d="$FAX_DIR/$b" if [ ! -d "$d" ] then mkdir -p "$d" cp -p "$f" "$d" cd "$d" && tiffsplit "$b" "$b." fi cd "$d" && ghfaxviewer "$fn" & shift done exit 0 ll0.13/src/bin/ion_getphoto0100775000175200017560000000177307571034306016246 0ustar stephensstephens#!/usr/local/bin/perl # $Id: ion_getphoto,v 1.1 2002/10/01 21:27:22 stephens Exp $ # Author: ks@kurtstephens.com 2002/07/05 use strict; use File::Path qw(mkpath); local $" = ', '; my $gphoto2 = 'gphoto2 --camera "Canon PowerShot G2" --port usb'; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); my $date = sprintf("%04d_%02d_%02d", $year + 1900, $mon + 1, $mday); my $dir = "/d/home/stephens/lib/image/cannon/$date"; my $dir_output = `$gphoto2 -l`; my @XXXCANON; $dir_output =~ s/ - (\d+CANON)/push(@XXXCANON, $1); '';/esg; die "Cannot find CANON dirs." unless @XXXCANON; #$DB::single = 1; print "CANON dirs = @XXXCANON\n"; #exit 1; my $del = '-D'; $del = ''; my $get_thumbs = '--get-all-thumbnails'; #$get_thumbs = ''; for my $XXXCANON ( @XXXCANON ) { print "Downloading $XXXCANON\n"; my $output = `set -x; mkdir -p "$dir" && cd "$dir" && yes | gphoto2 --folder "/DCIM/$XXXCANON" --get-all-files $get_thumbs $del | tee -a /dev/tty`; print $output; } exit; ll0.13/src/bin/cvschrep.pl.~1.3.~0100744000175200017560000000234707230344122016733 0ustar stephensstephens#!/usr/local/bin/perl # $Id: cvschrep.pl,v 1.3 2001/01/14 15:40:02 stephens Exp $ # use File::Find; $debug = 1; $testing = 0; $keep_backup = 0; $filename = 'Repository'; $from = undef; $to = $undef; while ( @ARGV ) { $_ = shift; if ( /^--?r/ ) { $filename = 'Root'; } elsif ( /^--?d/ ) { ++ $debug; } elsif ( /^--?t/ ) { ++ $testing; } elsif ( ! defined $from ) { $from = $_; } elsif ( ! defined $to ) { $to = $_; last; } } sub wanted { my($file) = $File::Find::name; if ( $File::Find::name =~ m@/CVS/$filename$@o && -f ) { my($in, $out) = ( "$_.tmp", $_ ); my($line); print STDERR "wanted: '$File::Find::name'\n" if ( $testing || $debug ); if ( $testing ) { $in = $out; } else { die "$in exists" if ( -e $in ); system('mv', $out, $in); } open($in, "<$in") || die "$in: $!"; if ( ! $testing ) { open($out, ">$out") || die "$out: $!"; } while ( $line = <$in> ) { $line =~ s/\r//sg; if ( $line =~ s@$from@$to@i ) { print STDERR "$File::Find::name: $line"; } if ( ! $testing ) { print $out $line; } } close($in); if ( ! $testing ) { close($out); unlink($in) if ( ! $keep_backup ); } } } find(\&wanted, @ARGV); 1; ll0.13/src/hash/0042755000175200017560000000000007402571464013774 5ustar stephensstephensll0.13/src/hash/CVS/0042755000175200017560000000000007336072176014431 5ustar stephensstephensll0.13/src/hash/CVS/Root0100664000175200017560000000006107336072176015271 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/hash/CVS/Repository0100644000175200017560000000002207236675452016525 0ustar stephensstephenshome/ion/src/hash ll0.13/src/hash/CVS/Entries0100644000175200017560000000204707312334463015755 0ustar stephensstephens/Makefile/1.5/Thu Apr 22 05:15:07 1999// /PKG/1.6/Wed Oct 13 17:34:58 1999// /charP_int_Table.c/1.3/Thu Nov 4 10:38:29 1999// /charP_int_Table.def/1.3/Thu Apr 22 05:16:38 1999// /charP_int_Table.h/1.2/Fri Feb 19 09:25:41 1999// /charP_voidP_Table.c/1.3/Thu Nov 4 10:38:29 1999// /charP_voidP_Table.def/1.3/Thu Apr 22 05:16:38 1999// /charP_voidP_Table.h/1.2/Fri Feb 19 09:25:41 1999// /generic_Table.c/1.2/Fri Feb 19 09:25:41 1999// /generic_Table.def/1.2/Fri Feb 19 09:25:42 1999// /generic_Table.h/1.2/Fri Feb 19 09:25:42 1999// /hash.c/1.9/Thu Nov 4 10:38:29 1999// /hash.def/1.6/Thu Nov 4 10:38:29 1999// /hash.h/1.4/Tue Oct 12 07:27:08 1999// /hash_end.def/1.5/Thu Nov 4 10:38:29 1999// /int_voidP_Table.c/1.3/Thu Nov 4 10:38:29 1999// /int_voidP_Table.def/1.2/Fri Feb 19 09:25:42 1999// /int_voidP_Table.h/1.2/Fri Feb 19 09:25:43 1999// /voidP_voidP_Table.c/1.2/Thu Nov 4 10:38:30 1999// /voidP_voidP_Table.def/1.1/Thu Apr 22 05:15:08 1999// /voidP_voidP_Table.h/1.1/Thu Apr 22 05:15:07 1999// D/test//// /charP_hash.c/1.2/Fri Jun 15 07:28:51 2001// ll0.13/src/hash/test/0042755000175200017560000000000007326751156014756 5ustar stephensstephensll0.13/src/hash/test/CVS/0042755000175200017560000000000007336072176015410 5ustar stephensstephensll0.13/src/hash/test/CVS/Root0100664000175200017560000000006107336072176016250 0ustar stephensstephens:ext:stephens@cvs.ionink.com:/cvs/ioncvs/cvsroot ll0.13/src/hash/test/CVS/Repository0100644000175200017560000000002707236675452017511 0ustar stephensstephenshome/ion/src/hash/test ll0.13/src/hash/test/CVS/Entries0100644000175200017560000000012207236675452016737 0ustar stephensstephens/Makefile/1.3/Tue Oct 12 07:27:08 1999// /test.c/1.3/Tue Oct 12 07:27:08 1999// D ll0.13/src/hash/test/Makefile0100644000175200017560000000051507000561314016372 0ustar stephensstephens# $Id: Makefile,v 1.3 1999/10/12 07:27:08 stephensk Exp $ C_FILES = ../charP_int_Table.c CFLAGS = -I.. -I../.. -g O_FILES = $(C_FILES:.c=.o) EXE=.exe test$(EXE) : test.c $(O_FILES) $(CC) $(CFLAGS) -o $@ test.c $(O_FILES) $(O_FILES) : $(MAKE) -C .. run_test : test$(EXE) test$(EXE) debug_test : test$(EXE) gdb test$(EXE) ll0.13/src/hash/test/test.c0100644000175200017560000000110107000561314016045 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_test_test_c__ #define __rcs_id_test_test_c__ static const char __rcs_id_test_test_c[] = "$Id: test.c,v 1.3 1999/10/12 07:27:08 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include #include #include "charP_int_Table.h" int main(int argc, char **argv) { charP_int_Table _t, *t = &_t; charP_int_TableInit(t, 5); charP_int_TableAdd(t, "foo", 4); assert(*charP_int_TableGet(t, "foo") == 4); charP_int_TableRemove(t, "foo"); assert(charP_int_TableGet(t, "foo") == 0); return 0; } ll0.13/src/hash/Makefile0100644000175200017560000000056306707530133015426 0ustar stephensstephens# $Id: Makefile,v 1.5 1999/04/22 05:15:07 stephensk Exp $ C_FILES = \ charP_int_Table.c \ charP_voidP_Table.c \ int_voidP_Table.c \ voidP_voidP_Table.c \ generic_Table.c CFLAGS = -I.. -g O_FILES = $(C_FILES:.c=.o) LIB = libhash.a $(LIB) : $(O_FILES) -rm -f $@ ar r $@ $(O_FILES) $(O_FILES) : hash.def hash.c hash.h clean : rm -f $(LIB) $(O_FILES) ll0.13/src/hash/PKG0100644000175200017560000000033707001141302014311 0ustar stephensstephensNAME=hash VERSION=0.5 RCS_ID="$Id: PKG,v 1.6 1999/10/13 17:34:58 stephensk Exp $" DESC="A C template library for efficient, configurable hash tables." CATEGORY="Development Tools" REQUIRES_PKGS="../util" REQUIRES_OTHERS="" ll0.13/src/hash/charP_hash.c0100644000175200017560000000074407312334463016174 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_hash_charP_hash_c__ #define __rcs_id_hash_charP_hash_c__ static const char __rcs_id_hash_charP_hash_c[] = "$Id: charP_hash.c,v 1.2 2001/06/15 07:28:51 stephens Exp $"; #endif #endif /* __rcs_id__ */ #ifndef HASH_EXTERN #define HASH_EXTERN #endif HASH_EXTERN unsigned int strhash (const char *str) { unsigned int hash = 0; while ( *str ) { hash ^= * (unsigned char*) (str ++); hash ^= (hash << 15) | (hash >> 1); } return hash; } ll0.13/src/hash/charP_int_Table.c0100644000175200017560000000061107010261045017131 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_hash_charP_int_Table_c__ #define __rcs_id_hash_charP_int_Table_c__ static const char __rcs_id_hash_charP_int_Table_c[] = "$Id: charP_int_Table.c,v 1.3 1999/11/04 10:38:29 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include #include #include "charP_hash.c" #include "charP_int_Table.def" #include "hash.c" ll0.13/src/hash/charP_int_Table.def0100644000175200017560000000112206707530266017463 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_hash_charP_int_Table_def__ #define __rcs_id_hash_charP_int_Table_def__ static const char __rcs_id_hash_charP_int_Table_def[] = "$Id: charP_int_Table.def,v 1.3 1999/04/22 05:16:38 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define HASH(X)charP_int_##X #define HASH_KEY const char* #define HASH_KEY_HASH(X) strhash(X) #define HASH_KEY_EQUAL(X,Y) ((X)[0] == (Y)[0] && strcmp((X),(Y))==0) #define HASH_KEY_SET(X,Y) do { (X) = strcpy(HASH_MALLOC(strlen(Y) + 1), (Y)); } while(0) #define HASH_KEY_FREE(X) do { HASH_FREE(X); } while(0) #define HASH_DATA int ll0.13/src/hash/charP_int_Table.h0100644000175200017560000000056706663227025017165 0ustar stephensstephens#ifndef _charP_int_Table_h #ifndef __rcs_id__ #ifndef __rcs_id_hash_charP_int_Table_h__ #define __rcs_id_hash_charP_int_Table_h__ static const char __rcs_id_hash_charP_int_Table_h[] = "$Id: charP_int_Table.h,v 1.2 1999/02/19 09:25:41 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _charP_int_Table_h #include "charP_int_Table.def" #include "hash/hash.h" #endif ll0.13/src/hash/charP_voidP_Table.c0100644000175200017560000000062407010261045017424 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_hash_charP_voidP_Table_c__ #define __rcs_id_hash_charP_voidP_Table_c__ static const char __rcs_id_hash_charP_voidP_Table_c[] = "$Id: charP_voidP_Table.c,v 1.3 1999/11/04 10:38:29 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include #include #include "charP_hash.c" #include "charP_voidP_Table.def" #include "hash.c" ll0.13/src/hash/charP_voidP_Table.def0100644000175200017560000000115006707530266017753 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_hash_charP_voidP_Table_def__ #define __rcs_id_hash_charP_voidP_Table_def__ static const char __rcs_id_hash_charP_voidP_Table_def[] = "$Id: charP_voidP_Table.def,v 1.3 1999/04/22 05:16:38 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define HASH(X)charP_voidP_##X #define HASH_KEY const char* #define HASH_KEY_HASH(X) strhash(X) #define HASH_KEY_EQUAL(X,Y) ((X)[0] == (Y)[0] && strcmp((X),(Y))==0) #define HASH_KEY_SET(X,Y) do { (X) = strcpy(HASH_MALLOC(strlen(Y) + 1), (Y)); } while(0) #define HASH_KEY_FREE(X) do { HASH_FREE((char*) (X)); } while(0) #define HASH_DATA void* ll0.13/src/hash/charP_voidP_Table.h0100644000175200017560000000060506663227025017445 0ustar stephensstephens#ifndef _charP_voidP_Table_h #ifndef __rcs_id__ #ifndef __rcs_id_hash_charP_voidP_Table_h__ #define __rcs_id_hash_charP_voidP_Table_h__ static const char __rcs_id_hash_charP_voidP_Table_h[] = "$Id: charP_voidP_Table.h,v 1.2 1999/02/19 09:25:41 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _charP_voidP_Table_h #include "charP_voidP_Table.def" #include "hash/hash.h" #endif ll0.13/src/hash/generic_Table.c0100644000175200017560000000045306663227025016657 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_hash_generic_Table_c__ #define __rcs_id_hash_generic_Table_c__ static const char __rcs_id_hash_generic_Table_c[] = "$Id: generic_Table.c,v 1.2 1999/02/19 09:25:41 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "generic_Table.def" #include "hash.c" ll0.13/src/hash/generic_Table.def0100644000175200017560000000144406663227026017175 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_hash_generic_Table_def__ #define __rcs_id_hash_generic_Table_def__ static const char __rcs_id_hash_generic_Table_def[] = "$Id: generic_Table.def,v 1.2 1999/02/19 09:25:42 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define HASH(X)generic_##X struct generic_TableMethods; #define HASH_TABLE_DATA struct generic_TableMethods _methods; #define HASH_KEY void* #define HASH_KEY_HASH(X) (ht->_methods._hash)(X) #define HASH_KEY_EQUAL(X,Y) (ht->_methods._equal)(X, Y) #define HASH_KEY_SET(X,Y) ((X) = (ht->_methods._copy(Y))) #define HASH_KEY_FREE(X) (ht->_methods._free)(X) typedef struct generic_TableMethods { unsigned int (*_hash)(HASH_KEY); int (*_equal)(HASH_KEY a, HASH_KEY b); void* (*_copy)(HASH_KEY); void (*_free)(HASH_KEY); } generic_TableMethods; ll0.13/src/hash/generic_Table.h0100644000175200017560000000055106663227026016664 0ustar stephensstephens#ifndef _generic_Table_h #ifndef __rcs_id__ #ifndef __rcs_id_hash_generic_Table_h__ #define __rcs_id_hash_generic_Table_h__ static const char __rcs_id_hash_generic_Table_h[] = "$Id: generic_Table.h,v 1.2 1999/02/19 09:25:42 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _generic_Table_h #include "generic_Table.def" #include "hash/hash.h" #endif ll0.13/src/hash/hash.c0100644000175200017560000002633707010261045015053 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_hash_hash_c__ #define __rcs_id_hash_hash_c__ static const char __rcs_id_hash_hash_c[] = "$Id: hash.c,v 1.9 1999/11/04 10:38:29 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include /* size_t */ #include /* malloc(), realloc(), free() */ #include #include #include "hash.def" #if HASH_TABLE_SIZE_TO_PRIME #define EXTERN static #include "util/prime.c" #undef EXTERN #endif #ifndef HASH_MALLOC #define HASH_MALLOC(X) malloc(X) #endif #ifndef HASH_FREE #define HASH_FREE(X) free(X) #endif #ifndef HASH_WRITE_BARRIER #define HASH_WRITE_BARRIER(X) #endif #if HASH_KEEP_HASH #define HASH_ENTRY_HASH(e) (e)->_hash #else #define HASH_ENTRY_HASH(e) HASH_KEY_HASH((e)->_key) #endif HASH_EXTERN void HASH(TableStats) (HASH(Table) *ht, FILE *fp) { int i; int ne = 0; int tne = 0; /* total no. of entries */ int tnhc = 0; /* total no. of hash collisions */ int tbc = 0; /* total no. of bucket collisions */ int mbc = 0; /* max no of bucket collisions */ int biu = 0; /* buckets in use */ #define _HASH_STRINGTIZE(X)#X #define HASH_STRINGTIZE(X)_HASH_STRINGTIZE(X) fprintf(fp, "HASH_STATS %s %p {\n", HASH_STRINGTIZE(HASH(Table)), ht); for ( i = 0; i < HASH_TABLE_SIZE(ht); i ++ ) { HASH(TableEntry) *e; ne = 0; for ( e = ht->_entries[i]; e; e = e->_next ) { ne ++; tne ++; } if ( ne > 0 ) { biu ++; } if ( ne > 1 ) { if ( mbc < ne ) { mbc = ne; } tbc += ne - 1; } if ( ne > 1 ) { HASH_VAL *hashes = malloc(sizeof(hashes[0]) * ne); unsigned int *counts = malloc(sizeof(counts[0]) * ne); int nhashes = 0; int hi; memset(hashes, 0, sizeof(hashes[0]) * ne); memset(counts, 0, sizeof(counts[0]) * ne); fprintf(fp, " %5d: %4d: ", i, ne); for ( e = ht->_entries[i]; e; e = e->_next ) { HASH_VAL h = HASH_ENTRY_HASH(e); for ( hi = 0; hi < nhashes; hi ++ ) { if ( hashes[hi] == h ) { counts[hi] ++; goto found_hash; } } nhashes ++; assert(nhashes <= ne); hashes[hi] = h; found_hash: counts[hi] ++; } fprintf(fp, " %3d: { ", nhashes); for ( hi = 0; hi < nhashes; hi ++ ) { fprintf(stderr, "0x%08lx %4d ", (unsigned long) hashes[hi], (int) counts[hi]); tnhc += counts[hi] - 1; } fprintf(fp, "}\n"); free(hashes); free(counts); } } fprintf(fp, "}\n"); fprintf(fp, "total buckets: %d\n", HASH_TABLE_SIZE(ht)); fprintf(fp, "total buckets in use: %d\n", biu); fprintf(fp, "total nentries: %d\n", tne); fprintf(fp, "total hash collisions: %d\n", tnhc); fprintf(fp, "total bucket collisions: %d\n", tbc); #if HASH_TABLE_COLLISIONS fprintf(fp, "_collisions: %d\n", ht->_collisions); #endif fprintf(fp, "max bucket collisions: %d\n", mbc); } #ifndef HASH_COLLISION_STATS #define HASH_COLLISION_STATS 0 #endif #if HASH_COLLISION_STATS static int hcs = 0; #define HASH_CHECK_COLLISION_STATS(ht) if ( hcs ++ > HASH_COLLISION_STATS ) { hcs = 0; HASH(TableStats) (ht, stderr); } #else #define HASH_CHECK_COLLISION_STATS(ht) #endif HASH_EXTERN HASH(TableEntry) ** HASH(TableSearch) ( HASH(Table) *ht, HASH_KEY _key, HASH_VAL _hash ) { #if HASH_CACHE if ( ht->_cache && (*ht->_cache) && #if HASH_KEEP_HASH _hash == (*ht->_cache)->_hash && #endif (HASH_KEY_EQUAL(_key, (*ht->_cache)->_key)) ) { return ht->_cache; } #endif { unsigned int i = ((unsigned int) _hash) % HASH_TABLE_SIZE(ht); HASH(TableEntry) **e = &(ht->_entries[i]); while ( *e ) { if ( #if HASH_KEEP_HASH _hash == (*e)->_hash && #endif (HASH_KEY_EQUAL(_key, (*e)->_key)) ) { #if HASH_SEARCH_MOVE_TO_FRONT != 0 if ( HASH_SEARCH_MOVE_TO_FRONT ) { HASH(TableEntry) *ee = *e; *e = ee->_next; HASH_WRITE_BARRIER(e); ee->_next = ht->_entries[i]; HASH_WRITE_BARRIER(ee); ht->_entries[i] = ee; HASH_WRITE_BARRIER(ht->entries); e = &(ht->_entries[i]); HASH_WRITE_BARRIER(e); } #endif return e; } e = &((*e)->_next); } return 0; } } HASH_EXTERN void HASH(TableAddEntry) ( HASH(Table) *ht, HASH(TableEntry) *e ) { unsigned int i = ((unsigned int) HASH_ENTRY_HASH(e)) % HASH_TABLE_SIZE(ht); #if HASH_TABLE_COLLISIONS != 0 if ( ht->_entries[i] ) ht->_collisions ++; #endif e->_next = ht->_entries[i]; HASH_WRITE_BARRIER(e); ht->_entries[i] = e; HASH_WRITE_BARRIER(ht->_entries); #if HASH_TABLE_NENTRIES != 0 ht->_nentries ++; #endif HASH_CHECK_COLLISION_STATS(ht); } HASH_EXTERN void HASH(TableInit) ( HASH(Table) *ht, int capacity ) { #ifdef HASH_TABLE_INIT HASH_TABLE_INIT(ht); #undef HASH_TABLE_INIT #endif HASH_TABLE_CAPACITY_ADJUST(capacity); if ( capacity < 1 ) capacity = 1; #if HASH_CACHE ht->_cache = 0; #endif #if HASH_TABLE_FIXED_SIZE == 0 ht->_entriesLen = capacity; ht->_entries = HASH_MALLOC(sizeof(ht->_entries[0]) * HASH_TABLE_SIZE(ht)); #endif memset(ht->_entries, 0, sizeof(ht->_entries[0]) * HASH_TABLE_SIZE(ht)); HASH_WRITE_BARRIER(ht->_entries); #if HASH_TABLE_NENTRIES != 0 ht->_nentries = 0; #endif #if HASH_TABLE_COLLISIONS != 0 ht->_collisions = 0; #endif } HASH_EXTERN size_t HASH(TableSize) ( HASH(Table) *ht ) { return HASH_TABLE_SIZE(ht); } HASH_EXTERN size_t HASH(TableNEntries) ( HASH(Table) *ht ) { #if HASH_TABLE_NENTRIES != 0 return ht->_nentries; #else int i; size_t tne = 0; for ( i = 0; i < HASH_TABLE_SIZE(ht); i ++ ) { HASH(TableEntry) *e; for ( e = ht->_entries[i]; e; e = e->_next ) { tne ++; } } return tne; #endif } HASH_EXTERN size_t HASH(TableCollisions) ( HASH(Table) *ht ) { #if HASH_TABLE_COLLISIONS != 0 return ht->_collisions; #else return (size_t) -1L; #endif } HASH_EXTERN void HASH(TableResize) ( HASH(Table) *ht, int capacity ) { #if HASH_TABLE_FIXED_SIZE == 0 unsigned int i; /* Remember the old entries */ HASH(TableEntry) **_entries = ht->_entries; unsigned int _entriesLen = HASH_TABLE_SIZE(ht); HASH_TABLE_CAPACITY_ADJUST(capacity); if ( capacity < 1 ) capacity = 1; if ( capacity == ht->_entriesLen ) return; /* Create a new entries table. */ HASH(TableInit) ( ht, capacity ); /* Scan through old entries. */ for ( i = 0; i < _entriesLen; i ++ ) { HASH(TableEntry) *e, *e_next; /* Reverse the list because Add puts them at the front of the list */ e = _entries[i]; _entries[i] = 0; HASH_WRITE_BARRIER(_entries); for ( ; e; e = e_next ) { e_next = e->_next; e->_next = _entries[i]; HASH_WRITE_BARRIER(e); _entries[i] = e; HASH_WRITE_BARRIER(_entries); } /* Add them to the new table. */ for ( e = _entries[i]; e; e = e_next ) { e_next = e->_next; HASH(TableAddEntry) (ht, e); } } /* Free old table. */ HASH_FREE((void*) _entries); #if 0 /* Show some stats. */ HASH(TableStats) (ht, stderr); #endif #endif } HASH_EXTERN void HASH(TableDestroy) ( HASH(Table) *ht ) { unsigned int i; #if HASH_CACHE ht->_cache = 0; #endif for ( i = 0; i < HASH_TABLE_SIZE(ht); i ++ ) { HASH(TableEntry) *e, *e_next; for ( e = ht->_entries[i]; e; e = e_next ) { e_next = e->_next; /* free the key */ HASH_KEY_FREE((void*) e->_key); /* free the data */ #ifdef HASH_DATA_DECL HASH_DATA_FREE((void*) e->_data); #endif /* free the entry */ HASH_FREE((void*) e); } } /* Delete the table */ #if HASH_TABLE_FIXED_SIZE HASH_FREE((void*) ht->_entries); ht->_entries = 0; HASH_WRITE_BARRIER(ht); ht->_entriesLen = 0; #endif #if HASH_TABLE_NENTRIES != 0 ht->_nentries = 0; #endif #if HASH_TABLE_COLLISIONS != 0 ht->_collisions = 0; #endif #ifdef HASH_TABLE_DESTROY HASH_TABLE_DESTROY(ht); #undef HASH_TABLE_DESTROY #endif } HASH_EXTERN void HASH(TablePush_) ( HASH(Table) *ht, HASH_KEY _key HASH_DATA_ARG , HASH_VAL _hash) { HASH(TableEntry) *e; e = HASH_MALLOC(sizeof(*e)); #if HASH_KEEP_HASH e->_hash = _hash; #endif HASH_KEY_SET(e->_key, _key); HASH_WRITE_BARRIER(e); #ifdef HASH_DATA_DECL HASH_DATA_SET(e->_data, _data); HASH_WRITE_BARRIER(e); #endif HASH(TableAddEntry) (ht, e); HASH_TABLE_AUTO_RESIZE(ht, 1); } HASH_EXTERN void HASH(TablePush) ( HASH(Table) *ht, HASH_KEY _key HASH_DATA_ARG) { HASH(TablePush_) (ht, _key HASH_DATA_ARG_VAR ,(HASH_KEY_HASH(_key))); } HASH_EXTERN int HASH(TableAdd_) (HASH(Table) *ht, HASH_KEY _key HASH_DATA_ARG ,HASH_VAL _hash) { HASH(TableEntry) **en = HASH(TableSearch) (ht, _key, _hash); if ( en ) { #ifdef HASH_DATA_DECL HASH_DATA_SET((*en)->_data, _data); HASH_WRITE_BARRIER(*en); #else HASH_KEY_SET((*en)->_key, _key); HASH_WRITE_BARRIER(*en); #endif return 0; } else { HASH(TablePush_)(ht, _key HASH_DATA_ARG_VAR , _hash); return 1; } } HASH_EXTERN int HASH(TableAdd) (HASH(Table) *ht, HASH_KEY _key HASH_DATA_ARG) { return HASH(TableAdd_) (ht, _key HASH_DATA_ARG_VAR , (HASH_KEY_HASH(_key))); } HASH_EXTERN int HASH(TableIsSet_) (HASH(Table) *ht, HASH_KEY _key, HASH_VAL _hash) { return HASH(TableSearch) (ht, _key, _hash) != 0; } HASH_EXTERN int HASH(TableIsSet) (HASH(Table) *ht, HASH_KEY _key) { return HASH(TableIsSet_) (ht, _key, (HASH_KEY_HASH(_key))); } HASH_EXTERN HASH_DATA *HASH(TableGet_) (HASH(Table) *ht, HASH_KEY _key, HASH_VAL _hash) { HASH(TableEntry) **en = HASH(TableSearch) (ht, _key, _hash); if ( en ) { #if HASH_CACHE /* Look up was successful, remember it in the cache. */ ht->_cache = en; #endif #ifdef HASH_DATA_DECL return &(*en)->_data; #else return &(*en)->_key; #endif } else { return 0; } } HASH_EXTERN HASH_DATA *HASH(TableGet) (HASH(Table) *ht, HASH_KEY _key) { return HASH(TableGet_) (ht, _key, (HASH_KEY_HASH(_key))); } HASH_EXTERN int HASH(TableRemove_) (HASH(Table) *ht, HASH_KEY _key, HASH_VAL _hash) { HASH(TableEntry) **en = HASH(TableSearch) (ht, _key, _hash); if ( en ) { HASH(TableEntry) *e = *en; *en = e->_next; HASH_WRITE_BARRIER(en); #if HASH_CACHE if ( ht->_cache == en ) ht->_cache = 0; #endif #if HASH_TABLE_NENTRIES != 0 ht->_nentries --; #endif #if HASH_TABLE_COLLISIONS if ( e->_next ) ht->_collisions --; #endif HASH_KEY_FREE((void*) e->_key); #ifdef HASH_DATA_DECL HASH_DATA_FREE((void*) e->_data); #endif HASH_FREE((void*) e); HASH_TABLE_AUTO_RESIZE(ht, -1); return ! 0; } else { return 0; } } HASH_EXTERN int HASH(TableRemove) (HASH(Table) *ht, HASH_KEY _key) { return HASH(TableRemove_) (ht, _key, (HASH_KEY_HASH(_key))); } HASH_EXTERN void HASH(TableIteratorInit)(HASH(Table) *ht, HASH(TableIterator) *i) { i->_i = -1; i->_e = 0; } HASH_EXTERN int HASH(TableIteratorNext)(HASH(Table) *ht, HASH(TableIterator) *i) { if ( i->_i >= HASH_TABLE_SIZE(ht) ) return 0; if ( i->_e ) i->_e = i->_e->_next; while ( ! i->_e ) { if ( ++ i->_i >= HASH_TABLE_SIZE(ht) ) return 0; i->_e = ht->_entries[i->_i]; } return 1; } HASH_EXTERN HASH_KEY *HASH(TableIteratorKey)(HASH(Table) *ht, HASH(TableIterator) *i) { return i->_e ? (HASH_KEY*) &(i->_e->_key) : (HASH_KEY*) 0; } HASH_EXTERN HASH_DATA *HASH(TableIteratorData)(HASH(Table) *ht, HASH(TableIterator) *i) { #ifdef HASH_DATA_DECL return i->_e ? (HASH_DATA *) &(i->_e->_data) : (HASH_DATA *) 0; #else return i->_e ? (HASH_DATA *) &(i->_e->_key) : (HASH_DATA *) 0; #endif } ll0.13/src/hash/hash.def0100644000175200017560000001747507010261045015372 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_hash_hash_def__ #define __rcs_id_hash_hash_def__ static const char __rcs_id_hash_hash_def[] = "$Id: hash.def,v 1.6 1999/11/04 10:38:29 stephensk Exp $"; #endif #endif /* __rcs_id__ */ /* ** Hash table template ** Copyright 1998, 1999 Kurt A. Stephens, http://www.acm.org/~stephensk ** $Id: hash.def,v 1.6 1999/11/04 10:38:29 stephensk Exp $ */ #ifndef HASH #define HASH(X) Hash##X #endif #ifndef HASH_EXTERN #define HASH_EXTERN #endif #ifndef HASH_VAL #define HASH_VAL unsigned int #endif #ifndef HASH_KEY #error "you must define HASH_KEY to a type" #endif #ifndef HASH_KEY_SET #define HASH_KEY_SET(X,Y) X = Y #endif #ifndef HASH_KEY_FREE #define HASH_KEY_FREE(X) #endif #ifndef HASH_KEY_EQUAL #define HASH_KEY_EQUAL(X,Y) (X)=(Y) #endif #ifndef HASH_KEY_HASH #error "you must define HASH_KEY_HASH(X) to a function that returns a HASH_VAL such that if HASH_KEY_EQUAL(X,Y) then HASH_KEY_HASH(X) == HASH_KEY_HASH(Y)" #endif #ifdef HASH_DATA #define HASH_DATA_DECL HASH_DATA _data; #define HASH_DATA_ARG ,HASH_DATA _data #define HASH_DATA_ARG_VAR ,_data #ifndef HASH_DATA_SET #define HASH_DATA_SET(X,Y) X = Y #endif #ifndef HASH_DATA_FREE #define HASH_DATA_FREE(X) #endif #else #define HASH_DATA_ARG #define HASH_DATA_ARG_VAR #define HASH_DATA HASH_KEY #endif #ifndef HASH_TABLE_DATA /* Define this to be struct elements that you want at the beginning of HASH(Table) */ #define HASH_TABLE_DATA #endif #ifndef HASH_TABLE_FIXED_SIZE #define HASH_TABLE_FIXED_SIZE 0 /* Define this to non-zero for a fixed size table */ #endif /* Choose a 2 ^ n - 1 >= X */ #define HASH_TO_POW_2_MINUS_1(X) { unsigned _x = 1; while ( _x - 1 < (X) ) _x *= 2; (X) = _x - 1; } #ifndef HASH_TABLE_SIZE_TO_PRIME /* Define this to non-zero to force table size to be a prime number. */ #define HASH_TABLE_SIZE_TO_PRIME 0 #endif #if HASH_TABLE_SIZE_TO_PRIME /* Choose a prime >= X, where X == 2 ^ n - 1 */ #define _HASH_TABLE_SIZE_TO_PRIME(X) (X) = *prime_ge(X) #else #define _HASH_TABLE_SIZE_TO_PRIME(X) #endif #ifndef HASH_TABLE_SIZE_ADJUST /* Define this to adjust X before finding power of two bigger. */ #define HASH_TABLE_SIZE_ADJUST(X) \ if ( ((X) & 1) == 0 ) (X) ++ \ /* { (X) = ((X) * 3) / 2; } */ \ /* HASH_TO_POW_2_MINUS_1(X) */ #endif #ifndef HASH_TABLE_CAPACITY_ADJUST /* Define this to adjust capacity X before allocating a new bucket table. */ #define HASH_TABLE_CAPACITY_ADJUST(X) HASH_TABLE_SIZE_ADJUST(X); _HASH_TABLE_SIZE_TO_PRIME(X) #endif #ifndef HASH_TABLE_COLLISIONS_THRESHOLD /* Define this to the limit in percent of allowable hash table collisions. */ #define HASH_TABLE_COLLISIONS_THRESHOLD 25 #endif #ifndef HASH_TABLE_COLLISIONS /* Define to non-zero if you want to keep track of hash collisions (useful for determining if you need an auto resize) */ #define HASH_TABLE_COLLISIONS HASH_TABLE_COLLISIONS_THRESHOLD #endif #ifdef HASH_TABLE_COLLISIONS_THRESHOLD #define HASH_TABLE_COLLISIONS_THRESHOLD_CHECK(HT) \ (((HT)->_collisions * 100 / (HT)->_entriesLen) > HASH_TABLE_COLLISIONS_THRESHOLD) #define HASH_TABLE_NEW_CAPACITY(HT) \ (HASH_TABLE_COLLISIONS_THRESHOLD_CHECK(HT) ? \ (HT)->_entriesLen * (100 + HASH_TABLE_COLLISIONS_THRESHOLD) / 100 : \ (HT)->_nentries) #else #define HASH_TABLE_COLLISIONS_THRESHOLD_CHECK(HT) 0 #endif #ifndef HASH_TABLE_NEW_CAPACITY #define HASH_TABLE_NEW_CAPACITY(HT) (HT)->_nentries #endif #ifndef HASH_TABLE_AUTO_RESIZE /* Define this to automatically resize the bucket array after add or delete. */ #if HASH_TABLE_FIXED_SIZE == 0 #define HASH_TABLE_AUTO_RESIZE(HT,GROWTH)if ( (GROWTH) > 0 && (HT)->_nentries > (HT)->_entriesLen || HASH_TABLE_COLLISIONS_THRESHOLD_CHECK(HT) ) HASH(TableResize)(HT, HASH_TABLE_NEW_CAPACITY(HT)); #define HASH_TABLE_NENTRIES 1 #endif #endif /* HASH_TABLE_AUTO_RESIZE */ #ifndef HASH_SEARCH_MOVE_TO_FRONT /* Define to non-zero if you want to move the entry to the front of the list when found during the bucket search */ #define HASH_SEARCH_MOVE_TO_FRONT 1 #endif #ifndef HASH_TABLE_NENTRIES /* Define to non-zero if you want to keep track of the number of entries in the hash table */ #define HASH_TABLE_NENTRIES 1 #endif #ifndef HASH_KEEP_HASH /* Define to non-zero if you want to use a cached hash value to short-circuit bucket collision key comparasions. */ #define HASH_KEEP_HASH 1 #endif #ifndef HASH_CACHE /* Define to non-zero if you want to cache last lookup. */ #define HASH_CACHE 1 #endif typedef struct HASH(TableEntry) { struct HASH(TableEntry) *_next; /* Points to the next entry with the same hash modulo */ #if HASH_KEEP_HASH HASH_VAL _hash; /* The hash value of the key */ #endif HASH_KEY _key; /* The hash key */ #ifdef HASH_DATA_DECL HASH_DATA_DECL /* The hash data */ #endif } HASH(TableEntry); typedef struct HASH(Table) { HASH_TABLE_DATA #if HASH_CACHE struct HASH(TableEntry) **_cache; /* Maybe this will be slot 0, which might be faster to access on some computers. */ #endif #if HASH_TABLE_NENTRIES != 0 unsigned int _nentries; /* The number of entries in the table */ #endif #if HASH_TABLE_COLLISIONS != 0 unsigned int _collisions; /* The number of entries that share buckets in the table */ #endif #if HASH_TABLE_FIXED_SIZE #define HASH_TABLE_SIZE(ht) HASH_TABLE_FIXED_SIZE struct HASH(TableEntry) *_entries[HASH_TABLE_FIXED_SIZE]; #else #define HASH_TABLE_SIZE(ht) (ht)->_entriesLen struct HASH(TableEntry) **_entries; unsigned int _entriesLen; #endif } HASH(Table); typedef struct HASH(TableIterator) { unsigned int _i; const struct HASH(TableEntry) *_e; } HASH(TableIterator); HASH_EXTERN void HASH(TableInit) ( HASH(Table) *ht, int capacity ); /* Initialize the table for a given size */ HASH_EXTERN size_t HASH(TableSize) ( HASH(Table) *ht ); /* Get the size of the table */ HASH_EXTERN size_t HASH(TableNEntries) ( HASH(Table) *ht ); /* Get the number of entries in the table */ HASH_EXTERN size_t HASH(TableCollisions) ( HASH(Table) *ht ); /* Get the number of collisions in the table */ HASH_EXTERN void HASH(TableResize) ( HASH(Table) *ht, int capacity ); /* Resize the table */ HASH_EXTERN void HASH(TableDestroy) ( HASH(Table) *ht ); /* Destroy the table */ HASH_EXTERN HASH_VAL HASH(TableHash) ( HASH(Table) *ht, HASH_KEY _key ); /* Get the hash value for a key */ HASH_EXTERN void HASH(TablePush_) ( HASH(Table) *ht, HASH_KEY _key HASH_DATA_ARG ,HASH_VAL _hash); HASH_EXTERN void HASH(TablePush) ( HASH(Table) *ht, HASH_KEY _key HASH_DATA_ARG); /* Push a value on to the table */ /* Return 1 if a new value was added */ HASH_EXTERN int HASH(TableAdd_) (HASH(Table) *ht, HASH_KEY _key HASH_DATA_ARG ,HASH_VAL _hash); HASH_EXTERN int HASH(TableAdd) (HASH(Table) *ht, HASH_KEY _key HASH_DATA_ARG); /* Return 1 if a value exists */ HASH_EXTERN int HASH(TableIsSet_) (HASH(Table) *ht, HASH_KEY _key, HASH_VAL _hash); HASH_EXTERN int HASH(TableIsSet) (HASH(Table) *ht, HASH_KEY _key); /* Return a pointer to the data for _key, or 0 if not set */ HASH_EXTERN HASH_DATA * HASH(TableGet_) (HASH(Table) *ht, HASH_KEY _key, HASH_VAL _hash); HASH_EXTERN HASH_DATA * HASH(TableGet) (HASH(Table) *ht, HASH_KEY _key); /* Return 1 if a value was removed */ HASH_EXTERN int HASH(TableRemove_) (HASH(Table) *ht, HASH_KEY _key, HASH_VAL _hash); HASH_EXTERN int HASH(TableRemove) (HASH(Table) *ht, HASH_KEY _key); /* Dump hash table stats to fp. */ HASH_EXTERN void HASH(TableStats) (HASH(Table) *ht, FILE *fp); /* ** Iterators: ** ** HASH(TableIterator) i; ** HASH(TableIteratorInit)(ht, &i) ** while ( HASH(TableInteratorNext)(ht, &i) ) { ** HASH_KEY key = *HASH(TableIteratorKey)(ht, &i); ** HASH_DATA data = *HASH(TableIteratorData)(ht, &i); ** } */ HASH_EXTERN void HASH(TableIteratorInit)(HASH(Table) *ht, HASH(TableIterator) *i); HASH_EXTERN int HASH(TableIteratorNext)(HASH(Table) *ht, HASH(TableIterator) *i); HASH_EXTERN HASH_KEY *HASH(TableIteratorKey)(HASH(Table) *ht, HASH(TableIterator) *i); HASH_EXTERN HASH_DATA *HASH(TableIteratorData)(HASH(Table) *ht, HASH(TableIterator) *i); ll0.13/src/hash/hash.h0100644000175200017560000000055007000561314015046 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_hash_hash_h__ #define __rcs_id_hash_hash_h__ static const char __rcs_id_hash_hash_h[] = "$Id: hash.h,v 1.4 1999/10/12 07:27:08 stephensk Exp $"; #endif #endif /* __rcs_id__ */ /* ** Template Hash Table ** Copyright 1998, 1999, Kurt A. Stephens, http://www.acm.org/~stephensk */ #include "hash.def" #include "hash_end.def" ll0.13/src/hash/hash_end.def0100644000175200017560000000176407010261045016212 0ustar stephensstephens#ifndef __rcs_id__ #ifndef __rcs_id_hash_hash_end_def__ #define __rcs_id_hash_hash_end_def__ static const char __rcs_id_hash_hash_end_def[] = "$Id: hash_end.def,v 1.5 1999/11/04 10:38:29 stephensk Exp $"; #endif #endif /* __rcs_id__ */ /* ** Template Hash Table ** Copyright 1998, 1999, Kurt A. Stephens, http://www.acm.org/~stephensk */ #undef HASH #undef HASH_EXTERN #undef HASH_VAL #undef HASH_KEY #undef HASH_KEY_SET #undef HASH_KEY_FREE #undef HASH_KEY_EQUAL #undef HASH_KEY_HASH #ifdef HASH_DATA #undef HASH_DATA #undef HASH_DATA_SET #undef HASH_DATA_FREE #endif #undef HASH_TABLE_DATA #undef HASH_TABLE_COLLISIONS #undef HASH_TABLE_COLLISIONS_THRESHOLD #ifdef HASH_TABLE_COLLISIONS_THRESHOLD_CHECK #undef HASH_TABLE_COLLISIONS_THRESHOLD_CHECK #endif #ifdef HASH_TABLE_NEW_CAPACITY #undef HASH_TABLE_NEW_CAPACITY #endif #undef HASH_SEARCH_MOVE_TO_FRONT #undef HASH_TABLE_AUTO_RESIZE #undef HASH_TABLE_NENTRIES #undef HASH_TABLE_SIZE #undef HASH_TABLE_SIZE_TO_PRIME #undef HASH_KEEP_HASH #undef HASH_CACHE ll0.13/src/hash/int_voidP_Table.c0100644000175200017560000000127007010261045017157 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_hash_int_voidP_Table_c__ #define __rcs_id_hash_int_voidP_Table_c__ static const char __rcs_id_hash_int_voidP_Table_c[] = "$Id: int_voidP_Table.c,v 1.3 1999/11/04 10:38:29 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include #include static unsigned int inthash(int _x) { const unsigned char *x = (const char*) &_x; unsigned int hash = x[0]; #define DO_HASH(i) hash ^= (hash << 15) | (hash >> 1) ^ x[i] switch ( sizeof(_x) ) { default: case 4: DO_HASH(3); case 3: DO_HASH(2); case 2: DO_HASH(1); } #undef DO_HASH return hash; } #include "int_voidP_Table.def" #include "hash.c" ll0.13/src/hash/int_voidP_Table.def0100644000175200017560000000057006663227026017513 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_hash_int_voidP_Table_def__ #define __rcs_id_hash_int_voidP_Table_def__ static const char __rcs_id_hash_int_voidP_Table_def[] = "$Id: int_voidP_Table.def,v 1.2 1999/02/19 09:25:42 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define HASH(X)int_voidP_##X #define HASH_KEY int #define HASH_KEY_HASH(X) inthash(X) #define HASH_DATA void* ll0.13/src/hash/int_voidP_Table.h0100644000175200017560000000056706663227027017213 0ustar stephensstephens#ifndef _int_voidP_Table_h #ifndef __rcs_id__ #ifndef __rcs_id_hash_int_voidP_Table_h__ #define __rcs_id_hash_int_voidP_Table_h__ static const char __rcs_id_hash_int_voidP_Table_h[] = "$Id: int_voidP_Table.h,v 1.2 1999/02/19 09:25:43 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define _int_voidP_Table_h #include "int_voidP_Table.def" #include "hash/hash.h" #endif ll0.13/src/hash/voidP_voidP_Table.c0100644000175200017560000000130707010261046017450 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_hash_voidP_voidP_Table_c__ #define __rcs_id_hash_voidP_voidP_Table_c__ static const char __rcs_id_hash_voidP_voidP_Table_c[] = "$Id: voidP_voidP_Table.c,v 1.2 1999/11/04 10:38:30 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include #include static unsigned int voidP_hash(void *_x) { const unsigned char *x = (const char*) &_x; unsigned int hash = x[0]; #define DO_HASH(i) hash ^= (hash << 15) | (hash >> 1) ^ x[i] switch ( sizeof(_x) ) { default: case 4: DO_HASH(3); case 3: DO_HASH(2); case 2: DO_HASH(1); } #undef DO_HASH return hash; } #include "voidP_voidP_Table.def" #include "hash.c" ll0.13/src/hash/voidP_voidP_Table.def0100644000175200017560000000060706707530134017777 0ustar stephensstephens #ifndef __rcs_id__ #ifndef __rcs_id_hash_voidP_voidP_Table_def__ #define __rcs_id_hash_voidP_voidP_Table_def__ static const char __rcs_id_hash_voidP_voidP_Table_def[] = "$Id: voidP_voidP_Table.def,v 1.1 1999/04/22 05:15:08 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #define HASH(X)voidP_voidP_##X #define HASH_KEY void* #define HASH_KEY_HASH(X) voidP_hash(X) #define HASH_DATA void* ll0.13/src/hash/voidP_voidP_Table.h0100644000175200017560000000060406707530133017464 0ustar stephensstephens#ifndef _voidP_voidP_Table_h #define _voidP_voidP_Table_h #ifndef __rcs_id__ #ifndef __rcs_id_hash_voidP_voidP_Table_h__ #define __rcs_id_hash_voidP_voidP_Table_h__ static const char __rcs_id_hash_voidP_voidP_Table_h[] = "$Id: voidP_voidP_Table.h,v 1.1 1999/04/22 05:15:07 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include "voidP_voidP_Table.def" #include "hash/hash.h" #endif ll0.13/src/GUM_BUILD_ROOT0100664000175200017560000000064107623406402015176 0ustar stephensstephens# $Id: GUM_BUILD_ROOT,v 1.4 2001/08/06 11:02:09 stephens Exp $ # Build options DEBUG=YES #OPTIMIZE=NO # output root is ../gumo GUM_GENERATED_ROOT:=$(shell cd $(GUM_BUILD_ROOT)/../gumo && /bin/pwd)# # Quick install. GUM_GENERATED_LIB_DIR=$(INSTALL_DIR_LIB)# # Pick up /iimp stuff PATH:=/iimp/app/prod/bin:$(PATH) INCLUDE_DIRS_GLOBAL:=$(GUM_BUILD_ROOT) /iimp/app/prod/include# LIB_DIRS_GLOBAL:=/iimp/app/prod/lib# ll0.13/README0100664000175200017560000002774407623416652013157 0ustar stephensstephensll 0.13 README ============================================================================== Copyright (c) 1997-2001 Kurt A. Stephens and Ion, Inc., All Rights Reserved. http://www.ionink.com/~stephens Kurt A. Stephens and Ion, Inc. MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Kurt A. Stephens and Ion, Inc. SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. $Id: COPYRIGHT,v 1.4 2001/10/20 04:41:49 stephens Exp $ ============================================================================== ll 0.13 README ============================================================================== -*- outline -*- * ll README ** Preface Author: Kurt A. Stephens Contact: stephensk@acm.org Version: 0.9 Version Id: $Id: README,v 1.4 1999/04/13 03:04:13 stephensk Exp $ ** Overview ll is an embeddable, pure, class-based, object Lisp system C library with multiple inheritance based on ideas from Scheme, Oaklisp and Dylan. It differs from most implementations by its easy integration with the C programming language. It intergrates well with existing C applications better than Oaklisp (due to its namespace usage and proper tail-call implementation) and provide object-oriented features that do not exist in other embeddable Scheme environments like GNU's guile library. *** Compatiblity ll should be compatable with the Revised 5 Report, except for the macro facility. ll supports lexical closures and proper tail recursion. ll makes it easy to defined new primitive methods in C. In the future ll will handle calling in and out of C with a automatic C runtime system. ll might also be made source-code compatable with GNU guile. *** Conventions ll uses the typical s-expression Scheme syntax for all expressions. All types are named with angle brackets ("", "", "", etc.) All type predicates are suffixed with '?' ("cons?", "object?", "number?", etc.) All mutating (setter) operations are begin with 'set-' and end with '!' ("set-car!", etc.) ** Tutorial You should be familar with Scheme to understand the basics. Recommended reading: [R5RS] Revised 5 Report on the Algorithmic Language Scheme, ACM SIGPLAN Procedings, Vol. 33, Number 9. *** Messaging All values in ll are objects, even the internal objects and compiler are defined using objects. All operations in ll happen by sending messages; the car position of a function call is a object, the cdr contains the reciever and any arguments. The object is used as a key for looking up a method in the receiver's type. Message expresions take the form: (^operation^ ^receiver^ . ^arguments^) or (^operation^) For example, the expression: (car (cons 'x 'y)) Sends the stored in the 'cons global to 'x with the argument 'y. A method for the cons is stored in , which is a subtype. Then the stored in the 'car global variable is send to the result. The root type of most objects is . The type is also a subtype of . The method for message expressions with no receiver (^operation^) are found within the type. *** Type instantiation All objects have zero or more supertypes and zero or more instance slots. New types are created by sending the 'make to the ' object. (make ^supers^ ^slots^) Both ^supers^ and ^slots^ are objects. For example, the type might be defined as: (define (make (list ) (list 'car 'cdr))) *** Object instantiation All objects respond to 'make. :make allocates a new object of it's type and sends it an 'initialize message with the remaining arguments. For example, the expression: (cons 'x 'y) => (make 'x 'y). In this example the :intitialize method might be implemented as: (add-method (initialize ( car cdr) self a d) (set! car a) (set! cdr d) self) *** Operations New operations are created with (make ). objects are anonymous. *** Settable Operations New settable operations are created with (make ). Settable operations respond to (setter ^operation^). Most of the accessor primitives, like 'car, are defined as objects. For example; The 'car is defined: (define car (make )) (define set-car! (setter car)) The compiler macro expands (set! (^op^ . ^args^) ^value^) to ((setter ^op^) . ^args^ ^value^) Thus (set! (car x) 'y) is ((setter car) x 'y). *** Methods New objects are created and added to objects using the following syntax: (add-method (^op^ (^type^ . ^slots^) . ^formals^) . ^body^) ^slots^ is a list of slots defined in ^type^ that are lexically bound in the ^body^. You cannot access ^slots^ within super or types of ^type^ directly. You must defined operations and methods to do so. For example, the car and set-car! objects for types might be defined as: (add-method (car ( car) self) car) (add-method ((setter car) ( car) self new-car) (set! car new-car)) A method with no ^formals^ must be added to because all messages with no reciever and arguments is directed to . 'add-method forms can be lexically scoped within each other. *** Closures Closures are actually anonymous objects with a object added to the type. ll essentally macro expands: (lambda ^formals^ . ^body^) ==> (add-method (make ) () . ^formals^) . ^body^) Note: the 'add-method form always returns the anonymous . *** Object Coercion All objects respond to (coercer ^^) which evaluates to an anonymous object that can be sent to an object to coerce it to a ^^ object. ((coercer ) "5") ==> (number->string "5") -> 5 *** Memory Managment ll uses the Boehm garbage collector for memory managment. If you link against the ll library you will need to make sure your other code uses GC_malloc() instead of malloc(). *** Errors and the Debugger The debugger is envoked when the system sends the 'handle-error message to an object. allow the user to use a new value to recover from the error by using (db exit ^value^). objects return to the top-level loop after (db exit). objects, which never get seen by the user, dump themselves and call the C abort() function. You can envoke the debugger by calling (debugger). Eval (db help) within the debugger for more info. ** System Catalog *** Type Catalog Here is a list of the base system types. *** Operation Catalog Here is a list of the base system operations. We use the <^type^>:^operation^' syntax to name them. ** Building ll has been built on: Windows 98 using cygwin-b20 Linux using gcc 2.7.2.3 You will need gcc to support proper tail recursion. To build ll unpack ll*.tgz into a directory. cd into src/ll. Run "make all" to build. ** Packages *** llt llt is a simple interactive interpreter. Running llt, creates an interpreter and begins a top-level read, eval, and print loop. *** ll C Interface **** Limitations 'call/cc is not yet supported. You should never longjmp from within ll to your C code as it will destroy the object chain. Use ll_CATCH_BEGIN to define an escape . There is only one interpreter per process. ll cannot yet support threads. **** Headers ll.h contains all the declarations. **** Initialization You must call ll_init(&argc, &argv, &envp) from within your C main() function. ll_init() returns non-zero if the initialization fails. **** Values ll_v Is the C typedef for an ll value. ***** Constants ll_nil Is the null object. '() ll_undef Is the object. #u ll_unspec Is the object. #s. All operations that evaluate to an unspecified value will return this object. See [R5RS]. ll_t Is the true value. #t ll_f Is the false value. #f ll_eos Is the value. ll_s(NAME) Is the interned of the name NAME. The C indentifier NAME is translated using the following rules: Leading underscores '_' are replaced with '%'. "__" maps to "->". "_" maps to "-". "ADD" maps to "+", "SUB" maps to "-". "MUL" maps to "*". "DIV" maps to "/". "NEG" maps to "-". "C" maps to ":". "S" maps to "*". "Q" maps to "?". "P" maps to "%". "E" maps to "!". Example: ll_s(__ADD__to_meQ) is the '%%+->to-me? symbol. See ll/symbol.h for a list of system symbol constants. ***** Global Variables ll_g(GLOBAL_VAR_NAME) Is the global value for the global variable named by the symbol ll_s(GLOBAL_VAR). ll_set_g(GLOBAL_VAR_NAME, ll_v ^value^) Sets the global value to ^value^. ll_o(GLOBAL_VAR_NAME) Is the object stored in the global variable. It similar to ll_g(GLOBAL_VAR_NAME) except the ll_init() routine will allocate and define ll_g(NAME) as a (or if a ll_o(set_'GLOBAL_VAR_NAME'E) is referenced). ll_type(NAME) Is the object stored in the global variable named "<^NAME^>". See ll/globals.h for a list of system global names. ***** Constructors SYNC THESE!!!! ****** Fixnum (small integers) ll_v ll_box_fixnum(long x); long ll_unbox_fixnum(ll_v); long ll_UNBOX_fixnum(ll_v); ****** Flonum (floating point reals) ll_v ll_box_flonum(float x); float ll_unbox_flonum(ll_v); float ll_UNBOX_flonum(ll_v); ****** Pair and List ll_v ll_cons(ll_v car, ll_v cdr); ll_v ll_immutable_cons(ll_v car, ll_v cdr); ll_v ll_listn(int n, ll_v value, ...); ll_v ll_listv(int n, ll_v *values); ****** String ll_v ll_make_string(char *buf, size_t size); ll_v ll_make_string_copy(const char *buf, size_t size); ****** Vector ll_v ll_make_vector(ll_v *buf, size_t size); ll_v ll_make_vector_copy(const ll_v *buf, size_t size); ****** Symbol ll_v ll_make_symbol(ll_v name); ll_v ll_make_symbol_(const char *name); ****** Object Use ll_call(ll_o(make), ^N^, (^type^, ^inits^ ...)) to construct other types. **** Messaging ll_v ll_call(ll_v op, int nargs, (ll_v args ...)); Sends ^op^ with an argument list. **** Defining Primitive Types See ll/type.h for a list of all primitive types. **** Defining Primitive Methods ll_define_primitive(^type^, ^op^, ^nargs^, (^formals^), _^n^(^options^ ...)) { ... } ll_define_primitive_end Defines a primitive method object that is automatically added to ^type^ using ^op^. If (^formals^) is prefixed with "_", the primitive has rest args. ***** Primitive Method Body ****** Primitive Method Body Values These can only be used within a ll_define_primitive() int ll_ARGC; The number of arguments the method was called with. Do not modify this value. ll_v *ll_ARGV; A pointer to the argument vector the method was called with. ll_v ll_SELF; Same as ll_ARGV[0]. ll_tsa_^type^ *ll_THIS; A pointer to the C structure for the ll_SELF object. ll_v ll_OP; The object the method was called with. ****** Primitive Method Body Functions These can only be used within a ll_define_primitive(). void ll_tail_call(op, nargs, (arglist ...)); Does a tail call within a ll_define_primitive. void ll_return(value); Returns a value from a ll_define_primitive. ll_v ll_call_super(ll_v op, ll_v super, int nargs, (ll_v args ...)); void ll_tail_call_super(ll_v op, ll_v super, int nargs, (ll_v args ...)); Send ^op^ to ll_SELF's supertype. Do not include ll_SELF in the args list. **** Defining Macro Primitives Macros do lexical transformations to ll_define_macro(^type^, ^car_symbol^, ^nargs^, (^formals^), _^n^(^options^ ...)) { ... } ll_define_macro_end Creates an operation that is bound to ^car_symbol^'s macro binding, that will transform s-exprs with objects of ^type^ in the cadr position. See ll/syntax.c for implementations of the required R5RS library syntax. ll0.13/COPYRIGHT0100664000175200017560000000113207623415766013556 0ustar stephensstephensCopyright (c) 1997-2003 Kurt A. Stephens and Ion, Inc., All Rights Reserved. http://www.ionink.com/stephens Kurt A. Stephens and Ion, Inc. MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Kurt A. Stephens and Ion, Inc. SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. $Id: COPYRIGHT,v 1.5 2003/02/15 10:12:18 stephens Exp $ ll0.13/CHANGES0100664000175200017560000223026107623416652013262 0ustar stephensstephensll 0.13 CHANGES ============================================================================== ============================================================================== Changes from release 'PUBLISH_ll0_12' to 'PUBLISH_ll0_13' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added voidP_voidP_*. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/PKG: New PKG version. Use prime > 2 ^ n - 1 for resizing. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: Added rcs ids. Checkpoint from IONLAP1 src/hash/hash.c: New rehash mechanism. Added lookup cache support. Added write barrier support. Use prime > 2 ^ n - 1 for resizing. Coerce hash value to unsigned int to avoid array index underflow. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/hash.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Checkpoint from IONLAP1 Initial revision Initial check in of D:\data\ion\src src/hash/hash.h: Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/hash_end.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/test/Makefile: src/hash/test/test.c: Added lookup cache support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Dont use GC by default, for testing. Checkpoint. Need curses for readline. Make sure tools get built too. Enabled -Wall. Explicitly make gc.a. Added new ll:hashstats. Added lcache.c. New inits. Automagically define CONFIG_H_VARS. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Make sure ../util/signals.h gets made. Added props.c. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added cadr.c, doc.c, sig.c. Added doc.c. Added readline.c. Added objdump.c: ll:obj-dump operation. Enumerate PRODUCTS. clean: rm $(PRODUCTS). Do not compile lookup.c with debugging. Added toplevel.c. Added debug target. Added debugger.c Added errors.h ar.h and H_FILES. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c Make all O_FILES dependent on Makefile. Don't bother scanning anything except bmethod.c for ll_bc defs. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added binding.c. Add makefile targets for $(GC_LIB) Added locative.c. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/PKG: New revision. No longer requires gc_boehm. v0.12 New version. New version. New version. New version. Fixed 0,6. New version id. Added GNU readline support. Needs gnumake. New version. Bump release number: new debugger. Added CHANGES_RELEASES. PUBLISH:ll0.3 Bump version number; major fixes and features. Integrated Boehm GC. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: New version. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. no message should be . Checkpoint. More TODO. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Misc changes. Fixed stupid errors. src/ll/ar.c: No side-effect methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. Remove quotes from write. no message Added ar.c. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: new BC stack nargs attribute. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.c: Emit slot names, not ir slot bindings; closed over vars are always in exports vector; do not emit code for magic operators. Disable internal debugging. Better checking and debugging. Added blank lines between methods. new properties format; Added ll_assert_ref()s. Changes from ion03 New stack probing. Added props, debug expr, doc string, non-tail body constant opt. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use properties-mixin. Use new global binding protocol to support readonly globals. Added const-folding support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Properly compile body defines. Elide if branches if test is a constant. Renamed macros to not conflict with formals. New error system. ll_BOX_PTR() obolesed. Do not close-over globals. Use new %write-shallow-contents. (super . ) is now (super . ) Removed debugging code in :%ir-compile2-body. Fixed (if ...) compilation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. <%ir>:initialize now defaults parent and car-pos? arguments to #f if not specified. Only car-pos lambda share code vectors. All nested lambda share const and global vectors. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Major fixes: Do not generate code to construct unreferenced rest args. Properly inline car-position lambda. Properly handle make-locative to car-position lambda formals. Do not allocate space for unreferenced car-position lambdas formals. Checkpoint. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: new properties format Docs are accessed by properties-mixin, by default. Added preliminary treadmill GC support. binding uses properties-mixin. Added :binding-doc docstring support. Use new %write-shallow-contents. super implies ll_SELF! Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. src/ll/bmethod.c: Handle slot op arguments; rewrite slot as slot_ op. Whitespace. Formatting. new properties format Changes from ion03 Added more bc meter support. New stack probing, bytecode metering, dissassembler. new BC stack nargs attrib, prompt, run and dump printing, bytecode metering, debug expr, method properties. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Compute stack motion for a byte-code string. Use new global binding protocol to support readonly globals. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Use proper names for bmethod function. rtn instruction uses ll_return(x) to properly unwind stack. Added :%dump for code gen debugging. Initialize formals, alist with something tractable. _ll_make_method* should make , not . New error system. Avoid compile warnings on _ll_val_sp volatility. Avoid stack pointer side-effects. Fixed super calls. _ll_pfx_* is now _ll_pf_*. PUBLISH:ll0.2 Proper tail and super call implementation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. glo(X) instruction is rewritten to glo_(Y) where; X is the index into the const vector for the global name (symbol), Y is the locative to the global's binding value. Added byte-codes for: 1. argument count checking. 2. rest arg list construction. 3. car-positon lambda rest arg list construction. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bool.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). Added not primitive. ll_g() is no longer an lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: Added blank lines between methods. Changes from ion03 New stack buffers. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). New error system. Catch application can now take 0 or 1 args. PUBLISH:ll0.2 argc must be 3 for caught body. ll_g() is no longer an lval. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Unwind fluid bindings. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: new properties format Proper ll_unboc_char, char=? methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. New error system. Restart method after type and range check for integer->char. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: new properties format Other changes. Added preliminary treadmill GC support. locative-car/cdr is has no side-effect Fixed set-c[ad]r! functions. Implemented locative functions. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Use new immutable-type/mutable-type cloning protocol. PUBLISH:ll0.2 Don't bother calling (super initialize). Distinguish and . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/constant.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Added blank lines between methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Formatting changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/debugger.c: Put type and method on newline for print-frame; Dont bother printing db_at_rtn. Formatting. new properties format cleaned up debugger init. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. New functionality in debugger! Major changes to debugger. Added debugger.c src/ll/defs.pl: Added support for multi-line macros and string constants. Added -s option to turn on source line tracking. Initial revision Initial check in of D:\data\ion\src src/ll/defs.sh: Other changes. CHECKPOINT Added -s option to turn on source line tracking. Check for cpp errors. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: Minor whitespace changes. new properties format Added new ll:hashstats. Use global ll_v vars for all ll_g bindings. Docs are accessed by properties-mixin, by default. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use new binding value locative and properties-mixin. New version. Preliminary stack-buffer support. Docstring support. ll_g_set() is now ll_set_g(). ll_BOX_PTR() obolesed. Restart binding errors. ll_g() is no longer an lval. super implies ll_SELF. %macro: return #f if no binding is found. Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/env.ll: src/ll/eq.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. equal? for number is eqv?. Added ll_eqvQ. equal?: Allow immutable and mutable objects to be type compared by using imutable-type messages. Added eqv? primitive. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/error.c: Fixed error object initialize method. new properties format; ll_abort(); show caller in arg-count error. Other changes. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Clean up _ll_range_error(). New _ll_typecheck_error(). Fixed :%bad-typecheck method. arg-count-recoverable-error, not arg-count-error-recoverable-error, etc. New BOX -> make, UNBOX -> box function names. restargs are now named. :values are now (key . value), not (key value). Added :error-get-value. ll_g_set() is now ll_set_g(). Added return-action value strings for common errors. :initialize no longer has a 'kind' ivar. Bug in values list consing. Added :error-ar, :error-values methods. Added :handle-error, :handle-error: (fluid-let (((fluid current-error) self)), then call (debugger self). :handle-error dumps stack traces and aborts. Moved backtrace code to debugger.c. Fixed common error generation functions to use new protocol. :initialize can now take rest args as key-value pairs for values ivar init. Use new %write-shallow-contents. :handle-error now calls (%print-backtrace-and-escape self). :%default-error-handler deleted. _ll_error creates args value from ll_ARGV, not _ll_val_sp. _ll_error doesn't check for any error handler, just calls (handle-error ). Fatal errors will attempt to print op and last method implementor type. :%print-backtrace-and-escape: prints error and ar backtrace then applies (%top-level-restart). _ll_argc_count_error(), _ll_range_error(), and _ll_undefined_variable_error() returns from _ll_error() %default-error-handler deleted; unused. Initialize %top-level-restart to #f. ll_g() is no longer an lval. super implies ll_SELF. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/eval.c: Checkpoint before ION07 HD backup. CHECKPOINT Added eval-no-const-fold. Shortcut for eval on a constant. eval now takes an optional environment rest arg (ignored). Removed old evaluator code. New BOX -> make, UNBOX -> box function names. restargs are now named. Added errors.h, floatcfg.h __ll_tail_callv is now _ll_tail_callv. eval-list debug support. Use new shorter form for basic <%ir> creation. Added eval-list primitive. Cleaned up. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/fixnum.c: new properties format Enabled -Wall. Added bitwise ops. fixnum:number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Optimize typechecks. Fixed lcm. Preliminary lcm code. Fixed modulo. Added odd?, even?, quotent, remainder, modulo, %gcd, %lcm, numerator, denominator, floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. PUBLISH:ll0.2 Comment change. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/floatcfg.c: CHECKPOINT Use epsilon not rand numbers to calc error. Don't bother with all of ll.h, use value.h. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/flonum.c: new properties format Enabled -Wall. number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/fluid.c: new properties format more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. ll_UNBOX_BOOL is now ll_unbox_boolean. Restarg are now named. ll_g_set() is now ll_set_g(). bind-%fluid will create top-level bindings after (fluid %top-level-fluid-bindings) if a previous binding is not found and value is specified. Added _ll_init_fluid_1() and _ll_init_fluid_2(). fluid binding objects are ( ), not ( . ). %fluid-bind returns old binding. (%fluid-binding ) will create a top-level fluid binding if one doesn't exist. (%fluid ) and (set-%fluid! ) will recover from . (define-%fluid ) will attempt to create a top-level fluid binding id one doesn't exist rather than do a (%fluid-bind). ll_g() is no longer a lval. %set-fluid! is now set-%fluid! to force fluid to be a . Move fluid and define-fluid macros from syntax.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/format.c: use current-output-port, not *current-output-port*; dont assume args are on stack, use va_list. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Disabled weak ptr read macro debugging. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Added ~N (named object) format. format is now ll:format. Added #p, #l weak ptr read macros. Added ~W (weak ptr) and ~L (locative) format specifiers. Disable trace in format. Use new error protocol. ll_BOX_PTR() obsolesed. Don't disable call tracing. Fixed too-many-formats error function. Added '~F' format to flush the port. Added bad-format-char error for unrecognized formats. Use %write-shallow for ~O format. ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Globals for primitives are no longer defined. ll_g_set() is now ll_set_g(). Scan ll_g_set() too. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.c: use save argv and env from main(). CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Update ll_initialized, ll_initializing. ll_init() now takes environment list. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Checkpoint. Other changes. Added lib/ll/test/test.scm. src/ll/lispread.c: Handle #\space, #\newline. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added read macro support (CALL_MACRO_CHAR(c)). Support #e and #i number modifiers. '^' is a valid symbol character. PUBLISH:ll0.2 "=" not "=="! Added support for immutable cons, vector and string. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. no message Initial revision Initial check in of D:\data\ion\src src/ll/list.c: new properties format Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added append, memq, memv, member, assq, assv, assoc. Added ll_consQ(). Added vector->list. ll_BOX_INT is now ll_make_fixnum. Restargs are now named. Added support for . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ll.h: Checkpoint before ION07 HD backup. Dont use GC by default, for testing. Formatting. Use global ll_v vars for all ll_g bindings. Broke out to prim.h. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Added new ll_VECTOR_LOOP_REF_FROM macro. _ll_range_error() and _ll_rangecheck() typedefs. Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. OP in ll_call*() is no longer affected by side effects to the activation record pointer. Added ll_consQ(). ll_init() now take environment list. Globals for primitives are no longer defined. ll_BOX_REF is now ll_make_ref. _nocheck_func removed. _minargc, _maxargc removed. Restargs are now named. ll_{BOX,UNBOX}_BOOL is now ll_{make,unbox}_boolean. ll_{BOX,UNBOX}_CHAR is now ll_{make,unbox}_char. Be sure to pick up ll_set_g() globals during defs.sh. ll_g_set() is now ll_set_g(). Added ll_eqQ(), ll_eqvQ(). Do not clear out activation records after pop, it screws up the debugger. Move basic ll_v definitions to value.h. Added new ll_e() error type reference macros. ll_BOX_PTR() obsolesed. Added new fluid binding function decls. Removed ll_CATCH_ERROR macros. ll_BOX_INT() casts to long before boxing. Make :argc an int to avoid repeated boxing and unboxing. Reorganize code. Elaborate more comments. Reference method's application function by meth->_func, not ll_SLOT(meth)[0]. Set ar's type to , not the undefined object value, after pop. Don't put super's search context on the stack; pass it directly to _ll_lookup_super(). Avoid side-effects in call primitive macros. _ll_pfx_* is now _ll_pf_*. Argument count errors can be returned from. Range errors can be returned from. ll_CATCH_ERROR uses %top-level-restart instead of %current-error-handler. Fixed most of the call primitive macros. ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Shorten macro operation symbol names. Define () as nil, not %%nil, it will be readonly soon enough. ll_THIS can now reference supertype ivars through super_. Global values are implemented using objects; see env.c, binding.c. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Intergrated Boehm GC. Minor comment changes. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.c: ll_init() now takes environment list. *read-eval-print-loop* is now ll:top-level Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.gdb: Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. no message Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/load.c: Path searching for load. Other changes. ll_LOAD_ONE. Restored :load. Move top-level code to toplevel.c. Optionally eval load expressions one at a time. *read-eval-print-loop*: Use ports for prompting. Don't print thrown error objects. load: Don't catch any errors. Don't disable call tracing. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. :load now reads entire file as a list of exprs and then compiles them all at once. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/locative.c: new properties format CHECKPOINT Added preliminary treadmill GC support. Added locative-contents nop. ll_UNBOX_LOC is now ll_UNBOX_locative. Added primitive accessor methods for . src/ll/lookup.c: Service signals before initializing any variables. Added __ll_lookup(). Bigger possible argument vectors. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added _ll_method_not_found_error. Added locatable-operation support. Added typecheck for op in lookup. Cleaned up dead code. Added async signal polling. ll_UNBOX_BOOL is now ll_unbox_boolean. restargs are now named. Use ll_AR_ARGC, ll_AR_ARGV to insure proper tracing and lookup. Use new error protocol. :lookup can now take . Removed :lookup-super. Use new %write-shallow-contents. Added "ll: " to trace message. Use current ll_ARGV[0] to determine rcvr type, not _ll_val_sp[0]. _ll_lookup_super(void) is now _ll_lookup_super(ll_v super). ll_DEBUG() is no longer a lval. Added assertion for ll_ARGC >= 0 in _ll_lookup(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/macro.c: Formatting. new properties format New stack probing. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Dont apply macro op if rcvr does not respond. Anything else is not macro-expanded. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. macro-expand1 is now macro-expand-1. Don't rewrite (set! ...) and (define ...) forms; the compiler understands them now. ll_UNBOX_BOOL is now ll_unbox_boolean. Minor changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Minor formatting. Do not attempt to lookup macro expander operations for non-symbol car. Properly handle zero-length arglists in :macro-expand1. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/map.c: Minor whitespace changes. New stack probing. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. restargs are now named. Watch out for stack motion side-effects. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_ARGC is side-effected within __ll_callv(). Majorly stupid fixes. Added apply and for-each. Reimplemented map according to RRALS5. Added support for mutable sequences. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/mem.c: New out-of-memory-error. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Redefine malloc, etc. to GC_malloc, maybe. added mem.c src/ll/meth.c: Minor whitespace changes. new properties format CHECKPOINT method alist is now properties Use properties-mixin. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Reimplemented method-minargc. minargc, maxargc are removed. _minargc and _maxargc are not boxed anymore. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/named.c: Formatting. Use binding locative not value for name lookup. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Use new #p syntax. New BOX -> make, UNBOX -> box function names. restargs are now named. Added support for and new objects. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/nil.c: Minor whitespace changes. Checkpoint before ION07 HD backup. new properties format CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Initialize %fluid-bindings to nil. New mutable list support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/num.c: new properties format negative? bug. CHECKPOINT New BOX -> make, UNBOX -> box function names. restargs are now named. Added exp, log, sin, cos, tan, asin, acos, atan operations. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c src/ll/number.c: new properties format Added max, min. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added magnitude. Faster *, + argument handling. Added gcd, lcm, read-part, imag-part, angle, =, <, >, <=, >= operators. Added +, -, * and / primitives (in conjection to the lexical optimizaitions in syntax.c). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: new properties format :make-immutable has no side-effect. New BOX -> make, UNBOX -> box function names. restargs are now named. New immutable-type/mutable-type protocol for equal? and cloning. Added :%get-tag method. Comment changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.c: Whitespace. new properties format Enabled -Wall. Initialize lcache and properties. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Write protect op globals. New version. Added locatable-operation support. Added :getter. New BOX -> make, UNBOX -> box function names. restargs are now named. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Preliminary locative-* op support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added ll_e() type defs. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ops.c: src/ll/port.c: new properties format; More file-open-error properties. Added call-with-input-file, call-with-output-file. Use standard port names. Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. Use _ll_ptr_string() where applicable. ll_g_set() is now ll_set_g(). Use new error protocol. Cast in and out of impl ivar. ll_BOX_PTR() obsolesed. Added :flush primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. is now so we get eof-object? for "free". Use stack allocated string for ll_write_string(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/posix.c: Added posix:chdir. New BOX -> make, UNBOX -> box function names. restargs are now named. Fixed (posix:exit) .vs. (posix:exit ). posix:exit can now take optional exit code. ll_BOX_PTR() obsolesed. Reformatting. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/prim.c: primitive alist is now properties. Added doc strings. new properties format; Added _ll_add_method validation. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types method alist is now properties Remove '%p:' from primitive name. Print primitive code if it is a symbol. Globals for primitives are no longer defined. minargc, maxargc are removed. restargs are now named. func, minargc, maxargc are now longer boxed values. ll_BOX_PTR() obsolesed. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Use standard port names. Comments. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added read macro support. restargs are now named. ll_UNBOX_CHAR is now ll_unbox_char. ll_BOX_CHAR is now ll_make_char. Use new error protocol. Added support for C string escape sequences. Added support for immutable cons, vector and string. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Disable internal debugging. Clean up of stack chaining and asserts. Fixed allocation for ptr chaining. Make default activation record stack frames bigger. New stack buffer protocol. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Preliminary stack-buffer support. Leave unreachable bootstrap elements on stacks. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: new properties format string:equal?, string-append!. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Only scan for 2 or 3 digits for numeric char escapes. BOX -> make, UNBOX -> unbox. Typecheck incoming char in string.c. Added and behaviors. :length is not boxed. array and length are no longer boxed. Added support for C string escape sequences. Added support for # digits. Added preliminary #e and #i specifier support. PUBLISH:ll0.2 :string->number: Bug in conversion of alpha digits to digit value. Check for fixnum overflow. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.c: Formatting. new properties format Added new ll:hashstats. New inits. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. _ll_make_symbol() now handles ll_f name properly. _ll_symbol_name typechecks now. ll_g_set() is now ll_set_g(). Escape EQ to =, not ==. :symbol->string: make name immutable. Added %gensym primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. 'P' escapes to '%', 'P' stands for Percent. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Use _ll_deftype_slot. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbols.c: src/ll/syntax.c: Minor whitespace changes. new properties format do special form debugging. CHECKPOINT Missing rparen in let* macro. Make ll_quote extern. Implemented locative transforms. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Implmented quasiquote. Added all basic syntax stuff from R5RS. Removed old set! and define rewrites. New BOX -> make, UNBOX -> box function names. restargs are now named. Reimplemented APPEND_BEGIN(), APPEND() macros. Added macros for let, let*, letrec, and, or. (-) is undefined. (define () ...) doesn't mean anything but (define (foo . bar) ...) does. Moved fluid macro to fluid.c. Implemented (make-locative ( . )) => ((locater ) . ). Added define-macro macro. Formatting. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/test.gdb: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/testold.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/toplevel.c: Minor whitespace changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. Use new readline protocol. Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.c: Fixed slot offset initialization method. Added missing write barriers. Doc strings. new properties format type:initialize can take options documention, has properties. CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Allow more type slot definitions. New BOX -> make, UNBOX -> box function names. restargs are now named. Initialize readline after other ports. Use immutable cons for critical type structures. Use new _ll_deftype* macros. PUBLISH:ll0.2 Be sure to init before . debug:init::type is now debug:init:type. Make type variables readonly after init. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.h: try again Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Prepare to swap type.h types.h. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added new properties-mixin. binding is now a properties-mixin. %ir is now a properties-mixin. method is now a properties-mixin. Reordered fluid-bindings slot in catch. binding now uses a locative to point to the value slot. Added locatable-operation support. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. Removed :minargc, maxargc. Added :top-wired? option. Added :default-exit-value slot. Added type. New _ll_deftype macros to support ll_e() error types. :tester for ? operations added.. :minargc, maxargc are no longer boxed. :length is now longer boxed. :kind removed. :ar added. added. added. ll_e() error types added. added. Make :argc an int to avoid repeated boxing and unboxing. Added and . is , is . is a . is now a . ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 is now . Added top-wired? decls. Added mutable sequence types. Added type for new environment impl. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . eventually inherits from . Minor comment changes. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/types.h: Comments. Comment changes. Other changes. CHECKPOINT try again Prepare to swap type.h types.h. New _ll_deftype macros to support ll_e() error types. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/undef.c: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/value.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. New value.h. src/ll/vec.c: new properties format Improper call supers; range checking. Fixed append. CHECKPOINT Added preliminary treadmill GC support. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Send %ptr and length messages in _ll_ptr_vec() if fast type check fails. Use new immutable-type protocol. :length is no longer boxed. Use new restartable-error protocol. Implement full type and range checks. ll_BOX_PTR() obsolesed. Use new initialize-clone protocol. PUBLISH:ll0.2 super implies ll_SELF. _ll_VEC_TERM != 0. Use "string-length" or "vector-length", not "length" in append. Added new and support. set-length! and append-one! should not take rest args. Checkpoint. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/vec.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/vector.c: Minor reformatting. new properties format CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. :length is no longer boxed. ll_BOX_PTR() obsolesed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/write.c: Whitespace. %write-shallow take optional op which is ignored. Use standard port names. Other changes. CHECKPOINT Disable recursion lock support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Remove '%p:' from primitive name. Print primitive code if it is a symbol. Escapes quote, quasiquote, unquote and unquote-splicing. _ll_write_string is now ll_write_string. restargs are now named. Added locative:%write-port, immedate:%write-shallow. :length is no longer boxed. Force flonum to be printed with .0 suffix. %writePort is now %write-port. %writeContents is now %write-shallow-contents. Added :%write-shallow. :%write and :%display call :%write-shallow. PUBLISH:ll0.2 Added %writePort method for . is now . Don't use ll_tail_call to force unspecified return value. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_11' to 'PUBLISH_ll0_12' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added voidP_voidP_*. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/PKG: New PKG version. Use prime > 2 ^ n - 1 for resizing. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: Added rcs ids. Checkpoint from IONLAP1 src/hash/hash.c: New rehash mechanism. Added lookup cache support. Added write barrier support. Use prime > 2 ^ n - 1 for resizing. Coerce hash value to unsigned int to avoid array index underflow. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/hash.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Checkpoint from IONLAP1 Initial revision Initial check in of D:\data\ion\src src/hash/hash.h: Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/hash_end.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/test/Makefile: src/hash/test/test.c: Added lookup cache support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Dont use GC by default, for testing. Checkpoint. Need curses for readline. Make sure tools get built too. Enabled -Wall. Explicitly make gc.a. Added new ll:hashstats. Added lcache.c. New inits. Automagically define CONFIG_H_VARS. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Make sure ../util/signals.h gets made. Added props.c. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added cadr.c, doc.c, sig.c. Added doc.c. Added readline.c. Added objdump.c: ll:obj-dump operation. Enumerate PRODUCTS. clean: rm $(PRODUCTS). Do not compile lookup.c with debugging. Added toplevel.c. Added debug target. Added debugger.c Added errors.h ar.h and H_FILES. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c Make all O_FILES dependent on Makefile. Don't bother scanning anything except bmethod.c for ll_bc defs. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added binding.c. Add makefile targets for $(GC_LIB) Added locative.c. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/PKG: New revision. No longer requires gc_boehm. v0.12 New version. New version. New version. New version. Fixed 0,6. New version id. Added GNU readline support. Needs gnumake. New version. Bump release number: new debugger. Added CHANGES_RELEASES. PUBLISH:ll0.3 Bump version number; major fixes and features. Integrated Boehm GC. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: New version. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. no message should be . Checkpoint. More TODO. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Misc changes. Fixed stupid errors. src/ll/ar.c: No side-effect methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. Remove quotes from write. no message Added ar.c. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: new BC stack nargs attribute. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.c: Emit slot names, not ir slot bindings; closed over vars are always in exports vector; do not emit code for magic operators. Disable internal debugging. Better checking and debugging. Added blank lines between methods. new properties format; Added ll_assert_ref()s. Changes from ion03 New stack probing. Added props, debug expr, doc string, non-tail body constant opt. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use properties-mixin. Use new global binding protocol to support readonly globals. Added const-folding support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Properly compile body defines. Elide if branches if test is a constant. Renamed macros to not conflict with formals. New error system. ll_BOX_PTR() obolesed. Do not close-over globals. Use new %write-shallow-contents. (super . ) is now (super . ) Removed debugging code in :%ir-compile2-body. Fixed (if ...) compilation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. <%ir>:initialize now defaults parent and car-pos? arguments to #f if not specified. Only car-pos lambda share code vectors. All nested lambda share const and global vectors. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Major fixes: Do not generate code to construct unreferenced rest args. Properly inline car-position lambda. Properly handle make-locative to car-position lambda formals. Do not allocate space for unreferenced car-position lambdas formals. Checkpoint. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: new properties format Docs are accessed by properties-mixin, by default. Added preliminary treadmill GC support. binding uses properties-mixin. Added :binding-doc docstring support. Use new %write-shallow-contents. super implies ll_SELF! Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. src/ll/bmethod.c: Handle slot op arguments; rewrite slot as slot_ op. Whitespace. Formatting. new properties format Changes from ion03 Added more bc meter support. New stack probing, bytecode metering, dissassembler. new BC stack nargs attrib, prompt, run and dump printing, bytecode metering, debug expr, method properties. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Compute stack motion for a byte-code string. Use new global binding protocol to support readonly globals. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Use proper names for bmethod function. rtn instruction uses ll_return(x) to properly unwind stack. Added :%dump for code gen debugging. Initialize formals, alist with something tractable. _ll_make_method* should make , not . New error system. Avoid compile warnings on _ll_val_sp volatility. Avoid stack pointer side-effects. Fixed super calls. _ll_pfx_* is now _ll_pf_*. PUBLISH:ll0.2 Proper tail and super call implementation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. glo(X) instruction is rewritten to glo_(Y) where; X is the index into the const vector for the global name (symbol), Y is the locative to the global's binding value. Added byte-codes for: 1. argument count checking. 2. rest arg list construction. 3. car-positon lambda rest arg list construction. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bool.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). Added not primitive. ll_g() is no longer an lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: Added blank lines between methods. Changes from ion03 New stack buffers. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). New error system. Catch application can now take 0 or 1 args. PUBLISH:ll0.2 argc must be 3 for caught body. ll_g() is no longer an lval. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Unwind fluid bindings. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: new properties format Proper ll_unboc_char, char=? methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. New error system. Restart method after type and range check for integer->char. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: new properties format Other changes. Added preliminary treadmill GC support. locative-car/cdr is has no side-effect Fixed set-c[ad]r! functions. Implemented locative functions. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Use new immutable-type/mutable-type cloning protocol. PUBLISH:ll0.2 Don't bother calling (super initialize). Distinguish and . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/constant.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Added blank lines between methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Formatting changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/debugger.c: Put type and method on newline for print-frame; Dont bother printing db_at_rtn. Formatting. new properties format cleaned up debugger init. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. New functionality in debugger! Major changes to debugger. Added debugger.c src/ll/defs.pl: Added support for multi-line macros and string constants. Added -s option to turn on source line tracking. Initial revision Initial check in of D:\data\ion\src src/ll/defs.sh: Other changes. CHECKPOINT Added -s option to turn on source line tracking. Check for cpp errors. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: Minor whitespace changes. new properties format Added new ll:hashstats. Use global ll_v vars for all ll_g bindings. Docs are accessed by properties-mixin, by default. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use new binding value locative and properties-mixin. New version. Preliminary stack-buffer support. Docstring support. ll_g_set() is now ll_set_g(). ll_BOX_PTR() obolesed. Restart binding errors. ll_g() is no longer an lval. super implies ll_SELF. %macro: return #f if no binding is found. Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/env.ll: src/ll/eq.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. equal? for number is eqv?. Added ll_eqvQ. equal?: Allow immutable and mutable objects to be type compared by using imutable-type messages. Added eqv? primitive. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/error.c: Fixed error object initialize method. new properties format; ll_abort(); show caller in arg-count error. Other changes. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Clean up _ll_range_error(). New _ll_typecheck_error(). Fixed :%bad-typecheck method. arg-count-recoverable-error, not arg-count-error-recoverable-error, etc. New BOX -> make, UNBOX -> box function names. restargs are now named. :values are now (key . value), not (key value). Added :error-get-value. ll_g_set() is now ll_set_g(). Added return-action value strings for common errors. :initialize no longer has a 'kind' ivar. Bug in values list consing. Added :error-ar, :error-values methods. Added :handle-error, :handle-error: (fluid-let (((fluid current-error) self)), then call (debugger self). :handle-error dumps stack traces and aborts. Moved backtrace code to debugger.c. Fixed common error generation functions to use new protocol. :initialize can now take rest args as key-value pairs for values ivar init. Use new %write-shallow-contents. :handle-error now calls (%print-backtrace-and-escape self). :%default-error-handler deleted. _ll_error creates args value from ll_ARGV, not _ll_val_sp. _ll_error doesn't check for any error handler, just calls (handle-error ). Fatal errors will attempt to print op and last method implementor type. :%print-backtrace-and-escape: prints error and ar backtrace then applies (%top-level-restart). _ll_argc_count_error(), _ll_range_error(), and _ll_undefined_variable_error() returns from _ll_error() %default-error-handler deleted; unused. Initialize %top-level-restart to #f. ll_g() is no longer an lval. super implies ll_SELF. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/eval.c: Checkpoint before ION07 HD backup. CHECKPOINT Added eval-no-const-fold. Shortcut for eval on a constant. eval now takes an optional environment rest arg (ignored). Removed old evaluator code. New BOX -> make, UNBOX -> box function names. restargs are now named. Added errors.h, floatcfg.h __ll_tail_callv is now _ll_tail_callv. eval-list debug support. Use new shorter form for basic <%ir> creation. Added eval-list primitive. Cleaned up. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/fixnum.c: new properties format Enabled -Wall. Added bitwise ops. fixnum:number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Optimize typechecks. Fixed lcm. Preliminary lcm code. Fixed modulo. Added odd?, even?, quotent, remainder, modulo, %gcd, %lcm, numerator, denominator, floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. PUBLISH:ll0.2 Comment change. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/floatcfg.c: CHECKPOINT Use epsilon not rand numbers to calc error. Don't bother with all of ll.h, use value.h. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/flonum.c: new properties format Enabled -Wall. number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/fluid.c: new properties format more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. ll_UNBOX_BOOL is now ll_unbox_boolean. Restarg are now named. ll_g_set() is now ll_set_g(). bind-%fluid will create top-level bindings after (fluid %top-level-fluid-bindings) if a previous binding is not found and value is specified. Added _ll_init_fluid_1() and _ll_init_fluid_2(). fluid binding objects are ( ), not ( . ). %fluid-bind returns old binding. (%fluid-binding ) will create a top-level fluid binding if one doesn't exist. (%fluid ) and (set-%fluid! ) will recover from . (define-%fluid ) will attempt to create a top-level fluid binding id one doesn't exist rather than do a (%fluid-bind). ll_g() is no longer a lval. %set-fluid! is now set-%fluid! to force fluid to be a . Move fluid and define-fluid macros from syntax.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/format.c: use current-output-port, not *current-output-port*; dont assume args are on stack, use va_list. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Disabled weak ptr read macro debugging. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Added ~N (named object) format. format is now ll:format. Added #p, #l weak ptr read macros. Added ~W (weak ptr) and ~L (locative) format specifiers. Disable trace in format. Use new error protocol. ll_BOX_PTR() obsolesed. Don't disable call tracing. Fixed too-many-formats error function. Added '~F' format to flush the port. Added bad-format-char error for unrecognized formats. Use %write-shallow for ~O format. ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Globals for primitives are no longer defined. ll_g_set() is now ll_set_g(). Scan ll_g_set() too. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.c: use save argv and env from main(). CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Update ll_initialized, ll_initializing. ll_init() now takes environment list. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Checkpoint. Other changes. Added lib/ll/test/test.scm. src/ll/lispread.c: Handle #\space, #\newline. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added read macro support (CALL_MACRO_CHAR(c)). Support #e and #i number modifiers. '^' is a valid symbol character. PUBLISH:ll0.2 "=" not "=="! Added support for immutable cons, vector and string. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. no message Initial revision Initial check in of D:\data\ion\src src/ll/list.c: new properties format Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added append, memq, memv, member, assq, assv, assoc. Added ll_consQ(). Added vector->list. ll_BOX_INT is now ll_make_fixnum. Restargs are now named. Added support for . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ll.h: Checkpoint before ION07 HD backup. Dont use GC by default, for testing. Formatting. Use global ll_v vars for all ll_g bindings. Broke out to prim.h. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Added new ll_VECTOR_LOOP_REF_FROM macro. _ll_range_error() and _ll_rangecheck() typedefs. Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. OP in ll_call*() is no longer affected by side effects to the activation record pointer. Added ll_consQ(). ll_init() now take environment list. Globals for primitives are no longer defined. ll_BOX_REF is now ll_make_ref. _nocheck_func removed. _minargc, _maxargc removed. Restargs are now named. ll_{BOX,UNBOX}_BOOL is now ll_{make,unbox}_boolean. ll_{BOX,UNBOX}_CHAR is now ll_{make,unbox}_char. Be sure to pick up ll_set_g() globals during defs.sh. ll_g_set() is now ll_set_g(). Added ll_eqQ(), ll_eqvQ(). Do not clear out activation records after pop, it screws up the debugger. Move basic ll_v definitions to value.h. Added new ll_e() error type reference macros. ll_BOX_PTR() obsolesed. Added new fluid binding function decls. Removed ll_CATCH_ERROR macros. ll_BOX_INT() casts to long before boxing. Make :argc an int to avoid repeated boxing and unboxing. Reorganize code. Elaborate more comments. Reference method's application function by meth->_func, not ll_SLOT(meth)[0]. Set ar's type to , not the undefined object value, after pop. Don't put super's search context on the stack; pass it directly to _ll_lookup_super(). Avoid side-effects in call primitive macros. _ll_pfx_* is now _ll_pf_*. Argument count errors can be returned from. Range errors can be returned from. ll_CATCH_ERROR uses %top-level-restart instead of %current-error-handler. Fixed most of the call primitive macros. ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Shorten macro operation symbol names. Define () as nil, not %%nil, it will be readonly soon enough. ll_THIS can now reference supertype ivars through super_. Global values are implemented using objects; see env.c, binding.c. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Intergrated Boehm GC. Minor comment changes. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.c: ll_init() now takes environment list. *read-eval-print-loop* is now ll:top-level Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.gdb: Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. no message Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/load.c: Path searching for load. Other changes. ll_LOAD_ONE. Restored :load. Move top-level code to toplevel.c. Optionally eval load expressions one at a time. *read-eval-print-loop*: Use ports for prompting. Don't print thrown error objects. load: Don't catch any errors. Don't disable call tracing. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. :load now reads entire file as a list of exprs and then compiles them all at once. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/locative.c: new properties format CHECKPOINT Added preliminary treadmill GC support. Added locative-contents nop. ll_UNBOX_LOC is now ll_UNBOX_locative. Added primitive accessor methods for . src/ll/lookup.c: Service signals before initializing any variables. Added __ll_lookup(). Bigger possible argument vectors. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added _ll_method_not_found_error. Added locatable-operation support. Added typecheck for op in lookup. Cleaned up dead code. Added async signal polling. ll_UNBOX_BOOL is now ll_unbox_boolean. restargs are now named. Use ll_AR_ARGC, ll_AR_ARGV to insure proper tracing and lookup. Use new error protocol. :lookup can now take . Removed :lookup-super. Use new %write-shallow-contents. Added "ll: " to trace message. Use current ll_ARGV[0] to determine rcvr type, not _ll_val_sp[0]. _ll_lookup_super(void) is now _ll_lookup_super(ll_v super). ll_DEBUG() is no longer a lval. Added assertion for ll_ARGC >= 0 in _ll_lookup(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/macro.c: Formatting. new properties format New stack probing. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Dont apply macro op if rcvr does not respond. Anything else is not macro-expanded. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. macro-expand1 is now macro-expand-1. Don't rewrite (set! ...) and (define ...) forms; the compiler understands them now. ll_UNBOX_BOOL is now ll_unbox_boolean. Minor changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Minor formatting. Do not attempt to lookup macro expander operations for non-symbol car. Properly handle zero-length arglists in :macro-expand1. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/map.c: Minor whitespace changes. New stack probing. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. restargs are now named. Watch out for stack motion side-effects. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_ARGC is side-effected within __ll_callv(). Majorly stupid fixes. Added apply and for-each. Reimplemented map according to RRALS5. Added support for mutable sequences. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/mem.c: New out-of-memory-error. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Redefine malloc, etc. to GC_malloc, maybe. added mem.c src/ll/meth.c: Minor whitespace changes. new properties format CHECKPOINT method alist is now properties Use properties-mixin. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Reimplemented method-minargc. minargc, maxargc are removed. _minargc and _maxargc are not boxed anymore. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/named.c: Formatting. Use binding locative not value for name lookup. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Use new #p syntax. New BOX -> make, UNBOX -> box function names. restargs are now named. Added support for and new objects. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/nil.c: Minor whitespace changes. Checkpoint before ION07 HD backup. new properties format CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Initialize %fluid-bindings to nil. New mutable list support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/num.c: new properties format negative? bug. CHECKPOINT New BOX -> make, UNBOX -> box function names. restargs are now named. Added exp, log, sin, cos, tan, asin, acos, atan operations. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c src/ll/number.c: new properties format Added max, min. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added magnitude. Faster *, + argument handling. Added gcd, lcm, read-part, imag-part, angle, =, <, >, <=, >= operators. Added +, -, * and / primitives (in conjection to the lexical optimizaitions in syntax.c). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: new properties format :make-immutable has no side-effect. New BOX -> make, UNBOX -> box function names. restargs are now named. New immutable-type/mutable-type protocol for equal? and cloning. Added :%get-tag method. Comment changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.c: Whitespace. new properties format Enabled -Wall. Initialize lcache and properties. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Write protect op globals. New version. Added locatable-operation support. Added :getter. New BOX -> make, UNBOX -> box function names. restargs are now named. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Preliminary locative-* op support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added ll_e() type defs. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ops.c: src/ll/port.c: new properties format; More file-open-error properties. Added call-with-input-file, call-with-output-file. Use standard port names. Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. Use _ll_ptr_string() where applicable. ll_g_set() is now ll_set_g(). Use new error protocol. Cast in and out of impl ivar. ll_BOX_PTR() obsolesed. Added :flush primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. is now so we get eof-object? for "free". Use stack allocated string for ll_write_string(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/posix.c: Added posix:chdir. New BOX -> make, UNBOX -> box function names. restargs are now named. Fixed (posix:exit) .vs. (posix:exit ). posix:exit can now take optional exit code. ll_BOX_PTR() obsolesed. Reformatting. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/prim.c: primitive alist is now properties. Added doc strings. new properties format; Added _ll_add_method validation. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types method alist is now properties Remove '%p:' from primitive name. Print primitive code if it is a symbol. Globals for primitives are no longer defined. minargc, maxargc are removed. restargs are now named. func, minargc, maxargc are now longer boxed values. ll_BOX_PTR() obsolesed. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Use standard port names. Comments. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added read macro support. restargs are now named. ll_UNBOX_CHAR is now ll_unbox_char. ll_BOX_CHAR is now ll_make_char. Use new error protocol. Added support for C string escape sequences. Added support for immutable cons, vector and string. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Disable internal debugging. Clean up of stack chaining and asserts. Fixed allocation for ptr chaining. Make default activation record stack frames bigger. New stack buffer protocol. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Preliminary stack-buffer support. Leave unreachable bootstrap elements on stacks. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: new properties format string:equal?, string-append!. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Only scan for 2 or 3 digits for numeric char escapes. BOX -> make, UNBOX -> unbox. Typecheck incoming char in string.c. Added and behaviors. :length is not boxed. array and length are no longer boxed. Added support for C string escape sequences. Added support for # digits. Added preliminary #e and #i specifier support. PUBLISH:ll0.2 :string->number: Bug in conversion of alpha digits to digit value. Check for fixnum overflow. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.c: Formatting. new properties format Added new ll:hashstats. New inits. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. _ll_make_symbol() now handles ll_f name properly. _ll_symbol_name typechecks now. ll_g_set() is now ll_set_g(). Escape EQ to =, not ==. :symbol->string: make name immutable. Added %gensym primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. 'P' escapes to '%', 'P' stands for Percent. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Use _ll_deftype_slot. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbols.c: src/ll/syntax.c: Minor whitespace changes. new properties format do special form debugging. CHECKPOINT Missing rparen in let* macro. Make ll_quote extern. Implemented locative transforms. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Implmented quasiquote. Added all basic syntax stuff from R5RS. Removed old set! and define rewrites. New BOX -> make, UNBOX -> box function names. restargs are now named. Reimplemented APPEND_BEGIN(), APPEND() macros. Added macros for let, let*, letrec, and, or. (-) is undefined. (define () ...) doesn't mean anything but (define (foo . bar) ...) does. Moved fluid macro to fluid.c. Implemented (make-locative ( . )) => ((locater ) . ). Added define-macro macro. Formatting. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/test.gdb: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/testold.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/toplevel.c: Minor whitespace changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. Use new readline protocol. Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.c: Fixed slot offset initialization method. Added missing write barriers. Doc strings. new properties format type:initialize can take options documention, has properties. CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Allow more type slot definitions. New BOX -> make, UNBOX -> box function names. restargs are now named. Initialize readline after other ports. Use immutable cons for critical type structures. Use new _ll_deftype* macros. PUBLISH:ll0.2 Be sure to init before . debug:init::type is now debug:init:type. Make type variables readonly after init. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.h: try again Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Prepare to swap type.h types.h. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added new properties-mixin. binding is now a properties-mixin. %ir is now a properties-mixin. method is now a properties-mixin. Reordered fluid-bindings slot in catch. binding now uses a locative to point to the value slot. Added locatable-operation support. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. Removed :minargc, maxargc. Added :top-wired? option. Added :default-exit-value slot. Added type. New _ll_deftype macros to support ll_e() error types. :tester for ? operations added.. :minargc, maxargc are no longer boxed. :length is now longer boxed. :kind removed. :ar added. added. added. ll_e() error types added. added. Make :argc an int to avoid repeated boxing and unboxing. Added and . is , is . is a . is now a . ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 is now . Added top-wired? decls. Added mutable sequence types. Added type for new environment impl. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . eventually inherits from . Minor comment changes. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/types.h: Comments. Comment changes. Other changes. CHECKPOINT try again Prepare to swap type.h types.h. New _ll_deftype macros to support ll_e() error types. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/undef.c: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/value.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. New value.h. src/ll/vec.c: new properties format Improper call supers; range checking. Fixed append. CHECKPOINT Added preliminary treadmill GC support. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Send %ptr and length messages in _ll_ptr_vec() if fast type check fails. Use new immutable-type protocol. :length is no longer boxed. Use new restartable-error protocol. Implement full type and range checks. ll_BOX_PTR() obsolesed. Use new initialize-clone protocol. PUBLISH:ll0.2 super implies ll_SELF. _ll_VEC_TERM != 0. Use "string-length" or "vector-length", not "length" in append. Added new and support. set-length! and append-one! should not take rest args. Checkpoint. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/vec.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/vector.c: Minor reformatting. new properties format CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. :length is no longer boxed. ll_BOX_PTR() obsolesed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/write.c: Whitespace. %write-shallow take optional op which is ignored. Use standard port names. Other changes. CHECKPOINT Disable recursion lock support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Remove '%p:' from primitive name. Print primitive code if it is a symbol. Escapes quote, quasiquote, unquote and unquote-splicing. _ll_write_string is now ll_write_string. restargs are now named. Added locative:%write-port, immedate:%write-shallow. :length is no longer boxed. Force flonum to be printed with .0 suffix. %writePort is now %write-port. %writeContents is now %write-shallow-contents. Added :%write-shallow. :%write and :%display call :%write-shallow. PUBLISH:ll0.2 Added %writePort method for . is now . Don't use ll_tail_call to force unspecified return value. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_10' to 'PUBLISH_ll0_11' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added voidP_voidP_*. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/PKG: New PKG version. Use prime > 2 ^ n - 1 for resizing. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: Added rcs ids. Checkpoint from IONLAP1 src/hash/hash.c: New rehash mechanism. Added lookup cache support. Added write barrier support. Use prime > 2 ^ n - 1 for resizing. Coerce hash value to unsigned int to avoid array index underflow. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/hash.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Checkpoint from IONLAP1 Initial revision Initial check in of D:\data\ion\src src/hash/hash.h: Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/hash_end.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/test/Makefile: src/hash/test/test.c: Added lookup cache support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Dont use GC by default, for testing. Checkpoint. Need curses for readline. Make sure tools get built too. Enabled -Wall. Explicitly make gc.a. Added new ll:hashstats. Added lcache.c. New inits. Automagically define CONFIG_H_VARS. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Make sure ../util/signals.h gets made. Added props.c. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added cadr.c, doc.c, sig.c. Added doc.c. Added readline.c. Added objdump.c: ll:obj-dump operation. Enumerate PRODUCTS. clean: rm $(PRODUCTS). Do not compile lookup.c with debugging. Added toplevel.c. Added debug target. Added debugger.c Added errors.h ar.h and H_FILES. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c Make all O_FILES dependent on Makefile. Don't bother scanning anything except bmethod.c for ll_bc defs. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added binding.c. Add makefile targets for $(GC_LIB) Added locative.c. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/PKG: New revision. No longer requires gc_boehm. v0.12 New version. New version. New version. New version. Fixed 0,6. New version id. Added GNU readline support. Needs gnumake. New version. Bump release number: new debugger. Added CHANGES_RELEASES. PUBLISH:ll0.3 Bump version number; major fixes and features. Integrated Boehm GC. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: New version. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. no message should be . Checkpoint. More TODO. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Misc changes. Fixed stupid errors. src/ll/ar.c: No side-effect methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. Remove quotes from write. no message Added ar.c. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: new BC stack nargs attribute. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.c: Emit slot names, not ir slot bindings; closed over vars are always in exports vector; do not emit code for magic operators. Disable internal debugging. Better checking and debugging. Added blank lines between methods. new properties format; Added ll_assert_ref()s. Changes from ion03 New stack probing. Added props, debug expr, doc string, non-tail body constant opt. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use properties-mixin. Use new global binding protocol to support readonly globals. Added const-folding support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Properly compile body defines. Elide if branches if test is a constant. Renamed macros to not conflict with formals. New error system. ll_BOX_PTR() obolesed. Do not close-over globals. Use new %write-shallow-contents. (super . ) is now (super . ) Removed debugging code in :%ir-compile2-body. Fixed (if ...) compilation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. <%ir>:initialize now defaults parent and car-pos? arguments to #f if not specified. Only car-pos lambda share code vectors. All nested lambda share const and global vectors. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Major fixes: Do not generate code to construct unreferenced rest args. Properly inline car-position lambda. Properly handle make-locative to car-position lambda formals. Do not allocate space for unreferenced car-position lambdas formals. Checkpoint. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: new properties format Docs are accessed by properties-mixin, by default. Added preliminary treadmill GC support. binding uses properties-mixin. Added :binding-doc docstring support. Use new %write-shallow-contents. super implies ll_SELF! Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. src/ll/bmethod.c: Handle slot op arguments; rewrite slot as slot_ op. Whitespace. Formatting. new properties format Changes from ion03 Added more bc meter support. New stack probing, bytecode metering, dissassembler. new BC stack nargs attrib, prompt, run and dump printing, bytecode metering, debug expr, method properties. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Compute stack motion for a byte-code string. Use new global binding protocol to support readonly globals. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Use proper names for bmethod function. rtn instruction uses ll_return(x) to properly unwind stack. Added :%dump for code gen debugging. Initialize formals, alist with something tractable. _ll_make_method* should make , not . New error system. Avoid compile warnings on _ll_val_sp volatility. Avoid stack pointer side-effects. Fixed super calls. _ll_pfx_* is now _ll_pf_*. PUBLISH:ll0.2 Proper tail and super call implementation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. glo(X) instruction is rewritten to glo_(Y) where; X is the index into the const vector for the global name (symbol), Y is the locative to the global's binding value. Added byte-codes for: 1. argument count checking. 2. rest arg list construction. 3. car-positon lambda rest arg list construction. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bool.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). Added not primitive. ll_g() is no longer an lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: Added blank lines between methods. Changes from ion03 New stack buffers. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). New error system. Catch application can now take 0 or 1 args. PUBLISH:ll0.2 argc must be 3 for caught body. ll_g() is no longer an lval. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Unwind fluid bindings. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: new properties format Proper ll_unboc_char, char=? methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. New error system. Restart method after type and range check for integer->char. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: new properties format Other changes. Added preliminary treadmill GC support. locative-car/cdr is has no side-effect Fixed set-c[ad]r! functions. Implemented locative functions. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Use new immutable-type/mutable-type cloning protocol. PUBLISH:ll0.2 Don't bother calling (super initialize). Distinguish and . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/constant.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Added blank lines between methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Formatting changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/debugger.c: Put type and method on newline for print-frame; Dont bother printing db_at_rtn. Formatting. new properties format cleaned up debugger init. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. New functionality in debugger! Major changes to debugger. Added debugger.c src/ll/defs.pl: Added support for multi-line macros and string constants. Added -s option to turn on source line tracking. Initial revision Initial check in of D:\data\ion\src src/ll/defs.sh: Other changes. CHECKPOINT Added -s option to turn on source line tracking. Check for cpp errors. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: Minor whitespace changes. new properties format Added new ll:hashstats. Use global ll_v vars for all ll_g bindings. Docs are accessed by properties-mixin, by default. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use new binding value locative and properties-mixin. New version. Preliminary stack-buffer support. Docstring support. ll_g_set() is now ll_set_g(). ll_BOX_PTR() obolesed. Restart binding errors. ll_g() is no longer an lval. super implies ll_SELF. %macro: return #f if no binding is found. Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/env.ll: src/ll/eq.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. equal? for number is eqv?. Added ll_eqvQ. equal?: Allow immutable and mutable objects to be type compared by using imutable-type messages. Added eqv? primitive. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/error.c: Fixed error object initialize method. new properties format; ll_abort(); show caller in arg-count error. Other changes. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Clean up _ll_range_error(). New _ll_typecheck_error(). Fixed :%bad-typecheck method. arg-count-recoverable-error, not arg-count-error-recoverable-error, etc. New BOX -> make, UNBOX -> box function names. restargs are now named. :values are now (key . value), not (key value). Added :error-get-value. ll_g_set() is now ll_set_g(). Added return-action value strings for common errors. :initialize no longer has a 'kind' ivar. Bug in values list consing. Added :error-ar, :error-values methods. Added :handle-error, :handle-error: (fluid-let (((fluid current-error) self)), then call (debugger self). :handle-error dumps stack traces and aborts. Moved backtrace code to debugger.c. Fixed common error generation functions to use new protocol. :initialize can now take rest args as key-value pairs for values ivar init. Use new %write-shallow-contents. :handle-error now calls (%print-backtrace-and-escape self). :%default-error-handler deleted. _ll_error creates args value from ll_ARGV, not _ll_val_sp. _ll_error doesn't check for any error handler, just calls (handle-error ). Fatal errors will attempt to print op and last method implementor type. :%print-backtrace-and-escape: prints error and ar backtrace then applies (%top-level-restart). _ll_argc_count_error(), _ll_range_error(), and _ll_undefined_variable_error() returns from _ll_error() %default-error-handler deleted; unused. Initialize %top-level-restart to #f. ll_g() is no longer an lval. super implies ll_SELF. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/eval.c: Checkpoint before ION07 HD backup. CHECKPOINT Added eval-no-const-fold. Shortcut for eval on a constant. eval now takes an optional environment rest arg (ignored). Removed old evaluator code. New BOX -> make, UNBOX -> box function names. restargs are now named. Added errors.h, floatcfg.h __ll_tail_callv is now _ll_tail_callv. eval-list debug support. Use new shorter form for basic <%ir> creation. Added eval-list primitive. Cleaned up. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/fixnum.c: new properties format Enabled -Wall. Added bitwise ops. fixnum:number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Optimize typechecks. Fixed lcm. Preliminary lcm code. Fixed modulo. Added odd?, even?, quotent, remainder, modulo, %gcd, %lcm, numerator, denominator, floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. PUBLISH:ll0.2 Comment change. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/floatcfg.c: CHECKPOINT Use epsilon not rand numbers to calc error. Don't bother with all of ll.h, use value.h. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/flonum.c: new properties format Enabled -Wall. number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/fluid.c: new properties format more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. ll_UNBOX_BOOL is now ll_unbox_boolean. Restarg are now named. ll_g_set() is now ll_set_g(). bind-%fluid will create top-level bindings after (fluid %top-level-fluid-bindings) if a previous binding is not found and value is specified. Added _ll_init_fluid_1() and _ll_init_fluid_2(). fluid binding objects are ( ), not ( . ). %fluid-bind returns old binding. (%fluid-binding ) will create a top-level fluid binding if one doesn't exist. (%fluid ) and (set-%fluid! ) will recover from . (define-%fluid ) will attempt to create a top-level fluid binding id one doesn't exist rather than do a (%fluid-bind). ll_g() is no longer a lval. %set-fluid! is now set-%fluid! to force fluid to be a . Move fluid and define-fluid macros from syntax.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/format.c: use current-output-port, not *current-output-port*; dont assume args are on stack, use va_list. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Disabled weak ptr read macro debugging. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Added ~N (named object) format. format is now ll:format. Added #p, #l weak ptr read macros. Added ~W (weak ptr) and ~L (locative) format specifiers. Disable trace in format. Use new error protocol. ll_BOX_PTR() obsolesed. Don't disable call tracing. Fixed too-many-formats error function. Added '~F' format to flush the port. Added bad-format-char error for unrecognized formats. Use %write-shallow for ~O format. ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Globals for primitives are no longer defined. ll_g_set() is now ll_set_g(). Scan ll_g_set() too. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.c: use save argv and env from main(). CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Update ll_initialized, ll_initializing. ll_init() now takes environment list. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Checkpoint. Other changes. Added lib/ll/test/test.scm. src/ll/lispread.c: Handle #\space, #\newline. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added read macro support (CALL_MACRO_CHAR(c)). Support #e and #i number modifiers. '^' is a valid symbol character. PUBLISH:ll0.2 "=" not "=="! Added support for immutable cons, vector and string. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. no message Initial revision Initial check in of D:\data\ion\src src/ll/list.c: new properties format Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added append, memq, memv, member, assq, assv, assoc. Added ll_consQ(). Added vector->list. ll_BOX_INT is now ll_make_fixnum. Restargs are now named. Added support for . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ll.h: Checkpoint before ION07 HD backup. Dont use GC by default, for testing. Formatting. Use global ll_v vars for all ll_g bindings. Broke out to prim.h. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Added new ll_VECTOR_LOOP_REF_FROM macro. _ll_range_error() and _ll_rangecheck() typedefs. Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. OP in ll_call*() is no longer affected by side effects to the activation record pointer. Added ll_consQ(). ll_init() now take environment list. Globals for primitives are no longer defined. ll_BOX_REF is now ll_make_ref. _nocheck_func removed. _minargc, _maxargc removed. Restargs are now named. ll_{BOX,UNBOX}_BOOL is now ll_{make,unbox}_boolean. ll_{BOX,UNBOX}_CHAR is now ll_{make,unbox}_char. Be sure to pick up ll_set_g() globals during defs.sh. ll_g_set() is now ll_set_g(). Added ll_eqQ(), ll_eqvQ(). Do not clear out activation records after pop, it screws up the debugger. Move basic ll_v definitions to value.h. Added new ll_e() error type reference macros. ll_BOX_PTR() obsolesed. Added new fluid binding function decls. Removed ll_CATCH_ERROR macros. ll_BOX_INT() casts to long before boxing. Make :argc an int to avoid repeated boxing and unboxing. Reorganize code. Elaborate more comments. Reference method's application function by meth->_func, not ll_SLOT(meth)[0]. Set ar's type to , not the undefined object value, after pop. Don't put super's search context on the stack; pass it directly to _ll_lookup_super(). Avoid side-effects in call primitive macros. _ll_pfx_* is now _ll_pf_*. Argument count errors can be returned from. Range errors can be returned from. ll_CATCH_ERROR uses %top-level-restart instead of %current-error-handler. Fixed most of the call primitive macros. ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Shorten macro operation symbol names. Define () as nil, not %%nil, it will be readonly soon enough. ll_THIS can now reference supertype ivars through super_. Global values are implemented using objects; see env.c, binding.c. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Intergrated Boehm GC. Minor comment changes. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.c: ll_init() now takes environment list. *read-eval-print-loop* is now ll:top-level Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.gdb: Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. no message Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/load.c: Path searching for load. Other changes. ll_LOAD_ONE. Restored :load. Move top-level code to toplevel.c. Optionally eval load expressions one at a time. *read-eval-print-loop*: Use ports for prompting. Don't print thrown error objects. load: Don't catch any errors. Don't disable call tracing. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. :load now reads entire file as a list of exprs and then compiles them all at once. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/locative.c: new properties format CHECKPOINT Added preliminary treadmill GC support. Added locative-contents nop. ll_UNBOX_LOC is now ll_UNBOX_locative. Added primitive accessor methods for . src/ll/lookup.c: Service signals before initializing any variables. Added __ll_lookup(). Bigger possible argument vectors. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added _ll_method_not_found_error. Added locatable-operation support. Added typecheck for op in lookup. Cleaned up dead code. Added async signal polling. ll_UNBOX_BOOL is now ll_unbox_boolean. restargs are now named. Use ll_AR_ARGC, ll_AR_ARGV to insure proper tracing and lookup. Use new error protocol. :lookup can now take . Removed :lookup-super. Use new %write-shallow-contents. Added "ll: " to trace message. Use current ll_ARGV[0] to determine rcvr type, not _ll_val_sp[0]. _ll_lookup_super(void) is now _ll_lookup_super(ll_v super). ll_DEBUG() is no longer a lval. Added assertion for ll_ARGC >= 0 in _ll_lookup(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/macro.c: Formatting. new properties format New stack probing. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Dont apply macro op if rcvr does not respond. Anything else is not macro-expanded. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. macro-expand1 is now macro-expand-1. Don't rewrite (set! ...) and (define ...) forms; the compiler understands them now. ll_UNBOX_BOOL is now ll_unbox_boolean. Minor changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Minor formatting. Do not attempt to lookup macro expander operations for non-symbol car. Properly handle zero-length arglists in :macro-expand1. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/map.c: Minor whitespace changes. New stack probing. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. restargs are now named. Watch out for stack motion side-effects. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_ARGC is side-effected within __ll_callv(). Majorly stupid fixes. Added apply and for-each. Reimplemented map according to RRALS5. Added support for mutable sequences. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/mem.c: New out-of-memory-error. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Redefine malloc, etc. to GC_malloc, maybe. added mem.c src/ll/meth.c: Minor whitespace changes. new properties format CHECKPOINT method alist is now properties Use properties-mixin. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Reimplemented method-minargc. minargc, maxargc are removed. _minargc and _maxargc are not boxed anymore. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/named.c: Formatting. Use binding locative not value for name lookup. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Use new #p syntax. New BOX -> make, UNBOX -> box function names. restargs are now named. Added support for and new objects. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/nil.c: Minor whitespace changes. Checkpoint before ION07 HD backup. new properties format CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Initialize %fluid-bindings to nil. New mutable list support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/num.c: new properties format negative? bug. CHECKPOINT New BOX -> make, UNBOX -> box function names. restargs are now named. Added exp, log, sin, cos, tan, asin, acos, atan operations. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c src/ll/number.c: new properties format Added max, min. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added magnitude. Faster *, + argument handling. Added gcd, lcm, read-part, imag-part, angle, =, <, >, <=, >= operators. Added +, -, * and / primitives (in conjection to the lexical optimizaitions in syntax.c). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: new properties format :make-immutable has no side-effect. New BOX -> make, UNBOX -> box function names. restargs are now named. New immutable-type/mutable-type protocol for equal? and cloning. Added :%get-tag method. Comment changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.c: Whitespace. new properties format Enabled -Wall. Initialize lcache and properties. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Write protect op globals. New version. Added locatable-operation support. Added :getter. New BOX -> make, UNBOX -> box function names. restargs are now named. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Preliminary locative-* op support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added ll_e() type defs. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ops.c: src/ll/port.c: new properties format; More file-open-error properties. Added call-with-input-file, call-with-output-file. Use standard port names. Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. Use _ll_ptr_string() where applicable. ll_g_set() is now ll_set_g(). Use new error protocol. Cast in and out of impl ivar. ll_BOX_PTR() obsolesed. Added :flush primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. is now so we get eof-object? for "free". Use stack allocated string for ll_write_string(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/posix.c: Added posix:chdir. New BOX -> make, UNBOX -> box function names. restargs are now named. Fixed (posix:exit) .vs. (posix:exit ). posix:exit can now take optional exit code. ll_BOX_PTR() obsolesed. Reformatting. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/prim.c: primitive alist is now properties. Added doc strings. new properties format; Added _ll_add_method validation. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types method alist is now properties Remove '%p:' from primitive name. Print primitive code if it is a symbol. Globals for primitives are no longer defined. minargc, maxargc are removed. restargs are now named. func, minargc, maxargc are now longer boxed values. ll_BOX_PTR() obsolesed. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Use standard port names. Comments. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added read macro support. restargs are now named. ll_UNBOX_CHAR is now ll_unbox_char. ll_BOX_CHAR is now ll_make_char. Use new error protocol. Added support for C string escape sequences. Added support for immutable cons, vector and string. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Disable internal debugging. Clean up of stack chaining and asserts. Fixed allocation for ptr chaining. Make default activation record stack frames bigger. New stack buffer protocol. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Preliminary stack-buffer support. Leave unreachable bootstrap elements on stacks. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: new properties format string:equal?, string-append!. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Only scan for 2 or 3 digits for numeric char escapes. BOX -> make, UNBOX -> unbox. Typecheck incoming char in string.c. Added and behaviors. :length is not boxed. array and length are no longer boxed. Added support for C string escape sequences. Added support for # digits. Added preliminary #e and #i specifier support. PUBLISH:ll0.2 :string->number: Bug in conversion of alpha digits to digit value. Check for fixnum overflow. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.c: Formatting. new properties format Added new ll:hashstats. New inits. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. _ll_make_symbol() now handles ll_f name properly. _ll_symbol_name typechecks now. ll_g_set() is now ll_set_g(). Escape EQ to =, not ==. :symbol->string: make name immutable. Added %gensym primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. 'P' escapes to '%', 'P' stands for Percent. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Use _ll_deftype_slot. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbols.c: src/ll/syntax.c: Minor whitespace changes. new properties format do special form debugging. CHECKPOINT Missing rparen in let* macro. Make ll_quote extern. Implemented locative transforms. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Implmented quasiquote. Added all basic syntax stuff from R5RS. Removed old set! and define rewrites. New BOX -> make, UNBOX -> box function names. restargs are now named. Reimplemented APPEND_BEGIN(), APPEND() macros. Added macros for let, let*, letrec, and, or. (-) is undefined. (define () ...) doesn't mean anything but (define (foo . bar) ...) does. Moved fluid macro to fluid.c. Implemented (make-locative ( . )) => ((locater ) . ). Added define-macro macro. Formatting. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/test.gdb: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/testold.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/toplevel.c: Minor whitespace changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. Use new readline protocol. Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.c: Fixed slot offset initialization method. Added missing write barriers. Doc strings. new properties format type:initialize can take options documention, has properties. CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Allow more type slot definitions. New BOX -> make, UNBOX -> box function names. restargs are now named. Initialize readline after other ports. Use immutable cons for critical type structures. Use new _ll_deftype* macros. PUBLISH:ll0.2 Be sure to init before . debug:init::type is now debug:init:type. Make type variables readonly after init. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.h: try again Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Prepare to swap type.h types.h. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added new properties-mixin. binding is now a properties-mixin. %ir is now a properties-mixin. method is now a properties-mixin. Reordered fluid-bindings slot in catch. binding now uses a locative to point to the value slot. Added locatable-operation support. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. Removed :minargc, maxargc. Added :top-wired? option. Added :default-exit-value slot. Added type. New _ll_deftype macros to support ll_e() error types. :tester for ? operations added.. :minargc, maxargc are no longer boxed. :length is now longer boxed. :kind removed. :ar added. added. added. ll_e() error types added. added. Make :argc an int to avoid repeated boxing and unboxing. Added and . is , is . is a . is now a . ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 is now . Added top-wired? decls. Added mutable sequence types. Added type for new environment impl. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . eventually inherits from . Minor comment changes. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/types.h: Comments. Comment changes. Other changes. CHECKPOINT try again Prepare to swap type.h types.h. New _ll_deftype macros to support ll_e() error types. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/undef.c: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/value.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. New value.h. src/ll/vec.c: new properties format Improper call supers; range checking. Fixed append. CHECKPOINT Added preliminary treadmill GC support. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Send %ptr and length messages in _ll_ptr_vec() if fast type check fails. Use new immutable-type protocol. :length is no longer boxed. Use new restartable-error protocol. Implement full type and range checks. ll_BOX_PTR() obsolesed. Use new initialize-clone protocol. PUBLISH:ll0.2 super implies ll_SELF. _ll_VEC_TERM != 0. Use "string-length" or "vector-length", not "length" in append. Added new and support. set-length! and append-one! should not take rest args. Checkpoint. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/vec.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/vector.c: Minor reformatting. new properties format CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. :length is no longer boxed. ll_BOX_PTR() obsolesed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/write.c: Whitespace. %write-shallow take optional op which is ignored. Use standard port names. Other changes. CHECKPOINT Disable recursion lock support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Remove '%p:' from primitive name. Print primitive code if it is a symbol. Escapes quote, quasiquote, unquote and unquote-splicing. _ll_write_string is now ll_write_string. restargs are now named. Added locative:%write-port, immedate:%write-shallow. :length is no longer boxed. Force flonum to be printed with .0 suffix. %writePort is now %write-port. %writeContents is now %write-shallow-contents. Added :%write-shallow. :%write and :%display call :%write-shallow. PUBLISH:ll0.2 Added %writePort method for . is now . Don't use ll_tail_call to force unspecified return value. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_9' to 'PUBLISH_ll0_10' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added voidP_voidP_*. Added rcs ids. src/hash/PKG: New PKG version. Use prime > 2 ^ n - 1 for resizing. Checkpoint from IONLAP1 src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: Added rcs ids. src/hash/charP_int_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. src/hash/charP_int_Table.h: src/hash/charP_voidP_Table.c: Added rcs ids. src/hash/charP_voidP_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. src/hash/charP_voidP_Table.h: src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: Added rcs ids. src/hash/hash.c: Use prime > 2 ^ n - 1 for resizing. Coerce hash value to unsigned int to avoid array index underflow. Added rcs ids. src/hash/hash.def: src/hash/hash.h: src/hash/hash_end.def: Use prime > 2 ^ n - 1 for resizing. Added rcs ids. src/hash/int_voidP_Table.c: src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: src/hash/test/Makefile: src/hash/test/test.c: Added rcs ids. src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added cadr.c, doc.c, sig.c. src/ll/PKG: New version. New version. src/ll/README: src/ll/TODO: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. src/ll/ar.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/bcompile.c: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Properly compile body defines. Elide if branches if test is a constant. src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: Added :binding-doc docstring support. src/ll/bmethod.c: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Use proper names for bmethod function. src/ll/bool.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/cadr.c: Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: Minor changes. src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: Fixed set-c[ad]r! functions. Implemented locative functions. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Fixed immutable-type problem. src/ll/constant.c: Added rcs ids. src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/debugger.c: print-frame: Print the previous frame's type and method. src/ll/defs.pl: src/ll/defs.sh: Added -s option to turn on source line tracking. src/ll/doc.c: Added doc.c. src/ll/env.c: New version. Preliminary stack-buffer support. Docstring support. src/ll/env.ll: src/ll/eq.c: equal? for number is eqv?. src/ll/error.c: New _ll_typecheck_error(). Fixed :%bad-typecheck method. src/ll/eval.c: Shortcut for eval on a constant. eval now takes an optional environment rest arg (ignored). Removed old evaluator code. src/ll/fixnum.c: Optimize typechecks. Fixed lcm. src/ll/floatcfg.c: Use epsilon not rand numbers to calc error. src/ll/flonum.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/fluid.c: ll_UNBOX_BOOL is now ll_unbox_boolean. Restarg are now named. src/ll/format.c: Disabled weak ptr read macro debugging. src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Globals for primitives are no longer defined. src/ll/init.c: Update ll_initialized, ll_initializing. src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Added lib/ll/test/test.scm. src/ll/lispread.c: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added read macro support (CALL_MACRO_CHAR(c)). src/ll/list.c: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added append, memq, memv, member, assq, assv, assoc. Added ll_consQ(). Added vector->list. src/ll/ll.h: Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. src/ll/llt.c: ll_init() now takes environment list. src/ll/llt.gdb: src/ll/load.c: ll_LOAD_ONE. Restored :load. src/ll/locative.c: Added locative-contents nop. ll_UNBOX_LOC is now ll_UNBOX_locative. src/ll/lookup.c: Added locatable-operation support. Added typecheck for op in lookup. Cleaned up dead code. src/ll/macro.c: Dont apply macro op if rcvr does not respond. Anything else is not macro-expanded. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. macro-expand1 is now macro-expand-1. Don't rewrite (set! ...) and (define ...) forms; the compiler understands them now. src/ll/map.c: restargs are now named. src/ll/mem.c: Redefine malloc, etc. to GC_malloc, maybe. src/ll/meth.c: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Reimplemented method-minargc. src/ll/named.c: Use new #p syntax. src/ll/nil.c: ll_g_set() is now ll_set_g(). src/ll/num.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/number.c: Added magnitude. src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/object.c: :make-immutable has no side-effect. src/ll/op.c: New version. Added locatable-operation support. Added :getter. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Added ll_e() type defs. src/ll/ops.c: src/ll/port.c: src/ll/posix.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/prim.c: Remove '%p:' from primitive name. Print primitive code if it is a symbol. src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Added read macro support. restargs are now named. ll_UNBOX_CHAR is now ll_unbox_char. ll_BOX_CHAR is now ll_make_char. src/ll/readline.c: Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. src/ll/sig.c: src/ll/sig.h: Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Preliminary stack-buffer support. Leave unreachable bootstrap elements on stacks. src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: Only scan for 2 or 3 digits for numeric char escapes. src/ll/symbol.c: _ll_make_symbol() now handles ll_f name properly. src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: Use _ll_deftype_slot. src/ll/symbols.c: src/ll/syntax.c: Implemented locative transforms. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Implmented quasiquote. Added all basic syntax stuff from R5RS. Removed old set! and define rewrites. src/ll/test.gdb: Added rcs ids. src/ll/testold.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/toplevel.c: src/ll/trace.c: Minor changes. src/ll/type.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/type.h: Added locatable-operation support. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. src/ll/types.h: New _ll_deftype macros to support ll_e() error types. src/ll/undef.c: ll_g_set() is now ll_set_g(). src/ll/value.h: Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/vec.c: Fixed immutable-type problem. src/ll/vec.h: Added rcs ids. src/ll/vector.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/write.c: Disable recursion lock support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Remove '%p:' from primitive name. Print primitive code if it is a symbol. src/maks/PKG: Initial check in of D:\data\ion\src src/maks/basic.mak: Added rcs ids. src/maks/bin/mak: Initial check in of D:\data\ion\src src/maks/bin/mak.bat: src/maks/fixpound.pl: src/maks/lib.mak: src/maks/opengl/Makefile: src/maks/opengl/Makefile.use: Added rcs ids. src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: src/maks/tool.mak: src/maks/tools.mak: src/maks/use.mak: src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. src/util/ConfigInfo.c: Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. src/util/Makefile.use: Added rcs ids. src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: src/util/enum.h: Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. src/util/mem.h: Changes from AM. New versions. Added rcs ids. src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. src/util/path.h: Added rcs ids. src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Added new files. src/util/sigs.pl: Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_8' to 'PUBLISH_ll0_9' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added rcs ids. src/hash/PKG: Checkpoint from IONLAP1 src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: src/hash/charP_int_Table.def: src/hash/charP_int_Table.h: src/hash/charP_voidP_Table.c: src/hash/charP_voidP_Table.def: src/hash/charP_voidP_Table.h: src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: src/hash/hash.c: src/hash/hash.def: src/hash/hash.h: src/hash/hash_end.def: src/hash/int_voidP_Table.c: src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: src/hash/test/Makefile: src/hash/test/test.c: Added rcs ids. src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Added cadr.c, doc.c, sig.c. src/ll/PKG: New version. New version. src/ll/README: More documentation. src/ll/TODO: src/ll/ar.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/bcompile.c: Properly compile body defines. Elide if branches if test is a constant. src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: Added :binding-doc docstring support. src/ll/bmethod.c: Use proper names for bmethod function. src/ll/bool.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/cadr.c: src/ll/cadr.h: Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: Minor changes. src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: Fixed immutable-type problem. src/ll/constant.c: Added rcs ids. src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/debugger.c: print-frame: Print the previous frame's type and method. src/ll/defs.pl: src/ll/defs.sh: Added -s option to turn on source line tracking. src/ll/doc.c: Added doc.c. src/ll/env.c: Docstring support. src/ll/env.ll: src/ll/eq.c: equal? for number is eqv?. src/ll/error.c: New _ll_typecheck_error(). Fixed :%bad-typecheck method. arg-count-recoverable-error, not arg-count-error-recoverable-error, etc. src/ll/eval.c: Shortcut for eval on a constant. eval now takes an optional environment rest arg (ignored). Removed old evaluator code. src/ll/fixnum.c: Fixed lcm. src/ll/floatcfg.c: Use epsilon not rand numbers to calc error. src/ll/flonum.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/fluid.c: ll_UNBOX_BOOL is now ll_unbox_boolean. Restarg are now named. src/ll/format.c: Disabled weak ptr read macro debugging. src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Globals for primitives are no longer defined. src/ll/init.c: Update ll_initialized, ll_initializing. ll_init() now takes environment list. src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Added lib/ll/test/test.scm. src/ll/lispread.c: Added read macro support (CALL_MACRO_CHAR(c)). src/ll/list.c: Added append, memq, memv, member, assq, assv, assoc. Added ll_consQ(). Added vector->list. src/ll/ll.h: Added more documentation. Preliminary envoke debugger at frame return. OP in ll_call*() is no longer affected by side effects to the activation record pointer. Added ll_consQ(). ll_init() now take environment list. Globals for primitives are no longer defined. src/ll/llt.c: ll_init() now takes environment list. src/ll/llt.gdb: src/ll/load.c: ll_LOAD_ONE. Restored :load. src/ll/locative.c: ll_UNBOX_LOC is now ll_UNBOX_locative. src/ll/lookup.c: Added typecheck for op in lookup. Cleaned up dead code. Added async signal polling. src/ll/macro.c: macro-expand1 is now macro-expand-1. Don't rewrite (set! ...) and (define ...) forms; the compiler understands them now. src/ll/map.c: restargs are now named. src/ll/mem.c: Redefine malloc, etc. to GC_malloc, maybe. src/ll/meth.c: Reimplemented method-minargc. src/ll/named.c: Use new #p syntax. src/ll/nil.c: ll_g_set() is now ll_set_g(). src/ll/num.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/number.c: Added magnitude. src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/object.c: :make-immutable has no side-effect. src/ll/op.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Added ll_e() type defs. src/ll/ops.c: src/ll/port.c: src/ll/posix.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/prim.c: Remove '%p:' from primitive name. Print primitive code if it is a symbol. Globals for primitives are no longer defined. src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Added read macro support. restargs are now named. ll_UNBOX_CHAR is now ll_unbox_char. ll_BOX_CHAR is now ll_make_char. src/ll/readline.c: Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. src/ll/sig.c: src/ll/sig.h: Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Leave unreachable bootstrap elements on stacks. src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: Only scan for 2 or 3 digits for numeric char escapes. src/ll/symbol.c: _ll_make_symbol() now handles ll_f name properly. src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: Use _ll_deftype_slot. src/ll/symbols.c: src/ll/syntax.c: Implmented quasiquote. Added all basic syntax stuff from R5RS. Removed old set! and define rewrites. src/ll/test.gdb: Added rcs ids. src/ll/testold.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/toplevel.c: src/ll/trace.c: Minor changes. src/ll/type.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/type.h: Added more documentation. Preliminary envoke debugger at frame return. Removed :minargc, maxargc. Added :top-wired? option. Added :default-exit-value slot. src/ll/types.h: New _ll_deftype macros to support ll_e() error types. src/ll/undef.c: ll_g_set() is now ll_set_g(). src/ll/value.h: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/vec.c: Fixed immutable-type problem. src/ll/vec.h: Added rcs ids. src/ll/vector.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/write.c: Remove '%p:' from primitive name. Print primitive code if it is a symbol. Escapes quote, quasiquote, unquote and unquote-splicing. src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: src/util/ConfigInfo.h: Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Added new files. src/util/Makefile.use: Added rcs ids. src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: src/util/enum.h: Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: src/util/mem.h: Added rcs ids. src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: src/util/path.h: Added rcs ids. src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: src/util/sig.c: src/util/sig.h: src/util/sigs.pl: Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_7' to 'PUBLISH_ll0_8' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added rcs ids. src/hash/PKG: Checkpoint from IONLAP1 src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: src/hash/charP_int_Table.def: src/hash/charP_int_Table.h: src/hash/charP_voidP_Table.c: src/hash/charP_voidP_Table.def: src/hash/charP_voidP_Table.h: src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: src/hash/hash.c: src/hash/hash.def: src/hash/hash.h: src/hash/hash_end.def: src/hash/int_voidP_Table.c: src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: src/hash/test/Makefile: src/hash/test/test.c: Added rcs ids. src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Added cadr.c, doc.c, sig.c. Added doc.c. src/ll/PKG: New version. Fixed 0,6. New version id. src/ll/README: More documentation. Added README src/ll/TODO: src/ll/ar.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/bcompile.c: Properly compile body defines. Elide if branches if test is a constant. Renamed macros to not conflict with formals. src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: Added :binding-doc docstring support. src/ll/bmethod.c: Use proper names for bmethod function. rtn instruction uses ll_return(x) to properly unwind stack. Added :%dump for code gen debugging. Initialize formals, alist with something tractable. _ll_make_method* should make , not . src/ll/bool.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/constant.c: Added rcs ids. src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/debugger.c: print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. src/ll/defs.pl: src/ll/defs.sh: Added -s option to turn on source line tracking. src/ll/doc.c: Added doc.c. src/ll/env.c: Docstring support. src/ll/env.ll: src/ll/eq.c: equal? for number is eqv?. Added ll_eqvQ. src/ll/error.c: arg-count-recoverable-error, not arg-count-error-recoverable-error, etc. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/eval.c: Shortcut for eval on a constant. eval now takes an optional environment rest arg (ignored). Removed old evaluator code. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/fixnum.c: Fixed lcm. src/ll/floatcfg.c: Use epsilon not rand numbers to calc error. src/ll/flonum.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/fluid.c: ll_UNBOX_BOOL is now ll_unbox_boolean. Restarg are now named. src/ll/format.c: Disabled weak ptr read macro debugging. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Added ~N (named object) format. format is now ll:format. Added #p, #l weak ptr read macros. src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Globals for primitives are no longer defined. ll_g_set() is now ll_set_g(). src/ll/init.c: ll_init() now takes environment list. Added rcs ids. src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Added lib/ll/test/test.scm. src/ll/lispread.c: Added read macro support (CALL_MACRO_CHAR(c)). src/ll/list.c: Added append, memq, memv, member, assq, assv, assoc. Added ll_consQ(). Added vector->list. ll_BOX_INT is now ll_make_fixnum. Restargs are now named. src/ll/ll.h: OP in ll_call*() is no longer affected by side effects to the activation record pointer. Added ll_consQ(). ll_init() now take environment list. Globals for primitives are no longer defined. ll_BOX_REF is now ll_make_ref. _nocheck_func removed. _minargc, _maxargc removed. Restargs are now named. ll_{BOX,UNBOX}_BOOL is now ll_{make,unbox}_boolean. ll_{BOX,UNBOX}_CHAR is now ll_{make,unbox}_char. src/ll/llt.c: ll_init() now takes environment list. *read-eval-print-loop* is now ll:top-level src/ll/llt.gdb: src/ll/load.c: ll_LOAD_ONE. Restored :load. src/ll/locative.c: ll_UNBOX_LOC is now ll_UNBOX_locative. src/ll/lookup.c: Added async signal polling. ll_UNBOX_BOOL is now ll_unbox_boolean. restargs are now named. src/ll/macro.c: macro-expand1 is now macro-expand-1. Don't rewrite (set! ...) and (define ...) forms; the compiler understands them now. ll_UNBOX_BOOL is now ll_unbox_boolean. src/ll/map.c: restargs are now named. src/ll/mem.c: Redefine malloc, etc. to GC_malloc, maybe. added mem.c src/ll/meth.c: Reimplemented method-minargc. minargc, maxargc are removed. src/ll/named.c: Use new #p syntax. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/nil.c: ll_g_set() is now ll_set_g(). src/ll/num.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/number.c: Added magnitude. Faster *, + argument handling. src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/object.c: :make-immutable has no side-effect. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/op.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Added ll_e() type defs. src/ll/ops.c: src/ll/port.c: src/ll/posix.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/prim.c: Globals for primitives are no longer defined. minargc, maxargc are removed. restargs are now named. src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Added read macro support. restargs are now named. ll_UNBOX_CHAR is now ll_unbox_char. ll_BOX_CHAR is now ll_make_char. src/ll/readline.c: Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Leave unreachable bootstrap elements on stacks. src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: Only scan for 2 or 3 digits for numeric char escapes. BOX -> make, UNBOX -> unbox. src/ll/symbol.c: _ll_make_symbol() now handles ll_f name properly. _ll_symbol_name typechecks now. src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: Use _ll_deftype_slot. src/ll/symbols.c: src/ll/syntax.c: Implmented quasiquote. Added all basic syntax stuff from R5RS. Removed old set! and define rewrites. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/test.gdb: Added rcs ids. src/ll/testold.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/toplevel.c: Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. src/ll/trace.c: Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/type.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/type.h: Removed :minargc, maxargc. Added :top-wired? option. Added :default-exit-value slot. src/ll/types.h: New _ll_deftype macros to support ll_e() error types. src/ll/undef.c: ll_g_set() is now ll_set_g(). src/ll/value.h: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/vec.c: Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/vec.h: Added rcs ids. src/ll/vector.c: New BOX -> make, UNBOX -> box function names. restargs are now named. src/ll/write.c: Escapes quote, quasiquote, unquote and unquote-splicing. _ll_write_string is now ll_write_string. restargs are now named. src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_6' to 'PUBLISH_ll0_7' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added voidP_voidP_*. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/PKG: New PKG version. Use prime > 2 ^ n - 1 for resizing. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: Added rcs ids. Checkpoint from IONLAP1 src/hash/hash.c: New rehash mechanism. Added lookup cache support. Added write barrier support. Use prime > 2 ^ n - 1 for resizing. Coerce hash value to unsigned int to avoid array index underflow. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/hash.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Checkpoint from IONLAP1 Initial revision Initial check in of D:\data\ion\src src/hash/hash.h: Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/hash_end.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/test/Makefile: src/hash/test/test.c: Added lookup cache support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Dont use GC by default, for testing. Checkpoint. Need curses for readline. Make sure tools get built too. Enabled -Wall. Explicitly make gc.a. Added new ll:hashstats. Added lcache.c. New inits. Automagically define CONFIG_H_VARS. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Make sure ../util/signals.h gets made. Added props.c. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added cadr.c, doc.c, sig.c. Added doc.c. Added readline.c. Added objdump.c: ll:obj-dump operation. Enumerate PRODUCTS. clean: rm $(PRODUCTS). Do not compile lookup.c with debugging. Added toplevel.c. Added debug target. Added debugger.c Added errors.h ar.h and H_FILES. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c Make all O_FILES dependent on Makefile. Don't bother scanning anything except bmethod.c for ll_bc defs. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added binding.c. Add makefile targets for $(GC_LIB) Added locative.c. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/PKG: New revision. No longer requires gc_boehm. v0.12 New version. New version. New version. New version. Fixed 0,6. New version id. Added GNU readline support. Needs gnumake. New version. Bump release number: new debugger. Added CHANGES_RELEASES. PUBLISH:ll0.3 Bump version number; major fixes and features. Integrated Boehm GC. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: New version. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. no message should be . Checkpoint. More TODO. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Misc changes. Fixed stupid errors. src/ll/ar.c: No side-effect methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. Remove quotes from write. no message Added ar.c. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: new BC stack nargs attribute. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.c: Emit slot names, not ir slot bindings; closed over vars are always in exports vector; do not emit code for magic operators. Disable internal debugging. Better checking and debugging. Added blank lines between methods. new properties format; Added ll_assert_ref()s. Changes from ion03 New stack probing. Added props, debug expr, doc string, non-tail body constant opt. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use properties-mixin. Use new global binding protocol to support readonly globals. Added const-folding support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Properly compile body defines. Elide if branches if test is a constant. Renamed macros to not conflict with formals. New error system. ll_BOX_PTR() obolesed. Do not close-over globals. Use new %write-shallow-contents. (super . ) is now (super . ) Removed debugging code in :%ir-compile2-body. Fixed (if ...) compilation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. <%ir>:initialize now defaults parent and car-pos? arguments to #f if not specified. Only car-pos lambda share code vectors. All nested lambda share const and global vectors. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Major fixes: Do not generate code to construct unreferenced rest args. Properly inline car-position lambda. Properly handle make-locative to car-position lambda formals. Do not allocate space for unreferenced car-position lambdas formals. Checkpoint. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: new properties format Docs are accessed by properties-mixin, by default. Added preliminary treadmill GC support. binding uses properties-mixin. Added :binding-doc docstring support. Use new %write-shallow-contents. super implies ll_SELF! Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. src/ll/bmethod.c: Handle slot op arguments; rewrite slot as slot_ op. Whitespace. Formatting. new properties format Changes from ion03 Added more bc meter support. New stack probing, bytecode metering, dissassembler. new BC stack nargs attrib, prompt, run and dump printing, bytecode metering, debug expr, method properties. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Compute stack motion for a byte-code string. Use new global binding protocol to support readonly globals. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Use proper names for bmethod function. rtn instruction uses ll_return(x) to properly unwind stack. Added :%dump for code gen debugging. Initialize formals, alist with something tractable. _ll_make_method* should make , not . New error system. Avoid compile warnings on _ll_val_sp volatility. Avoid stack pointer side-effects. Fixed super calls. _ll_pfx_* is now _ll_pf_*. PUBLISH:ll0.2 Proper tail and super call implementation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. glo(X) instruction is rewritten to glo_(Y) where; X is the index into the const vector for the global name (symbol), Y is the locative to the global's binding value. Added byte-codes for: 1. argument count checking. 2. rest arg list construction. 3. car-positon lambda rest arg list construction. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bool.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). Added not primitive. ll_g() is no longer an lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: Added blank lines between methods. Changes from ion03 New stack buffers. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). New error system. Catch application can now take 0 or 1 args. PUBLISH:ll0.2 argc must be 3 for caught body. ll_g() is no longer an lval. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Unwind fluid bindings. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: new properties format Proper ll_unboc_char, char=? methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. New error system. Restart method after type and range check for integer->char. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: new properties format Other changes. Added preliminary treadmill GC support. locative-car/cdr is has no side-effect Fixed set-c[ad]r! functions. Implemented locative functions. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Use new immutable-type/mutable-type cloning protocol. PUBLISH:ll0.2 Don't bother calling (super initialize). Distinguish and . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/constant.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Added blank lines between methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Formatting changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/debugger.c: Put type and method on newline for print-frame; Dont bother printing db_at_rtn. Formatting. new properties format cleaned up debugger init. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. New functionality in debugger! Major changes to debugger. Added debugger.c src/ll/defs.pl: Added support for multi-line macros and string constants. Added -s option to turn on source line tracking. Initial revision Initial check in of D:\data\ion\src src/ll/defs.sh: Other changes. CHECKPOINT Added -s option to turn on source line tracking. Check for cpp errors. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: Minor whitespace changes. new properties format Added new ll:hashstats. Use global ll_v vars for all ll_g bindings. Docs are accessed by properties-mixin, by default. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use new binding value locative and properties-mixin. New version. Preliminary stack-buffer support. Docstring support. ll_g_set() is now ll_set_g(). ll_BOX_PTR() obolesed. Restart binding errors. ll_g() is no longer an lval. super implies ll_SELF. %macro: return #f if no binding is found. Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/env.ll: src/ll/eq.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. equal? for number is eqv?. Added ll_eqvQ. equal?: Allow immutable and mutable objects to be type compared by using imutable-type messages. Added eqv? primitive. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/error.c: Fixed error object initialize method. new properties format; ll_abort(); show caller in arg-count error. Other changes. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Clean up _ll_range_error(). New _ll_typecheck_error(). Fixed :%bad-typecheck method. arg-count-recoverable-error, not arg-count-error-recoverable-error, etc. New BOX -> make, UNBOX -> box function names. restargs are now named. :values are now (key . value), not (key value). Added :error-get-value. ll_g_set() is now ll_set_g(). Added return-action value strings for common errors. :initialize no longer has a 'kind' ivar. Bug in values list consing. Added :error-ar, :error-values methods. Added :handle-error, :handle-error: (fluid-let (((fluid current-error) self)), then call (debugger self). :handle-error dumps stack traces and aborts. Moved backtrace code to debugger.c. Fixed common error generation functions to use new protocol. :initialize can now take rest args as key-value pairs for values ivar init. Use new %write-shallow-contents. :handle-error now calls (%print-backtrace-and-escape self). :%default-error-handler deleted. _ll_error creates args value from ll_ARGV, not _ll_val_sp. _ll_error doesn't check for any error handler, just calls (handle-error ). Fatal errors will attempt to print op and last method implementor type. :%print-backtrace-and-escape: prints error and ar backtrace then applies (%top-level-restart). _ll_argc_count_error(), _ll_range_error(), and _ll_undefined_variable_error() returns from _ll_error() %default-error-handler deleted; unused. Initialize %top-level-restart to #f. ll_g() is no longer an lval. super implies ll_SELF. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/eval.c: Checkpoint before ION07 HD backup. CHECKPOINT Added eval-no-const-fold. Shortcut for eval on a constant. eval now takes an optional environment rest arg (ignored). Removed old evaluator code. New BOX -> make, UNBOX -> box function names. restargs are now named. Added errors.h, floatcfg.h __ll_tail_callv is now _ll_tail_callv. eval-list debug support. Use new shorter form for basic <%ir> creation. Added eval-list primitive. Cleaned up. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/fixnum.c: new properties format Enabled -Wall. Added bitwise ops. fixnum:number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Optimize typechecks. Fixed lcm. Preliminary lcm code. Fixed modulo. Added odd?, even?, quotent, remainder, modulo, %gcd, %lcm, numerator, denominator, floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. PUBLISH:ll0.2 Comment change. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/floatcfg.c: CHECKPOINT Use epsilon not rand numbers to calc error. Don't bother with all of ll.h, use value.h. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/flonum.c: new properties format Enabled -Wall. number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/fluid.c: new properties format more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. ll_UNBOX_BOOL is now ll_unbox_boolean. Restarg are now named. ll_g_set() is now ll_set_g(). bind-%fluid will create top-level bindings after (fluid %top-level-fluid-bindings) if a previous binding is not found and value is specified. Added _ll_init_fluid_1() and _ll_init_fluid_2(). fluid binding objects are ( ), not ( . ). %fluid-bind returns old binding. (%fluid-binding ) will create a top-level fluid binding if one doesn't exist. (%fluid ) and (set-%fluid! ) will recover from . (define-%fluid ) will attempt to create a top-level fluid binding id one doesn't exist rather than do a (%fluid-bind). ll_g() is no longer a lval. %set-fluid! is now set-%fluid! to force fluid to be a . Move fluid and define-fluid macros from syntax.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/format.c: use current-output-port, not *current-output-port*; dont assume args are on stack, use va_list. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Disabled weak ptr read macro debugging. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Added ~N (named object) format. format is now ll:format. Added #p, #l weak ptr read macros. Added ~W (weak ptr) and ~L (locative) format specifiers. Disable trace in format. Use new error protocol. ll_BOX_PTR() obsolesed. Don't disable call tracing. Fixed too-many-formats error function. Added '~F' format to flush the port. Added bad-format-char error for unrecognized formats. Use %write-shallow for ~O format. ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Globals for primitives are no longer defined. ll_g_set() is now ll_set_g(). Scan ll_g_set() too. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.c: use save argv and env from main(). CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Update ll_initialized, ll_initializing. ll_init() now takes environment list. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Checkpoint. Other changes. Added lib/ll/test/test.scm. src/ll/lispread.c: Handle #\space, #\newline. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added read macro support (CALL_MACRO_CHAR(c)). Support #e and #i number modifiers. '^' is a valid symbol character. PUBLISH:ll0.2 "=" not "=="! Added support for immutable cons, vector and string. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. no message Initial revision Initial check in of D:\data\ion\src src/ll/list.c: new properties format Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added append, memq, memv, member, assq, assv, assoc. Added ll_consQ(). Added vector->list. ll_BOX_INT is now ll_make_fixnum. Restargs are now named. Added support for . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ll.h: Checkpoint before ION07 HD backup. Dont use GC by default, for testing. Formatting. Use global ll_v vars for all ll_g bindings. Broke out to prim.h. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Added new ll_VECTOR_LOOP_REF_FROM macro. _ll_range_error() and _ll_rangecheck() typedefs. Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. OP in ll_call*() is no longer affected by side effects to the activation record pointer. Added ll_consQ(). ll_init() now take environment list. Globals for primitives are no longer defined. ll_BOX_REF is now ll_make_ref. _nocheck_func removed. _minargc, _maxargc removed. Restargs are now named. ll_{BOX,UNBOX}_BOOL is now ll_{make,unbox}_boolean. ll_{BOX,UNBOX}_CHAR is now ll_{make,unbox}_char. Be sure to pick up ll_set_g() globals during defs.sh. ll_g_set() is now ll_set_g(). Added ll_eqQ(), ll_eqvQ(). Do not clear out activation records after pop, it screws up the debugger. Move basic ll_v definitions to value.h. Added new ll_e() error type reference macros. ll_BOX_PTR() obsolesed. Added new fluid binding function decls. Removed ll_CATCH_ERROR macros. ll_BOX_INT() casts to long before boxing. Make :argc an int to avoid repeated boxing and unboxing. Reorganize code. Elaborate more comments. Reference method's application function by meth->_func, not ll_SLOT(meth)[0]. Set ar's type to , not the undefined object value, after pop. Don't put super's search context on the stack; pass it directly to _ll_lookup_super(). Avoid side-effects in call primitive macros. _ll_pfx_* is now _ll_pf_*. Argument count errors can be returned from. Range errors can be returned from. ll_CATCH_ERROR uses %top-level-restart instead of %current-error-handler. Fixed most of the call primitive macros. ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Shorten macro operation symbol names. Define () as nil, not %%nil, it will be readonly soon enough. ll_THIS can now reference supertype ivars through super_. Global values are implemented using objects; see env.c, binding.c. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Intergrated Boehm GC. Minor comment changes. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.c: ll_init() now takes environment list. *read-eval-print-loop* is now ll:top-level Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.gdb: Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. no message Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/load.c: Path searching for load. Other changes. ll_LOAD_ONE. Restored :load. Move top-level code to toplevel.c. Optionally eval load expressions one at a time. *read-eval-print-loop*: Use ports for prompting. Don't print thrown error objects. load: Don't catch any errors. Don't disable call tracing. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. :load now reads entire file as a list of exprs and then compiles them all at once. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/locative.c: new properties format CHECKPOINT Added preliminary treadmill GC support. Added locative-contents nop. ll_UNBOX_LOC is now ll_UNBOX_locative. Added primitive accessor methods for . src/ll/lookup.c: Service signals before initializing any variables. Added __ll_lookup(). Bigger possible argument vectors. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added _ll_method_not_found_error. Added locatable-operation support. Added typecheck for op in lookup. Cleaned up dead code. Added async signal polling. ll_UNBOX_BOOL is now ll_unbox_boolean. restargs are now named. Use ll_AR_ARGC, ll_AR_ARGV to insure proper tracing and lookup. Use new error protocol. :lookup can now take . Removed :lookup-super. Use new %write-shallow-contents. Added "ll: " to trace message. Use current ll_ARGV[0] to determine rcvr type, not _ll_val_sp[0]. _ll_lookup_super(void) is now _ll_lookup_super(ll_v super). ll_DEBUG() is no longer a lval. Added assertion for ll_ARGC >= 0 in _ll_lookup(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/macro.c: Formatting. new properties format New stack probing. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Dont apply macro op if rcvr does not respond. Anything else is not macro-expanded. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. macro-expand1 is now macro-expand-1. Don't rewrite (set! ...) and (define ...) forms; the compiler understands them now. ll_UNBOX_BOOL is now ll_unbox_boolean. Minor changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Minor formatting. Do not attempt to lookup macro expander operations for non-symbol car. Properly handle zero-length arglists in :macro-expand1. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/map.c: Minor whitespace changes. New stack probing. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. restargs are now named. Watch out for stack motion side-effects. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_ARGC is side-effected within __ll_callv(). Majorly stupid fixes. Added apply and for-each. Reimplemented map according to RRALS5. Added support for mutable sequences. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/mem.c: New out-of-memory-error. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Redefine malloc, etc. to GC_malloc, maybe. added mem.c src/ll/meth.c: Minor whitespace changes. new properties format CHECKPOINT method alist is now properties Use properties-mixin. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Reimplemented method-minargc. minargc, maxargc are removed. _minargc and _maxargc are not boxed anymore. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/named.c: Formatting. Use binding locative not value for name lookup. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Use new #p syntax. New BOX -> make, UNBOX -> box function names. restargs are now named. Added support for and new objects. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/nil.c: Minor whitespace changes. Checkpoint before ION07 HD backup. new properties format CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Initialize %fluid-bindings to nil. New mutable list support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/num.c: new properties format negative? bug. CHECKPOINT New BOX -> make, UNBOX -> box function names. restargs are now named. Added exp, log, sin, cos, tan, asin, acos, atan operations. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c src/ll/number.c: new properties format Added max, min. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added magnitude. Faster *, + argument handling. Added gcd, lcm, read-part, imag-part, angle, =, <, >, <=, >= operators. Added +, -, * and / primitives (in conjection to the lexical optimizaitions in syntax.c). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: new properties format :make-immutable has no side-effect. New BOX -> make, UNBOX -> box function names. restargs are now named. New immutable-type/mutable-type protocol for equal? and cloning. Added :%get-tag method. Comment changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.c: Whitespace. new properties format Enabled -Wall. Initialize lcache and properties. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Write protect op globals. New version. Added locatable-operation support. Added :getter. New BOX -> make, UNBOX -> box function names. restargs are now named. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Preliminary locative-* op support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added ll_e() type defs. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ops.c: src/ll/port.c: new properties format; More file-open-error properties. Added call-with-input-file, call-with-output-file. Use standard port names. Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. Use _ll_ptr_string() where applicable. ll_g_set() is now ll_set_g(). Use new error protocol. Cast in and out of impl ivar. ll_BOX_PTR() obsolesed. Added :flush primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. is now so we get eof-object? for "free". Use stack allocated string for ll_write_string(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/posix.c: Added posix:chdir. New BOX -> make, UNBOX -> box function names. restargs are now named. Fixed (posix:exit) .vs. (posix:exit ). posix:exit can now take optional exit code. ll_BOX_PTR() obsolesed. Reformatting. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/prim.c: primitive alist is now properties. Added doc strings. new properties format; Added _ll_add_method validation. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types method alist is now properties Remove '%p:' from primitive name. Print primitive code if it is a symbol. Globals for primitives are no longer defined. minargc, maxargc are removed. restargs are now named. func, minargc, maxargc are now longer boxed values. ll_BOX_PTR() obsolesed. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Use standard port names. Comments. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added read macro support. restargs are now named. ll_UNBOX_CHAR is now ll_unbox_char. ll_BOX_CHAR is now ll_make_char. Use new error protocol. Added support for C string escape sequences. Added support for immutable cons, vector and string. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Disable internal debugging. Clean up of stack chaining and asserts. Fixed allocation for ptr chaining. Make default activation record stack frames bigger. New stack buffer protocol. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Preliminary stack-buffer support. Leave unreachable bootstrap elements on stacks. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: new properties format string:equal?, string-append!. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Only scan for 2 or 3 digits for numeric char escapes. BOX -> make, UNBOX -> unbox. Typecheck incoming char in string.c. Added and behaviors. :length is not boxed. array and length are no longer boxed. Added support for C string escape sequences. Added support for # digits. Added preliminary #e and #i specifier support. PUBLISH:ll0.2 :string->number: Bug in conversion of alpha digits to digit value. Check for fixnum overflow. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.c: Formatting. new properties format Added new ll:hashstats. New inits. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. _ll_make_symbol() now handles ll_f name properly. _ll_symbol_name typechecks now. ll_g_set() is now ll_set_g(). Escape EQ to =, not ==. :symbol->string: make name immutable. Added %gensym primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. 'P' escapes to '%', 'P' stands for Percent. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Use _ll_deftype_slot. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbols.c: src/ll/syntax.c: Minor whitespace changes. new properties format do special form debugging. CHECKPOINT Missing rparen in let* macro. Make ll_quote extern. Implemented locative transforms. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Implmented quasiquote. Added all basic syntax stuff from R5RS. Removed old set! and define rewrites. New BOX -> make, UNBOX -> box function names. restargs are now named. Reimplemented APPEND_BEGIN(), APPEND() macros. Added macros for let, let*, letrec, and, or. (-) is undefined. (define () ...) doesn't mean anything but (define (foo . bar) ...) does. Moved fluid macro to fluid.c. Implemented (make-locative ( . )) => ((locater ) . ). Added define-macro macro. Formatting. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/test.gdb: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/testold.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/toplevel.c: Minor whitespace changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. Use new readline protocol. Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.c: Fixed slot offset initialization method. Added missing write barriers. Doc strings. new properties format type:initialize can take options documention, has properties. CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Allow more type slot definitions. New BOX -> make, UNBOX -> box function names. restargs are now named. Initialize readline after other ports. Use immutable cons for critical type structures. Use new _ll_deftype* macros. PUBLISH:ll0.2 Be sure to init before . debug:init::type is now debug:init:type. Make type variables readonly after init. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.h: try again Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Prepare to swap type.h types.h. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added new properties-mixin. binding is now a properties-mixin. %ir is now a properties-mixin. method is now a properties-mixin. Reordered fluid-bindings slot in catch. binding now uses a locative to point to the value slot. Added locatable-operation support. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. Removed :minargc, maxargc. Added :top-wired? option. Added :default-exit-value slot. Added type. New _ll_deftype macros to support ll_e() error types. :tester for ? operations added.. :minargc, maxargc are no longer boxed. :length is now longer boxed. :kind removed. :ar added. added. added. ll_e() error types added. added. Make :argc an int to avoid repeated boxing and unboxing. Added and . is , is . is a . is now a . ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 is now . Added top-wired? decls. Added mutable sequence types. Added type for new environment impl. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . eventually inherits from . Minor comment changes. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/types.h: Comments. Comment changes. Other changes. CHECKPOINT try again Prepare to swap type.h types.h. New _ll_deftype macros to support ll_e() error types. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/undef.c: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/value.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. New value.h. src/ll/vec.c: new properties format Improper call supers; range checking. Fixed append. CHECKPOINT Added preliminary treadmill GC support. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Send %ptr and length messages in _ll_ptr_vec() if fast type check fails. Use new immutable-type protocol. :length is no longer boxed. Use new restartable-error protocol. Implement full type and range checks. ll_BOX_PTR() obsolesed. Use new initialize-clone protocol. PUBLISH:ll0.2 super implies ll_SELF. _ll_VEC_TERM != 0. Use "string-length" or "vector-length", not "length" in append. Added new and support. set-length! and append-one! should not take rest args. Checkpoint. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/vec.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/vector.c: Minor reformatting. new properties format CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. :length is no longer boxed. ll_BOX_PTR() obsolesed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/write.c: Whitespace. %write-shallow take optional op which is ignored. Use standard port names. Other changes. CHECKPOINT Disable recursion lock support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Remove '%p:' from primitive name. Print primitive code if it is a symbol. Escapes quote, quasiquote, unquote and unquote-splicing. _ll_write_string is now ll_write_string. restargs are now named. Added locative:%write-port, immedate:%write-shallow. :length is no longer boxed. Force flonum to be printed with .0 suffix. %writePort is now %write-port. %writeContents is now %write-shallow-contents. Added :%write-shallow. :%write and :%display call :%write-shallow. PUBLISH:ll0.2 Added %writePort method for . is now . Don't use ll_tail_call to force unspecified return value. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_5' to 'PUBLISH_ll0_6' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added voidP_voidP_*. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/PKG: New PKG version. Use prime > 2 ^ n - 1 for resizing. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_int_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.def: Use HASH_MALLOC, HASH_FREE. Compare first key char before calling strcmp for speed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/charP_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: Added rcs ids. Checkpoint from IONLAP1 src/hash/hash.c: New rehash mechanism. Added lookup cache support. Added write barrier support. Use prime > 2 ^ n - 1 for resizing. Coerce hash value to unsigned int to avoid array index underflow. Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision Initial check in of D:\data\ion\src src/hash/hash.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Checkpoint from IONLAP1 Initial revision Initial check in of D:\data\ion\src src/hash/hash.h: Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/hash_end.def: New rehash mechanism. Added lookup cache support. Use prime > 2 ^ n - 1 for resizing. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.c: New rehash mechanism. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/test/Makefile: src/hash/test/test.c: Added lookup cache support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Dont use GC by default, for testing. Checkpoint. Need curses for readline. Make sure tools get built too. Enabled -Wall. Explicitly make gc.a. Added new ll:hashstats. Added lcache.c. New inits. Automagically define CONFIG_H_VARS. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Make sure ../util/signals.h gets made. Added props.c. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added cadr.c, doc.c, sig.c. Added doc.c. Added readline.c. Added objdump.c: ll:obj-dump operation. Enumerate PRODUCTS. clean: rm $(PRODUCTS). Do not compile lookup.c with debugging. Added toplevel.c. Added debug target. Added debugger.c Added errors.h ar.h and H_FILES. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c Make all O_FILES dependent on Makefile. Don't bother scanning anything except bmethod.c for ll_bc defs. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added binding.c. Add makefile targets for $(GC_LIB) Added locative.c. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/PKG: New revision. No longer requires gc_boehm. v0.12 New version. New version. New version. New version. Fixed 0,6. New version id. Added GNU readline support. Needs gnumake. New version. Bump release number: new debugger. Added CHANGES_RELEASES. PUBLISH:ll0.3 Bump version number; major fixes and features. Integrated Boehm GC. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: New version. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. no message should be . Checkpoint. More TODO. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Misc changes. Fixed stupid errors. src/ll/ar.c: No side-effect methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. Remove quotes from write. no message Added ar.c. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: new BC stack nargs attribute. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.c: Emit slot names, not ir slot bindings; closed over vars are always in exports vector; do not emit code for magic operators. Disable internal debugging. Better checking and debugging. Added blank lines between methods. new properties format; Added ll_assert_ref()s. Changes from ion03 New stack probing. Added props, debug expr, doc string, non-tail body constant opt. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use properties-mixin. Use new global binding protocol to support readonly globals. Added const-folding support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Properly compile body defines. Elide if branches if test is a constant. Renamed macros to not conflict with formals. New error system. ll_BOX_PTR() obolesed. Do not close-over globals. Use new %write-shallow-contents. (super . ) is now (super . ) Removed debugging code in :%ir-compile2-body. Fixed (if ...) compilation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. <%ir>:initialize now defaults parent and car-pos? arguments to #f if not specified. Only car-pos lambda share code vectors. All nested lambda share const and global vectors. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Major fixes: Do not generate code to construct unreferenced rest args. Properly inline car-position lambda. Properly handle make-locative to car-position lambda formals. Do not allocate space for unreferenced car-position lambdas formals. Checkpoint. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: new properties format Docs are accessed by properties-mixin, by default. Added preliminary treadmill GC support. binding uses properties-mixin. Added :binding-doc docstring support. Use new %write-shallow-contents. super implies ll_SELF! Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. src/ll/bmethod.c: Handle slot op arguments; rewrite slot as slot_ op. Whitespace. Formatting. new properties format Changes from ion03 Added more bc meter support. New stack probing, bytecode metering, dissassembler. new BC stack nargs attrib, prompt, run and dump printing, bytecode metering, debug expr, method properties. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Compute stack motion for a byte-code string. Use new global binding protocol to support readonly globals. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Use proper names for bmethod function. rtn instruction uses ll_return(x) to properly unwind stack. Added :%dump for code gen debugging. Initialize formals, alist with something tractable. _ll_make_method* should make , not . New error system. Avoid compile warnings on _ll_val_sp volatility. Avoid stack pointer side-effects. Fixed super calls. _ll_pfx_* is now _ll_pf_*. PUBLISH:ll0.2 Proper tail and super call implementation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. glo(X) instruction is rewritten to glo_(Y) where; X is the index into the const vector for the global name (symbol), Y is the locative to the global's binding value. Added byte-codes for: 1. argument count checking. 2. rest arg list construction. 3. car-positon lambda rest arg list construction. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/bool.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). Added not primitive. ll_g() is no longer an lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: Added blank lines between methods. Changes from ion03 New stack buffers. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. ll_g_set() is now ll_set_g(). New error system. Catch application can now take 0 or 1 args. PUBLISH:ll0.2 argc must be 3 for caught body. ll_g() is no longer an lval. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Unwind fluid bindings. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: new properties format Proper ll_unboc_char, char=? methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. New error system. Restart method after type and range check for integer->char. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: new properties format Other changes. Added preliminary treadmill GC support. locative-car/cdr is has no side-effect Fixed set-c[ad]r! functions. Implemented locative functions. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Use new immutable-type/mutable-type cloning protocol. PUBLISH:ll0.2 Don't bother calling (super initialize). Distinguish and . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/constant.c: new properties format Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Added blank lines between methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Formatting changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/debugger.c: Put type and method on newline for print-frame; Dont bother printing db_at_rtn. Formatting. new properties format cleaned up debugger init. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. New functionality in debugger! Major changes to debugger. Added debugger.c src/ll/defs.pl: Added support for multi-line macros and string constants. Added -s option to turn on source line tracking. Initial revision Initial check in of D:\data\ion\src src/ll/defs.sh: Other changes. CHECKPOINT Added -s option to turn on source line tracking. Check for cpp errors. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: Minor whitespace changes. new properties format Added new ll:hashstats. Use global ll_v vars for all ll_g bindings. Docs are accessed by properties-mixin, by default. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Use new binding value locative and properties-mixin. New version. Preliminary stack-buffer support. Docstring support. ll_g_set() is now ll_set_g(). ll_BOX_PTR() obolesed. Restart binding errors. ll_g() is no longer an lval. super implies ll_SELF. %macro: return #f if no binding is found. Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/env.ll: src/ll/eq.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. equal? for number is eqv?. Added ll_eqvQ. equal?: Allow immutable and mutable objects to be type compared by using imutable-type messages. Added eqv? primitive. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/error.c: Fixed error object initialize method. new properties format; ll_abort(); show caller in arg-count error. Other changes. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Clean up _ll_range_error(). New _ll_typecheck_error(). Fixed :%bad-typecheck method. arg-count-recoverable-error, not arg-count-error-recoverable-error, etc. New BOX -> make, UNBOX -> box function names. restargs are now named. :values are now (key . value), not (key value). Added :error-get-value. ll_g_set() is now ll_set_g(). Added return-action value strings for common errors. :initialize no longer has a 'kind' ivar. Bug in values list consing. Added :error-ar, :error-values methods. Added :handle-error, :handle-error: (fluid-let (((fluid current-error) self)), then call (debugger self). :handle-error dumps stack traces and aborts. Moved backtrace code to debugger.c. Fixed common error generation functions to use new protocol. :initialize can now take rest args as key-value pairs for values ivar init. Use new %write-shallow-contents. :handle-error now calls (%print-backtrace-and-escape self). :%default-error-handler deleted. _ll_error creates args value from ll_ARGV, not _ll_val_sp. _ll_error doesn't check for any error handler, just calls (handle-error ). Fatal errors will attempt to print op and last method implementor type. :%print-backtrace-and-escape: prints error and ar backtrace then applies (%top-level-restart). _ll_argc_count_error(), _ll_range_error(), and _ll_undefined_variable_error() returns from _ll_error() %default-error-handler deleted; unused. Initialize %top-level-restart to #f. ll_g() is no longer an lval. super implies ll_SELF. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/eval.c: Checkpoint before ION07 HD backup. CHECKPOINT Added eval-no-const-fold. Shortcut for eval on a constant. eval now takes an optional environment rest arg (ignored). Removed old evaluator code. New BOX -> make, UNBOX -> box function names. restargs are now named. Added errors.h, floatcfg.h __ll_tail_callv is now _ll_tail_callv. eval-list debug support. Use new shorter form for basic <%ir> creation. Added eval-list primitive. Cleaned up. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/fixnum.c: new properties format Enabled -Wall. Added bitwise ops. fixnum:number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Optimize typechecks. Fixed lcm. Preliminary lcm code. Fixed modulo. Added odd?, even?, quotent, remainder, modulo, %gcd, %lcm, numerator, denominator, floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. PUBLISH:ll0.2 Comment change. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/floatcfg.c: CHECKPOINT Use epsilon not rand numbers to calc error. Don't bother with all of ll.h, use value.h. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/flonum.c: new properties format Enabled -Wall. number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/fluid.c: new properties format more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. ll_UNBOX_BOOL is now ll_unbox_boolean. Restarg are now named. ll_g_set() is now ll_set_g(). bind-%fluid will create top-level bindings after (fluid %top-level-fluid-bindings) if a previous binding is not found and value is specified. Added _ll_init_fluid_1() and _ll_init_fluid_2(). fluid binding objects are ( ), not ( . ). %fluid-bind returns old binding. (%fluid-binding ) will create a top-level fluid binding if one doesn't exist. (%fluid ) and (set-%fluid! ) will recover from . (define-%fluid ) will attempt to create a top-level fluid binding id one doesn't exist rather than do a (%fluid-bind). ll_g() is no longer a lval. %set-fluid! is now set-%fluid! to force fluid to be a . Move fluid and define-fluid macros from syntax.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/format.c: use current-output-port, not *current-output-port*; dont assume args are on stack, use va_list. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Disabled weak ptr read macro debugging. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Added ~N (named object) format. format is now ll:format. Added #p, #l weak ptr read macros. Added ~W (weak ptr) and ~L (locative) format specifiers. Disable trace in format. Use new error protocol. ll_BOX_PTR() obsolesed. Don't disable call tracing. Fixed too-many-formats error function. Added '~F' format to flush the port. Added bad-format-char error for unrecognized formats. Use %write-shallow for ~O format. ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Globals for primitives are no longer defined. ll_g_set() is now ll_set_g(). Scan ll_g_set() too. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.c: use save argv and env from main(). CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added preliminary treadmill GC support. Update ll_initialized, ll_initializing. ll_init() now takes environment list. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Checkpoint. Other changes. Added lib/ll/test/test.scm. src/ll/lispread.c: Handle #\space, #\newline. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added read macro support (CALL_MACRO_CHAR(c)). Support #e and #i number modifiers. '^' is a valid symbol character. PUBLISH:ll0.2 "=" not "=="! Added support for immutable cons, vector and string. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. no message Initial revision Initial check in of D:\data\ion\src src/ll/list.c: new properties format Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added append, memq, memv, member, assq, assv, assoc. Added ll_consQ(). Added vector->list. ll_BOX_INT is now ll_make_fixnum. Restargs are now named. Added support for . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ll.h: Checkpoint before ION07 HD backup. Dont use GC by default, for testing. Formatting. Use global ll_v vars for all ll_g bindings. Broke out to prim.h. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Added new ll_VECTOR_LOOP_REF_FROM macro. _ll_range_error() and _ll_rangecheck() typedefs. Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. OP in ll_call*() is no longer affected by side effects to the activation record pointer. Added ll_consQ(). ll_init() now take environment list. Globals for primitives are no longer defined. ll_BOX_REF is now ll_make_ref. _nocheck_func removed. _minargc, _maxargc removed. Restargs are now named. ll_{BOX,UNBOX}_BOOL is now ll_{make,unbox}_boolean. ll_{BOX,UNBOX}_CHAR is now ll_{make,unbox}_char. Be sure to pick up ll_set_g() globals during defs.sh. ll_g_set() is now ll_set_g(). Added ll_eqQ(), ll_eqvQ(). Do not clear out activation records after pop, it screws up the debugger. Move basic ll_v definitions to value.h. Added new ll_e() error type reference macros. ll_BOX_PTR() obsolesed. Added new fluid binding function decls. Removed ll_CATCH_ERROR macros. ll_BOX_INT() casts to long before boxing. Make :argc an int to avoid repeated boxing and unboxing. Reorganize code. Elaborate more comments. Reference method's application function by meth->_func, not ll_SLOT(meth)[0]. Set ar's type to , not the undefined object value, after pop. Don't put super's search context on the stack; pass it directly to _ll_lookup_super(). Avoid side-effects in call primitive macros. _ll_pfx_* is now _ll_pf_*. Argument count errors can be returned from. Range errors can be returned from. ll_CATCH_ERROR uses %top-level-restart instead of %current-error-handler. Fixed most of the call primitive macros. ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Shorten macro operation symbol names. Define () as nil, not %%nil, it will be readonly soon enough. ll_THIS can now reference supertype ivars through super_. Global values are implemented using objects; see env.c, binding.c. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Intergrated Boehm GC. Minor comment changes. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.c: ll_init() now takes environment list. *read-eval-print-loop* is now ll:top-level Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/llt.gdb: Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. no message Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/load.c: Path searching for load. Other changes. ll_LOAD_ONE. Restored :load. Move top-level code to toplevel.c. Optionally eval load expressions one at a time. *read-eval-print-loop*: Use ports for prompting. Don't print thrown error objects. load: Don't catch any errors. Don't disable call tracing. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. :load now reads entire file as a list of exprs and then compiles them all at once. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/locative.c: new properties format CHECKPOINT Added preliminary treadmill GC support. Added locative-contents nop. ll_UNBOX_LOC is now ll_UNBOX_locative. Added primitive accessor methods for . src/ll/lookup.c: Service signals before initializing any variables. Added __ll_lookup(). Bigger possible argument vectors. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added _ll_method_not_found_error. Added locatable-operation support. Added typecheck for op in lookup. Cleaned up dead code. Added async signal polling. ll_UNBOX_BOOL is now ll_unbox_boolean. restargs are now named. Use ll_AR_ARGC, ll_AR_ARGV to insure proper tracing and lookup. Use new error protocol. :lookup can now take . Removed :lookup-super. Use new %write-shallow-contents. Added "ll: " to trace message. Use current ll_ARGV[0] to determine rcvr type, not _ll_val_sp[0]. _ll_lookup_super(void) is now _ll_lookup_super(ll_v super). ll_DEBUG() is no longer a lval. Added assertion for ll_ARGC >= 0 in _ll_lookup(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/macro.c: Formatting. new properties format New stack probing. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Dont apply macro op if rcvr does not respond. Anything else is not macro-expanded. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. macro-expand1 is now macro-expand-1. Don't rewrite (set! ...) and (define ...) forms; the compiler understands them now. ll_UNBOX_BOOL is now ll_unbox_boolean. Minor changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Minor formatting. Do not attempt to lookup macro expander operations for non-symbol car. Properly handle zero-length arglists in :macro-expand1. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/map.c: Minor whitespace changes. New stack probing. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. restargs are now named. Watch out for stack motion side-effects. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_ARGC is side-effected within __ll_callv(). Majorly stupid fixes. Added apply and for-each. Reimplemented map according to RRALS5. Added support for mutable sequences. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/mem.c: New out-of-memory-error. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Redefine malloc, etc. to GC_malloc, maybe. added mem.c src/ll/meth.c: Minor whitespace changes. new properties format CHECKPOINT method alist is now properties Use properties-mixin. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Reimplemented method-minargc. minargc, maxargc are removed. _minargc and _maxargc are not boxed anymore. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/named.c: Formatting. Use binding locative not value for name lookup. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Use new #p syntax. New BOX -> make, UNBOX -> box function names. restargs are now named. Added support for and new objects. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/nil.c: Minor whitespace changes. Checkpoint before ION07 HD backup. new properties format CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Initialize %fluid-bindings to nil. New mutable list support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/num.c: new properties format negative? bug. CHECKPOINT New BOX -> make, UNBOX -> box function names. restargs are now named. Added exp, log, sin, cos, tan, asin, acos, atan operations. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c src/ll/number.c: new properties format Added max, min. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added magnitude. Faster *, + argument handling. Added gcd, lcm, read-part, imag-part, angle, =, <, >, <=, >= operators. Added +, -, * and / primitives (in conjection to the lexical optimizaitions in syntax.c). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: new properties format :make-immutable has no side-effect. New BOX -> make, UNBOX -> box function names. restargs are now named. New immutable-type/mutable-type protocol for equal? and cloning. Added :%get-tag method. Comment changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.c: Whitespace. new properties format Enabled -Wall. Initialize lcache and properties. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Write protect op globals. New version. Added locatable-operation support. Added :getter. New BOX -> make, UNBOX -> box function names. restargs are now named. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Preliminary locative-* op support. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added ll_e() type defs. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/ops.c: src/ll/port.c: new properties format; More file-open-error properties. Added call-with-input-file, call-with-output-file. Use standard port names. Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. New BOX -> make, UNBOX -> box function names. restargs are now named. Use _ll_ptr_string() where applicable. ll_g_set() is now ll_set_g(). Use new error protocol. Cast in and out of impl ivar. ll_BOX_PTR() obsolesed. Added :flush primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. is now so we get eof-object? for "free". Use stack allocated string for ll_write_string(). Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/posix.c: Added posix:chdir. New BOX -> make, UNBOX -> box function names. restargs are now named. Fixed (posix:exit) .vs. (posix:exit ). posix:exit can now take optional exit code. ll_BOX_PTR() obsolesed. Reformatting. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/prim.c: primitive alist is now properties. Added doc strings. new properties format; Added _ll_add_method validation. New inits. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types method alist is now properties Remove '%p:' from primitive name. Print primitive code if it is a symbol. Globals for primitives are no longer defined. minargc, maxargc are removed. restargs are now named. func, minargc, maxargc are now longer boxed values. ll_BOX_PTR() obsolesed. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Use standard port names. Comments. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added read macro support. restargs are now named. ll_UNBOX_CHAR is now ll_unbox_char. ll_BOX_CHAR is now ll_make_char. Use new error protocol. Added support for C string escape sequences. Added support for immutable cons, vector and string. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Disable internal debugging. Clean up of stack chaining and asserts. Fixed allocation for ptr chaining. Make default activation record stack frames bigger. New stack buffer protocol. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types stack.c handles saving all globals on stack unwind. Preliminary stack-buffer support. Leave unreachable bootstrap elements on stacks. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: new properties format string:equal?, string-append!. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Only scan for 2 or 3 digits for numeric char escapes. BOX -> make, UNBOX -> unbox. Typecheck incoming char in string.c. Added and behaviors. :length is not boxed. array and length are no longer boxed. Added support for C string escape sequences. Added support for # digits. Added preliminary #e and #i specifier support. PUBLISH:ll0.2 :string->number: Bug in conversion of alpha digits to digit value. Check for fixnum overflow. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.c: Formatting. new properties format Added new ll:hashstats. New inits. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. _ll_make_symbol() now handles ll_f name properly. _ll_symbol_name typechecks now. ll_g_set() is now ll_set_g(). Escape EQ to =, not ==. :symbol->string: make name immutable. Added %gensym primitive. PUBLISH:ll0.2 ll_g() is no longer a lval. 'P' escapes to '%', 'P' stands for Percent. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New version. Use _ll_deftype_slot. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/symbols.c: src/ll/syntax.c: Minor whitespace changes. new properties format do special form debugging. CHECKPOINT Missing rparen in let* macro. Make ll_quote extern. Implemented locative transforms. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Implmented quasiquote. Added all basic syntax stuff from R5RS. Removed old set! and define rewrites. New BOX -> make, UNBOX -> box function names. restargs are now named. Reimplemented APPEND_BEGIN(), APPEND() macros. Added macros for let, let*, letrec, and, or. (-) is undefined. (define () ...) doesn't mean anything but (define (foo . bar) ...) does. Moved fluid macro to fluid.c. Implemented (make-locative ( . )) => ((locater ) . ). Added define-macro macro. Formatting. Checkpoint. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/test.gdb: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/testold.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/toplevel.c: Minor whitespace changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. Use new readline protocol. Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: new properties format Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Minor changes. New BOX -> make, UNBOX -> box function names. restargs are now named. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.c: Fixed slot offset initialization method. Added missing write barriers. Doc strings. new properties format type:initialize can take options documention, has properties. CHECKPOINT more init changes, default signal handlers, put type inits in type.c. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Allow more type slot definitions. New BOX -> make, UNBOX -> box function names. restargs are now named. Initialize readline after other ports. Use immutable cons for critical type structures. Use new _ll_deftype* macros. PUBLISH:ll0.2 Be sure to init before . debug:init::type is now debug:init:type. Make type variables readonly after init. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/type.h: try again Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Prepare to swap type.h types.h. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. method alist is now properties Added new properties-mixin. binding is now a properties-mixin. %ir is now a properties-mixin. method is now a properties-mixin. Reordered fluid-bindings slot in catch. binding now uses a locative to point to the value slot. Added locatable-operation support. Preliminary stack-buffer support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added more documentation. Preliminary envoke debugger at frame return. Removed :minargc, maxargc. Added :top-wired? option. Added :default-exit-value slot. Added type. New _ll_deftype macros to support ll_e() error types. :tester for ? operations added.. :minargc, maxargc are no longer boxed. :length is now longer boxed. :kind removed. :ar added. added. added. ll_e() error types added. added. Make :argc an int to avoid repeated boxing and unboxing. Added and . is , is . is a . is now a . ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 is now . Added top-wired? decls. Added mutable sequence types. Added type for new environment impl. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . eventually inherits from . Minor comment changes. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/types.h: Comments. Comment changes. Other changes. CHECKPOINT try again Prepare to swap type.h types.h. New _ll_deftype macros to support ll_e() error types. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/undef.c: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/value.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. New value.h. src/ll/vec.c: new properties format Improper call supers; range checking. Fixed append. CHECKPOINT Added preliminary treadmill GC support. Fixed immutable-type problem. New BOX -> make, UNBOX -> box function names. restargs are now named. Send %ptr and length messages in _ll_ptr_vec() if fast type check fails. Use new immutable-type protocol. :length is no longer boxed. Use new restartable-error protocol. Implement full type and range checks. ll_BOX_PTR() obsolesed. Use new initialize-clone protocol. PUBLISH:ll0.2 super implies ll_SELF. _ll_VEC_TERM != 0. Use "string-length" or "vector-length", not "length" in append. Added new and support. set-length! and append-one! should not take rest args. Checkpoint. Added rcs ids. Fixed stupid errors. Initial revision Initial check in of D:\data\ion\src src/ll/vec.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/vector.c: Minor reformatting. new properties format CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. :length is no longer boxed. ll_BOX_PTR() obsolesed. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/ll/write.c: Whitespace. %write-shallow take optional op which is ignored. Use standard port names. Other changes. CHECKPOINT Disable recursion lock support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Remove '%p:' from primitive name. Print primitive code if it is a symbol. Escapes quote, quasiquote, unquote and unquote-splicing. _ll_write_string is now ll_write_string. restargs are now named. Added locative:%write-port, immedate:%write-shallow. :length is no longer boxed. Force flonum to be printed with .0 suffix. %writePort is now %write-port. %writeContents is now %write-shallow-contents. Added :%write-shallow. :%write and :%display call :%write-shallow. PUBLISH:ll0.2 Added %writePort method for . is now . Don't use ll_tail_call to force unspecified return value. Misc changes. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_4' to 'PUBLISH_ll0_5' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added rcs ids. src/hash/PKG: Checkpoint from IONLAP1 src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: src/hash/charP_int_Table.def: src/hash/charP_int_Table.h: src/hash/charP_voidP_Table.c: src/hash/charP_voidP_Table.def: src/hash/charP_voidP_Table.h: src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: src/hash/hash.c: src/hash/hash.def: src/hash/hash.h: src/hash/hash_end.def: src/hash/int_voidP_Table.c: src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: src/hash/test/Makefile: src/hash/test/test.c: Added rcs ids. src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Added objdump.c: ll:obj-dump operation. Enumerate PRODUCTS. clean: rm $(PRODUCTS). Do not compile lookup.c with debugging. Added toplevel.c. Added debug target. src/ll/PKG: Needs gnumake. New version. Bump release number: new debugger. src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: no message src/ll/ar.c: Remove quotes from write. no message src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/bcompile.c: New error system. ll_BOX_PTR() obolesed. src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: Use new %write-shallow-contents. src/ll/bmethod.c: New error system. src/ll/bool.c: ll_g_set() is now ll_set_g(). Added not primitive. src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: ll_g_set() is now ll_set_g(). New error system. Catch application can now take 0 or 1 args. src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: New error system. Restart method after type and range check for integer->char. src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: Use new immutable-type/mutable-type cloning protocol. src/ll/constant.c: Added rcs ids. src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Formatting changes. src/ll/debugger.c: New functionality in debugger! Major changes to debugger. src/ll/defs.pl: src/ll/defs.sh: Added -s option to turn on source line tracking. src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: ll_g_set() is now ll_set_g(). ll_BOX_PTR() obolesed. Restart binding errors. src/ll/env.ll: src/ll/eq.c: equal?: Allow immutable and mutable objects to be type compared by using imutable-type messages. src/ll/error.c: :values are now (key . value), not (key value). Added :error-get-value. ll_g_set() is now ll_set_g(). Added return-action value strings for common errors. :initialize no longer has a 'kind' ivar. Bug in values list consing. Added :error-ar, :error-values methods. Added :handle-error, :handle-error: (fluid-let (((fluid current-error) self)), then call (debugger self). :handle-error dumps stack traces and aborts. Moved backtrace code to debugger.c. Fixed common error generation functions to use new protocol. src/ll/eval.c: Added errors.h, floatcfg.h src/ll/fixnum.c: Preliminary lcm code. src/ll/floatcfg.c: Don't bother with all of ll.h, use value.h. src/ll/flonum.c: Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. src/ll/fluid.c: ll_g_set() is now ll_set_g(). bind-%fluid will create top-level bindings after (fluid %top-level-fluid-bindings) if a previous binding is not found and value is specified. Added _ll_init_fluid_1() and _ll_init_fluid_2(). src/ll/format.c: Added ~W (weak ptr) and ~L (locative) format specifiers. Disable trace in format. Use new error protocol. ll_BOX_PTR() obsolesed. src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: ll_g_set() is now ll_set_g(). Scan ll_g_set() too. src/ll/init.c: Added rcs ids. src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Added lib/ll/test/test.scm. src/ll/lispread.c: Support #e and #i number modifiers. src/ll/list.c: Added support for . src/ll/ll.h: ll_g_set() is now ll_set_g(). Added ll_eqQ(), ll_eqvQ(). Do not clear out activation records after pop, it screws up the debugger. Move basic ll_v definitions to value.h. Added new ll_e() error type reference macros. ll_BOX_PTR() obsolesed. Added new fluid binding function decls. Removed ll_CATCH_ERROR macros. src/ll/llt.c: Added rcs ids. src/ll/llt.gdb: no message src/ll/load.c: Move top-level code to toplevel.c. src/ll/locative.c: Added primitive accessor methods for . src/ll/lookup.c: Use ll_AR_ARGC, ll_AR_ARGV to insure proper tracing and lookup. Use new error protocol. :lookup can now take . Removed :lookup-super. src/ll/macro.c: Minor changes. src/ll/map.c: Watch out for stack motion side-effects. src/ll/mem.c: added mem.c src/ll/meth.c: _minargc and _maxargc are not boxed anymore. src/ll/named.c: Added support for and new objects. src/ll/nil.c: ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. src/ll/num.c: Added exp, log, sin, cos, tan, asin, acos, atan operations. src/ll/number.c: Added gcd, lcm, read-part, imag-part, angle, =, <, >, <=, >= operators. src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: New immutable-type/mutable-type protocol for equal? and cloning. Added :%get-tag method. src/ll/op.c: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Added ll_e() type defs. src/ll/ops.c: src/ll/port.c: ll_g_set() is now ll_set_g(). Use new error protocol. Cast in and out of impl ivar. ll_BOX_PTR() obsolesed. src/ll/posix.c: Fixed (posix:exit) .vs. (posix:exit ). src/ll/prim.c: func, minargc, maxargc are now longer boxed values. ll_BOX_PTR() obsolesed. src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Use new error protocol. src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: :length is not boxed. array and length are no longer boxed. src/ll/symbol.c: ll_g_set() is now ll_set_g(). Escape EQ to =, not ==. src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: Use _ll_deftype_slot. src/ll/symbols.c: src/ll/syntax.c: Reimplemented APPEND_BEGIN(), APPEND() macros. Added macros for let, let*, letrec, and, or. src/ll/test.gdb: src/ll/testold.c: Added rcs ids. src/ll/toplevel.c: Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: Added rcs ids. src/ll/type.c: Use immutable cons for critical type structures. Use new _ll_deftype* macros. src/ll/type.h: New _ll_deftype macros to support ll_e() error types. :tester for ? operations added.. :minargc, maxargc are no longer boxed. :length is now longer boxed. :kind removed. :ar added. added. added. ll_e() error types added. added. src/ll/types.h: New _ll_deftype macros to support ll_e() error types. src/ll/undef.c: ll_g_set() is now ll_set_g(). ll_g() is no longer a lval. src/ll/value.h: New value.h. src/ll/vec.c: Use new immutable-type protocol. :length is no longer boxed. Use new restartable-error protocol. Implement full type and range checks. ll_BOX_PTR() obsolesed. Use new initialize-clone protocol. src/ll/vec.h: Added rcs ids. src/ll/vector.c: :length is no longer boxed. ll_BOX_PTR() obsolesed. src/ll/write.c: Added locative:%write-port, immedate:%write-shallow. :length is no longer boxed. src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_3' to 'PUBLISH_ll0_4' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added rcs ids. src/hash/PKG: Checkpoint from IONLAP1 src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: src/hash/charP_int_Table.def: src/hash/charP_int_Table.h: src/hash/charP_voidP_Table.c: src/hash/charP_voidP_Table.def: src/hash/charP_voidP_Table.h: src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: src/hash/hash.c: src/hash/hash.def: src/hash/hash.h: src/hash/hash_end.def: src/hash/int_voidP_Table.c: src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: src/hash/test/Makefile: src/hash/test/test.c: Added rcs ids. src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Added toplevel.c. Added debug target. Added debugger.c Added errors.h ar.h and H_FILES. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c Make all O_FILES dependent on Makefile. Don't bother scanning anything except bmethod.c for ll_bc defs. src/ll/PKG: Bump release number: new debugger. Added CHANGES_RELEASES. src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: no message should be . Checkpoint. src/ll/ar.c: No side-effect methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. Remove quotes from write. no message Added ar.c. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/bcompile.c: New error system. ll_BOX_PTR() obolesed. Do not close-over globals. Use new %write-shallow-contents. (super . ) is now (super . ) src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: Use new %write-shallow-contents. src/ll/bmethod.c: New error system. Avoid compile warnings on _ll_val_sp volatility. Avoid stack pointer side-effects. Fixed super calls. _ll_pfx_* is now _ll_pf_*. src/ll/bool.c: Added not primitive. src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: New error system. Catch application can now take 0 or 1 args. PUBLISH:ll0.2 src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: New error system. Restart method after type and range check for integer->char. Added rcs ids. src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: Use new immutable-type/mutable-type cloning protocol. PUBLISH:ll0.2 src/ll/constant.c: Added rcs ids. src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Formatting changes. src/ll/debugger.c: Put type and method on newline for print-frame; Dont bother printing db_at_rtn. Formatting. new properties format cleaned up debugger init. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. New functionality in debugger! Major changes to debugger. Added debugger.c src/ll/defs.pl: Added support for multi-line macros and string constants. Added -s option to turn on source line tracking. Initial revision Initial check in of D:\data\ion\src src/ll/defs.sh: Added -s option to turn on source line tracking. Check for cpp errors. src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: ll_BOX_PTR() obolesed. Restart binding errors. ll_g() is no longer an lval. super implies ll_SELF. %macro: return #f if no binding is found. src/ll/env.ll: src/ll/eq.c: equal?: Allow immutable and mutable objects to be type compared by using imutable-type messages. Added eqv? primitive. Added rcs ids. src/ll/error.c: :initialize no longer has a 'kind' ivar. Bug in values list consing. Added :error-ar, :error-values methods. Added :handle-error, :handle-error: (fluid-let (((fluid current-error) self)), then call (debugger self). :handle-error dumps stack traces and aborts. Moved backtrace code to debugger.c. Fixed common error generation functions to use new protocol. :initialize can now take rest args as key-value pairs for values ivar init. Use new %write-shallow-contents. :handle-error now calls (%print-backtrace-and-escape self). :%default-error-handler deleted. _ll_error creates args value from ll_ARGV, not _ll_val_sp. _ll_error doesn't check for any error handler, just calls (handle-error ). Fatal errors will attempt to print op and last method implementor type. :%print-backtrace-and-escape: prints error and ar backtrace then applies (%top-level-restart). _ll_argc_count_error(), _ll_range_error(), and _ll_undefined_variable_error() returns from _ll_error() %default-error-handler deleted; unused. Initialize %top-level-restart to #f. src/ll/eval.c: Added errors.h, floatcfg.h __ll_tail_callv is now _ll_tail_callv. eval-list debug support. src/ll/fixnum.c: Preliminary lcm code. Fixed modulo. Added odd?, even?, quotent, remainder, modulo, %gcd, %lcm, numerator, denominator, floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. PUBLISH:ll0.2 src/ll/floatcfg.c: Don't bother with all of ll.h, use value.h. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/flonum.c: Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/fluid.c: bind-%fluid will create top-level bindings after (fluid %top-level-fluid-bindings) if a previous binding is not found and value is specified. Added _ll_init_fluid_1() and _ll_init_fluid_2(). fluid binding objects are ( ), not ( . ). %fluid-bind returns old binding. (%fluid-binding ) will create a top-level fluid binding if one doesn't exist. (%fluid ) and (set-%fluid! ) will recover from . (define-%fluid ) will attempt to create a top-level fluid binding id one doesn't exist rather than do a (%fluid-bind). ll_g() is no longer a lval. src/ll/format.c: Use new error protocol. ll_BOX_PTR() obsolesed. Don't disable call tracing. Fixed too-many-formats error function. Added '~F' format to flush the port. Added bad-format-char error for unrecognized formats. Use %write-shallow for ~O format. src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Scan ll_g_set() too. src/ll/init.c: Added rcs ids. src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Added lib/ll/test/test.scm. src/ll/lispread.c: Support #e and #i number modifiers. '^' is a valid symbol character. PUBLISH:ll0.2 src/ll/list.c: Added support for . src/ll/ll.h: Move basic ll_v definitions to value.h. Added new ll_e() error type reference macros. ll_BOX_PTR() obsolesed. Added new fluid binding function decls. Removed ll_CATCH_ERROR macros. ll_BOX_INT() casts to long before boxing. Make :argc an int to avoid repeated boxing and unboxing. Reorganize code. Elaborate more comments. Reference method's application function by meth->_func, not ll_SLOT(meth)[0]. Set ar's type to , not the undefined object value, after pop. Don't put super's search context on the stack; pass it directly to _ll_lookup_super(). Avoid side-effects in call primitive macros. _ll_pfx_* is now _ll_pf_*. Argument count errors can be returned from. Range errors can be returned from. ll_CATCH_ERROR uses %top-level-restart instead of %current-error-handler. Fixed most of the call primitive macros. src/ll/llt.c: Added rcs ids. src/ll/llt.gdb: no message Added rcs ids. src/ll/load.c: Move top-level code to toplevel.c. Optionally eval load expressions one at a time. *read-eval-print-loop*: Use ports for prompting. Don't print thrown error objects. load: Don't catch any errors. Don't disable call tracing. src/ll/locative.c: Added primitive accessor methods for . src/ll/lookup.c: Use new error protocol. :lookup can now take . Removed :lookup-super. Use new %write-shallow-contents. Added "ll: " to trace message. Use current ll_ARGV[0] to determine rcvr type, not _ll_val_sp[0]. _ll_lookup_super(void) is now _ll_lookup_super(ll_v super). src/ll/macro.c: Minor changes. src/ll/map.c: Watch out for stack motion side-effects. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/mem.c: added mem.c src/ll/meth.c: _minargc and _maxargc are not boxed anymore. Added rcs ids. src/ll/named.c: Added support for and new objects. src/ll/nil.c: ll_g() is no longer a lval. src/ll/num.c: new properties format negative? bug. CHECKPOINT New BOX -> make, UNBOX -> box function names. restargs are now named. Added exp, log, sin, cos, tan, asin, acos, atan operations. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c src/ll/number.c: Added gcd, lcm, read-part, imag-part, angle, =, <, >, <=, >= operators. Added +, -, * and / primitives (in conjection to the lexical optimizaitions in syntax.c). src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: New immutable-type/mutable-type protocol for equal? and cloning. Added :%get-tag method. Comment changes. src/ll/op.c: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Added ll_e() type defs. Added rcs ids. src/ll/ops.c: src/ll/port.c: Use new error protocol. Cast in and out of impl ivar. ll_BOX_PTR() obsolesed. Added :flush primitive. src/ll/posix.c: Fixed (posix:exit) .vs. (posix:exit ). posix:exit can now take optional exit code. ll_BOX_PTR() obsolesed. Reformatting. src/ll/prim.c: func, minargc, maxargc are now longer boxed values. ll_BOX_PTR() obsolesed. Added rcs ids. src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Use new error protocol. Added support for C string escape sequences. Added support for immutable cons, vector and string. src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: array and length are no longer boxed. Added support for C string escape sequences. Added support for # digits. Added preliminary #e and #i specifier support. PUBLISH:ll0.2 src/ll/symbol.c: Escape EQ to =, not ==. :symbol->string: make name immutable. Added %gensym primitive. src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: Use _ll_deftype_slot. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/symbols.c: src/ll/syntax.c: Reimplemented APPEND_BEGIN(), APPEND() macros. Added macros for let, let*, letrec, and, or. src/ll/test.gdb: src/ll/testold.c: Added rcs ids. src/ll/toplevel.c: Minor whitespace changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. Use new readline protocol. Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: Added rcs ids. src/ll/type.c: Use new _ll_deftype* macros. PUBLISH:ll0.2 src/ll/type.h: New _ll_deftype macros to support ll_e() error types. :tester for ? operations added.. :minargc, maxargc are no longer boxed. :length is now longer boxed. :kind removed. :ar added. added. added. ll_e() error types added. added. Make :argc an int to avoid repeated boxing and unboxing. Added and . is , is . is a . is now a . src/ll/types.h: New _ll_deftype macros to support ll_e() error types. Added rcs ids. src/ll/undef.c: ll_g() is no longer a lval. src/ll/value.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. New value.h. src/ll/vec.c: Use new immutable-type protocol. :length is no longer boxed. Use new restartable-error protocol. Implement full type and range checks. ll_BOX_PTR() obsolesed. Use new initialize-clone protocol. PUBLISH:ll0.2 src/ll/vec.h: Added rcs ids. src/ll/vector.c: :length is no longer boxed. ll_BOX_PTR() obsolesed. Added rcs ids. src/ll/write.c: :length is no longer boxed. Force flonum to be printed with .0 suffix. %writePort is now %write-port. %writeContents is now %write-shallow-contents. Added :%write-shallow. :%write and :%display call :%write-shallow. src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_2' to 'PUBLISH_ll0_3' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added rcs ids. src/hash/PKG: Checkpoint from IONLAP1 src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: src/hash/charP_int_Table.def: src/hash/charP_int_Table.h: src/hash/charP_voidP_Table.c: src/hash/charP_voidP_Table.def: src/hash/charP_voidP_Table.h: src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: src/hash/hash.c: src/hash/hash.def: src/hash/hash.h: src/hash/hash_end.def: src/hash/int_voidP_Table.c: src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: src/hash/test/Makefile: src/hash/test/test.c: Added rcs ids. src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Make all O_FILES dependent on Makefile. Don't bother scanning anything except bmethod.c for ll_bc defs. PUBLISH:ll0.2 src/ll/PKG: Added CHANGES_RELEASES. PUBLISH:ll0.3 Bump version number; major fixes and features. src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: Checkpoint. src/ll/ar.c: No side-effect methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. Remove quotes from write. no message Added ar.c. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/bcompile.c: Use new %write-shallow-contents. (super . ) is now (super . ) Removed debugging code in :%ir-compile2-body. src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: Use new %write-shallow-contents. super implies ll_SELF! src/ll/bmethod.c: Fixed super calls. _ll_pfx_* is now _ll_pf_*. PUBLISH:ll0.2 src/ll/bool.c: Added not primitive. ll_g() is no longer an lval. src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: PUBLISH:ll0.2 src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: Added rcs ids. src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: PUBLISH:ll0.2 src/ll/constant.c: Added rcs ids. src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Formatting changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/debugger.c: Put type and method on newline for print-frame; Dont bother printing db_at_rtn. Formatting. new properties format cleaned up debugger init. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. New functionality in debugger! Major changes to debugger. Added debugger.c src/ll/defs.pl: Initial check in of D:\data\ion\src src/ll/defs.sh: Check for cpp errors. src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: ll_g() is no longer an lval. super implies ll_SELF. %macro: return #f if no binding is found. src/ll/env.ll: src/ll/eq.c: Added rcs ids. src/ll/error.c: :initialize can now take rest args as key-value pairs for values ivar init. Use new %write-shallow-contents. :handle-error now calls (%print-backtrace-and-escape self). :%default-error-handler deleted. _ll_error creates args value from ll_ARGV, not _ll_val_sp. _ll_error doesn't check for any error handler, just calls (handle-error ). Fatal errors will attempt to print op and last method implementor type. :%print-backtrace-and-escape: prints error and ar backtrace then applies (%top-level-restart). _ll_argc_count_error(), _ll_range_error(), and _ll_undefined_variable_error() returns from _ll_error() %default-error-handler deleted; unused. Initialize %top-level-restart to #f. ll_g() is no longer an lval. super implies ll_SELF. src/ll/eval.c: __ll_tail_callv is now _ll_tail_callv. eval-list debug support. src/ll/fixnum.c: PUBLISH:ll0.2 src/ll/floatcfg.c: CHECKPOINT Use epsilon not rand numbers to calc error. Don't bother with all of ll.h, use value.h. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/flonum.c: new properties format Enabled -Wall. number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/fluid.c: ll_g() is no longer a lval. src/ll/format.c: Don't disable call tracing. Fixed too-many-formats error function. Added '~F' format to flush the port. Added bad-format-char error for unrecognized formats. Use %write-shallow for ~O format. ll_g() is no longer a lval. src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Scan ll_g_set() too. src/ll/init.c: Added rcs ids. src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Checkpoint. Other changes. Added lib/ll/test/test.scm. src/ll/lispread.c: PUBLISH:ll0.2 src/ll/list.c: Added support for . src/ll/ll.h: Reorganize code. Elaborate more comments. Reference method's application function by meth->_func, not ll_SLOT(meth)[0]. Set ar's type to , not the undefined object value, after pop. Don't put super's search context on the stack; pass it directly to _ll_lookup_super(). Avoid side-effects in call primitive macros. _ll_pfx_* is now _ll_pf_*. Argument count errors can be returned from. Range errors can be returned from. ll_CATCH_ERROR uses %top-level-restart instead of %current-error-handler. Fixed most of the call primitive macros. ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 src/ll/llt.c: src/ll/llt.gdb: Added rcs ids. src/ll/load.c: *read-eval-print-loop*: Use ports for prompting. Don't print thrown error objects. load: Don't catch any errors. Don't disable call tracing. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/locative.c: Added primitive accessor methods for . src/ll/lookup.c: Use new %write-shallow-contents. Added "ll: " to trace message. Use current ll_ARGV[0] to determine rcvr type, not _ll_val_sp[0]. _ll_lookup_super(void) is now _ll_lookup_super(ll_v super). ll_DEBUG() is no longer a lval. src/ll/macro.c: Minor changes. Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/map.c: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/mem.c: added mem.c src/ll/meth.c: Added rcs ids. src/ll/named.c: Added support for and new objects. src/ll/nil.c: ll_g() is no longer a lval. src/ll/num.c: new properties format negative? bug. CHECKPOINT New BOX -> make, UNBOX -> box function names. restargs are now named. Added exp, log, sin, cos, tan, asin, acos, atan operations. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c src/ll/number.c: Added +, -, * and / primitives (in conjection to the lexical optimizaitions in syntax.c). src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: Comment changes. src/ll/op.c: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Added rcs ids. src/ll/ops.c: src/ll/port.c: Added :flush primitive. PUBLISH:ll0.2 src/ll/posix.c: Reformatting. src/ll/prim.c: Added rcs ids. src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Added support for immutable cons, vector and string. src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: PUBLISH:ll0.2 src/ll/symbol.c: :symbol->string: make name immutable. Added %gensym primitive. PUBLISH:ll0.2 src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. src/ll/symbols.c: src/ll/syntax.c: Reimplemented APPEND_BEGIN(), APPEND() macros. Added macros for let, let*, letrec, and, or. (-) is undefined. src/ll/test.gdb: src/ll/testold.c: Added rcs ids. src/ll/toplevel.c: Minor whitespace changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. Use new readline protocol. Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: Added rcs ids. src/ll/type.c: PUBLISH:ll0.2 src/ll/type.h: is now a . ll_ARGV is now stored in the activation record to support stack backtracing. PUBLISH:ll0.2 src/ll/types.h: Added rcs ids. src/ll/undef.c: ll_g() is no longer a lval. src/ll/value.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. New value.h. src/ll/vec.c: PUBLISH:ll0.2 src/ll/vec.h: src/ll/vector.c: Added rcs ids. src/ll/write.c: %writePort is now %write-port. %writeContents is now %write-shallow-contents. Added :%write-shallow. :%write and :%display call :%write-shallow. PUBLISH:ll0.2 src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release 'PUBLISH_ll0_1' to 'PUBLISH_ll0_2' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added rcs ids. src/hash/PKG: Checkpoint from IONLAP1 src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: src/hash/charP_int_Table.def: src/hash/charP_int_Table.h: src/hash/charP_voidP_Table.c: src/hash/charP_voidP_Table.def: src/hash/charP_voidP_Table.h: src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: src/hash/hash.c: src/hash/hash.def: src/hash/hash.h: src/hash/hash_end.def: src/hash/int_voidP_Table.c: src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: src/hash/test/Makefile: src/hash/test/test.c: Added rcs ids. src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added binding.c. Add makefile targets for $(GC_LIB) Added locative.c. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. src/ll/PKG: Bump version number; major fixes and features. Integrated Boehm GC. Fixed stupid errors. src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: Checkpoint. More TODO. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Misc changes. Fixed stupid errors. src/ll/ar.c: No side-effect methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. Remove quotes from write. no message Added ar.c. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. Added rcs ids. src/ll/bcompile.c: Removed debugging code in :%ir-compile2-body. Fixed (if ...) compilation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. <%ir>:initialize now defaults parent and car-pos? arguments to #f if not specified. Only car-pos lambda share code vectors. All nested lambda share const and global vectors. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Major fixes: Do not generate code to construct unreferenced rest args. Properly inline car-position lambda. Properly handle make-locative to car-position lambda formals. Do not allocate space for unreferenced car-position lambdas formals. Checkpoint. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: new properties format Docs are accessed by properties-mixin, by default. Added preliminary treadmill GC support. binding uses properties-mixin. Added :binding-doc docstring support. Use new %write-shallow-contents. super implies ll_SELF! Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. src/ll/bmethod.c: PUBLISH:ll0.2 Proper tail and super call implementation. ll_bc(NAME) is now ll_bc(NAME,NARGS) to allow easier bytecode disassembly. glo(X) instruction is rewritten to glo_(Y) where; X is the index into the const vector for the global name (symbol), Y is the locative to the global's binding value. Added byte-codes for: 1. argument count checking. 2. rest arg list construction. 3. car-positon lambda rest arg list construction. Added rcs ids. src/ll/bool.c: ll_g() is no longer an lval. Added rcs ids. src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: PUBLISH:ll0.2 argc must be 3 for caught body. ll_g() is no longer an lval. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Unwind fluid bindings. Added rcs ids. src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: Added rcs ids. src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: PUBLISH:ll0.2 Don't bother calling (super initialize). Distinguish and . Added rcs ids. src/ll/constant.c: Added rcs ids. src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. src/ll/debugger.c: Put type and method on newline for print-frame; Dont bother printing db_at_rtn. Formatting. new properties format cleaned up debugger init. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. New functionality in debugger! Major changes to debugger. Added debugger.c src/ll/defs.pl: Initial check in of D:\data\ion\src src/ll/defs.sh: Check for cpp errors. Added rcs ids. src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: ll_g() is no longer an lval. super implies ll_SELF. %macro: return #f if no binding is found. Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. Added rcs ids. src/ll/env.ll: src/ll/eq.c: Added rcs ids. src/ll/error.c: ll_g() is no longer an lval. super implies ll_SELF. Misc changes. Added rcs ids. src/ll/eval.c: __ll_tail_callv is now _ll_tail_callv. eval-list debug support. Use new shorter form for basic <%ir> creation. Added eval-list primitive. Cleaned up. Added rcs ids. src/ll/fixnum.c: PUBLISH:ll0.2 Comment change. Added rcs ids. src/ll/floatcfg.c: CHECKPOINT Use epsilon not rand numbers to calc error. Don't bother with all of ll.h, use value.h. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/flonum.c: new properties format Enabled -Wall. number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/fluid.c: ll_g() is no longer a lval. %set-fluid! is now set-%fluid! to force fluid to be a . Move fluid and define-fluid macros from syntax.c. Added rcs ids. src/ll/format.c: ll_g() is no longer a lval. Added rcs ids. src/ll/global.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/global1.h: Scan ll_g_set() too. Added rcs ids. src/ll/init.c: Added rcs ids. src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Checkpoint. Other changes. Added lib/ll/test/test.scm. src/ll/lispread.c: PUBLISH:ll0.2 "=" not "=="! Added support for immutable cons, vector and string. Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. src/ll/list.c: Added support for . Added rcs ids. src/ll/ll.h: PUBLISH:ll0.2 Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Shorten macro operation symbol names. Define () as nil, not %%nil, it will be readonly soon enough. ll_THIS can now reference supertype ivars through super_. Global values are implemented using objects; see env.c, binding.c. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Intergrated Boehm GC. Minor comment changes. Checkpoint. Added rcs ids. src/ll/llt.c: src/ll/llt.gdb: Added rcs ids. src/ll/load.c: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. :load now reads entire file as a list of exprs and then compiles them all at once. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. src/ll/locative.c: new properties format CHECKPOINT Added preliminary treadmill GC support. Added locative-contents nop. ll_UNBOX_LOC is now ll_UNBOX_locative. Added primitive accessor methods for . src/ll/lookup.c: ll_DEBUG() is no longer a lval. Added assertion for ll_ARGC >= 0 in _ll_lookup(). Added rcs ids. src/ll/macro.c: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Minor formatting. Do not attempt to lookup macro expander operations for non-symbol car. Properly handle zero-length arglists in :macro-expand1. Added rcs ids. src/ll/map.c: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. ll_ARGC is side-effected within __ll_callv(). Majorly stupid fixes. Added apply and for-each. Reimplemented map according to RRALS5. Added support for mutable sequences. Added rcs ids. src/ll/mem.c: New out-of-memory-error. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Redefine malloc, etc. to GC_malloc, maybe. added mem.c src/ll/meth.c: Added rcs ids. src/ll/named.c: Added support for and new objects. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. src/ll/nil.c: ll_g() is no longer a lval. Initialize %fluid-bindings to nil. New mutable list support. Added rcs ids. src/ll/num.c: new properties format negative? bug. CHECKPOINT New BOX -> make, UNBOX -> box function names. restargs are now named. Added exp, log, sin, cos, tan, asin, acos, atan operations. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c src/ll/number.c: Added +, -, * and / primitives (in conjection to the lexical optimizaitions in syntax.c). Added rcs ids. src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: Comment changes. Added rcs ids. src/ll/op.c: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Preliminary locative-* op support. Added rcs ids. src/ll/op.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/op1.h: Added rcs ids. src/ll/ops.c: src/ll/port.c: PUBLISH:ll0.2 ll_g() is no longer a lval. is now so we get eof-object? for "free". Use stack allocated string for ll_write_string(). Added rcs ids. src/ll/posix.c: Reformatting. Added rcs ids. src/ll/prim.c: Added rcs ids. src/ll/prim.h: Define ll_PRIM_TYPE_NAME, ll_PRIM_OP_NAME for debugging printfs. primitive alist is now properties. Added doc strings. new properties format Enabled -Wall. New file. Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Added support for immutable cons, vector and string. Added rcs ids. src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . Added rcs ids. src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: PUBLISH:ll0.2 :string->number: Bug in conversion of alpha digits to digit value. Check for fixnum overflow. Added rcs ids. src/ll/symbol.c: PUBLISH:ll0.2 ll_g() is no longer a lval. 'P' escapes to '%', 'P' stands for Percent. Added rcs ids. src/ll/symbol.h: Removed temporary files Initial revision Initial check in of D:\data\ion\src src/ll/symbol1.h: Renamed low level send macros. ll_g() and ll_DEBUG() are no longer lvals, use ll_g_set() and ll_DEBUG_SET(). Simplified build by creating dummy DEFS files for bootstrapping. string.o vector.o depend on vec.c. Added rcs ids. src/ll/symbols.c: src/ll/syntax.c: (-) is undefined. (define () ...) doesn't mean anything but (define (foo . bar) ...) does. Moved fluid macro to fluid.c. Implemented (make-locative ( . )) => ((locater ) . ). Added define-macro macro. Formatting. Checkpoint. Added rcs ids. src/ll/test.gdb: src/ll/testold.c: Added rcs ids. src/ll/toplevel.c: Minor whitespace changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. Use new readline protocol. Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: Added rcs ids. src/ll/type.c: PUBLISH:ll0.2 Be sure to init before . debug:init::type is now debug:init:type. Make type variables readonly after init. Added rcs ids. src/ll/type.h: PUBLISH:ll0.2 is now . Added top-wired? decls. Added mutable sequence types. Added type for new environment impl. Added simple history mechanism. Added stack pointer unwinding to catch. , and are mixins and are not subtypes of . eventually inherits from . Minor comment changes. Added rcs ids. src/ll/types.h: Added rcs ids. src/ll/undef.c: ll_g() is no longer a lval. Added rcs ids. src/ll/value.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. New value.h. src/ll/vec.c: PUBLISH:ll0.2 super implies ll_SELF. _ll_VEC_TERM != 0. Use "string-length" or "vector-length", not "length" in append. Added new and support. set-length! and append-one! should not take rest args. Checkpoint. Added rcs ids. src/ll/vec.h: src/ll/vector.c: Added rcs ids. src/ll/write.c: PUBLISH:ll0.2 Added %writePort method for . is now . Don't use ll_tail_call to force unspecified return value. Misc changes. Added rcs ids. src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ============================================================================== Changes from release '' to 'PUBLISH_ll0_1' ============================================================================== src/bin/PKG: Initial revision Initial check in of D:\data\ion\src src/bin/addcr: Removed addcr.t stuff. Added addcr.t/run. Case insensitive filename suffix matching. Ignore .bak files REM for .bat files Added #! check point Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t1.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t2: src/bin/addcr.t/backup/t3: Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/backup/t4: Removed addcr.t stuff. Added addcr.t/run. Initial revision Initial check in of D:\data\ion\src src/bin/addcr.t/run: Removed addcr.t stuff. Added addcr.t/run. src/bin/addrcsid.pl: Added java support. no message Added addrcsid.pl. src/bin/ccinfo: src/bin/ccloclibs: Initial revision Initial check in of D:\data\ion\src src/bin/ctocnl.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/cuecatlibrary.pl: Checkpoint. Major changes. Initial version. src/bin/cvsadd_r: Initial. src/bin/cvschrep.pl: Added pod. Added -r option Added rcs ids. New files src/bin/cvschroot.pl: check point check point New files src/bin/cvsclean: Added cvsclean. src/bin/cvsedited: src/bin/cvsfind.pl: Added cvsclean. Fixed unknown field error msg. Changed field names. simply grow the array by assignment New cvsfind.pl and cvsrevhist.pl src/bin/cvsfix.pl: Added cvs to CVS directory renaming. Added. src/bin/cvsretag.pl: Added cvsretag.pl src/bin/cvsrevhist.pl: PUBLISH_bin0.1 Added show_empty_entries, auto_extend_rev_ranges and collapse_comments options. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed handling of -s(how-rev-info) flag. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/cwfixlib.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/d2u.pl: ingore! use chomp instead of chop Change case of dotted names only. Added -help, -r options, ll, scm suffixes. Merged u2d.pl. Added cc and tcl support. Recognize .def files Added option handling. Added all caps renaming. Proper default ignore_pattern. Added d2u.pl. src/bin/dos2unix.c: initial src/bin/ecd: src/bin/fe: src/bin/findsource: Initial revision Initial check in of D:\data\ion\src src/bin/ifdu: src/bin/ifud: Checkpoint. src/bin/igrep: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/ion_dockstatn: Initial. src/bin/ion_emacs: Checkpoint before ION07 HD backup. Always attempt to use emacsclient. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_faxview: Quote directory name. Added ion_faxview. src/bin/ion_getphoto: Initial. src/bin/ion_make: Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_open_url: minor changes. minor changes. Added ion_open_url. src/bin/ion_startx: mod: Added xinerama support for dockstatn. Export ION_STARTX_RUNNING so subshells do not try to run ion_startx. Stop ssh-agent. Start X from home directory. Fixed icon titles. Moved ion_emacs, ion_make, ion_startx to ion/src/bin. src/bin/ion_vmware: Oops with exec. Start and stop services. Do not mess with vmware services. Added ion_vmware.services support. Added ion_vmware. src/bin/lib/perl/ion/_cvs/entry.pm: Hackish fix for remove cvs. Fixed // comment. Added cvsclean. Added clear_rlog method. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/lib/perl/ion/_cvs/find.pm: Fixed publish.pl. Fix INC path. Added cvsclean. New $ion::_cvs::find::show_funny_entries option. New ion::_cvs::entry.pm ion::_cvs::rlog Fixed unknown field error msg. Changed field names. simply grow the array by assignment Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl src/bin/lib/perl/ion/_cvs/rlog.pm: Hackish fix for remove cvs. Unlink input file and return undef if error running rlog. Force $v->{symbolic_names} to be a list. New ion::_cvs::entry.pm ion::_cvs::rlog src/bin/linkdups: src/bin/locstatic: Initial revision Initial check in of D:\data\ion\src src/bin/lpr: Added -L support. Checkpoint. src/bin/lsup: Use . by default. Initial revision Initial check in of D:\data\ion\src src/bin/mergefiles.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/mkindex: V1.1 Initial revision Initial check in of D:\data\ion\src src/bin/mvr.pl: src/bin/nmlibs: src/bin/nmm: src/bin/objcsyms: Initial revision Initial check in of D:\data\ion\src src/bin/procmailnow: Checkpoint. src/bin/publish.pl: Hackish fix for remove cvs. Minor changes. Fixed publish.pl. Added CHANGES_RELEASE logging support. Added CHANGES file support. New cvsfind.pl and cvsrevhist.pl Force cvs tag only if -force option is supplied. Print file sizes. Prepend '0' to day of month if single digit. PUBLISH:bin0.1 Fixed edit collision. PUBLISH: bin0.1 Initial revision Initial check in of D:\data\ion\src src/bin/sci: src/bin/scip: Initial revision Initial check in of D:\data\ion\src src/bin/si: Filter out blank and include lines. Initial revision Initial check in of D:\data\ion\src src/bin/split.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/bin/swig2def.pl: Added src/bin/tablefmt.pl: Initial. src/bin/tgz: bz2 NOT b2 added more suffix patterns. tgz files use gzip not bzip. New bzip2 support. Use input redir for GUNZIP. Now supports .tar files. Initial revision Initial check in of D:\data\ion\src src/bin/ts: Added ts. src/bin/uud: src/bin/uudindex: Added directory options. Gen .html for each image. Initial revision Initial check in of D:\data\ion\src src/bin/which: Must be a file, too. Initial revision Initial check in of D:\data\ion\src src/bin/whichall: Initial revision Initial check in of D:\data\ion\src src/bin/wwwgrab: Added wwwgrab. src/bin/wwwgrab.pl: Need Socket. Added wwwgrab. src/bin/wwwsend: Initial revision Initial check in of D:\data\ion\src src/hash/Makefile: Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision src/hash/PKG: Checkpoint from IONLAP1 Another check point. Initial revision src/hash/charP_hash.c: Force single char string hashes to be big. New rehash mechanism. src/hash/charP_int_Table.c: src/hash/charP_int_Table.def: src/hash/charP_int_Table.h: src/hash/charP_voidP_Table.c: src/hash/charP_voidP_Table.def: src/hash/charP_voidP_Table.h: Added rcs ids. Initial revision src/hash/generic_Table.c: src/hash/generic_Table.def: src/hash/generic_Table.h: Added rcs ids. Checkpoint from IONLAP1 src/hash/hash.c: Added rcs ids. Checkpoint from IONLAP1 Another check point. Initial revision src/hash/hash.def: Added rcs ids. Checkpoint from IONLAP1 Initial revision src/hash/hash.h: src/hash/hash_end.def: src/hash/int_voidP_Table.c: src/hash/int_voidP_Table.def: src/hash/int_voidP_Table.h: src/hash/test/Makefile: src/hash/test/test.c: Added rcs ids. Initial revision src/hash/voidP_voidP_Table.c: New rehash mechanism. Added voidP_voidP_*. src/hash/voidP_voidP_Table.def: src/hash/voidP_voidP_Table.h: Added voidP_voidP_*. src/ll/Makefile: Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision src/ll/PKG: Fixed stupid errors. Initial revision src/ll/README: Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. More documentation. Added README src/ll/TODO: Fixed stupid errors. src/ll/ar.c: No side-effect methods. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. New BOX -> make, UNBOX -> box function names. restargs are now named. Remove quotes from write. no message Added ar.c. src/ll/assert.c: ll_abort(). Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/assert.h: Added ll_assert_prim. New stack assertions. bc assertion. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/bc.pl: Initial. src/ll/bcode.h: Added rcs ids. Initial revision src/ll/bcompile.c: Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. Fixed stupid errors. Removed temporary files Initial revision src/ll/bcompile.h: Added preliminary treadmill GC support. Added bcompile.h. src/ll/binding.c: new properties format Docs are accessed by properties-mixin, by default. Added preliminary treadmill GC support. binding uses properties-mixin. Added :binding-doc docstring support. Use new %write-shallow-contents. super implies ll_SELF! Environment now uses objects instead of es int the binding vector. Macro definitions are also moved into the objects instead of the environment's _macros assoc. Symbol properties are now implemented in the objects. Basic readonly global support is implemented; still need changes for define, set!, and make-locative runtime checks for readonly globals in the bytecode compiler. src/ll/bmethod.c: src/ll/bool.c: Added rcs ids. Initial revision src/ll/cadr.c: new properties format Added locatable-operation support. Renamed to . Ported to Linux. Added printing recursion locking. More documentation. Added %bc:debug and %bc:debug-off bytecodes. Added new files. src/ll/cadr.h: Added preliminary treadmill GC support. Added new files. src/ll/call.c: Formatting. Other changes. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call.h: Other changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/call_int.h: No extra argument for super calls. Leave room for return value!. Other changes. CHECKPOINT Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/catch.c: Added rcs ids. Initial revision src/ll/cfold.c: new properties format Changes from ion03 Other changes. %ir-constant? works for global symbol. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. IR. New version. src/ll/char.c: Added rcs ids. Initial revision src/ll/config.mak: Dont use GC by default, for testing. Enable lcache and history. Disable RUN_DEBUG default. More config vars. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/config.pl: src/ll/cons.c: src/ll/constant.c: Added rcs ids. Initial revision src/ll/cops.h: Added bitwise ops. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/debug.c: Added rcs ids. Initial revision src/ll/debugger.c: Put type and method on newline for print-frame; Dont bother printing db_at_rtn. Formatting. new properties format cleaned up debugger init. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. print-frame: Print the previous frame's type and method. Use new ~N for frame display. Use :default-exit-value if none is specified by user. *prompt-read-eval* is now ll:top-level:prompt-read-eval. New functionality in debugger! Major changes to debugger. Added debugger.c src/ll/defs.pl: Initial check in of D:\data\ion\src src/ll/defs.sh: Added rcs ids. Initial revision src/ll/doc.c: Formatting. Docs are accessed by properties-mixin, by default. Added doc.c. src/ll/env.c: Added rcs ids. Initial revision src/ll/env.ll: src/ll/eq.c: src/ll/error.c: src/ll/eval.c: src/ll/fixnum.c: Added rcs ids. Initial revision src/ll/floatcfg.c: CHECKPOINT Use epsilon not rand numbers to calc error. Don't bother with all of ll.h, use value.h. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/flonum.c: new properties format Enabled -Wall. number->string supports radix. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types New BOX -> make, UNBOX -> box function names. restargs are now named. Added floor, ceiling, truncate, round, exact->inexact, inexact->exact, number->string operations. ll_*BOX_PTR() is obsolete. New flonum support (uses old PTR tag). :slots is now (( . ) ...). Byte-code slot make-locative code fixed. src/ll/fluid.c: src/ll/format.c: Added rcs ids. Initial revision src/ll/global.h: Initial check in of D:\data\ion\src src/ll/global1.h: src/ll/init.c: Added rcs ids. Initial revision src/ll/init.h: Extra tokens after #endif. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/inits.c: Other changes. more init changes, default signal handlers, put type inits in type.c. src/ll/lcache.c: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Initial. src/ll/lcache.h: Compilable lcache. Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. src/ll/lib/ll/fluid.ll: src/ll/lib/ll/let.scm: Checkpoint. src/ll/lib/ll/match.scm: Added match.scm src/ll/lib/ll/outliner.ll: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/lib/ll/strstrm.ll: Added strstrm.ll. src/ll/lib/ll/test/closed.scm: Added src/ll/lib/ll/test/mycons.scm: Minor reformatting. Fixed syntax errors. Other changes. src/ll/lib/ll/test/test.scm: Checkpoint. Other changes. Added lib/ll/test/test.scm. src/ll/lispread.c: Makefile: added lispread.c .o dependency. bcompile.c: emit "rtn" after tail-pos (quote ) form. lispread.c: check for ')' AFTER reading x in '(foo bar . x), not before. ops.h: Fixed rcs Id. Added rcs ids. no message Initial revision src/ll/list.c: src/ll/ll.h: src/ll/llt.c: src/ll/llt.gdb: src/ll/load.c: Added rcs ids. Initial revision src/ll/locative.c: new properties format CHECKPOINT Added preliminary treadmill GC support. Added locative-contents nop. ll_UNBOX_LOC is now ll_UNBOX_locative. Added primitive accessor methods for . src/ll/lookup.c: src/ll/macro.c: src/ll/map.c: Added rcs ids. Initial revision src/ll/mem.c: New out-of-memory-error. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added preliminary treadmill GC support. Redefine malloc, etc. to GC_malloc, maybe. added mem.c src/ll/meth.c: src/ll/named.c: src/ll/nil.c: Added rcs ids. Initial revision src/ll/num.c: new properties format negative? bug. CHECKPOINT New BOX -> make, UNBOX -> box function names. restargs are now named. Added exp, log, sin, cos, tan, asin, acos, atan operations. Added num.c for more number functionality. fixnum.o and flonum.o depend on num.c src/ll/number.c: Added rcs ids. Initial revision src/ll/objdump.c: New BOX -> make, UNBOX -> box function names. restargs are now named. Added type size field. Fixed stupid %obj-dump bug. Added objdump.c: ll:obj-dump operation. src/ll/object.c: src/ll/op.c: Added rcs ids. Initial revision src/ll/op.h: Initial check in of D:\data\ion\src src/ll/op1.h: Added rcs ids. Initial revision src/ll/ops.c: src/ll/port.c: src/ll/posix.c: Added rcs ids. Initial revision src/ll/prim.c: Added rcs ids. Fixed stupid errors. Initial revision src/ll/prim.h: Initial check in of D:\data\ion\src src/ll/prims.c: src/ll/props.c: new properties format properties-mixin initialize. CHECKPOINT Added new properties-mixin type. src/ll/read.c: Added rcs ids. Initial revision src/ll/readline.c: Minor reformatting. completion_matches is now rl_completion_matches. CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Added preliminary treadmill GC support. Added symbol completion support. ll_UNBOX_BOOL is now ll_unbox_boolean. ll_BOX_INT is now ll_make_fixnum. _ll_write_string is now ll_write_string. Initialize readline history. Added readline.c. src/ll/sig.c: Doc strings. Abort on SIGSEGV. Added new ll:hashstats. debugging. more init changes, default signal handlers, put type inits in type.c. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Added new files. src/ll/sig.h: ll_sig_service() never called _ll_sig_service Added new ll:hashstats. Added new files. src/ll/src/include/ll/README: Added README. src/ll/src/include/ll/bcs.h: src/ll/src/include/ll/debugs.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/ll/errors.h: src/ll/src/include/ll/floatcfg.h: Added errors.h, floatcfg.h src/ll/src/include/ll/globals.h: src/ll/src/include/ll/inits.h: src/ll/src/include/ll/macros.h: src/ll/src/include/ll/ops.h: src/ll/src/include/ll/prims.h: src/ll/src/include/ll/symbols.h: Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types src/ll/src/include/readline/history.h: Added readline.c. src/ll/stack.c: Added rcs ids. Initial revision src/ll/stack.h: Clean up of stack chaining and asserts. New file. src/ll/string.c: src/ll/symbol.c: Added rcs ids. Initial revision src/ll/symbol.h: Initial check in of D:\data\ion\src src/ll/symbol1.h: Added rcs ids. Initial revision src/ll/symbols.c: src/ll/syntax.c: src/ll/test.gdb: src/ll/testold.c: Added rcs ids. Initial revision src/ll/toplevel.c: Minor whitespace changes. Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Minor changes. *read-eval-print-loop* is now ll:top-level. Added #^, #V read macros for history. ll:top-level-* is now ll:top-level:*. Added ll:top-level:exprs, ll:top-level:results for interactive history. Use new readline protocol. Insert leading space in top-level prompts for visibility. Moved top-level code from load.c. src/ll/trace.c: src/ll/type.c: Added rcs ids. Initial revision src/ll/type.h: Added rcs ids. Fixed stupid errors. Initial revision src/ll/types.h: src/ll/undef.c: Added rcs ids. Initial revision src/ll/value.h: CHECKPOINT Major changes: new assertion, new init, new DEFS names + locations; immutable+mutable types Checkpoint: New assertions, uninlined ll_call, new ll_INIT, new lcache. Preliminary stack-buffer support. Added preliminary ct_v support. New BOX -> make, UNBOX -> box function names. restargs are now named. New value.h. src/ll/vec.c: Added rcs ids. Fixed stupid errors. Initial revision src/ll/vec.h: src/ll/vector.c: src/ll/write.c: Added rcs ids. Initial revision src/maks/PKG: Added swig2def dll support. Initial revision Initial check in of D:\data\ion\src src/maks/basic.mak: Port to RH7.0. More swig support. Added swig support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak: Unknown edits. Initial revision Initial check in of D:\data\ion\src src/maks/bin/mak.bat: Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/fixpound.pl: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/lib.mak: Added swig2def dll support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/opengl/Makefile.use: Checkpoint. Port to RH7.0. Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/os/CYGWIN.mak: src/maks/os/CYGWIN_98-4.10.mak: src/maks/os/Linux.mak: Added new os support. Fixed tool.mak. src/maks/pre.mak: More swig support. Added swig support. Added new os support. Fixed tool.mak. Added BUILD_TARGET to BUILD_VARS. Added BUILD_VARS support. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tool.mak: Added new os support. Fixed tool.mak. MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/tools.mak: MSG, vm, proper products. Unknown edits. Added rcs ids. Minor non-functional changes, and comments. Initial revision Initial check in of D:\data\ion\src src/maks/use.mak: USE dir Unknown edits. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/maks/win32/Makefile: src/maks/win32/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/ConfigInfo.c: Merge changes from UBS. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/ConfigInfo.h: Changes from AM. New versions. Added new ConfigInfo_getValue1(). Added new ConfigInfo_initFromValueArray(). More documentation. Added new files. src/util/GUMakefile: Added GUMakefile. src/util/Makefile: Merge changes from UBS. Added file.c, file.h. Added outbuf.c, outbuf.h. Minor fixes. Added prime.c, prime.h. Added rc4.c, rc4.h. Checkpoint. Added lockfile.c, lockfile.h errs.pl is now errlist.pl Added errlist.h, errlist.c, errlist.pl. Changes from AM. New versions. Added new files. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/Makefile.use: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/PKG: New version releases. Minor fixes. Changes from AM. New versions. maks, not mak. Needs perl. Initial revision Initial check in of D:\data\ion\src src/util/bitset.h: src/util/charset.c: Fixed escape routines. Added charset.c, charset.h. src/util/charset.h: Added charset.c, charset.h. src/util/enum.c: Dont use strchr() on non-null-term strings. Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/enum.h: Added C_enum_value_to_str(). Remove WDR Copyrights. Changes from am. Checkpoint. Changes from AM. New versions. Added new files. src/util/errlist.h: Make compatable with Linux. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/errlist.pl: New memdebug interloper. Minor change. Remove WDR Copyrights. Changes from am. Checkpoint. Added errlist.h, errlist.c, errlist.pl. src/util/file.c: mod: fixed pe == 0 bug for last iteration of PATH. Changes from WDR Changes from UBS. Disable testing. New file.c, file.h. src/util/file.h: Changes from WDR Merge changes from UBS. Changes from UBS. New file.c, file.h. src/util/host.c: Merge changes from UBS. Changes from UBS. src/util/host.h: Merge changes from UBS. Changes from UBS. src/util/lockfile.c: Merge changes from UBS. Fixed empty lockfile reporting. Added lockfile error support. Changes from am. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile.h: Added lockfile error support. Checkpoint. Added lockfile.c, lockfile.h src/util/lockfile_main.c: Added lockfile error support. src/util/mem.c: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/mem.h: Remove WDR Copyrights. Changes from AM. New versions. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/memcpy.h: src/util/midi.h: src/util/nurbs.c: CYGWIN compatibility. NURBS. src/util/nurbs.h: NURBS. src/util/outbuf.c: Merge changes from UBS. Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/outbuf.h: Allow reentry during flush. Added outbuf.c, outbuf.h. src/util/path.c: Remove WDR Copyrights. Changes from am. Added errlist.h, errlist.c, errlist.pl. Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/path.h: Added rcs ids. Initial revision Initial check in of D:\data\ion\src src/util/port.c: Merge changes from UBS. Changes from UBS. src/util/port.h: Merge changes from UBS. Changes from UBS. src/util/prime.c: Added prime_factors(). Merge changes from UBS. Return proper pointer. None. Added prime.c, prime.h. src/util/prime.h: Added prime_factors(). None. Added prime.c, prime.h. src/util/rc4.c: src/util/rc4.h: Added RC4_EXPORT support for inlining. Minor optimizations. Minor fixes. Added rc4.c, rc4.h. src/util/refcntptr.cc: Added refcntptr. src/util/refcntptr.hh: Optimize constructors. Added glue support. Added refcntptr. src/util/setenv.c: src/util/setenv.h: Changes from AM. New versions. Added new files. src/util/sig.c: src/util/sig.h: Changes from UBS libSignal. Added new files. src/util/sigs.pl: Changes from UBS libSignal. Changes from AM. New versions. Added new files. src/util/ssprintf.c: Merge changes from UBS. Checkpoint. src/util/ssprintf.h: Checkpoint. src/util/test/ConfigTest.c: src/util/test/ConfigTest.cfg: Added test. ll0.13/TOC0100664000175200017560000007230007623416652012633 0ustar stephensstephensll 0.13 Table of Contents ============================================================================== ll0.13: total 620 drwxrwxr-x 3 stephens 4096 Feb 15 05:59 . drwxrwxr-x 3 stephens 4096 Feb 15 04:48 .. -rw-rw-r-- 1 stephens 602289 Feb 15 05:59 CHANGES -rw-rw-r-- 1 stephens 602 Feb 15 05:52 COPYRIGHT -rw-rw-r-- 1 stephens 779 Feb 15 04:48 README drwxrwxr-x 7 stephens 4096 Feb 15 04:48 src -rw-rw-r-- 1 stephens 105 Feb 15 05:59 TOC ll0.13/src: total 32 drwxrwxr-x 7 stephens 4096 Feb 15 04:48 . drwxrwxr-x 3 stephens 4096 Feb 15 05:59 .. drwxr-sr-x 5 stephens 4096 Feb 3 12:29 bin -rw-rw-r-- 1 stephens 417 Feb 15 04:48 GUM_BUILD_ROOT drwxr-sr-x 4 stephens 4096 Dec 2 2001 hash drwxr-sr-x 5 stephens 4096 Feb 15 04:48 ll drwxr-sr-x 7 stephens 4096 Jul 23 2001 maks drwxr-sr-x 4 stephens 4096 Feb 15 04:48 util ll0.13/src/bin: total 360 drwxr-sr-x 5 stephens 4096 Feb 3 12:29 . drwxrwxr-x 7 stephens 4096 Feb 15 04:48 .. -rw-r--r-- 1 stephens 9271 Feb 17 1999 addcr drwxr-sr-x 4 stephens 4096 Oct 21 2001 addcr.t -rw-r--r-- 1 stephens 3385 Jun 28 1999 addrcsid.pl -rwxrwxr-x 1 stephens 261 Dec 17 12:01 argouml -rw-r--r-- 1 stephens 5118 Feb 17 1999 ccinfo -rw-r--r-- 1 stephens 3059 Feb 17 1999 ccloclibs -rw-r--r-- 1 stephens 372 Feb 19 1999 ctocnl.c -rwxrwxr-x 1 stephens 16212 Oct 1 17:26 cuecatlibrary.pl -rwxrwxr-x 1 stephens 15961 Jul 4 2002 cuecatlibrary.pl.~1.2.~ drwxr-sr-x 2 stephens 4096 Feb 3 12:29 CVS -rwxr-xr-x 1 stephens 192 Jun 16 2001 cvsadd_r -rwxrw-r-- 1 stephens 2088 Feb 3 12:46 cvschrep.pl -rwxr--r-- 1 stephens 1255 Jan 14 2001 cvschrep.pl.~1.3.~ -rw-r--r-- 1 stephens 1062 Feb 17 1999 cvschroot.pl -rw-r--r-- 1 stephens 352 Oct 20 1999 cvsclean -rw-r--r-- 1 stephens 331 Oct 13 1999 cvsedited -rw-r--r-- 1 stephens 1373 Oct 20 1999 cvsfind.pl -rw-r--r-- 1 stephens 1372 Jul 9 2001 cvsfix.pl -rw-r--r-- 1 stephens 1193 Sep 9 1999 cvsretag.pl -rw-r--r-- 1 stephens 3571 Mar 21 2000 cvsrevhist.pl -rw-r--r-- 1 stephens 945 Feb 19 1999 cwfixlib.pl -rwxr--r-- 1 stephens 3010 Jan 14 2001 d2u.pl -rw-r--r-- 1 stephens 312 Apr 8 1994 dos2unix.c -rw-r--r-- 1 stephens 709 Feb 17 1999 ecd -rw-r--r-- 1 stephens 190 Feb 17 1999 fe -rw-r--r-- 1 stephens 103 Feb 17 1999 findsource -rwxr-xr-x 1 stephens 223 May 10 2002 ifdu -rwxr-xr-x 1 stephens 223 May 10 2002 ifud -rw-r--r-- 1 stephens 6566 Sep 30 1999 igrep -rwxrwxr-x 1 stephens 146 Oct 1 17:27 ion_dockstatn -rwxr-xr-x 1 stephens 569 Apr 22 2002 ion_emacs -rwxrwxr-x 1 stephens 433 Oct 1 17:26 ion_faxview -rwxrwxr-x 1 stephens 431 Jul 5 2002 ion_faxview.~1.1.~ -rwxrwxr-x 1 stephens 1019 Nov 26 22:15 ion_getphoto -rwxrwxr-x 1 stephens 1018 Oct 1 17:27 ion_getphoto.~1.1.~ -rwxr-xr-x 1 stephens 237 Oct 21 2001 ion_make -rwxr-xr-x 1 stephens 180 Jun 15 2001 ion_open_url -rwxrwxr-x 1 stephens 943 Oct 1 17:26 ion_startx -rwxr-xr-x 1 stephens 306 Dec 25 14:55 ion_vmware drwxr-sr-x 4 stephens 4096 Jul 23 2001 lib -rw-r--r-- 1 stephens 647 Feb 17 1999 linkdups -rw-r--r-- 1 stephens 1369 Feb 17 1999 locstatic -rwxrwxr-x 1 stephens 189 Oct 1 17:25 lpr -rwxr-xr-x 1 stephens 126 May 10 2002 lpr.~1.1.~ -rw-r--r-- 1 stephens 259 Sep 30 1999 lsup -rw-r--r-- 1 stephens 6485 Feb 19 1999 mergefiles.pl -rwxrwxr-x 1 stephens 485 Jan 13 22:30 metriconv -rw-r--r-- 1 stephens 1965 Sep 30 1999 mkindex -rw-r--r-- 1 stephens 1739 Oct 13 1999 mvr.pl -rw-r--r-- 1 stephens 279 Feb 17 1999 nmlibs -rwxr-xr-x 1 stephens 64 Feb 17 1999 nmm -rw-r--r-- 1 stephens 2427 Feb 17 1999 objcsyms -rw-r--r-- 1 stephens 230 Feb 17 1999 PKG -rwxr-xr-x 1 stephens 380 Nov 7 2001 procmailnow -rw-r--r-- 1 stephens 18470 Oct 20 2001 publish.pl -rw-r--r-- 1 stephens 2957 Feb 17 1999 sci -rw-r--r-- 1 stephens 3328 Feb 17 1999 scip -rw-r--r-- 1 stephens 92 Oct 13 1999 si -rw-r--r-- 1 stephens 2374 Feb 19 1999 split.c -rwxr--r-- 1 stephens 436 Apr 3 2001 swig2def.pl -rwxrwxr-x 1 stephens 1491 Aug 11 2002 tablefmt.pl -rwxr--r-- 1 stephens 2350 Jan 14 2001 tgz -rw-r--r-- 1 stephens 1655 Mar 21 2000 ts -rwxr--r-- 1 stephens 2170 Apr 3 2001 uud -rwxr--r-- 1 stephens 2170 Feb 23 2001 .#uud.1.2 -rwxr--r-- 1 stephens 3661 Apr 3 2001 uudindex -rwxr--r-- 1 stephens 3661 Feb 23 2001 .#uudindex.1.2 -rwxr--r-- 1 stephens 650 Jul 9 2001 which -rw-r--r-- 1 stephens 99 Feb 17 1999 whichall -rwxrwxr-x 1 stephens 95 Sep 17 2001 wwwgrab -rwxrwxr-x 1 stephens 1584 Oct 1 17:25 wwwgrab.pl -rwxrwxr-x 1 stephens 1570 Sep 17 2001 wwwgrab.pl.~1.1.~ -rw-r--r-- 1 stephens 1777 Feb 17 1999 wwwsend ll0.13/src/bin/addcr.t: total 20 drwxr-sr-x 4 stephens 4096 Oct 21 2001 . drwxr-sr-x 5 stephens 4096 Feb 3 12:29 .. drwxr-sr-x 3 stephens 4096 Oct 21 2001 backup drwxr-sr-x 2 stephens 4096 Oct 21 2001 CVS -rw-r--r-- 1 stephens 143 Feb 17 1999 run ll0.13/src/bin/addcr.t/backup: total 28 drwxr-sr-x 3 stephens 4096 Oct 21 2001 . drwxr-sr-x 4 stephens 4096 Oct 21 2001 .. drwxr-sr-x 2 stephens 4096 Oct 21 2001 CVS -rw-r--r-- 1 stephens 260 Feb 19 1999 t1.c -rw-r--r-- 1 stephens 20 Feb 17 1999 t2 -rw-r--r-- 1 stephens 41 Feb 17 1999 t3 -rw-r--r-- 1 stephens 379 Feb 17 1999 t4 ll0.13/src/bin/addcr.t/backup/CVS: total 20 drwxr-sr-x 2 stephens 4096 Oct 21 2001 . drwxr-sr-x 3 stephens 4096 Oct 21 2001 .. -rw-r--r-- 1 stephens 155 Oct 21 2001 Entries -rw-r--r-- 1 stephens 32 Oct 21 2001 Repository -rw-r--r-- 1 stephens 49 Oct 21 2001 Root ll0.13/src/bin/addcr.t/CVS: total 20 drwxr-sr-x 2 stephens 4096 Oct 21 2001 . drwxr-sr-x 4 stephens 4096 Oct 21 2001 .. -rw-r--r-- 1 stephens 49 Oct 21 2001 Entries -rw-r--r-- 1 stephens 25 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/bin/CVS: total 20 drwxr-sr-x 2 stephens 4096 Feb 3 12:29 . drwxr-sr-x 5 stephens 4096 Feb 3 12:29 .. -rw-rw-r-- 1 stephens 2533 Feb 3 12:29 Entries -rw-r--r-- 1 stephens 17 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/bin/lib: total 16 drwxr-sr-x 4 stephens 4096 Jul 23 2001 . drwxr-sr-x 5 stephens 4096 Feb 3 12:29 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS drwxr-sr-x 4 stephens 4096 Jul 23 2001 perl ll0.13/src/bin/lib/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 11 Feb 2 2001 Entries -rw-r--r-- 1 stephens 21 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/bin/lib/perl: total 16 drwxr-sr-x 4 stephens 4096 Jul 23 2001 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS drwxr-sr-x 4 stephens 4096 Jul 23 2001 ion ll0.13/src/bin/lib/perl/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 10 Feb 2 2001 Entries -rw-r--r-- 1 stephens 26 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/bin/lib/perl/ion: total 16 drwxr-sr-x 4 stephens 4096 Jul 23 2001 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. drwxr-sr-x 3 stephens 4096 Oct 20 2001 _cvs drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS ll0.13/src/bin/lib/perl/ion/_cvs: total 28 drwxr-sr-x 3 stephens 4096 Oct 20 2001 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. drwxr-sr-x 2 stephens 4096 Oct 20 2001 CVS -rw-r--r-- 1 stephens 1091 Oct 20 2001 entry.pm -rw-r--r-- 1 stephens 3296 Jun 2 2001 find.pm -rw-r--r-- 1 stephens 5268 Oct 20 2001 rlog.pm ll0.13/src/bin/lib/perl/ion/_cvs/CVS: total 20 drwxr-sr-x 2 stephens 4096 Oct 20 2001 . drwxr-sr-x 3 stephens 4096 Oct 20 2001 .. -rw-rw-r-- 1 stephens 123 Oct 20 2001 Entries -rw-r--r-- 1 stephens 35 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/bin/lib/perl/ion/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 11 Feb 2 2001 Entries -rw-r--r-- 1 stephens 30 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/hash: total 116 drwxr-sr-x 4 stephens 4096 Dec 2 2001 . drwxrwxr-x 7 stephens 4096 Feb 15 04:48 .. -rw-r--r-- 1 stephens 484 Jun 15 2001 charP_hash.c -rw-r--r-- 1 stephens 393 Nov 4 1999 charP_int_Table.c -rw-r--r-- 1 stephens 594 Apr 22 1999 charP_int_Table.def -rw-r--r-- 1 stephens 375 Feb 19 1999 charP_int_Table.h -rw-r--r-- 1 stephens 404 Nov 4 1999 charP_voidP_Table.c -rw-r--r-- 1 stephens 616 Apr 22 1999 charP_voidP_Table.def -rw-r--r-- 1 stephens 389 Feb 19 1999 charP_voidP_Table.h drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 299 Feb 19 1999 generic_Table.c -rw-r--r-- 1 stephens 804 Feb 19 1999 generic_Table.def -rw-r--r-- 1 stephens 361 Feb 19 1999 generic_Table.h -rw-r--r-- 1 stephens 11487 Nov 4 1999 hash.c -rw-r--r-- 1 stephens 7997 Nov 4 1999 hash.def -rw-r--r-- 1 stephens 1012 Nov 4 1999 hash_end.def -rw-r--r-- 1 stephens 360 Oct 12 1999 hash.h -rw-r--r-- 1 stephens 696 Nov 4 1999 int_voidP_Table.c -rw-r--r-- 1 stephens 376 Feb 19 1999 int_voidP_Table.def -rw-r--r-- 1 stephens 375 Feb 19 1999 int_voidP_Table.h -rw-r--r-- 1 stephens 371 Apr 22 1999 Makefile -rw-r--r-- 1 stephens 223 Oct 13 1999 PKG drwxr-sr-x 3 stephens 4096 Jul 23 2001 test -rw-r--r-- 1 stephens 711 Nov 4 1999 voidP_voidP_Table.c -rw-r--r-- 1 stephens 391 Apr 22 1999 voidP_voidP_Table.def -rw-r--r-- 1 stephens 388 Apr 22 1999 voidP_voidP_Table.h ll0.13/src/hash/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 4 stephens 4096 Dec 2 2001 .. -rw-r--r-- 1 stephens 1063 Jun 15 2001 Entries -rw-r--r-- 1 stephens 18 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/hash/test: total 20 drwxr-sr-x 3 stephens 4096 Jul 23 2001 . drwxr-sr-x 4 stephens 4096 Dec 2 2001 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 333 Oct 12 1999 Makefile -rw-r--r-- 1 stephens 577 Oct 12 1999 test.c ll0.13/src/hash/test/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 3 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 82 Feb 2 2001 Entries -rw-r--r-- 1 stephens 23 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/ll: total 732 drwxr-sr-x 5 stephens 4096 Feb 15 04:48 . drwxrwxr-x 7 stephens 4096 Feb 15 04:48 .. -rwxr--r-- 1 stephens 1232 Jan 14 2001 ar.c -rwxr--r-- 1 stephens 890 Jan 14 2001 assert.c -rwxr--r-- 1 stephens 2124 Apr 3 2001 assert.h -rw-r--r-- 1 stephens 476 Oct 2 1999 bcode.h -rwxrw-r-- 1 stephens 48094 Feb 15 04:29 bcompile.c -rw-r--r-- 1 stephens 1644 Jun 28 1999 bcompile.h -rw-r--r-- 1 stephens 2318 Oct 13 1999 bc.pl -rwxr--r-- 1 stephens 3270 Jan 14 2001 binding.c -rwxrw-r-- 1 stephens 20763 Feb 15 04:30 bmethod.c -rwxr--r-- 1 stephens 604 Jan 14 2001 bool.c -rwxr--r-- 1 stephens 1197 Jan 14 2001 cadr.c -rw-r--r-- 1 stephens 1339 Jun 28 1999 cadr.h -rwxr--r-- 1 stephens 1654 Apr 3 2001 call.c -rw-r--r-- 1 stephens 3363 Oct 13 1999 call.h -rw-rw-r-- 1 stephens 6087 Feb 15 04:31 call_int.h -rwxr--r-- 1 stephens 4224 Jan 14 2001 catch.c -rwxr--r-- 1 stephens 6197 Jan 14 2001 cfold.c -rwxr--r-- 1 stephens 2583 Jan 14 2001 char.c -rw-rw-r-- 1 stephens 232 Aug 13 2001 config.mak -rw-r--r-- 1 stephens 185 Oct 13 1999 config.pl -rwxr--r-- 1 stephens 5347 Jan 14 2001 cons.c -rwxr--r-- 1 stephens 1133 Jan 14 2001 constant.c -rw-r--r-- 1 stephens 393 Dec 3 1999 cops.h drwxr-sr-x 2 stephens 4096 Feb 15 04:40 CVS -rwxr--r-- 1 stephens 982 Jan 14 2001 debug.c -rwxrw-r-- 1 stephens 13605 Feb 15 04:31 debugger.c -rwxr--r-- 1 stephens 2264 Apr 3 2001 defs.pl -rw-r--r-- 1 stephens 645 Oct 13 1999 defs.sh -rwxr--r-- 1 stephens 1795 Apr 3 2001 doc.c -rwxrw-r-- 1 stephens 13297 Feb 15 04:34 env.c -rw-r--r-- 1 stephens 411 Oct 13 1999 env.ll -rwxr--r-- 1 stephens 3897 Jan 14 2001 eq.c -rwxr--r-- 1 stephens 7836 Apr 3 2001 error.c -rw-r--r-- 1 stephens 2345 Apr 22 2002 eval.c -rwxr--r-- 1 stephens 6574 Jan 14 2001 fixnum.c -rw-r--r-- 1 stephens 1086 Oct 2 1999 floatcfg.c -rwxr--r-- 1 stephens 3646 Jan 14 2001 flonum.c -rwxr--r-- 1 stephens 3813 Jan 14 2001 fluid.c -rwxr--r-- 1 stephens 4386 Jan 14 2001 format.c -rw-r--r-- 1 stephens 533 Oct 1 1999 global1.h -rw-r--r-- 1 stephens 386 Oct 1 1999 global.h -rwxr--r-- 1 stephens 3512 Jan 14 2001 init.c -rw-rw-r-- 1 stephens 1099 Feb 15 04:32 init.h -rw-r--r-- 1 stephens 432 Oct 13 1999 inits.c -rw-r--r-- 1 stephens 1631 Nov 4 1999 lcache.c -rw-r--r-- 1 stephens 851 Nov 4 1999 lcache.h drwxr-sr-x 4 stephens 4096 Jul 23 2001 lib -rw-r--r-- 1 stephens 10130 Nov 4 1999 lispread.c -rwxr--r-- 1 stephens 8604 Jan 14 2001 list.c -rw-r--r-- 1 stephens 12532 Apr 22 2002 ll.h -rw-r--r-- 1 stephens 354 Mar 28 1999 llt.c -rw-r--r-- 1 stephens 484 Oct 13 1999 llt.gdb -rwxr--r-- 1 stephens 2472 Jan 14 2001 load.c -rwxr--r-- 1 stephens 1025 Jan 14 2001 locative.c -rw-rw-r-- 1 stephens 8830 Aug 13 2001 lookup.c -rwxr--r-- 1 stephens 4701 Apr 3 2001 macro.c -rw-rw-r-- 1 stephens 6055 Aug 13 2001 Makefile -rw-rw-r-- 1 stephens 3385 Feb 15 04:34 map.c -rw-r--r-- 1 stephens 1851 Oct 13 1999 mem.c -rwxrw-r-- 1 stephens 1798 Feb 15 04:34 meth.c -rwxr--r-- 1 stephens 2337 Apr 3 2001 named.c -rwxrw-r-- 1 stephens 1044 Feb 15 04:34 nil.c -rwxr--r-- 1 stephens 4449 Jan 14 2001 number.c -rwxr--r-- 1 stephens 4408 Jan 14 2001 num.c -rw-r--r-- 1 stephens 2532 Mar 24 1999 objdump.c -rwxr--r-- 1 stephens 3524 Jan 14 2001 object.c -rw-r--r-- 1 stephens 374 Oct 1 1999 op1.h -rwxr--r-- 1 stephens 7412 Jun 2 2001 op.c -rw-r--r-- 1 stephens 414 Oct 13 1999 op.h -rw-r--r-- 1 stephens 362 Oct 13 1999 ops.c -rw-rw-r-- 1 stephens 401 Feb 15 04:33 PKG -rwxr--r-- 1 stephens 7503 Jan 14 2001 port.c -rwxr--r-- 1 stephens 877 Jan 14 2001 posix.c -rwxr--r-- 1 stephens 4001 Apr 3 2001 prim.c -rwxrw-r-- 1 stephens 6943 Feb 15 04:32 prim.h -rw-r--r-- 1 stephens 519 Oct 13 1999 prims.c -rwxr--r-- 1 stephens 1634 Jan 14 2001 props.c -rw-r--r-- 1 stephens 3299 Dec 3 1999 read.c -rw-rw-r-- 1 stephens 5051 Feb 15 04:44 readline.c -rw-r--r-- 1 stephens 11387 Apr 12 1999 README -rwxr--r-- 1 stephens 5274 Apr 3 2001 sig.c -rwxr--r-- 1 stephens 385 Jan 14 2001 sig.h drwxr-sr-x 4 stephens 4096 Jul 23 2001 src -rwxr--r-- 1 stephens 7694 Jun 15 2001 stack.c -rwxr--r-- 1 stephens 4158 Apr 3 2001 stack.h -rwxr--r-- 1 stephens 10066 Jan 14 2001 string.c -rw-r--r-- 1 stephens 411 Oct 2 1999 symbol1.h -rwxr--r-- 1 stephens 6276 Apr 3 2001 symbol.c -rw-r--r-- 1 stephens 408 Oct 13 1999 symbol.h -rw-r--r-- 1 stephens 467 Oct 13 1999 symbols.c -rwxrw-r-- 1 stephens 18843 Feb 15 04:34 syntax.c -rw-r--r-- 1 stephens 136 Feb 19 1999 test.gdb -rw-r--r-- 1 stephens 1757 Mar 24 1999 testold.c -rw-r--r-- 1 stephens 287 Nov 4 1999 TODO -rw-rw-r-- 1 stephens 5242 Feb 15 04:34 toplevel.c -rwxr--r-- 1 stephens 2046 Jan 14 2001 trace.c -rw-rw-r-- 1 stephens 17527 Feb 15 04:33 type.c -rw-r--r-- 1 stephens 988 Oct 1 1999 type.h -rwxr--r-- 1 stephens 30098 Jun 2 2001 types.h -rw-r--r-- 1 stephens 421 Oct 1 1999 undef.c -rw-r--r-- 1 stephens 5851 Oct 2 1999 value.h -rwxr--r-- 1 stephens 13960 Jan 14 2001 vec.c -rw-r--r-- 1 stephens 659 Feb 19 1999 vec.h -rwxrw-r-- 1 stephens 1478 Feb 15 04:44 vector.c -rw-rw-r-- 1 stephens 10112 Aug 13 2001 write.c ll0.13/src/ll/CVS: total 24 drwxr-sr-x 2 stephens 4096 Feb 15 04:40 . drwxr-sr-x 5 stephens 4096 Feb 15 04:48 .. -rw-rw-r-- 1 stephens 4131 Feb 15 04:40 Entries -rw-r--r-- 1 stephens 16 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/ll/lib: total 16 drwxr-sr-x 4 stephens 4096 Jul 23 2001 . drwxr-sr-x 5 stephens 4096 Feb 15 04:48 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS drwxr-sr-x 4 stephens 4096 Feb 15 04:48 ll ll0.13/src/ll/lib/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 9 Feb 2 2001 Entries -rw-r--r-- 1 stephens 20 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/ll/lib/ll: total 36 drwxr-sr-x 4 stephens 4096 Feb 15 04:48 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 366 Mar 3 1999 fluid.ll -rw-r--r-- 1 stephens 1227 Mar 3 1999 let.scm -rwxr--r-- 1 stephens 2071 Jan 14 2001 match.scm -rw-r--r-- 1 stephens 1487 Oct 1 1999 outliner.ll -rw-r--r-- 1 stephens 1316 Mar 2 1999 strstrm.ll drwxr-sr-x 3 stephens 4096 Feb 15 04:40 test ll0.13/src/ll/lib/ll/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 4 stephens 4096 Feb 15 04:48 .. -rw-r--r-- 1 stephens 221 Feb 2 2001 Entries -rw-r--r-- 1 stephens 23 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/ll/lib/ll/test: total 52 drwxr-sr-x 3 stephens 4096 Feb 15 04:40 . drwxr-sr-x 4 stephens 4096 Feb 15 04:48 .. -rwxr--r-- 1 stephens 363 Jan 14 2001 closed.scm drwxr-sr-x 2 stephens 4096 Feb 15 04:40 CVS -rw-rw-r-- 1 stephens 649 Feb 15 04:44 mycons.scm -rw-rw-r-- 1 stephens 644 Feb 15 04:27 mycons.scm.~1.2.~ -rwxr--r-- 1 stephens 27748 Jul 9 2001 test.scm ll0.13/src/ll/lib/ll/test/CVS: total 20 drwxr-sr-x 2 stephens 4096 Feb 15 04:40 . drwxr-sr-x 3 stephens 4096 Feb 15 04:40 .. -rw-rw-r-- 1 stephens 129 Feb 15 04:40 Entries -rw-r--r-- 1 stephens 28 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/ll/src: total 16 drwxr-sr-x 4 stephens 4096 Jul 23 2001 . drwxr-sr-x 5 stephens 4096 Feb 15 04:48 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS drwxr-sr-x 5 stephens 4096 Jul 23 2001 include ll0.13/src/ll/src/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 14 Feb 2 2001 Entries -rw-r--r-- 1 stephens 20 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/ll/src/include: total 20 drwxr-sr-x 5 stephens 4096 Jul 23 2001 . drwxr-sr-x 4 stephens 4096 Jul 23 2001 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS drwxr-sr-x 3 stephens 4096 Jul 23 2001 ll drwxr-sr-x 3 stephens 4096 Jul 23 2001 readline ll0.13/src/ll/src/include/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 5 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 24 Feb 2 2001 Entries -rw-r--r-- 1 stephens 28 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/ll/src/include/ll: total 56 drwxr-sr-x 3 stephens 4096 Jul 23 2001 . drwxr-sr-x 5 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 91 Oct 1 1999 bcs.h drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 97 Oct 1 1999 debugs.h -rw-r--r-- 1 stephens 93 Mar 10 1999 errors.h -rw-r--r-- 1 stephens 137 Mar 10 1999 floatcfg.h -rw-r--r-- 1 stephens 94 Oct 1 1999 globals.h -rw-r--r-- 1 stephens 95 Oct 1 1999 inits.h -rw-r--r-- 1 stephens 82 Oct 1 1999 macros.h -rw-r--r-- 1 stephens 90 Oct 1 1999 ops.h -rw-r--r-- 1 stephens 92 Oct 1 1999 prims.h -rw-r--r-- 1 stephens 156 Mar 4 1999 README -rw-r--r-- 1 stephens 94 Oct 1 1999 symbols.h ll0.13/src/ll/src/include/ll/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 3 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 447 Feb 2 2001 Entries -rw-r--r-- 1 stephens 31 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/ll/src/include/readline: total 24 drwxr-sr-x 3 stephens 4096 Jul 23 2001 . drwxr-sr-x 5 stephens 4096 Jul 23 2001 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 8530 Mar 12 1999 history.h ll0.13/src/ll/src/include/readline/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 3 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 44 Feb 2 2001 Entries -rw-r--r-- 1 stephens 37 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/maks: total 68 drwxr-sr-x 7 stephens 4096 Jul 23 2001 . drwxrwxr-x 7 stephens 4096 Feb 15 04:48 .. -rwxr--r-- 1 stephens 4407 Apr 4 2001 basic.mak drwxr-sr-x 3 stephens 4096 Jul 23 2001 bin drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 172 Feb 19 1999 fixpound.pl -rwxr--r-- 1 stephens 2246 Apr 3 2001 lib.mak drwxr-sr-x 3 stephens 4096 Jul 23 2001 opengl drwxr-sr-x 3 stephens 4096 Jul 23 2001 os -rwxr--r-- 1 stephens 206 Apr 3 2001 PKG -rwxr--r-- 1 stephens 6667 Apr 3 2001 pre.mak -rw-r--r-- 1 stephens 1651 Mar 21 2000 tool.mak -rw-r--r-- 1 stephens 212 Sep 9 1999 tools.mak -rwxr--r-- 1 stephens 494 Apr 3 2001 use.mak drwxr-sr-x 3 stephens 4096 Jul 23 2001 win32 ll0.13/src/maks/bin: total 20 drwxr-sr-x 3 stephens 4096 Jul 23 2001 . drwxr-sr-x 7 stephens 4096 Jul 23 2001 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 418 Jun 28 1999 mak -rw-r--r-- 1 stephens 106 Jun 28 1999 mak.bat ll0.13/src/maks/bin/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 3 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 78 Feb 2 2001 Entries -rw-r--r-- 1 stephens 22 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/maks/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 7 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 370 Apr 4 2001 Entries -rw-r--r-- 1 stephens 18 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/maks/opengl: total 20 drwxr-sr-x 3 stephens 4096 Jul 23 2001 . drwxr-sr-x 7 stephens 4096 Jul 23 2001 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 75 Feb 19 1999 Makefile -rwxr--r-- 1 stephens 472 Jul 9 2001 Makefile.use ll0.13/src/maks/opengl/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 3 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 88 Jul 9 2001 Entries -rw-r--r-- 1 stephens 25 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/maks/os: total 24 drwxr-sr-x 3 stephens 4096 Jul 23 2001 . drwxr-sr-x 7 stephens 4096 Jul 23 2001 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 116 Jan 13 2000 CYGWIN_98-4.10.mak -rw-r--r-- 1 stephens 88 Jan 13 2000 CYGWIN.mak -rw-r--r-- 1 stephens 77 Jan 13 2000 Linux.mak ll0.13/src/maks/os/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 3 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 138 Feb 2 2001 Entries -rw-r--r-- 1 stephens 21 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/maks/win32: total 20 drwxr-sr-x 3 stephens 4096 Jul 23 2001 . drwxr-sr-x 7 stephens 4096 Jul 23 2001 .. drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS -rw-r--r-- 1 stephens 75 Feb 19 1999 Makefile -rw-r--r-- 1 stephens 101 Feb 19 1999 Makefile.use ll0.13/src/maks/win32/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 3 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 88 Feb 2 2001 Entries -rw-r--r-- 1 stephens 24 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/util: total 252 drwxr-sr-x 4 stephens 4096 Feb 15 04:48 . drwxrwxr-x 7 stephens 4096 Feb 15 04:48 .. -rw-r--r-- 1 stephens 712 Jan 7 2000 bitset.h -rw-r--r-- 1 stephens 4571 Sep 30 1999 charset.c -rw-r--r-- 1 stephens 943 Apr 22 1999 charset.h -rw-r--r-- 1 stephens 21030 Jan 4 2000 ConfigInfo.c -rw-r--r-- 1 stephens 4826 Apr 5 1999 ConfigInfo.h drwxr-sr-x 2 stephens 4096 Nov 13 13:00 CVS -rw-r--r-- 1 stephens 3438 Jan 13 2000 enum.c -rw-r--r-- 1 stephens 790 Jan 13 2000 enum.h -rw-r--r-- 1 stephens 184 Jan 13 2000 errlist.h -rw-r--r-- 1 stephens 684 Oct 26 1999 errlist.pl -rw-rw-r-- 1 stephens 11771 Nov 13 13:05 file.c -rw-rw-r-- 1 stephens 11771 Nov 13 13:00 file.c.~1.5.~ -rw-r--r-- 1 stephens 1276 Feb 1 2001 file.h -rw-rw-r-- 1 stephens 1044 Aug 13 2001 GUMakefile -rw-r--r-- 1 stephens 1113 Jan 4 2000 host.c -rw-r--r-- 1 stephens 335 Jan 4 2000 host.h -rw-r--r-- 1 stephens 5782 Jan 4 2000 lockfile.c -rw-r--r-- 1 stephens 781 Jun 9 1999 lockfile.h -rw-r--r-- 1 stephens 949 Jun 9 1999 lockfile_main.c -rw-r--r-- 1 stephens 1081 Jan 4 2000 Makefile -rw-r--r-- 1 stephens 86 Feb 19 1999 Makefile.use -rw-r--r-- 1 stephens 3146 Feb 19 1999 mem.c -rw-r--r-- 1 stephens 457 Apr 5 2001 memcpy.h -rw-r--r-- 1 stephens 575 Jun 28 1999 mem.h -rw-r--r-- 1 stephens 1875 Oct 13 1999 midi.h -rw-rw-r-- 1 stephens 2962 Aug 6 2001 nurbs.c -rw-r--r-- 1 stephens 1079 Apr 22 2001 nurbs.h -rw-r--r-- 1 stephens 1837 Jan 4 2000 outbuf.c -rw-r--r-- 1 stephens 726 Sep 30 1999 outbuf.h -rw-r--r-- 1 stephens 2609 Jun 28 1999 path.c -rw-r--r-- 1 stephens 651 Feb 19 1999 path.h -rw-r--r-- 1 stephens 249 May 7 1999 PKG -rw-r--r-- 1 stephens 904 Jan 4 2000 port.c -rw-r--r-- 1 stephens 236 Jan 4 2000 port.h -rw-r--r-- 1 stephens 4366 Jan 13 2000 prime.c -rw-r--r-- 1 stephens 388 Jan 13 2000 prime.h -rw-r--r-- 1 stephens 1192 May 9 2000 rc4.c -rw-r--r-- 1 stephens 399 May 9 2000 rc4.h -rw-r--r-- 1 stephens 1301 Apr 5 2001 refcntptr.cc -rw-r--r-- 1 stephens 2636 Apr 19 2001 refcntptr.hh -rw-r--r-- 1 stephens 1317 Apr 5 1999 setenv.c -rw-r--r-- 1 stephens 377 Apr 5 1999 setenv.h -rw-r--r-- 1 stephens 1345 Jan 4 2000 sig.c -rw-r--r-- 1 stephens 348 Jan 4 2000 sig.h -rw-r--r-- 1 stephens 533 Jan 4 2000 sigs.pl -rw-r--r-- 1 stephens 2015 Jan 4 2000 ssprintf.c -rw-r--r-- 1 stephens 337 Apr 22 1999 ssprintf.h drwxr-sr-x 3 stephens 4096 Jul 23 2001 test ll0.13/src/util/CVS: total 20 drwxr-sr-x 2 stephens 4096 Nov 13 13:00 . drwxr-sr-x 4 stephens 4096 Feb 15 04:48 .. -rw-rw-r-- 1 stephens 1849 Nov 13 13:00 Entries -rw-r--r-- 1 stephens 18 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root ll0.13/src/util/test: total 20 drwxr-sr-x 3 stephens 4096 Jul 23 2001 . drwxr-sr-x 4 stephens 4096 Feb 15 04:48 .. -rw-r--r-- 1 stephens 1192 May 7 1999 ConfigTest.c -rw-r--r-- 1 stephens 44 May 7 1999 ConfigTest.cfg drwxr-sr-x 2 stephens 4096 Aug 13 2001 CVS ll0.13/src/util/test/CVS: total 20 drwxr-sr-x 2 stephens 4096 Aug 13 2001 . drwxr-sr-x 3 stephens 4096 Jul 23 2001 .. -rw-r--r-- 1 stephens 94 Feb 2 2001 Entries -rw-r--r-- 1 stephens 23 Feb 2 2001 Repository -rw-rw-r-- 1 stephens 49 Aug 13 2001 Root