1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-13 22:54:47 +02:00

Compare commits

..

21 Commits

Author SHA1 Message Date
Sébastien Helleu 3e8f957210 Version 4.5.2 2025-02-20 23:37:24 +01:00
Sébastien Helleu 1110b8b9d5 debian: update changelog 2025-02-20 23:05:45 +01:00
Sébastien Helleu 524528fc34 core: update ChangeLog 2025-02-20 22:55:00 +01:00
LuK1337 34c79971fc core: use <stdbool.h> instead of typedef in ncurses-fake.h
Fixes the following error when building in Fedora rawhide:
error: ‘bool’ cannot be defined via ‘typedef’.

Likely GCC 15 related.
2025-01-26 08:55:36 +01:00
Sébastien Helleu c1ca6c4002 core: add parameter name in signal handler functions 2025-01-26 08:55:34 +01:00
LuK1337 c7af60daaa core: add int arg for all sigaction.sa_handler functions
src/gui/curses/gui-curses-main.c: In function ‘gui_main_loop’:
src/gui/curses/gui-curses-main.c:399:33: error: passing argument 2 of ‘signal_catch’ from incompatible pointer type [-Wincompatible-pointer-types]
  399 |         signal_catch (SIGWINCH, &gui_main_signal_sigwinch);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 void (*)(void)
In file included from src/gui/curses/gui-curses-main.c:38:
src/gui/curses/../../core/core-signal.h:33:46: note: expected ‘void (*)(int)’ but argument is of type ‘void (*)(void)’
   33 | extern void signal_catch (int signum, void (*handler)(int));
      |                                       ~~~~~~~^~~~~~~~~~~~~
2025-01-26 08:55:32 +01:00
Sébastien Helleu 99a3865665 relay/api: bump version in OpenAPI document 2025-01-05 13:44:17 +01:00
Sébastien Helleu b93a24d949 relay/api: fix name of body field "buffer_name" in doc of POST /api/input 2025-01-05 10:36:59 +01:00
Sébastien Helleu 1ee6b6e635 Version 4.5.2-dev 2024-12-23 08:52:56 +01:00
Sébastien Helleu b62c87d9eb Version 4.5.1 2024-12-23 08:47:56 +01:00
Sébastien Helleu 18be2b3151 core: fix typo in ChangeLog 2024-12-23 08:37:06 +01:00
Sébastien Helleu 8a9a652d03 relay: fix description of relay clients after /upgrade 2024-12-22 19:34:31 +01:00
Sébastien Helleu f8c48b8000 relay: fix crash after /upgrade when relay clients are connected 2024-12-22 19:34:29 +01:00
Sébastien Helleu 42c65cebcb api: allow to add empty buffer with function infolist_new_var_buffer
This fixes the following error with `/upgrade` command when relay clients are
connected:

  relay: failed to save upgrade data
2024-12-22 19:34:20 +01:00
Sébastien Helleu c9c57eeee2 Revert "ci: fix macOS CI"
Remove workaround for https://github.com/actions/runner-images/issues/10984

