update some comments

This commit is contained in:
4am 2021-10-28 01:26:02 -04:00
parent 9a7edbc42f
commit 7b57f28078

View File

@ -6,7 +6,6 @@
; Public functions ; Public functions
; - okvs_init(address) reset (required) ; - okvs_init(address) reset (required)
; - okvs_len(address) get number of keys ; - okvs_len(address) get number of keys
; - okvs_append(address, key, value, max_len) add new key/value pair
; - okvs_update(address, key, value) update key/value pair ; - okvs_update(address, key, value) update key/value pair
; - okvs_get(address, key) get value by key lookup ; - okvs_get(address, key) get value by key lookup
; - okvs_find(address, key) get key by key lookup ; - okvs_find(address, key) get key by key lookup
@ -18,7 +17,7 @@
; Call init() once. Call it again to reset the store to 0 records. ; Call init() once. Call it again to reset the store to 0 records.
; ;
; Records are maintained in a singly linked list, so most functions are O(n). ; Records are maintained in a singly linked list, so most functions are O(n).
; len() and append() are O(1) though. ; len() is O(1) though.
; ;
; Record count is stored as a word, so a store can hold 65535 records. ; Record count is stored as a word, so a store can hold 65535 records.
; ;
@ -27,24 +26,17 @@
; ;
; Keys are case-sensitive. Lookups are an exact byte-for-byte comparison. ; Keys are case-sensitive. Lookups are an exact byte-for-byte comparison.
; ;
; append() has a max_len argument to reserve more space for the value, in case
; you want to update it later. max_len is the total space to reserve, not the
; additional space. One exception: max_len can be 0, and it will be treated as
; length(value) at append time. update() always modifies the value in place.
; There is no range checking because this is assembly.
; All functions take the starting address of the store's data buffer in ; All functions take the starting address of the store's data buffer in
; memory, so there can be multiple independent stores at one time. Only the ; memory, so there can be multiple independent stores at one time. Only the
; size of a record is stored, so stores are easily relocatable. append() will ; size of a record is stored, so stores are easily relocatable. There is no
; happily extend the store's data buffer without limit. There is no overflow ; overflow protection because this is assembly.
; protection because this is assembly.
; ;
; There is no sort() function. ; There is no sort() function.
; ;
; There is no delete() function. ; There is no delete() function.
; ;
; Keys can be duplicated, but get() and find() will always return the one that ; Keys can be duplicated, but get() and find() will always return the first
; was append()ed first. ; match.
; ;
; Structures: ; Structures:
; ;