summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
authorChen Wang <[email protected]>2025-03-12 11:00:32 +0800
committerRbb666 <[email protected]>2025-03-12 12:54:25 +0800
commit5a42cfd16b62cd5482af5007dff56c38aad76732 (patch)
treea40f6a21999ec0afd9b337273dc1e9f3e1df681d /src/object.c
parent5a09694f05b3882a1e22cb4cbabdf8d4d031c4ec (diff)
doxygen: update doc for kenrel object model
Move the introduction of function parameters in markdown to source code comments, because this part of the content is completely repeated. We only need to keep and maintain the comments in the code. The detailed explanation of the API in markdown can directly refer to the comments in the code. Try not to directly copy the definition of the structure in the markdown document, because this part of the content may change with the upgrade of the code. Therefore, when the structure definition is involved in markdown, try to indicate that it is just a code snippet. The specific definition is still directly quoted from the source code and the source code comments. It is very convenient to quote structures and functions in markdown. Just use "`" to enclose the structure name or function name, and the generated html is a link to its definition. According to this principle, this patch only modifies the documents and code comments of the kernel object model. Other modules will be modified one by one in separate patches later. Signed-off-by: Chen Wang <[email protected]>
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/object.c b/src/object.c
index 5313ac6422..a916cd41c9 100644
--- a/src/object.c
+++ b/src/object.c
@@ -335,11 +335,20 @@ RTM_EXPORT(rt_object_get_pointers);
* @brief This function will initialize an object and add it to object system
* management.
*
- * @param object is the specified object to be initialized.
+ * @param object The specified object to be initialized.
+ * The object pointer that needs to be initialized must point to
+ * a specific object memory block, not a null pointer or a wild pointer.
*
- * @param type is the object type.
+ * @param type The object type. The type of the object must be a enumeration
+ * type listed in rt_object_class_type, RT_Object_Class_Static
+ * excluded. (For static objects, or objects initialized with the
+ * rt_object_init interface, the system identifies it as an
+ * RT_Object_Class_Static type)
*
- * @param name is the object name. In system, the object's name must be unique.
+ * @param name Name of the object. In system, the object's name must be unique.
+ * Each object can be set to a name, and the maximum length for the
+ * name is specified by RT_NAME_MAX. The system does not care if it
+ * uses '\0' as a terminal symbol.
*/
void rt_object_init(struct rt_object *object,
enum rt_object_class_type type,
@@ -436,11 +445,17 @@ void rt_object_detach(rt_object_t object)
/**
* @brief This function will allocate an object from object system.
*
- * @param type is the type of object.
+ * @param type Type of object. The type of the allocated object can only be of
+ * type rt_object_class_type other than RT_Object_Class_Static.
+ * In addition, the type of object allocated through this interface
+ * is dynamic, not static.
*
- * @param name is the object name. In system, the object's name must be unique.
+ * @param name Name of the object. In system, the object's name must be unique.
+ * Each object can be set to a name, and the maximum length for the
+ * name is specified by RT_NAME_MAX. The system does not care if it
+ * uses '\0' as a terminal symbol.
*
- * @return object
+ * @return object handle allocated successfully, or RT_NULL if no memory can be allocated.
*/
rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name)
{
@@ -505,7 +520,7 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name)
/**
* @brief This function will delete an object and release object memory.
*
- * @param object is the specified object to be deleted.
+ * @param object The specified object to be deleted.
*/
void rt_object_delete(rt_object_t object)
{
@@ -543,7 +558,7 @@ void rt_object_delete(rt_object_t object)
* @note Normally, the system object is a static object and the type
* of object set to RT_Object_Class_Static.
*
- * @param object is the specified object to be judged.
+ * @param object The specified object to be judged.
*
* @return RT_TRUE if a system object, RT_FALSE for others.
*/