* release the resources of the kmod library context.
*
* Returns: a new kmod library context
+ *
+ * Since: 1
*/
struct kmod_ctx *kmod_new(const char *dirname, const char * const *config_paths);
* Take a reference of the kmod library context.
*
* Returns: the passed kmod library context
+ *
+ * Since: 1
*/
struct kmod_ctx *kmod_ref(struct kmod_ctx *ctx);
* reaches zero, the resources of the context will be released.
*
* Returns: the passed kmod library context or NULL if it's freed
+ *
+ * Since: 1
*/
struct kmod_ctx *kmod_unref(struct kmod_ctx *ctx);
* this function will speedup the searches.
*
* Returns: 0 on success or < 0 otherwise.
+ *
+ * Since: 1
*/
int kmod_load_resources(struct kmod_ctx *ctx);
* could free the resources by calling kmod_unload_resources().
*
* Returns: 0 on success or < 0 otherwise.
+ *
+ * Since: 1
*/
void kmod_unload_resources(struct kmod_ctx *ctx);
*
* Set the current logging priority, as defined in syslog.h(0P). The value
* controls which messages are logged.
+ *
+ * Since: 1
*/
void kmod_set_log_priority(struct kmod_ctx *ctx, int priority);
* Get the current logging priority, as defined in syslog.h(0P).
*
* Returns: the current logging priority
+ *
+ * Since: 1
*/
int kmod_get_log_priority(const struct kmod_ctx *ctx);
* The built-in logging writes to stderr. It can be
* overridden by a custom function, to plug log messages
* into the user's logging functionality.
+ *
+ * Since: 1
*/
void kmod_set_log_fn(struct kmod_ctx *ctx,
void (*log_fn)(void *log_data,
* @userdata: data pointer
*
* Store custom @userdata in the library context.
+ *
+ * Since: 1
*/
void kmod_set_userdata(struct kmod_ctx *ctx, const void *userdata);
* to access from callbacks.
*
* Returns: stored userdata
+ *
+ * Since: 1
*/
void *kmod_get_userdata(const struct kmod_ctx *ctx);
*
* Returns: node next to @curr or NULL if either this node is the last of or
* list is empty.
+ *
+ * Since: 1
*/
struct kmod_list *kmod_list_next(const struct kmod_list *list,
const struct kmod_list *curr);
*
* Returns: node previous to @curr or NULL if either this node is the head of
* the list or the list is empty.
+ *
+ * Since: 1
*/
struct kmod_list *kmod_list_prev(const struct kmod_list *list,
const struct kmod_list *curr);
* Returns: 0 on success or < 0 otherwise. It fails if any of the lookup
* methods failed, which is basically due to memory allocation fail. If module
* is not found, it still returns 0, but @list is an empty list.
+ *
+ * Since: 1
*/
int kmod_module_new_from_lookup(struct kmod_ctx *ctx, const char *given_alias,
struct kmod_list **list);
*
* Returns: 0 on success or < 0 otherwise. It fails if name is not a valid
* module name or if memory allocation failed.
+ *
+ * Since: 1
*/
int kmod_module_new_from_name(struct kmod_ctx *ctx, const char *name,
struct kmod_module **mod);
*
* Returns: 0 on success or < 0 otherwise. It fails if file does not exist, if
* it's not a valid file for a kmod_module or if memory allocation failed.
+ *
+ * Since: 1
*/
int kmod_module_new_from_path(struct kmod_ctx *ctx, const char *path,
struct kmod_module **mod);
* Take a reference of the kmod module, incrementing its refcount.
*
* Returns: the passed @module with its refcount incremented.
+ *
+ * Since: 1
*/
struct kmod_module *kmod_module_ref(struct kmod_module *mod);
*
* Returns: NULL if @mod is NULL or if the module was released. Otherwise it
* returns the passed @mod with its refcount decremented.
+ *
+ * Since: 1
*/
struct kmod_module *kmod_module_unref(struct kmod_module *mod);
* taken by the list itself.
*
* Returns: 0
+ *
+ * Since: 1
*/
int kmod_module_unref_list(struct kmod_list *list);
*
* Returns: 0 on success or < 0 on failure. If module is already loaded it
* returns -EEXIST.
+ *
+ * Since: 1
*/
int kmod_module_insert_module(struct kmod_module *mod, unsigned int flags,
const char *options);
* Remove a module from the kernel.
*
* Returns: 0 on success or < 0 on failure.
+ *
+ * Since: 1
*/
int kmod_module_remove_module(struct kmod_module *mod, unsigned int flags);
*
* Returns: NULL on failure or the kmod_module contained in this list entry
* with its refcount incremented.
+ *
+ * Since: 1
*/
struct kmod_module *kmod_module_get_module(const struct kmod_list *entry);
*
* Returns: NULL on failure. Otherwise it returns a list of kmod modules
* that can be released by calling kmod_module_unref_list().
+ *
+ * Since: 1
*/
struct kmod_list *kmod_module_get_dependencies(const struct kmod_module *mod);
*
* Returns: 0 on success or < 0 otherwise. @output is saved with the updated
* list.
+ *
+ * Since: 1
*/
int kmod_module_get_filtered_blacklist(const struct kmod_ctx *ctx,
const struct kmod_list *input,
*
* Returns: a string with all install commands separated by semicolons. This
* string is owned by @mod, do not free it.
+ *
+ * Since: 1
*/
const char *kmod_module_get_install_commands(const struct kmod_module *mod);
*
* Returns: a string with all remove commands separated by semicolons. This
* string is owned by @mod, do not free it.
+ *
+ * Since: 1
*/
const char *kmod_module_get_remove_commands(const struct kmod_module *mod);
* it's always normalized (dashes are replaced with underscores).
*
* Returns: the name of this kmod module.
+ *
+ * Since: 1
*/
const char *kmod_module_get_name(const struct kmod_module *mod);
*
* Returns: a string with all the options separated by spaces. This string is
* owned by @mod, do not free it.
+ *
+ * Since: 1
*/
const char *kmod_module_get_options(const struct kmod_module *mod);
*
* Returns: the path of this kmod module or NULL if such information is not
* available.
+ *
+ * Since: 1
*/
const char *kmod_module_get_path(const struct kmod_module *mod);
* After use, free the @list by calling kmod_module_section_free_list().
*
* Returns: a new list of kmod module sections on success or NULL on failure.
+ *
+ * Since: 1
*/
struct kmod_list *kmod_module_get_sections(const struct kmod_module *mod);
*
* Returns: the address of this kmod module section on success or ULONG_MAX
* on failure.
+ *
+ * Since: 1
*/
unsigned long kmod_module_section_get_address(const struct kmod_list *entry);
*
* Returns: the name of this kmod module section on success or NULL on
* failure. The string is owned by the section, do not free it.
+ *
+ * Since: 1
*/
const char *kmod_module_section_get_name(const struct kmod_list *entry);
* @list: kmod module section list
*
* Release the resources taken by @list
+ *
+ * Since: 1
*/
void kmod_module_section_free_list(struct kmod_list *list);
* completed.
*
* Returns: 0 on success or < 0 on error.
+ *
+ * Since: 1
*/
int kmod_module_new_from_loaded(struct kmod_ctx *ctx,
struct kmod_list **list);
*
* Returns: < 0 on error or module state if module is found in the kernel, valid
* states are #kmod_module_initstate.
+ *
+ * Since: 1
*/
int kmod_module_get_initstate(const struct kmod_module *mod);
*
* Returns: the string associated to the @state. This string is statically
* allocated, do not free it.
+ *
+ * Since: 1
*/
const char *kmod_module_initstate_str(enum kmod_module_initstate state);
* module to get its size.
*
* Returns: the size of this kmod module.
+ *
+ * Since: 1
*/
long kmod_module_get_size(const struct kmod_module *mod);
* /sys filesystem.
*
* Returns: the reference count on success or < 0 on failure.
+ *
+ * Since: 1
*/
int kmod_module_get_refcnt(const struct kmod_module *mod);
* Kernel. After use, free the @list by calling kmod_module_unref_list().
*
* Returns: a new list of kmod modules on success or NULL on failure.
+ *
+ * Since: 1
*/
struct kmod_list *kmod_module_get_holders(const struct kmod_module *mod);