Changeset 16950 in project


Ignore:
Timestamp:
01/06/10 12:43:59 (11 years ago)
Author:
Alaric Snell-Pym
Message:

Made Ugarit compile with chicken 4

Location:
release/4/ugarit/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/4/ugarit/trunk/backend-devtools.scm

    r15241 r16950  
    9393      (lambda (tag key) ; set-tag!
    9494         (begin
    95             (printf "~A: (set-tag! ~A)\n" name tag key)
     95            (printf "~A: (set-tag! ~A ~A)\n" name tag key)
    9696            ((storage-set-tag! be) tag key)))
    9797      (lambda (tag) ; tag
  • release/4/ugarit/trunk/posixextras.scm

    r15242 r16950  
    8585   
    8686 
    87 (define-foreign-variable _seek_set int "SEEK_SET")
    88 (define-foreign-variable _seek_cur int "SEEK_CUR")
    89 (define-foreign-variable _seek_end int "SEEK_END")
     87;; (define-foreign-variable _seek_set int "SEEK_SET")
     88;; (define-foreign-variable _seek_cur int "SEEK_CUR")
     89;; (define-foreign-variable _seek_end int "SEEK_END")
    9090 
    91 (define set-file-position!
    92    (lambda (port pos . whence)
    93      (let ([whence (if (pair? whence) (car whence) _seek_set)])
    94        (##sys#check-exact pos 'set-file-position!)
    95        (##sys#check-exact whence 'set-file-position!)
    96        (when (fx< pos 0) (##sys#signal-hook #:bounds-error 'set-file-position! "invalid negative port position" pos port))
    97        (unless (cond [(port? port)
    98      (and (eq? (##sys#slot port 7) 'stream)
    99        (##core#inline "C_fseek" port pos whence) ) ]
    100      [(fixnum? port) (##core#inline "C_lseek" port pos whence)]
    101      [else (##sys#signal-hook #:type-error 'set-file-position! "invalid file" port)] )
    102    (posix-error #:file-error 'set-file-position! "cannot set file position" port pos) ) ) ) )
     91;; (define set-file-position!
     92;;    (lambda (port pos . whence)
     93;;      (let ([whence (if (pair? whence) (car whence) _seek_set)])
     94;;        (##sys#check-exact pos 'set-file-position!)
     95;;        (##sys#check-exact whence 'set-file-position!)
     96;;        (when (fx< pos 0) (##sys#signal-hook #:bounds-error 'set-file-position! "invalid negative port position" pos port))
     97;;        (unless (cond [(port? port)
     98;;      (and (eq? (##sys#slot port 7) 'stream)
     99;;        (##core#inline "C_fseek" port pos whence) ) ]
     100;;      [(fixnum? port) (##core#inline "C_lseek" port pos whence)]
     101;;      [else (##sys#signal-hook #:type-error 'set-file-position! "invalid file" port)] )
     102;;    (posix-error #:file-error 'set-file-position! "cannot set file position" port pos) ) ) ) )
    103103
  • release/4/ugarit/trunk/ugarit-core.scm

    r15242 r16950  
    139139         (make-keyed-hash (lambda (hash key) (lambda (block type) (hash (string-append key (hash block) (symbol->string type)))))))
    140140   (match config
    141       ((or #f ('tiger)) (make-basic-hash tiger192:digest))
    142       (('tiger key) (make-keyed-hash tiger192:digest key))
    143       (('sha256) (make-basic-hash sha256:digest))
    144       (('sha256 key) (make-keyed-hash sha256:digest key))
    145       (('sha384) (make-basic-hash sha384:digest))
    146       (('sha384 key) (make-keyed-hash sha384:digest key))
    147       (('sha512) (make-basic-hash sha512:digest))
    148       (('sha512 key) (make-keyed-hash sha512:digest key))
     141      ((or #f ('tiger)) (make-basic-hash tiger192-digest))
     142      (('tiger key) (make-keyed-hash tiger192-digest key))
     143      (('sha256) (make-basic-hash sha256-digest))
     144      (('sha256 key) (make-keyed-hash sha256-digest key))
     145      (('sha384) (make-basic-hash sha384-digest))
     146      (('sha384 key) (make-keyed-hash sha384-digest key))
     147      (('sha512) (make-basic-hash sha512-digest))
     148      (('sha512 key) (make-keyed-hash sha512-digest key))
    149149      (else (signal (make-property-condition 'exn 'message "Unknown hash algorithm" 'arguments config))))))
    150150
     
    165165                (length (car keyspec))
    166166                (passphrase (get-passphrase (cadr keyspec)))
    167                 (key (sha512:binary-digest passphrase)))
     167                (key (sha512-binary-digest passphrase)))
    168168            (if (> length 64) ; 512 bits = 64 bytes
    169169               (signal (make-property-condition 'exn 'message "Cannot generate a key that large due to a shortage of a big enough hash function (max 64)" 'arguments keyspec))
     
    181181               (stir-iv! (lambda (iv block)
    182182                  (move-memory! (string->blob
    183                      (tiger192:binary-digest (string-append (tiger192:binary-digest block) (blob->string iv))))
     183                     (tiger192-binary-digest (string-append (tiger192-binary-digest block) (blob->string iv))))
    184184                     iv 16))))
    185185               
    186186               ; Generate initial IV from the key and current time
    187                (move-memory! (string->blob (tiger192:binary-digest
     187               (move-memory! (string->blob (tiger192-binary-digest
    188188                  (string-append (blob->string key) (number->string (time->seconds (current-time)))))) iv 16)
    189189
Note: See TracChangeset for help on using the changeset viewer.