This is the pounds Reference Manual, version 0.2.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 06:24:03 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
pounds
Provides portable file mappings and related utilities.
Frank James <frank.a.james@gmail.com>
MIT
0.2.1
cffi
(system).
trivial-gray-streams
(system).
nibbles
(system).
babel
(system).
bordeaux-threads
(system).
package.lisp
(file).
ffi.lisp
(file).
mappings.lisp
(file).
log.lisp
(file).
database.lisp
(file).
blog.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
pounds/pounds.asd
pounds/package.lisp
pounds/ffi.lisp
pounds/mappings.lisp
pounds/log.lisp
pounds/database.lisp
pounds/blog.lisp
pounds/ffi.lisp
package.lisp
(file).
pounds
(system).
close-mapping
(function).
mapping-size
(reader).
(setf mapping-size)
(writer).
open-mapping
(function).
remap
(function).
%close
(function).
%flock
(function).
%fsync
(function).
%lseek
(function).
%mmap
(function).
%munmap
(function).
%open
(function).
%pread
(function).
%pwrite
(function).
%read
(function).
%strerror
(function).
%var-accessor-*errno*
(function).
(setf %var-accessor-*errno*)
(function).
%write
(function).
*errno*
(symbol macro).
+eintr+
(constant).
+lock-ex+
(constant).
+lock-un+
(constant).
copy-mapping
(function).
ensure-file-exists
(function).
flush-buffers
(function).
get-last-error
(function).
invalid-pointer-p
(function).
lock-mapping
(function).
make-mapping
(function).
mapping
(structure).
mapping-fd
(reader).
(setf mapping-fd)
(writer).
mapping-lock
(reader).
(setf mapping-lock)
(writer).
mapping-p
(function).
mapping-ptr
(reader).
(setf mapping-ptr)
(writer).
read-file
(function).
read-mapping-block
(function).
unlock-mapping
(function).
write-file
(function).
write-mapping-block
(function).
write-zero-at
(function).
pounds/mappings.lisp
ffi.lisp
(file).
pounds
(system).
make-mapping-stream
(function).
mapping-stream
(class).
mapping-stream-mapping
(reader method).
mapping-stream-position
(reader method).
(setf mapping-stream-position)
(writer method).
stream-element-type
(method).
(setf stream-file-position)
(method).
stream-file-position
(method).
stream-finish-output
(method).
stream-force-output
(method).
stream-listen
(method).
stream-read-byte
(method).
stream-read-sequence
(method).
stream-write-byte
(method).
stream-write-sequence
(method).
with-locked-mapping
(macro).
check-if-open
(function).
with-mapping
(macro).
with-mapping-stream
(macro).
with-open-mapping
(macro).
pounds/log.lisp
mappings.lisp
(file).
pounds
(system).
close-log
(function).
dump-log
(function).
open-log
(function).
read-message
(function).
start-following
(function).
stop-following
(function).
write-message
(function).
%copy-plog
(function).
%make-follower
(function).
%make-plog
(function).
*default-log-file*
(special variable).
*follower*
(special variable).
+default-count+
(constant).
+default-size+
(constant).
+msg-magic+
(constant).
advance-to-block
(function).
advance-to-next
(function).
advance-to-next-block
(function).
copy-follower
(function).
copy-log
(function).
copy-log-header
(function).
copy-log-message
(function).
follow-log
(function).
follower
(structure).
follower-exit-p
(reader).
(setf follower-exit-p)
(writer).
follower-log
(reader).
(setf follower-log)
(writer).
follower-lvl
(reader).
(setf follower-lvl)
(writer).
follower-output
(reader).
(setf follower-output)
(writer).
follower-p
(function).
follower-tag
(reader).
(setf follower-tag)
(writer).
follower-thread
(reader).
(setf follower-thread)
(writer).
header-id
(function).
header-index
(function).
int-level
(function).
level-int
(function).
log-header
(structure).
log-header-count
(reader).
(setf log-header-count)
(writer).
log-header-id
(reader).
(setf log-header-id)
(writer).
log-header-index
(reader).
(setf log-header-index)
(writer).
log-header-p
(function).
log-header-size
(reader).
(setf log-header-size)
(writer).
log-message
(structure).
log-message-id
(reader).
(setf log-message-id)
(writer).
log-message-lvl
(reader).
(setf log-message-lvl)
(writer).
log-message-magic
(reader).
(setf log-message-magic)
(writer).
log-message-msg
(reader).
(setf log-message-msg)
(writer).
log-message-p
(function).
log-message-tag
(reader).
(setf log-message-tag)
(writer).
log-message-time
(reader).
(setf log-message-time)
(writer).
make-follower
(function).
make-log-header
(function).
make-log-message
(function).
make-plog
(function).
plog
(structure).
plog-count
(reader).
(setf plog-count)
(writer).
plog-p
(function).
plog-size
(reader).
(setf plog-size)
(writer).
plog-stream
(reader).
(setf plog-stream)
(writer).
plog-tag
(reader).
(setf plog-tag)
(writer).
read-header
(function).
read-log-header
(function).
read-log-message
(function).
set-header-id-index
(function).
write-header
(function).
write-log-header
(function).
write-log-message
(function).
write-message-to-stream
(function).
pounds/database.lisp
log.lisp
(file).
pounds
(system).
close-db
(function).
db-seqno
(function).
doentries
(macro).
find-entry
(function).
(setf find-entry)
(function).
find-entry-if
(function).
header
(function).
(setf header)
(function).
mapentries
(function).
open-db
(function).
remove-entry
(function).
+default-block-size+
(constant).
+default-count+
(constant).
copy-db
(function).
db
(structure).
db-bsize
(reader).
(setf db-bsize)
(writer).
db-count
(function).
db-header
(reader).
(setf db-header)
(writer).
db-mapping
(reader).
(setf db-mapping)
(writer).
db-p
(function).
db-reader
(reader).
(setf db-reader)
(writer).
db-stream
(reader).
(setf db-stream)
(writer).
db-writer
(reader).
(setf db-writer)
(writer).
make-db
(function).
maybe-remap
(function).
read-entry
(function).
read-header
(function).
with-locked-db
(macro).
write-entry
(function).
write-header
(function).
pounds/blog.lisp
database.lisp
(file).
pounds
(system).
blog-properties
(function).
close-blog
(function).
open-blog
(function).
read-entries
(function).
read-entry
(function).
read-entry-details
(function).
read-header
(function).
reset-blog
(function).
sync-blog
(function).
write-entry
(function).
write-header
(function).
+blog-version+
(constant).
+entry-size+
(constant).
+flag-more+
(constant).
+props-block+
(constant).
advance-to-id
(function).
blog
(structure).
blog-index
(function).
(setf blog-index)
(function).
blog-mapping
(reader).
(setf blog-mapping)
(writer).
blog-p
(function).
blog-props
(reader).
(setf blog-props)
(writer).
blog-stream
(reader).
(setf blog-stream)
(writer).
copy-blog
(function).
copy-entry
(function).
copy-props
(function).
copy-xdr-block
(function).
decode-entry
(function).
decode-props
(function).
decode-uint32
(function).
encode-entry
(function).
encode-props
(function).
encode-uint32
(function).
entry
(structure).
entry-count
(reader).
(setf entry-count)
(writer).
entry-id
(reader).
(setf entry-id)
(writer).
entry-p
(function).
make-blog
(function).
make-entry
(function).
make-props
(function).
make-xdr-block
(function).
next-index
(function).
prev-index
(function).
props
(structure).
props-block-size
(reader).
(setf props-block-size)
(writer).
props-header-size
(reader).
(setf props-header-size)
(writer).
props-id
(reader).
(setf props-id)
(writer).
props-index
(reader).
(setf props-index)
(writer).
props-nblocks
(reader).
(setf props-nblocks)
(writer).
props-p
(function).
props-seqno
(reader).
(setf props-seqno)
(writer).
props-tag
(reader).
(setf props-tag)
(writer).
props-version
(reader).
(setf props-version)
(writer).
read-blog-entry-props
(function).
read-blog-props
(function).
read-entry-locked
(function).
reset-xdr-block
(function).
space-or-lose
(function).
write-blog-entry
(function).
write-blog-entry-props
(function).
write-blog-props
(function).
xdr-block
(function).
xdr-block
(structure).
xdr-block-buffer
(reader).
(setf xdr-block-buffer)
(writer).
xdr-block-count
(reader).
(setf xdr-block-count)
(writer).
xdr-block-offset
(reader).
(setf xdr-block-offset)
(writer).
xdr-block-p
(function).
Packages are listed by definition order.
pounds.blog
common-lisp
.
pounds
.
blog-properties
(function).
close-blog
(function).
open-blog
(function).
read-entries
(function).
read-entry
(function).
read-entry-details
(function).
read-header
(function).
reset-blog
(function).
sync-blog
(function).
write-entry
(function).
write-header
(function).
+blog-version+
(constant).
+entry-size+
(constant).
+flag-more+
(constant).
+props-block+
(constant).
advance-to-id
(function).
blog
(structure).
blog-index
(function).
(setf blog-index)
(function).
blog-mapping
(reader).
(setf blog-mapping)
(writer).
blog-p
(function).
blog-props
(reader).
(setf blog-props)
(writer).
blog-stream
(reader).
(setf blog-stream)
(writer).
copy-blog
(function).
copy-entry
(function).
copy-props
(function).
copy-xdr-block
(function).
decode-entry
(function).
decode-props
(function).
decode-uint32
(function).
encode-entry
(function).
encode-props
(function).
encode-uint32
(function).
entry
(structure).
entry-count
(reader).
(setf entry-count)
(writer).
entry-id
(reader).
(setf entry-id)
(writer).
entry-p
(function).
make-blog
(function).
make-entry
(function).
make-props
(function).
make-xdr-block
(function).
next-index
(function).
prev-index
(function).
props
(structure).
props-block-size
(reader).
(setf props-block-size)
(writer).
props-header-size
(reader).
(setf props-header-size)
(writer).
props-id
(reader).
(setf props-id)
(writer).
props-index
(reader).
(setf props-index)
(writer).
props-nblocks
(reader).
(setf props-nblocks)
(writer).
props-p
(function).
props-seqno
(reader).
(setf props-seqno)
(writer).
props-tag
(reader).
(setf props-tag)
(writer).
props-version
(reader).
(setf props-version)
(writer).
read-blog-entry-props
(function).
read-blog-props
(function).
read-entry-locked
(function).
reset-xdr-block
(function).
space-or-lose
(function).
write-blog-entry
(function).
write-blog-entry-props
(function).
write-blog-props
(function).
xdr-block
(function).
xdr-block
(structure).
xdr-block-buffer
(reader).
(setf xdr-block-buffer)
(writer).
xdr-block-count
(reader).
(setf xdr-block-count)
(writer).
xdr-block-offset
(reader).
(setf xdr-block-offset)
(writer).
xdr-block-p
(function).
pounds
cffi
.
common-lisp
.
trivial-gray-streams
.
close-mapping
(function).
make-mapping-stream
(function).
mapping-size
(reader).
(setf mapping-size)
(writer).
mapping-stream
(class).
mapping-stream-mapping
(generic reader).
mapping-stream-position
(generic reader).
(setf mapping-stream-position)
(generic writer).
open-mapping
(function).
remap
(function).
with-locked-mapping
(macro).
%close
(function).
%flock
(function).
%fsync
(function).
%lseek
(function).
%mmap
(function).
%munmap
(function).
%open
(function).
%pread
(function).
%pwrite
(function).
%read
(function).
%strerror
(function).
%var-accessor-*errno*
(function).
(setf %var-accessor-*errno*)
(function).
%write
(function).
*errno*
(symbol macro).
+eintr+
(constant).
+lock-ex+
(constant).
+lock-un+
(constant).
check-if-open
(function).
copy-mapping
(function).
ensure-file-exists
(function).
flush-buffers
(function).
get-last-error
(function).
invalid-pointer-p
(function).
lock-mapping
(function).
make-mapping
(function).
mapping
(structure).
mapping-fd
(reader).
(setf mapping-fd)
(writer).
mapping-lock
(reader).
(setf mapping-lock)
(writer).
mapping-p
(function).
mapping-ptr
(reader).
(setf mapping-ptr)
(writer).
read-file
(function).
read-mapping-block
(function).
unlock-mapping
(function).
with-mapping
(macro).
with-mapping-stream
(macro).
with-open-mapping
(macro).
write-file
(function).
write-mapping-block
(function).
write-zero-at
(function).
pounds.log
plog
common-lisp
.
pounds
.
trivial-gray-streams
.
close-log
(function).
dump-log
(function).
open-log
(function).
read-message
(function).
start-following
(function).
stop-following
(function).
write-message
(function).
%copy-plog
(function).
%make-follower
(function).
%make-plog
(function).
*default-log-file*
(special variable).
*follower*
(special variable).
+default-count+
(constant).
+default-size+
(constant).
+msg-magic+
(constant).
advance-to-block
(function).
advance-to-next
(function).
advance-to-next-block
(function).
copy-follower
(function).
copy-log
(function).
copy-log-header
(function).
copy-log-message
(function).
follow-log
(function).
follower
(structure).
follower-exit-p
(reader).
(setf follower-exit-p)
(writer).
follower-log
(reader).
(setf follower-log)
(writer).
follower-lvl
(reader).
(setf follower-lvl)
(writer).
follower-output
(reader).
(setf follower-output)
(writer).
follower-p
(function).
follower-tag
(reader).
(setf follower-tag)
(writer).
follower-thread
(reader).
(setf follower-thread)
(writer).
header-id
(function).
header-index
(function).
int-level
(function).
level-int
(function).
log-header
(structure).
log-header-count
(reader).
(setf log-header-count)
(writer).
log-header-id
(reader).
(setf log-header-id)
(writer).
log-header-index
(reader).
(setf log-header-index)
(writer).
log-header-p
(function).
log-header-size
(reader).
(setf log-header-size)
(writer).
log-message
(structure).
log-message-id
(reader).
(setf log-message-id)
(writer).
log-message-lvl
(reader).
(setf log-message-lvl)
(writer).
log-message-magic
(reader).
(setf log-message-magic)
(writer).
log-message-msg
(reader).
(setf log-message-msg)
(writer).
log-message-p
(function).
log-message-tag
(reader).
(setf log-message-tag)
(writer).
log-message-time
(reader).
(setf log-message-time)
(writer).
make-follower
(function).
make-log-header
(function).
make-log-message
(function).
make-plog
(function).
plog
(structure).
plog-count
(reader).
(setf plog-count)
(writer).
plog-p
(function).
plog-size
(reader).
(setf plog-size)
(writer).
plog-stream
(reader).
(setf plog-stream)
(writer).
plog-tag
(reader).
(setf plog-tag)
(writer).
read-header
(function).
read-log-header
(function).
read-log-message
(function).
set-header-id-index
(function).
write-header
(function).
write-log-header
(function).
write-log-message
(function).
write-message-to-stream
(function).
pounds.db
common-lisp
.
pounds
.
close-db
(function).
db-seqno
(function).
doentries
(macro).
find-entry
(function).
(setf find-entry)
(function).
find-entry-if
(function).
header
(function).
(setf header)
(function).
mapentries
(function).
open-db
(function).
remove-entry
(function).
+default-block-size+
(constant).
+default-count+
(constant).
copy-db
(function).
db
(structure).
db-bsize
(reader).
(setf db-bsize)
(writer).
db-count
(function).
db-header
(reader).
(setf db-header)
(writer).
db-mapping
(reader).
(setf db-mapping)
(writer).
db-p
(function).
db-reader
(reader).
(setf db-reader)
(writer).
db-stream
(reader).
(setf db-stream)
(writer).
db-writer
(reader).
(setf db-writer)
(writer).
make-db
(function).
maybe-remap
(function).
read-entry
(function).
read-header
(function).
with-locked-db
(macro).
write-entry
(function).
write-header
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Iterate over all entries in the database, evaluating the body forms with VAR bound to each entry.
VAR ::= symbol bound to the entry.
DB ::= database, as returned from OPEN-DB.
RESULT ::= optional result form.
The body forms are evaluated in the context of two local macros:
CLEAR-ENTRY ::= delete the current entry
UPDATE-ENTRY val ::= overwrite the current entry with VAL.
Evaluate the body with the mapping lock held.
Read the current blog properties.
Close the binary log and free all resources.
Close the database.
Close the log and its associated file mapping.
Read the database sequence number.
Dump the contents of the log to the stream. Filters the messages on tag and levels, if provided.
Search for the item in the database.
Find the item in the database.
Map over the entries in the database.
Open the binary log.
PATHSPEC ::= path to the file.
NBLOCKS ::= number of blocks in the log.
BLOCK-SIZE ::= number of bytes in each block.
HEADER-SIZE ::= number of bytes to assign to user customizable header.
Returns the BLOG structure. Close using CLOSE-BLOG.
Open the database.
PATHSPEC ::= pathspec to the file.
READER ::= function (stream) which reads an entry.
WRITER ::= function (stream entry) which writes the entry to the stream.
COUNT ::= default initial number of entries.
BLOCK-SIZE ::= agreed block size. Must be at least 16.
Returns the database.
Open a log file, creating it if it doesn’t exist.
PATH should be a string representing a pathname to the log file to use. THe file will be created if it doesn’t exist.
The pathname MUST be in the local system format.
COUNT, if provided, is the number of blocks to use in the log file. Default is 16k.
SIZE is the size of each block. Default is 128 bytes. The total filesize is (* SIZE COUNT).
TAG, if provided, should be a string of exactly 4 characters which is used to tag each message written to the log
file.
Returns a PLOG structure.
Opens the file named by PATH and maps it into memory. SIZE is the size in bytes of the file to map.
Read a set of messages starting from message ID.
BLOG ::= the binary log
ID ::= starting ID.
NMSGS ::= number of messages to read.
SEQUENCE ::= octet vector to receive the messages.
START, END ::= region of sequence to read into.
Returns a list of (count id start end) for each message.
COUNT ::= the length of the message, even if it couldn’t fit into the buffer.
ID ::= message ID.
START, END ::= region of SEQUENCE that the message was written into. If the message
may have only been partially read into SEQUENCE if insufficient space was provided.
Note that this function does not update the internal properties and therefore does not affect subsequent calls to READ-ENTRY.
Read the entry starting at the index currently pointed to by the log properties.
BLOG ::= binary log
SEQUENCE ::= octet vector
START, END ::= region of sequence to read into.
If the message is larger than the sequence provided will read as much as it can,
returning the truncated message in the sequence. You can use READ-ENTRY-DETAILS
before calling this to ensure you have allocated sufficient space.
Updates the blog properties (but does not persist the updated properties)
to the index of the next message to read.
Returns (values count id) where
COUNT ::= the number of bytes in the message.
ID ::= message ID
Read the properties of the next entry.
BLOG ::= the binary log.
Returns (values count id) where
COUTN ::= length of the message
ID ::= the ID of the message.
Read the user header data.
BLOG ::= binary log
SEQUENCE ::= octet vector
START, END ::= region of sequence to read into.
Read the next message from the log
Remap the file. SIZE should be the new size.
Delete the item from the database.
Reset the binary log. Clears all data blocks and assigns new tag and seqno.
Start following the log. If TAG is provided, only those messages with a matching tag will be displayed.
Stop following the log.
Synchronize the binary log. Flushes the file mapping, reads and sets current properties.
Write a new message into the log.
BLOG ::= binary log
SEQUENCE ::= octet vector
START, END ::= region of sequence to write.
Writes the data into the log starting at the currently persisted index. Updates the persisted properties to the next index, ID and increments the seqno.
Returns the ID of the message that was written.
Write the user header data.
BLOG ::= binary log
SEQUENCE ::= octet vector
START, END ::= region of sequence to write.
Note that the header is a free-access region with no record of how much of the allocated space (if any) is actually in use.
Write a message to the log. Updates the log header information and advances the underlying mapping stream.
LVL should be a keyword namign a log level.
MESSAGE should be a string with the message to write.
TAG, if provided, will be the message tag, otherwise the default tag for the log will be used.
mapping-stream
)) ¶automatically generated reader method
mapping-stream
)) ¶mapping-stream
)) ¶Stores the current position in the remote file.
mapping-stream
)) ¶The element type is always OCTET by definition.
mapping-stream
)) ¶Sets the index into the underlying vector if POSITION-SPEC is acceptable.
trivial-gray-streams
.
mapping-stream
)) ¶Simply returns the index into the underlying vector.
trivial-gray-streams
.
mapping-stream
)) ¶sb-gray
.
mapping-stream
)) ¶sb-gray
.
mapping-stream
)) ¶checks whether there are bytes left to read
sb-gray
.
mapping-stream
)) ¶Returns the byte or :EOF
sb-gray
.
mapping-stream
) sequence start end &key) ¶Returns the index of last byte read.
trivial-gray-streams
.
mapping-stream
) byte) ¶write the byte to the local buffer, flush it if at the end of the buffer
sb-gray
.
mapping-stream
) sequence start end &key) ¶Returns the index of last byte written.
trivial-gray-streams
.
fundamental-binary-input-stream
.
fundamental-binary-output-stream
.
trivial-gray-stream-mixin
.
:mapping
This slot is read-only.
Stores the current position in the remote file.
common-lisp
.
0
Magic number placed at the start of a message block to make it easy to identify value messages in the log.
Evaluate the body in the contect of a mapping stream.
Set the stream position to the block index
Reset the log position of the next message.
Advance the stream position to the start of the next block.
Checks if STREAM is open and signals an error otherwise.
Make a copy of the log stream, possibly changing the log tag
Ensures the file exists with specified size.
Ensure changes to the file mappign are written to disk
Print the log messages to the output stream until the exit-p flag is signalled.
log
.
lvl
.
tag
.
Read the current message ID from the log header
Read the current block index from the header
id
.
size
.
id
.
lvl
.
msg
.
tag
.
time
.
Make a follower for the log streeam specified. Will output the messages to the stream provided.
Make a plog instance from a mapping stream. SIZE should be the size of each block.
size
.
tag
.
Read from the mapping offset into the sequence.
Set the log header message id and block index
Write the sequence into the mapping.
Format a message tothe stream
structure-object
.
structure-object
.
(vector (unsigned-byte 8))
(make-array pounds.blog::+props-block+ :element-type (quote (unsigned-byte 8)) :initial-element 0)
common-lisp
.
integer
pounds.blog::+props-block+
integer
0
Jump to: | %
(
A B C D E F G H I L M N O P R S U W X |
---|
Jump to: | %
(
A B C D E F G H I L M N O P R S U W X |
---|
Jump to: | *
+
B C E F H I L M N O P R S T V W |
---|
Jump to: | *
+
B C E F H I L M N O P R S T V W |
---|
Jump to: | B C D E F L M P S X |
---|
Jump to: | B C D E F L M P S X |
---|