-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from Dr-Nekoma/ffi-and-pagination
FFI and Pagination
- Loading branch information
Showing
12 changed files
with
1,829 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ racketowerDB/main | |
.DS_Store | ||
compiled/ | ||
/doc/ | ||
/utilities/*.o | ||
libbplustree.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#lang racket | ||
|
||
(require ffi/unsafe | ||
ffi/unsafe/define) | ||
|
||
(provide insert | ||
find_and_get_value | ||
find_and_get_node | ||
print_leaves | ||
print_tree | ||
convert-leaves | ||
deref-row-id | ||
_RECORD | ||
_RECORD-pointer | ||
RECORD->list) | ||
|
||
(define-cstruct _RECORD ([chunkNumber _int] | ||
[pageNumber _int] | ||
[slotNumber _int])) | ||
|
||
(define-ffi-definer define-bplustree (ffi-lib "libbplustree")) | ||
|
||
(define-bplustree insert (_fun _pointer _int _int _int _int -> _pointer)) | ||
(define-bplustree find_and_get_value (_fun _pointer _int _bool -> _pointer)) | ||
(define-bplustree find_and_get_node (_fun _pointer _int _pointer -> _pointer)) | ||
(define-bplustree print_leaves (_fun _pointer -> _void)) | ||
(define-bplustree print_tree (_fun _pointer -> _void)) | ||
|
||
(define (convert-leaves ptr size) (ptr-ref ptr (_array/vector _RECORD-pointer size))) | ||
|
||
(define (deref-row-id row-id-ptr) (RECORD->list (ptr-ref row-id-ptr _RECORD))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Oops, something went wrong.