Skip to content

Commit

Permalink
Add missing kmod_set_log_fn to allow to set it to null (no logs)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoofx committed Jul 21, 2024
1 parent 23eed29 commit e3ae15b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ internal partial class LibkmodGenerator(LibDescriptor descriptor) : GeneratorBas
e => e.Map<CppParameter>("kmod_module_probe_insert_module::flags").Type("kmod_probe"),
e => e.Map<CppEnum>("kmod_symbol_bind").Discard(), // Not used in public API but only internally
e => e.Map<CppEnumItem>("_KMOD_MODULE_PAD").Discard(),
e => e.Map<CppFunction>("kmod_set_log_fn").Discard(),
e => e.Map<CppParameter>("kmod_set_log_fn::log_fn").Type("intptr_t"),
//e => e.Map<CppFunction>("kmod_set_log_fn").Discard(),
e => e.Map<CppFunction>("vsyslog").Discard(), // discard as it has a va_list
e => e.Map<CppTypedef>("va_list").Discard(), // discard va_list
e => e.Map<CppClass>("__va_list_tag").Discard(), // discard __va_list_tag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ public enum kmod_module_initstate : uint
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
public static partial libkmod.kmod_ctx kmod_unref(libkmod.kmod_ctx ctx);

[global::System.Runtime.InteropServices.LibraryImport(LibraryName, EntryPoint = "kmod_set_log_fn")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
public static partial void kmod_set_log_fn(libkmod.kmod_ctx ctx, nint log_fn, void* data);

[global::System.Runtime.InteropServices.LibraryImport(LibraryName, EntryPoint = "kmod_get_log_priority")]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(CallConvCdecl) })]
public static partial int kmod_get_log_priority(libkmod.kmod_ctx ctx);
Expand Down
2 changes: 1 addition & 1 deletion src/libkmod/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Other OS might require a different setup.
The following API were automatically generated from the C/C++ code:

- libkmod.h: `kmod_config_get_aliases`, `kmod_config_get_blacklists`, `kmod_config_get_install_commands`, `kmod_config_get_options`, `kmod_config_get_remove_commands`, `kmod_config_get_softdeps`, `kmod_config_iter_free_iter`, `kmod_config_iter_get_key`, `kmod_config_iter_get_value`, `kmod_config_iter_next`, `kmod_dump_index`, `kmod_get_dirname`, `kmod_get_log_priority`, `kmod_get_userdata`, `kmod_list_last`, `kmod_list_next`, `kmod_list_prev`, `kmod_load_resources`, `kmod_module_apply_filter`, `kmod_module_dependency_symbol_get_bind`, `kmod_module_dependency_symbol_get_crc`, `kmod_module_dependency_symbol_get_symbol`, `kmod_module_dependency_symbols_free_list`, `kmod_module_get_dependencies`, `kmod_module_get_dependency_symbols`, `kmod_module_get_filtered_blacklist`, `kmod_module_get_holders`, `kmod_module_get_info`, `kmod_module_get_initstate`, `kmod_module_get_install_commands`, `kmod_module_get_module`, `kmod_module_get_name`, `kmod_module_get_options`, `kmod_module_get_path`, `kmod_module_get_refcnt`, `kmod_module_get_remove_commands`, `kmod_module_get_sections`, `kmod_module_get_size`, `kmod_module_get_softdeps`, `kmod_module_get_symbols`, `kmod_module_get_versions`, `kmod_module_info_free_list`, `kmod_module_info_get_key`, `kmod_module_info_get_value`, `kmod_module_initstate_str`, `kmod_module_insert_module`, `kmod_module_new_from_loaded`, `kmod_module_new_from_lookup`, `kmod_module_new_from_name`, `kmod_module_new_from_name_lookup`, `kmod_module_new_from_path`, `kmod_module_probe_insert_module`, `kmod_module_ref`, `kmod_module_remove_module`, `kmod_module_section_free_list`, `kmod_module_section_get_address`, `kmod_module_section_get_name`, `kmod_module_symbol_get_crc`, `kmod_module_symbol_get_symbol`, `kmod_module_symbols_free_list`, `kmod_module_unref`, `kmod_module_unref_list`, `kmod_module_version_get_crc`, `kmod_module_version_get_symbol`, `kmod_module_versions_free_list`, `kmod_new`, `kmod_ref`, `kmod_set_log_priority`, `kmod_set_userdata`, `kmod_unload_resources`, `kmod_unref`, `kmod_validate_resources`
- libkmod.h: `kmod_config_get_aliases`, `kmod_config_get_blacklists`, `kmod_config_get_install_commands`, `kmod_config_get_options`, `kmod_config_get_remove_commands`, `kmod_config_get_softdeps`, `kmod_config_iter_free_iter`, `kmod_config_iter_get_key`, `kmod_config_iter_get_value`, `kmod_config_iter_next`, `kmod_dump_index`, `kmod_get_dirname`, `kmod_get_log_priority`, `kmod_get_userdata`, `kmod_list_last`, `kmod_list_next`, `kmod_list_prev`, `kmod_load_resources`, `kmod_module_apply_filter`, `kmod_module_dependency_symbol_get_bind`, `kmod_module_dependency_symbol_get_crc`, `kmod_module_dependency_symbol_get_symbol`, `kmod_module_dependency_symbols_free_list`, `kmod_module_get_dependencies`, `kmod_module_get_dependency_symbols`, `kmod_module_get_filtered_blacklist`, `kmod_module_get_holders`, `kmod_module_get_info`, `kmod_module_get_initstate`, `kmod_module_get_install_commands`, `kmod_module_get_module`, `kmod_module_get_name`, `kmod_module_get_options`, `kmod_module_get_path`, `kmod_module_get_refcnt`, `kmod_module_get_remove_commands`, `kmod_module_get_sections`, `kmod_module_get_size`, `kmod_module_get_softdeps`, `kmod_module_get_symbols`, `kmod_module_get_versions`, `kmod_module_info_free_list`, `kmod_module_info_get_key`, `kmod_module_info_get_value`, `kmod_module_initstate_str`, `kmod_module_insert_module`, `kmod_module_new_from_loaded`, `kmod_module_new_from_lookup`, `kmod_module_new_from_name`, `kmod_module_new_from_name_lookup`, `kmod_module_new_from_path`, `kmod_module_probe_insert_module`, `kmod_module_ref`, `kmod_module_remove_module`, `kmod_module_section_free_list`, `kmod_module_section_get_address`, `kmod_module_section_get_name`, `kmod_module_symbol_get_crc`, `kmod_module_symbol_get_symbol`, `kmod_module_symbols_free_list`, `kmod_module_unref`, `kmod_module_unref_list`, `kmod_module_version_get_crc`, `kmod_module_version_get_symbol`, `kmod_module_versions_free_list`, `kmod_new`, `kmod_ref`, `kmod_set_log_fn`, `kmod_set_log_priority`, `kmod_set_userdata`, `kmod_unload_resources`, `kmod_unref`, `kmod_validate_resources`


## 🪪 License
Expand Down

0 comments on commit e3ae15b

Please sign in to comment.