1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

[modules] Additional function getname

When non NULL it will be return module name and version.
This commit is contained in:
Witold Filipczyk 2024-09-26 16:19:26 +02:00
parent 3f6d28c1ab
commit 541303cbff
57 changed files with 123 additions and 61 deletions

View File

@ -555,5 +555,6 @@ struct module leds_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_leds,
/* done: */ done_leds
/* done: */ done_leds,
/* getname: */ NULL
);

View File

@ -186,7 +186,8 @@ struct module bookmarks_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_bookmarks,
/* done: */ done_bookmarks
/* done: */ done_bookmarks,
/* getname: */ NULL
);

View File

@ -1002,5 +1002,6 @@ struct module kbdbind_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_keymaps,
/* done: */ free_keymaps
/* done: */ free_keymaps,
/* getname: */ NULL
);

View File

@ -85,5 +85,6 @@ struct module periodic_saving_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_timer,
/* done: */ done_timer
/* done: */ done_timer,
/* getname: */ NULL
);

View File

@ -64,5 +64,6 @@ struct module goto_url_history_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_url_history,
/* done: */ done_url_history
/* done: */ done_url_history,
/* getname: */ NULL
);

View File

@ -930,5 +930,6 @@ struct module cookies_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_cookies,
/* done: */ done_cookies
/* done: */ done_cookies,
/* getname: */ NULL
);

View File

@ -211,5 +211,6 @@ struct module exmode_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_exmode,
/* done: */ done_exmode
/* done: */ done_exmode,
/* getname: */ NULL
);

View File

@ -248,5 +248,6 @@ struct module css_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_css,
/* done: */ done_css
/* done: */ done_css,
/* getname: */ NULL
);

View File

@ -719,5 +719,6 @@ struct module document_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_documents,
/* done: */ done_documents
/* done: */ done_documents,
/* getname: */ NULL
);

View File

@ -458,5 +458,6 @@ struct module forms_history_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ done_form_history
/* done: */ done_form_history,
/* getname: */ NULL
);

View File

@ -454,5 +454,6 @@ struct module global_history_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_global_history,
/* done: */ done_global_history
/* done: */ done_global_history,
/* getname: */ NULL
);

View File

@ -244,6 +244,7 @@ struct module gettext_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_gettext,
/* done: */ done_gettext
/* done: */ done_gettext,
/* getname: */ NULL
);

View File

@ -246,5 +246,6 @@ struct module gettext_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_gettext,
/* done: */ done_gettext
/* done: */ done_gettext,
/* getname: */ NULL
);

View File

@ -809,5 +809,6 @@ struct module ecmascript_module = struct_module(
/* submodules: */ ecmascript_modules,
/* data: */ NULL,
/* init: */ init_ecmascript_module,
/* done: */ done_ecmascript_module
/* done: */ done_ecmascript_module,
/* getname: */ NULL
);

View File

@ -452,5 +452,6 @@ struct module mujs_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ mujs_init,
/* done: */ mujs_done
/* done: */ mujs_done,
/* getname: */ NULL
);

View File

@ -562,5 +562,6 @@ struct module quickjs_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ quickjs_init,
/* done: */ quickjs_done
/* done: */ quickjs_done,
/* getname: */ NULL
);

View File

@ -706,5 +706,6 @@ struct module spidermonkey_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ spidermonkey_init,
/* done: */ spidermonkey_done
/* done: */ spidermonkey_done,
/* getname: */ NULL
);

View File

@ -39,10 +39,13 @@ struct module {
/* This function should shutdown the module. */
void (*done)(struct module *module);
/* This function return name and version of the module if set. */
const char *(*getname)(struct module *module);
};
#define struct_module(name, options, hooks, submods, data, init, done) \
{ name, options, hooks, submods, data, init, done }
#define struct_module(name, options, hooks, submods, data, init, done, getname) \
{ name, options, hooks, submods, data, init, done, getname }
#define foreach_module(module, modules, i) \
for (i = 0, module = modules ? modules[i] : NULL; \

View File

@ -224,5 +224,6 @@ struct module default_mime_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -456,5 +456,6 @@ struct module dgi_mime_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_dgi,
/* done: */ done_dgi
/* done: */ done_dgi,
/* getname: */ NULL
);

View File

@ -788,7 +788,8 @@ struct module mailcap_mime_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_mailcap,
/* done: */ done_mailcap
/* done: */ done_mailcap,
/* getname: */ NULL
);
#ifdef TEST_MAILCAP

View File

@ -283,5 +283,6 @@ struct module mimetypes_mime_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_mimetypes,
/* done: */ done_mimetypes
/* done: */ done_mimetypes,
/* getname: */ NULL
);

View File

