diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-29 17:01:55 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-29 17:06:28 +0100 |
| commit | 7e5be1572c043484293ee0cdd840dd41f54e87ee (patch) | |
| tree | 171427b27eb240d4006fda89e485ce6da28fd749 /Public/Developer/SystemLib/Headers/File.h | |
| parent | d7eb7affee3733dfeee6864045da4c2f5df2e919 (diff) | |
Kernel and SystemLib: See below.
What has been done:
- Rename most System.Core to SystemLib.
- Reworked it's API and the concept of ObjectRef to become the
ApplicationRef object.
- Remove unused ODF and XIFF file format from tree, ODF will be part of
the text editing program.
- Update Readme for SystemLib.
- Add Support folder on NewFS partitions.
What is next:
- NewFS filesystem support.
- Program loading.
- Preemptive scheduler on non-SMP systems using timers.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Developer/SystemLib/Headers/File.h')
| -rw-r--r-- | Public/Developer/SystemLib/Headers/File.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Public/Developer/SystemLib/Headers/File.h b/Public/Developer/SystemLib/Headers/File.h new file mode 100644 index 00000000..0bce05f9 --- /dev/null +++ b/Public/Developer/SystemLib/Headers/File.h @@ -0,0 +1,44 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + +#include <Headers/Defines.h> + +/// @brief Filesystem wrapper. + +typedef QWordTyp FSRef; + +/// @brief Opens a new file. +/// @param path where to find it. +/// @param r the restrict (rw, rwe, r+, w+, r, w) +/// @return +CA_EXTERN_C FSRef FsOpenFile(const CharacterTypeUTF8* path, const CharacterTypeUTF8* r); + +/// @brief Closes the file and flushes it to the said file. +/// @param refFs the filesystem reference. +/// @return +CA_EXTERN_C VoidType FsCloseFile(FSRef refFs); + +typedef QWordTyp FSForkRef; + +/// @brief A fork information header. +typedef struct _Fork { + PtrVoidType forkData; + SizeType forkSize; + Int32Type forkFlags; + Int32Type forkKind; + CharacterTypeUTF8 forkName[256]; +} ForkType; + +/// @brief Gets the fork inside a file. +/// @param refFs the filesystem ref +/// @param forkName the fork's name +/// @return the fork data. +CA_EXTERN_C FSForkRef FsGetFork(FSRef refFs, const CharacterTypeUTF8* forkName); + +#define FsGetDataFork(refFs) FsGetFork(refFs, "data") +#define FsGetRsrcFork(refFs) FsGetFork(refFs, "rsrc") |
