From: Emil Velikov Date: Mon, 2 Sep 2024 22:20:19 +0000 (+0100) Subject: libkmod/docs: document and reference kmod_resources X-Git-Tag: v34~439 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6460211608dda5add519a68aad61a3209c0a782;p=thirdparty%2Fkmod.git libkmod/docs: document and reference kmod_resources Mostly move the existing documentation from kmod_validate_resources(). Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/94 Signed-off-by: Lucas De Marchi --- diff --git a/libkmod/docs/libkmod-sections.txt b/libkmod/docs/libkmod-sections.txt index c0c992e9..704409fc 100644 --- a/libkmod/docs/libkmod-sections.txt +++ b/libkmod/docs/libkmod-sections.txt @@ -7,6 +7,7 @@ kmod_unref kmod_load_resources kmod_unload_resources +kmod_resources kmod_validate_resources kmod_dump_index diff --git a/libkmod/libkmod.h b/libkmod/libkmod.h index f95d4cc1..fcfcecbb 100644 --- a/libkmod/libkmod.h +++ b/libkmod/libkmod.h @@ -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);