Megatest

Diff
Login

Differences From Artifact [bbb0371221]:

To Artifact [423ddbb678]:


1
2
3




4
5
6
7
8
9
10
11
12
13
14
15

16
17
18
19
;; Single record for managing a filedb
;; make-vector-record "Filedb record" filedb fdb db dbpath pathcache idcache partcache
;; Filedb record




(define (make-filedb:fdb)(make-vector 5))
(define-inline (filedb:fdb-get-db          vec)    (vector-ref  vec 0))
(define-inline (filedb:fdb-get-dbpath      vec)    (vector-ref  vec 1))
(define-inline (filedb:fdb-get-pathcache   vec)    (vector-ref  vec 2))
(define-inline (filedb:fdb-get-idcache     vec)    (vector-ref  vec 3))
(define-inline (filedb:fdb-get-partcache   vec)    (vector-ref  vec 4))
(define-inline (filedb:fdb-set-db!         vec val)(vector-set! vec 0 val))
(define-inline (filedb:fdb-set-dbpath!     vec val)(vector-set! vec 1 val))
(define-inline (filedb:fdb-set-pathcache!  vec val)(vector-set! vec 2 val))
(define-inline (filedb:fdb-set-idcache!    vec val)(vector-set! vec 3 val))
(define-inline (filedb:fdb-set-partcache!  vec val)(vector-set! vec 4 val))


;; children records, should have use something other than "child"
(define-inline (filedb:child-get-id vec)       (vector-ref vec 0))
(define-inline (filedb:child-get-path vec)     (vector-ref vec 1))
(define-inline (filedb:child-get-parent_id vec)(vector-ref vec 2))



>
>
>
>
|
|
|
|
|
|
|
|
|
|
|

>
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
;; Single record for managing a filedb
;; make-vector-record "Filedb record" filedb fdb db dbpath pathcache idcache partcache
;; Filedb record
(use defstruct)
(defstruct filedb:fdb db dbpath pathcache idcache partcache db! dbpath! pathcache! idcache! partcache!)

;; BB: following replaced by defstruct filedb:fdb --
;;(define (make-filedb:fdb)(make-vector 5))
;;(define-inline (filedb:fdb-get-db          vec)    (vector-ref  vec 0))
;;(define-inline (filedb:fdb-get-dbpath      vec)    (vector-ref  vec 1))
;;(define-inline (filedb:fdb-get-pathcache   vec)    (vector-ref  vec 2))
;;(define-inline (filedb:fdb-get-idcache     vec)    (vector-ref  vec 3))
;;(define-inline (filedb:fdb-get-partcache   vec)    (vector-ref  vec 4))
;;(define-inline (filedb:fdb-set-db!         vec val)(vector-set! vec 0 val))
;;(define-inline (filedb:fdb-set-dbpath!     vec val)(vector-set! vec 1 val))
;;(define-inline (filedb:fdb-set-pathcache!  vec val)(vector-set! vec 2 val))
;;(define-inline (filedb:fdb-set-idcache!    vec val)(vector-set! vec 3 val))
;;(define-inline (filedb:fdb-set-partcache!  vec val)(vector-set! vec 4 val))

;; BB: following is not used, commenting out --
;;; children records, should have use something other than "child"
;;(define-inline (filedb:child-get-id vec)       (vector-ref vec 0))
;;(define-inline (filedb:child-get-path vec)     (vector-ref vec 1))
;;(define-inline (filedb:child-get-parent_id vec)(vector-ref vec 2))