core: move new object system to core module

this will allow a wider range of data structures (e.g. b_error, b_stream, b_stringstream) to make use
of the new object system, and other modules and library users can use the object system without
depending on the blue-object or blue-ds modules.

blue-ds will become a simple library of data structures (string, hashmap, etc), built on top of the
core object system.
This commit is contained in:
2025-10-15 10:38:18 +01:00
parent 2108277061
commit 9d2ebfce2e
11 changed files with 19 additions and 19 deletions

View File

@@ -9,7 +9,7 @@ set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(b_modules core ds object serial term cmd io compress) set(b_modules core ds serial term cmd io compress)
set(b_system_name ${CMAKE_SYSTEM_NAME}) set(b_system_name ${CMAKE_SYSTEM_NAME})
string(TOLOWER ${b_system_name} b_system_name) string(TOLOWER ${b_system_name} b_system_name)

View File

@@ -2,7 +2,7 @@
#include "type.h" #include "type.h"
#include <blue/object/class.h> #include <blue/core/class.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -1,7 +1,7 @@
#ifndef BLUE_OBJECT_CLASS_H_ #ifndef BLUE_OBJECT_CLASS_H_
#define BLUE_OBJECT_CLASS_H_ #define BLUE_OBJECT_CLASS_H_
#include <blue/object/type.h> #include <blue/core/type.h>
#define B_CLASS_MAGIC 0xDEADFACEDCAFEBEDULL #define B_CLASS_MAGIC 0xDEADFACEDCAFEBEDULL
#define B_CLASS(p) ((b_class *)(p)) #define B_CLASS(p) ((b_class *)(p))

View File

@@ -1,10 +1,10 @@
#ifndef BLUE_OBJECT_MACROS_H_ #ifndef BLUE_CORE_MACROS_H_
#define BLUE_OBJECT_MACROS_H_ #define BLUE_CORE_MACROS_H_
#include <blue/core/class.h>
#include <blue/core/object.h>
#include <blue/core/thread.h> #include <blue/core/thread.h>
#include <blue/object/class.h> #include <blue/core/type.h>
#include <blue/object/object.h>
#include <blue/object/type.h>
#include <stdlib.h> #include <stdlib.h>
#define __B_IFACE_I0(p, x) p##x #define __B_IFACE_I0(p, x) p##x

View File

@@ -1,9 +1,9 @@
#ifndef BLUE_OBJECT_OBJECT_H_ #ifndef BLUE_CORE_OBJECT_H_
#define BLUE_OBJECT_OBJECT_H_ #define BLUE_CORE_OBJECT_H_
#include <blue/core/misc.h> #include <blue/core/misc.h>
#include <blue/core/stringstream.h> #include <blue/core/stringstream.h>
#include <blue/object/type.h> #include <blue/core/type.h>
#define B_OBJECT_MAGIC 0xDECAFC0C0ABEEF13ULL #define B_OBJECT_MAGIC 0xDECAFC0C0ABEEF13ULL

View File

@@ -1,5 +1,5 @@
#ifndef BLUE_OBJECT_TYPE_H_ #ifndef BLUE_CORE_TYPE_H_
#define BLUE_OBJECT_TYPE_H_ #define BLUE_CORE_TYPE_H_
#include <blue/core/error.h> #include <blue/core/error.h>
#include <blue/core/misc.h> #include <blue/core/misc.h>

View File

@@ -2,10 +2,10 @@
#include "type.h" #include "type.h"
#include <blue/core/class.h>
#include <blue/core/macros.h>
#include <blue/core/object.h>
#include <blue/core/thread.h> #include <blue/core/thread.h>
#include <blue/object/class.h>
#include <blue/object/macros.h>
#include <blue/object/object.h>
B_TYPE_CLASS_DEFINITION_BEGIN(b_object) B_TYPE_CLASS_DEFINITION_BEGIN(b_object)
B_TYPE_CLASS_INTERFACE_BEGIN(b_object, B_TYPE_OBJECT) B_TYPE_CLASS_INTERFACE_BEGIN(b_object, B_TYPE_OBJECT)

View File

@@ -5,8 +5,8 @@
#include <blue/core/btree.h> #include <blue/core/btree.h>
#include <blue/core/endian.h> #include <blue/core/endian.h>
#include <blue/object/object.h> #include <blue/core/object.h>
#include <blue/object/type.h> #include <blue/core/type.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@@ -2,7 +2,7 @@
#define _TYPE_H_ #define _TYPE_H_
#include <blue/core/btree.h> #include <blue/core/btree.h>
#include <blue/object/type.h> #include <blue/core/type.h>
#include <stddef.h> #include <stddef.h>
enum b_type_category { enum b_type_category {