diff options
Diffstat (limited to 'dev/SCI')
| -rw-r--r-- | dev/SCI/SCIErr.hxx | 49 | ||||
| -rw-r--r-- | dev/SCI/Sources/SCIErr.cxx | 9 | ||||
| -rw-r--r-- | dev/SCI/Sources/base.cxx (renamed from dev/SCI/Sources/SCIBase.cxx) | 2 | ||||
| -rw-r--r-- | dev/SCI/sci_base.hxx (renamed from dev/SCI/SCIBase.hxx) | 43 | ||||
| -rw-r--r-- | dev/SCI/sci_err.hxx | 47 | ||||
| -rw-r--r-- | dev/SCI/sci_hint.hxx (renamed from dev/SCI/Hint.h) | 0 |
6 files changed, 76 insertions, 74 deletions
diff --git a/dev/SCI/SCIErr.hxx b/dev/SCI/SCIErr.hxx deleted file mode 100644 index af5d54fd..00000000 --- a/dev/SCI/SCIErr.hxx +++ /dev/null @@ -1,49 +0,0 @@ -/* ------------------------------------------- - - Copyright ZKA Technologies. - -------------------------------------------- */ - -#pragma once - -#include <SCI/SCIBase.hxx> - -#define ErrLocalIsOk() (kLastError == kErrorSuccess) -#define ErrLocalFailed() (kLastError != kErrorSuccess) -#define ErrLocal() (kLastError) - -typedef SInt32 NEW_ERROR_TYPE; - -inline constexpr NEW_ERROR_TYPE kErrorSuccess = 0; -inline constexpr NEW_ERROR_TYPE kErrorExecutable = 33; -inline constexpr NEW_ERROR_TYPE kErrorExecutableLib = 34; -inline constexpr NEW_ERROR_TYPE kErrorFileNotFound = 35; -inline constexpr NEW_ERROR_TYPE kErrorDirectoryNotFound = 36; -inline constexpr NEW_ERROR_TYPE kErrorDiskReadOnly = 37; -inline constexpr NEW_ERROR_TYPE kErrorDiskIsFull = 38; -inline constexpr NEW_ERROR_TYPE kErrorProcessFault = 39; -inline constexpr NEW_ERROR_TYPE kErrorSocketHangUp = 40; -inline constexpr NEW_ERROR_TYPE kErrorThreadLocalStorage = 41; -inline constexpr NEW_ERROR_TYPE kErrorMath = 42; -inline constexpr NEW_ERROR_TYPE kErrorNoNetwork = 43; -inline constexpr NEW_ERROR_TYPE kErrorHeapOutOfMemory = 44; -inline constexpr NEW_ERROR_TYPE kErrorNoSuchDisk = 45; -inline constexpr NEW_ERROR_TYPE kErrorFileExists = 46; -inline constexpr NEW_ERROR_TYPE kErrorFormatFailed = 47; -inline constexpr NEW_ERROR_TYPE kErrorNetworkTimeout = 48; -inline constexpr NEW_ERROR_TYPE kErrorInternal = 49; -inline constexpr NEW_ERROR_TYPE kErrorForkAlreadyExists = 50; -inline constexpr NEW_ERROR_TYPE kErrorOutOfTeamSlot = 51; -inline constexpr NEW_ERROR_TYPE kErrorHeapNotPresent = 52; -inline constexpr NEW_ERROR_TYPE kErrorNoEntrypoint = 53; -inline constexpr NEW_ERROR_TYPE kErrorDiskIsCorrupted = 54; -inline constexpr NEW_ERROR_TYPE kErrorDisk = 55; -inline constexpr NEW_ERROR_TYPE kErrorInvalidData = 56; -inline constexpr NEW_ERROR_TYPE kErrorAsync = 57; -inline constexpr NEW_ERROR_TYPE kErrorNonBlocking = 58; -inline constexpr NEW_ERROR_TYPE kErrorIPC = 59; -inline constexpr NEW_ERROR_TYPE kErrorSign = 60; -inline constexpr NEW_ERROR_TYPE kErrorInvalidCreds = 61; -inline constexpr NEW_ERROR_TYPE kErrorUnimplemented = 0; - -IMPORT_C NEW_ERROR_TYPE kLastError; diff --git a/dev/SCI/Sources/SCIErr.cxx b/dev/SCI/Sources/SCIErr.cxx deleted file mode 100644 index 509ccd6d..00000000 --- a/dev/SCI/Sources/SCIErr.cxx +++ /dev/null @@ -1,9 +0,0 @@ -/* -------------------------------------------
-
- Copyright ZKA Technologies.
-
-------------------------------------------- */
-
-#include <SCI/SCIErr.hxx>
-
-NEW_ERROR_TYPE kLastError = 0;
diff --git a/dev/SCI/Sources/SCIBase.cxx b/dev/SCI/Sources/base.cxx index b103886c..6963a624 100644 --- a/dev/SCI/Sources/SCIBase.cxx +++ b/dev/SCI/Sources/base.cxx @@ -4,4 +4,4 @@ ------------------------------------------- */
-#include <SCI/SCIBase.hxx>
+#include <SCI/sci_base.hxx>
diff --git a/dev/SCI/SCIBase.hxx b/dev/SCI/sci_base.hxx index 982ca950..1d69a56b 100644 --- a/dev/SCI/SCIBase.hxx +++ b/dev/SCI/sci_base.hxx @@ -10,7 +10,7 @@ Purpose: SCI/M core header file (C++) #ifndef __SCI_BASE_HXX__
#define __SCI_BASE_HXX__
-#include <SCI/Hint.h>
+#include <SCI/sci_hint.hxx>
#define IMPORT_CXX extern "C++"
#define IMPORT_C extern "C"
@@ -34,6 +34,8 @@ typedef void* VoidPtr; typedef __UINTPTR_TYPE__ UIntPtr;
typedef char Char;
+#include <SCI/sci_err.hxx>
+
#ifdef __SCI_IMPL__
#include <SCI/scm.internal.inl>
#else
@@ -89,12 +91,13 @@ public: /// @note Handle types.
// ------------------------------------------------------------------------------------------ //
-typedef VoidPtr NEW_OBJECT;
+typedef VoidPtr ZKAObject;
-typedef NEW_OBJECT DLL_OBJECT;
-typedef NEW_OBJECT IO_OBJECT;
-typedef NEW_OBJECT COMP_OBJECT;
-typedef NEW_OBJECT SCM_OBJECT;
+typedef ZKAObject ZKADLLObject;
+typedef ZKAObject ZKAIOObject;
+typedef ZKAObject ZKASCMObject;
+typedef ZKAObject ZKAThreadObject;
+typedef ZKAObject ZKASocketObject;
// ------------------------------------------------------------------------------------------ //
@@ -106,18 +109,18 @@ typedef NEW_OBJECT SCM_OBJECT; /// @param symbol the symbol to look for
/// @param dll_handle the DLL handle.
/// @return the proc pointer.
-IMPORT_C NEW_OBJECT LdrGetDLLProc(_Input const Char* symbol, _Input NEW_OBJECT dll_handle);
+IMPORT_C ZKAObject LdrGetDLLProc(_Input const Char* symbol, _Input ZKAObject dll_handle);
/// @brief Open DLL handle.
/// @param path
/// @param drv
/// @return
-IMPORT_C NEW_OBJECT LdrOpenDLL(_Input const Char* path, _Input const Char* drive_letter);
+IMPORT_C ZKAObject LdrOpenDLL(_Input const Char* path, _Input const Char* drive_letter);
/// @brief Close DLL handle
/// @param dll_handle
/// @return
-IMPORT_C UInt0 LdrCloseDLL(_Input NEW_OBJECT dll_handle);
+IMPORT_C UInt0 LdrCloseDLL(_Input ZKAObject dll_handle);
// ------------------------------------------------------------------------------------------ //
// File API.
@@ -127,18 +130,28 @@ IMPORT_C UInt0 LdrCloseDLL(_Input NEW_OBJECT dll_handle); /// @param fs_path the filesystem path.
/// @param drive_letter drive name, use NULL to use default one.
/// @return the file descriptor of the file.
-IMPORT_C NEW_OBJECT RtlOpenFile(const Char* fs_path, const Char* drive_letter);
+IMPORT_C ZKAObject IoOpenFile(const Char* fs_path, const Char* drive_letter);
/// @brief Closes a file and flushes its content.
/// @param file_desc the file descriptor.
-/// @return
-IMPORT_C UInt0 RtlCloseFile(_Input NEW_OBJECT file_desc);
+/// @return void.
+IMPORT_C UInt0 IoCloseFile(_Input ZKAObject file_desc);
+
+IMPORT_C UInt32 IoWriteFile(_Input ZKAObject file_desc, _Output VoidPtr out_data, SizeT sz_data);
+
+IMPORT_C UInt32 IoReadFile(_Input ZKAObject file_desc, _Output VoidPtr* out_data, SizeT sz_data);
+
+IMPORT_C UInt64 IoRewindFile(_Input ZKAObject file_desc);
+
+IMPORT_C UInt64 IoTellFile(_Input ZKAObject file_desc);
+
+IMPORT_C UInt64 IoSeekFile(_Input ZKAObject file_desc, UInt64 file_offset);
// ------------------------------------------------------------------------
// TLS API.
// ------------------------------------------------------------------------
-/// @brief Installs the TIB and GIB inside the current process.
+/// @brief Installs the Thread Information Block and Global Information Block inside the current process.
/// @param void.
/// @return > 0 error ocurred or already present, = 0 success.
IMPORT_C UInt32 TlsInstallIB(UInt0);
@@ -165,11 +178,11 @@ SInt32 ScmReleaseClass(_Input TCLS* cls); /// @brief Creates an SCM instance in the process.
/// @param handle_instance the SCM handle.
/// @param flags the SCM flags.
-IMPORT_C SInt32 ScmCreateInstance(_Input UInt32 flags, _Output SCM_OBJECT* handle_instance);
+IMPORT_C SInt32 ScmCreateInstance(_Input UInt32 flags, _Output ZKAObject* handle_instance);
/// @brief Destroys an SCM instance of the process.
/// @param handle_instance the SCM handle.
-IMPORT_C UInt0 ScmDestroyInstance(_Input SCM_OBJECT handle_instance);
+IMPORT_C UInt0 ScmDestroyInstance(_Input ZKAObject handle_instance);
// ------------------------------------------------------------------------
// Memory Management API.
diff --git a/dev/SCI/sci_err.hxx b/dev/SCI/sci_err.hxx new file mode 100644 index 00000000..a1e56dfd --- /dev/null +++ b/dev/SCI/sci_err.hxx @@ -0,0 +1,47 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#pragma once + +#define ErrLocalIsOk() (kLastError == kErrorSuccess) +#define ErrLocalFailed() (kLastError != kErrorSuccess) +#define ErrLocal() (kLastError) + +typedef SInt32 ZKAErr; + +inline constexpr ZKAErr kErrorSuccess = 0; +inline constexpr ZKAErr kErrorExecutable = 33; +inline constexpr ZKAErr kErrorExecutableLib = 34; +inline constexpr ZKAErr kErrorFileNotFound = 35; +inline constexpr ZKAErr kErrorDirectoryNotFound = 36; +inline constexpr ZKAErr kErrorDiskReadOnly = 37; +inline constexpr ZKAErr kErrorDiskIsFull = 38; +inline constexpr ZKAErr kErrorProcessFault = 39; +inline constexpr ZKAErr kErrorSocketHangUp = 40; +inline constexpr ZKAErr kErrorThreadLocalStorage = 41; +inline constexpr ZKAErr kErrorMath = 42; +inline constexpr ZKAErr kErrorNoNetwork = 43; +inline constexpr ZKAErr kErrorHeapOutOfMemory = 44; +inline constexpr ZKAErr kErrorNoSuchDisk = 45; +inline constexpr ZKAErr kErrorFileExists = 46; +inline constexpr ZKAErr kErrorFormatFailed = 47; +inline constexpr ZKAErr kErrorNetworkTimeout = 48; +inline constexpr ZKAErr kErrorInternal = 49; +inline constexpr ZKAErr kErrorForkAlreadyExists = 50; +inline constexpr ZKAErr kErrorOutOfTeamSlot = 51; +inline constexpr ZKAErr kErrorHeapNotPresent = 52; +inline constexpr ZKAErr kErrorNoEntrypoint = 53; +inline constexpr ZKAErr kErrorDiskIsCorrupted = 54; +inline constexpr ZKAErr kErrorDisk = 55; +inline constexpr ZKAErr kErrorInvalidData = 56; +inline constexpr ZKAErr kErrorAsync = 57; +inline constexpr ZKAErr kErrorNonBlocking = 58; +inline constexpr ZKAErr kErrorIPC = 59; +inline constexpr ZKAErr kErrorSign = 60; +inline constexpr ZKAErr kErrorInvalidCreds = 61; +inline constexpr ZKAErr kErrorUnimplemented = 0; + +IMPORT_C ZKAErr kLastError; diff --git a/dev/SCI/Hint.h b/dev/SCI/sci_hint.hxx index c785f953..c785f953 100644 --- a/dev/SCI/Hint.h +++ b/dev/SCI/sci_hint.hxx |
