Diol can save your theme preference in this browser using local storage.
const void *EsBundleFind(const EsBundle *bundle, STRING name, size_t *byteCount = ES_NULL);
Pass null as the bundle to use the current application's bundle.
EsDirectoryChild *EsDirectoryEnumerate(STRING path, size_t *count, EsError *error = ES_NULL);
Lists the children of the directory at path. Returns an array of EsDirectoryChild; free with EsHeapFree. count receives the entry count and error receives the error.
void *EsFileReadAll(STRING filePath, size_t *fileSize, EsError *error = ES_NULL);
Free with EsHeapFree.
void *EsFileReadAllFromHandle(EsHandle handle, size_t *fileSize, EsError *error = ES_NULL);
Free with EsHeapFree.
EsError EsFileWriteAll(STRING filePath, const void *data, size_t fileSize);
Creates the file at filePath, and any missing leading directories, and writes the data. Returns an error code.
EsError EsFileWriteAllFromHandle(EsHandle handle, const void *data, size_t fileSize);
Overwrites the contents of the open file with the data. Returns an error code.
EsError EsFileWriteAllGather(STRING filePath, const void **data, const size_t *sizes, size_t gatherCount);
Creates the file at filePath and writes gatherCount buffers consecutively. Returns an error code.
EsError EsFileWriteAllGatherFromHandle(EsHandle handle, const void **data, const size_t *sizes, size_t gatherCount);
Overwrites the open file with gatherCount buffers written consecutively. Returns an error code.
void *EsFileMap(STRING filePath, size_t *fileSize, uint32_t flags);
Maps the file at filePath into memory. Returns a pointer, or null on error. fileSize receives the file size. Unmap with EsMemoryUnreserve.
EsError EsFileCopy(STRING source, STRING destination, void **copyBuffer = ES_NULL, EsFileCopyCallback callback = ES_NULL, EsGeneric data = ES_NULL);
If you are copying lots of files, you can reuse the temporary copy buffer by storing the output copyBuffer; call EsHeapFree on it after the last copy.
EsError EsFileControl(EsHandle file, EsFileControlOperation operation, void *data, size_t dataBytes);
Performs the given control operation on the open file. data is the operation payload.
EsFileInformation EsFileOpen(STRING path, EsFileOpenFlags flags);
Opens the file at path with the given flags. Returns an EsFileInformation; check its error field.
EsFileOffset EsFileGetSize(EsHandle handle);
Returns the size of the open file.
size_t EsFileReadSync(EsHandle file, EsFileOffset offset, size_t size, void *buffer);
Reads size bytes from file at offset into buffer. Returns the number of bytes read.
EsError EsFileResize(EsHandle file, EsFileOffset newSize);
Resizes the open file to newSize. Returns an error code.
size_t EsFileWriteSync(EsHandle file, EsFileOffset offset, size_t size, const void *buffer);
Writes size bytes from buffer to file at offset. Returns the number of bytes written.
EsError EsFileDelete(EsHandle file);
Deletes the file. Returns an error code.
EsError EsPathDelete(STRING path);
Deletes the node at path. Returns an error code if the path does not exist.
size_t EsPathFindUniqueName(char *buffer, size_t originalBytes, size_t bufferBytes);
Modifies buffer in place to a path that does not exist yet, appending a number before the extension. Returns the new path length, or 0 on failure.
EsError EsPathMove(STRING oldPath, STRING newPath, EsPathMoveFlags flags = ES_FLAGS_DEFAULT);
Moves or renames the node at oldPath to newPath. Use ES_PATH_MOVE_ALLOW_COPY_AND_DELETE to move between volumes.
bool EsPathExists(STRING filePath, EsNodeType *type = ES_NULL);
Returns true if the file/directory exists.
EsError EsPathCreate(STRING filePath, EsNodeType type, bool createLeadingDirectories);
Creates a file or directory at filePath. type is ES_NODE_FILE or ES_NODE_DIRECTORY. Returns an error code if the node already exists.
EsError EsPathQueryInformation(STRING filePath, EsDirectoryChild *information);
Fills information with the type, size, and content type of the node at filePath.
void *EsFileStoreReadAll(EsFileStore *file, size_t *fileSize);
Free with EsHeapFree.
bool EsFileStoreWriteAll(EsFileStore *file, const void *data, size_t dataBytes);
Overwrites the file store's file with the data. Returns true on success.
bool EsFileStoreAppend(EsFileStore *file, const void *data, size_t dataBytes);
Appends the data to the file store's file. Returns true on success.
EsFileOffsetDifference EsFileStoreGetSize(EsFileStore *file);
Returns -1 on error.
void *EsFileStoreMap(EsFileStore *file, size_t *fileSize, uint32_t flags);
Maps the file store's file into memory. Returns a pointer, or null on error. fileSize receives the file size.
void EsFileStoreSetContentType(EsFileStore *file, EsUniqueIdentifier identifier);
Sets the content type of the file store's file.
bool EsMountPointGetVolumeInformation(STRING prefix, EsVolumeInformation *information);
Returns false if the mount point does not exist.
EsError EsMountPointAdd(STRING prefix, EsHandle base);
The system maintains a duplicate of the base handle.
bool EsMountPointRemove(STRING prefix);
Returns false if the mount point does not exist. You can only remove mount points you added with EsMountPointAdd.
void EsOpenDocumentQueryInformation(STRING filePath, EsOpenDocumentInformation *information);
Asks the desktop for the open document matching filePath. Fills information.
void _EsPathAnnouncePathMoved(STRING oldPath, STRING newPath);
Set oldPathBytes = 0 to make the file manager refresh the path.
void _EsOpenDocumentEnumerate(EsBuffer *outputBuffer);
Appends the list of open documents to outputBuffer. Requires the all-files permission.
EsMessageDevice *EsDeviceEnumerate(size_t *count);
This must be done with the message mutex acquired. As soon as EsMessageReceived is next called, or the message mutex is released, then the handles in this array are invalid.
EsError EsDeviceControl(EsHandle handle, EsDeviceControlType type, void *dp, void *dq);
Sends a device control request to handle. dp and dq are the request and response data.