Changeset 35340 in project


Ignore:
Timestamp:
03/25/18 08:12:25 (4 months ago)
Author:
kon
Message:

add types

Location:
release/4/message-digest/trunk
Files:
2 edited

Legend:

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

    r35339 r35340  
    3636(include "message-digest-types")
    3737
    38 ;;; Message Digest API
    39 
    40 ;; Update
    41 
    4238;;
    43 
    44 (define (message-digest-update-blob md blb #!optional (start 0) (end (blob-size blb)))
    45   (*message-digest-update-blob
    46     (check-message-digest 'message-digest-update-blob md)
    47     (check-blob/slice 'message-digest-update-blob blb start end)) )
    48 
    49 ;;
    50 
    51 (define (message-digest-update-string md str #!optional (start 0) (end (string-length str)))
    52   (*message-digest-update-string
    53     (check-message-digest 'message-digest-update-string md)
    54     (check-string/slice 'message-digest-update-string str start end)) )
    55 
    56 ;;
    57 
    58 ;DEPRECATED
    59 (define (message-digest-update-substring md str start end)
    60   (*message-digest-update-string
    61     (check-message-digest 'message-digest-update-substring md)
    62     (substring/shared (check-string 'message-digest-update-substring str) start end)) )
    63 
    64 ;; Single Source API
    65 
    66 (define (message-digest-blob mdp blb
    67             #!optional
    68             (result-type (message-digest-result-form))
    69             (start 0) (end (blob-size blb)))
    70   (let (
    71     (md (initialize-message-digest mdp)) )
    72     (message-digest-update-blob md blb start end)
    73     (finalize-message-digest md result-type) ) )
    74 
    75 (define (message-digest-string mdp str
    76             #!optional
    77             (result-type (message-digest-result-form))
    78             (start 0) (end (string-length str)))
    79   (let (
    80     (md (initialize-message-digest mdp)) )
    81     (message-digest-update-string md str start end)
    82     (finalize-message-digest md result-type) ) )
    83 
    84 (define (message-digest-blob! mdp blb result-buffer
    85             #!optional
    86             (start 0) (end (blob-size blb)))
    87   (let (
    88     (md (initialize-message-digest mdp)) )
    89     (message-digest-update-blob md blb start end)
    90     (finalize-message-digest! md result-buffer) ) )
    91 
    92 (define (message-digest-string! mdp str result-buffer
    93             #!optional
    94             (start 0) (end (string-length str)))
    95   (let (
    96     (md (initialize-message-digest mdp)) )
    97     (message-digest-update-string md str start end)
    98     (finalize-message-digest! md result-buffer) ) )
    99 
    100 ;;;
    10139
    10240(define (check-blob/slice loc blb start end)
     
    11452    "end < start") )
    11553
     54;;; Message Digest API
     55
     56;; Update
     57
     58;;
     59
     60;FIXME using & then checking !
     61
     62(define: (message-digest-update-blob (md message-digest) (blb blob) . (opts list)) -> void
     63  (let-optionals* opts (
     64    (start 0)
     65    (end (blob-size blb)) )
     66    (*message-digest-update-blob
     67      (check-message-digest 'message-digest-update-blob md)
     68      (check-blob/slice 'message-digest-update-blob blb start end)) ) )
     69
     70;;
     71
     72(define: (message-digest-update-string (md message-digest) (str string) . (opts list)) -> void
     73  (let-optionals* opts (
     74    (start 0)
     75    (end (string-length str)) )
     76    (*message-digest-update-string
     77      (check-message-digest 'message-digest-update-string md)
     78      (check-string/slice 'message-digest-update-string str start end)) ) )
     79
     80;;
     81
     82;; Single Source API
     83
     84(define: (message-digest-blob (mdp message-digest-primitive) (blb blob) . (opts list)) -> message-digest-result-form
     85  (let-optionals* opts (
     86    (result-type (message-digest-result-form))
     87    (start 0)
     88    (end (blob-size blb)) )
     89    (let (
     90      (md (initialize-message-digest mdp)) )
     91      (message-digest-update-blob md blb start end)
     92      (finalize-message-digest md result-type) ) ) )
     93
     94(define: (message-digest-string (mdp message-digest-primitive) (str string) . (opts list)) -> message-digest-result-form
     95  (let-optionals* opts (
     96    (result-type (message-digest-result-form))
     97    (start 0)
     98    (end (string-length str)) )
     99    (let (
     100      (md (initialize-message-digest mdp)) )
     101      (message-digest-update-string md str start end)
     102      (finalize-message-digest md result-type) ) ) )
     103
     104(define: (message-digest-blob! (mdp message-digest-primitive) (blb blob) (buf message-digest-buffer) . (opts list)) -> message-digest-result-form
     105  (let-optionals* opts (
     106    (start 0)
     107    (end (blob-size blb)) )
     108    (let (
     109      (md (initialize-message-digest mdp)) )
     110      (message-digest-update-blob md blb start end)
     111      (finalize-message-digest! md buf) ) ) )
     112
     113(define: (message-digest-string! (mdp message-digest-primitive) (str string) (buf message-digest-buffer) . (opts list)) -> message-digest-result-form
     114  (let-optionals* opts (
     115    (start 0)
     116    (end (string-length str)) )
     117    (let (
     118      (md (initialize-message-digest mdp)) )
     119      (message-digest-update-string md str start end)
     120      (finalize-message-digest! md buf) ) ) )
     121
     122;;DEPRECATED
     123
     124(: message-digest-update-substring deprecated)
     125(define (message-digest-update-substring md str start end)
     126  (*message-digest-update-string
     127    (check-message-digest 'message-digest-update-substring md)
     128    (substring/shared (check-string 'message-digest-update-substring str) start end)) )
     129
    116130) ;module message-digest-bv
  • release/4/message-digest/trunk/message-digest-port.scm

    r35339 r35340  
    6565  obj )
    6666
    67 ; Synthesize a port-name from a primitive-name
     67;Synthesize a port-name from a primitive-name
    6868(define (make-digest-port-name mdp)
    6969  (let* (
Note: See TracChangeset for help on using the changeset viewer.