Changeset 22421 in project


Ignore:
Timestamp:
01/15/11 15:42:22 (11 years ago)
Author:
Thomas Chust
Message:

[sqlite3] Makefile overhaul, text exit status and CHICKEN 4.6.4 compatibility

Location:
release/4/sqlite3/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • release/4/sqlite3/trunk/Makefile

    r15423 r22421  
    1212
    1313NAME=sqlite3
    14 VERSION=3.5.0
     14VERSION=3.5.2
    1515
    1616.PHONY: all clean
     
    1919
    2020clean:
    21         $(RM) $(addprefix $(NAME),.egg .so .html .setup)
     21        $(RM) $(addprefix $(NAME),.egg .so .setup)
    2222
    23 $(NAME).egg:    $(addprefix $(NAME),.scm .html .setup .meta) tests/run.scm egg.jpg doc.scm Makefile
     23$(NAME).egg:    $(addprefix $(NAME),.scm .setup .meta) tests/run.scm Makefile
    2424        $(TAR) czf $@ $^
    25 
    26 $(NAME).html: doc.scm
    27         $(CSI) -s $< >$@
    2825
    2926$(NAME).setup: Makefile
  • release/4/sqlite3/trunk/sqlite3.html

    r17785 r22421  
    487487<h3>Version</h3>
    488488<ul>
     489<li>3.5.2 Makefile overhaul, text exit status and CHICKEN 4.6.4 compatibility</li>
    489490<li>3.5.1 Corrected parameter error checks for define-function</li>
    490491<li>3.5.0 Switched to less error prone internal C API</li>
  • release/4/sqlite3/trunk/sqlite3.scm

    r17785 r22421  
    1111(declare
    1212  (usual-integrations)
    13   (fixnum-arithmetic)
    1413  (no-procedure-checks-for-usual-bindings)
    1514  (unused
     
    285284    (let ([r #f])
    286285      (dynamic-wind
    287         noop
     286        void
    288287        (lambda ()
    289288          (handle-exceptions exn
     
    357356(define (parameter-data n args)
    358357  (let loop ([i 0])
    359     (if (<= n i)
     358    (if (fx<= n i)
    360359      '()
    361360      (cons (case ((foreign-lambda* sqlite3:type
     
    389388        [else
    390389          (sql-null)])
    391   (loop (add1 i))))))
     390  (loop (fx+ i 1))))))
    392391
    393392(define (set-result! ctx v)
     
    423422  (let/cc return
    424423    (dynamic-wind
    425       noop
     424      void
    426425      (lambda ()
    427426        (handle-exceptions exn
     
    445444  (let/cc return
    446445    (dynamic-wind
    447       noop
     446      void
    448447      (lambda ()
    449448        (handle-exceptions exn
     
    466465    (let ([agc (sqlite3_aggregate_context ctx)])
    467466      (dynamic-wind
    468         noop
     467        void
    469468        (lambda ()
    470469          (handle-exceptions exn
     
    489488      (check-database 'define-function db)
    490489      (check-string 'define-function name)
    491       (check-cardinal-number 'define-function (add1 n))
     490      (check-cardinal-number 'define-function (fx+ n 1))
    492491      (check-procedure 'define-function proc)
    493492      (let ([qn (object-evict (list (pointer->address (database-ptr db)) name))])
     
    516515      (check-database 'define-function db)
    517516      (check-string 'define-function name)
    518       (check-cardinal-number 'define-function (add1 n))
     517      (check-cardinal-number 'define-function (fx+ n 1))
    519518      (let ([final-proc (optional final-proc identity)])
    520519        (check-procedure 'define-function step-proc)
     
    574573(define (make-busy-timeout timeout)
    575574  (define (thread-sleep!/ms ms)
    576     (thread-sleep!
    577       (milliseconds->time (+ ms (current-milliseconds)))))
     575    (thread-sleep! (/ ms 1000)))
    578576  (let* ([delays '#(1 2 5 10 15 20 25 25 25 50 50 100)]
    579577   [totals '#(0 1 3  8 18 33 53 78 103 128 178 228)]
     
    581579    (lambda (db count)
    582580      (let* ([delay (vector-ref delays (min count (- ndelay 1)))]
    583        [prior (if (< count ndelay)
     581       [prior (if (fx< count ndelay)
    584582         (vector-ref totals count)
    585583         (+ (vector-ref totals (- ndelay 1))
    586584           (* delay (- count (- ndelay 1)))))])
    587   (let ([delay (if (> (+ prior delay) timeout)
     585  (let ([delay (if (fx> (+ prior delay) timeout)
    588586                (- timeout prior)
    589587                delay)])
    590588    (cond
    591       [(<= delay 0) #f]
     589      [(fx<= delay 0) #f]
    592590      [else
    593591        (thread-sleep!/ms delay)
     
    677675                    (cond
    678676                      [(and h (h db retries))
    679                         (retry (add1 retries))]
     677                        (retry (fx+ retries 1))]
    680678                      [else
    681679                        ((abort-sqlite3-error 'prepare db db sql) err)]))]
     
    710708    (if (zero? i)
    711709      #f
    712       (sub1 i))))
     710      (fx- i 1))))
    713711
    714712;; Get the name of a bindable parameter
     
    716714  (check-statement 'bind-parameter-name stmt)
    717715  ((foreign-lambda c-string "sqlite3_bind_parameter_name" sqlite3:statement int)
    718     stmt (add1 i)))
     716    stmt (fx+ i 1)))
    719717
    720718;; Bind data as parameters to an existing statement
     
    728726                ((sqlite3:statement stmt) (int i) (scheme-pointer v) (int n))
    729727                "return(sqlite3_bind_blob(stmt, i, v, n, SQLITE_TRANSIENT));")
    730               stmt (add1 i) v (blob-size v))
     728              stmt (fx+ i 1) v (blob-size v))
    731729        => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)])]
    732730    [(or (and (fixnum? v) v) (and (boolean? v) (if v 1 0)))
     
    734732          (cond [((foreign-lambda sqlite3:status "sqlite3_bind_int"
    735733                    sqlite3:statement int int)
    736                   stmt (add1 i) v)
     734                  stmt (fx+ i 1) v)
    737735            => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)]))]
    738736    [(real? v)
    739737      (cond [((foreign-lambda sqlite3:status "sqlite3_bind_double"
    740738                sqlite3:statement int double)
    741               stmt (add1 i) v)
     739              stmt (fx+ i 1) v)
    742740        => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)])]
    743741    [(string? v)
     
    745743                ((sqlite3:statement stmt) (int i) (scheme-pointer v) (int n))
    746744                "return(sqlite3_bind_text(stmt, i, v, n, SQLITE_TRANSIENT));")
    747               stmt (add1 i) v (string-length v))
     745              stmt (fx+ i 1) v (string-length v))
    748746        => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i v)])]
    749747    [(sql-null? v)
    750748      (cond [((foreign-lambda sqlite3:status "sqlite3_bind_null" sqlite3:statement int)
    751               stmt (add1 i))
     749              stmt (fx+ i 1))
    752750        => (abort-sqlite3-error 'bind! (statement-database stmt) stmt i)])]
    753751    [else
     
    772770        [(v . rest)
    773771          (hash-table-set! vs i v)
    774           (loop (add1 i) rest)]
     772          (loop (fx+ i 1) rest)]
    775773        [()
    776774          (void)]))
     
    806804              (cond
    807805                [(and h (h db retries))
    808                   (retry (add1 retries))]
     806                  (retry (fx+ retries 1))]
    809807                [else
    810808                  ((abort-sqlite3-error 'step! db stmt) s)]))]
  • release/4/sqlite3/trunk/sqlite3.setup

    r17785 r22421  
    88  'sqlite3
    99  '("sqlite3.so" "sqlite3.import.so" "sqlite3-static.o")
    10   '((version "3.5.1")
     10  '((version "3.5.2")
    1111    (static "sqlite3-static.o")
    1212    (documentation "sqlite3.html" "egg.jpg")))
  • release/4/sqlite3/trunk/tests/run.scm

    r15423 r22421  
    308308(print "Database memory still used: " (database-memory-used))
    309309(print "Database memory high water mark: " (database-memory-highwater))
     310
     311(test-exit)
Note: See TracChangeset for help on using the changeset viewer.