diff options
-rw-r--r-- | doc/en/weechat_dev.en.adoc | 2 | ||||
-rw-r--r-- | doc/fr/weechat_dev.fr.adoc | 2 | ||||
-rw-r--r-- | doc/ja/weechat_dev.ja.adoc | 4 | ||||
-rw-r--r-- | doc/sr/weechat_dev.sr.adoc | 4 | ||||
-rw-r--r-- | po/srcfiles.cmake | 4 | ||||
-rw-r--r-- | src/core/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/core/wee-command.c | 98 | ||||
-rw-r--r-- | src/core/wee-config.c | 2 |
8 files changed, 59 insertions, 59 deletions
diff --git a/doc/en/weechat_dev.en.adoc b/doc/en/weechat_dev.en.adoc index 569a4902d..85c822102 100644 --- a/doc/en/weechat_dev.en.adoc +++ b/doc/en/weechat_dev.en.adoc @@ -140,13 +140,13 @@ WeeChat "core" is located in following directories: | wee-secure-config.c | Secured data options (file sec.conf). | wee-signal.c | Signal functions. | wee-string.c | Functions on strings. +| wee-sys.c | System functions. | wee-upgrade-file.c | Internal upgrade system. | wee-upgrade.c | Upgrade for WeeChat core (buffers, lines, history, ...). | wee-url.c | URL transfer (using libcurl). | wee-utf8.c | UTF-8 functions. | wee-util.c | Some other functions. | wee-version.c | Functions for WeeChat version. -| wee-sys.c | System functions. | weechat.c | Main functions: command line options, startup. | hook/ | Hook functions. | wee-hook-command-run.c | Hook "command_run". diff --git a/doc/fr/weechat_dev.fr.adoc b/doc/fr/weechat_dev.fr.adoc index 14006001d..b72f98f00 100644 --- a/doc/fr/weechat_dev.fr.adoc +++ b/doc/fr/weechat_dev.fr.adoc @@ -142,13 +142,13 @@ Le cœur de WeeChat est situé dans les répertoires suivants : | wee-secure-config.c | Options des données sécurisées (fichier sec.conf). | wee-signal.c | Fonctions sur les signaux. | wee-string.c | Fonctions sur les chaînes de caractères. +| wee-sys.c | Fonctions système. | wee-upgrade-file.c | Système de mise à jour interne. | wee-upgrade.c | Mise à jour du cœur de WeeChat (tampons, lignes, historique, ...). | wee-url.c | Transfert d'URL (en utilisant libcurl). | wee-utf8.c | Fonctions UTF-8. | wee-util.c | Quelques autres fonctions utilitaires. | wee-version.c | Fonctions pour la version de WeeChat. -| wee-sys.c | Fonctions système. | weechat.c | Fonctions principales : options de ligne de commande, démarrage. | hook/ | Hook functions. | wee-hook-command-run.c | Hook "command_run". diff --git a/doc/ja/weechat_dev.ja.adoc b/doc/ja/weechat_dev.ja.adoc index 060cecefc..5e0268dc7 100644 --- a/doc/ja/weechat_dev.ja.adoc +++ b/doc/ja/weechat_dev.ja.adoc @@ -152,14 +152,14 @@ WeeChat "core" は以下のディレクトリに配置されています: // TRANSLATION MISSING | wee-signal.c | Signal functions. | wee-string.c | 文字列関数 +// TRANSLATION MISSING +| wee-sys.c | System functions. | wee-upgrade-file.c | 内部アップグレードシステム | wee-upgrade.c | WeeChat コアのアップグレード (バッファ、行、履歴、...) | wee-url.c | URL 転送 (libcurl を使う) | wee-utf8.c | UTF-8 関数 | wee-util.c | その他の関数 | wee-version.c | WeeChat バージョンについての関数 -// TRANSLATION MISSING -| wee-sys.c | System functions. | weechat.c | 主要関数: コマンドラインオプション、起動 | hook/ | フック関数 | wee-hook-command-run.c | "command_run" フック diff --git a/doc/sr/weechat_dev.sr.adoc b/doc/sr/weechat_dev.sr.adoc index 77aa124df..d50c35fb6 100644 --- a/doc/sr/weechat_dev.sr.adoc +++ b/doc/sr/weechat_dev.sr.adoc @@ -142,14 +142,14 @@ WeeChat „језгро” се налази у следећим директо | wee-secure-buffer.c | Бафер обезбеђених података. | wee-secure-config.c | Опције обезбеђених података (фајл sec.conf). | wee-string.c | Функције над стринговима. +// TRANSLATION MISSING +| wee-sys.c | System functions. | wee-upgrade-file.c | Интерни систем ажурирања. | wee-upgrade.c | Ажурирање за WeeChat језгро (бафери, линије, историја, ...). | wee-url.c | URL трансфер (помоћу libcurl). | wee-utf8.c | UTF-8 фунцкије. | wee-util.c | Неке друге функције. | wee-version.c | Функције за WeeChat верзију. -// TRANSLATION MISSING -| wee-sys.c | System functions. | weechat.c | Основне функције: опције командне линије, покретање. | hook/ | Функције кука. | wee-hook-command-run.c | Кука "command_run". diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake index 17a616fe4..2f8a688ba 100644 --- a/po/srcfiles.cmake +++ b/po/srcfiles.cmake @@ -89,6 +89,8 @@ SET(WEECHAT_SOURCES ./src/core/wee-signal.h ./src/core/wee-string.c ./src/core/wee-string.h +./src/core/wee-sys.c +./src/core/wee-sys.h ./src/core/wee-upgrade.c ./src/core/wee-upgrade-file.c ./src/core/wee-upgrade-file.h @@ -101,8 +103,6 @@ SET(WEECHAT_SOURCES ./src/core/wee-util.h ./src/core/wee-version.c ./src/core/wee-version.h -./src/core/wee-sys.c -./src/core/wee-sys.h ./src/gui/curses/gui-curses-bar-window.c ./src/gui/curses/gui-curses-bar-window.h ./src/gui/curses/gui-curses-chat.c diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index dd46ed673..0e8432748 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -47,13 +47,13 @@ set(LIB_CORE_SRC wee-secure-config.c wee-secure-config.h wee-signal.c wee-signal.h wee-string.c wee-string.h + wee-sys.c wee-sys.h wee-upgrade.c wee-upgrade.h wee-upgrade-file.c wee-upgrade-file.h wee-url.c wee-url.h wee-utf8.c wee-utf8.h wee-util.c wee-util.h wee-version.c wee-version.h - wee-sys.c wee-sys.h hook/wee-hook-command-run.c hook/wee-hook-command-run.h hook/wee-hook-command.c hook/wee-hook-command.h hook/wee-hook-completion.c hook/wee-hook-completion.h diff --git a/src/core/wee-command.c b/src/core/wee-command.c index fe11705ca..7e078edbd 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -6734,6 +6734,41 @@ COMMAND_CALLBACK(set) } /* + * Callback for command "/sys": system actions. + */ + +COMMAND_CALLBACK(sys) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) buffer; + + COMMAND_MIN_ARGS(2, ""); + + if (string_strcmp (argv[1], "get") == 0) + { + COMMAND_MIN_ARGS(2, "get"); + + if (string_strcmp (argv[2], "rlimit") == 0) + sys_display_rlimit (); + else if (string_strcmp (argv[2], "rusage") == 0) + sys_display_rusage (); + else + COMMAND_ERROR; + return WEECHAT_RC_OK; + } + + if (string_strcmp (argv[1], "suspend") == 0) + { + signal_suspend (); + return WEECHAT_RC_OK; + } + + COMMAND_ERROR; +} + +/* * Callback for command "/toggle": toggles value of configuration option. */ @@ -7777,41 +7812,6 @@ COMMAND_CALLBACK(window) } /* - * Callback for command "/sys": system actions. - */ - -COMMAND_CALLBACK(sys) -{ - /* make C compiler happy */ - (void) pointer; - (void) data; - (void) buffer; - - COMMAND_MIN_ARGS(2, ""); - - if (string_strcmp (argv[1], "get") == 0) - { - COMMAND_MIN_ARGS(2, "get"); - - if (string_strcmp (argv[2], "rlimit") == 0) - sys_display_rlimit (); - else if (string_strcmp (argv[2], "rusage") == 0) - sys_display_rusage (); - else - COMMAND_ERROR; - return WEECHAT_RC_OK; - } - - if (string_strcmp (argv[1], "suspend") == 0) - { - signal_suspend (); - return WEECHAT_RC_OK; - } - - COMMAND_ERROR; -} - -/* * Hooks WeeChat core commands. */ @@ -9206,6 +9206,20 @@ command_init () " || env %(env_vars) %(env_value)", &command_set, NULL, NULL); hook_command ( + NULL, "sys", + N_("system actions"), + N_("get rlimit|rusage" + " || suspend"), + N_(" get: display system info\n" + " rlimit: display resource limits " + "(see /help weechat.startup.sys_rlimit and \"man getrlimit\")\n" + " rusage: display resource usage (see \"man getrusage\")\n" + "suspend: suspend WeeChat and go back to the shell, by sending " + "signal SIGTSTP to the WeeChat process"), + "get rlimit|rusage" + " || suspend", + &command_sys, NULL, NULL); + hook_command ( NULL, "toggle", N_("toggle value of a config option"), N_("<option> [<value> [<value>...]]"), @@ -9493,20 +9507,6 @@ command_init () " || bare" " || %(windows_numbers)", &command_window, NULL, NULL); - hook_command ( - NULL, "sys", - N_("system actions"), - N_("get rlimit|rusage" - " || suspend"), - N_(" get: display system info\n" - " rlimit: display resource limits " - "(see /help weechat.startup.sys_rlimit and \"man getrlimit\")\n" - " rusage: display resource usage (see \"man getrusage\")\n" - "suspend: suspend WeeChat and go back to the shell, by sending " - "signal SIGTSTP to the WeeChat process"), - "get rlimit|rusage" - " || suspend", - &command_sys, NULL, NULL); } /* diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 89bde3d70..e2d7ae3bd 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -47,8 +47,8 @@ #include "wee-list.h" #include "wee-proxy.h" #include "wee-string.h" -#include "wee-version.h" #include "wee-sys.h" +#include "wee-version.h" #include "../gui/gui-bar.h" #include "../gui/gui-bar-item.h" #include "../gui/gui-bar-item-custom.h" |