Changeset 34302 in project


Ignore:
Timestamp:
08/20/17 22:00:29 (3 months ago)
Author:
kon
Message:

add message-digest-result-form, dep message-digest-default-result-type. per alvarom@… email Chicken 4.8.0.5 has prob w/ sym consts.

Location:
release/4/message-digest
Files:
9 edited
16 copied

Legend:

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

    r34300 r34302  
    6464;; Single Source API
    6565
    66 (define (message-digest-string mdp str #!optional (result-type (message-digest-default-result-type)))
     66(define (message-digest-string mdp str #!optional (result-type (message-digest-result-form)))
    6767  (let ((md (initialize-message-digest mdp)))
    6868    (message-digest-update-string md str)
    6969    (finalize-message-digest md result-type) ) )
    7070
    71 (define (message-digest-blob mdp blb #!optional (result-type (message-digest-default-result-type)))
     71(define (message-digest-blob mdp blb #!optional (result-type (message-digest-result-form)))
    7272  (let ((md (initialize-message-digest mdp)))
    7373    (message-digest-update-blob md blb)
  • release/4/message-digest/tags/3.3.0/message-digest-item.scm

    r34300 r34302  
    2424;;; Single Source API
    2525
    26 (define (message-digest-object mdp obj #!optional (result-type (message-digest-default-result-type)))
     26(define (message-digest-object mdp obj #!optional (result-type (message-digest-result-form)))
    2727  (let ((md (initialize-message-digest mdp)))
    2828    (message-digest-update-object md obj)
    2929    (finalize-message-digest md result-type) ) )
    3030
    31 (define (message-digest-file mdp flnm #!optional (result-type (message-digest-default-result-type)))
     31(define (message-digest-file mdp flnm #!optional (result-type (message-digest-result-form)))
    3232  (let ((md (initialize-message-digest mdp)))
    3333    (message-digest-update-file md flnm)
    3434    (finalize-message-digest md result-type) ) )
    3535
    36 (define (message-digest-port mdp port #!optional (result-type (message-digest-default-result-type)))
     36(define (message-digest-port mdp port #!optional (result-type (message-digest-result-form)))
    3737  (let ((md (initialize-message-digest mdp)))
    3838    (message-digest-update-port md port)
  • release/4/message-digest/tags/3.3.0/message-digest-parameters.scm

    r34300 r34302  
    2929  srfi-4)
    3030
     31(require-extension
     32  miscmacros)
     33
    3134;;; Update Phase Helpers
    3235
     
    5558;;
    5659
    57 (define message-digest-chunk-size (make-parameter DEFAULT-CHUNK-SIZE
     60(define-parameter message-digest-chunk-size DEFAULT-CHUNK-SIZE
    5861  (lambda (x)
    5962    (cond
     
    6265      (else
    6366        (warning 'message-digest-chunk-size "invalid positive-fixnum" x)
    64         (message-digest-chunk-size) ) ) ) ) )
     67        (message-digest-chunk-size) ) ) ) )
    6568
    6669;;
    6770
    68 (define message-digest-chunk-read-maker (make-parameter default-chunk-read-maker
     71(define-parameter message-digest-chunk-read-maker default-chunk-read-maker
    6972  (lambda (x)
    7073    (cond
     
    7376      (else
    7477        (warning 'message-digest-chunk-read-maker "invalid procedure" x)
    75         (message-digest-chunk-read-maker) ) ) ) ) )
     78        (message-digest-chunk-read-maker) ) ) ) )
    7679
    7780;;
    7881
    79 (define message-digest-chunk-converter (make-parameter #f
     82(define-parameter message-digest-chunk-converter #f
    8083  (lambda (x)
    8184    (if (or (not x) (procedure? x))
     
    8386      (begin
    8487        (warning 'message-digest-chunk-converter "invalid procedure or #f" x)
    85         (message-digest-chunk-converter) ) ) ) ) )
     88        (message-digest-chunk-converter) ) ) ) )
    8689
    8790) ;module message-digest-parameters
  • release/4/message-digest/tags/3.3.0/message-digest-port.scm

    r34300 r34302  
    111111    res ) )
    112112
    113 (define (get-output-digest digest-port #!optional (result-type (message-digest-default-result-type)))
     113(define (get-output-digest digest-port #!optional (result-type (message-digest-result-form)))
    114114  (*close-output-digest 'get-output-digest digest-port result-type) )
    115115
     
    119119;; Returns the accumulated output string | blob | u8vector | hexstring
    120120
    121 (define (call-with-output-digest mdp proc #!optional (result-type (message-digest-default-result-type)))
     121(define (call-with-output-digest mdp proc #!optional (result-type (message-digest-result-form)))
    122122  (let ((port (open-output-digest mdp)))
    123123    (proc port)
     
    128128;; Returns the accumulated output string | blob | u8vector | hexstring
    129129
    130 (define (with-output-to-digest mdp thunk #!optional (result-type (message-digest-default-result-type)))
     130(define (with-output-to-digest mdp thunk #!optional (result-type (message-digest-result-form)))
    131131  (call-with-output-digest mdp (cut with-input-from-port <> thunk) result-type) )
    132132
  • release/4/message-digest/tags/3.3.0/message-digest-srfi-4.scm

    r34300 r34302  
    9090;;; Single Source API
    9191
    92 (define (message-digest-u8vector mdp u8vec #!optional (result-type (message-digest-default-result-type)))
     92(define (message-digest-u8vector mdp u8vec #!optional (result-type (message-digest-result-form)))
    9393  (let ((md (initialize-message-digest mdp)))
    9494    (message-digest-update-u8vector md u8vec)
  • release/4/message-digest/tags/3.3.0/message-digest-type.scm

    r34300 r34302  
    1414(;export
    1515  ; MD API
    16   message-digest-default-result-type
     16  message-digest-default-result-type  ;DEPRECATED
     17  message-digest-result-form
    1718  message-digest? check-message-digest error-message-digest
    1819  message-digest-algorithm message-digest-context
     
    4546
    4647(require-extension
     48  miscmacros
    4749  message-digest-primitive)
    4850
     
    5153(define-constant MINIMUM-BUFFER-SIZE 8)
    5254
     55#; ;CHICKEN 4.8.0.5 has an issue here
    5356(define-constant DEFAULT-RESULT-TYPE 'hex-string)
    5457
     
    101104;;
    102105
    103 (define message-digest-default-result-type (make-parameter DEFAULT-RESULT-TYPE
     106(define-parameter message-digest-result-form #;DEFAULT-RESULT-TYPE 'hex-string
    104107  (lambda (x)
    105108    (or
    106       (if x (canonical-result-name x) DEFAULT-RESULT-TYPE)
     109      (if x (canonical-result-name x) #;DEFAULT-RESULT-TYPE 'hex-string)
    107110      (begin
    108         (warning 'message-digest-default-result-type "invalid result-form" x)
    109         (message-digest-default-result-type) ) ) ) ) )
     111        (warning 'message-digest-result-form "invalid result-form" x)
     112        (message-digest-result-form) ) ) ) )
     113
     114;DEPRECATED
     115(define message-digest-default-result-type message-digest-result-form)
    110116
    111117;;
     
    139145;;
    140146
    141 (define (finalize-message-digest md #!optional (result-type (message-digest-default-result-type)))
     147(define (finalize-message-digest md #!optional (result-type (message-digest-result-form)))
    142148  (let* ((mdp
    143149          (message-digest-algorithm
  • release/4/message-digest/tags/3.3.0/message-digest.setup

    r34300 r34302  
    55(verify-extension-name "message-digest")
    66
    7 (setup-shared+static-extension-module 'message-digest-primitive (extension-version "3.2.0")
     7(setup-shared+static-extension-module 'message-digest-primitive (extension-version "3.3.0")
    88  #:inline? #t
    99        #:types? #t
     
    1212    -no-procedure-checks-for-toplevel-bindings))
    1313
    14 (setup-shared+static-extension-module 'message-digest-type (extension-version "3.2.0")
     14(setup-shared+static-extension-module 'message-digest-type (extension-version "3.3.0")
    1515  #:inline? #t
    1616        #:types? #t
     
    1919    -no-procedure-checks-for-toplevel-bindings))
    2020
    21 (setup-shared+static-extension-module 'message-digest-parameters (extension-version "3.2.0")
     21(setup-shared+static-extension-module 'message-digest-parameters (extension-version "3.3.0")
    2222  #:inline? #t
    2323        #:types? #t
     
    2626    -no-procedure-checks-for-toplevel-bindings))
    2727
    28 (setup-shared+static-extension-module 'message-digest-support (extension-version "3.2.0")
     28(setup-shared+static-extension-module 'message-digest-support (extension-version "3.3.0")
    2929  #:inline? #t
    3030        #:types? #t
     
    3333    -no-procedure-checks-for-toplevel-bindings))
    3434
    35 (setup-shared+static-extension-module 'message-digest-bv (extension-version "3.2.0")
     35(setup-shared+static-extension-module 'message-digest-bv (extension-version "3.3.0")
    3636  #:inline? #t
    3737        #:types? #t
     
    4040    -no-procedure-checks-for-toplevel-bindings))
    4141
    42 (setup-shared+static-extension-module 'message-digest-int (extension-version "3.2.0")
     42(setup-shared+static-extension-module 'message-digest-int (extension-version "3.3.0")
    4343  #:inline? #t
    4444        #:types? #t
     
    4747    -no-procedure-checks-for-toplevel-bindings))
    4848
    49 (setup-shared+static-extension-module 'message-digest-srfi-4 (extension-version "3.2.0")
     49(setup-shared+static-extension-module 'message-digest-srfi-4 (extension-version "3.3.0")
    5050  #:inline? #t
    5151        #:types? #t
     
    5454    -no-procedure-checks-for-toplevel-bindings))
    5555
    56 (setup-shared+static-extension-module 'message-digest-update-item (extension-version "3.2.0")
     56(setup-shared+static-extension-module 'message-digest-update-item (extension-version "3.3.0")
    5757  #:inline? #t
    5858        #:types? #t
     
    6161    -no-procedure-checks-for-toplevel-bindings))
    6262
    63 (setup-shared+static-extension-module 'message-digest-item (extension-version "3.2.0")
     63(setup-shared+static-extension-module 'message-digest-item (extension-version "3.3.0")
    6464  #:inline? #t
    6565        #:types? #t
     
    6868    -no-procedure-checks-for-toplevel-bindings))
    6969
    70 (setup-shared+static-extension-module 'message-digest-port (extension-version "3.2.0")
     70(setup-shared+static-extension-module 'message-digest-port (extension-version "3.3.0")
    7171  #:inline? #t
    7272        #:types? #t
     
    7575    -no-procedure-checks-for-toplevel-bindings))
    7676
    77 (setup-shared+static-extension-module 'message-digest-basic (extension-version "3.2.0")
     77(setup-shared+static-extension-module 'message-digest-basic (extension-version "3.3.0")
    7878  #:inline? #t
    7979        #:types? #t
     
    8282    -no-procedure-checks-for-toplevel-bindings))
    8383
    84 (setup-shared+static-extension-module 'message-digest (extension-version "3.2.0")
     84(setup-shared+static-extension-module 'message-digest (extension-version "3.3.0")
    8585  #:inline? #t
    8686        #:types? #t
  • release/4/message-digest/tags/3.3.0/tests/run.scm

    r31014 r34302  
    3030
    3131(test-begin "Message Digest")
     32
     33;
     34(test 'hex-string (message-digest-result-form 'hex))
    3235
    3336;Tests defaults
     
    239242      (test-assert (output-port? port))
    240243      (display simple-src port) ;cannot be readable!
    241       (test simple-res (get-output-digest port 'hex))
     244      (test simple-res (get-output-digest port))
    242245      (test-assert (port-closed? port)) )
    243246  )
  • release/4/message-digest/trunk/message-digest-bv.scm

    r34300 r34302  
    6464;; Single Source API
    6565
    66 (define (message-digest-string mdp str #!optional (result-type (message-digest-default-result-type)))
     66(define (message-digest-string mdp str #!optional (result-type (message-digest-result-form)))
    6767  (let ((md (initialize-message-digest mdp)))
    6868    (message-digest-update-string md str)
    6969    (finalize-message-digest md result-type) ) )
    7070
    71 (define (message-digest-blob mdp blb #!optional (result-type (message-digest-default-result-type)))
     71(define (message-digest-blob mdp blb #!optional (result-type (message-digest-result-form)))
    7272  (let ((md (initialize-message-digest mdp)))
    7373    (message-digest-update-blob md blb)
  • release/4/message-digest/trunk/message-digest-item.scm

    r34300 r34302  
    2424;;; Single Source API
    2525
    26 (define (message-digest-object mdp obj #!optional (result-type (message-digest-default-result-type)))
     26(define (message-digest-object mdp obj #!optional (result-type (message-digest-result-form)))
    2727  (let ((md (initialize-message-digest mdp)))
    2828    (message-digest-update-object md obj)
    2929    (finalize-message-digest md result-type) ) )
    3030
    31 (define (message-digest-file mdp flnm #!optional (result-type (message-digest-default-result-type)))
     31(define (message-digest-file mdp flnm #!optional (result-type (message-digest-result-form)))
    3232  (let ((md (initialize-message-digest mdp)))
    3333    (message-digest-update-file md flnm)
    3434    (finalize-message-digest md result-type) ) )
    3535
    36 (define (message-digest-port mdp port #!optional (result-type (message-digest-default-result-type)))
     36(define (message-digest-port mdp port #!optional (result-type (message-digest-result-form)))
    3737  (let ((md (initialize-message-digest mdp)))
    3838    (message-digest-update-port md port)
  • release/4/message-digest/trunk/message-digest-parameters.scm

    r34300 r34302  
    2929  srfi-4)
    3030
     31(require-extension
     32  miscmacros)
     33
    3134;;; Update Phase Helpers
    3235
     
    5558;;
    5659
    57 (define message-digest-chunk-size (make-parameter DEFAULT-CHUNK-SIZE
     60(define-parameter message-digest-chunk-size DEFAULT-CHUNK-SIZE
    5861  (lambda (x)
    5962    (cond
     
    6265      (else
    6366        (warning 'message-digest-chunk-size "invalid positive-fixnum" x)
    64         (message-digest-chunk-size) ) ) ) ) )
     67        (message-digest-chunk-size) ) ) ) )
    6568
    6669;;
    6770
    68 (define message-digest-chunk-read-maker (make-parameter default-chunk-read-maker
     71(define-parameter message-digest-chunk-read-maker default-chunk-read-maker
    6972  (lambda (x)
    7073    (cond
     
    7376      (else
    7477        (warning 'message-digest-chunk-read-maker "invalid procedure" x)
    75         (message-digest-chunk-read-maker) ) ) ) ) )
     78        (message-digest-chunk-read-maker) ) ) ) )
    7679
    7780;;
    7881
    79 (define message-digest-chunk-converter (make-parameter #f
     82(define-parameter message-digest-chunk-converter #f
    8083  (lambda (x)
    8184    (if (or (not x) (procedure? x))
     
    8386      (begin
    8487        (warning 'message-digest-chunk-converter "invalid procedure or #f" x)
    85         (message-digest-chunk-converter) ) ) ) ) )
     88        (message-digest-chunk-converter) ) ) ) )
    8689
    8790) ;module message-digest-parameters
  • release/4/message-digest/trunk/message-digest-port.scm

    r34300 r34302  
    111111    res ) )
    112112
    113 (define (get-output-digest digest-port #!optional (result-type (message-digest-default-result-type)))
     113(define (get-output-digest digest-port #!optional (result-type (message-digest-result-form)))
    114114  (*close-output-digest 'get-output-digest digest-port result-type) )
    115115
     
    119119;; Returns the accumulated output string | blob | u8vector | hexstring
    120120
    121 (define (call-with-output-digest mdp proc #!optional (result-type (message-digest-default-result-type)))
     121(define (call-with-output-digest mdp proc #!optional (result-type (message-digest-result-form)))
    122122  (let ((port (open-output-digest mdp)))
    123123    (proc port)
     
    128128;; Returns the accumulated output string | blob | u8vector | hexstring
    129129
    130 (define (with-output-to-digest mdp thunk #!optional (result-type (message-digest-default-result-type)))
     130(define (with-output-to-digest mdp thunk #!optional (result-type (message-digest-result-form)))
    131131  (call-with-output-digest mdp (cut with-input-from-port <> thunk) result-type) )
    132132
  • release/4/message-digest/trunk/message-digest-srfi-4.scm

    r34300 r34302  
    9090;;; Single Source API
    9191
    92 (define (message-digest-u8vector mdp u8vec #!optional (result-type (message-digest-default-result-type)))
     92(define (message-digest-u8vector mdp u8vec #!optional (result-type (message-digest-result-form)))
    9393  (let ((md (initialize-message-digest mdp)))
    9494    (message-digest-update-u8vector md u8vec)
  • release/4/message-digest/trunk/message-digest-type.scm

    r34300 r34302  
    1414(;export
    1515  ; MD API
    16   message-digest-default-result-type
     16  message-digest-default-result-type  ;DEPRECATED
     17  message-digest-result-form
    1718  message-digest? check-message-digest error-message-digest
    1819  message-digest-algorithm message-digest-context
     
    4546
    4647(require-extension
     48  miscmacros
    4749  message-digest-primitive)
    4850
     
    5153(define-constant MINIMUM-BUFFER-SIZE 8)
    5254
     55#; ;CHICKEN 4.8.0.5 has an issue here
    5356(define-constant DEFAULT-RESULT-TYPE 'hex-string)
    5457
     
    101104;;
    102105
    103 (define message-digest-default-result-type (make-parameter DEFAULT-RESULT-TYPE
     106(define-parameter message-digest-result-form #;DEFAULT-RESULT-TYPE 'hex-string
    104107  (lambda (x)
    105108    (or
    106       (if x (canonical-result-name x) DEFAULT-RESULT-TYPE)
     109      (if x (canonical-result-name x) #;DEFAULT-RESULT-TYPE 'hex-string)
    107110      (begin
    108         (warning 'message-digest-default-result-type "invalid result-form" x)
    109         (message-digest-default-result-type) ) ) ) ) )
     111        (warning 'message-digest-result-form "invalid result-form" x)
     112        (message-digest-result-form) ) ) ) )
     113
     114;DEPRECATED
     115(define message-digest-default-result-type message-digest-result-form)
    110116
    111117;;
     
    139145;;
    140146
    141 (define (finalize-message-digest md #!optional (result-type (message-digest-default-result-type)))
     147(define (finalize-message-digest md #!optional (result-type (message-digest-result-form)))
    142148  (let* ((mdp
    143149          (message-digest-algorithm
  • release/4/message-digest/trunk/message-digest.setup

    r34300 r34302  
    55(verify-extension-name "message-digest")
    66
    7 (setup-shared+static-extension-module 'message-digest-primitive (extension-version "3.2.0")
     7(setup-shared+static-extension-module 'message-digest-primitive (extension-version "3.3.0")
    88  #:inline? #t
    99        #:types? #t
     
    1212    -no-procedure-checks-for-toplevel-bindings))
    1313
    14 (setup-shared+static-extension-module 'message-digest-type (extension-version "3.2.0")
     14(setup-shared+static-extension-module 'message-digest-type (extension-version "3.3.0")
    1515  #:inline? #t
    1616        #:types? #t
     
    1919    -no-procedure-checks-for-toplevel-bindings))
    2020
    21 (setup-shared+static-extension-module 'message-digest-parameters (extension-version "3.2.0")
     21(setup-shared+static-extension-module 'message-digest-parameters (extension-version "3.3.0")
    2222  #:inline? #t
    2323        #:types? #t
     
    2626    -no-procedure-checks-for-toplevel-bindings))
    2727
    28 (setup-shared+static-extension-module 'message-digest-support (extension-version "3.2.0")
     28(setup-shared+static-extension-module 'message-digest-support (extension-version "3.3.0")
    2929  #:inline? #t
    3030        #:types? #t
     
    3333    -no-procedure-checks-for-toplevel-bindings))
    3434
    35 (setup-shared+static-extension-module 'message-digest-bv (extension-version "3.2.0")
     35(setup-shared+static-extension-module 'message-digest-bv (extension-version "3.3.0")
    3636  #:inline? #t
    3737        #:types? #t
     
    4040    -no-procedure-checks-for-toplevel-bindings))
    4141
    42 (setup-shared+static-extension-module 'message-digest-int (extension-version "3.2.0")
     42(setup-shared+static-extension-module 'message-digest-int (extension-version "3.3.0")
    4343  #:inline? #t
    4444        #:types? #t
     
    4747    -no-procedure-checks-for-toplevel-bindings))
    4848
    49 (setup-shared+static-extension-module 'message-digest-srfi-4 (extension-version "3.2.0")
     49(setup-shared+static-extension-module 'message-digest-srfi-4 (extension-version "3.3.0")
    5050  #:inline? #t
    5151        #:types? #t
     
    5454    -no-procedure-checks-for-toplevel-bindings))
    5555
    56 (setup-shared+static-extension-module 'message-digest-update-item (extension-version "3.2.0")
     56(setup-shared+static-extension-module 'message-digest-update-item (extension-version "3.3.0")
    5757  #:inline? #t
    5858        #:types? #t
     
    6161    -no-procedure-checks-for-toplevel-bindings))
    6262
    63 (setup-shared+static-extension-module 'message-digest-item (extension-version "3.2.0")
     63(setup-shared+static-extension-module 'message-digest-item (extension-version "3.3.0")
    6464  #:inline? #t
    6565        #:types? #t
     
    6868    -no-procedure-checks-for-toplevel-bindings))
    6969
    70 (setup-shared+static-extension-module 'message-digest-port (extension-version "3.2.0")
     70(setup-shared+static-extension-module 'message-digest-port (extension-version "3.3.0")
    7171  #:inline? #t
    7272        #:types? #t
     
    7575    -no-procedure-checks-for-toplevel-bindings))
    7676
    77 (setup-shared+static-extension-module 'message-digest-basic (extension-version "3.2.0")
     77(setup-shared+static-extension-module 'message-digest-basic (extension-version "3.3.0")
    7878  #:inline? #t
    7979        #:types? #t
     
    8282    -no-procedure-checks-for-toplevel-bindings))
    8383
    84 (setup-shared+static-extension-module 'message-digest (extension-version "3.2.0")
     84(setup-shared+static-extension-module 'message-digest (extension-version "3.3.0")
    8585  #:inline? #t
    8686        #:types? #t
  • release/4/message-digest/trunk/tests/run.scm

    r31014 r34302  
    3030
    3131(test-begin "Message Digest")
     32
     33;
     34(test 'hex-string (message-digest-result-form 'hex))
    3235
    3336;Tests defaults
     
    239242      (test-assert (output-port? port))
    240243      (display simple-src port) ;cannot be readable!
    241       (test simple-res (get-output-digest port 'hex))
     244      (test simple-res (get-output-digest port))
    242245      (test-assert (port-closed? port)) )
    243246  )
Note: See TracChangeset for help on using the changeset viewer.