@ -373,5 +373,6 @@ struct module mime_module = struct_module(
/* submodules: */ mime_submodules,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -238,7 +238,8 @@ static struct module openssl_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_openssl,
/* done: */ done_openssl
/* done: */ done_openssl,
/* getname: */ NULL
);
#elif defined(CONFIG_GNUTLS)
@ -385,7 +386,8 @@ static struct module gnutls_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_gnutls,
/* done: */ done_gnutls
/* done: */ done_gnutls,
/* getname: */ NULL
);
#endif /* USE_OPENSSL or CONFIG_GNUTLS */
@ -414,7 +416,8 @@ struct module ssl_module = struct_module(
/* submodules: */ ssl_modules,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);
int

View File

@ -335,5 +335,6 @@ struct module auth_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ done_auth
/* done: */ done_auth,
/* getname: */ NULL
);

View File

@ -346,5 +346,6 @@ struct module bittorrent_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ done_bittorrent
/* done: */ done_bittorrent,
/* getname: */ NULL
);

View File

@ -75,7 +75,8 @@ struct module ftpes_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_ftpes,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);
#endif
@ -87,7 +88,8 @@ struct module sftp_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);
#endif

View File

@ -63,7 +63,8 @@ struct module cgi_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);
static void

View File

@ -49,7 +49,8 @@ struct module dgi_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -75,7 +75,8 @@ struct module file_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -46,7 +46,8 @@ struct module mailcap_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);
#ifdef HAVE_FORK

View File

@ -29,7 +29,8 @@ struct module finger_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);
static void

View File

@ -59,7 +59,8 @@ struct module fsp_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);
/* Because functions of fsplib block waiting for a response from the

View File

@ -99,7 +99,8 @@ struct module fsp_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);
/* ************ Internal functions **************** */

View File

@ -115,7 +115,8 @@ struct module ftp_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -51,7 +51,8 @@ struct module gemini_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ done_gemini
/* done: */ done_gemini,
/* getname: */ NULL
);
static void

View File

@ -55,7 +55,8 @@ struct module gopher_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -263,7 +263,8 @@ struct module http_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ done_http
/* done: */ done_http,
/* getname: */ NULL
);

View File

@ -69,5 +69,6 @@ struct module nntp_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -356,5 +356,6 @@ struct module protocol_module = struct_module(
/* submodules: */ protocol_submodules,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -351,5 +351,6 @@ struct module uri_rewrite_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -52,7 +52,8 @@ struct module smb_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_smb,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);
static FILE *header_out, *data_out;

View File

@ -42,7 +42,8 @@ struct program {
/* submodules: */ NULL, \
/* data: */ NULL, \
/* init: */ NULL, \
/* done: */ NULL \
/* done: */ NULL, \
/* getname: */ NULL \
)
STUB_MODULE(auth_module);
STUB_MODULE(bittorrent_protocol_module);

View File

@ -88,7 +88,8 @@ struct module user_protocol_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -19,5 +19,6 @@ struct module guile_scripting_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_guile,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -19,5 +19,6 @@ struct module lua_scripting_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_lua,
/* done: */ cleanup_lua
/* done: */ cleanup_lua,
/* getname: */ NULL
);

View File

@ -19,5 +19,6 @@ struct module perl_scripting_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_perl,
/* done: */ cleanup_perl
/* done: */ cleanup_perl,
/* getname: */ NULL
);

View File

@ -21,5 +21,6 @@ struct module python_scripting_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_python,
/* done: */ cleanup_python
/* done: */ cleanup_python,
/* getname: */ NULL
);

View File

@ -19,5 +19,6 @@ struct module ruby_scripting_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_ruby,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -110,5 +110,6 @@ struct module scripting_module = struct_module(
/* submodules: */ scripting_modules,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -19,5 +19,6 @@ struct module smjs_scripting_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_smjs,
/* done: */ cleanup_smjs
/* done: */ cleanup_smjs,
/* getname: */ NULL
);

View File

@ -1699,5 +1699,6 @@ struct module terminal_screen_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ done_screen_drivers
/* done: */ done_screen_drivers,
/* getname: */ NULL
);

View File

@ -601,5 +601,6 @@ struct module terminal_module = struct_module(
/* submodules: */ terminal_submodules,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);

View File

@ -161,5 +161,6 @@ struct module viewer_marks_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ done_marks
/* done: */ done_marks,
/* getname: */ NULL
);

View File

@ -2035,5 +2035,6 @@ struct module search_history_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_search_history,
/* done: */ done_search_history
/* done: */ done_search_history,
/* getname: */ NULL
);

View File

@ -92,5 +92,6 @@ struct module timer_module = struct_module(
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ init_timer,
/* done: */ done_timer
/* done: */ done_timer,
/* getname: */ NULL
);

View File

@ -28,5 +28,6 @@ struct module viewer_module = struct_module(
/* submodules: */ viewer_submodules,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
/* done: */ NULL,
/* getname: */ NULL
);