Files
SystemPaw3/paw/stos/head/ob/object.h
T
Chloe M. 70f58b193f stos: ob: Initialize object manager
Signed-off-by: Chloe M. <chloe@mensia.org>
2026-06-25 00:51:24 +00:00

86 lines
1.6 KiB
C

/*
* Copyright (c) 2026, Chloe M.
* Provided under the BSD-3 clause.
*
* Description: Object manager
* Author: Chloe M.
*/
#ifndef _OB_OBJECT_H_
#define _OB_OBJECT_H_ 1
#include <stapi/status.h>
#include <stdef.h>
/* Maximum size of system object names */
#define OBJECT_NAMESZ 32
/* Slut tag for pool allocations */
#define OBJECT_POOL_TAG 'OB'
/*
* Represents valid object types
*
* @OBJECT_TYPE_DIRECTORY: Object is directory
*/
typedef enum {
OBJECT_TYPE_DIRECTORY
} OBJECT_TYPE;
/*
* Represents a Slut Technology system object
*
* @Name: Name of object
* @RefCount: Object reference count
* @Type: Object type
* @Data: Object data
*/
typedef struct {
CHAR Name[OBJECT_NAMESZ];
ULONG RefCount;
OBJECT_TYPE Type;
VOID *Data;
} ST_OBJECT;
/*
* Represents a directory object containing one or more
* objects.
*
* @First: First entry in object directory
* @Last: Last entry in object directory
* @EntryCount: Number of entries in directory
*/
typedef struct {
ST_OBJECT *First;
ST_OBJECT *Last;
USIZE EntryCount;
} OBJECT_DIRECTORY;
/*
* Create a new object directory
*
* @Name: Name of object
* @Result: Resulting object is written here
*/
ST_STATUS ObCreateDirectory(const CHAR *Name, ST_OBJECT **Result);
/*
* Allocate and create a new objec
*
* @Name: Object name
* @Type: Object type
* @Data: Actual backing data
* @Result: Result is written here
*/
ST_STATUS ObCreateObject(
const CHAR *Name, OBJECT_TYPE Type,
VOID *Data, ST_OBJECT **Result
);
/*
* Initialize the object manager
*/
VOID ObInitManager(VOID);
#endif /* !_OB_OBJECT_H_ */