Changeset 35345 in project


Ignore:
Timestamp:
03/26/18 03:13:19 (6 months ago)
Author:
kon
Message:

reflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/message-digest/trunk/message-digest-update-item.scm

    r35044 r35345  
    1616
    1717(import scheme chicken)
    18 
    1918(use
    2019  (only lolevel number-of-bytes pointer?)
     
    2928  message-digest-support
    3029  type-checks
    31   type-errors)
     30  type-errors
     31  typed-define)
    3232
    3333;;; Support
     
    3737;=> #f or converted-chunk
    3838(define (chunk-convert obj)
    39   (and-let* ((cnv (message-digest-chunk-converter)))
     39  (and-let* (
     40    (cnv (message-digest-chunk-converter)) )
    4041    (cnv obj) ) )
    4142
     
    7374
    7475(define (do-procedure-update loc md proc start end)
    75   (let ((s-updt (get-update md))
    76         (r-updt (get-raw-update md))
    77         (ctx (message-digest-context md)) )
     76  (let (
     77    (src-updt (get-update md))
     78    (raw-updt (get-raw-update md))
     79    (ctx (message-digest-context md)) )
    7880    ;note the 'src' object (return of proc) may or may not be unique
    7981    (while* (proc)
    80       (do-byte-source-update loc ctx it s-updt r-updt start end) ) ) )
     82      (do-byte-source-update loc ctx it src-updt raw-updt start end) ) ) )
    8183
    82 (define (do-byte-source-update loc ctx src s-updt r-updt start end)
     84(define (do-byte-source-update loc ctx src src-updt raw-updt start end)
    8385  (cond
    8486    ; simple bytes
    8587    ((blob? src)
    8688      (let ((src (blob/slice src start end)))
    87           (s-updt ctx src (blob-size src)) ) )
     89          (src-updt ctx src (blob-size src)) ) )
    8890    ((string? src)
    8991      (let ((src (string/slice src start end)))
    90           (s-updt ctx src (string-length src)) ) )
     92          (src-updt ctx src (string-length src)) ) )
    9193    ((message-digest-raw-chunk? src)
    9294      (let* ((obj (message-digest-raw-chunk-object src))
    93              (updtr (if (pointer? obj) r-updt s-updt)))
     95             (updtr (if (pointer? obj) raw-updt src-updt)))
    9496        (unless updtr
    9597          (error loc "primitive does not support raw-update") )
     
    101103    ; more complicated bytes
    102104    ((object->bytevector-like src) =>
    103         (cut do-byte-source-update loc ctx <> s-updt r-updt start end) )
     105        (cut do-byte-source-update loc ctx <> src-updt raw-updt start end) )
    104106    ; too complicated bytes
    105107    (else
     
    159161
    160162(define (*message-digest-update-file/fileno loc md flnm)
    161   (let ((fd (file-open flnm open/rdonly)))
     163  (let (
     164    (fd (file-open flnm open/rdonly)) )
    162165    (handle-exceptions
    163166      ;as
     
    172175
    173176(define (*message-digest-update-file/port loc md flnm)
    174   (let ((in (open-input-file flnm)))
     177  (let (
     178    (in (open-input-file flnm)) )
    175179    (handle-exceptions
    176180      ;as
     
    184188    (close-input-port in) ) )
    185189
    186 #;
     190#; ;book implementation
    187191(define (message-digest-update-file md flnm)
    188192  (let ((in #f))
Note: See TracChangeset for help on using the changeset viewer.