This reverts commit 2555c378a2.
2024-12-22 10:56:07 +01:00
Sébastien Helleu 8c63243941 core: fix detection of dl library (issue #2218)
This fixes the linking to curl and ncurses on macOS.
2024-12-21 18:11:57 +01:00
Sébastien Helleu 732bfe4a48 core: add option POST_BUILD in add_custom_command
This fixes the following CMake warning:

CMake Warning (dev) at src/gui/curses/normal/CMakeLists.txt:73 (add_custom_command):
  Exactly one of PRE_BUILD, PRE_LINK, or POST_BUILD must be given.  Assuming
  POST_BUILD to preserve backward compatibility.

  Policy CMP0175 is not set: add_custom_command() rejects invalid arguments.
  Run "cmake --help-policy CMP0175" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.
2024-12-21 18:11:08 +01:00
Sébastien Helleu 46f322c10f logger: fix path displayed when the logs directory can not be created 2024-12-21 17:16:15 +01:00
Sébastien Helleu 52cb5bbbe0 core: update ChangeLog 2024-12-20 07:39:18 +01:00
zeromind b634270f2a perl: set locale only on supported Perl versions
restrict setting the locale only if the Perl version supports it (>=5.27.9)

fixes #2219
2024-12-20 07:38:33 +01:00
Sébastien Helleu f4dbdb93d7 Version 4.5.1-dev 2024-12-20 07:38:14 +01:00
707 changed files with 8242 additions and 13813 deletions
+2 -2
View File
@@ -92,7 +92,7 @@ env:
ruby
rubygem-asciidoctor
sudo
tcl86
tcl87
zstd
jobs:
@@ -163,7 +163,7 @@ jobs:
env:
RELAY_PASSWORD: test
run: |
pipx install schemathesis==3.39.16
pipx install schemathesis
weechat-headless \
--dir /tmp/weechat-test-api \
--run-command '/set relay.network.password "${{ env.RELAY_PASSWORD }}"' \
-2
View File
@@ -28,7 +28,6 @@ Alphabetically:
- Christian Heinz
- Christopher O'Neill (deltafire)
- coypoop
- Daniel Lublin
- Danilo Spinella
- David Flatz
- Dmitry Kobylin
@@ -64,7 +63,6 @@ Alphabetically:
- jesopo
- Jim Ramsay (lack)
- Jiri Golembiovsky (GolemJ)
- Joe Hermaszewski
- Joey Pabalinas (alyptik)
- Johan Rylander
- Johannes Kuhn
-83
View File
@@ -1,88 +1,5 @@
# WeeChat ChangeLog
## Version 4.6.4 (under dev)
### Added
- core: add support of specifier `%@` for UTC time in function util_strftimeval
### Fixed
- core: fix buffer overflow in connection to SOCKS5 proxy ([#2325](https://github.com/weechat/weechat/issues/2325))
- api: fix infinite loop in function string_replace when the search string is empty
- irc: limit size of data received from the server to prevent memory exhaustion
- irc: fix out-of-bounds read on incoming DCC command with a quoted filename ending the message ([#2322](https://github.com/weechat/weechat/issues/2322))
- relay: limit size of received websocket frame and HTTP body to prevent memory exhaustion
- relay: fix timing attack on password authentication ([GHSA-vhv8-g2r9-cwcc](https://github.com/weechat/weechat/security/advisories/GHSA-vhv8-g2r9-cwcc), [CVE-2026-53525](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53525))
- api, relay: fix timing attack on TOTP validation ([GHSA-vhv8-g2r9-cwcc](https://github.com/weechat/weechat/security/advisories/GHSA-vhv8-g2r9-cwcc), [CVE-2026-53525](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53525))
- relay: limit size of decompressed websocket frame with permessage-deflate to prevent memory exhaustion ([GHSA-v2v4-45wm-5cr3](https://github.com/weechat/weechat/security/advisories/GHSA-v2v4-45wm-5cr3), [CVE-2026-53524](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-53524))
- relay/weechat: fix empty buffers in client when WeeChat is running on Solaris/illumos
- relay: limit size of partial message received while reading an HTTP request to prevent memory exhaustion
- relay: fix out-of-bounds read in dump of data ([#2324](https://github.com/weechat/weechat/issues/2324))
- xfer: replace directory separator in remote nick by underscore in download filename to prevent writing the file outside the download directory ([#2321](https://github.com/weechat/weechat/issues/2321))
- xfer: fix out-of-bounds read when receiving empty line in DCC chat ([#2323](https://github.com/weechat/weechat/issues/2323))
- build: fix build on Solaris/illumos (issue #2251)
## Version 4.6.3 (2025-05-11)
### Fixed
- core: fix integer overflow with decimal numbers in calculation of expression
- core: fix integer overflow in base32 encoding/decoding
- core: fix integer overflow in function util_version_number
- core: fix buffer overflow in function util_parse_time
- core: fix buffer overflow in function eval_syntax_highlight_colorize
- core: fix buffer overflow in function eval_string_base_encode
- core: fix buffer overflow in function eval_string_range_chars
- core: fix memory leak in function util_parse_delay
## Version 4.6.2 (2025-04-18)
### Fixed
- core: fix write of weechat.log to stdout with `weechat-headless --stdout` ([#2247](https://github.com/weechat/weechat/issues/2247))
- core: add refresh of window title on buffer switch, when option weechat.look.window_title is set
## Version 4.6.1 (2025-04-09)
### Fixed
- core: consider all keys are safe in cursor context ([#2244](https://github.com/weechat/weechat/issues/2244))
- irc: display nick changes and quit messages when option irc.look.ignore_tag_messages is enabled ([#2241](https://github.com/weechat/weechat/issues/2241))
- perl: fix build when multiplicity is not available ([#2243](https://github.com/weechat/weechat/issues/2243))
## Version 4.6.0 (2025-03-23)
### Changed
- core: add option `-v` to display upgrades in command `/version`
- api: add property `keep_spaces_right` in function hook_set to keep trailing spaces in command arguments
- core, irc, alias, xfer: keep spaces at the end of some commands, where trailing spaces are important
- irc: add option `-connected` in command `/server list|listfull`
- buflist: apply option buflist.look.nick_prefix_empty also on private and list buffers
- xfer: compute speed and ETA with microsecond precision ([#665](https://github.com/weechat/weechat/issues/665))
### Added
- core: add command `/pipe`
- core: add option `whitespace` in command `/debug`, add options weechat.look.whitespace_char and weechat.look.tab_whitespace_char ([#947](https://github.com/weechat/weechat/issues/947))
- core: add option weechat.completion.nick_ignore_words ([#1143](https://github.com/weechat/weechat/issues/1143))
- spell: add CMake options ASPELL_DICT_DIR and ENCHANT_MYSPELL_DICT_DIR to override dictionaries locations ([#1174](https://github.com/weechat/weechat/issues/1174))
- api: add function completion_set
- relay/api: add resource `POST /api/completion` ([#2207](https://github.com/weechat/weechat/issues/2207))
- relay/api: add default key `Alt`+`Ctrl`+`l` (L) to toggle between remote and local commands on remote buffers, add option `togglecmd` in command `/remote`, add options relay.api.remote_input_cmd_local and relay.api.remote_input_cmd_remote ([#2148](https://github.com/weechat/weechat/issues/2148))
### Fixed
- relay: fix crash after `/upgrade` when relay clients are connected
- core: save configuration files as UTF-8 when the locale is wrong
- api: fix creation of empty buffer in function infolist_new_var_buffer
- core: fix build with gcc 15 ([#2229](https://github.com/weechat/weechat/issues/2229), [#2230](https://github.com/weechat/weechat/issues/2230))
- core: fix detection of dl library ([#2218](https://github.com/weechat/weechat/issues/2218))
- logger: fix path displayed when the logs directory can not be created
- perl: fix build with Perl < 5.7.29 ([#2219](https://github.com/weechat/weechat/issues/2219), [#2220](https://github.com/weechat/weechat/issues/2220))
- python: enable subinterpreters ([#2222](https://github.com/weechat/weechat/issues/2222))
## Version 4.5.2 (2025-02-20)
### Fixed
+1 -32
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2007-2008 Julien Louis <ptitlouis@sysif.net>
# Copyright (C) 2008-2009 Emmanuel Bouthenot <kolter@openics.org>
#
@@ -166,16 +166,6 @@ if(ENABLE_TESTS AND NOT ENABLE_HEADLESS)
message(FATAL_ERROR "Headless mode is required for tests.")
endif()
# Set this to override aspell's dictionaries directory
if(ASPELL_DICT_DIR)
add_definitions(-DASPELL_DICT_DIR="${ASPELL_DICT_DIR}")
endif()
# Set this to override the myspell dictionaries directory when using enchant
if(ENCHANT_MYSPELL_DICT_DIR)
add_definitions(-DENCHANT_MYSPELL_DICT_DIR="${ENCHANT_MYSPELL_DICT_DIR}")
endif()
# option WEECHAT_HOME
set(WEECHAT_HOME "${WEECHAT_HOME}" CACHE
STRING "Force a single WeeChat home directory for config, logs, scripts, etc."
@@ -198,7 +188,6 @@ include(FindPkgConfig)
include(CheckIncludeFiles)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckLibraryExists)
check_include_files("langinfo.h" HAVE_LANGINFO_CODESET)
check_include_files("sys/resource.h" HAVE_SYS_RESOURCE_H)
@@ -209,33 +198,13 @@ check_symbol_exists("malloc_trim" "malloc.h" HAVE_MALLOC_TRIM)
check_function_exists(mallinfo HAVE_MALLINFO)
check_function_exists(mallinfo2 HAVE_MALLINFO2)
check_symbol_exists("htonll" "sys/types.h;netinet/in.h;inttypes.h" HAVE_HTONLL)
check_symbol_exists("eat_newline_glitch" "term.h" HAVE_EAT_NEWLINE_GLITCH)
# Check if res_init requires libresolv
check_function_exists(res_init, LIBC_HAS_RES_INIT)
if(NOT LIBC_HAS_RES_INIT)
find_library(RESOLV_LIBRARY resolv)
if(RESOLV_LIBRARY)
check_library_exists("${RESOLV_LIBRARY}" res_init "" LIBRESOLV_HAS_RES_INIT)
if(LIBRESOLV_HAS_RES_INIT)
list(APPEND EXTRA_LIBS ${RESOLV_LIBRARY})
endif()
endif()
endif()
# Check for Large File Support
if(ENABLE_LARGEFILE)
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_LARGE_FILES)
endif()
# _XPG4_2 is needed for macros like CMSG_SPACE
# __EXTENSIONS__ is needed for constants like NI_MAXHOST and for struct timeval
if(CMAKE_HOST_SOLARIS)
add_definitions(-D_XPG4_2 -D__EXTENSIONS__)
endif()
# Check for libgcrypt
pkg_check_modules(LIBGCRYPT REQUIRED libgcrypt)
include_directories(${LIBGCRYPT_INCLUDE_DIRS})
+1 -1
View File
@@ -48,7 +48,7 @@ WeeChat is following a "practical" semantic versioning, see file [CONTRIBUTING.m
## Copyright
Copyright © 2003-2025 [Sébastien Helleu](https://github.com/flashcode)
Copyright © 2003-2024 [Sébastien Helleu](https://github.com/flashcode)
This file is part of WeeChat, the extensible chat client.
-21
View File
@@ -7,27 +7,6 @@ When upgrading from version X to Y, please read and apply all instructions from
For a list of all changes in each version, please see [CHANGELOG.md](CHANGELOG.md).
## Version 4.6.3
### API function util_version_number
An integer overflow has been fixed in the function
[util_version_number](https://weechat.org/doc/weechat/plugin/#_util_version_number)
which now returns a version up to "127.255.255.255" (0x7FFFFFFF).
## Version 4.6.0
### Relay remote commands
Commands on remote buffers can now be toggled: execution on remote WeeChat or
locally, with a new default key: `Alt`+`Ctrl`+`l` (L).
You can add this key with this command:
```text
/key missing
```
## Version 4.3.1
### Detection of libgcrypt
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2014-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2014-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2007 Julien Louis <ptitlouis@sysif.net>
# Copyright (C) 2009 Emmanuel Bouthenot <kolter@openics.org>
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2011-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2011-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+1 -1
View File
@@ -1,6 +1,6 @@
#
# Copyright (C) 2017 Adam Saponara <as@php.net>
# Copyright (C) 2017-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2017-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+34
View File
@@ -0,0 +1,34 @@
#
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2009 Julien Louis <ptitlouis@sysif.net>
#
# This file is part of WeeChat, the extensible chat client.
#
# WeeChat is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# WeeChat is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
#
# - Find Python
# This module finds if Python is installed and determines where the include files
# and libraries are. It also determines what the name of the library is. This
# code sets the following variables:
#
# PYTHON_EXECUTABLE = full path to the python binary
# PYTHON_INCLUDE_DIRS = path to where python.h can be found
# PYTHON_LIBRARIES = path to where libpython.so* can be found
# PYTHON_LDFLAGS = python compiler options for linking
pkg_check_modules(PYTHON python3-embed IMPORTED_TARGET GLOBAL)
if(NOT PYTHON_FOUND)
pkg_check_modules(PYTHON python3 IMPORTED_TARGET GLOBAL)
endif()
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2015-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2015-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
-1
View File
@@ -43,7 +43,6 @@
#cmakedefine HAVE_MALLINFO2
#cmakedefine HAVE_MALLOC_H
#cmakedefine HAVE_MALLOC_TRIM
#cmakedefine HAVE_HTONLL
#cmakedefine HAVE_EAT_NEWLINE_GLITCH
#cmakedefine HAVE_ASPELL_VERSION_STRING
#cmakedefine HAVE_ENCHANT_GET_VERSION
+1 -1
View File
@@ -24,7 +24,7 @@ Build-Depends:
libzstd-dev,
zlib1g-dev,
libcjson-dev
Standards-Version: 4.7.2
Standards-Version: 4.7.0
Homepage: https://weechat.org/
Vcs-Git: https://salsa.debian.org/kolter/weechat.git
Vcs-Browser: https://salsa.debian.org/kolter/weechat
-6
View File
@@ -1,9 +1,3 @@
weechat (4.6.1-1) unstable; urgency=medium
* New upstream release (Closes: #1102450, #1098090)
-- Emmanuel Bouthenot <kolter@debian.org> Wed, 16 Apr 2025 20:31:07 +0000
weechat (4.5.1-1) unstable; urgency=medium
* New upstream release
+1 -1
View File
@@ -24,7 +24,7 @@ Build-Depends:
libzstd-dev,
zlib1g-dev,
libcjson-dev
Standards-Version: 4.7.2
Standards-Version: 4.7.0
Homepage: https://weechat.org/
Vcs-Git: https://salsa.debian.org/kolter/weechat.git
Vcs-Browser: https://salsa.debian.org/kolter/weechat
+1 -1
View File
@@ -4,7 +4,7 @@ Upstream-Contact: Sébastien Helleu <flashcode@flashtux.org>
Source: https://weechat.org/
Files: *
Copyright: 2003-2025, Sébastien Helleu <flashcode@flashtux.org>
Copyright: 2003-2024, Sébastien Helleu <flashcode@flashtux.org>
License: GPL-3+
Files: src/core/core-command.c
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2009 Emmanuel Bouthenot <kolter@openics.org>
#
# This file is part of WeeChat, the extensible chat client.
+1 -1
View File
@@ -99,7 +99,7 @@ $HOME/.local/share/weechat/weechat.log::
WeeChat je napsán Sébastienem Helleu a přispěvovateli (kompletní seznam je v
souboru AUTHORS.md).
Copyright (C) 2003-2025 {author}
Copyright (C) 2003-2024 {author}
WeeChat is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -100,7 +100,7 @@ $HOME/.local/share/weechat/weechat.log::
WeeChat wird programmiert von Sébastien Helleu und weiteren Beteiligten (eine vollständige Auflistung
findet man in der AUTHORS.md Datei).
Copyright (C) 2003-2025 {author}
Copyright (C) 2003-2024 {author}
WeeChat is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
+5 -6
View File
@@ -1764,12 +1764,11 @@ Sie können mit dem Befehl <<command_weechat_key,/key>> geändert und neue hinzu
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Taste | Beschreibung | Befehl
| kbd:[Alt+m] | schaltet Mausfunktion ein/aus. | `+/mouse toggle+`
| kbd:[Alt+s] | Umschalten der Rechtschreibprüfung. | `+/mute spell toggle+`
| kbd:[Alt+=] | schaltet Filterfunktion an/aus. | `+/filter toggle+`
| kbd:[Alt+-] | schaltet, für den aktuellen Buffer, Filterfunktion an/aus. | `+/filter toggle @+`
| kbd:[Alt+Ctrl+l] (`L`) | Umschalten zwischen Remote- und lokalen Befehlen in einem Remote-Buffer (relay "api"). | `+/remote togglecmd+`
| Taste | Beschreibung | Befehl
| kbd:[Alt+m] | schaltet Mausfunktion ein/aus. | `+/mouse toggle+`
| kbd:[Alt+s] | Umschalten der Rechtschreibprüfung. | `+/mute spell toggle+`
| kbd:[Alt+=] | schaltet Filterfunktion an/aus. | `+/filter toggle+`
| kbd:[Alt+-] | schaltet, für den aktuellen Buffer, Filterfunktion an/aus. | `+/filter toggle @+`
|===
[[key_bindings_search_context]]
+1 -1
View File
@@ -1,6 +1,6 @@
<!--
Custom styles for Asciidoctor
Copyright (C) 2016-2025 Sébastien Helleu <flashcode@flashtux.org>
Copyright (C) 2016-2024 Sébastien Helleu <flashcode@flashtux.org>
-->
<style>
+1 -1
View File
@@ -100,7 +100,7 @@ $HOME/.local/share/weechat/weechat.log::
WeeChat is written by Sébastien Helleu and contributors (complete list is in
the AUTHORS.md file).
Copyright (C) 2003-2025 {author}
Copyright (C) 2003-2024 {author}
WeeChat is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
+1 -1
View File
@@ -577,7 +577,7 @@ Example in C:
/*
* weechat.c - core functions for WeeChat
*
* Copyright (C) 2025 Your Name <your@email.com>
* Copyright (C) 2024 Your Name <your@email.com>
*
* This file is part of WeeChat, the extensible chat client.
*
+5 -81
View File
@@ -4762,7 +4762,7 @@ This function is not available in scripting API.
==== util_strftimeval
_WeeChat ≥ 4.2.0, updated in 4.3.0, 4.6.4._
_WeeChat ≥ 4.2.0, updated in 4.3.0._
Format date and time like function `strftime` in C library, using `struct timeval`
as input, and supporting extra specifiers.
@@ -4779,8 +4779,6 @@ Arguments:
* _string_: buffer where the formatted string is stored
* _max_: string size
* _format_: format, the same as _strftime_ function, with these extra specifiers:
** `%@`: return the date expressed in Coordinated Universal Time (UTC)
instead of date relative to the user's specified timezone _(WeeChat ≥ 4.7.0)_
** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits
(for example `%.3` for milliseconds)
** `%f`: alias of `%.6`
@@ -4797,8 +4795,8 @@ C example:
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%@%FT%T.%fZ", &tv);
/* result: 2023-12-26T18:10:04.460509Z */
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* result: 2023-12-26T18:10:04.460509 */
----
[NOTE]
@@ -10983,11 +10981,6 @@ _WeeChat ≥ 4.1.0._
URL transfer.
This function is similar to <<_hook_process,hook_process>> and
<<_hook_process_hashtable,hook_process_hashtable>> with command "url:..."
but it uses a thread instead of new process, making it more lightweight
and thus recommended for this usage.
Prototype:
[source,c]
@@ -14021,10 +14014,6 @@ Properties:
| Name of sub plugin (commonly script name, which is displayed in
`/help command` for a hook of type _command_).
| keep_spaces_right | 4.6.0 | _command_, _command_run_
| "0" or "1"
| Keep trailing spaces in command arguments when it is executed.
| stdin | 0.4.3 | _process_, _process_hashtable_
| any string
| Send data on standard input (_stdin_) of child process.
@@ -15530,8 +15519,8 @@ void weechat_window_set_title (const char *title);
Arguments:
* _title_: new title for terminal; string is evaluated, so variables like
`${info:version}` can be used
* _title_: new title for terminal (NULL to reset title); string is evaluated,
so variables like `${info:version}` can be used
(see <<_string_eval_expression,string_eval_expression>>)
C example:
@@ -17094,71 +17083,6 @@ def my_completion_cb(data: str, completion_item: str, buffer: str, completion: s
return weechat.WEECHAT_RC_OK
----
==== completion_set
_WeeChat ≥ 4.6.0._
Set a completion property.
Prototype:
[source,c]
----
void weechat_completion_get_string (struct t_gui_completion *completion,
const char *property,
const char *value);
----
Arguments:
* _completion_: completion pointer
* _property_: property name (see table below)
* _value_: new value for property
Properties:
[width="100%",cols="^2,^1,4,8",options="header"]
|===
| Name | Min WeeChat | Value | Description
| add_space | 4.6.0 | "0" or "1"
| "0": do not add space after completion +
"1": add space after completion (default).
|===
C example:
[source,c]
----
int
my_completion_cb (const void *pointer, void *data, const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* do not add space after completion */
weechat_completion_set (completion, "add_space", "0");
/* ... */
return WEECHAT_RC_OK;
}
----
Script (Python):
[source,python]
----
# prototype
def completion_set(completion: str, property: str, value: str) -> int: ...
# example
def my_completion_cb(data: str, completion_item: str, buffer: str, completion: str) -> int:
# do not add space after completion
weechat.completion_set(completion, "add_space", "0")
# ...
return weechat.WEECHAT_RC_OK
----
==== completion_list_add
_WeeChat ≥ 2.9._
-52
View File
@@ -1220,58 +1220,6 @@ Response:
HTTP/1.1 204 No content
----
[[resource_completion]]
=== Completion
Complete user command or text in a buffer.
Endpoint:
----
POST /api/completion
----
Body parameters:
* `buffer_id` (integer, optional): buffer unique identifier (not to be confused
with the buffer number, which is different)
* `buffer_name` (string, optional, default: `core.weechat`): buffer name
* `command` (string, **required**): command or text to complete
* `position` (integer, optional, default: end of string): position in command
(first position is 0)
Request example: complete command `/qu` on channel #weechat:
[source,shell]
----
curl -L -u 'plain:secret_password' -X POST \
-d '{"buffer_name": "irc.libera.#weechat", "command": "/qu"}' \
'https://localhost:9000/api/completion'
----
Response:
[source,http]
----
HTTP/1.1 200 OK
----
[source,json]
----
{
"context": "command",
"base_word": "qu",
"position_replace": 1,
"add_space": true,
"list": [
"query",
"quiet",
"quit",
"quote"
]
}
----
[[resource_ping]]
=== Ping
+5 -6
View File
@@ -1753,12 +1753,11 @@ They can be changed and new ones can be added with the <<command_weechat_key,/ke
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Key | Description | Command
| kbd:[Alt+m] | Toggle mouse. | `+/mouse toggle+`
| kbd:[Alt+s] | Toggle spell checker. | `+/mute spell toggle+`
| kbd:[Alt+=] | Toggle filters. | `+/filter toggle+`
| kbd:[Alt+-] | Toggle filters in current buffer. | `+/filter toggle @+`
| kbd:[Alt+Ctrl+l] (`L`) | Toggle between remote and local commands on a remote buffer (relay "api"). | `+/remote togglecmd+`
| Key | Description | Command
| kbd:[Alt+m] | Toggle mouse. | `+/mouse toggle+`
| kbd:[Alt+s] | Toggle spell checker. | `+/mute spell toggle+`
| kbd:[Alt+=] | Toggle filters. | `+/filter toggle+`
| kbd:[Alt+-] | Toggle filters in current buffer. | `+/filter toggle @+`
|===
[[key_bindings_search_context]]
+1 -1
View File
@@ -102,7 +102,7 @@ $HOME/.local/share/weechat/weechat.log::
WeeChat est écrit par Sébastien Helleu et des contributeurs (la liste complète
est dans le fichier AUTHORS.md).
Copyright (C) 2003-2025 {author}
Copyright (C) 2003-2024 {author}
WeeChat est un logiciel libre ; vous pouvez le redistribuer et/ou le modifier
sous les termes de la GNU General Public License telle que publiée par la
+1 -1
View File
@@ -578,7 +578,7 @@ Exemple en C :
/*
* weechat.c - core functions for WeeChat
*
* Copyright (C) 2025 Your Name <your@email.com>
* Copyright (C) 2024 Your Name <your@email.com>
*
* This file is part of WeeChat, the extensible chat client.
*
+6 -82
View File
@@ -4841,7 +4841,7 @@ Cette fonction n'est pas disponible dans l'API script.
==== util_strftimeval
_WeeChat ≥ 4.2.0, mis à jour dans la 4.3.0, 4.6.4._
_WeeChat ≥ 4.2.0, mis à jour dans la 4.3.0._
Formatter la date et l'heure comme la fonction `strftime` de la bibliothèque C,
en utilisant un `struct timeval` en entrée et en supportant des caractères de
@@ -4860,8 +4860,6 @@ Paramètres :
* _max_ : taille de la chaîne
* _format_ : format, le même que celui de la fonction _strftime_, avec des
caractères de conversion supplémentaires :
** `%@`: retourner la date exprimée en Temps Universel Coordonné (UTC)
au lieu de la date relative au fuseau horaire de l'utilisateur _(WeeChat ≥ 4.7.0)_
** `%.N` où `N` est entre 1 and 6: microsecondes remplies avec des zéros sur
N chiffres (par exemple `%.3` pour les millisecondes)
** `%f` : alias de `%.6`
@@ -4878,8 +4876,8 @@ Exemple en C :
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%@%FT%T.%fZ", &tv);
/* résultat : 2023-12-26T18:10:04.460509Z */
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* résultat : 2023-12-26T18:10:04.460509 */
----
[NOTE]
@@ -11187,11 +11185,6 @@ _WeeChat ≥ 4.1.0._
Transfert d'URL.
Cette fonction est similaire à <<_hook_process,hook_process>> et
<<_hook_process_hashtable,hook_process_hashtable>> avec la commande "url:..."
mais elle utilise un thread au lieu d'un nouveau processus, la rendant plus
légère et donc recommandée pour cet usage.
Prototype :
[source,c]
@@ -14334,10 +14327,6 @@ Propriétés :
| Nom de la sous-extension (couramment un nom de script, qui est affiché dans
`/help commande` pour un hook de type _command_).
| keep_spaces_right | 4.6.0 | _command_, _command_run_
| "0" ou "1"
| Garder les espaces à la fin des paramètres de la commande quand elle est exécutée.
| stdin | 0.4.3 | _process_, _process_hashtable_ | toute chaîne
| Envoyer les données sur l'entrée standard (_stdin_) du processus fils.
@@ -15871,9 +15860,9 @@ void weechat_window_set_title (const char *title);
Paramètres :
* _title_ : nouveau titre pour le terminal ; la chaîne est évaluée, donc les variables
comme `${info:version}` peuvent être utilisées
(voir <<_string_eval_expression,string_eval_expression>>)
* _title_ : nouveau titre pour le terminal (NULL pour réinitialiser le titre) ;
la chaîne est évaluée, donc les variables comme `${info:version}` peuvent
être utilisées (voir <<_string_eval_expression,string_eval_expression>>)
Exemple en C :
@@ -17458,71 +17447,6 @@ def my_completion_cb(data: str, completion_item: str, buffer: str, completion: s
return weechat.WEECHAT_RC_OK
----
==== completion_set
_WeeChat ≥ 4.6.0._
Affecter une valeur à une propriété d'une complétion.
Prototype:
[source,c]
----
void weechat_completion_get_string (struct t_gui_completion *completion,
const char *property,
const char *value);
----
Paramètres:
* _completion_ : pointeur vers la complétion
* _property_ : nom de la propriété (voir le tableau ci-dessous)
* _value_ : nouvelle valeur pour la propriété
Properties:
[width="100%",cols="^2,^1,4,8",options="header"]
|===
| Name | Min WeeChat | Value | Description
| add_space | 4.6.0 | "0" or "1"
| "0": do not add space after completion +
"1": add space after completion (default).
|===
Exemple en C :
[source,c]
----
int
my_completion_cb (const void *pointer, void *data, const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* ne pas ajouter d'espace après la complétion */
weechat_completion_set (completion, "add_space", "0");
/* ... */
return WEECHAT_RC_OK;
}
----
Script (Python):
[source,python]
----
# prototype
def completion_set(completion: str, property: str, value: str) -> int: ...
# exemple
def my_completion_cb(data: str, completion_item: str, buffer: str, completion: str) -> int:
# ne pas ajouter d'espace après la complétion
weechat.completion_set(completion, "add_space", "0")
# ...
return weechat.WEECHAT_RC_OK
----
==== completion_list_add
_WeeChat ≥ 2.9._
-52
View File
@@ -1232,58 +1232,6 @@ Réponse :
HTTP/1.1 204 No content
----
[[resource_completion]]
=== Complétion
Compléter une commande ou du texte de l'utilisateur sur un tampon.
Point de terminaison :
----
POST /api/completion
----
Paramètres du corps :
* `buffer_id` (entier, facultatif) : identifiant unique du tampon (à ne pas
confondre avec le numéro du tampon, qui est différent)
* `buffer_name` (chaîne, facultatif, par défaut: `core.weechat`) : nom de tampon
* `command` (chaîne, **obligatoire**) : commande ou texte à compléter
* `position` (entier, facultatif, par défaut: fin de la chaîne): position
dans la commande (la première position est 0)
Exemple de requête : compléter la commande `/qu` sur le canal #weechat :
[source,shell]
----
curl -L -u 'plain:secret_password' -X POST \
-d '{"buffer_name": "irc.libera.#weechat", "command": "/qu"}' \
'https://localhost:9000/api/completion'
----
Réponse :
[source,http]
----
HTTP/1.1 200 OK
----
[source,json]
----
{
"context": "command",
"base_word": "qu",
"position_replace": 1,
"add_space": true,
"list": [
"query",
"quiet",
"quit",
"quote"
]
}
----
[[resource_ping]]
=== Ping
+5 -6
View File
@@ -1788,12 +1788,11 @@ Ils peuvent être modifiés et de nouveaux peuvent être ajoutés avec la comman
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Touche | Description | Commande
| kbd:[Alt+m] | Activer/désactiver la souris. | `+/mouse toggle+`
| kbd:[Alt+s] | Activer/désactiver la vérification de l'orthographe. | `+/mute spell toggle+`
| kbd:[Alt+=] | Activer/désactiver les filtres. | `+/filter toggle+`
| kbd:[Alt+-] | Activer/désactiver les filtres dans le tampon courant. | `+/filter toggle @+`
| kbd:[Alt+Ctrl+l] (`L`) | Basculer entre les commandes distantes et locales sur un tampon distant (relay "api"). | `+/remote togglecmd+`
| Touche | Description | Commande
| kbd:[Alt+m] | Activer/désactiver la souris. | `+/mouse toggle+`
| kbd:[Alt+s] | Activer/désactiver la vérification de l'orthographe. | `+/mute spell toggle+`
| kbd:[Alt+=] | Activer/désactiver les filtres. | `+/filter toggle+`
| kbd:[Alt+-] | Activer/désactiver les filtres dans le tampon courant. | `+/filter toggle @+`
|===
[[key_bindings_search_context]]
+1 -1
View File
@@ -103,7 +103,7 @@ $HOME/.local/share/weechat/weechat.log::
WeeChat is written by Sébastien Helleu and contributors (complete list is in
the AUTHORS.md file).
Copyright (C) 2003-2025 {author}
Copyright (C) 2003-2024 {author}
WeeChat is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
+5 -89
View File
@@ -4985,7 +4985,7 @@ Questa funzione non è disponibile nelle API per lo scripting.
// TRANSLATION MISSING
==== util_strftimeval
_WeeChat ≥ 4.2.0, updated in 4.3.0, 4.6.4._
_WeeChat ≥ 4.2.0, updated in 4.3.0._
Format date and time like function `strftime` in C library, using `struct timeval`
as input, and supporting extra specifiers.
@@ -5002,8 +5002,6 @@ Arguments:
* _string_: buffer where the formatted string is stored
* _max_: string size
* _format_: format, the same as _strftime_ function, with these extra specifiers:
** `%@`: return the date expressed in Coordinated Universal Time (UTC)
instead of date relative to the user's specified timezone _(WeeChat ≥ 4.7.0)_
** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits
(for example `%.3` for milliseconds)
** `%f`: alias of `%.6`
@@ -5020,8 +5018,8 @@ C example:
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%@%FT%T.%fZ", &tv);
/* result: 2023-12-26T18:10:04.460509Z */
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* result: 2023-12-26T18:10:04.460509 */
----
[NOTE]
@@ -11396,11 +11394,6 @@ _WeeChat ≥ 4.1.0._
URL transfer.
This function is similar to <<_hook_process,hook_process>> and
<<_hook_process_hashtable,hook_process_hashtable>> with command "url:..."
but it uses a thread instead of new process, making it more lightweight
and thus recommended for this usage.
Prototipo:
[source,c]
@@ -14674,17 +14667,11 @@ Properties:
// TRANSLATION MISSING
| subplugin | | any type
| qualsiasi stringa |
// TRANSLATION MISSING
Name of sub plugin (commonly script name, which is displayed in
`/help command` for a hook of type _command_).
// TRANSLATION MISSING
| keep_spaces_right | 4.6.0 | _command_, _command_run_
| "0" or "1"
| Keep trailing spaces in command arguments when it is executed.
| stdin | 0.4.3 | _process_, _process_hashtable_ | qualsiasi stringa |
// TRANSLATION MISSING
Send data on standard input (_stdin_) of child process.
@@ -16304,8 +16291,8 @@ void weechat_window_set_title (const char *title);
Argomenti:
// TRANSLATION MISSING
* _title_: nuovo titolo per il terminale; string is evaluated, so variables
like `${info:version}` can be used
* _title_: nuovo titolo per il terminale (NULL per resettarlo);
string is evaluated, so variables like `${info:version}` can be used
(see <<_string_eval_expression,string_eval_expression>>)
Esempio in C:
@@ -17931,77 +17918,6 @@ def my_completion_cb(data: str, completion_item: str, buffer: str, completion: s
return weechat.WEECHAT_RC_OK
----
==== completion_set
_Novità nella versioe 4.6.0._
// TRANSLATION MISSING
Set a completion property.
Prototipo:
[source,c]
----
void weechat_completion_get_string (struct t_gui_completion *completion,
const char *property,
const char *value);
----
Argomenti:
* _completion_: puntatore al completamento
// TRANSLATION MISSING
* _property_: nome della proprietà (see table below)
// TRANSLATION MISSING
* _value_: new value for property
// TRANSLATION MISSING
Properties:
[width="100%",cols="^2,^1,4,8",options="header"]
|===
// TRANSLATION MISSING
| Name | Min WeeChat | Value | Description
// TRANSLATION MISSING
| add_space | 4.6.0 | "0" or "1"
| "0": do not add space after completion +
"1": add space after completion (default).
|===
Esempio in C:
[source,c]
----
int
my_completion_cb (const void *pointer, void *data, const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* do not add space after completion */
weechat_completion_set (completion, "add_space", "0");
/* ... */
return WEECHAT_RC_OK;
}
----
Script (Python):
[source,python]
----
# prototipo
def completion_set(completion: str, property: str, value: str) -> int: ...
# esempio
def my_completion_cb(data: str, completion_item: str, buffer: str, completion: str) -> int:
# do not add space after completion
weechat.completion_set(completion, "add_space", "0")
# ...
return weechat.WEECHAT_RC_OK
----
==== completion_list_add
_Novità nella versioe 2.9._
+5 -7
View File
@@ -1934,15 +1934,13 @@ They can be changed and new ones can be added with the <<command_weechat_key,/ke
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Tasti | Descrizione | Comando
| kbd:[Alt+m] | Abilita/disabilita. | `+/mouse toggle+`
| Tasti | Descrizione | Comando
| kbd:[Alt+m] | Abilita/disabilita. | `+/mouse toggle+`
// TRANSLATION MISSING
| kbd:[Alt+s] | Toggle spell checker. | `+/mute spell toggle+`
| kbd:[Alt+=] | Attiva/disattiva filtri. | `+/filter toggle+`
| kbd:[Alt+s] | Toggle spell checker. | `+/mute spell toggle+`
| kbd:[Alt+=] | Attiva/disattiva filtri. | `+/filter toggle+`
// TRANSLATION MISSING
| kbd:[Alt+-] | Toggle filters in current buffer. | `+/filter toggle @+`
// TRANSLATION MISSING
| kbd:[Alt+Ctrl+l] (`L`) | Toggle between remote and local commands on a remote buffer (relay "api"). | `+/remote togglecmd+`
| kbd:[Alt+-] | Toggle filters in current buffer. | `+/filter toggle @+`
|===
// TRANSLATION MISSING
+1 -1
View File
@@ -100,7 +100,7 @@ $HOME/.local/share/weechat/weechat.log::
WeeChat は Sébastien Helleu さんと貢献者によって作成されています
(完全なリストは AUTHORS.md ファイルを参照してください)。
著作権 (C) 2003-2025 {author}
著作権 (C) 2003-2024 {author}
WeeChat はフリーソフトウェアです。あなたはこれを、フリーソフトウェア財団によって発行された
GNU 一般公衆利用許諾契約書 (バージョン 2 か、希望によってはそれ以降のバージョンのうちどれか)
+1 -1
View File
@@ -701,7 +701,7 @@ WeeChat とプラグインの翻訳は gettext で行います、ファイルは
/*
* weechat.c - core functions for WeeChat
*
* Copyright (C) 2025 Your Name <your@email.com>
* Copyright (C) 2024 Your Name <your@email.com>
*
* This file is part of WeeChat, the extensible chat client.
*
+5 -85
View File
@@ -4898,7 +4898,7 @@ weechat_printf (NULL, "date: %s",
// TRANSLATION MISSING
==== util_strftimeval
_WeeChat ≥ 4.2.0, updated in 4.3.0, 4.6.4._
_WeeChat ≥ 4.2.0, updated in 4.3.0._
Format date and time like function `strftime` in C library, using `struct timeval`
as input, and supporting extra specifiers.
@@ -4915,8 +4915,6 @@ Arguments:
* _string_: buffer where the formatted string is stored
* _max_: string size
* _format_: format, the same as _strftime_ function, with these extra specifiers:
** `%@`: return the date expressed in Coordinated Universal Time (UTC)
instead of date relative to the user's specified timezone _(WeeChat ≥ 4.7.0)_
** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits
(for example `%.3` for milliseconds)
** `%f`: alias of `%.6`
@@ -4933,8 +4931,8 @@ C example:
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%@%FT%T.%fZ", &tv);
/* result: 2023-12-26T18:10:04.460509Z */
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* result: 2023-12-26T18:10:04.460509 */
----
[NOTE]
@@ -11129,11 +11127,6 @@ _WeeChat ≥ 4.1.0._
URL transfer.
This function is similar to <<_hook_process,hook_process>> and
<<_hook_process_hashtable,hook_process_hashtable>> with command "url:..."
but it uses a thread instead of new process, making it more lightweight
and thus recommended for this usage.
プロトタイプ:
[source,c]
@@ -14245,11 +14238,6 @@ void weechat_hook_set (struct t_hook *hook, const char *property,
| サブプラグインの名前 (通常は `/help command` で _command_
をタイプした時のフックで表示されるスクリプト名)
// TRANSLATION MISSING
| keep_spaces_right | 4.6.0 | _command_, _command_run_
| "0" or "1"
| Keep trailing spaces in command arguments when it is executed.
| stdin | 0.4.3 | _process_、_process_hashtable_ | 任意の文字列
| 子プロセスの標準入力 (_stdin_) にデータを送信
@@ -15799,8 +15787,8 @@ void weechat_window_set_title (const char *title);
引数:
* _title_: 端末の新しいタイトル; この文字列は評価されるため、文字列内に
`${info:version}` などの変数を含めることが可能です
* _title_: 端末の新しいタイトル (タイトルをリセットする場合は NULL);
この文字列は評価されるため、文字列内に `${info:version}` などの変数を含めることが可能です
(<<_string_eval_expression,string_eval_expression>> を参照)
C 言語での使用例:
@@ -17389,74 +17377,6 @@ def my_completion_cb(data: str, completion_item: str, buffer: str, completion: s
return weechat.WEECHAT_RC_OK
----
==== completion_set
_WeeChat バージョン 4.6.0 以上で利用可。_
// TRANSLATION MISSING
Set a completion property.
プロトタイプ:
[source,c]
----
void weechat_completion_get_string (struct t_gui_completion *completion,
const char *property,
const char *value);
----
引数:
* _completion_: 補完へのポインタ
* _property_: プロパティ名 (以下の表を参照)
* _value_: プロパティの新しい値
プロパティ:
[width="100%",cols="^2,^1,4,8",options="header"]
|===
// TRANSLATION MISSING
| Name | Min WeeChat | Value | Description
// TRANSLATION MISSING
| add_space | 4.6.0 | "0" or "1"
| "0": do not add space after completion +
"1": add space after completion (default).
|===
C 言語での使用例:
[source,c]
----
int
my_completion_cb (const void *pointer, void *data, const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* do not add space after completion */
weechat_completion_set (completion, "add_space", "0");
/* ... */
return WEECHAT_RC_OK;
}
----
スクリプト (Python) での使用例:
[source,python]
----
# prototype
def completion_set(completion: str, property: str, value: str) -> int: ...
# example
def my_completion_cb(data: str, completion_item: str, buffer: str, completion: str) -> int:
# do not add space after completion
weechat.completion_set(completion, "add_space", "0")
# ...
return weechat.WEECHAT_RC_OK
----
==== completion_list_add
_WeeChat バージョン 2.9 以上で利用可。_
+5 -7
View File
@@ -1894,13 +1894,11 @@ They can be changed and new ones can be added with the <<command_weechat_key,/ke
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| キー | 説明 | コマンド
| kbd:[Alt+m] | マウスの有効無効を切り替え | `+/mouse toggle+`
| kbd:[Alt+s] | スペルチェッカの有効無効を切り替え | `+/mute spell toggle+`
| kbd:[Alt+=] | フィルタの有効無効を切り替え | `+/filter toggle+`
| kbd:[Alt+-] | 現在のバッファのフィルタの有効無効を切り替え | `+/filter toggle @+`
// TRANSLATION MISSING
| kbd:[Alt+Ctrl+l] (`L`) | Toggle between remote and local commands on a remote buffer (relay "api"). | `+/remote togglecmd+`
| キー | 説明 | コマンド
| kbd:[Alt+m] | マウスの有効無効を切り替え | `+/mouse toggle+`
| kbd:[Alt+s] | スペルチェッカの有効無効を切り替え | `+/mute spell toggle+`
| kbd:[Alt+=] | フィルタの有効無効を切り替え | `+/filter toggle+`
| kbd:[Alt+-] | 現在のバッファのフィルタの有効無効を切り替え | `+/filter toggle @+`
|===
// TRANSLATION MISSING
+2 -1
View File
@@ -33,8 +33,9 @@
*-h*, *--help*::
Wyświetla pomoc.
// TRANSLATION MISSING
*-i*, *--build-info*::
Wyświetla informację o kompilacji.
Display build information and exit.
*-l*, *--license*::
Wyświetla licencję.
+1 -1
View File
@@ -101,7 +101,7 @@ $HOME/.local/share/weechat/weechat.log::
WeeChat jest tworzony przez Sébastien Helleu i społeczność (pełna lista dostępna
jest w pliku AUTHORS.md).
Copyright (C) 2003-2025 {author}
Copyright (C) 2003-2024 {author}
WeeChat is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
+13 -10
View File
@@ -930,11 +930,13 @@ Pasek _status_ posiada następujące domyślne elementy:
| buffer_nicklist_count | `4` | Ilość nicków wyświetlanych na liście nicków.
| buffer_zoom | ! | `!` oznacza, że połączony bufor jest przybliżony (tylko ten jest wyświetlany), pusta wartość oznacza, że wszystkie połączone bufory są wyświetlane.
| buffer_filter | `+*+` | Wskaźnik filtrowania: `+*+` oznacza, że niektóre linie zostały odfiltrowywane (ukryte), pusta wartość oznacza, że wszystkie linie są wyświetlane.
| mouse_status | `M` | Status obsługi myszy (pusty jeśli obsługa myszy jest wyłączona), zobacz <<command_weechat_mouse,/mouse>> i <<key_bindings_toggle_keys,Włącz/wyłącz>>.
// TRANSLATION MISSING
| mouse_status | `M` | Mouse status (empty if mouse is disabled), see command <<command_weechat_mouse,/mouse>> and <<key_bindings_toggle_keys,Włącz/wyłącz>>.
| scroll | `-Więcej(50)-` | Wskaźnik przewijania, z numerem linii poniżej ostatniej wyświetlanej.
| lag | `Lag: 2.5` | Wskaźnik opóźnienia, w sekundach (ukryty dla niskich opóźnień).
| hotlist | `H: 3:#abc(2,5), 5` | Lista buforów z aktywnością (nieprzeczytane wiadomości) (w przykładzie, 2 podświetlenia i 5 nieprzeczytanych wiadomości w _#abc_, jedna wiadomość w buforze #5).
| typing | `Typing: bob, (alice)` | Powiadomienia o pisaniu, zobacz <<typing_notifications,Powiadomienia o pisaniu>>.
// TRANSLATION MISSING
| typing | `Typing: bob, (alice)` | Typing notification, see <<typing_notifications,Powiadomienia o pisaniu>>.
| completion | `abc(2) def(5)` | Lista słów do dopełnienia, z ilością możliwych dopełnień dla każdego słowa.
|===
@@ -997,7 +999,8 @@ Inne dostępne elementy (nie używane domyślnie w paskach):
| irc_nick_host | `+Flashy!user@host.com+` | Aktualny nick i host IRC.
| irc_nick_modes | `i` | Atrybuty IRC dla własnego nicka.
| irc_nick_prefix | `@` | Prefiks nicku na kanale IRC.
| spacer | | Specjalny element używany do wyrównania tekstu na paskach, zobacz <<item_spacer,Odstęp>>.
// TRANSLATION MISSING
| spacer | | Special item used to align text in bars, see <<item_spacer,Odstęp>>.
| spell_dict | `fr,en` | Słowniki używane w obecnym buforze.
| spell_suggest | `print,prone,prune` | Sugestie dla słowa pod kursorem (jeśli zawiera błąd).
| tls_version | `TLS1.3` | Wersja TLS używana przez obecny serwer IRC.
@@ -1761,12 +1764,11 @@ Można je zmienić oraz dodać nowe za pomocą komendy <<command_weechat_key,/ke
[width="100%",cols="^.^3,.^8,.^5",options="header"]
|===
| Skrót | Opis | Komenda
| kbd:[Alt+m] | Włącz/wyłącz obsługę myszy. | `+/mouse toggle+`
| kbd:[Alt+s] | Włącz/wyłącz sprawdzenie pisowni. | `+/mute spell toggle+`
| kbd:[Alt+=] | Włącz/wyłącz filtry. | `+/filter toggle+`
| kbd:[Alt+-] | Włącz/wyłącz filtry w bieżącym buforze. | `+/filter toggle @+`
| kbd:[Alt+Ctrl+l] (`L`) | Przełącz między lokalnymi komendami a zdalnym buforem (relay "api"). | `+/remote togglecmd+`
| Skrót | Opis | Komenda
| kbd:[Alt+m] | Włącz/wyłącz obsługę myszy. | `+/mouse toggle+`
| kbd:[Alt+s] | Włącz/wyłącz sprawdzenie pisowni. | `+/mute spell toggle+`
| kbd:[Alt+=] | Włącz/wyłącz filtry. | `+/filter toggle+`
| kbd:[Alt+-] | Włącz/wyłącz filtry w bieżącym buforze. | `+/filter toggle @+`
|===
[[key_bindings_search_context]]
@@ -3432,7 +3434,8 @@ Na przykład w celu połączenia się do https://libera.chat/[libera.chat ^↗^
----
[NOTE]
Domyślny port to 6697 i TLS (szyfrowanie ruchu) jest włączone.
// TRANSLATION MISSING
Default port is 6697 and TLS (encrypted traffic) is enabled.
Możesz powiedzieć WeeChat, aby automatycznie łączył się z tym serwerem po
uruchomieniu:
+1 -1
View File
@@ -99,7 +99,7 @@ $HOME/.local/share/weechat/weechat.log::
WeeChat написан Sébastien Helleu и другими участниками (полный список находится
в файле AUTHORS.md).
Copyright (C) 2003-2025 {author}
Copyright (C) 2003-2024 {author}
WeeChat is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
+2 -1
View File
@@ -20,8 +20,9 @@
*-h*, *--help*::
Приказује помоћ.
// TRANSLATION MISSING
*-i*, *--build-info*::
Приказује информације о изградњи и прекида извршавање.
Display build information and exit.
*-l*, *--license*::
Приказује лиценцу програма WeeChat.
+1 -1
View File
@@ -97,7 +97,7 @@ $HOME/.config/weechat/weechat.log::
// tag::copyright[]
Програм WeeChat је написао Себастијен Елеу и људи који су дали свој допринос (комплетна листа се налази у фајлу AUTHORS.md).
Ауторска права (C) 2003-2025 {author}
Ауторска права (C) 2003-2024 {author}
WeeChat је слободни софтвер; можете га редистрибуирати и/или изменити под условима ГНУ Опште Јавне Лиценце коју је објавила Free Software Foundation; или верзије 3 Лиценце, или (по вашој жељи) било којој каснијој верзији.
+2 -2
View File
@@ -6,7 +6,7 @@ include::includes/attributes-sr.adoc[]
Превод:
* Иван Пешић (<ivan.pesic@gmail.com>), 2025.
* Иван Пешић (<ivan.pesic@gmail.com>), 2021.
Ово упутство описује WeeChat чет клијент и део је програма WeeChat.
@@ -576,7 +576,7 @@ WeeChat „језгро” се налази у следећим директо
/*
* weechat.c - core functions for WeeChat
*
* Copyright (C) 2025 Your Name <your@email.com>
* Copyright (C) 2024 Your Name <your@email.com>
*
* This file is part of WeeChat, the extensible chat client.
*
+1 -1
View File
@@ -6,7 +6,7 @@ include::includes/attributes-sr.adoc[]
Превод:
* Иван Пешић (<ivan.pesic@gmail.com>), 2025.
* Иван Пешић (<ivan.pesic@gmail.com>), 2021.
[[general]]
== Опште
+5 -88
View File
@@ -6,7 +6,7 @@ include::includes/attributes-sr.adoc[]
Превод:
* Иван Пешић (<ivan.pesic@gmail.com>), 2025.
* Иван Пешић (<ivan.pesic@gmail.com>), 2021.
Ово упутство описује WeeChat чет клијент и део је програма WeeChat.
@@ -4624,7 +4624,7 @@ weechat_printf (NULL, "date: %s",
==== util_strftimeval
_WeeChat ≥ 4.2.0, ажурирано у 4.3.0, 4.6.4._
_WeeChat ≥ 4.2.0, ажурирано у 4.3.0._
Форматира датум и време као функција `strftime` из C библиотеке, користећи `struct timeval`
као улаз уз подршку за додатне спецификаторе.
@@ -4641,9 +4641,6 @@ int weechat_util_strftimeval (char *string, int max, const char *format, struct
* _string_: бафер у који се смешта форматирани стринг
* _max_: величина стринга
* _format_: формат, исто као за _strftime_ функцију, са следећим додатним спецификаторима:
// TRANSLATION MISSING
** `%@`: return the date expressed in Coordinated Universal Time (UTC)
instead of date relative to the user's specified timezone _(WeeChat ≥ 4.7.0)_
** `%.N` где је `N` између 1 и 6: микросекунде допуњене нулама на N цифара
(на пример `%.3` за милисекунде)
** `%f`: алијас за `%.6`
@@ -4660,8 +4657,8 @@ C пример:
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%@%FT%T.%fZ", &tv);
/* резултат: 2023-12-26T18:10:04.460509Z */
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* резултат: 2023-12-26T18:10:04.460509 */
----
[NOTE]
@@ -10705,12 +10702,6 @@ _WeeChat ≥ 4.1.0._
URL трансфер.
// TRANSLATION MISSING
This function is similar to <<_hook_process,hook_process>> and
<<_hook_process_hashtable,hook_process_hashtable>> with command "url:..."
but it uses a thread instead of new process, making it more lightweight
and thus recommended for this usage.
Прототип:
[source,c]
@@ -13630,11 +13621,6 @@ void weechat_hook_set (struct t_hook *hook, const char *property,
| Име под додатка (обично је то име скрипте које се приказује у
`/help команда` за куку типа _command_).
// TRANSLATION MISSING
| keep_spaces_right | 4.6.0 | _command_, _command_run_
| "0" or "1"
| Keep trailing spaces in command arguments when it is executed.
| stdin | 0.4.3 | _process_, _process_hashtable_ | било који стринг
| Шаље податке на стандардни улаз (_stdin_) дете процеса.
@@ -15107,9 +15093,7 @@ void weechat_window_set_title (const char *title);
Аргументи:
* _title_: нови наслов за терминал; стринг се израчунава, тако да је могуће
коришћење променљивих као што је `${info:version}`
(погледајте <<_string_eval_expression,string_eval_expression>>)
* _title_: нови наслов за терминал (NULL ако желите да ресетујете наслов); стринг се израчунава, тако да је могуће коришћење променљивих као што је `${info:version}` (погледајте <<_string_eval_expression,string_eval_expression>>)
C пример:
@@ -16640,73 +16624,6 @@ def my_completion_cb(data: str, completion_item: str, buffer: str, completion: s
return weechat.WEECHAT_RC_OK
----
==== completion_set
_WeeChat ≥ 4.6.0._
// TRANSLATION MISSING
Set a completion property.
Прототип:
[source,c]
----
void weechat_completion_get_string (struct t_gui_completion *completion,
const char *property,
const char *value);
----
Аргументи:
* _completion_: показивач на довршавање
* _property_: име особине (погледајте табелу испод)
* _value_: нова вредност за особину
Особине:
[width="100%",cols="^2,^1,4,8",options="header"]
|===
| Име | Мин WeeChat | Вредност | Опис
// TRANSLATION MISSING
| add_space | 4.6.0 | "0" or "1"
| "0": do not add space after completion +
"1": add space after completion (default).
|===
C пример:
[source,c]
----
int
my_completion_cb (const void *pointer, void *data, const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
/* do not add space after completion */
weechat_completion_set (completion, "add_space", "0");
/* ... */
return WEECHAT_RC_OK;
}
----
Скрипта (Python):
[source,python]
----
# прототип
def completion_set(completion: str, property: str, value: str) -> int: ...
# пример
def my_completion_cb(data: str, completion_item: str, buffer: str, completion: str) -> int:
# do not add space after completion
weechat.completion_set(completion, "add_space", "0")
# ...
return weechat.WEECHAT_RC_OK
----
==== completion_list_add
_WeeChat ≥ 2.9._
+1 -1
View File
@@ -6,7 +6,7 @@ include::includes/attributes-sr.adoc[]
Превод:
* Иван Пешић (<ivan.pesic@gmail.com>), 2025.
* Иван Пешић (<ivan.pesic@gmail.com>), 2021.
[[start]]
== Покретање програма WeeChat
+1 -1
View File
@@ -6,7 +6,7 @@ include::includes/attributes-sr.adoc[]
Превод:
* Иван Пешић (<ivan.pesic@gmail.com>), 2025.
* Иван Пешић (<ivan.pesic@gmail.com>), 2021.
[[introduction]]
== Увод
+1 -1
View File
@@ -6,7 +6,7 @@ include::includes/attributes-sr.adoc[]
Превод:
* Иван Пешић (<ivan.pesic@gmail.com>), 2025.
* Иван Пешић (<ivan.pesic@gmail.com>), 2021.
Ово упутство описује WeeChat чет клијент и део је програма WeeChat.
+6 -8
View File
@@ -6,7 +6,7 @@ include::includes/attributes-sr.adoc[]
Превод:
* Иван Пешић (<ivan.pesic@gmail.com>), 2025.
* Иван Пешић (<ivan.pesic@gmail.com>), 2021.
Ово упутство описује WeeChat чет клијент и део је програма WeeChat.
@@ -1671,13 +1671,11 @@ WeeChat нуди доста подразумеваних тастерских п
[width="100%", cols="^.^3,.^8,.^5", options="header"]
|===
| Тастер | Опис | Команда
| kbd:[Alt+m] | Пребацивање активности миша. | `+/mouse toggle+`
| kbd:[Alt+s] | Пребацује стање активности модула за проверу правописа. | `+/mute spell toggle+`
| kbd:[Alt+=] | Пребацивање активности филтера. | `+/filter toggle+`
| kbd:[Alt+-] | Пребацивање активности филтера у текућем баферу. | `+/filter toggle @+`
// TRANSLATION MISSING
| kbd:[Alt+Ctrl+l] (`L`) | Toggle between remote and local commands on a remote buffer (relay "api"). | `+/remote togglecmd+`
| Тастер | Опис | Команда
| kbd:[Alt+m] | Пребацивање активности миша. | `+/mouse toggle+`
| kbd:[Alt+s] | Пребацује стање активности модула за проверу правописа. | `+/mute spell toggle+`
| kbd:[Alt+=] | Пребацивање активности филтера. | `+/filter toggle+`
| kbd:[Alt+-] | Пребацивање активности филтера у текућем баферу. | `+/filter toggle @+`
|===
[[key_bindings_search_context]]
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
+3 -2
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat, the extensible chat client.
#
@@ -79,7 +79,8 @@ foreach(pofile ${PO_FILES})
add_custom_command(
OUTPUT "${mofile}"
COMMAND "${MSGMERGE_EXECUTABLE}" ARGS --quiet -o "${CMAKE_CURRENT_BINARY_DIR}/${pofile}" "${CMAKE_CURRENT_SOURCE_DIR}/${pofile}" ${POT_FILE_PATH}
COMMAND "${MSGFMT_EXECUTABLE}" ARGS -c --statistics --verbose -o "${mofile}" "${CMAKE_CURRENT_BINARY_DIR}/${pofile}"
COMMAND "${MSGFMT_EXECUTABLE}" ARGS -o "${mofile}" "${CMAKE_CURRENT_BINARY_DIR}/${pofile}"
COMMAND "${MSGFMT_EXECUTABLE}" ARGS -c --statistics --verbose --output-file=/dev/null "${CMAKE_CURRENT_BINARY_DIR}/${pofile}"
DEPENDS "${POT_FILE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/${pofile}"
COMMENT "Compiling ${polang}.po"
)
+225 -415
View File
File diff suppressed because it is too large Load Diff
+356 -582
View File
File diff suppressed because it is too large Load Diff
+223 -413
View File
File diff suppressed because it is too large Load Diff
+372 -601
View File
File diff suppressed because it is too large Load Diff
+193 -370
View File
File diff suppressed because it is too large Load Diff
+253 -444
View File
File diff suppressed because it is too large Load Diff
+354 -561
View File
File diff suppressed because it is too large Load Diff
+373 -595
View File
File diff suppressed because it is too large Load Diff
+280 -473
View File
File diff suppressed because it is too large Load Diff
+203 -387
View File
File diff suppressed because it is too large Load Diff
+191 -368
View File
File diff suppressed because it is too large Load Diff
+395 -605
View File
File diff suppressed because it is too large Load Diff
+634 -803
View File
File diff suppressed because it is too large Load Diff
+191 -352
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2007-2008 Julien Louis <ptitlouis@sysif.net>
# Copyright (C) 2008-2009 Emmanuel Bouthenot <kolter@openics.org>
#
+1 -1
View File
@@ -1,5 +1,5 @@
#
# Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
# Copyright (C) 2008 Julien Louis <ptitlouis@sysif.net>
# Copyright (C) 2009 Emmanuel Bouthenot <kolter@openics.org>
#
+1 -1
View File
@@ -1,7 +1,7 @@
/*
* core-arraylist.c - array lists management
*
* Copyright (C) 2014-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2014-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2014-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
+2 -2
View File
@@ -1,7 +1,7 @@
/*
* core-backtrace.c - backtrace after a segfault
*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -149,7 +149,7 @@ weechat_backtrace_addr2line (int number, void *address, const char *symbol)
*/
void
weechat_backtrace (void)
weechat_backtrace ()
{
#ifdef HAVE_BACKTRACE
void *trace[BACKTRACE_MAX];
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -22,6 +22,6 @@
#define BACKTRACE_MAX 128
extern void weechat_backtrace (void);
extern void weechat_backtrace ();
#endif /* WEECHAT_BACKTRACE_H */
+3 -3
View File
@@ -1,7 +1,7 @@
/*
* core-calc.c - calculate result of an expression
*
* Copyright (C) 2019-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2019-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -336,9 +336,9 @@ calc_expression (const char *expr)
struct t_arraylist *list_values, *list_ops;
const char *ptr_expr, *ptr_expr2;
char str_result[64], *ptr_operator, *operator;
int index_op;
int index_op, decimals;
enum t_calc_symbol last_symbol;
double value, factor, decimals, *ptr_value;
double value, factor, *ptr_value;
list_values = NULL;
list_ops = NULL;
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2019-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
+114 -453
View File
@@ -1,7 +1,7 @@
/*
* core-command.c - WeeChat core commands
*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2005-2006 Emmanuel Bouthenot <kolter@openics.org>
*
* This file is part of WeeChat, the extensible chat client.
@@ -1841,7 +1841,7 @@ COMMAND_CALLBACK(color)
COMMAND_CALLBACK(command)
{
int index_args, any_plugin;
int length, index_args, any_plugin;
char *command, **commands, **ptr_command;
struct t_weechat_plugin *ptr_plugin;
struct t_gui_buffer *ptr_buffer;
@@ -1912,8 +1912,11 @@ COMMAND_CALLBACK(command)
}
else
{
if (string_asprintf (&command, "/%s", argv_eol[index_args + 1]) >= 0)
length = strlen (argv_eol[index_args + 1]) + 2;
command = malloc (length);
if (command)
{
snprintf (command, length, "/%s", argv_eol[index_args + 1]);
(void) input_exec_command (ptr_buffer, any_plugin, ptr_plugin,
command, NULL);
free (command);
@@ -2035,7 +2038,7 @@ COMMAND_CALLBACK(debug)
struct t_weechat_plugin *ptr_plugin;
struct timeval time_start, time_end;
char *result, *str_threshold;
unsigned long long threshold;
long long threshold;
int debug;
/* make C compiler happy */
@@ -2073,8 +2076,7 @@ COMMAND_CALLBACK(debug)
if (string_strcmp (argv[1], "callbacks") == 0)
{
COMMAND_MIN_ARGS(3, argv[1]);
if (!util_parse_delay (argv[2], 1, &threshold))
COMMAND_ERROR;
threshold = util_parse_delay (argv[2], 1);
if (threshold > 0)
{
str_threshold = util_get_microseconds_string (threshold);
@@ -2292,13 +2294,6 @@ COMMAND_CALLBACK(debug)
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "whitespace") == 0)
{
gui_chat_whitespace_mode ^= 1;
gui_window_ask_refresh (1);
return WEECHAT_RC_OK;
}
COMMAND_ERROR;
}
@@ -3058,7 +3053,7 @@ command_help_list_commands (int verbose)
*/
const char *
command_help_option_color_values (void)
command_help_option_color_values ()
{
return _("a WeeChat color name (default, black, "
"(dark)gray, white, (light)red, (light)green, "
@@ -3084,8 +3079,8 @@ COMMAND_CALLBACK(help)
struct t_weechat_plugin *ptr_plugin;
struct t_config_option *ptr_option;
int i, length, command_found, first_line_displayed, verbose;
char *string, *ptr_string, **string_values, *pos_double_pipe, *pos_end;
char *args_desc, empty_string[1] = { '\0' }, str_format[64];
char *string, *ptr_string, *pos_double_pipe, *pos_end, *args_desc;
char empty_string[1] = { '\0' }, str_format[64];
/* make C compiler happy */
(void) pointer;
@@ -3375,53 +3370,63 @@ COMMAND_CALLBACK(help)
}
break;
case CONFIG_OPTION_TYPE_ENUM:
string_values = string_dyn_alloc (256);
if (string_values)
length = 0;
i = 0;
while (ptr_option->string_values[i])
{
i = 0;
while (ptr_option->string_values[i])
{
string_dyn_concat (string_values, "\"", -1);
string_dyn_concat (string_values,
ptr_option->string_values[i], -1);
string_dyn_concat (string_values, "\"", -1);
if (ptr_option->string_values[i + 1])
string_dyn_concat (string_values, ", ", -1);
i++;
}
gui_chat_printf (NULL, " %s: %s", _("type"), _("enum"));
gui_chat_printf (NULL, " %s: %s", _("values"), *string_values);
if (ptr_option->default_value)
{
gui_chat_printf (
NULL, " %s: \"%s\"",
_("default value"),
ptr_option->string_values[CONFIG_ENUM_DEFAULT(ptr_option)]);
}
else
length += strlen (ptr_option->string_values[i]) + 5;
i++;
}
if (length > 0)
{
string = malloc (length);
if (string)
{
string[0] = '\0';
i = 0;
while (ptr_option->string_values[i])
{
strcat (string, "\"");
strcat (string, ptr_option->string_values[i]);
strcat (string, "\"");
if (ptr_option->string_values[i + 1])
strcat (string, ", ");
i++;
}
gui_chat_printf (NULL, " %s: %s",
_("default value"),
_("(undefined)"));
_("type"), _("enum"));
gui_chat_printf (NULL, " %s: %s",
_("values"), string);
if (ptr_option->default_value)
{
gui_chat_printf (NULL, " %s: \"%s\"",
_("default value"),
ptr_option->string_values[CONFIG_ENUM_DEFAULT(ptr_option)]);
}
else
{
gui_chat_printf (NULL, " %s: %s",
_("default value"),
_("(undefined)"));
}
if (ptr_option->value)
{
gui_chat_printf (NULL,
" %s: \"%s%s%s\"",
_("current value"),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
ptr_option->string_values[CONFIG_ENUM(ptr_option)],
GUI_COLOR(GUI_COLOR_CHAT));
}
else
{
gui_chat_printf (NULL,
" %s: %s",
_("current value"),
_("(undefined)"));
}
free (string);
}
if (ptr_option->value)
{
gui_chat_printf (
NULL,
" %s: \"%s%s%s\"",
_("current value"),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
ptr_option->string_values[CONFIG_ENUM(ptr_option)],
GUI_COLOR(GUI_COLOR_CHAT));
}
else
{
gui_chat_printf (NULL,
" %s: %s",
_("current value"),
_("(undefined)"));
}
string_dyn_free (string_values, 1);
}
break;
case CONFIG_NUM_OPTION_TYPES:
@@ -4869,7 +4874,7 @@ COMMAND_CALLBACK(mouse)
COMMAND_CALLBACK(mute)
{
int mute_mode, gui_chat_mute_old;
int length, mute_mode, gui_chat_mute_old;
char *command, *ptr_command;
struct t_gui_buffer *mute_buffer, *ptr_buffer, *gui_chat_mute_buffer_old;
@@ -4934,8 +4939,11 @@ COMMAND_CALLBACK(mute)
}
else
{
if (string_asprintf (&command, "/%s", ptr_command) >= 0)
length = strlen (ptr_command) + 2;
command = malloc (length);
if (command)
{
snprintf (command, length, "/%s", ptr_command);
(void) input_exec_command (buffer, 1, NULL, command, NULL);
free (command);
}
@@ -4951,260 +4959,6 @@ COMMAND_CALLBACK(mute)
return WEECHAT_RC_OK;
}
/*
* Opens a file in write mode to redirect messages.
*
* Returns a pointer to the file, NULL if error.
*/
FILE *
command_pipe_open_file (const char *filename)
{
char *filename2;
FILE *file;
filename2 = string_expand_home (filename);
if (!filename2)
return NULL;
file = fopen (filename2, "w");
if (!file)
return NULL;
fchmod (fileno (file), 0600);
free (filename2);
return file;
}
/*
* Callback for command "/pipe": redirect command output to a buffer or a file
*/
COMMAND_CALLBACK(pipe)
{
const char *ptr_command, *ptr_filename, *ptr_hsignal;
const char *ptr_concat_separator, *ptr_strip_chars;
char *command, space[2] = " ", newline[2] = "\n";
int i, index_command, skip_empty_lines, send_to_buffer, no_locale;
int pipe_set, color, color_set;
struct t_gui_buffer *ptr_buffer;
/* make C compiler happy */
(void) pointer;
(void) data;
if (argc < 2)
{
/* silently ignore missing arguments ("/pipe" does nothing) */
return WEECHAT_RC_OK;
}
index_command = 1;
send_to_buffer = 0;
no_locale = 0;
ptr_concat_separator = NULL;
ptr_strip_chars = NULL;
skip_empty_lines = 0;
ptr_buffer = NULL;
ptr_filename = NULL;
ptr_hsignal = NULL;
ptr_command = NULL;
color = GUI_CHAT_PIPE_COLOR_STRIP;
color_set = 0;
for (i = 1; i < argc; i++)
{
if (string_strcmp (argv[i], "-concat") == 0)
{
COMMAND_MIN_ARGS(i + 2, argv[i]);
i++;
ptr_concat_separator = argv[i];
index_command = i + 1;
}
else if (string_strcmp (argv[i], "-strip") == 0)
{
COMMAND_MIN_ARGS(i + 2, argv[i]);
i++;
ptr_strip_chars = argv[i];
index_command = i + 1;
}
else if (string_strcmp (argv[i], "-skipempty") == 0)
{
skip_empty_lines = 1;
index_command = i + 1;
}
else if (string_strcmp (argv[i], "-c") == 0)
{
ptr_concat_separator = space;
ptr_strip_chars = space;
skip_empty_lines = 1;
index_command = i + 1;
}
else if (string_strcmp (argv[i], "-nl") == 0)
{
no_locale = 1;
index_command = i + 1;
}
else if (string_strcmp (argv[i], "-o") == 0)
{
send_to_buffer = 1;
index_command = i + 1;
}
else if (string_strcmp (argv[i], "-buffer") == 0)
{
COMMAND_MIN_ARGS(i + 2, argv[i]);
i++;
ptr_buffer = gui_buffer_search_by_full_name (argv[i]);
if (!ptr_buffer)
{
gui_chat_printf (NULL,
_("%sBuffer \"%s\" not found"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[i]);
return WEECHAT_RC_ERROR;
}
index_command = i + 1;
}
else if (string_strcmp (argv[i], "-file") == 0)
{
COMMAND_MIN_ARGS(i + 2, argv[i]);
i++;
ptr_filename = argv[i];
index_command = i + 1;
}
else if (string_strcmp (argv[i], "-hsignal") == 0)
{
COMMAND_MIN_ARGS(i + 2, argv[i]);
i++;
ptr_hsignal = argv[i];
index_command = i + 1;
}
else if (string_strcmp (argv[i], "-color") == 0)
{
COMMAND_MIN_ARGS(i + 2, argv[i]);
i++;
color = gui_chat_pipe_search_color (argv[i]);
if (color < 0)
{
gui_chat_printf (NULL,
_("%sInvalid color: \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[i]);
return WEECHAT_RC_ERROR;
}
color_set = 1;
index_command = i + 1;
}
else
break;
}
if (index_command < argc)
ptr_command = argv_eol[index_command];
if (!ptr_command || !ptr_command[0])
{
/* silently ignore missing command */
return WEECHAT_RC_OK;
}
/* for hsignal, set default concat separator to newline if not set */
if (ptr_hsignal && !ptr_concat_separator)
ptr_concat_separator = newline;
/*
* when chaining /pipe command, only the first one (surrounding) wins;
* if buffer/file is already set, ignore it and just execute the command
* with the existing redirection
*/
pipe_set = 0;
if (!gui_chat_pipe)
{
gui_chat_pipe_command = strdup (ptr_command);
if (ptr_filename)
{
gui_chat_pipe_file = command_pipe_open_file (ptr_filename);
if (!gui_chat_pipe_file)
{
gui_chat_printf (NULL,
_("%sUnable to open file \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
ptr_filename);
return WEECHAT_RC_ERROR;
}
}
else if (ptr_hsignal)
{
gui_chat_pipe_hsignal = strdup (ptr_hsignal);
if (!gui_chat_pipe_hsignal)
COMMAND_ERROR;
gui_chat_pipe_concat_tags = string_dyn_alloc (1024);
}
else
{
gui_chat_pipe_buffer = (ptr_buffer) ? ptr_buffer : buffer;
if (!gui_chat_pipe_buffer)
COMMAND_ERROR;
if (!color_set && !send_to_buffer)
color = GUI_CHAT_PIPE_COLOR_KEEP;
if (gui_chat_pipe_buffer->type != GUI_BUFFER_TYPE_FORMATTED)
{
gui_chat_printf (NULL,
_("%sCommand /pipe can only use buffers "
"with formatted content"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
gui_chat_pipe_buffer = NULL;
return WEECHAT_RC_ERROR;
}
}
gui_chat_pipe_send_to_buffer = send_to_buffer;
if (ptr_concat_separator)
{
gui_chat_pipe_concat_lines = string_dyn_alloc (1024);
gui_chat_pipe_concat_sep = string_convert_escaped_chars (
ptr_concat_separator);
}
if (ptr_strip_chars)
{
gui_chat_pipe_strip_chars = string_convert_escaped_chars (
ptr_strip_chars);
}
gui_chat_pipe_skip_empty_lines = skip_empty_lines;
if (no_locale)
setlocale (LC_ALL, "C");
gui_chat_pipe_color = color;
pipe_set = 1;
gui_chat_pipe = 1;
}
if (string_asprintf (
&command,
"%s%s",
(string_is_command_char (ptr_command)) ? "" : "/",
ptr_command) < 0)
COMMAND_ERROR;
(void) input_exec_command (
buffer,
1, /* any_plugin */
NULL, /* plugin */
command,
NULL); /* commands_allowed */
free (command);
if (pipe_set)
{
gui_chat_pipe_end ();
if (no_locale)
setlocale (LC_ALL, "");
}
return WEECHAT_RC_OK;
}
/*
* Displays a list of loaded plugins.
*/
@@ -5741,7 +5495,7 @@ COMMAND_CALLBACK(print)
*/
void
command_proxy_list (void)
command_proxy_list ()
{
struct t_proxy *ptr_proxy;
const char *ipv6_status;
@@ -6175,7 +5929,7 @@ command_repeat_timer_cb (const void *pointer, void *data, int remaining_calls)
COMMAND_CALLBACK(repeat)
{
int arg_count, count, i;
unsigned long long interval;
long long interval;
char *error;
struct t_command_repeat *cmd_repeat;
@@ -6190,8 +5944,9 @@ COMMAND_CALLBACK(repeat)
if ((argc >= 5) && (string_strcmp (argv[1], "-interval") == 0))
{
if (!util_parse_delay (argv[2], 1000000, &interval))
COMMAND_ERROR;
interval = util_parse_delay (argv[2], 1000000);
if (interval < 0)
interval = 0;
interval /= 1000;
arg_count = 3;
}
@@ -6736,7 +6491,7 @@ int
command_set_display_option_list (const char *message, const char *search,
int display_only_changed)
{
int number_found, section_displayed;
int number_found, section_displayed, length;
struct t_config_file *ptr_config;
struct t_config_section *ptr_section;
struct t_config_option *ptr_option;
@@ -6769,12 +6524,15 @@ command_set_display_option_list (const char *message, const char *search,
!config_file_option_has_changed (ptr_option))
continue;
if (string_asprintf (&option_full_name,
"%s.%s.%s",
ptr_config->name,
ptr_section->name,
ptr_option->name) >= 0)
length = strlen (ptr_config->name) + 1
+ strlen (ptr_section->name) + 1
+ strlen (ptr_option->name) + 1;
option_full_name = malloc (length);
if (option_full_name)
{
snprintf (option_full_name, length, "%s.%s.%s",
ptr_config->name, ptr_section->name,
ptr_option->name);
if ((!search) ||
(search && search[0]
&& (string_match (option_full_name, search, 1))))
@@ -7368,7 +7126,6 @@ COMMAND_CALLBACK(unset)
void
command_upgrade_display (struct t_gui_buffer *buffer,
int send_to_buffer_as_input,
int translated_string)
{
char string[1024], str_first_start[128], str_last_start[128];
@@ -7430,18 +7187,11 @@ command_upgrade_display (struct t_gui_buffer *buffer,
}
}
if (send_to_buffer_as_input)
{
(void) input_data (buffer,
string,
NULL,
0, /* split_newline */
0); /* user_data */
}
else
{
gui_chat_printf (NULL, "%s", string);
}
(void) input_data (buffer,
string,
NULL,
0, /* split_newline */
0); /* user_data */
}
/*
@@ -7468,12 +7218,12 @@ COMMAND_CALLBACK(upgrade)
{
if (string_strcmp (argv[1], "-o") == 0)
{
command_upgrade_display (buffer, 1, 0);
command_upgrade_display (buffer, 0);
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "-ol") == 0)
{
command_upgrade_display (buffer, 1, 1);
command_upgrade_display (buffer, 1);
return WEECHAT_RC_OK;
}
if (string_strcmp (argv[1], "-yes") == 0)
@@ -7784,8 +7534,7 @@ void
command_version_display (struct t_gui_buffer *buffer,
int send_to_buffer_as_input,
int translated_string,
int display_git_version,
int display_upgrades)
int display_git_version)
{
char string[1024];
@@ -7815,9 +7564,6 @@ command_version_display (struct t_gui_buffer *buffer,
version_get_compilation_time (),
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS));
}
if (display_upgrades)
command_upgrade_display (buffer, send_to_buffer_as_input, translated_string);
}
/*
@@ -7826,7 +7572,7 @@ command_version_display (struct t_gui_buffer *buffer,
COMMAND_CALLBACK(version)
{
int i, send_to_buffer_as_input, translated_string, display_upgrades;
int send_to_buffer_as_input, translated_string;
/* make C compiler happy */
(void) pointer;
@@ -7835,32 +7581,20 @@ COMMAND_CALLBACK(version)
send_to_buffer_as_input = 0;
translated_string = 0;
display_upgrades = 0;
for (i = 1; i < argc; i++)
if (argc >= 2)
{
if (string_strcmp (argv[i], "-o") == 0)
{
if (string_strcmp (argv[1], "-o") == 0)
send_to_buffer_as_input = 1;
translated_string = 0;
}
else if (string_strcmp (argv[i], "-ol") == 0)
else if (string_strcmp (argv[1], "-ol") == 0)
{
send_to_buffer_as_input = 1;
translated_string = 1;
}
else if (string_strcmp (argv[i], "-v") == 0)
{
display_upgrades = 1;
}
}
command_version_display (
buffer,
send_to_buffer_as_input,
translated_string,
1, /* display_git_version */
display_upgrades);
command_version_display (buffer, send_to_buffer_as_input,
translated_string, 1);
return WEECHAT_RC_OK;
}
@@ -7871,7 +7605,7 @@ COMMAND_CALLBACK(version)
COMMAND_CALLBACK(wait)
{
unsigned long long delay;
long long delay;
/* make C compiler happy */
(void) pointer;
@@ -7879,8 +7613,7 @@ COMMAND_CALLBACK(wait)
COMMAND_MIN_ARGS(3, "");
if (!util_parse_delay (argv[1], 1000000, &delay))
COMMAND_ERROR;
delay = util_parse_delay (argv[1], 1000000);
if (delay < 1)
COMMAND_ERROR;
@@ -8293,11 +8026,9 @@ COMMAND_CALLBACK(window)
*/
void
command_init (void)
command_init ()
{
struct t_hook *ptr_hook;
ptr_hook = hook_command (
hook_command (
NULL, "allbuf",
N_("execute a command on all buffers"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") may be translated */
@@ -8310,7 +8041,6 @@ command_init (void)
N_(" set read marker on all buffers:"),
AI(" /allbuf /buffer set unread")),
"%(commands:/)", &command_allbuf, NULL, NULL);
COMMAND_KEEP_SPACES;
hook_command (
NULL, "away",
N_("set or remove away status"),
@@ -8346,7 +8076,7 @@ command_init (void)
N_("> raw[root]: outside windows"),
N_("> raw[window]: inside windows, with optional conditions (see below)"),
N_("conditions: the conditions to display the bar (without conditions, "
"the bar is always displayed):"),
"the bar is always displayed:"),
N_("> raw[active]: on active window"),
N_("> raw[inactive]: on inactive windows"),
N_("> raw[nicklist]: on windows with nicklist"),
@@ -8560,7 +8290,7 @@ command_init (void)
* give high priority (50000) so that an alias will not take precedence
* over this command
*/
ptr_hook = hook_command (
hook_command (
NULL, "50000|command",
N_("launch explicit WeeChat or plugin command"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") may be translated */
@@ -8580,7 +8310,6 @@ command_init (void)
" || -s"
" || %(plugins_names)|" PLUGIN_CORE " %(plugins_commands:/)",
&command_command, NULL, NULL);
COMMAND_KEEP_SPACES;
hook_command (
NULL, "cursor",
N_("free movement of cursor on screen to execute actions on specific "
@@ -8632,8 +8361,7 @@ command_init (void)
" || mouse|cursor [verbose]"
" || hdata [free]"
" || time <command>"
" || unicode <string>"
" || whitespace"),
" || unicode <string>"),
CMD_ARGS_DESC(
N_("raw[list]: list plugins with debug levels"),
N_("raw[set]: set debug level for plugin"),
@@ -8675,9 +8403,6 @@ command_init (void)
"the current buffer"),
N_("raw[unicode]: display information about string and unicode chars "
"(evaluated, see /help eval)"),
N_("raw[whitespace]: toggle whitespace mode: make spaces and tabulations "
"visible in buffers and bars (see options weechat.look.whitespace_char "
"and weechat.look.tab_whitespace_char)"),
"",
N_("Examples:"),
AI(" /debug set irc 1"),
@@ -8706,10 +8431,9 @@ command_init (void)
" || url"
" || windows"
" || time %(commands:/)"
" || unicode"
" || whitespace",
" || unicode",
&command_debug, NULL, NULL);
ptr_hook = hook_command (
hook_command (
NULL, "eval",
N_("evaluate expression"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") may be translated */
@@ -8897,7 +8621,6 @@ command_init (void)
AI(" /eval -n -c abcd =- bc ==> 1")),
"-n|-s|-c|%(eval_variables)|%*",
&command_eval, NULL, NULL);
COMMAND_KEEP_SPACES;
hook_command (
NULL, "filter",
N_("filter messages in buffers, to hide/show them according to tags or "
@@ -9347,11 +9070,11 @@ command_init (void)
AI(" /mouse toggle 5")),
"enable|disable|toggle",
&command_mouse, NULL, NULL);
ptr_hook = hook_command (
hook_command (
NULL, "mute",
N_("execute a command silently"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") may be translated */
N_("[-core|-current|-buffer <name>] <command>"),
N_("[-core | -current | -buffer <name>] <command>"),
CMD_ARGS_DESC(
N_("raw[-core]: no output on WeeChat core buffer"),
N_("raw[-current]: no output on current buffer"),
@@ -9372,63 +9095,6 @@ command_init (void)
" || -buffer %(buffers_plugins_names) %(commands:/)|%*"
" || %(commands:/)|%*",
&command_mute, NULL, NULL);
COMMAND_KEEP_SPACES;
ptr_hook = hook_command (
NULL, "pipe",
N_("redirect command output to a buffer, a file or a hsignal"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") may be translated */
N_("[-buffer <name>|-file <filename>|-hsignal <name>] "
"[-color strip|keep|ansi] [-concat <separator>] "
"[-strip <chars>] [-skipempty] [-c] [-o] [-g] [-nl] <command>"),
CMD_ARGS_DESC(
N_("raw[-buffer]: display command output on this buffer"),
N_("name: full buffer name (examples: \"core.weechat\", "
"\"irc.server.libera\", \"irc.libera.#weechat\")"),
N_("raw[-file]: write command output in this file"),
N_("raw[-hsignal]: send command output as hsignal; "
"keys: \"command\", \"output\" (lines separated by separator) "
"and \"tags\" (tags of each line separated by newline)"),
N_("raw[-color]: convert colors"),
N_("raw[-o]: send command output to the buffer as input; "
"colors are stripped and commands are NOT executed "
"(used only with -buffer)"),
N_("raw[-concat]: concatenate all lines displayed using a separator; "
"chars can be escaped (example: \\x20 for space)"),
N_("raw[-strip]: strip chars from lines (beginning/end); "
"chars can be escaped (example: \\x20 for space)"),
N_("raw[-skipempty]: skip empty lines when lines are concatenated"),
N_("raw[-c]: alias for \"-concat \\x20 -strip \\x20 -skipempty\""),
N_("raw[-nl]: display messages in English during the command execution "
"(do not use the current locale)"),
N_("command: command to execute (a \"/\" is automatically added "
"if not found at beginning of command)"),
"",
N_("If no target is specified (\"-buffer\", \"-file\" or \"-hsignal\"), "
"then the command output is sent on the current buffer."),
"",
N_("Note: for commands that display messages in an asynchronous way "
"(like /exec and many IRC commands), the output will not be "
"caught by this command."),
N_("For example \"/pipe /whois nick\" will NOT redirect the answer "
"from IRC server to the current buffer."),
"",
N_("Examples:"),
N_(" write info about external libraries in a file:"),
AI(" /pipe -file /tmp/libs.txt /debug libs"),
N_(" send output of \"/debug libs\" as a single line on current channel:"),
AI(" /pipe -o -c /debug libs"),
N_(" display info about all buffers on current buffer:"),
AI(" /pipe /allbuf /eval /print ${buffer.full_name} -> "
"${buffer.number}. ${buffer.short_name} (${buffer})"),
N_(" send list of filters on current channel, in English:"),
AI(" /pipe -o -nl /filter")),
"-buffer %(buffers_plugins_names) %(commands:/)|%*"
" || -file %(filename) %(commands:/)|%*"
" || -hsignal %- %(commands:/)|%*"
" || -o %(commands:/)|%*"
" || %(commands:/)|%*",
&command_pipe, NULL, NULL);
COMMAND_KEEP_SPACES;
hook_command (
NULL, "plugin",
N_("list/load/unload plugins"),
@@ -9467,7 +9133,7 @@ command_init (void)
" || reload %(plugins_names)|* -a|-s"
" || unload %(plugins_names)",
&command_plugin, NULL, NULL);
ptr_hook = hook_command (
hook_command (
NULL, "print",
N_("display text on a buffer"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") may be translated */
@@ -9535,7 +9201,6 @@ command_init (void)
" || -stderr"
" || -beep",
&command_print, NULL, NULL);
COMMAND_KEEP_SPACES;
hook_command (
NULL, "proxy",
N_("manage proxies"),
@@ -9577,7 +9242,7 @@ command_init (void)
" || del %(proxies_names)|%*"
" || set %(proxies_names) %(proxies_options)",
&command_proxy, NULL, NULL);
ptr_hook = hook_command (
hook_command (
NULL, "quit",
N_("quit WeeChat"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") may be translated */
@@ -9594,7 +9259,6 @@ command_init (void)
"\"weechat.look.save_layout_on_exit\").")),
"",
&command_quit, NULL, NULL);
COMMAND_KEEP_SPACES;
hook_command (
NULL, "reload",
N_("reload configuration files from disk"),
@@ -9606,7 +9270,7 @@ command_init (void)
N_("Without argument, all files (WeeChat and plugins) are reloaded.")),
"%(config_files)|%*",
&command_reload, NULL, NULL);
ptr_hook = hook_command (
hook_command (
NULL, "repeat",
N_("execute a command several times"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") may be translated */
@@ -9643,7 +9307,6 @@ command_init (void)
AI(" /repeat -interval 1 6 /print ${if:${repeat_last}?Boom!:${repeat_revindex0}}")),
"%- %(commands:/)",
&command_repeat, NULL, NULL);
COMMAND_KEEP_SPACES;
hook_command (
NULL, "reset",
N_("reset config options"),
@@ -9931,18 +9594,17 @@ command_init (void)
hook_command (
NULL, "version",
N_("show WeeChat version and compilation date"),
"[-o|-ol] [-v]",
"[-o|-ol]",
CMD_ARGS_DESC(
N_("raw[-o]: send version to current buffer as input (English string)"),
N_("raw[-ol]: send version to current buffer as input (translated string)"),
N_("raw[-v]: verbose mode: display information about upgrades of WeeChat with /upgrade"),
"",
N_("The default alias /v can be used to execute this command on "
"all buffers (otherwise the irc command /version is used on irc "
"buffers).")),
"-o|-ol|-v|%*",
"-o|-ol",
&command_version, NULL, NULL);
ptr_hook = hook_command (
hook_command (
NULL, "wait",
N_("schedule a command execution in future"),
/* TRANSLATORS: only text between angle brackets (eg: "<name>") may be translated */
@@ -9971,7 +9633,6 @@ command_init (void)
N_(" /wait 2m hello")),
"%- %(commands:/)",
&command_wait, NULL, NULL);
COMMAND_KEEP_SPACES;
hook_command (
NULL, "window",
N_("manage windows"),
+4 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2005-2006 Emmanuel Bouthenot <kolter@openics.org>
*
* This file is part of WeeChat, the extensible chat client.
@@ -85,8 +85,6 @@ struct t_gui_buffer;
#define CMD_ARGS_DESC(args...) \
STR_CONCAT("\n", WEECHAT_HOOK_COMMAND_STR_FORMATTED, ##args)
#define COMMAND_KEEP_SPACES hook_set (ptr_hook, "keep_spaces_right", "1")
struct t_command_repeat
{
char *buffer_name; /* full buffer name */
@@ -96,13 +94,12 @@ struct t_command_repeat
int index; /* current index (starts at 1) */
};
extern const char *command_help_option_color_values (void);
extern const char *command_help_option_color_values ();
extern void command_version_display (struct t_gui_buffer *buffer,
int send_to_buffer_as_input,
int translated_string,
int display_git_version,
int display_upgrades);
extern void command_init (void);
int display_git_version);
extern void command_init ();
extern void command_startup (int plugins_loaded);
#endif /* WEECHAT_COMMAND_H */
+47 -23
View File
@@ -1,7 +1,7 @@
/*
* core-completion.c - completion for WeeChat commands
*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2006 Emmanuel Bouthenot <kolter@openics.org>
*
* This file is part of WeeChat, the extensible chat client.
@@ -71,12 +71,17 @@ completion_list_add_quoted_word (struct t_gui_completion *completion,
const char *word)
{
char *temp;
int length;
if (string_asprintf (&temp, "\"%s\"", word) >= 0)
{
gui_completion_list_add (completion, temp, 0, WEECHAT_LIST_POS_END);
free (temp);
}
length = 1 + strlen (word) + 1 + 1;
temp = malloc (length);
if (!temp)
return;
snprintf (temp, length, "\"%s\"", word);
gui_completion_list_add (completion, temp, 0, WEECHAT_LIST_POS_END);
free (temp);
}
/*
@@ -1216,6 +1221,7 @@ completion_list_add_config_options_cb (const void *pointer, void *data,
struct t_config_file *ptr_config;
struct t_config_section *ptr_section;
struct t_config_option *ptr_option;
int length;
char *option_full_name;
/* make C compiler happy */
@@ -1233,12 +1239,15 @@ completion_list_add_config_options_cb (const void *pointer, void *data,
for (ptr_option = ptr_section->options; ptr_option;
ptr_option = ptr_option->next_option)
{
if (string_asprintf (&option_full_name,
"%s.%s.%s",
ptr_config->name,
ptr_section->name,
ptr_option->name) >= 0)
length = strlen (ptr_config->name) + 1
+ strlen (ptr_section->name) + 1
+ strlen (ptr_option->name) + 1;
option_full_name = malloc (length);
if (option_full_name)
{
snprintf (option_full_name, length, "%s.%s.%s",
ptr_config->name, ptr_section->name,
ptr_option->name);
gui_completion_list_add (completion,
option_full_name,
0, WEECHAT_LIST_POS_SORT);
@@ -1325,6 +1334,7 @@ completion_list_add_plugins_installed_cb (const void *pointer, void *data,
struct t_gui_completion *completion)
{
char *plugin_path, *dir_name, *extra_libdir;
int length;
struct t_hashtable *options;
/* make C compiler happy */
@@ -1337,8 +1347,11 @@ completion_list_add_plugins_installed_cb (const void *pointer, void *data,
extra_libdir = getenv (WEECHAT_EXTRA_LIBDIR);
if (extra_libdir && extra_libdir[0])
{
if (string_asprintf (&dir_name, "%s/plugins", extra_libdir) >= 0)
length = strlen (extra_libdir) + 16 + 1;
dir_name = malloc (length);
if (dir_name)
{
snprintf (dir_name, length, "%s/plugins", extra_libdir);
dir_exec_on_files (dir_name, 1, 0,
&completion_list_add_plugins_installed_exec_cb,
completion);
@@ -1370,8 +1383,11 @@ completion_list_add_plugins_installed_cb (const void *pointer, void *data,
}
/* plugins in WeeChat global lib dir */
if (string_asprintf (&dir_name, "%s/plugins", WEECHAT_LIBDIR) >= 0)
length = strlen (WEECHAT_LIBDIR) + 16 + 1;
dir_name = malloc (length);
if (dir_name)
{
snprintf (dir_name, length, "%s/plugins", WEECHAT_LIBDIR);
dir_exec_on_files (dir_name, 1, 0,
&completion_list_add_plugins_installed_exec_cb,
completion);
@@ -1484,6 +1500,7 @@ completion_list_add_config_option_values_cb (const void *pointer, void *data,
char *pos_space, *option_full_name, *pos_section, *pos_option;
char *file, *section, *value_string, **ptr_value;
const char *color_name;
int length;
struct t_config_file *ptr_config;
struct t_config_section *ptr_section, *section_found;
struct t_config_option *option_found;
@@ -1570,11 +1587,12 @@ completion_list_add_config_option_values_cb (const void *pointer, void *data,
0, WEECHAT_LIST_POS_BEGINNING);
if (option_found->value)
{
if (string_asprintf (
&value_string,
"%d",
CONFIG_INTEGER(option_found)) >= 0)
length = 64;
value_string = malloc (length);
if (value_string)
{
snprintf (value_string, length,
"%d", CONFIG_INTEGER(option_found));
gui_completion_list_add (completion,
value_string,
0, WEECHAT_LIST_POS_BEGINNING);
@@ -1594,11 +1612,13 @@ completion_list_add_config_option_values_cb (const void *pointer, void *data,
0, WEECHAT_LIST_POS_BEGINNING);
if (option_found->value)
{
if (string_asprintf (
&value_string,
"\"%s\"",
CONFIG_STRING(option_found)) >= 0)
length = strlen (CONFIG_STRING(option_found)) + 2 + 1;
value_string = malloc (length);
if (value_string)
{
snprintf (value_string, length,
"\"%s\"",
CONFIG_STRING(option_found));
gui_completion_list_add (completion,
value_string,
0, WEECHAT_LIST_POS_BEGINNING);
@@ -2106,13 +2126,17 @@ completion_list_map_eval_buffer_local_variable_cb (void *data,
const void *key, const void *value)
{
char *name;
int length;
/* make C compiler happy */
(void) hashtable;
(void) value;
if (string_asprintf (&name, "${%s}", (const char *)key) >= 0)
length = strlen (key) + 3 + 1;
name = malloc (length);
if (name)
{
snprintf (name, length, "${%s}", (const char *)key);
gui_completion_list_add ((struct t_gui_completion *)data,
name, 0, WEECHAT_LIST_POS_SORT);
free (name);
@@ -2227,7 +2251,7 @@ completion_list_add_eval_variables_cb (const void *pointer, void *data,
*/
void
completion_init (void)
completion_init ()
{
hook_completion (NULL, "buffers_names", /* formerly "%b" */
N_("names of buffers"),
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -28,6 +28,6 @@ extern int completion_list_add_filename_cb (const void *pointer,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion);
extern void completion_init (void);
extern void completion_init ();
#endif /* WEECHAT_COMPLETION_H */
+101 -65
View File
@@ -1,7 +1,7 @@
/*
* core-config-file.c - configuration files/sections/options management
*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2005-2006 Emmanuel Bouthenot <kolter@openics.org>
*
* This file is part of WeeChat, the extensible chat client.
@@ -201,7 +201,8 @@ config_file_new (struct t_weechat_plugin *plugin, const char *name,
{
struct t_config_file *new_config_file;
const char *ptr_name;
int priority;
char *filename;
int priority, length;
string_get_priority_and_name (name, &priority, &ptr_name,
CONFIG_PRIORITY_DEFAULT);
@@ -224,7 +225,16 @@ config_file_new (struct t_weechat_plugin *plugin, const char *name,
free (new_config_file);
return NULL;
}
if (string_asprintf (&new_config_file->filename, "%s.conf", ptr_name) < 0)
new_config_file->filename = NULL;
length = strlen (ptr_name) + 8 + 1;
filename = malloc (length);
if (filename)
{
snprintf (filename, length, "%s.conf", ptr_name);
new_config_file->filename = strdup (filename);
free (filename);
}
if (!new_config_file->filename)
{
free (new_config_file->name);
free (new_config_file);
@@ -311,7 +321,7 @@ config_file_arraylist_cmp_config_cb (void *data,
*/
struct t_arraylist *
config_file_get_configs_by_priority (void)
config_file_get_configs_by_priority ()
{
struct t_arraylist *list;
struct t_config_file *ptr_config;
@@ -491,16 +501,23 @@ config_file_search_section (struct t_config_file *config_file,
char *
config_file_option_full_name (struct t_config_option *option)
{
int length_option;
char *option_full_name;
if (!option)
return NULL;
string_asprintf (&option_full_name,
"%s.%s.%s",
option->config_file->name,
option->section->name,
option->name);
length_option = strlen (option->config_file->name) + 1 +
strlen (option->section->name) + 1 + strlen (option->name) + 1;
option_full_name = malloc (length_option);
if (option_full_name)
{
snprintf (option_full_name, length_option,
"%s.%s.%s",
option->config_file->name,
option->section->name,
option->name);
}
return option_full_name;
}
@@ -633,7 +650,7 @@ config_file_option_insert_in_section (struct t_config_option *option)
*/
struct t_config_option *
config_file_option_malloc (void)
config_file_option_malloc ()
{
struct t_config_option *new_option;
@@ -2356,7 +2373,7 @@ config_file_option_value_to_string (struct t_config_option *option,
{
char *value;
const char *ptr_value;
int enabled;
int enabled, length;
if (!option)
return NULL;
@@ -2364,11 +2381,14 @@ config_file_option_value_to_string (struct t_config_option *option,
if ((default_value && !option->default_value)
|| (!default_value && !option->value))
{
string_asprintf (
&value,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE_NULL) : "",
"null");
length = 7 + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE_NULL) : "",
"null");
return value;
}
@@ -2377,51 +2397,66 @@ config_file_option_value_to_string (struct t_config_option *option,
case CONFIG_OPTION_TYPE_BOOLEAN:
enabled = (default_value) ?
CONFIG_BOOLEAN_DEFAULT(option) : CONFIG_BOOLEAN(option);
string_asprintf (
&value,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(enabled) ? "on" : "off");
length = 7 + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(enabled) ? "on" : "off");
return value;
case CONFIG_OPTION_TYPE_INTEGER:
string_asprintf (
&value,
"%s%d",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(default_value) ? CONFIG_INTEGER_DEFAULT(option) : CONFIG_INTEGER(option));
length = 31 + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%d",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(default_value) ? CONFIG_INTEGER_DEFAULT(option) : CONFIG_INTEGER(option));
return value;
case CONFIG_OPTION_TYPE_STRING:
ptr_value = (default_value) ? CONFIG_STRING_DEFAULT(option) : CONFIG_STRING(option);
string_asprintf (
&value,
"%s%s%s%s%s%s",
(use_colors && use_delimiters) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(use_delimiters) ? "\"" : "",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
ptr_value,
(use_colors && use_delimiters) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(use_delimiters) ? "\"" : "");
length = strlen (ptr_value) + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s%s%s%s%s",
(use_colors && use_delimiters) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(use_delimiters) ? "\"" : "",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
ptr_value,
(use_colors && use_delimiters) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(use_delimiters) ? "\"" : "");
return value;
case CONFIG_OPTION_TYPE_COLOR:
ptr_value = gui_color_get_name (
(default_value) ? CONFIG_COLOR_DEFAULT(option) : CONFIG_COLOR(option));
if (!ptr_value)
return NULL;
string_asprintf (
&value,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
ptr_value);
length = strlen (ptr_value) + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
ptr_value);
return value;
case CONFIG_OPTION_TYPE_ENUM:
ptr_value = (default_value) ?
option->string_values[CONFIG_ENUM_DEFAULT(option)] :
option->string_values[CONFIG_ENUM(option)];
string_asprintf (
&value,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
ptr_value);
option->string_values[CONFIG_ENUM(option)];
length = strlen (ptr_value) + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
ptr_value);
return value;
case CONFIG_NUM_OPTION_TYPES:
/* make C compiler happy */
@@ -3152,7 +3187,7 @@ int
config_file_write_internal (struct t_config_file *config_file,
int default_options)
{
int rc;
int filename_length, rc;
long file_perms;
char *filename, *filename2, resolved_path[PATH_MAX], *error;
struct t_config_section *ptr_section;
@@ -3162,24 +3197,25 @@ config_file_write_internal (struct t_config_file *config_file,
return WEECHAT_CONFIG_WRITE_ERROR;
/* build filename */
if (string_asprintf (&filename,
"%s%s%s",
weechat_config_dir,
DIR_SEPARATOR,
config_file->filename) < 0)
{
filename_length = strlen (weechat_config_dir) + strlen (DIR_SEPARATOR) +
strlen (config_file->filename) + 1;
filename = malloc (filename_length);
if (!filename)
return WEECHAT_CONFIG_WRITE_MEMORY_ERROR;
}
snprintf (filename, filename_length, "%s%s%s",
weechat_config_dir, DIR_SEPARATOR, config_file->filename);
/*
* build temporary filename, this temp file will be renamed to filename
* after write
*/
if (string_asprintf (&filename2, "%s.weechattmp", filename) < 0)
filename2 = malloc (filename_length + 32);
if (!filename2)
{
free (filename);
return WEECHAT_CONFIG_WRITE_MEMORY_ERROR;
}
snprintf (filename2, filename_length + 32, "%s.weechattmp", filename);
/* if filename is a symbolic link, use target as filename */
if (realpath (filename, resolved_path))
@@ -3588,7 +3624,8 @@ config_file_update_data_read (struct t_config_file *config_file,
int
config_file_read_internal (struct t_config_file *config_file, int reload)
{
int line_number, rc, length, version, warning_update_displayed;
int filename_length, line_number, rc, length, version;
int warning_update_displayed;
char *filename, *section, *option, *value;
struct t_config_section *ptr_section;
struct t_config_option *ptr_option;
@@ -3601,14 +3638,13 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
warning_update_displayed = 0;
/* build filename */
if (string_asprintf (&filename,
"%s%s%s",
weechat_config_dir,
DIR_SEPARATOR,
config_file->filename) < 0)
{
filename_length = strlen (weechat_config_dir) + strlen (DIR_SEPARATOR) +
strlen (config_file->filename) + 1;
filename = malloc (filename_length);
if (!filename)
return WEECHAT_CONFIG_READ_MEMORY_ERROR;
}
snprintf (filename, filename_length, "%s%s%s",
weechat_config_dir, DIR_SEPARATOR, config_file->filename);
/* create file with default options if it does not exist */
if (access (filename, F_OK) != 0)
@@ -4150,7 +4186,7 @@ config_file_free (struct t_config_file *config_file)
*/
void
config_file_free_all (void)
config_file_free_all ()
{
while (config_files)
{
@@ -4497,7 +4533,7 @@ config_file_add_to_infolist (struct t_infolist *infolist,
*/
void
config_file_print_log (void)
config_file_print_log ()
{
struct t_config_file *ptr_config_file;
struct t_config_section *ptr_section;
+4 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2005-2006 Emmanuel Bouthenot <kolter@openics.org>
*
* This file is part of WeeChat, the extensible chat client.
@@ -205,7 +205,7 @@ extern int config_file_set_version (struct t_config_file *config_file,
struct t_hashtable *data_read),
const void *callback_update_pointer,
void *callback_update_data);
extern struct t_arraylist *config_file_get_configs_by_priority (void);
extern struct t_arraylist *config_file_get_configs_by_priority ();
extern struct t_config_section *config_file_new_section (struct t_config_file *config_file,
const char *name,
int user_can_add_options,
@@ -340,7 +340,7 @@ extern void config_file_option_free (struct t_config_option *option,
extern void config_file_section_free_options (struct t_config_section *section);
extern void config_file_section_free (struct t_config_section *section);
extern void config_file_free (struct t_config_file *config_file);
extern void config_file_free_all (void);
extern void config_file_free_all ();
extern void config_file_free_all_plugin (struct t_weechat_plugin *plugin);
extern struct t_hdata *config_file_hdata_config_file_cb (const void *pointer,
void *data,
@@ -353,6 +353,6 @@ extern struct t_hdata *config_file_hdata_config_option_cb (const void *pointer,
const char *hdata_name);
extern int config_file_add_to_infolist (struct t_infolist *infolist,
const char *option_name);
extern void config_file_print_log (void);
extern void config_file_print_log ();
#endif /* WEECHAT_CONFIG_FILE_H */
+23 -152
View File
@@ -1,7 +1,7 @@
/*
* core-config.c - WeeChat configuration options (file weechat.conf)
*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2005-2006 Emmanuel Bouthenot <kolter@openics.org>
*
* This file is part of WeeChat, the extensible chat client.
@@ -217,10 +217,8 @@ struct t_config_option *config_look_scroll_page_percent = NULL;
struct t_config_option *config_look_search_text_not_found_alert = NULL;
struct t_config_option *config_look_separator_horizontal = NULL;
struct t_config_option *config_look_separator_vertical = NULL;
struct t_config_option *config_look_tab_whitespace_char = NULL;
struct t_config_option *config_look_tab_width = NULL;
struct t_config_option *config_look_time_format = NULL;
struct t_config_option *config_look_whitespace_char = NULL;
struct t_config_option *config_look_window_auto_zoom = NULL;
struct t_config_option *config_look_window_separator_horizontal = NULL;
struct t_config_option *config_look_window_separator_vertical = NULL;
@@ -309,7 +307,6 @@ struct t_config_option *config_completion_nick_case_sensitive = NULL;
struct t_config_option *config_completion_nick_completer = NULL;
struct t_config_option *config_completion_nick_first_only = NULL;
struct t_config_option *config_completion_nick_ignore_chars = NULL;
struct t_config_option *config_completion_nick_ignore_words = NULL;
struct t_config_option *config_completion_partial_completion_alert = NULL;
struct t_config_option *config_completion_partial_completion_command = NULL;
struct t_config_option *config_completion_partial_completion_command_arg = NULL;
@@ -364,7 +361,6 @@ int config_num_highlight_tags = 0;
char **config_plugin_extensions = NULL;
int config_num_plugin_extensions = 0;
char config_tab_spaces[TAB_MAX_WIDTH + 1];
char config_tab_spaces_whitespace[(TAB_MAX_WIDTH * 4) + 1];
struct t_config_look_word_char_item *config_word_chars_highlight = NULL;
int config_word_chars_highlight_count = 0;
struct t_config_look_word_char_item *config_word_chars_input = NULL;
@@ -376,7 +372,6 @@ char **config_eval_syntax_colors = NULL;
int config_num_eval_syntax_colors = 0;
char *config_item_time_evaluated = NULL;
char *config_buffer_time_same_evaluated = NULL;
struct t_hashtable *config_hashtable_completion_nick_ignore_words = NULL;
struct t_hashtable *config_hashtable_completion_partial_templates = NULL;
char **config_hotlist_sort_fields = NULL;
int config_num_hotlist_sort_fields = 0;
@@ -433,7 +428,7 @@ config_check_config_permissions (const void *pointer, void *data,
*/
void
config_change_save_config_layout_on_exit (void)
config_change_save_config_layout_on_exit ()
{
if (gui_init_ok && !CONFIG_BOOLEAN(config_look_save_config_on_exit)
&& (CONFIG_ENUM(config_look_save_layout_on_exit) != CONFIG_LOOK_SAVE_LAYOUT_ON_EXIT_NONE))
@@ -498,8 +493,12 @@ config_change_window_title (const void *pointer, void *data,
(void) data;
(void) option;
if (gui_init_ok)
if (gui_init_ok
|| (CONFIG_STRING(config_look_window_title)
&& CONFIG_STRING(config_look_window_title)[0]))
{
gui_window_set_title (CONFIG_STRING(config_look_window_title));
}
}
/*
@@ -762,7 +761,7 @@ config_change_buffer_time_same (const void *pointer, void *data,
*/
void
config_compute_prefix_max_length_all_buffers (void)
config_compute_prefix_max_length_all_buffers ()
{
struct t_gui_buffer *ptr_buffer;
@@ -781,7 +780,7 @@ config_compute_prefix_max_length_all_buffers (void)
*/
void
config_set_nick_colors (void)
config_set_nick_colors ()
{
if (config_nick_colors)
{
@@ -860,7 +859,7 @@ config_change_look_nick_color_force (const void *pointer, void *data,
*/
void
config_set_eval_syntax_colors (void)
config_set_eval_syntax_colors ()
{
if (config_eval_syntax_colors)
{
@@ -1312,54 +1311,20 @@ config_check_separator (const void *pointer, void *data,
}
/*
* Checks options "weechat.look.whitespace_char" and
* "weechat.look.tab_whitespace_char".
*/
int
config_check_whitespace_char (const void *pointer, void *data,
struct t_config_option *option,
const char *value)
{
/* make C compiler happy */
(void) pointer;
(void) data;
(void) option;
return ((strlen (value) <= 4) && (utf8_strlen_screen (value) == 1)) ? 1 : 0;
}
/*
* Callback for changes on options "weechat.look.tab_width" and
* "weechat.look.tab_whitespace_char".
* Callback for changes on option "weechat.look.tab_width".
*/
void
config_change_tab (const void *pointer, void *data,
struct t_config_option *option)
config_change_tab_width (const void *pointer, void *data,
struct t_config_option *option)
{
int tab_width, i;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) option;
tab_width = CONFIG_INTEGER(config_look_tab_width);
/* build a string with spaces that replace Tab char */
memset (config_tab_spaces, ' ', tab_width);
config_tab_spaces[tab_width] = '\0';
/* replaces spaces in whitespace mode */
config_tab_spaces_whitespace[0] = '\0';
strcat (config_tab_spaces_whitespace,
CONFIG_STRING(config_look_tab_whitespace_char));
for (i = 1; i < tab_width; i++)
{
strcat (config_tab_spaces_whitespace,
CONFIG_STRING(config_look_whitespace_char));
}
memset (config_tab_spaces, ' ', CONFIG_INTEGER(config_look_tab_width));
config_tab_spaces[CONFIG_INTEGER(config_look_tab_width)] = '\0';
gui_window_ask_refresh (1);
}
@@ -1418,56 +1383,6 @@ config_change_eval_syntax_colors (const void *pointer, void *data,
gui_color_buffer_display ();
}
/*
* Callback for changes on option "weechat.completion.nick_ignore_words".
*/
void
config_change_completion_nick_ignore_words (const void *pointer,
void *data,
struct t_config_option *option)
{
char **words;
int num_words, i;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) option;
if (!config_hashtable_completion_nick_ignore_words)
{
config_hashtable_completion_nick_ignore_words = hashtable_new (
32,
WEECHAT_HASHTABLE_STRING,
WEECHAT_HASHTABLE_POINTER,
NULL, NULL);
}
else
{
hashtable_remove_all (config_hashtable_completion_nick_ignore_words);
}
words = string_split (
CONFIG_STRING(config_completion_nick_ignore_words),
",",
NULL,
WEECHAT_STRING_SPLIT_STRIP_LEFT
| WEECHAT_STRING_SPLIT_STRIP_RIGHT
| WEECHAT_STRING_SPLIT_COLLAPSE_SEPS,
0,
&num_words);
if (words)
{
for (i = 0; i < num_words; i++)
{
hashtable_set (config_hashtable_completion_nick_ignore_words,
words[i], NULL);
}
string_free_split (words);
}
}
/*
* Callback for changes on option
* "weechat.completion.partial_completion_templates".
@@ -1652,7 +1567,7 @@ config_day_change_timer_cb (const void *pointer, void *data,
*/
void
config_weechat_init_after_read (void)
config_weechat_init_after_read ()
{
int context;
@@ -2007,7 +1922,7 @@ config_weechat_debug_get (const char *plugin_name)
*/
void
config_weechat_debug_set_all (void)
config_weechat_debug_set_all ()
{
struct t_config_option *ptr_option;
struct t_weechat_plugin *ptr_plugin;
@@ -3227,7 +3142,7 @@ config_weechat_key_delete_option_cb (const void *pointer, void *data,
*/
int
config_weechat_init_options (void)
config_weechat_init_options ()
{
int context;
char section_name[128];
@@ -4421,24 +4336,13 @@ config_weechat_init_options (void)
&config_check_separator, NULL, NULL,
&config_change_buffers, NULL, NULL,
NULL, NULL, NULL);
config_look_tab_whitespace_char = config_file_new_option (
weechat_config_file, weechat_config_section_look,
"tab_whitespace_char", "string",
N_("first char to display for tabulations when whitespace mode is "
"enabled with command `/debug whitespace`; width on screen must "
"be exactly one char; subsequent chars are set by option "
"weechat.look.whitespace_char"),
NULL, 0, 0, "", NULL, 0,
&config_check_whitespace_char, NULL, NULL,
&config_change_tab, NULL, NULL,
NULL, NULL, NULL);
config_look_tab_width = config_file_new_option (
weechat_config_file, weechat_config_section_look,
"tab_width", "integer",
N_("number of spaces used to display tabs in messages"),
NULL, 1, TAB_MAX_WIDTH, "1", NULL, 0,
NULL, NULL, NULL,
&config_change_tab, NULL, NULL,
&config_change_tab_width, NULL, NULL,
NULL, NULL, NULL);
config_look_time_format = config_file_new_option (
weechat_config_file, weechat_config_section_look,
@@ -4447,16 +4351,6 @@ config_weechat_init_options (void)
"messages (see man strftime for date/time specifiers)"),
NULL, 0, 0, "%a, %d %b %Y %T", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_whitespace_char = config_file_new_option (
weechat_config_file, weechat_config_section_look,
"whitespace_char", "string",
N_("char to display for spaces when whitespace mode is enabled with "
"command `/debug whitespace`; width on screen must be exactly "
"one char; see also option weechat.look.tab_whitespace_char"),
NULL, 0, 0, "·", NULL, 0,
&config_check_whitespace_char, NULL, NULL,
&config_change_buffers, NULL, NULL,
NULL, NULL, NULL);
config_look_window_auto_zoom = config_file_new_option (
weechat_config_file, weechat_config_section_look,
"window_auto_zoom", "boolean",
@@ -5222,19 +5116,6 @@ config_weechat_init_options (void)
N_("chars ignored for nick completion"),
NULL, 0, 0, "[]`_-^", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_completion_nick_ignore_words = config_file_new_option (
weechat_config_file, weechat_config_section_completion,
"nick_ignore_words", "string",
N_("comma-separated list of nicks to ignore (not completed); "
"the whole nick must be set in this option even if chars are "
"ignored in completion with option "
"weechat.completion.nick_ignore_chars; look up for nicks is with "
"exact case then lower case, so it's possible to use only lower "
"case for nicks in this option"),
NULL, 0, 0, "", NULL, 0,
NULL, NULL, NULL,
&config_change_completion_nick_ignore_words, NULL, NULL,
NULL, NULL, NULL);
config_completion_partial_completion_alert = config_file_new_option (
weechat_config_file, weechat_config_section_completion,
"partial_completion_alert", "boolean",
@@ -5588,7 +5469,7 @@ config_weechat_init_options (void)
*/
int
config_weechat_init (void)
config_weechat_init ()
{
int rc;
struct timeval tv_time;
@@ -5596,8 +5477,6 @@ config_weechat_init (void)
time_t seconds;
snprintf (config_tab_spaces, sizeof (config_tab_spaces), " ");
snprintf (config_tab_spaces_whitespace, sizeof (config_tab_spaces_whitespace),
"\u2192");
rc = config_weechat_init_options ();
@@ -5633,8 +5512,6 @@ config_weechat_init (void)
config_change_word_chars_highlight (NULL, NULL, NULL);
if (!config_word_chars_input)
config_change_word_chars_input (NULL, NULL, NULL);
if (!config_hashtable_completion_nick_ignore_words)
config_change_completion_nick_ignore_words (NULL, NULL, NULL);
if (!config_hashtable_completion_partial_templates)
config_change_completion_partial_completion_templates (NULL, NULL, NULL);
@@ -5651,7 +5528,7 @@ config_weechat_init (void)
*/
int
config_weechat_read (void)
config_weechat_read ()
{
int rc;
@@ -5674,7 +5551,7 @@ config_weechat_read (void)
*/
int
config_weechat_write (void)
config_weechat_write ()
{
return config_file_write (weechat_config_file);
}
@@ -5684,7 +5561,7 @@ config_weechat_write (void)
*/
void
config_weechat_free (void)
config_weechat_free ()
{
config_file_free (weechat_config_file);
@@ -5762,12 +5639,6 @@ config_weechat_free (void)
config_buffer_time_same_evaluated = NULL;
}
if (config_hashtable_completion_nick_ignore_words)
{
hashtable_free (config_hashtable_completion_nick_ignore_words);
config_hashtable_completion_nick_ignore_words = NULL;
}
if (config_hashtable_completion_partial_templates)
{
hashtable_free (config_hashtable_completion_partial_templates);
+7 -12
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2005-2006 Emmanuel Bouthenot <kolter@openics.org>
*
* This file is part of WeeChat, the extensible chat client.
@@ -273,10 +273,8 @@ extern struct t_config_option *config_look_scroll_page_percent;
extern struct t_config_option *config_look_search_text_not_found_alert;
extern struct t_config_option *config_look_separator_horizontal;
extern struct t_config_option *config_look_separator_vertical;
extern struct t_config_option *config_look_tab_whitespace_char;
extern struct t_config_option *config_look_tab_width;
extern struct t_config_option *config_look_time_format;
extern struct t_config_option *config_look_whitespace_char;
extern struct t_config_option *config_look_window_auto_zoom;
extern struct t_config_option *config_look_window_separator_horizontal;
extern struct t_config_option *config_look_window_separator_vertical;
@@ -358,7 +356,6 @@ extern struct t_config_option *config_completion_nick_case_sensitive;
extern struct t_config_option *config_completion_nick_completer;
extern struct t_config_option *config_completion_nick_first_only;
extern struct t_config_option *config_completion_nick_ignore_chars;
extern struct t_config_option *config_completion_nick_ignore_words;
extern struct t_config_option *config_completion_partial_completion_alert;
extern struct t_config_option *config_completion_partial_completion_command;
extern struct t_config_option *config_completion_partial_completion_command_arg;
@@ -400,7 +397,6 @@ extern int config_num_highlight_tags;
extern char **config_plugin_extensions;
extern int config_num_plugin_extensions;
extern char config_tab_spaces[];
extern char config_tab_spaces_whitespace[];
extern struct t_config_look_word_char_item *config_word_chars_highlight;
extern int config_word_chars_highlight_count;
extern struct t_config_look_word_char_item *config_word_chars_input;
@@ -411,25 +407,24 @@ extern struct t_hashtable *config_hashtable_nick_color_force;
extern char **config_eval_syntax_colors;
extern int config_num_eval_syntax_colors;
extern char *config_buffer_time_same_evaluated;
extern struct t_hashtable *config_hashtable_completion_nick_ignore_words;
extern struct t_hashtable *config_hashtable_completion_partial_templates;
extern char **config_hotlist_sort_fields;
extern int config_num_hotlist_sort_fields;
extern void config_set_nick_colors (void);
extern void config_set_nick_colors ();
extern struct t_config_option *config_weechat_debug_get (const char *plugin_name);
extern int config_weechat_debug_set (const char *plugin_name,
const char *value);
extern void config_weechat_debug_set_all (void);
extern void config_weechat_debug_set_all ();
extern int config_weechat_buffer_set (struct t_gui_buffer *buffer,
const char *property, const char *value);
extern int config_weechat_notify_set (struct t_gui_buffer *buffer,
const char *notify);
extern void config_get_item_time (char *text_time, int max_length);
extern int config_weechat_get_key_context (struct t_config_section *section);
extern int config_weechat_init (void);
extern int config_weechat_read (void);
extern int config_weechat_write (void);
extern void config_weechat_free (void);
extern int config_weechat_init ();
extern int config_weechat_read ();
extern int config_weechat_write ();
extern void config_weechat_free ();
#endif /* WEECHAT_CONFIG_H */
+11 -18
View File
@@ -1,7 +1,7 @@
/*
* core-crypto.c - cryptographic functions
*
* Copyright (C) 2018-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2018-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -34,18 +34,10 @@
/* Bring in htobe64 */
#ifdef __ANDROID__
#define _BSD_SOURCE
#define BE_INT64 htobe64
#include <endian.h>
#elif defined(__APPLE__)
#include <libkern/OSByteOrder.h>
#define BE_INT64 OSSwapHostToBigInt64
#elif defined(HAVE_HTONLL)
#include <sys/types.h>
#include <netinet/in.h>
#include <inttypes.h>
#define BE_INT64 htonll
#else
#define BE_INT64 htobe64
#define htobe64 OSSwapHostToBigInt64
#endif
#include "weechat.h"
@@ -55,6 +47,10 @@
#include "core-string.h"
#include "../plugins/plugin.h"
#ifdef htonll
#define htobe64 htonll
#endif
char *weecrypto_hash_algo_string[] = {
"crc32",
"md5",
@@ -537,7 +533,7 @@ weecrypto_totp_generate_internal (const char *secret, int length_secret,
int rc, offset, length;
unsigned long bin_code;
moving_factor_swapped = BE_INT64 (moving_factor);
moving_factor_swapped = htobe64 (moving_factor);
rc = weecrypto_hmac (secret, length_secret,
&moving_factor_swapped, sizeof (moving_factor_swapped),
GCRY_MD_SHA1,
@@ -662,18 +658,15 @@ weecrypto_totp_validate (const char *secret_base32, time_t totp_time,
otp_ok = 0;
/*
* Compare in constant time and never break early: a non-constant
* compare and an early exit on match would let an observer measure
* how many digits of the expected OTP they got right and which
* time-window offset matched.
*/
for (i = moving_factor - window; i <= moving_factor + window; i++)
{
rc = weecrypto_totp_generate_internal (secret, length_secret,
i, digits, str_otp);
if (rc && (string_memcmp_constant_time (str_otp, otp, digits) == 0))
if (rc && (strcmp (str_otp, otp) == 0))
{
otp_ok = 1;
break;
}
}
free (secret);
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2018-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
+11 -13
View File
@@ -1,7 +1,7 @@
/*
* core-debug.c - debug functions
*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -93,7 +93,7 @@ long long debug_long_callbacks = 0; /* callbacks taking more than */
*/
void
debug_build_info (void)
debug_build_info ()
{
/* display version and compilation date/time */
string_fprintf (
@@ -343,7 +343,7 @@ debug_windows_tree_display (struct t_gui_window_tree *tree, int indent)
*/
void
debug_windows_tree (void)
debug_windows_tree ()
{
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, _("Windows tree:"));
@@ -355,7 +355,7 @@ debug_windows_tree (void)
*/
void
debug_memory (void)
debug_memory ()
{
#ifdef HAVE_MALLINFO2
struct mallinfo2 info;
@@ -501,7 +501,7 @@ debug_hdata_map_cb (void *data,
*/
void
debug_hdata (void)
debug_hdata ()
{
int count;
@@ -519,7 +519,7 @@ debug_hdata (void)
*/
void
debug_hooks (void)
debug_hooks ()
{
int i;
@@ -653,7 +653,7 @@ debug_hooks_plugin_types (const char *plugin_mask, const char **hook_types)
*/
void
debug_infolists (void)
debug_infolists ()
{
struct t_infolist *ptr_infolist;
struct t_infolist_item *ptr_item;
@@ -817,7 +817,7 @@ debug_libs_cb (const void *pointer, void *data,
*/
void
debug_directories (void)
debug_directories ()
{
char *extra_libdir, str_temp[1024];
@@ -865,9 +865,7 @@ debug_display_time_elapsed (struct timeval *time1, struct timeval *time2,
gettimeofday (&debug_timeval_end, NULL);
diff = util_timeval_diff (time1, time2);
if (diff < 0)
diff *= -1;
str_diff = util_get_microseconds_string ((unsigned long long)diff);
str_diff = util_get_microseconds_string (diff);
if (display)
{
@@ -1028,7 +1026,7 @@ debug_unicode (const char *string)
*/
void
debug_init (void)
debug_init ()
{
/*
* hook signals with high priority, to be sure they will be used before
@@ -1044,6 +1042,6 @@ debug_init (void)
*/
void
debug_end (void)
debug_end ()
{
}
+10 -10
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -26,22 +26,22 @@ struct t_gui_window_tree;
extern long long debug_long_callbacks;
extern void debug_build_info (void);
extern void debug_build_info ();
extern void debug_sigsegv_cb (int signo);
extern void debug_windows_tree (void);
extern void debug_memory (void);
extern void debug_hdata (void);
extern void debug_hooks (void);
extern void debug_windows_tree ();
extern void debug_memory ();
extern void debug_hdata ();
extern void debug_hooks ();
extern void debug_hooks_plugin_types (const char *plugin_name,
const char **hook_types);
extern void debug_infolists (void);
extern void debug_directories (void);
extern void debug_infolists ();
extern void debug_directories ();
extern void debug_display_time_elapsed (struct timeval *time1,
struct timeval *time2,
const char *message,
int display);
extern void debug_unicode (const char *string);
extern void debug_init (void);
extern void debug_end (void);
extern void debug_init ();
extern void debug_end ();
#endif /* WEECHAT_DEBUG_H */
+22 -18
View File
@@ -1,7 +1,7 @@
/*
* core-dir.c - directory/file functions
*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -64,7 +64,7 @@
*/
char *
dir_get_temp_dir (void)
dir_get_temp_dir ()
{
char *tmpdir;
struct stat buf;
@@ -109,7 +109,7 @@ int
dir_mkdir_home (const char *directory, int mode)
{
char *dir, *dir1, *dir2, *dir3, *dir4, *dir5;
int rc;
int rc, dir_length;
rc = 0;
dir = NULL;
@@ -129,8 +129,11 @@ dir_mkdir_home (const char *directory, int mode)
else
{
/* build directory in data dir by default */
if (string_asprintf (&dir, "%s/%s", weechat_data_dir, directory) < 0)
dir_length = strlen (weechat_data_dir) + strlen (directory) + 2;
dir = malloc (dir_length);
if (!dir)
goto end;
snprintf (dir, dir_length, "%s/%s", weechat_data_dir, directory);
}
dir1 = string_replace (dir, "${weechat_config_dir}", weechat_config_dir);
@@ -380,10 +383,10 @@ end:
*/
int
dir_create_home_temp_dir (void)
dir_create_home_temp_dir ()
{
char *temp_dir, *temp_home_template, *ptr_weechat_home;
int rc, add_separator;
int rc, length, add_separator;
rc = 0;
temp_dir = NULL;
@@ -393,15 +396,16 @@ dir_create_home_temp_dir (void)
if (!temp_dir || !temp_dir[0])
goto memory_error;
add_separator = (temp_dir[strlen (temp_dir) - 1] != DIR_SEPARATOR_CHAR);
if (string_asprintf (&temp_home_template,
"%s%sweechat_temp_XXXXXX",
temp_dir,
(add_separator) ? DIR_SEPARATOR : "") < 0)
{
length = strlen (temp_dir) + 32 + 1;
temp_home_template = malloc (length);
if (!temp_home_template)
goto memory_error;
}
add_separator = (temp_dir[strlen (temp_dir) - 1] != DIR_SEPARATOR_CHAR);
snprintf (temp_home_template, length,
"%s%sweechat_temp_XXXXXX",
temp_dir,
add_separator ? DIR_SEPARATOR : "");
ptr_weechat_home = mkdtemp (temp_home_template);
if (!ptr_weechat_home)
{
@@ -599,7 +603,7 @@ error:
*/
int
dir_find_home_dirs (void)
dir_find_home_dirs ()
{
char *ptr_home, *ptr_weechat_home, *config_weechat_home;
char *config_dir, *data_dir, *state_dir, *cache_dir, *runtime_dir;
@@ -738,7 +742,7 @@ dir_create_home_dir (char *path)
*/
void
dir_create_home_dirs (void)
dir_create_home_dirs ()
{
int rc;
@@ -772,7 +776,7 @@ error:
*/
void
dir_remove_home_dirs (void)
dir_remove_home_dirs ()
{
dir_rmtree (weechat_config_dir);
if (strcmp (weechat_config_dir, weechat_data_dir) != 0)
@@ -798,7 +802,7 @@ dir_remove_home_dirs (void)
*/
char *
dir_get_string_home_dirs (void)
dir_get_string_home_dirs ()
{
char *dirs[6];
+5 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2003-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2003-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -20,14 +20,14 @@
#ifndef WEECHAT_DIR_H
#define WEECHAT_DIR_H
extern char *dir_get_temp_dir (void);
extern char *dir_get_temp_dir();
extern int dir_mkdir_home (const char *directory, int mode);
extern int dir_mkdir (const char *directory, int mode);
extern int dir_mkdir_parents (const char *directory, int mode);
extern int dir_rmtree (const char *directory);
extern void dir_create_home_dirs (void);
extern void dir_remove_home_dirs (void);
extern char *dir_get_string_home_dirs (void);
extern void dir_create_home_dirs ();
extern void dir_remove_home_dirs ();
extern char *dir_get_string_home_dirs ();
extern void dir_exec_on_files (const char *directory, int recurse_subdirs,
int hidden_files,
void (*callback)(void *data,
+1 -1
View File
@@ -1,7 +1,7 @@
/*
* core-doc.c - documentation generator
*
* Copyright (C) 2023-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2023-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
+1 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2023-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
+8 -18
View File
@@ -1,7 +1,7 @@
/*
* core-eval.c - evaluate expressions with references to internal vars
*
* Copyright (C) 2012-2025 Sébastien Helleu <flashcode@flashtux.org>
* Copyright (C) 2012-2024 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -300,9 +300,6 @@ eval_string_range_chars (const char *range)
string = NULL;
result = NULL;
if (!range || !range[0])
goto end;
for (i = 0; eval_range_chars[i][0]; i++)
{
if (strcmp (range, eval_range_chars[i][0]) == 0)
@@ -312,15 +309,11 @@ eval_string_range_chars (const char *range)
char1 = utf8_char_int (range);
/* next char must be '-' */
if (!range[0])
goto end;
ptr_char = utf8_next_char (range);
if (!ptr_char || !ptr_char[0] || (ptr_char[0] != '-'))
goto end;
/* next char is the char2 */
if (!range[0])
goto end;
ptr_char = utf8_next_char (ptr_char);
if (!ptr_char || !ptr_char[0])
goto end;
@@ -901,7 +894,7 @@ eval_string_base_encode (const char *text)
ptr_string++;
length = strlen (ptr_string);
result = malloc ((length * 4) + 8 + 1);
result = malloc ((length * 4) + 1);
if (!result)
goto end;
@@ -1151,7 +1144,6 @@ char *
eval_hdata_count (const char *text, struct t_eval_context *eval_context)
{
struct t_hdata *hdata;
unsigned long ptr_value;
void *pointer;
char *pos1, *pos2, *value, *hdata_name, *pointer_name, str_count[64];
int rc, count;
@@ -1182,10 +1174,9 @@ eval_hdata_count (const char *text, struct t_eval_context *eval_context)
if (strncmp (pointer_name, "0x", 2) == 0)
{
rc = sscanf (pointer_name, "%lx", &ptr_value);
rc = sscanf (pointer_name, "%p", &pointer);
if ((rc != EOF) && (rc != 0))
{
pointer = (void *)ptr_value;
if (!hdata_check_pointer (hdata, NULL, pointer))
goto end;
}
@@ -1422,7 +1413,6 @@ eval_string_hdata (const char *text, struct t_eval_context *eval_context)
void *pointer;
struct t_hdata *hdata;
int rc;
unsigned long ptr;
value = NULL;
hdata_name = NULL;
@@ -1474,10 +1464,9 @@ eval_string_hdata (const char *text, struct t_eval_context *eval_context)
{
if (strncmp (pointer_name, "0x", 2) == 0)
{
rc = sscanf (pointer_name, "%lx", &ptr);
rc = sscanf (pointer_name, "%p", &pointer);
if ((rc != EOF) && (rc != 0))
{
pointer = (void *)ptr;
if (!hdata_check_pointer (hdata, NULL, pointer))
goto end;
}
@@ -1583,8 +1572,7 @@ eval_syntax_highlight_colorize (const char *value)
else if (ptr_value[0] == '-')
color--;
}
if (ptr_value[0])
ptr_value++;
ptr_value++;
if (config_num_eval_syntax_colors > 0)
{
string_dyn_concat (
@@ -2536,9 +2524,11 @@ eval_replace_regex (const char *string, regex_t *regex, const char *replace,
if (!string || !regex || !replace)
goto end;
result = strdup (string);
length = strlen (string) + 1;
result = malloc (length);
if (!result)
goto end;
snprintf (result, length, "%s", string);
eval_context->regex = &eval_regex;
eval_context->regex_replacement_index = 1;

Some files were not shown because too many files have changed in this diff Show More