Derives the key of the given data, without storing it.
◆ c4blob_create()Stores a blob.
The associated key will be written to outKey
, if non-NULL. If expectedKey
is not NULL, then the operation will fail unless the contents actually have that key.
Deletes a blob from the store given its key.
◆ c4blob_deleteStore()Deletes the BlobStore's blobs and directory, and (if successful) frees the object.
Closes/frees a BlobStore.
(A NULL parameter is allowed.)
Reads the entire contents of a blob into memory.
Caller is responsible for freeing it.
◆ c4blob_getFilePath()Returns the path of the file that stores the blob, if possible.
This call may fail with error kC4ErrorWrongFormat if the blob is encrypted (in which case the file would be unreadable by the caller) or with kC4ErrorUnsupported if for some implementation reason the blob isn't stored as a standalone file. Thus, the caller MUST use this function only as an optimization, and fall back to reading the contents via the API if it fails. Also, it goes without saying that the caller MUST not modify the file!
◆ c4blob_getSize()Gets the content size of a blob given its key.
Returns -1 if it doesn't exist. WARNING: If the blob is encrypted, the return value is a conservative estimate that may be up to 16 bytes larger than the actual size.
◆ c4blob_keyFromString()Decodes a string of the form "sha1-"+base64 into a raw key.
Encodes a blob key to a string of the form "sha1-"+base64.
Opens a blob for reading, as a random-access byte stream.
Opens a BlobStore in a directory.
If the flags allow creating, the directory will be created if necessary. Call c4blob_freeStore() when finished using the BlobStore.
Opens a write stream for creating a new blob.
You should then call c4stream_write to write the data, ending with c4stream_install to compute the blob's key and add it to the store, and then c4stream_closeWriter.
Returns the BlobStore associated with a bundled database.
Fails if the database is not bundled. DO NOT call c4blob_freeStore on this! The C4Database will free it when it closes.
◆ c4stream_bytesWritten()Returns the number of bytes written to the stream.
Computes the blob-key (digest) of the data written to the stream.
This should only be called after writing the entire data. No more data can be written after this call.
Returns the exact length in bytes of the stream.
Adds the data written to the stream as a finished blob to the store.
If expectedKey
is not NULL, then the operation will fail unless the contents actually have that key. (If you don't know ahead of time what the key should be, call c4stream_computeBlobKey beforehand to derive it, and pass NULL for expectedKey.) This function does not close the writer.
Reads from an open stream.
Moves to a random location in the stream; the next c4stream_read call will read from that location.
Writes data to a stream.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4