diff options
author | Timo Sirainen <cras@irssi.org> | 2000-07-02 22:04:00 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-07-02 22:04:00 +0000 |
commit | 21999ae2058e7b9e24c45ab34d6a37c7f207f4c3 (patch) | |
tree | 57e47f40e8a0eb26a2d1e16457e400fcf281d425 /src/fe-common/core | |
parent | 4475a04841a2844260f56f7bec8d77b92fa5104a (diff) | |
download | irssi-21999ae2058e7b9e24c45ab34d6a37c7f207f4c3.zip |
Implemented runtime loadable modules. /LOAD loads a module, /UNLOAD
unloads it.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@420 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/Makefile.am | 1 | ||||
-rw-r--r-- | src/fe-common/core/fe-common-core.c | 6 | ||||
-rw-r--r-- | src/fe-common/core/module-formats.c | 21 | ||||
-rw-r--r-- | src/fe-common/core/module-formats.h | 9 |
4 files changed, 31 insertions, 6 deletions
diff --git a/src/fe-common/core/Makefile.am b/src/fe-common/core/Makefile.am index 093334ed..5a3bba07 100644 --- a/src/fe-common/core/Makefile.am +++ b/src/fe-common/core/Makefile.am @@ -13,6 +13,7 @@ libfe_common_core_la_SOURCES = \ fe-common-core.c \ fe-core-commands.c \ fe-log.c \ + fe-modules.c \ fe-server.c \ fe-settings.c \ hilight-text.c \ diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c index a402e6ae..ca337962 100644 --- a/src/fe-common/core/fe-common-core.c +++ b/src/fe-common/core/fe-common-core.c @@ -17,6 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "module.h" #include "module-formats.h" #include "levels.h" @@ -43,6 +44,9 @@ void fe_core_log_deinit(void); void fe_log_init(void); void fe_log_deinit(void); +void fe_modules_init(void); +void fe_modules_deinit(void); + void fe_server_init(void); void fe_server_deinit(void); @@ -87,6 +91,7 @@ void fe_common_core_init(void) keyboard_init(); printtext_init(); fe_log_init(); + fe_modules_init(); fe_server_init(); fe_settings_init(); translation_init(); @@ -106,6 +111,7 @@ void fe_common_core_deinit(void) keyboard_deinit(); printtext_deinit(); fe_log_deinit(); + fe_modules_deinit(); fe_server_deinit(); fe_settings_deinit(); translation_deinit(); diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index 45a31ae5..497dab92 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -72,13 +72,13 @@ FORMAT_REC fecommon_core_formats[] = { /* ---- */ { NULL, "Logging", 0 }, - { "log_opened", "Log file %W$0%n opened", 1, { 0 } }, - { "log_closed", "Log file %W$0%n closed", 1, { 0 } }, + { "log_opened", "Log file %_$0%_ opened", 1, { 0 } }, + { "log_closed", "Log file %_$0%_ closed", 1, { 0 } }, { "log_create_failed", "Couldn't create log file %_$0%_: $1", 2, { 0, 0 } }, - { "log_locked", "Log file %W$0%n is locked, probably by another running Irssi", 1, { 0 } }, - { "log_not_open", "Log file %W$0%n not open", 1, { 0 } }, - { "log_started", "Started logging to file %W$0", 1, { 0 } }, - { "log_stopped", "Stopped logging to file %W$0", 1, { 0 } }, + { "log_locked", "Log file %_$0%_ is locked, probably by another running Irssi", 1, { 0 } }, + { "log_not_open", "Log file %_$0%_ not open", 1, { 0 } }, + { "log_started", "Started logging to file %_$0", 1, { 0 } }, + { "log_stopped", "Stopped logging to file %_$0", 1, { 0 } }, { "log_list_header", "Logs:", 0 }, { "log_list", "$0 $1: $2 $3$4$5", 6, { 1, 0, 0, 0, 0, 0 } }, { "log_list_footer", "", 0 }, @@ -88,6 +88,15 @@ FORMAT_REC fecommon_core_formats[] = { { "away_msgs", "$1 new messages in awaylog:", 2, { 0, 1 } }, /* ---- */ + { NULL, "Modules", 0 }, + + { "module_already_loaded", "Module %_$0%_ already loaded", 1, { 0 } }, + { "module_load_error", "Error loading module %_$0%_: $1", 2, { 0, 0 } }, + { "module_invalid", "%_$0%_ isn't Irssi module", 1, { 0 } }, + { "module_loaded", "Loaded module %_$0", 1, { 0 } }, + { "module_unloaded", "Unloaded module %_$0", 1, { 0 } }, + + /* ---- */ { NULL, "Misc", 0 }, { "not_toggle", "Value must be either ON, OFF or TOGGLE", 0 }, diff --git a/src/fe-common/core/module-formats.h b/src/fe-common/core/module-formats.h index 416cb1cf..c88788c3 100644 --- a/src/fe-common/core/module-formats.h +++ b/src/fe-common/core/module-formats.h @@ -63,6 +63,14 @@ enum { IRCTXT_FILL_6, + IRCTXT_MODULE_ALREADY_LOADED, + IRCTXT_MODULE_LOAD_ERROR, + IRCTXT_MODULE_INVALID, + IRCTXT_MODULE_LOADED, + IRCTXT_MODULE_UNLOADED, + + IRCTXT_FILL_7, + IRCTXT_NOT_TOGGLE, IRCTXT_PERL_ERROR, IRCTXT_OPTION_UNKNOWN, @@ -76,6 +84,7 @@ enum { IRCTXT_CHAN_NOT_FOUND, IRCTXT_CHAN_NOT_SYNCED, IRCTXT_NOT_GOOD_IDEA + }; extern FORMAT_REC fecommon_core_formats[]; |