summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-10-23 09:27:16 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-10-23 09:30:18 +0200
commit64492ed9c42659d0c5f7eb2143a673dd0b5f9dc3 (patch)
treeca8074878f508bd212a414f0c6ddbdf7e41d5dd7
parent9c4d2506ccb897045d9fb0c1082ed69ac24ce251 (diff)
feat! breaking API changes in kernel.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--dev/kernel/CFKit/Property.h4
-rw-r--r--dev/kernel/FSKit/IndexableProperty.h2
-rw-r--r--dev/kernel/NeKit/Defines.h11
-rw-r--r--dev/kernel/NeKit/Json.h46
-rw-r--r--dev/kernel/NeKit/KString.h26
-rw-r--r--dev/kernel/NeKit/KString.inl28
-rw-r--r--dev/kernel/NeKit/Ref.h3
-rw-r--r--dev/kernel/NeKit/Variant.h7
-rw-r--r--dev/kernel/src/FS/HeFS+FileMgr.cc33
-rw-r--r--dev/kernel/src/FS/HeFS+FileSystemParser.cc2
-rw-r--r--dev/kernel/src/Json.cc2
-rw-r--r--dev/kernel/src/Property.cc4
-rw-r--r--dev/libMsg/MsgKit/Server.h9
13 files changed, 106 insertions, 71 deletions
diff --git a/dev/kernel/CFKit/Property.h b/dev/kernel/CFKit/Property.h
index 17246a63..e8f2f713 100644
--- a/dev/kernel/CFKit/Property.h
+++ b/dev/kernel/CFKit/Property.h
@@ -30,9 +30,9 @@ class Property {
Property& operator=(const Property&) = default;
Property(const Property&) = default;
- BOOL StringEquals(BasicKString<>& name);
+ BOOL StringEquals(KBasicString<>& name);
PropertyId& GetValue();
- BasicKString<>& GetKey();
+ KBasicString<>& GetKey();
private:
KString fName{kMaxPropLen};
diff --git a/dev/kernel/FSKit/IndexableProperty.h b/dev/kernel/FSKit/IndexableProperty.h
index 8be6d7c3..d6b89d35 100644
--- a/dev/kernel/FSKit/IndexableProperty.h
+++ b/dev/kernel/FSKit/IndexableProperty.h
@@ -25,7 +25,7 @@ namespace Indexer {
class IndexableProperty final : public Property {
public:
explicit IndexableProperty() : Property() {
- Kernel::BasicKString<> strProp(kMaxPropLen);
+ Kernel::KBasicString<> strProp(kMaxPropLen);
strProp += "/prop/indexable";
this->GetKey() = strProp;
diff --git a/dev/kernel/NeKit/Defines.h b/dev/kernel/NeKit/Defines.h
index c5f02e0a..ed979e03 100644
--- a/dev/kernel/NeKit/Defines.h
+++ b/dev/kernel/NeKit/Defines.h
@@ -12,7 +12,7 @@
#define NEKIT_VERSION_BCD 0x0001
#ifndef __cplusplus
-#error Kernel compiles with a C++ compiler.
+#error !!! Kernel compiles only with a C++ compiler. !!!
#endif
#if __cplusplus <= 201703L
@@ -39,7 +39,7 @@ using Int32 = __INT32_TYPE__;
using UShort = __UINT16_TYPE__;
using UInt16 = __UINT16_TYPE__;
using Short = short;
-using Int16 = short;
+using Int16 = __INT16_TYPE__;
using UInt = __UINT32_TYPE__;
using UInt32 = __UINT32_TYPE__;
using Long = __INT64_TYPE__;
@@ -49,11 +49,13 @@ using UInt64 = __UINT64_TYPE__;
using Boolean = bool;
using Bool = bool;
using Char = char;
+using Int8 = __INT8_TYPE__;
+using Char8 = char8_t;
using UChar = __UINT8_TYPE__;
using UInt8 = __UINT8_TYPE__;
-using SSize = Int64;
-using SSizeT = Int64;
+using SSize = long;
+using SSizeT = long;
using Size = __SIZE_TYPE__;
using SizeT = __SIZE_TYPE__;
using IntPtr = __INTPTR_TYPE__;
@@ -83,6 +85,7 @@ typedef UInt32 PhysicalAddressKind;
typedef UIntPtr VirtualAddressKind;
using Void = void;
+using Any = void*;
using Lba = UInt64;
diff --git a/dev/kernel/NeKit/Json.h b/dev/kernel/NeKit/Json.h
index 24357dd7..35f53b57 100644
--- a/dev/kernel/NeKit/Json.h
+++ b/dev/kernel/NeKit/Json.h
@@ -7,7 +7,7 @@
#pragma once
-// last-rev: 02/04/25
+/// @brief Kernel JSON API.
#include <CompilerKit/CompilerKit.h>
#include <NeKit/Defines.h>
@@ -15,58 +15,58 @@
#include <NeKit/Stream.h>
#include <NeKit/Utils.h>
-#define kJSONMaxLen (8196)
-#define kJSONLen (256)
-#define kJSONNullArr "[]"
-#define kJSONNullObj "{}"
+#define kNeJsonMaxLen (8196)
+#define kNeJsonLen (256)
+#define kNeJsonNullArr "[]"
+#define kNeJsonNullObj "{}"
namespace Kernel {
/// @brief JavaScript object class
-class Json final {
+class JsonObject final {
public:
- explicit Json() {
- auto len = kJSONMaxLen;
- BasicKString<> key = KString(len);
- key += kJSONNullObj;
+ explicit JsonObject() {
+ auto len = kNeJsonMaxLen;
+ KBasicString<> key = KString(len);
+ key += kNeJsonNullObj;
this->AsKey() = key;
this->AsValue() = key;
}
- explicit Json(SizeT lhsLen, SizeT rhsLen) : fKey(lhsLen), fValue(rhsLen) {}
+ explicit JsonObject(SizeT lhsLen, SizeT rhsLen) : fKey(lhsLen), fValue(rhsLen) {}
- ~Json() = default;
+ ~JsonObject() = default;
- NE_COPY_DEFAULT(Json)
+ NE_COPY_DEFAULT(JsonObject)
Bool& IsUndefined() { return fUndefined; }
private:
Bool fUndefined; // is this instance undefined?
- BasicKString<> fKey;
- BasicKString<> fValue;
+ KBasicString<> fKey;
+ KBasicString<> fValue;
public:
/// @brief returns the key of the json
/// @return the key as string view.
- BasicKString<>& AsKey() { return fKey; }
+ KBasicString<>& AsKey() { return fKey; }
/// @brief returns the value of the json.
/// @return the key as string view.
- BasicKString<>& AsValue() { return fValue; }
+ KBasicString<>& AsValue() { return fValue; }
- static Json kNull;
+ static JsonObject kNull;
};
-/// @brief Json stream reader helper.
+/// @brief JsonObject stream reader helper.
struct JsonStreamReader final {
- STATIC Json In(const Char* full_array) {
+ STATIC JsonObject In(const Char* full_array) {
auto start_val = '{';
auto end_val = '}';
Boolean probe_value = false;
if (full_array[0] != start_val) {
- if (full_array[0] != '[') return Json::kNull;
+ if (full_array[0] != '[') return JsonObject::kNull;
start_val = '[';
end_val = ']';
@@ -79,7 +79,7 @@ struct JsonStreamReader final {
SizeT key_len = 0;
SizeT value_len = 0;
- Json type(kJSONMaxLen, kJSONMaxLen);
+ JsonObject type(kNeJsonMaxLen, kNeJsonMaxLen);
for (SizeT i = 1; i < len; ++i) {
if (full_array[i] == '\r' || full_array[i] == '\n') continue;
@@ -125,5 +125,5 @@ struct JsonStreamReader final {
}
};
-using JsonStream = Stream<JsonStreamReader, Json>;
+using JsonStream = Stream<JsonStreamReader, JsonObject>;
} // namespace Kernel
diff --git a/dev/kernel/NeKit/KString.h b/dev/kernel/NeKit/KString.h
index ec883a2f..6a1b04d2 100644
--- a/dev/kernel/NeKit/KString.h
+++ b/dev/kernel/NeKit/KString.h
@@ -12,14 +12,14 @@
#include <NeKit/KernelPanic.h>
#include <NeKit/Utils.h>
-#define kMinimumStringSize (8196U)
-
namespace Kernel {
+inline auto kMinimumStringSize = 8196;
+
/// @brief Kernel string class, not dynamic.
template <typename CharKind = Char>
-class BasicKString final {
+class KBasicString final {
public:
- explicit BasicKString() {
+ explicit KBasicString() {
fDataSz = kMinimumStringSize;
fData = new CharKind[fDataSz];
@@ -28,7 +28,7 @@ class BasicKString final {
rt_set_memory(fData, 0, fDataSz);
}
- explicit BasicKString(SizeT Sz) : fDataSz(Sz) {
+ explicit KBasicString(SizeT Sz) : fDataSz(Sz) {
MUST_PASS(Sz > 1);
fData = new CharKind[Sz];
@@ -37,14 +37,14 @@ class BasicKString final {
rt_set_memory(fData, 0, Sz);
}
- ~BasicKString() {
+ ~KBasicString() {
if (fData) {
delete[] fData;
fData = nullptr;
}
}
- NE_COPY_DEFAULT(BasicKString)
+ NE_COPY_DEFAULT(KBasicString)
CharKind* Data();
const CharKind* CData() const;
@@ -53,11 +53,11 @@ class BasicKString final {
bool operator==(const CharKind* rhs) const;
bool operator!=(const CharKind* rhs) const;
- bool operator==(const BasicKString<CharKind>& rhs) const;
- bool operator!=(const BasicKString<CharKind>& rhs) const;
+ bool operator==(const KBasicString<CharKind>& rhs) const;
+ bool operator!=(const KBasicString<CharKind>& rhs) const;
- BasicKString<CharKind>& operator+=(const CharKind* rhs);
- BasicKString<CharKind>& operator+=(const BasicKString<CharKind>& rhs);
+ KBasicString<CharKind>& operator+=(const CharKind* rhs);
+ KBasicString<CharKind>& operator+=(const KBasicString<CharKind>& rhs);
operator const char*() { return fData; }
@@ -73,13 +73,13 @@ class BasicKString final {
friend class KStringBuilder;
};
-using KString = BasicKString<>;
+using KString = KBasicString<>;
using KStringOr = ErrorOr<KString>;
class KStringBuilder final {
public:
template <typename CharKind = Char>
- static ErrorOr<BasicKString<CharKind>> Construct(const CharKind* data);
+ static ErrorOr<KBasicString<CharKind>> Construct(const CharKind* data);
template <typename CharKind = Char>
static const CharKind* FromBool(const CharKind* fmt, bool n);
template <typename CharKind = Char>
diff --git a/dev/kernel/NeKit/KString.inl b/dev/kernel/NeKit/KString.inl
index 4bb48415..d238818c 100644
--- a/dev/kernel/NeKit/KString.inl
+++ b/dev/kernel/NeKit/KString.inl
@@ -4,7 +4,7 @@
------------------------------------------- */
-/// @file BasicKString.inl
+/// @file KBasicString.inl
/// @brief Kernel String manipulation file.
namespace Kernel {
@@ -19,22 +19,22 @@ inline void ort_string_append(CharKind* lhs, const CharKind* rhs, Int32 cur) {
}
template <typename CharKind>
-inline CharKind* BasicKString<CharKind>::Data() {
+inline CharKind* KBasicString<CharKind>::Data() {
return this->fData;
}
template <typename CharKind>
-inline const CharKind* BasicKString<CharKind>::CData() const {
+inline const CharKind* KBasicString<CharKind>::CData() const {
return const_cast<const CharKind*>(this->fData);
}
template <typename CharKind>
-inline SizeT BasicKString<CharKind>::Length() const {
+inline SizeT KBasicString<CharKind>::Length() const {
return this->fDataSz;
}
template <typename CharKind>
-inline bool BasicKString<CharKind>::operator==(const BasicKString<CharKind>& rhs) const {
+inline bool KBasicString<CharKind>::operator==(const KBasicString<CharKind>& rhs) const {
if (rhs.Length() != this->Length()) return false;
for (Size index = 0; index < this->Length(); ++index) {
@@ -45,7 +45,7 @@ inline bool BasicKString<CharKind>::operator==(const BasicKString<CharKind>& rhs
}
template <typename CharKind>
-inline bool BasicKString<CharKind>::operator==(const CharKind* rhs) const {
+inline bool KBasicString<CharKind>::operator==(const CharKind* rhs) const {
if (ort_string_len<CharKind>(rhs) != this->Length()) return false;
for (Size index = 0; index < ort_string_len<CharKind>(rhs); ++index) {
@@ -56,7 +56,7 @@ inline bool BasicKString<CharKind>::operator==(const CharKind* rhs) const {
}
template <typename CharKind>
-inline bool BasicKString<CharKind>::operator!=(const BasicKString<CharKind>& rhs) const {
+inline bool KBasicString<CharKind>::operator!=(const KBasicString<CharKind>& rhs) const {
if (rhs.Length() != this->Length()) return false;
for (Size index = 0; index < rhs.Length(); ++index) {
@@ -67,7 +67,7 @@ inline bool BasicKString<CharKind>::operator!=(const BasicKString<CharKind>& rhs
}
template <typename CharKind>
-inline bool BasicKString<CharKind>::operator!=(const CharKind* rhs) const {
+inline bool KBasicString<CharKind>::operator!=(const CharKind* rhs) const {
if (ort_string_len<CharKind>(rhs) != this->Length()) return false;
for (Size index = 0; index < ort_string_len<CharKind>(rhs); ++index) {
@@ -78,7 +78,7 @@ inline bool BasicKString<CharKind>::operator!=(const CharKind* rhs) const {
}
template <typename CharKind>
-inline BasicKString<CharKind>& BasicKString<CharKind>::operator+=(const BasicKString<CharKind>& rhs) {
+inline KBasicString<CharKind>& KBasicString<CharKind>::operator+=(const KBasicString<CharKind>& rhs) {
if (ort_string_len<CharKind>(rhs.fData) > this->Length()) return *this;
ort_string_append(this->fData, const_cast<CharKind*>(rhs.fData), this->fCur);
@@ -88,7 +88,7 @@ inline BasicKString<CharKind>& BasicKString<CharKind>::operator+=(const BasicKSt
}
template <typename CharKind>
-inline BasicKString<CharKind>& BasicKString<CharKind>::operator+=(const CharKind* rhs) {
+inline KBasicString<CharKind>& KBasicString<CharKind>::operator+=(const CharKind* rhs) {
ort_string_append(this->fData, const_cast<CharKind*>(rhs), this->fCur);
this->fCur += ort_string_len<CharKind>(const_cast<CharKind*>(rhs));
@@ -96,13 +96,13 @@ inline BasicKString<CharKind>& BasicKString<CharKind>::operator+=(const CharKind
}
template <typename CharKind>
-inline ErrorOr<BasicKString<CharKind>> KStringBuilder::Construct(const CharKind* data) {
- if (!data || *data == 0) return ErrorOr<BasicKString<CharKind>>(nullptr);
+inline ErrorOr<KBasicString<CharKind>> KStringBuilder::Construct(const CharKind* data) {
+ if (!data || *data == 0) return ErrorOr<KBasicString<CharKind>>(nullptr);
- BasicKString<CharKind>* view = new BasicKString<CharKind>(ort_string_len<CharKind>(data));
+ KBasicString<CharKind>* view = new KBasicString<CharKind>(ort_string_len<CharKind>(data));
(*view) += data;
- return ErrorOr<BasicKString<CharKind>>(*view);
+ return ErrorOr<KBasicString<CharKind>>(*view);
}
template <typename CharKind>
inline const CharKind* KStringBuilder::FromBool(const CharKind* fmt, bool i) {
diff --git a/dev/kernel/NeKit/Ref.h b/dev/kernel/NeKit/Ref.h
index 6f7eca21..566f7486 100644
--- a/dev/kernel/NeKit/Ref.h
+++ b/dev/kernel/NeKit/Ref.h
@@ -65,6 +65,9 @@ class NonNullRef final {
private:
Ref<T> fRef{};
};
+
+using RefAny = Ref<Any>;
+using NonNullRefAny = NonNullRef<Any>;
} // namespace Kernel
#endif // ifndef _NEKIT_REF_H_
diff --git a/dev/kernel/NeKit/Variant.h b/dev/kernel/NeKit/Variant.h
index 51548272..700c9d9a 100644
--- a/dev/kernel/NeKit/Variant.h
+++ b/dev/kernel/NeKit/Variant.h
@@ -33,9 +33,10 @@ class Variant final {
~Variant() = default;
public:
- explicit Variant(KString* stringView) : fPtr((VoidPtr) stringView), fKind(VariantKind::kString) {}
+ template <typename CharKind>
+ explicit Variant(KBasicString<CharKind>* stringView) : fPtr((VoidPtr) stringView), fKind(VariantKind::kString) {}
- explicit Variant(Json* json) : fPtr((VoidPtr) json), fKind(VariantKind::kJson) {}
+ explicit Variant(JsonObject* json) : fPtr((VoidPtr) json), fKind(VariantKind::kJson) {}
explicit Variant(nullPtr ptr) : fPtr(ptr), fKind(VariantKind::kNull) {}
@@ -55,7 +56,7 @@ class Variant final {
VariantKind& Kind();
private:
- voidPtr fPtr{nullptr};
+ VoidPtr fPtr{nullptr};
VariantKind fKind{VariantKind::kNull};
};
} // namespace Kernel
diff --git a/dev/kernel/src/FS/HeFS+FileMgr.cc b/dev/kernel/src/FS/HeFS+FileMgr.cc
index 6b559cf4..33813f65 100644
--- a/dev/kernel/src/FS/HeFS+FileMgr.cc
+++ b/dev/kernel/src/FS/HeFS+FileMgr.cc
@@ -19,12 +19,12 @@ HeFileSystemMgr::HeFileSystemMgr() {
mParser = new HeFileSystemParser();
MUST_PASS(mParser);
- kout << "We are done allocating NeFileSystemParser...\n";
+ kout << "We are done allocating HeFileSystemParser...\n";
}
HeFileSystemMgr::~HeFileSystemMgr() {
if (mParser) {
- kout << "Destroying NeFileSystemParser...\n";
+ kout << "Destroying HeFileSystemParser...\n";
delete mParser;
mParser = nullptr;
}
@@ -124,21 +124,44 @@ _Output NodePtr HeFileSystemMgr::Open(_Input const Char* path, _Input const Char
}
Void HeFileSystemMgr::Write(_Input NodePtr node, _Input VoidPtr data, _Input Int32 flags,
- _Input SizeT size) {}
+ _Input SizeT size) {
+ NE_UNUSED(node);
+ NE_UNUSED(flags);
+ NE_UNUSED(size);
+ NE_UNUSED(data);
+}
_Output VoidPtr HeFileSystemMgr::Read(_Input NodePtr node, _Input Int32 flags, _Input SizeT size) {
+ NE_UNUSED(node);
+ NE_UNUSED(flags);
+ NE_UNUSED(size);
+
return nullptr;
}
Void HeFileSystemMgr::Write(_Input const Char* name, _Input NodePtr node, _Input VoidPtr data,
- _Input Int32 flags, _Input SizeT size) {}
+ _Input Int32 flags, _Input SizeT size) {
+ NE_UNUSED(node);
+ NE_UNUSED(flags);
+ NE_UNUSED(size);
+ NE_UNUSED(name);
+ NE_UNUSED(data);
+}
_Output VoidPtr HeFileSystemMgr::Read(_Input const Char* name, _Input NodePtr node,
_Input Int32 flags, _Input SizeT sz) {
+ NE_UNUSED(node);
+ NE_UNUSED(flags);
+ NE_UNUSED(sz);
+ NE_UNUSED(name);
+
return nullptr;
}
_Output Bool HeFileSystemMgr::Seek(NodePtr node, SizeT off) {
+ NE_UNUSED(node);
+ NE_UNUSED(off);
+
return false;
}
@@ -146,6 +169,7 @@ _Output Bool HeFileSystemMgr::Seek(NodePtr node, SizeT off) {
/// @param node
/// @return kFileMgrNPos if invalid, else current offset.
_Output SizeT HeFileSystemMgr::Tell(NodePtr node) {
+ NE_UNUSED(node);
return kFileMgrNPos;
}
@@ -153,6 +177,7 @@ _Output SizeT HeFileSystemMgr::Tell(NodePtr node) {
/// @param node
/// @return False if invalid, nah? calls Seek(node, 0).
_Output Bool HeFileSystemMgr::Rewind(NodePtr node) {
+ NE_UNUSED(node);
return kFileMgrNPos;
}
diff --git a/dev/kernel/src/FS/HeFS+FileSystemParser.cc b/dev/kernel/src/FS/HeFS+FileSystemParser.cc
index 86f929c0..029fdf26 100644
--- a/dev/kernel/src/FS/HeFS+FileSystemParser.cc
+++ b/dev/kernel/src/FS/HeFS+FileSystemParser.cc
@@ -79,12 +79,14 @@ namespace Detail {
const Utf8Char* dir_name, UInt16 flags,
const BOOL delete_or_create);
+ /// @brief This helper makes it easier for other machines to understand HeFS encoded hashes.
STATIC UInt64 hefsi_to_big_endian_64(UInt64 val) {
return ((val >> 56) & 0x00000000000000FFULL) | ((val >> 40) & 0x000000000000FF00ULL) |
((val >> 24) & 0x0000000000FF0000ULL) | ((val >> 8) & 0x00000000FF000000ULL) |
((val << 8) & 0x000000FF00000000ULL) | ((val << 24) & 0x0000FF0000000000ULL) |
((val << 40) & 0x00FF000000000000ULL) | ((val << 56) & 0xFF00000000000000ULL);
}
+
/// @brief Simple algorithm to hash directory entries for INDs.
/// @param path the directory path.
/// @return The hashed path.
diff --git a/dev/kernel/src/Json.cc b/dev/kernel/src/Json.cc
index 68ab55fc..d156c0ce 100644
--- a/dev/kernel/src/Json.cc
+++ b/dev/kernel/src/Json.cc
@@ -7,4 +7,4 @@
#include <NeKit/Json.h>
/// @brief Undefined object, is null in length.
-RTL_INIT_OBJECT(Kernel::Json::kNull, Kernel::Json);
+RTL_INIT_OBJECT(Kernel::JsonObject::kNull, Kernel::JsonObject);
diff --git a/dev/kernel/src/Property.cc b/dev/kernel/src/Property.cc
index 1d01293f..714fb2a4 100644
--- a/dev/kernel/src/Property.cc
+++ b/dev/kernel/src/Property.cc
@@ -21,14 +21,14 @@ Property::Property() = default;
/// @brief Check if property's name equals to name.
/// @param name string to check.
/***********************************************************************************/
-Bool Property::StringEquals(BasicKString<>& name) {
+Bool Property::StringEquals(KBasicString<>& name) {
return this->fName && this->fName == name;
}
/***********************************************************************************/
/// @brief Gets the key (name) of property.
/***********************************************************************************/
-BasicKString<>& Property::GetKey() {
+KBasicString<>& Property::GetKey() {
return this->fName;
}
diff --git a/dev/libMsg/MsgKit/Server.h b/dev/libMsg/MsgKit/Server.h
index 022aa425..5bc9617d 100644
--- a/dev/libMsg/MsgKit/Server.h
+++ b/dev/libMsg/MsgKit/Server.h
@@ -13,6 +13,7 @@
#endif
/// @author Amlal El Mahrouss
+/// @file Server.h
/// @brief libMsg LISP system.
struct LIBMSG_EXPR;
@@ -23,8 +24,8 @@ struct LIBMSG_EXPR final {
CF::CFString* l_key{nullptr};
CF::CFString* l_value{nullptr};
#else
- VoidPtr l_key{nullptr};
- VoidPtr l_value{nullptr};
+ // if we use C< we won't know about CF, so let's make those private.
+ VoidPtr l_private_data[2]{nullptr};
#endif
LIBMSG_EXPR* l_head{nullptr};
@@ -33,8 +34,8 @@ struct LIBMSG_EXPR final {
};
/// @brief Function type for LibMSG lisp.
-typedef Void (*libmsg_func_t)(struct LIBMSG_EXPR* self, VoidPtr arg, SizeT arg_size);
+typedef Void (*libmsg_func_type)(struct LIBMSG_EXPR* self, VoidPtr arg, SizeT arg_size);
-IMPORT_C Void libmsg_init_library(libmsg_func_t* funcs, SizeT cnt);
+IMPORT_C Void libmsg_init_library(libmsg_func_type* funcs, SizeT cnt);
IMPORT_C UInt32 libmsg_close_library(Void);
IMPORT_C UInt32 libmsg_eval_expr(struct LIBMSG_EXPR* head);