]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod/docs: document and reference kmod_resources
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 6 Sep 2024 16:43:24 +0000 (11:43 -0500)
Mostly move the existing documentation from kmod_validate_resources().

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/docs/libkmod-sections.txt
libkmod/libkmod.h

index c0c992e9206079c32f3d3177912a44af6c8fb706..704409fc1dfb9a97bdc09c7a7dacb301b55c9091 100644 (file)
@@ -7,6 +7,7 @@ kmod_unref
 
 kmod_load_resources
 kmod_unload_resources
+kmod_resources
 kmod_validate_resources
 kmod_dump_index
 
index f95d4cc1d1f7436c0e41f4c4be730c601626d47b..fcfcecbb0d2cc04384664884599a40f0747f5463 100644 (file)
@@ -122,6 +122,17 @@ int kmod_load_resources(struct kmod_ctx *ctx);
  */
 void kmod_unload_resources(struct kmod_ctx *ctx);
 
+/**
+ * kmod_resources:
+ * @KMOD_RESOURCES_OK: resources are valid
+ * @KMOD_RESOURCES_MUST_RELOAD: resources are not valid; to resolve call
+ * kmod_unload_resources() and kmod_load_resources()
+ * @KMOD_RESOURCES_MUST_RECREATE: resources are not valid; to resolve @ctx must
+ * be re-created.
+ *
+ * The validity state of the current libkmod resources, returned by
+ * kmod_validate_resources().
+ */
 enum kmod_resources {
        KMOD_RESOURCES_OK = 0,
        KMOD_RESOURCES_MUST_RELOAD = 1,
@@ -135,10 +146,7 @@ enum kmod_resources {
  * Check if indexes and configuration files changed on disk and the current
  * context is not valid anymore.
  *
- * Returns: KMOD_RESOURCES_OK if resources are still valid,
- * KMOD_RESOURCES_MUST_RELOAD if it's sufficient to call
- * kmod_unload_resources() and kmod_load_resources() or
- * KMOD_RESOURCES_MUST_RECREATE if @ctx must be re-created.
+ * Returns: the resources state, valid states are #kmod_resources.
  */
 int kmod_validate_resources(struct kmod_ctx *ctx);