summaryrefslogtreecommitdiffhomepage
path: root/Usr
diff options
context:
space:
mode:
authoramlal <amlalelmahrouss@icloud.com>2024-06-13 22:02:27 +0200
committeramlal <amlalelmahrouss@icloud.com>2024-06-13 22:02:27 +0200
commit67a14f5c12510e277911cbcf8ea5ce01f8b8fbb1 (patch)
treead0ef9e95ef9ce136160bfa915c042e778f34b1e /Usr
parent12126f9eebfa7fc6b2cd6148f13585ff71cf5425 (diff)
MHR-31: Detect all types of cores except the boot one.
Signed-off-by: amlal <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Usr')
-rw-r--r--Usr/Sys/CoreSystem/Headers/Defines.h19
-rw-r--r--Usr/Sys/CoreSystem/Headers/File.h2
-rw-r--r--Usr/Sys/CoreSystem/Headers/Intl.h6
-rw-r--r--Usr/Sys/CoreSystem/Headers/Transport.h6
-rw-r--r--Usr/Sys/CoreSystem/Sources/CRTStartup.c2
-rw-r--r--Usr/Sys/CoreSystem/Sources/File.c18
6 files changed, 26 insertions, 27 deletions
diff --git a/Usr/Sys/CoreSystem/Headers/Defines.h b/Usr/Sys/CoreSystem/Headers/Defines.h
index 2c04c3f1..f659fa76 100644
--- a/Usr/Sys/CoreSystem/Headers/Defines.h
+++ b/Usr/Sys/CoreSystem/Headers/Defines.h
@@ -11,12 +11,12 @@
#endif
#ifdef _DEBUG
-#define CS_MUST_PASS(e) \
- { \
- if (!e) \
- { \
+#define CS_MUST_PASS(e) \
+ { \
+ if (!e) \
+ { \
UiAlert("Assertion failed.\nExpression :%s\nFile: %s\nLine: %i", #e, __FILE__, __LINE__) RtAssertTriggerInterrupt() \
- } \
+ } \
}
#else
#define CS_MUST_PASS(e) CS_UNREFERENCED_PARAMETER(e)
@@ -124,7 +124,7 @@ typedef CharacterTypeUTF8 BooleanType;
#define CS_CONSTEXPR
#endif // __cplusplus
-enum
+enum
{
kCallAllocPtr = 1,
kCallFreePtr,
@@ -173,8 +173,7 @@ typedef struct ApplicationInterface
{
VoidType (*Release)(struct ApplicationInterface* Self, DWordType ExitCode);
IntPtrType (*Invoke)(struct ApplicationInterface* Self, DWordType Sel, ...);
- VoidType (*Query)(struct ApplicationInterface* Self, PtrVoidType* Dst,
- SizeType SzDst, struct GUID* GuidOf);
+ VoidType (*Query)(struct ApplicationInterface* Self, PtrVoidType* Dst, SizeType SzDst, struct GUID* GuidOf);
} ApplicationInterface, *ApplicationInterfaceRef;
#ifdef __cplusplus
@@ -214,12 +213,12 @@ CS_EXTERN_C ApplicationInterfaceRef RtGetAppPointer(VoidType);
/// @brief Get argument count
/// @param
/// @return
-CS_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType);
+CS_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType);
/// @brief Get argument pointer.
/// @param
/// @return
-CS_EXTERN_C CharacterTypeUTF8** RtGetAppArgumentsPtr(VoidType);
+CS_EXTERN_C CharacterTypeUTF8** RtGetAppArgumentsPtr(VoidType);
/// @brief Shared application interface.
CS_EXTERN_C ApplicationInterfaceRef kSharedApplication;
diff --git a/Usr/Sys/CoreSystem/Headers/File.h b/Usr/Sys/CoreSystem/Headers/File.h
index 66bc6549..12dfb033 100644
--- a/Usr/Sys/CoreSystem/Headers/File.h
+++ b/Usr/Sys/CoreSystem/Headers/File.h
@@ -51,7 +51,7 @@ CS_EXTERN_C BooleanType CSIsValidPath(const CharacterTypeUTF8* path);
/// @brief Flush file
/// @param refCS the file reference.
-/// @return
+/// @return
CS_EXTERN_C VoidType CSFlushFile(FSRef refCS);
/// END OF FILE
diff --git a/Usr/Sys/CoreSystem/Headers/Intl.h b/Usr/Sys/CoreSystem/Headers/Intl.h
index c9eae306..afc7431c 100644
--- a/Usr/Sys/CoreSystem/Headers/Intl.h
+++ b/Usr/Sys/CoreSystem/Headers/Intl.h
@@ -14,12 +14,12 @@ typedef UInt64Type IntlRef;
/// @brief Get app locale.
/// @param name locale name.
-/// @return
-IntlRef IntlGetLocale(const char* name);
+/// @return
+IntlRef IntlGetLocale(const char* name);
/// @brief Set app locale.
/// @param intl the locale
-/// @return
+/// @return
BooleanType IntlSetLocale(const IntlRef intl);
/// @brief locale helpers.
diff --git a/Usr/Sys/CoreSystem/Headers/Transport.h b/Usr/Sys/CoreSystem/Headers/Transport.h
index 671621c8..996e69cc 100644
--- a/Usr/Sys/CoreSystem/Headers/Transport.h
+++ b/Usr/Sys/CoreSystem/Headers/Transport.h
@@ -28,19 +28,19 @@ CS_EXTERN_C CS_CONST TptStreamType CSOpenSocket(UInt32Type afType, UInt32Type so
/// @brief Close a STREAMS socket.
/// @param streams The streams socket.
-/// @return
+/// @return
CS_EXTERN_C VoidType CSCloseSocket(CS_CONST TptStreamType streams);
/// @brief Get OpenTransport version.
/// @param void
-/// @return
+/// @return
CS_EXTERN_C CS_CONST Int32Type CSGetVersion(VoidType);
enum
{
TrSocketProtoTCP, /// TCP socket
TrSocketProtoUDP, /// UDP socket
- TrSocketProtoUN, /// IPC socket
+ TrSocketProtoUN, /// IPC socket
TrSocketProtoRaw, /// Raw socket
TrSocketProtoCount,
};
diff --git a/Usr/Sys/CoreSystem/Sources/CRTStartup.c b/Usr/Sys/CoreSystem/Sources/CRTStartup.c
index faefe9b7..2dc9b1c4 100644
--- a/Usr/Sys/CoreSystem/Sources/CRTStartup.c
+++ b/Usr/Sys/CoreSystem/Sources/CRTStartup.c
@@ -8,5 +8,5 @@
VoidType __DllMainCRTStartup(VoidType)
{
- kSharedApplication = RtGetAppPointer();
+ kSharedApplication = RtGetAppPointer();
} \ No newline at end of file
diff --git a/Usr/Sys/CoreSystem/Sources/File.c b/Usr/Sys/CoreSystem/Sources/File.c
index 9f6b3b35..2e34d782 100644
--- a/Usr/Sys/CoreSystem/Sources/File.c
+++ b/Usr/Sys/CoreSystem/Sources/File.c
@@ -19,7 +19,7 @@ enum FileOp
/// @brief Opens a new file.
/// @param path where to find it.
/// @param rest the restrict (rw, rwe, r+, w+, r, w)
-/// @return FSRef the file.
+/// @return FSRef file reference.
CS_EXTERN_C FSRef CSOpenFile(const CharacterTypeUTF8* path,
const CharacterTypeUTF8* rest)
{
@@ -33,7 +33,7 @@ CS_EXTERN_C FSRef CSOpenFile(const CharacterTypeUTF8* path,
/// @brief Closes the file and flushes it to the said file.
/// @param refCS the filesystem reference.
-/// @return
+/// @return void
CS_EXTERN_C VoidType CSCloseFile(FSRef refCS)
{
CS_MUST_PASS(kSharedApplication);
@@ -45,7 +45,7 @@ CS_EXTERN_C VoidType CSCloseFile(FSRef refCS)
/// @brief Flush file
/// @param refCS the file reference.
-/// @return
+/// @return void
CS_EXTERN_C VoidType CSFlushFile(FSRef refCS)
{
CS_MUST_PASS(kSharedApplication);
@@ -54,16 +54,16 @@ CS_EXTERN_C VoidType CSFlushFile(FSRef refCS)
}
/// @brief Check if filesystem path is valid.
-/// @param path
-/// @return
+/// @param path the filesystem path.
+/// @return if the path is valid or not.
CS_EXTERN_C BooleanType CSIsValidPath(const CharacterTypeUTF8* path)
{
CS_MUST_PASS(kSharedApplication);
CS_MUST_PASS(path);
return kSharedApplication->Invoke(kSharedApplication, kCallFileExists, path) ||
- kSharedApplication->Invoke(kSharedApplication, kCallDirectoryExists, path) ||
- kSharedApplication->Invoke(kSharedApplication, kCallSymlinkExists, path) ||
- kSharedApplication->Invoke(kSharedApplication, kCallDriveExists, path) ||
- kSharedApplication->Invoke(kSharedApplication, kCallDeviceExists, path);
+ kSharedApplication->Invoke(kSharedApplication, kCallDirectoryExists, path) ||
+ kSharedApplication->Invoke(kSharedApplication, kCallSymlinkExists, path) ||
+ kSharedApplication->Invoke(kSharedApplication, kCallDriveExists, path) ||
+ kSharedApplication->Invoke(kSharedApplication, kCallDeviceExists, path);
} \ No newline at end of file