summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-08-28 17:55:54 +0200
committerSébastien Helleu <flashcode@flashtux.org>2023-08-28 17:55:54 +0200
commitb203c4109ba1aa1483ed14882a289b857c09705c (patch)
tree25b9a9e55ea1a9213976fedc60216d91828e04bd /src/core
parenta16b3d25ce2fd6d2f4d2b306043c5da494004e6a (diff)
downloadweechat-b203c4109ba1aa1483ed14882a289b857c09705c.zip
core: move sys filename and functions
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/wee-command.c98
-rw-r--r--src/core/wee-config.c2
3 files changed, 51 insertions, 51 deletions
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"