1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: store microseconds in buffer lines (closes #649)

This commit is contained in:
Sébastien Helleu
2023-12-26 18:37:21 +01:00
parent 57f80a4c1f
commit 9fb3d3f14c
97 changed files with 3558 additions and 810 deletions
+4
View File
@@ -15,6 +15,7 @@ For a list of important changes that require manual actions, please look at rele
New features::
* core: store microseconds in buffer lines (issue #649)
* core: evaluate expressions even when the suffix is missing ("}" by default) (issue #2042, issue #1714)
* core: add syntax highlighting in evaluation of expressions with `raw_hl:string` and `hl:string`, add option weechat.color.eval_syntax_colors (issue #2042)
* core: add option `search_history` in command `/input`, add key kbd:[Ctrl+r] to search in commands history, add key context "histsearch" (issue #2040)
@@ -26,6 +27,8 @@ New features::
* core: display only version with command `/version`, add options `-o` and `-ol` in command `/upgrade`
* core: add number of processes in command `/sys waitpid`
* core, alias, trigger: allow wildcard in commands `/bar`, `/item`, `/proxy`, `/alias` and `/trigger` (issue #1956)
* api: add functions util_strftimeval, printf_datetime_tags, printf_y_datetime_tags (issue #649)
* api: add argument "date_usec" in hook_print callback (issue #649)
* api: add property "type" in function buffer_get_string
* api: add info "mouse"
* buflist: jump to previous/next buffer displayed in buflist item with ctrl+wheel up/down on a buflist item (issue #1473)
@@ -37,6 +40,7 @@ New features::
* irc: add tags "nick_xxx" and "host_xxx" in all messages, including self and server messages
* irc: add option irc.look.ignore_tag_messages (issue #989)
* relay: change default value of option relay.network.tls_priorities to `NORMAL`
* trigger: change format of variables `${tg_date}` from "%Y-%m-%d %H:%M:%S" to "%FT%T.%f" (issue #649)
* trigger: rename local variable "trigger_filter" to "filter" on monitor buffer (issue #2037)
Bug fixes::
+14
View File
@@ -14,6 +14,20 @@ For a complete list of changes, please look at ChangeLog.
[[v4.2.0]]
== Version 4.2.0 (under dev)
[[v4.2.0_lines_microseconds]]
=== Microseconds in buffer lines
Microseconds have been added in buffer lines (for both date and printed date).
Here are the changes that could affect plugins and scripts:
* hook_print: the C callback receives a new argument "date_usec" (microseconds
of date), after the argument "date" (scripting API is unchanged: the
microseconds are not available)
* trigger of types "print" and "timer": the format of variable `${tg_date}` is
changed from `%Y-%m-%d %H:%M:%S` to `%FT%T.%f` (where `%f` is the number of
microseconds on 6 digits)
[[v4.2.0_irc_anti_flood]]
=== IRC anti-flood
+2
View File
@@ -664,8 +664,10 @@ Liste der Skript API Funktionen:
color +
print (für Python: prnt) +
print_date_tags (für Python: prnt_date_tags) +
print_datetime_tags (für Python: prnt_datetime_tags) +
print_y (für Python: prnt_y) +
print_y_date_tags (für Python: prnt_y_date_tags) +
print_y_datetime_tags (für Python: prnt_y_datetime_tags) +
log_print
| Hooks
+9 -3
View File
@@ -5284,7 +5284,7 @@ Wenn _var_ nicht angegeben ist, wird die Standardvariable verwendet, sie hängt
| signal | tg_signal_data |
| hsignal | |
| modifier | tg_string | tg_string
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message
| print | tg_message |
| command | tg_argv_eol1 |
| command_run | tg_command |
@@ -5447,7 +5447,11 @@ Der Callback von "line" legt folgende Variablen in der Hashtable an:
| buffer_type | string | Buffertyp ("formatted" oder "free").
| y | string | Zeilennummer bei einem Buffer mit freier Einteilung (≥ 0), -1 für einen Buffer mit formatiertem Inhalt.
| date | string | Datum der Zeile (Zeitstempel).
// TRANSLATION MISSING
| date_usec | string | Microseconds of line date.
| date_printed | string | Datum wann die Zeile dargestellt wurde (Zeitstempel).
// TRANSLATION MISSING
| date_usec_printed | string | Microseconds of date when line was displayed.
| str_time | string | Datum für Darstellung. Kann Farbkodierungen erhalten.
| tags | string | Tags einer Nachricht (Komma wird automatisch zu Beginn und Ende den Tags hinzugefügt).
| displayed | string | "1" wenn Zeile dargestellt wird, "0" wenn Zeile gefiltert wird.
@@ -5486,7 +5490,8 @@ Der Callback von "print" legt folgende Variablen in der Hashtable an:
|===
| Variable | Typ | Beschreibung
| buffer | pointer | Buffer.
| tg_date | string | Datum/Uhrzeit der Nachricht (Format: `YYYY-MM-DD hh:mm:ss`).
// TRANSLATION MISSING
| tg_date | string | Datum/Uhrzeit der Nachricht (Format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
| tg_displayed | string | "1" wenn Nachricht dargestellt wird, "0" falls Nachricht gefiltert wird.
| tg_highlight | string | "1" falls es sich um eine Highlight-Nachricht handelt, andernfalls "0".
| tg_prefix | string | Präfix.
@@ -5551,7 +5556,8 @@ Der Callback von "timer" legt folgende Variablen in der Hashtable an:
|===
| Variable | Typ | Beschreibung
| tg_remaining_calls | string | Anzahl der noch ausstehenden Aufrufe.
| tg_date | string | aktuelles Datum und Uhrzeit (Format: `YYYY-MM-DD hh:mm:ss`).
// TRANSLATION MISSING
| tg_date | string | aktuelles Datum und Uhrzeit (Format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
|===
[[trigger_data_config]]
+207 -8
View File
@@ -4696,6 +4696,47 @@ weechat_printf (NULL, "date: %s",
[NOTE]
This function is not available in scripting API.
==== util_strftimeval
_WeeChat ≥ 4.2.0._
Format date and time like function `strftime` in C library, using `struct timeval`
as input, and supporting extra specifiers for microseconds.
Prototype:
[source,c]
----
int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv);
----
Arguments:
* _string_: buffer where the formatted string is stored
* _max_: string size
* _format_: format, the same as _strftime_ function, with these extra specifiers:
** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits
(for example `%.3` for milliseconds)
** `%f`: alias of `%.6`
Return value:
* number of bytes put in _string_ (value returned from _strftime_ function)
C example:
[source,c]
----
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* result: 2023-12-26T18:10:04.460509 */
----
[NOTE]
This function is not available in scripting API.
==== util_version_number
_WeeChat ≥ 0.3.9._
@@ -9270,13 +9311,13 @@ Prototype:
void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...);
----
This function is a shortcut for function printf_date_tags. These two calls give
exactly same result:
This function is a shortcut for function printf_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf (buffer, "message");
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
Arguments:
@@ -9338,6 +9379,15 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
const char *tags, const char *message, ...);
----
This function is a shortcut for function printf_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
Arguments:
* _buffer_: buffer pointer, if NULL, message is displayed on WeeChat buffer
@@ -9372,6 +9422,62 @@ weechat.prnt_date_tags("", time - 120, "notify_message",
[NOTE]
Function is called "print_date_tags" in scripts ("prnt_date_tags" in Python).
==== printf_datetime_tags
_WeeChat ≥ 4.2.0._
Display a message on a buffer, using a custom date/time (with microseconds)
and tags.
Prototype:
[source,c]
----
void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
Arguments:
* _buffer_: buffer pointer, if NULL, message is displayed on WeeChat buffer
* _date_: date for message (0 means current date/time)
* _date_usec_: microseconds of date (between 0 and 999999)
* _tags_: comma separated list of tags (NULL means no tags)
* _message_: message to display
See the link:weechat_user.en.html#lines_tags[WeeChat user's guide / Lines tags ^↗^^]
for a list of commonly used tags in WeeChat.
C example:
[source,c]
----
struct timeval tv_now;
gettimeofday (&tv_now, NULL);
weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec,
"notify_message",
"Message 2 minutes ago, with a tag 'notify_message'");
----
Script (Python):
[source,python]
----
# prototype
def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ...
# example
now = time.time()
time_sec = int(now)
time_usec = int((now * 1000000) % 1000000)
weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message",
"Message 2 minutes ago, with a tag 'notify_message'")
----
[NOTE]
Function is called "print_datetime_tags" in scripts ("prnt_datetime_tags" in Python).
==== printf_y
Display a message on a line of a buffer with free content.
@@ -9380,8 +9486,16 @@ Prototype:
[source,c]
----
void weechat_printf_y (struct t_gui_buffer *buffer, int y,
const char *message, ...);
void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...);
----
This function is a shortcut for function printf_y_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_y (buffer, 0, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
Arguments:
@@ -9429,6 +9543,15 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date
const char *tags, const char *message, ...);
----
This function is a shortcut for function printf_y_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
Arguments:
* _buffer_: buffer pointer
@@ -9460,6 +9583,53 @@ weechat.prnt_y_date_tags("", 2, 0, "my_tag", "My message on third line with a ta
[NOTE]
Function is called "print_y_date_tags" in scripts ("prnt_y_date_tags" in Python).
==== printf_y_datetime_tags
_WeeChat ≥ 4.2.0._
Display a message on a line of a buffer with free content, using a custom
date/time (with microseconds) and tags.
Prototype:
[source,c]
----
void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
Arguments:
* _buffer_: buffer pointer
* _y_: line number (first line is 0); a negative value adds a line after last
line displayed: absolute value of _y_ is the number of lines after last line
(for example -1 is immediately after last line, -2 is 2 lines after last line)
* _date_: date for message (0 means current date/time)
* _date_usec_: microseconds of date (between 0 and 999999)
* _tags_: comma separated list of tags (NULL means no tags)
* _message_: message to display
C example:
[source,c]
----
weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "my_tag", "My message on third line with a tag");
----
Script (Python):
[source,python]
----
# prototype
def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ...
# example
weechat.prnt_y_datetime_tags("", 2, 0, 0, "my_tag", "My message on third line with a tag")
----
[NOTE]
Function is called "print_y_datetime_tags" in scripts ("prnt_y_datetime_tags" in Python).
==== log_printf
Write a message in WeeChat log file (weechat.log).
@@ -10823,7 +10993,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
==== hook_line
_WeeChat ≥ 2.3, updated in 3.7._
_WeeChat ≥ 2.3, updated in 4.2.0._
Hook a line to be printed in a buffer.
@@ -10922,11 +11092,21 @@ Line data sent to the callback is a hashtable, with following values
| N/A ("0").
| `+1533792000+`
| date_usec
| Microseconds of line date (between 0 and 999999).
| N/A ("0").
| `+123456+`
| date_printed
| Date when line was displayed (timestamp).
| N/A ("0").
| `+1533792012+`
| date_usec_printed
| Microseconds of date when line was displayed (between 0 and 999999).
| N/A ("0").
| `+654321+`
| str_time
| Date for display (possible color codes inside).
| N/A (empty string).
@@ -11013,11 +11193,22 @@ in this hashtable):
| The date is set to this value. +
The value of `+str_time+` is updated accordingly.
| date_usec
| Integer ("0" to "999999").
| N/A.
| The microseconds of line date is set to this value. +
The value of `+str_time+` is updated accordingly.
| date_printed
| Timestamp.
| N/A.
| The printed date is set to this timestamp (not displayed).
| date_usec_printed
| Integer ("0" to "999999").
| N/A.
| The microseconds of printed date is set to this value.
| str_time
| String.
| N/A.
@@ -11098,7 +11289,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "")
==== hook_print
_Updated in 0.4.3, 1.0, 1.5._
_Updated in 0.4.3, 1.0, 1.5, 4.2.0._
Hook a message printed. It is called when a line has been added in a buffer
with formatted content.
@@ -11118,6 +11309,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer,
void *data,
struct t_gui_buffer *buffer,
time_t date,
int date_usec,
int tags_count,
const char **tags,
int displayed,
@@ -11147,6 +11339,7 @@ Arguments:
** _void *data_: pointer
** _struct t_gui_buffer *buffer_: buffer pointer
** _time_t date_: date
** _int date_usec_: microseconds of date
** _int tags_count_: number of tags for line
** _const char **tags_: array with tags for line
** _int displayed_: 1 if line is displayed, 0 if it is filtered (hidden)
@@ -11177,7 +11370,7 @@ C example:
----
int
my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, const char **tags,
time_t date, int date_usec, int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
@@ -13292,9 +13485,15 @@ Content of hashtable sent to callback (keys and values are of type "string"):
| _chat_line_date | Line date/time.
| "1313237175" | "0"
| _chat_line_date_usec | Microseconds of line date/time.
| "123456" | "0"
| _chat_line_date_printed | Line date/time ^(4)^.
| "1313237175" | "0"
| _chat_line_date_usec_printed | Microseconds of line printed date/time ^(4)^.
| "123456" | "0"
| _chat_line_time | Time displayed.
| "14:06:15" | ""
+22 -10
View File
@@ -488,7 +488,9 @@ hda:
'buffer': 'ptr',
'y': 'int',
'date': 'tim',
'date_usec': 'int',
'date_printed': 'tim',
'date_usec_printed': 'int',
'str_time': 'str',
'tags_count': 'int',
'tags_array': 'arr',
@@ -506,7 +508,9 @@ hda:
buffer: '0x558d61ea3e60'
y: -1
date: 1588404926
date_usec: 118712
date_printed: 1588404926
date_usec_printed: 118712
str_time: 'F@0025209F@0024535F@0024026'
tags_count: 0
tags_array: []
@@ -522,7 +526,9 @@ hda:
buffer: '0x558d61ea3e60'
y: -1
date: 1588404930
date_usec: 25
date_printed: 1588404930
date_usec_printed: 25
str_time: 'F@0025209F@0024535F@0024030'
tags_count: 0
tags_array: []
@@ -2050,16 +2056,18 @@ Data sent as hdata:
[width="100%",cols="3m,2,10",options="header"]
|===
| Name | Type | Description
| buffer | pointer | Buffer pointer.
| date | time | Date of message.
| date_printed | time | Date when WeeChat displayed message.
| displayed | char | 1 if message is displayed, 0 if message is filtered (hidden).
| notify_level | char | Notify level: -1 = notify disabled, 0 = low, 1 = message, 2 = private, 3 = highlight.
| highlight | char | 1 if line has a highlight, otherwise 0.
| tags_array | array of strings | List of tags for line.
| prefix | string | Prefix.
| message | string | Message.
| Name | Type | Description
| buffer | pointer | Buffer pointer.
| date | time | Date of message.
| date_usec | integer | Microseconds of date.
| date_printed | time | Date when WeeChat displayed message.
| date_usec_printed | integer | Microseconds of date when WeeChat displayed message.
| displayed | char | 1 if message is displayed, 0 if message is filtered (hidden).
| notify_level | char | Notify level: -1 = notify disabled, 0 = low, 1 = message, 2 = private, 3 = highlight.
| highlight | char | 1 if line has a highlight, otherwise 0.
| tags_array | array of strings | List of tags for line.
| prefix | string | Prefix.
| message | string | Message.
|===
Example: new message _hello!_ from nick _FlashCode_ on buffer _irc.libera.#weechat_:
@@ -2071,7 +2079,9 @@ hda:
keys: {
'buffer': 'ptr',
'date': 'tim',
'date_usec': 'int',
'date_printed': 'tim',
'date_usec_printed': 'int',
'displayed': 'chr',
'notify_level': 'chr',
'highlight': 'chr',
@@ -2084,7 +2094,9 @@ hda:
__path: ['0x4a49600']
buffer: '0x4a715d0'
date: 1362728993
date_usec: 902765
date_printed: 1362728993
date_usec_printed: 902765
displayed: 1
notify_level: 1
highlight: 0
+2
View File
@@ -649,8 +649,10 @@ List of functions in script API:
color +
print (for python: prnt) +
print_date_tags (for python: prnt_date_tags) +
print_datetime_tags (for python: prnt_datetime_tags) +
print_y (for python: prnt_y) +
print_y_date_tags (for python: prnt_y_date_tags) +
print_y_datetime_tags (for python: prnt_y_datetime_tags) +
log_print
| hooks
+5 -3
View File
@@ -5178,7 +5178,7 @@ type:
| signal | tg_signal_data |
| hsignal | |
| modifier | tg_string | tg_string
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message
| print | tg_message |
| command | tg_argv_eol1 |
| command_run | tg_command |
@@ -5337,7 +5337,9 @@ The "line" callback sets following variables in hashtable:
| buffer_type | string | Buffer type ("formatted" or "free").
| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content.
| date | string | Line date (timestamp).
| date_usec | string | Microseconds of line date.
| date_printed | string | Date when line was displayed (timestamp).
| date_usec_printed | string | Microseconds of date when line was displayed.
| str_time | string | Date for display. It may contain color codes.
| tags | string | Tags of message (with comma added at beginning/end of string).
| displayed | string | "1" if displayed, "0" if line filtered.
@@ -5376,7 +5378,7 @@ The "print" callback sets following variables in hashtable:
|===
| Variable | Type | Description
| buffer | pointer | Buffer.
| tg_date | string | Message date/time (format: `YYYY-MM-DD hh:mm:ss`).
| tg_date | string | Message date/time (format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
| tg_displayed | string | "1" if displayed, "0" if line filtered.
| tg_highlight | string | "1" if highlight, otherwise "0".
| tg_prefix | string | Prefix.
@@ -5441,7 +5443,7 @@ The "timer" callback sets following variables in hashtable:
|===
| Variable | Type | Description
| tg_remaining_calls | string | Number of remaining calls.
| tg_date | string | Current date/time (format: `YYYY-MM-DD hh:mm:ss`).
| tg_date | string | Current date/time (format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
|===
[[trigger_data_config]]
+215 -8
View File
@@ -4775,6 +4775,49 @@ weechat_printf (NULL, "date : %s",
[NOTE]
Cette fonction n'est pas disponible dans l'API script.
==== util_strftimeval
_WeeChat ≥ 4.2.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
conversion pour les microsecondes.
Prototype :
[source,c]
----
int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv);
----
Paramètres :
* _string_ : tampon où stocker la chaîne formattée
* _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 :
** `%.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`
Valeur de retour :
* nombre d'octets placés dans _string_ (valeur retournée par la fonction _strftime_).
Exemple en C :
[source,c]
----
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* résultat : 2023-12-26T18:10:04.460509 */
----
[NOTE]
Cette fonction n'est pas disponible dans l'API script.
==== util_version_number
_WeeChat ≥ 0.3.9._
@@ -9419,13 +9462,13 @@ Prototype :
void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...);
----
Cette fonction est un raccourci vers la fonction printf_date_tags. Ces deux appels
donnent exactement le même résultat :
Cette fonction est un raccourci vers la fonction printf_datetime_tags. +
Ces deux appels donnent exactement le même résultat :
[source,c]
----
weechat_printf (buffer, "message");
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
Paramètres :
@@ -9490,6 +9533,15 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
const char *tags, const char *message, ...);
----
Cette fonction est un raccourci vers la fonction printf_datetime_tags. +
Ces deux appels donnent exactement le même résultat :
[source,c]
----
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
Paramètres :
* _buffer_ : pointeur vers le tampon, si NULL, le message est affiché sur le
@@ -9527,6 +9579,65 @@ weechat.prnt_date_tags("", time - 120, "notify_message",
La fonction s'appelle "print_date_tags" dans les scripts ("prnt_date_tags" en
Python).
==== printf_datetime_tags
_WeeChat ≥ 4.2.0._
Afficher un message sur un tampon, en utilisant une date/heure (avec microsecondes)
et des étiquettes personnalisées.
Prototype :
[source,c]
----
void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
Paramètres :
* _buffer_ : pointeur vers le tampon, si NULL, le message est affiché sur le
tampon WeeChat
* _date_ : date pour le message (0 signifie la date/heure courante)
* _date_usec_ : microsecondes de la date (entre 0 et 999999)
* _tags_ : liste d'étiquettes séparées par des virgules (NULL signifie aucune
étiquette)
* _message_ : message à afficher
Voir le link:weechat_user.fr.html#lines_tags[Guide utilisateur WeeChat / Étiquettes des lignes ^↗^^]
pour une liste des étiquettes couramment utilisées dans WeeChat.
Exemple en C :
[source,c]
----
struct timeval tv_now;
gettimeofday (&tv_now, NULL);
weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec,
"notify_message",
"Message il y a 2 minutes avec une étiquette 'notify_message'");
----
Script (Python) :
[source,python]
----
# prototype
def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ...
# exemple
now = time.time()
time_sec = int(now)
time_usec = int((now * 1000000) % 1000000)
weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message",
"Message il y a 2 minutes avec une étiquette 'notify_message'")
----
[NOTE]
La fonction s'appelle "print_datetime_tags" dans les scripts ("prnt_datetime_tags"
en Python).
==== printf_y
Afficher un message sur une ligne d'un tampon avec contenu libre.
@@ -9535,8 +9646,16 @@ Prototype :
[source,c]
----
void weechat_printf_y (struct t_gui_buffer *buffer, int y,
const char *message, ...);
void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...);
----
Cette fonction est un raccourci vers la fonction printf_y_datetime_tags. +
Ces deux appels donnent exactement le même résultat :
[source,c]
----
weechat_printf_y (buffer, 0, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
Paramètres :
@@ -9585,6 +9704,15 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date
const char *tags, const char *message, ...);
----
Cette fonction est un raccourci vers la fonction printf_y_datetime_tags. +
Ces deux appels donnent exactement le même résultat :
[source,c]
----
weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
Paramètres :
* _buffer_ : pointeur vers le tampon
@@ -9619,6 +9747,56 @@ weechat.prnt_y_date_tags("", 2, 0, "mon_etiquette", "Mon message sur la 3ème li
La fonction s'appelle "print_y_date_tags" dans les scripts ("prnt_y_date_tags"
en Python).
==== printf_y_datetime_tags
_WeeChat ≥ 4.2.0._
Afficher un message sur une ligne d'un tampon avec contenu libre, en utilisant
une date/heure (avec microsecondes) et des étiquettes personnalisées.
Prototype :
[source,c]
----
void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
Paramètres :
* _buffer_ : pointeur vers le tampon
* _y_ : numéro de ligne (la première ligne est 0); une valeur négative affiche
une ligne après la dernière ligne affichée : la valeur absolue de _y_ est le
nombre de lignes après la dernière ligne (par exemple -1 est immédiatement
après la dernière ligne, -2 est 2 lignes après la dernière ligne)
* _date_ : date pour le message (0 signifie la date/heure courante)
* _date_usec_ : microsecondes de la date (entre 0 et 999999)
* _tags_ : liste d'étiquettes séparées par des virgules (NULL signifie aucune
étiquette)
* _message_ : message à afficher
Exemple en C :
[source,c]
----
weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "mon_etiquette", "Mon message sur la 3ème ligne avec une étiquette");
----
Script (Python) :
[source,python]
----
# prototype
def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ...
# exemple
weechat.prnt_y_datetime_tags("", 2, 0, 0, "mon_etiquette", "Mon message sur la 3ème ligne avec une étiquette")
----
[NOTE]
La fonction s'appelle "print_y_datetime_tags" dans les scripts
("prnt_y_datetime_tags" en Python).
==== log_printf
Écrire un message dans le fichier de log WeeChat (weechat.log).
@@ -11033,7 +11211,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
==== hook_line
_WeeChat ≥ 2.3, mis à jour dans la 3.7._
_WeeChat ≥ 2.3, mis à jour dans la 4.2.0._
Intercepter une ligne sur le point d'être affichée dans un tampon.
@@ -11139,11 +11317,21 @@ de hachage, avec les valeurs suivantes (les clés et valeurs sont des chaînes)
| N/A ("0").
| `+1533792000+`
| date_usec
| Microsecondes de la date de la ligne (entre 0 et 999999).
| N/A ("0").
| `+123456+`
| date_printed
| Date d'affichage de la ligne (horodatage).
| N/A ("0").
| `+1533792012+`
| date_usec_printed
| Microsecondes de la date d'affichage de la ligne (entre 0 et 999999).
| N/A ("0").
| `+654321+`
| str_time
| Date pour l'affichage (elle peut contenir des codes couleur).
| N/A (chaîne vide).
@@ -11232,11 +11420,22 @@ valeurs sont des chaînes dans cette table de hachage) :
| La date est positionnée à cet horodatage. +
La valeur de `+str_time+` est mise à jour en conséquence.
| date_usec
| Entier ("0" à "999999").
| N/A.
| Les microsecondes de la date sont positionnées à cette valeur. +
La valeur de `+str_time+` est mise à jour en conséquence.
| date_printed
| Horodatage.
| N/A.
| La date d'affichage est positionnée à cet horodatage (non affichée).
| date_usec_printed
| Entier ("0" à "999999").
| N/A.
| Les microsecondes de la date d'affichage sont positionnées à cette valeur.
| str_time
| Chaîne.
| N/A.
@@ -11320,7 +11519,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "")
==== hook_print
_Mis à jour dans la 0.4.3, 1.0, 1.5._
_Mis à jour dans la 0.4.3, 1.0, 1.5, 4.2.0._
Intercepter un message affiché. Il est appelée quand une ligne a été ajoutée
dans un tampon avec contenu formaté.
@@ -11340,6 +11539,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer,
void *data,
struct t_gui_buffer *buffer,
time_t date,
int date_usec,
int tags_count,
const char **tags,
int displayed,
@@ -11371,6 +11571,7 @@ Paramètres :
** _void *data_ : pointeur
** _struct t_gui_buffer *buffer_ : pointeur vers le tampon
** _time_t date_ : date
** _int date_usec_ : microsecondes de la date
** _int tags_count_ : nombre d'étiquettes de la ligne
** _const char **tags_ : tableau avec les étiquettes de la ligne
** _int displayed_ : 1 si la ligne est affichée, 0 si elle est filtrée (cachée)
@@ -11405,7 +11606,7 @@ Exemple en C :
----
int
my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, const char **tags,
time_t date, int date_usec, int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
@@ -13594,9 +13795,15 @@ valeurs sont de type "string") :
| _chat_line_date | Date/heure de la ligne.
| "1313237175" | "0"
| _chat_line_date_usec | Microsecondes de la date/heure de la ligne.
| "123456" | "0"
| _chat_line_date_printed | Date/heure de la ligne ^(4)^.
| "1313237175" | "0"
| _chat_line_date_usec_printed | Microsecondes de la date/heure de la ligne ^(4)^.
| "123456" | "0"
| _chat_line_time | Heure affichée.
| "14:06:15" | ""
+22 -10
View File
@@ -503,7 +503,9 @@ hda:
'buffer': 'ptr',
'y': 'int',
'date': 'tim',
'date_usec': 'int',
'date_printed': 'tim',
'date_usec_printed': 'int',
'str_time': 'str',
'tags_count': 'int',
'tags_array': 'arr',
@@ -521,7 +523,9 @@ hda:
buffer: '0x558d61ea3e60'
y: -1
date: 1588404926
date_usec: 118712
date_printed: 1588404926
date_usec_printed: 118712
str_time: 'F@0025209F@0024535F@0024026'
tags_count: 0
tags_array: []
@@ -537,7 +541,9 @@ hda:
buffer: '0x558d61ea3e60'
y: -1
date: 1588404930
date_usec: 25
date_printed: 1588404930
date_usec_printed: 25
str_time: 'F@0025209F@0024535F@0024030'
tags_count: 0
tags_array: []
@@ -2078,16 +2084,18 @@ Données envoyées dans le hdata :
[width="100%",cols="3m,2,10",options="header"]
|===
| Nom | Type | Description
| buffer | pointeur | Pointeur vers le tampon.
| date | date/heure | Date du message.
| date_printed | date/heure | Date d'affichage du message.
| displayed | caractère | 1 si le message est affiché, 0 si le message est filtré (caché).
| notify_level | caractère | Niveau de notification : -1 = notification désactivée, 0 = bas, 1 = message, 2 = privé, 3 = highlight.
| highlight | caractère | 1 si la ligne a un highlight, sinon 0.
| tags_array | tableau de chaînes | Liste des étiquettes de la ligne.
| prefix | chaîne | Préfixe.
| message | chaîne | Message.
| Nom | Type | Description
| buffer | pointeur | Pointeur vers le tampon.
| date | date/heure | Date du message.
| date_usec | entier | Microsecondes de la date.
| date_printed | date/heure | Date d'affichage du message.
| date_usec_printed | entier | Microsecondes de la date d'affichage du message.
| displayed | caractère | 1 si le message est affiché, 0 si le message est filtré (caché).
| notify_level | caractère | Niveau de notification : -1 = notification désactivée, 0 = bas, 1 = message, 2 = privé, 3 = highlight.
| highlight | caractère | 1 si la ligne a un highlight, sinon 0.
| tags_array | tableau de chaînes | Liste des étiquettes de la ligne.
| prefix | chaîne | Préfixe.
| message | chaîne | Message.
|===
Exemple : nouveau message _hello!_ du pseudo _FlashCode_ sur le tampon
@@ -2100,7 +2108,9 @@ hda:
keys: {
'buffer': 'ptr',
'date': 'tim',
'date_usec': 'int',
'date_printed': 'tim',
'date_usec_printed': 'int',
'displayed': 'chr',
'notify_level': 'chr',
'highlight': 'chr',
@@ -2113,7 +2123,9 @@ hda:
__path: ['0x4a49600']
buffer: '0x4a715d0'
date: 1362728993
date_usec: 902765
date_printed: 1362728993
date_usec_printed: 902765
displayed: 1
notify_level: 1
highlight: 0
+2
View File
@@ -670,8 +670,10 @@ Liste des fonctions de l'API script :
color +
print (pour python : prnt) +
print_date_tags (pour python : prnt_date_tags) +
print_datetime_tags (pour python : prnt_datetime_tags) +
print_y (pour python : prnt_y) +
print_y_date_tags (pour python : prnt_y_date_tags) +
print_y_datetime_tags (pour python : prnt_y_datetime_tags) +
log_print
| hooks
+5 -3
View File
@@ -5334,7 +5334,7 @@ du type de hook :
| signal | tg_signal_data |
| hsignal | |
| modifier | tg_string | tg_string
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message
| print | tg_message |
| command | tg_argv_eol1 |
| command_run | tg_command |
@@ -5505,7 +5505,9 @@ de hachage :
| buffer_type | chaîne | Type de tampon ("formatted" ou "free").
| y | chaîne | Numéro de ligne pour un tampon avec contenu libre (≥ 0), -1 pour un tampon avec contenu formaté.
| date | chaîne | Date de la ligne (horodatage).
| date_usec | chaîne | Microsecondes de la date de la ligne.
| date_printed | chaîne | Date d'affichage de la ligne (horodatage).
| date_usec_printed | chaîne | Microsecondes de la date d'affichage de la ligne.
| str_time | chaîne | Date pour l'affichage. Elle peut contenir des codes couleur.
| tags | chaîne | Étiquettes du message (avec une virgule en début/fin de chaîne).
| displayed | chaîne | "1" si affichée, "0" si la ligne est filtrée.
@@ -5546,7 +5548,7 @@ hachage :
|===
| Variable | Type | Description
| buffer | pointeur | Tampon.
| tg_date | chaîne | Date/heure du message (format : `YYYY-MM-DD hh:mm:ss`).
| tg_date | chaîne | Date/heure du message (format : `%FT%T.%f`, voir la link:weechat_plugin_api.fr.html#_util_strftimeval[Référence API extension WeeChat / util_strftimeval ^↗^^]).
| tg_displayed | chaîne | "1" si affiché, "0" si ligne filtrée.
| tg_highlight | chaîne | "1" si highlight, sinon "0".
| tg_prefix | chaîne | Préfixe.
@@ -5615,7 +5617,7 @@ hachage :
|===
| Variable | Type | Description
| tg_remaining_calls | chaîne | Nombre d'appels restants.
| tg_date | chaîne | Date/heure courante (format : `YYYY-MM-DD hh:mm:ss`).
| tg_date | chaîne | Date/heure courante (format : `%FT%T.%f`, voir la link:weechat_plugin_api.fr.html#_util_strftimeval[Référence API extension WeeChat / util_strftimeval ^↗^^]).
|===
[[trigger_data_config]]
+224 -8
View File
@@ -4913,6 +4913,48 @@ weechat_printf (NULL, "date: %s",
[NOTE]
Questa funzione non è disponibile nelle API per lo scripting.
// TRANSLATION MISSING
==== util_strftimeval
_WeeChat ≥ 4.2.0._
Format date and time like function `strftime` in C library, using `struct timeval`
as input, and supporting extra specifiers for microseconds.
Prototype:
[source,c]
----
int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv);
----
Arguments:
* _string_: buffer where the formatted string is stored
* _max_: string size
* _format_: format, the same as _strftime_ function, with these extra specifiers:
** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits
(for example `%.3` for milliseconds)
** `%f`: alias of `%.6`
Return value:
* number of bytes put in _string_ (value returned from _strftime_ function)
C example:
[source,c]
----
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* result: 2023-12-26T18:10:04.460509 */
----
[NOTE]
Questa funzione non è disponibile nelle API per lo scripting.
==== util_version_number
_WeeChat ≥ 0.3.9._
@@ -9611,13 +9653,13 @@ void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...);
----
// TRANSLATION MISSING
This function is a shortcut for function printf_date_tags. These two calls give
exactly same result:
This function is a shortcut for function printf_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf (buffer, "message");
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
Argomenti:
@@ -9683,6 +9725,16 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
const char *tags, const char *message, ...);
----
// TRANSLATION MISSING
This function is a shortcut for function printf_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
Argomenti:
* _buffer_: puntatore al buffer, se NULL il messaggio viene visualizzato
@@ -9720,6 +9772,67 @@ weechat.prnt_date_tags("", time - 120, "notify_message",
[NOTE]
La funzione è chiamata "print_date_tags" negli script ("prnt_date_tags" in Python).
==== printf_datetime_tags
_WeeChat ≥ 4.2.0._
// TRANSLATION MISSING
Display a message on a buffer, using a custom date/time (with microseconds)
and tags.
Prototipo:
[source,c]
----
void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
Argomenti:
* _buffer_: puntatore al buffer, se NULL il messaggio viene visualizzato
sul buffer di WeeChat
* _date_: data per il messaggio (0 indica data/ora corrente)
// TRANSLATION MISSING
* _date_usec_: microseconds of date (between 0 and 999999)
// TRANSLATION MISSING
* _tags_: lista di tag separati da virgole (NULL means no tags)
* _message_: messaggio da visualizzare
// TRANSLATION MISSING
See the link:weechat_user.it.html#lines_tags[WeeChat user's guide / Lines tags ^↗^^]
for a list of commonly used tags in WeeChat.
Esempio in C:
[source,c]
----
struct timeval tv_now;
gettimeofday (&tv_now, NULL);
weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec,
"notify_message",
"Messaggio 2 minuti fa, con tag 'notify_message'");
----
Script (Python):
[source,python]
----
# prototipo
def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ...
# esempio
now = time.time()
time_sec = int(now)
time_usec = int((now * 1000000) % 1000000)
weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message",
"Messaggio 2 minuti fa, con tag 'notify_message'")
----
[NOTE]
La funzione è chiamata "print_datetime_tags" negli script ("prnt_datetime_tags" in Python).
==== printf_y
Visualizza un messaggio sulla riga di un buffer con contenuto libero.
@@ -9728,8 +9841,17 @@ Prototipo:
[source,c]
----
void weechat_printf_y (struct t_gui_buffer *buffer, int y,
const char *message, ...);
void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...);
----
// TRANSLATION MISSING
This function is a shortcut for function printf_y_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_y (buffer, 0, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
Argomenti:
@@ -9779,6 +9901,16 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date
const char *tags, const char *message, ...);
----
// TRANSLATION MISSING
This function is a shortcut for function printf_y_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
Argomenti:
* _buffer_: puntatore al buffer
@@ -9813,6 +9945,58 @@ weechat.prnt_y_date_tags("", 2, 0, "my_tag", "My message on third line with a ta
[NOTE]
La funzione è chiamata "print_y_date_tags" negli script ("prnt_y_date_tags in Python).
==== printf_y_datetime_tags
_WeeChat ≥ 4.2.0._
// TRANSLATION MISSING
Display a message on a line of a buffer with free content, using a custom
date/time (with microseconds) and tags.
Prototipo:
[source,c]
----
void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
Argomenti:
* _buffer_: puntatore al buffer
// TRANSLATION MISSING
* _y_: numero di riga (la prima riga è 0); a negative value adds a line after
last line displayed: absolute value of _y_ is the number of lines after last
line (for example -1 is immediately after last line, -2 is 2 lines after last
line)
* _date_: data per il messaggio (0 indica data/ora corrente)
// TRANSLATION MISSING
* _date_usec_: microseconds of date (between 0 and 999999)
// TRANSLATION MISSING
* _tags_: lista di tag separati da virgole (NULL means no tags)
* _message_: messaggio da visualizzare
Esempio in C:
[source,c]
----
weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "my_tag", "My message on third line with a tag");
----
Script (Python):
[source,python]
----
# prototipo
def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ...
# esempio
weechat.prnt_y_datetime_tags("", 2, 0, 0, "my_tag", "My message on third line with a tag")
----
[NOTE]
La funzione è chiamata "print_y_datetime_tags" negli script ("prnt_y_datetime_tags in Python).
==== log_printf
Scrive un messaggio nel file di log di WeeChat (weechat.log).
@@ -11218,7 +11402,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
// TRANSLATION MISSING
==== hook_line
_WeeChat ≥ 2.3, updated in 3.7._
_WeeChat ≥ 2.3, updated in 4.2.0._
Hook a line to be printed in a buffer.
@@ -11317,11 +11501,21 @@ Line data sent to the callback is a hashtable, with following values
| N/A ("0").
| `+1533792000+`
| date_usec
| Microseconds of line date (between 0 and 999999).
| N/A ("0").
| `+123456+`
| date_printed
| Date when line was displayed (timestamp).
| N/A ("0").
| `+1533792012+`
| date_usec_printed
| Microseconds of date when line was displayed (between 0 and 999999).
| N/A ("0").
| `+654321+`
| str_time
| Date for display (possible color codes inside).
| N/A (empty string).
@@ -11408,11 +11602,22 @@ in this hashtable):
| The date is set to this value. +
The value of `+str_time+` is updated accordingly.
| date_usec
| Integer ("0" to "999999").
| N/A.
| The microseconds of line date is set to this value. +
The value of `+str_time+` is updated accordingly.
| date_printed
| Timestamp.
| N/A.
| The printed date is set to this timestamp (not displayed).
| date_usec_printed
| Integer ("0" to "999999").
| N/A.
| The microseconds of printed date is set to this value.
| str_time
| String.
| N/A.
@@ -11494,7 +11699,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "")
==== hook_print
// TRANSLATION MISSING
_Updated in 0.4.3, 1.0, 1.5._
_Updated in 0.4.3, 1.0, 1.5, 4.2.0._
// TRANSLATION MISSING
Hook su un messaggio stampato. It is called when a line has been added in
@@ -11516,6 +11721,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer,
void *data,
struct t_gui_buffer *buffer,
time_t date,
int date_usec,
int tags_count,
const char **tags,
int displayed,
@@ -11549,6 +11755,8 @@ Argomenti:
** _void *data_: puntatore
** _struct t_gui_buffer *buffer_: puntatore al buffer
** _time_t date_: data
// TRANSLATION MISSING
** _int date_usec_: microseconds of date
** _int tags_count_: numero di tag per riga
** _const char **tags_: array con tag per riga
** _int displayed_: 1 se la riga è visualizzata, 0 se filtrata (nascosta)
@@ -11581,7 +11789,7 @@ Esempio in C:
----
int
my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, const char **tags,
time_t date, int date_usec, int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
@@ -13891,9 +14099,17 @@ Contenuto della tabella hash inviata alla callback (tasti e valori sono di tipo
| _chat_line_date | Riga con data/ora.
| "1313237175" | "0"
// TRANSLATION MISSING
| _chat_line_date_usec | Microseconds of line date/time.
| "123456" | "0"
| _chat_line_date_printed | Riga con data/ora ^(4)^.
| "1313237175" | "0"
// TRANSLATION MISSING
| _chat_line_date_usec_printed | Microseconds of line printed date/time ^(4)^.
| "123456" | "0"
| _chat_line_time | Ora visualizzata.
| "14:06:15" | ""
+4
View File
@@ -681,10 +681,14 @@ Elenco di funzioni nelle API per gli script:
print (for python: prnt) +
// TRANSLATION MISSING
print_date_tags (for python: prnt_date_tags) +
// TRANSLATION MISSING
print_datetime_tags (for python: prnt_datetime_tags) +
// TRANSLATION MISSING
print_y (for python: prnt_y) +
// TRANSLATION MISSING
print_y_date_tags (for python: prnt_y_date_tags) +
// TRANSLATION MISSING
print_y_datetime_tags (for python: prnt_y_datetime_tags) +
log_print
| hook
+7 -3
View File
@@ -5575,7 +5575,7 @@ type:
| signal | tg_signal_data |
| hsignal | |
| modifier | tg_string | tg_string
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message
| print | tg_message |
| command | tg_argv_eol1 |
| command_run | tg_command |
@@ -5734,7 +5734,9 @@ The "line" callback sets following variables in hashtable:
| buffer_type | string | Buffer type ("formatted" or "free").
| y | string | Line number for a buffer with free content (≥ 0), -1 for a buffer with formatted content.
| date | string | Line date (timestamp).
| date_usec | string | Microseconds of line date.
| date_printed | string | Date when line was displayed (timestamp).
| date_usec_printed | string | Microseconds of date when line was displayed.
| str_time | string | Date for display. It may contain color codes.
| tags | string | Tags of message (with comma added at beginning/end of string).
| displayed | string | "1" if displayed, "0" if line filtered.
@@ -5773,7 +5775,8 @@ The "print" callback sets following variables in hashtable:
|===
| Variable | Type | Description
| buffer | pointer | Buffer.
| tg_date | string | Message date/time (format: `YYYY-MM-DD hh:mm:ss`).
// TRANSLATION MISSING
| tg_date | string | Message date/time (format: `%FT%T.%f`, see link:weechat_plugin_api.it.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
| tg_displayed | string | "1" if displayed, "0" if line filtered.
| tg_highlight | string | "1" if highlight, otherwise "0".
| tg_prefix | string | Prefix.
@@ -5838,7 +5841,8 @@ The "timer" callback sets following variables in hashtable:
|===
| Variable | Type | Description
| tg_remaining_calls | string | Number of remaining calls.
| tg_date | string | Current date/time (format: `YYYY-MM-DD hh:mm:ss`).
// TRANSLATION MISSING
| tg_date | string | Current date/time (format: `%FT%T.%f`, see link:weechat_plugin_api.it.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
|===
[[trigger_data_config]]
+220 -7
View File
@@ -4820,6 +4820,48 @@ weechat_printf (NULL, "date: %s",
[NOTE]
スクリプト API ではこの関数を利用できません。
// TRANSLATION MISSING
==== util_strftimeval
_WeeChat ≥ 4.2.0._
Format date and time like function `strftime` in C library, using `struct timeval`
as input, and supporting extra specifiers for microseconds.
Prototype:
[source,c]
----
int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv);
----
Arguments:
* _string_: buffer where the formatted string is stored
* _max_: string size
* _format_: format, the same as _strftime_ function, with these extra specifiers:
** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits
(for example `%.3` for milliseconds)
** `%f`: alias of `%.6`
Return value:
* number of bytes put in _string_ (value returned from _strftime_ function)
C example:
[source,c]
----
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* result: 2023-12-26T18:10:04.460509 */
----
[NOTE]
スクリプト API ではこの関数を利用できません。
==== util_version_number
_WeeChat バージョン 0.3.9 以上で利用可。_
@@ -9375,13 +9417,13 @@ weechat.prnt("", "Color: %sblue %sdefault color %syellow on red"
void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...);
----
この関数は printf_date_tags
この関数は printf_datetime_tags
関数の別名です。以下に示す通り、どちらの関数も同じ結果を返します:
[source,c]
----
weechat_printf (buffer, "message");
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
引数:
@@ -9443,6 +9485,15 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
const char *tags, const char *message, ...);
----
この関数は printf_datetime_tags
関数の別名です。以下に示す通り、どちらの関数も同じ結果を返します:
[source,c]
----
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
引数:
* _buffer_: バッファへのポインタ、NULL の場合、メッセージは WeeChat バッファに表示
@@ -9477,6 +9528,64 @@ weechat.prnt_date_tags("", time - 120, "notify_message",
[NOTE]
この関数をスクリプトの中で実行するには "print_date_tags" (Python の場合は "prnt_date_tags") と書きます。
==== printf_datetime_tags
_WeeChat ≥ 4.2.0._
// TRANSLATION MISSING
Display a message on a buffer, using a custom date/time (with microseconds)
and tags.
プロトタイプ:
[source,c]
----
void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
引数:
* _buffer_: バッファへのポインタ、NULL の場合、メッセージは WeeChat バッファに表示
* _date_: メッセージの日付 (0 は現在の日付/時間を意味する)
// TRANSLATION MISSING
* _date_usec_: microseconds of date (between 0 and 999999)
* _tags_: タグのコンマ区切りリスト (タグを指定しない場合は NULL)
* _message_: 表示するメッセージ
WeeChat で共通に使われるタグのリストは
link:weechat_user.ja.html#lines_tags[WeeChat ユーザーズガイド / 行のタグ ^↗^^]を参照してください
C 言語での使用例:
[source,c]
----
struct timeval tv_now;
gettimeofday (&tv_now, NULL);
weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec,
"notify_message",
"Message 2 minutes ago, with a tag 'notify_message'");
----
スクリプト (Python) での使用例:
[source,python]
----
# プロトタイプ
def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ...
# 例
now = time.time()
time_sec = int(now)
time_usec = int((now * 1000000) % 1000000)
weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message",
"Message 2 minutes ago, with a tag 'notify_message'")
----
[NOTE]
この関数をスクリプトの中で実行するには "print_datetime_tags" (Python の場合は "prnt_datetime_tags") と書きます。
==== printf_y
自由内容のバッファのある行にメッセージを表示
@@ -9485,8 +9594,17 @@ weechat.prnt_date_tags("", time - 120, "notify_message",
[source,c]
----
void weechat_printf_y (struct t_gui_buffer *buffer, int y,
const char *message, ...);
void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...);
----
// TRANSLATION MISSING
This function is a shortcut for function printf_y_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_y (buffer, 0, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
引数:
@@ -9535,6 +9653,16 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date
const char *tags, const char *message, ...);
----
// TRANSLATION MISSING
This function is a shortcut for function printf_y_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
引数:
* _buffer_: バッファへのポインタ
@@ -9566,6 +9694,55 @@ weechat.prnt_y_date_tags("", 2, 0, "my_tag", "My message on third line with a ta
[NOTE]
この関数をスクリプトの中で実行するには "print_y_date_tags" (Python の場合は "prnt_y_date_tags") と書きます。
==== printf_y_datetime_tags
_WeeChat ≥ 4.2.0._
// TRANSLATION MISSING
Display a message on a line of a buffer with free content, using a custom
date/time (with microseconds) and tags.
プロトタイプ:
[source,c]
----
void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
引数:
* _buffer_: バッファへのポインタ
* _y_: 行番号 (1 行目は 0); 負数の場合は表示された最後の行の後に行を追加する:
_y_ の絶対値で最後の行の後に追加する行数を指定 (例えば
-1 は最後の行のすぐ後、-2 は 最後の行の 2 行後)
* _date_: メッセージの日付 (0 は現在の日付/時間を意味する)
// TRANSLATION MISSING
* _date_usec_: microseconds of date (between 0 and 999999)
* _tags_: タグのコンマ区切りリスト (タグを指定しない場合は NULL)
* _message_: 表示するメッセージ
C 言語での使用例:
[source,c]
----
weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "my_tag", "My message on third line with a tag");
----
スクリプト (Python) での使用例:
[source,python]
----
# プロトタイプ
def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ...
# 例
weechat.prnt_y_datetime_tags("", 2, 0, 0, "my_tag", "My message on third line with a tag")
----
[NOTE]
この関数をスクリプトの中で実行するには "print_y_datetime_tags" (Python の場合は "prnt_y_datetime_tags") と書きます。
==== log_printf
WeeChat ログファイル (weechat.log) にメッセージを書き込む。
@@ -10944,7 +11121,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
==== hook_line
// TRANSLATION MISSING
_WeeChat ≥ 2.3, updated in 3.7._
_WeeChat ≥ 2.3, updated in 4.2.0._
バッファに対する行表示をフックする。
@@ -11043,11 +11220,23 @@ struct t_hook *weechat_hook_line (const char *buffer_type,
| 利用不可 ("0")
| `+1533792000+`
// TRANSLATION MISSING
| date_usec
| Microseconds of line date (between 0 and 999999).
| N/A ("0").
| `+123456+`
| date_printed
| 行が表示された日付 (タイムスタンプ)
| 利用不可 ("0")
| `+1533792012+`
// TRANSLATION MISSING
| date_usec_printed
| Microseconds of date when line was displayed (between 0 and 999999).
| N/A ("0").
| `+654321+`
| str_time
| 行に追加される日付 (色コードを入れてもよい)
| 利用不可 (空文字列)
@@ -11135,11 +11324,24 @@ WeeChat はそれらを無視します。
| 日付はこの値に設定されます +
これに対応して `+str_time+` も更新されます
// TRANSLATION MISSING
| date_usec
| Integer ("0" to "999999").
| 利用不可
| The microseconds of line date is set to this value. +
これに対応して `+str_time+` も更新されます
| date_printed
| タイムスタンプ
| 利用不可
| 表示される日付はこのタイムスタンプを使います。The printed date is set to this timestamp (not displayed).
// TRANSLATION MISSING
| date_usec_printed
| Integer ("0" to "999999").
| 利用不可
| The microseconds of printed date is set to this value.
| str_time
| 文字列
| 利用不可
@@ -11220,7 +11422,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "")
==== hook_print
_WeeChat バージョン 0.4.3、1.0、1.5 で更新。_
_WeeChat バージョン 0.4.3、1.0、1.5、4.2.0 で更新。_
メッセージの表示をフックする。これは行がフォーマット済みバッファに追加された時点で呼び出されます。
@@ -11239,6 +11441,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer,
void *data,
struct t_gui_buffer *buffer,
time_t date,
int date_usec,
int tags_count,
const char **tags,
int displayed,
@@ -11268,6 +11471,8 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer,
** _void *data_: ポインタ
** _struct t_gui_buffer *buffer_: バッファへのポインタ
** _time_t date_: 日付
// TRANSLATION MISSING
** _int date_usec_: microseconds of date
** _int tags_count_: 行に付けられたタグの個数
** _const char **tags_: 行に付けられたタグの配列
** _int displayed_: 行が表示される場合は 1、フィルタされる (隠される) 場合は 0
@@ -11298,7 +11503,7 @@ C 言語での使用例:
----
int
my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, const char **tags,
time_t date, int date_usec, int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
@@ -13460,9 +13665,17 @@ info を使う前にエリアが一致していることを確認して下さい
| _chat_line_date | 日付/時間の行
| "1313237175" | "0"
// TRANSLATION MISSING
| _chat_line_date_usec | Microseconds of line date/time.
| "123456" | "0"
| _chat_line_date_printed | 日付/時間の行 ^(4)^
| "1313237175" | "0"
// TRANSLATION MISSING
| _chat_line_date_usec_printed | Microseconds of line printed date/time ^(4)^.
| "123456" | "0"
| _chat_line_time | 表示された時間
| "14:06:15" | ""
+24 -10
View File
@@ -507,7 +507,9 @@ hda:
'buffer': 'ptr',
'y': 'int',
'date': 'tim',
'date_usec': 'int',
'date_printed': 'tim',
'date_usec_printed', 'int',
'str_time': 'str',
'tags_count': 'int',
'tags_array': 'arr',
@@ -525,7 +527,9 @@ hda:
buffer: '0x558d61ea3e60'
y: -1
date: 1588404926
date_usec: 118712
date_printed: 1588404926
date_usec_printed: 118712
str_time: 'F@0025209F@0024535F@0024026'
tags_count: 0
tags_array: []
@@ -541,7 +545,9 @@ hda:
buffer: '0x558d61ea3e60'
y: -1
date: 1588404930
date_usec: 25
date_printed: 1588404930
date_usec_printed: 25
str_time: 'F@0025209F@0024535F@0024030'
tags_count: 0
tags_array: []
@@ -2085,17 +2091,21 @@ hdata として送られるデータ:
[width="100%",cols="3m,2,10",options="header"]
|===
| 名前 | 型 | 説明
| buffer | pointer | バッファへのポインタ
| date | time | メッセージの日付
| date_printed | time | WeeChat メッセージを表示した日付
| displayed | char | メッセージが表示される場合は 1、メッセージがフィルタされる (隠される) 場合は 0
| 名前 | 型 | 説明
| buffer | pointer | バッファへのポインタ
| date | time | メッセージの日付
// TRANSLATION MISSING
| notify_level | char | Notify level: -1 = notify disabled, 0 = low, 1 = message, 2 = private, 3 = highlight.
| highlight | char | 行がハイライト部分を含む場合は 1、それ以外は 0
| tags_array | string の配列 | 行に対するタグのリスト
| prefix | string | プレフィックス
| message | string | メッセージ
| date_usec | integer | Microseconds of date.
| date_printed | time | WeeChat メッセージを表示した日付
// TRANSLATION MISSING
| date_usec_printed | integer | Microseconds of date when WeeChat displayed message.
| displayed | char | メッセージが表示される場合は 1、メッセージがフィルタされる (隠される) 場合は 0
// TRANSLATION MISSING
| notify_level | char | Notify level: -1 = notify disabled, 0 = low, 1 = message, 2 = private, 3 = highlight.
| highlight | char | 行がハイライト部分を含む場合は 1、それ以外は 0
| tags_array | string の配列 | 行に対するタグのリスト
| prefix | string | プレフィックス
| message | string | メッセージ
|===
例: バッファ _irc.libera.#weechat_ でニックネーム _FlashCode_ からの新しいメッセージ _hello!_:
@@ -2107,7 +2117,9 @@ hda:
keys: {
'buffer': 'ptr',
'date': 'tim',
'date_used': 'int',
'date_printed': 'tim',
'date_usec_printed': 'int',
'displayed': 'chr',
'notify_level': 'chr',
'highlight': 'chr',
@@ -2120,7 +2132,9 @@ hda:
__path: ['0x4a49600']
buffer: '0x4a715d0'
date: 1362728993
date_usec: 902765
date_printed: 1362728993
date_usec_printed: 902765
displayed: 1
notify_level: 1
highlight: 0
+2
View File
@@ -671,8 +671,10 @@ link:weechat_plugin_api.ja.html[WeeChat プラグイン API リファレンス 
color +
print (python では prnt) +
print_date_tags (python では prnt_date_tags) +
print_datetime_tags (python では prnt_datetime_tags) +
print_y (python では prnt_y) +
print_y_date_tags (python では prnt_y_date_tags) +
print_y_datetime_tags (python では prnt_y_datetime_tags) +
log_print
| フック
+9 -3
View File
@@ -5415,7 +5415,7 @@ type:
| signal | tg_signal_data |
| hsignal | |
| modifier | tg_string | tg_string
| line | message | buffer、buffer_name、y、date、date_printed、str_time、tags、notify_level、highlight、prefix、message
| line | message | buffer、buffer_name、y、date、date_usec、date_printed、date_usec_printed、str_time、tags、notify_level、highlight、prefix、message
| print | tg_message |
| command | tg_argv_eol1 |
| command_run | tg_command |
@@ -5575,7 +5575,11 @@ _weechat_print_ 修飾子では、メッセージタグを使う変数 (下の
| buffer_type | string | バッファ型 ("formatted" または "free")
| y | string | 自由内容バッファの行番号 (≥ 0)、-1 はフォーマット済みバッファ用
| date | string | 行の日付 (タイムスタンプ)
// TRANSLATION MISSING
| date_usec | string | Microseconds of line date.
| date_printed | string | 行が表示される日付 (タイムスタンプ).
// TRANSLATION MISSING
| date_usec_printed | string | Microseconds of date when line was displayed.
| str_time | string | 表示に使う日付、色コードを含めることも可能
| tags | string | メッセージのタグ (文字列の最初と最後にコンマが追加されます)
| displayed | string | "1" の場合は表示、"0" の場合は非表示
@@ -5617,7 +5621,8 @@ _weechat_print_ 修飾子では、メッセージタグを使う変数 (下の
|===
| 変数 | 型 | 説明
| buffer | pointer | メッセージが表示されたバッファ
| tg_date | string | メッセージの日付と時間 (書式: `YYYY-MM-DD hh:mm:ss`)
// TRANSLATION MISSING
| tg_date | string | メッセージの日付と時間 (書式: `%FT%T.%f`, see link:weechat_plugin_api.ja.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
| tg_displayed | string | 表示された場合 "1"、フィルタされた場合 "0"
| tg_highlight | string | ハイライトされた場合 "1"、それ以外は "0"
| tg_prefix | string | プレフィックス
@@ -5689,7 +5694,8 @@ _weechat_print_ 修飾子では、メッセージタグを使う変数 (下の
|===
| 変数 | 型 | 説明
| tg_remaining_calls | string | 残り呼び出し回数
| tg_date | string | 現在の日付および時間 (書式: `YYYY-MM-DD hh:mm:ss`)
// TRANSLATION MISSING
| tg_date | string | 現在の日付および時間 (書式: `%FT%T.%f`, see link:weechat_plugin_api.ja.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
|===
[[trigger_data_config]]
+2
View File
@@ -657,8 +657,10 @@ Lista funkcji w API skryptów:
color +
print (dla pythona: prnt) +
print_date_tags (dla pythona: prnt_date_tags) +
print_datetime_tags (dla pythona: prnt_datetime_tags) +
print_y (dla pythona: prnt_y) +
print_y_date_tags (dla pythona: prnt_y_date_tags) +
print_y_datetime_tags (dla pythona: prnt_y_datetime_tags) +
log_print
| hooks
+9 -3
View File
@@ -5229,7 +5229,7 @@ od typu hooka:
| signal | tg_signal_data |
| hsignal | |
| modifier | tg_string | tg_string
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message
| print | tg_message |
| command | tg_argv_eol1 |
| command_run | tg_command |
@@ -5388,7 +5388,11 @@ Callback "line" ustawia następujące zmienne w tablicy hashy:
| buffer_type | ciąg | Typ bufora ("formatted" lub "free").
| y | ciąg | Numer linii bufora z wolną zawartością (≥ 0), -1 dla bufora ze sformatowaną zawartością.
| date | ciąg | Linia z datą (timestamp).
// TRANSLATION MISSING
| date_usec | ciąg | Microseconds of line date.
| date_printed | ciąg | Data, kiedy linia została wyświetlona (timestamp).
// TRANSLATION MISSING
| date_usec_printed | ciąg | Microseconds of date when line was displayed.
| str_time | ciąg | Date do wyświetlenia. Może zawierać kody kolorów.
| tags | ciąg | Tagi wiadomości (z przecinkiem dodanym na początku/końcu ciągu).
| displayed | ciąg | "1" jeśli wyświetlono, "0" jeśli nie wyświetlono.
@@ -5427,7 +5431,8 @@ Callback "print" ustawia następujące zmienne w tablicy hashy:
|===
| Zmienna | Typ | Opis
| buffer | wskaźnik | Bufor.
| tg_date | ciąg | Data/czas wiadomości (format: `YYYY-MM-DD hh:mm:ss`).
// TRANSLATION MISSING
| tg_date | ciąg | Data/czas wiadomości (format: `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
| tg_displayed | ciąg | "1" jeśli wyświetlone, "0" jeśli linia odfiltrowana.
| tg_highlight | ciąg | "1" jeśli higlight, inaczej "0".
| tg_prefix | ciąg | Prefiks.
@@ -5492,7 +5497,8 @@ Callback "timer" ustawia następujące zmienne w tablicy hashy:
|===
| Zmienna | Typ | Opis
| tg_remaining_calls | ciąg | Liczba pozostałych wywołań.
| tg_date | ciąg | Obecna data/czas (format: `YYYY-MM-DD hh:mm:ss`).
// TRANSLATION MISSING
| tg_date | ciąg | Obecna data/czas `%FT%T.%f`, see link:weechat_plugin_api.en.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
|===
[[trigger_data_config]]
+218 -7
View File
@@ -4557,6 +4557,48 @@ weechat_printf (NULL, "date: %s",
[NOTE]
Ова функција није доступна у API скриптовања.
// TRANSLATION MISSING
==== util_strftimeval
_WeeChat ≥ 4.2.0._
Format date and time like function `strftime` in C library, using `struct timeval`
as input, and supporting extra specifiers for microseconds.
Prototype:
[source,c]
----
int weechat_util_strftimeval (char *string, int max, const char *format, struct timeval *tv);
----
Arguments:
* _string_: buffer where the formatted string is stored
* _max_: string size
* _format_: format, the same as _strftime_ function, with these extra specifiers:
** `%.N` where `N` is between 1 and 6: zero-padded microseconds on N digits
(for example `%.3` for milliseconds)
** `%f`: alias of `%.6`
Return value:
* number of bytes put in _string_ (value returned from _strftime_ function)
C example:
[source,c]
----
char time[256];
struct timeval tv;
gettimeofday (&tv, NULL);
weechat_util_strftimeval (time, sizeof (time), "%FT%T.%f", &tv);
/* result: 2023-12-26T18:10:04.460509 */
----
[NOTE]
Ова функција није доступна у API скриптовања.
==== util_version_number
_WeeChat ≥ 0.3.9._
@@ -9027,12 +9069,13 @@ weechat.prnt("", "Color: %sblue %sdefault color %syellow on red"
void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...);
----
Ова функција је пречица за функцију printf_date_tags. Следећа два позива дају потпуно исти резултат:
Ова функција је пречица за функцију printf_datetime_tags. +
Следећа два позива дају потпуно исти резултат:
[source,c]
----
weechat_printf (buffer, "message");
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
Аргументи:
@@ -9090,6 +9133,15 @@ void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
const char *tags, const char *message, ...);
----
Ова функција је пречица за функцију printf_datetime_tags. +
Следећа два позива дају потпуно исти резултат:
[source,c]
----
weechat_printf_date_tags (buffer, 0, NULL, "message");
weechat_printf_datetime_tags (buffer, 0, 0, NULL, "message");
----
Аргументи:
* _buffer_: показивач на бафер, ако је NULL, порука се приказује у WeeChat баферу
@@ -9123,6 +9175,63 @@ weechat.prnt_date_tags("", time - 120, "notify_message",
[NOTE]
Функција се у скриптама зове „print_date_tags” („prnt_date_tags” у језику Python).
==== printf_datetime_tags
_WeeChat ≥ 4.2.0._
// TRANSLATION MISSING
Display a message on a buffer, using a custom date/time (with microseconds)
and tags.
Прототип:
[source,c]
----
void weechat_printf_datetime_tags (struct t_gui_buffer *buffer, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
Аргументи:
* _buffer_: показивач на бафер, ако је NULL, порука се приказује у WeeChat баферу
* _date_: датум за поруку (0 значи текући датум/време)
// TRANSLATION MISSING
* _date_usec_: microseconds of date (between 0 and 999999)
* _tags_: листа ознака раздвојених запетама (NULL значи да нема ознака)
* _message_: порука која треба да се прикаже
За листу ознака које се уобичјаено користе у програму WeeChat, погледајте link:weechat_user.sr.html#lines_tags[Корисничко упутство / Ознаке линија ^↗^^].
C пример:
[source,c]
----
struct timeval tv_now;
gettimeofday (&tv_now, NULL);
weechat_printf_datetime_tags (NULL, tv_now.tv_sec - 120, tv_now.tv_usec,
"notify_message",
"Message 2 minutes ago, with a tag 'notify_message'");
----
Скрипта (Python):
[source,python]
----
# прототип
def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int: ...
# пример
now = time.time()
time_sec = int(now)
time_usec = int((now * 1000000) % 1000000)
weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message",
"Message 2 minutes ago, with a tag 'notify_message'")
----
[NOTE]
Функција се у скриптама зове „print_datetime_tags” („prnt_datetime_tags” у језику Python).
==== printf_y
Приказује поруку на линији бафера са слободним садржајем.
@@ -9131,8 +9240,17 @@ weechat.prnt_date_tags("", time - 120, "notify_message",
[source,c]
----
void weechat_printf_y (struct t_gui_buffer *buffer, int y,
const char *message, ...);
void weechat_printf_y (struct t_gui_buffer *buffer, int y, const char *message, ...);
----
// TRANSLATION MISSING
This function is a shortcut for function printf_y_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_y (buffer, 0, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
Аргументи:
@@ -9177,6 +9295,16 @@ void weechat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date
const char *tags, const char *message, ...);
----
// TRANSLATION MISSING
This function is a shortcut for function printf_y_datetime_tags. +
These two calls give exactly same result:
[source,c]
----
weechat_printf_y_date_tags (buffer, 0, 0, NULL, "message");
weechat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "message");
----
Аргументи:
* _buffer_: показивач на бафер
@@ -9206,6 +9334,53 @@ weechat.prnt_y_date_tags("", 2, 0, "my_tag", "My message on third line with a ta
[NOTE]
У скриптама се функција зове „print_y_date_tags” („prnt_y_date_tags” у језику Python).
==== printf_y_datetime_tags
_WeeChat ≥ 4.2.0._
// TRANSLATION MISSING
Display a message on a line of a buffer with free content, using a custom
date/time (with microseconds) and tags.
Прототип:
[source,c]
----
void weechat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y, time_t date,
int date_usec, const char *tags, const char *message, ...);
----
Аргументи:
* _buffer_: показивач на бафер
* _y_: број линије (прва линија је 0); негативна вредност додаје линију иза последње приказане линије: апсолутна вредност _y_ је број линија након последње линије (на пример -1 је непосредно након последње линије, -2 је 2 линије након последње линије)
* _date_: датум за поруку (0 значи текући датум/време)
// TRANSLATION MISSING
* _date_usec_: microseconds of date (between 0 and 999999)
* _tags_: листа ознака раздвојених запетама (NULL значи да нема ознака)
* _message_: порука која треба да се прикаже
C пример:
[source,c]
----
weechat_printf_y_datetime_tags (buffer, 2, 0, 0, "my_tag", "My message on third line with a tag");
----
Скрипта (Python):
[source,python]
----
# прототип
def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int: ...
# пример
weechat.prnt_y_datetime_tags("", 2, 0, 0, "my_tag", "My message on third line with a tag")
----
[NOTE]
У скриптама се функција зове „print_y_datetime_tags” („prnt_y_datetime_tags” у језику Python).
==== log_printf
Уписује поруку у WeeChat лог фајл (weechat.log).
@@ -10488,7 +10663,7 @@ hook = weechat.hook_connect("", "my.server.org", 1234, 1, 0, "",
==== hook_line
_WeeChat ≥ 2.3, ажурирано у 3.7._
_WeeChat ≥ 2.3, ажурирано у 4.2.0._
Качи се на линију која треба да се испише у бафер.
@@ -10573,11 +10748,23 @@ struct t_hook *weechat_hook_line (const char *buffer_type,
| Нема ("0").
| `+1533792000+`
// TRANSLATION MISSING
| date_usec
| Microseconds of line date (between 0 and 999999).
| N/A ("0").
| `+123456+`
| date_printed
| Датум када је линија била приказана (временска ознака).
| Нема ("0").
| `+1533792012+`
// TRANSLATION MISSING
| date_usec_printed
| Microseconds of date when line was displayed (between 0 and 999999).
| N/A ("0").
| `+654321+`
| str_time
| Датум за приказ (са могућим кодовима боја у себи).
| Нема (празан стринг).
@@ -10662,11 +10849,24 @@ struct t_hook *weechat_hook_line (const char *buffer_type,
| Датум се поставља на ову вредност. +
Сагласно овоме се поставља и вредност `+str_time+`.
// TRANSLATION MISSING
| date_usec
| Integer ("0" to "999999").
| Нема.
| The microseconds of line date is set to this value. +
Сагласно овоме се поставља и вредност `+str_time+`.
| date_printed
| Временска ознака.
| Нема.
| Датум се поставља на ову временску ознаку (не приказује се).
// TRANSLATION MISSING
| date_usec_printed
| Integer ("0" to "999999").
| Нема.
| The microseconds of printed date is set to this value.
| str_time
| Стринг.
| Нема.
@@ -10747,7 +10947,7 @@ hook = weechat.hook_line("", "", "irc_join", "my_line_cb", "")
==== hook_print
_Ажурирано у верзијама 0.4.3, 1.0, 1.5._
_Ажурирано у верзијама 0.4.3, 1.0, 1.5, 4.2.0._
Качи се на поруку која се исписује. Позива се када се у бафер са форматираним садржајем дода линија.
@@ -10765,6 +10965,7 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer,
void *data,
struct t_gui_buffer *buffer,
time_t date,
int date_usec,
int tags_count,
const char **tags,
int displayed,
@@ -10788,6 +10989,8 @@ struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer,
** _void *data_: показивач
** _struct t_gui_buffer *buffer_: показивач на бафер
** _time_t date_: датум
// TRANSLATION MISSING
** _int date_usec_: microseconds of date
** _int tags_count_: број ознака за линију
** _const char **tags_: низ са ознакама за линију
** _int displayed_: 1 ако се линија приказује, 0 ако је филтрирана (скривена)
@@ -10814,7 +11017,7 @@ C пример:
----
int
my_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, const char **tags,
time_t date, int date_usec, int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
@@ -12859,9 +13062,17 @@ struct t_hook *weechat_hook_focus (const char *area,
| _chat_line_date | Датум/време линије.
| "1313237175" | "0"
// TRANSLATION MISSING
| _chat_line_date_usec | Microseconds of line date/time.
| "123456" | "0"
| _chat_line_date_printed | Датум/време линије ^(4)^.
| "1313237175" | "0"
// TRANSLATION MISSING
| _chat_line_date_usec_printed | Microseconds of line printed date/time ^(4)^.
| "123456" | "0"
| _chat_line_time | Приказано време.
| "14:06:15" | ""
+24 -10
View File
@@ -439,7 +439,9 @@ hda:
'buffer': 'ptr',
'y': 'int',
'date': 'tim',
'date_usec': 'int',
'date_printed': 'tim',
'date_usec_printed': 'int',
'str_time': 'str',
'tags_count': 'int',
'tags_array': 'arr',
@@ -457,7 +459,9 @@ hda:
buffer: '0x558d61ea3e60'
y: -1
date: 1588404926
date_usec: 118712
date_printed: 1588404926
date_usec_printed: 118712
str_time: 'F@0025209F@0024535F@0024026'
tags_count: 0
tags_array: []
@@ -473,7 +477,9 @@ hda:
buffer: '0x558d61ea3e60'
y: -1
date: 1588404930
date_usec: 25
date_printed: 1588404930
date_usec_printed: 25
str_time: 'F@0025209F@0024535F@0024030'
tags_count: 0
tags_array: []
@@ -1946,16 +1952,20 @@ hda:
[width="100%", cols="3m,2,10", options="header"]
|===
| Име | Тип | Опис
| buffer | показивач | Показивач на бафер.
| date | време | Датум поруке.
| date_printed | време | Датум када је програм WeeChat приказао поруку.
| displayed | карактер | 1 ако је порука приказана, 0 ако је порука филтрирана (скривена).
| notify_level | карактер | Ниво обавештења: -1 = обавештење искључено, 0 = ниски, 1 = порука, 2 = приватно, 3 = истицање.
| highlight | карактер | 1 ако се у линији налази истицање, у супротном 0.
| tags_array | низ стрингова | Листа ознака за линију.
| prefix | стринг | Префикс.
| message | стринг | Порука.
| Име | Тип | Опис
| buffer | показивач | Показивач на бафер.
| date | време | Датум поруке.
// TRANSLATION MISSING
| date_usec | integer | Microseconds of date.
| date_printed | време | Датум када је програм WeeChat приказао поруку.
// TRANSLATION MISSING
| date_usec_printed | integer | Microseconds of date when WeeChat displayed message.
| displayed | карактер | 1 ако је порука приказана, 0 ако је порука филтрирана (скривена).
| notify_level | карактер | Ниво обавештења: -1 = обавештење искључено, 0 = ниски, 1 = порука, 2 = приватно, 3 = истицање.
| highlight | карактер | 1 ако се у линији налази истицање, у супротном 0.
| tags_array | низ стрингова | Листа ознака за линију.
| prefix | стринг | Префикс.
| message | стринг | Порука.
|===
Пример: нова порука _здраво!_ од надимка _FlashCode_ у баферу _irc.libera.#weechat_:
@@ -1967,7 +1977,9 @@ hda:
keys: {
'buffer': 'ptr',
'date': 'tim',
'date_usec': 'int',
'date_printed': 'tim',
'date_usec_printed': 'int',
'displayed': 'chr',
'notify_level': 'chr',
'highlight': 'chr',
@@ -1980,7 +1992,9 @@ hda:
__path: ['0x4a49600']
buffer: '0x4a715d0'
date: 1362728993
date_usec: 902765
date_printed: 1362728993
date_usec_printed: 902765
displayed: 1
notify_level: 1
highlight: 0
+2
View File
@@ -610,8 +610,10 @@ weechat_hook_timer(1000, 0, 1, $timer_cb, 'test');
color +
print (за python: prnt) +
print_date_tags (за python: prnt_date_tags) +
print_datetime_tags (за python: prnt_datetime_tags) +
print_y (за python: prnt_y) +
print_y_date_tags (за python: prnt_y_date_tags) +
print_y_datetime_tags (за python: prnt_y_datetime_tags) +
log_print
| куке
+9 -3
View File
@@ -4915,7 +4915,7 @@ y/${chars:a-z}${chars:A-Z}/${chars:b-z}a${chars:B-Z}A/
| signal | tg_signal_data |
| hsignal | |
| modifier | tg_string | tg_string
| line | message | buffer, buffer_name, y, date, date_printed, str_time, tags, notify_level, highlight, prefix, message
| line | message | buffer, buffer_name, y, date, date_usec, date_printed, date_usec_printed, str_time, tags, notify_level, highlight, prefix, message
| print | tg_message |
| command | tg_argv_eol1 |
| command_run | tg_command |
@@ -5064,7 +5064,11 @@ ${buffer[${tg_signal_data}].full_name}
| buffer_type | стринг | Тип бафера („formatted” или „free”).
| y | стринг | Број линије за бафер са слободним садржајем (≥ 0), -1 за бафер са форматираним садржајем.
| date | стринг | Датум линије (временска ознака).
// TRANSLATION MISSING
| date_usec | стринг | Microseconds of line date.
| date_printed | стринг | Датум када је линија била приказана (временска ознака).
// TRANSLATION MISSING
| date_usec_printed | стринг | Microseconds of date when line was displayed.
| str_time | стринг | Датум за приказ. Може да садржи кодове боја.
| tags | стринг | Ознаке поруке (са запетом додатом на почетак/крај стринга).
| displayed | стринг | „1” ако се приказује, „0” ако је линија филтрирана.
@@ -5103,7 +5107,8 @@ ${buffer[${tg_signal_data}].full_name}
|===
| Променљива | Тип | Опис
| buffer | показивач | Бафер.
| tg_date | стринг | Датум/време поруке (формат: `ГГГГ-ММ-ДД чч:мм:сс`).
// TRANSLATION MISSING
| tg_date | стринг | Датум/време поруке (формат: `%FT%T.%f`, see link:weechat_plugin_api.sr.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
| tg_displayed | стринг | „1” ако се приказује, „0” ако се линија филтрира.
| tg_highlight | стринг | „1” ако је истакнута, у супротном „0”.
| tg_prefix | стринг | Префикс.
@@ -5168,7 +5173,8 @@ ${buffer[${tg_signal_data}].full_name}
|===
| Променљива | Тип | Опис
| tg_remaining_calls | стринг | Број преосталих позива.
| tg_date | стринг | Текући датум/време (формат: `ГГГГ-ММ-ДД чч:мм:сс`).
// TRANSLATION MISSING
| tg_date | стринг | Текући датум/време (формат: `%FT%T.%f`, see link:weechat_plugin_api.sr.html#_util_strftimeval[WeeChat plugin API reference / util_strftimeval ^↗^^]).
|===
[[trigger_data_config]]
+30 -11
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3883,7 +3883,9 @@ msgstr ""
#, fuzzy
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"časový formát pro \"time\" položku panelu (viz. man strftime pro specifikaci "
"data/času)"
@@ -3938,9 +3940,12 @@ msgstr ""
#, fuzzy
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"formát času zobrazeného na každém řádku v bufferu (viz. man strftime pro "
"specifikaci data/času), barvy jsou povoleny ve formátu \"${barva}\", "
@@ -4494,8 +4499,11 @@ msgstr "text pro zobrazení před přezdívkou v okně rozhovoru"
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr "text pro zobrazení za přezdívkou v okně rozhovoru"
msgid "time format when quoting a message (see /help cursor)"
msgstr "formát času při citování zprávy (viz /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
@@ -9504,8 +9512,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -10326,7 +10335,8 @@ msgstr "použít stejnou barvu přezdívky pro kanál a soukromý rozhovor"
#, fuzzy
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"časový formát pro \"time\" položku panelu (viz. man strftime pro specifikaci "
"data/času)"
@@ -12372,7 +12382,13 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"časová známka použita v logovacích souborech (použijte manuálovou stránku "
"strftime pro spcifikátory data/času)"
@@ -15867,3 +15883,6 @@ msgstr "%s%s: vypršel časový limit \"%s\" pro %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: nemohu se připojit\" neočekávaná chyba (%d)"
#~ msgid "time format when quoting a message (see /help cursor)"
#~ msgstr "formát času při citování zprávy (viz /help cursor)"
+52 -16
View File
@@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-12-25 15:45+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -4308,8 +4308,14 @@ msgstr ""
msgid "exit the bare display mode on any changes in input"
msgstr "beendet den einfachen Anzeigemodus durch Tastendruck"
#, fuzzy
#| msgid ""
#| "time format in bare display mode (see man strftime for date/time "
#| "specifiers)"
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"Format für die Zeitanzeige im einfachen Anzeigemodus, \"time\" (siehe man "
"strftime, welche Platzhalter für das Datum und die Uhrzeit verwendet werden)"
@@ -4380,11 +4386,20 @@ msgstr ""
"(prefix), Präfix und Nachricht (prefix_message)"
#. TRANSLATORS: string "${color:xxx}" must NOT be translated
#, fuzzy
#| msgid ""
#| "time format for each line displayed in buffers (see man strftime for date/"
#| "time specifiers) (note: content is evaluated, so you can use colors with "
#| "format \"${color:xxx}\", see /help eval); for example time using "
#| "grayscale: \"${color:252}%H${color:243}%M${color:237}%S\""
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"Format für die Uhrzeit, die in jeder Zeile eines Buffers dargestellt wird "
"(siehe man strftime, welche Platzhalter für das Datum und die Uhrzeit "
@@ -5081,8 +5096,11 @@ msgstr ""
"Text der nach dem Nick dargestellt werden soll, wenn die Nachricht gequotet "
"wird (siehe /help cursor)"
msgid "time format when quoting a message (see /help cursor)"
msgstr "Zeitformat wenn eine Nachricht gequotet wird (siehe /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
@@ -5855,7 +5873,6 @@ msgstr "Speicheranzeige nicht verfügbar (Funktion \"mallinfo\" nicht gefunden)"
msgid "not initialized"
msgstr "nicht initialisiert"
#| msgid "no variable"
msgid "not available"
msgstr "nicht verfügbar"
@@ -10530,12 +10547,20 @@ msgstr ""
msgid "> `m:xxx`: show only IRC command \"xxx\""
msgstr "> `m:xxx`: zeigt nur IRC Befehl \"xxx\" an"
#, fuzzy
#| msgid ""
#| "> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
#| "using following variables: output of function irc_message_parse (like "
#| "nick, command, channel, text, etc., see function info_get_hashtable in "
#| "plugin API reference for the list of all variables), date (format: \"yyyy-"
#| "mm-dd hh:mm:ss\"), server, recv, sent, modified, redirected"
msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
"> `c:xxx`: zeigt nur Nachrichten an auf die die evaluierte Bedingung \"xxx\" "
"zutrifft, folgende Variablen können verwendet werden: Ausgabe der Funktion "
@@ -11427,9 +11452,14 @@ msgstr ""
"nutzt die selbe Farbe für die Darstellung des Nicks im Kanal wie auch im "
"privaten Buffer"
#, fuzzy
#| msgid ""
#| "time format used in answer to message CTCP TIME (see man strftime for "
#| "date/time specifiers)"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"Format für die Zeitanzeige die bei einer CTCP TIME Anfrage zurückgesendet "
"wird (siehe man strftime, welche Platzhalter für das Datum und die Uhrzeit "
@@ -13676,7 +13706,13 @@ msgstr ""
"Option ändern,sollte sie zuerst den Komprimierungstyp über die Option logger."
"file festlegen.rotation_compression_type"
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"Zeitstempel in Protokoll-Datei nutzen (siehe man strftime, welche "
"Platzhalter für das Datum und die Uhrzeit verwendet werden)"
@@ -16433,8 +16469,7 @@ msgstr "verwaltet Trigger, das Schweizer Armeemesser für WeeChat"
msgid ""
"list [-o|-ol|-i|-il] || listfull || listdefault || add|addoff|addreplace "
"<name> <hook> "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<"
"return_code>\" [\"<post_action>\"]]]]]] "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<return_code>\" [\"<post_action>\"]]]]]] "
"|| addinput [<hook>] || input|output|recreate <name> || set <name> <option> "
"<value> || rename|copy <name> <new_name> || enable|disable|toggle [<name>|"
"<mask> [<name>|<mask>...]] || restart <name>|<mask> [<name>|<mask>...] || "
@@ -16443,8 +16478,7 @@ msgid ""
msgstr ""
"list [-o|-ol|-i|-il] || listfull || listdefault || add|addoff|addreplace "
"<name> <hook> "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<"
"return_code>\" [\"<post_action>\"]]]]]] "
"[\"<arguments>\" [\"<conditions>\" [\"<regex>\" [\"<command>\" [\"<return_code>\" [\"<post_action>\"]]]]]] "
"|| addinput [<hook>] || input|output|recreate <name> || set <name> <option> "
"<value> || rename|copy <name> <new_name> || enable|disable|toggle [<name>|"
"<mask> [<name>|<mask>...]] || restart <name>|<mask> [<name>|<mask>...] || "
@@ -17443,3 +17477,5 @@ msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr ""
"%s%s: Verbindung konnte nicht hergestellt werden: unerwarteter Fehler (%d)"
#~ msgid "time format when quoting a message (see /help cursor)"
#~ msgstr "Zeitformat wenn eine Nachricht gequotet wird (siehe /help cursor)"
+30 -10
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3997,7 +3997,9 @@ msgstr ""
#, fuzzy
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"formato de hora para el elemento de barra \"time\" (ver el manual de "
"strftime para los especificadores de fecha/hora)"
@@ -4051,9 +4053,12 @@ msgstr ""
#, fuzzy
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"formato de hora en el registro (ver el manual de strftime para los "
"especificadores de fecha/hora), se pueden usar colores con el formato "
@@ -4645,7 +4650,10 @@ msgstr "texto a mostrar antes del apodo en la ventana de charla"
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr "texto a mostrar tras el apodo en la ventana de charla"
msgid "time format when quoting a message (see /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
@@ -9708,8 +9716,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -10549,9 +10558,14 @@ msgstr "usar color del apodo en mensajes del servidor"
msgid "use same nick color for channel and private"
msgstr "usar el mismo color de apodo en el canal y conversaciones privadas"
#, fuzzy
#| msgid ""
#| "time format used in answer to message CTCP TIME (see man strftime for "
#| "date/time specifiers)"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"formato de hora usado en respuesta al mensaje CTCP TIME (consultar man "
"strftime para las especificaciones de fecha/hora)"
@@ -12663,7 +12677,13 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"formato de hora en el registro (ver el manual de strftime para los "
"especificadores de fecha/hora)"
+51 -21
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"PO-Revision-Date: 2023-12-24 16:47+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-12-26 19:00+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -4212,10 +4212,14 @@ msgstr ""
"ligne de commande"
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"format de date/heure dans l'affichage dépouillé (\"bare\") (voir man "
"strftime pour le format de date/heure)"
"strftime pour le format de date/heure, des caractères de conversion "
"supplémentaires sont supportés, voir la fonction util_strftimeval dans la "
"Référence API extension)"
msgid ""
"automatically renumber buffers to have only consecutive numbers and start "
@@ -4281,15 +4285,21 @@ msgstr ""
#. TRANSLATORS: string "${color:xxx}" must NOT be translated
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"format de date/heure pour chaque ligne affichée dans les tampons (voir man "
"strftime pour le format de date/heure) (note : le contenu est évalué, donc "
"vous pouvez utiliser des couleurs avec le format \"${color:xxx}\", voir /"
"help eval) ; par exemple l'heure avec des niveaux de gris : "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"strftime pour le format de date/heure, des caractères de conversion "
"supplémentaires sont supportés, voir la fonction util_strftimeval dans la "
"Référence API extension) (note : le contenu est évalué, donc vous pouvez "
"utiliser des couleurs avec le format \"${color:xxx}\", voir /help eval) ; "
"par exemple l'heure avec des niveaux de gris : "
"\"${color:252}%H${color:243}%M${color:237}%S\", le même format avec des "
"millisecondes : \"${color:252}%H${color:243}%M${color:237}%S.%.3\""
#. TRANSLATORS: string "${color:xxx}" must NOT be translated
msgid ""
@@ -4955,8 +4965,15 @@ msgstr ""
"texte à afficher après le pseudo dans la citation d'un message (voir /help "
"cursor)"
msgid "time format when quoting a message (see /help cursor)"
msgstr "format de date/heure dans la citation d'un message (voir /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"format de date/heure dans la citation d'un message (voir /help cursor) (voir "
"man strftime pour le format de date/heure, des caractères de conversion "
"supplémentaires sont supportés, voir la fonction util_strftimeval dans la "
"Référence API extension)"
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
@@ -10345,15 +10362,17 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
"> `c:xxx` : afficher seulement les messages qui correspondent à la condition "
"évaluée \"xxx\", en utilisant les variables suivantes : sortie de la "
"fonction irc_message_parse (comme nick, command, channel, text, etc., voir "
"la fonction info_get_hashtable dans la référence API extension pour la liste "
"de toutes les variables), date (format : \"yyyy-mm-dd hh:mm:ss\"), server, "
"recv, sent, modified, redirected"
"de toutes les variables), date (format : \"%FT%T.%f\", voir la fonction "
"util_strftimeval dans la Référence API extension), server, recv, sent, "
"modified, redirected"
msgid "list services currently connected to the network"
msgstr "lister les services actuellement connectés au réseau"
@@ -11209,10 +11228,13 @@ msgstr "utiliser la même couleur de pseudo pour le canal et le privé"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"format de date/heure utilisé pour la réponse au message CTCP TIME (voir man "
"strftime pour le format de date/heure)"
"strftime pour le format de date/heure, des caractères de conversion "
"supplémentaires sont supportés, voir la fonction util_strftimeval dans la "
"Référence API extension)"
msgid ""
"display ACCOUNT messages received when capability account-notify is enabled"
@@ -13390,10 +13412,14 @@ msgstr ""
"devriez d'abord définir le type de compression via l'option logger.file."
"rotation_compression_type"
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"format de date/heure utilisé dans les fichiers log (voir man strftime pour "
"le format de date/heure)"
"le format de date/heure, des caractères de conversion supplémentaires sont "
"supportés, voir la fonction util_strftimeval dans la Référence API extension)"
msgid "path to current log filename for the buffer"
msgstr "chemin vers le fichier de log pour le tampon"
@@ -17102,3 +17128,7 @@ msgstr "%s%s : délai d'attente dépassé pour \"%s\" avec %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s : impossible de se connecter : erreur inattendue (%d)"
#~ msgid "time format when quoting a message (see /help cursor)"
#~ msgstr ""
#~ "format de date/heure dans la citation d'un message (voir /help cursor)"
+23 -10
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3703,7 +3703,9 @@ msgstr ""
#, fuzzy
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr "új nap kezdetével megjelenő időbélyeg"
msgid ""
@@ -3750,9 +3752,12 @@ msgstr ""
#, fuzzy
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr "új nap kezdetével megjelenő időbélyeg"
#. TRANSLATORS: string "${color:xxx}" must NOT be translated
@@ -4216,7 +4221,10 @@ msgstr "a név előtt megjelenítendő szöveg a beszédablakban"
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr "a név után megjelenítendő szöveg a beszédablakban"
msgid "time format when quoting a message (see /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
#, fuzzy
@@ -9121,8 +9129,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -9925,7 +9934,8 @@ msgstr "másik fél nevének színe privát beszélgetésben"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid ""
@@ -11852,7 +11862,10 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
msgid "path to current log filename for the buffer"
+30 -10
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3904,7 +3904,9 @@ msgstr ""
#, fuzzy
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"formato dell'ora per l'elemento barra \"time\" (consultare man strftime per "
"gli specificatori data/ora)"
@@ -3958,9 +3960,12 @@ msgstr ""
#, fuzzy
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"formato dell'ora per ogni riga visualizzata nei buffer (consultare man "
"strftime per gli specificatori data/ora), i colori sono consentiti nel "
@@ -4564,7 +4569,10 @@ msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
"testo da visualizzare dopo il nick nel prefisso del messaggio, esempio: \">\""
msgid "time format when quoting a message (see /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
@@ -9699,8 +9707,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -10546,9 +10555,14 @@ msgstr "usa i colori dei nick nei messaggi dal server"
msgid "use same nick color for channel and private"
msgstr "usa lo stesso colore del nick per canale e privato"
#, fuzzy
#| msgid ""
#| "time format used in answer to message CTCP TIME (see man strftime for "
#| "date/time specifiers)"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"formato dell'ora in risposta al messaggio CTCP TIME (consultare man strftime "
"per i dettagli su data/ora)"
@@ -12673,7 +12687,13 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"data e ora usati nei file di log (consultare man strftime per gli "
"specificatori di data/ora)"
+38 -11
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -4024,8 +4024,14 @@ msgstr ""
msgid "exit the bare display mode on any changes in input"
msgstr "入力の変更に対する最小限表示モードを終了する"
#, fuzzy
#| msgid ""
#| "time format in bare display mode (see man strftime for date/time "
#| "specifiers)"
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"最小限表示モードで使う時間書式 (日付/時間指定子は strftime の man を参照して"
"ください)"
@@ -4097,9 +4103,12 @@ msgstr ""
#| "\"${color:252}%H${color:245}%M${color:240}%S\""
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"バッファに表示される行に付く時間書式 (日付/時間の指定子は strftime の man を"
"参照してください) (注意: 値は評価されるため \"${color:xxx}\" 書式で色を指定出"
@@ -4725,8 +4734,11 @@ msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
"メッセージを引用する際にニックネームの後につけるテキスト (/help cursor 参照)"
msgid "time format when quoting a message (see /help cursor)"
msgstr "メッセージを引用する際の時間書式 (/help cursor を参照してください)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr "最初の未読行を表示するマーカー (line か char) をバッファ内で使用"
@@ -9977,8 +9989,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -10890,9 +10903,14 @@ msgstr "サーバからのメッセージにニックネーム色を利用"
msgid "use same nick color for channel and private"
msgstr "チャンネルとプライベートバッファで同じニックネーム色を利用"
#, fuzzy
#| msgid ""
#| "time format used in answer to message CTCP TIME (see man strftime for "
#| "date/time specifiers)"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"CTCP TIME メッセージに対する応答に利用される時間書式 (日付/時間指定子は "
"strftime の man を参照してください)"
@@ -13079,7 +13097,13 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"ログファイルで使用するタイムスタンプ (日付/時間指定子は strftime の man 参照)"
@@ -16654,3 +16678,6 @@ msgstr "%s%s: \"%s\" のタイムアウト %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: 接続できません: 未定義のエラー (%d)"
#~ msgid "time format when quoting a message (see /help cursor)"
#~ msgstr "メッセージを引用する際の時間書式 (/help cursor を参照してください)"
+51 -11
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-12-04 21:07+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@@ -4101,8 +4101,14 @@ msgid "exit the bare display mode on any changes in input"
msgstr ""
"wyjście z trybu niesformatowanego wyświetlania po każdej zmianie wejścia"
#, fuzzy
#| msgid ""
#| "time format in bare display mode (see man strftime for date/time "
#| "specifiers)"
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"format czasu dla trybu niesformatowanego wyświetlania (zobacz man strftime "
"dla specyfikatorów daty/czasu)"
@@ -4168,11 +4174,20 @@ msgstr ""
"i wiadomości"
#. TRANSLATORS: string "${color:xxx}" must NOT be translated
#, fuzzy
#| msgid ""
#| "time format for each line displayed in buffers (see man strftime for date/"
#| "time specifiers) (note: content is evaluated, so you can use colors with "
#| "format \"${color:xxx}\", see /help eval); for example time using "
#| "grayscale: \"${color:252}%H${color:243}%M${color:237}%S\""
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"format czasu używany dla każdej linii w buforach (zobacz man strftime dla "
"specyfikatorów daty/czasu) (uwaga: zawartość jest przetwarzana, dlatego "
@@ -4821,8 +4836,11 @@ msgstr ""
"teks wyświetlany za nickiem podczas cytowania wiadomości (zobacz /help "
"cursor)"
msgid "time format when quoting a message (see /help cursor)"
msgstr "format czasu podczas cytowania wiadomości (zobacz /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
@@ -10034,12 +10052,20 @@ msgstr ""
msgid "> `m:xxx`: show only IRC command \"xxx\""
msgstr "> `m:xxx`: pokaż tylko komendę IRC „xxx”"
#, fuzzy
#| msgid ""
#| "> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
#| "using following variables: output of function irc_message_parse (like "
#| "nick, command, channel, text, etc., see function info_get_hashtable in "
#| "plugin API reference for the list of all variables), date (format: \"yyyy-"
#| "mm-dd hh:mm:ss\"), server, recv, sent, modified, redirected"
msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
"> `c:xxx`: pokaż tylko wiadomości pasujące to przetworzonego warunku „xxx”, "
"używając następujących zmiennych: wynik funkcji irc_message_parse (jak nick, "
@@ -10884,9 +10910,14 @@ msgstr "użyj koloru nicka w wiadomościach od serwera"
msgid "use same nick color for channel and private"
msgstr "użyj takiego samego koloru nicka na kanałach i prywatnych rozmowach"
#, fuzzy
#| msgid ""
#| "time format used in answer to message CTCP TIME (see man strftime for "
#| "date/time specifiers)"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"format czasu używany w odpowiedzi na wiadomość CTCP TIME (zobacz man "
"strftime dla specyfikatorów daty/czasu)"
@@ -13022,7 +13053,13 @@ msgstr ""
"przed zmianą tej opcji powinieneś najpierw ustawić typ kompresji za pomocą "
"opcji logger.file.rotation_compression_type"
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"format czasu użyty w plikach z logami (zobacz man strftime dla "
"specyfikatorów daty/czasu)"
@@ -16630,3 +16667,6 @@ msgstr "%s%s: przekroczono czas na \"%s\" z %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: nie można połączyć: niespodziewany błąd (%d)"
#~ msgid "time format when quoting a message (see /help cursor)"
#~ msgstr "format czasu podczas cytowania wiadomości (zobacz /help cursor)"
+38 -11
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -4035,8 +4035,14 @@ msgstr ""
msgid "exit the bare display mode on any changes in input"
msgstr "sair da apresentação básica ao escrever na entrada"
#, fuzzy
#| msgid ""
#| "time format in bare display mode (see man strftime for date/time "
#| "specifiers)"
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"formato de data/hora na apresentação básica (ver man strftime para "
"especificadores de data/hora)"
@@ -4110,9 +4116,12 @@ msgstr ""
#| "\"${color:252}%H${color:245}%M${color:240}%S\""
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"formato de data/hora de cada linha mostrada no buffer (ver man strftime para "
"especificadores de data/hora) (nota: o conteúdo é avaliado, por isso pode "
@@ -4755,8 +4764,11 @@ msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
"texto a apresentar depois do nick ao citar uma mensagem (ver /help cursor)"
msgid "time format when quoting a message (see /help cursor)"
msgstr "formato de data/hora ao citar uma mensagem (ver /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
@@ -9972,8 +9984,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -10861,9 +10874,14 @@ msgstr "usar nicks com cores em mensagens do servidor"
msgid "use same nick color for channel and private"
msgstr "usar a mesma cor para o nick no canal e em privado"
#, fuzzy
#| msgid ""
#| "time format used in answer to message CTCP TIME (see man strftime for "
#| "date/time specifiers)"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"formato de data/hora usado para responder a mensagens CTCP (ver man strftime "
"para especificadores de data/hora)"
@@ -13024,7 +13042,13 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"carimbo de data/hora usado nos ficheiros de registo (ver man strftime para "
"especificadores de data/hora)"
@@ -16623,3 +16647,6 @@ msgstr "%s%s: tempo limite de \"%s\" com %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: não foi possível conectar: erro inesperado (%d)"
#~ msgid "time format when quoting a message (see /help cursor)"
#~ msgstr "formato de data/hora ao citar uma mensagem (ver /help cursor)"
+26 -10
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-10-20 13:11+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3924,7 +3924,9 @@ msgstr ""
#, fuzzy
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"formato de tempo para o item de barra \"time\" (veja man strftime para "
"especificadores de data/tempo)"
@@ -3985,9 +3987,12 @@ msgstr ""
#| "\"${color:252}%H${color:245}%M${color:240}%S\""
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"formato de tempo para cada linha mostrada nos buffers (veja man strftime "
"para especificadores de data/tempo) (nota: o conteúdo é avaliado, então voce "
@@ -4532,7 +4537,10 @@ msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
"texto a ser exibido depois do apelido no prefixo da mensage, examplo: \">\""
msgid "time format when quoting a message (see /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
@@ -9454,8 +9462,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -10230,7 +10239,8 @@ msgstr "utilizar a mesma cor de apelido para canal e privado"
#, fuzzy
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"formato de tempo para o item de barra \"time\" (veja man strftime para "
"especificadores de data/tempo)"
@@ -12217,7 +12227,13 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"marca de tempo utilizada nos arquivos de registro (veja \"man strftime\" "
"para especificadores de data/tempo)"
+23 -10
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3726,7 +3726,9 @@ msgstr ""
#, fuzzy
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr "отображение маркера даты при смене дня"
msgid ""
@@ -3773,9 +3775,12 @@ msgstr ""
#, fuzzy
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr "отображение маркера даты при смене дня"
#. TRANSLATORS: string "${color:xxx}" must NOT be translated
@@ -4249,7 +4254,10 @@ msgstr "текст, который отображать до ника в окн
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr "текст, который отображать после ника в окне чата"
msgid "time format when quoting a message (see /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
#, fuzzy
@@ -9163,8 +9171,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -9965,7 +9974,8 @@ msgstr "цвет ника собеседника в окне привата"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid ""
@@ -11902,7 +11912,10 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
msgid "path to current log filename for the buffer"
+51 -11
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-12-05 14:55+0400\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4092,8 +4092,14 @@ msgstr ""
msgid "exit the bare display mode on any changes in input"
msgstr "режим огољеног приказа се напушта при било каквој промени уноса"
#, fuzzy
#| msgid ""
#| "time format in bare display mode (see man strftime for date/time "
#| "specifiers)"
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"формат времена у режиму огољеног приказа (погледајте man strftime за "
"спецификаторе датума/времена)"
@@ -4161,11 +4167,20 @@ msgstr ""
"подразумевана претрага текста у баферу: у поруци, префиксу, префиксу и поруци"
#. TRANSLATORS: string "${color:xxx}" must NOT be translated
#, fuzzy
#| msgid ""
#| "time format for each line displayed in buffers (see man strftime for date/"
#| "time specifiers) (note: content is evaluated, so you can use colors with "
#| "format \"${color:xxx}\", see /help eval); for example time using "
#| "grayscale: \"${color:252}%H${color:243}%M${color:237}%S\""
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"формат времена за сваку линију која се приказује у баферима (погледајте man "
"strftime за спецификаторе датума/времена) (напомена: садржај се израчунава, "
@@ -4809,8 +4824,11 @@ msgstr ""
"текст који се приказује након надимка када се цитира порука (погледајте /"
"help cursor)"
msgid "time format when quoting a message (see /help cursor)"
msgstr "формат времена када се цитира порука (погледајте /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
@@ -10013,12 +10031,20 @@ msgstr ""
msgid "> `m:xxx`: show only IRC command \"xxx\""
msgstr "> `m:xxx`: приказ само IRC команде „xxx”"
#, fuzzy
#| msgid ""
#| "> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
#| "using following variables: output of function irc_message_parse (like "
#| "nick, command, channel, text, etc., see function info_get_hashtable in "
#| "plugin API reference for the list of all variables), date (format: \"yyyy-"
#| "mm-dd hh:mm:ss\"), server, recv, sent, modified, redirected"
msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
"> `c:xxx`: приказ само порука које се подударају са израчунатим условом "
"„xxx”, користећи следеће променљиве: излаз функције irc_message_parse (као "
@@ -10863,9 +10889,14 @@ msgstr "у порукама са сервера се користе обојен
msgid "use same nick color for channel and private"
msgstr "иста боја надимка се користи и за канал и за приватни разговор"
#, fuzzy
#| msgid ""
#| "time format used in answer to message CTCP TIME (see man strftime for "
#| "date/time specifiers)"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"формат времена који се користи у одговору на CTCP поруку TIME (погледајте "
"man strftime за спецификаторе датума/времена)"
@@ -12998,7 +13029,13 @@ msgstr ""
"пре него што промените ову опцију, требало би најпре да поставите тип "
"компресије опцијом logger.file.rotation_compression_type"
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"временска ознака која се користи у лог фајловима (погледајте man strftime за "
"спецификаторе датума/времена)"
@@ -16588,3 +16625,6 @@ msgstr "%s%s: тајмаут за „%s” са %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: повезивање није успело: неочекивана грешка (%d)"
#~ msgid "time format when quoting a message (see /help cursor)"
#~ msgstr "формат времена када се цитира порука (погледајте /help cursor)"
+39 -11
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2023-11-29 09:59+0100\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -4049,8 +4049,14 @@ msgstr ""
msgid "exit the bare display mode on any changes in input"
msgstr "girdide bir değişiklik olursa çıplak ekran kipinden çık"
#, fuzzy
#| msgid ""
#| "time format in bare display mode (see man strftime for date/time "
#| "specifiers)"
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
"çıplak ekran kipinde zaman biçimi (tarih/zaman belirticileri için man "
"strftime yapın)"
@@ -4121,9 +4127,12 @@ msgstr "arabellekteki öntanımlı metin arama: iletide, önek, önek ve ileti"
#| "\"${color:252}%H${color:245}%M${color:240}%S\""
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
"arabelleklerde görüntülenen her satır için zaman biçimi (tarih/zaman "
"belirticileri için man strftime yapın) (not: içerik değerlendirilir, böylece "
@@ -4758,8 +4767,11 @@ msgstr ""
"bir iletiyi alıntılarken takma addan sonra görüntülenecek metin (bkz. /help "
"cursor)"
msgid "time format when quoting a message (see /help cursor)"
msgstr "bir iletiyi alıntılarken kullanılacak zaman biçimi (bkz. /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
msgstr ""
@@ -10093,8 +10105,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -11029,9 +11042,14 @@ msgstr "sunucu iletilerinde takma ad rengini kullan"
msgid "use same nick color for channel and private"
msgstr "kanal ve özel arabellekler için aynı takma ad rengini kullan"
#, fuzzy
#| msgid ""
#| "time format used in answer to message CTCP TIME (see man strftime for "
#| "date/time specifiers)"
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
"CTCP TIME ileti yanıtlarında kullanılan zaman biçimi (zaman belirticileri "
"için bkz. man strftime)"
@@ -13217,7 +13235,13 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
#, fuzzy
#| msgid ""
#| "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
"günlük dosyalarında kullanılan zaman damgası (tarih/zaman belirticileri için "
"bkz. /man strftime)"
@@ -16864,3 +16888,7 @@ msgstr "%s%s: \"%s\" için %s ile zaman aşımı"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: Bağlanılamıyor: Beklenmedik hata (%d)"
#~ msgid "time format when quoting a message (see /help cursor)"
#~ msgstr ""
#~ "bir iletiyi alıntılarken kullanılacak zaman biçimi (bkz. /help cursor)"
+23 -10
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-12-24 16:45+0100\n"
"POT-Creation-Date: 2023-12-26 18:55+0100\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3462,7 +3462,9 @@ msgid "exit the bare display mode on any changes in input"
msgstr ""
msgid ""
"time format in bare display mode (see man strftime for date/time specifiers)"
"time format in bare display mode (see API man strftime for date/time "
"specifiers, extra specifiers are supported, see function util_strftimeval in "
"Plugin API reference)"
msgstr ""
msgid ""
@@ -3508,9 +3510,12 @@ msgstr ""
#. TRANSLATORS: string "${color:xxx}" must NOT be translated
msgid ""
"time format for each line displayed in buffers (see man strftime for date/"
"time specifiers) (note: content is evaluated, so you can use colors with "
"format \"${color:xxx}\", see /help eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference) (note: content is evaluated, so "
"you can use colors with format \"${color:xxx}\", see /help eval); for "
"example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""
msgstr ""
#. TRANSLATORS: string "${color:xxx}" must NOT be translated
@@ -3947,7 +3952,10 @@ msgstr ""
msgid "text to display after nick when quoting a message (see /help cursor)"
msgstr ""
msgid "time format when quoting a message (see /help cursor)"
msgid ""
"time format when quoting a message (see /help cursor) (see man strftime for "
"date/time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid "use a marker (line or char) on buffers to show first unread line"
@@ -8361,8 +8369,9 @@ msgid ""
"> `c:xxx`: show only messages matching the evaluated condition \"xxx\", "
"using following variables: output of function irc_message_parse (like nick, "
"command, channel, text, etc., see function info_get_hashtable in plugin API "
"reference for the list of all variables), date (format: \"yyyy-mm-dd hh:mm:"
"ss\"), server, recv, sent, modified, redirected"
"reference for the list of all variables), date (format: \"%FT%T.%f\", see "
"function util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"
msgstr ""
msgid "list services currently connected to the network"
@@ -9013,7 +9022,8 @@ msgstr ""
msgid ""
"time format used in answer to message CTCP TIME (see man strftime for date/"
"time specifiers)"
"time specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"
msgstr ""
msgid ""
@@ -10833,7 +10843,10 @@ msgid ""
"rotation_compression_type"
msgstr ""
msgid "timestamp used in log files (see man strftime for date/time specifiers)"
msgid ""
"timestamp used in log files (see man strftime for date/time specifiers, "
"extra specifiers are supported, see function util_strftimeval in Plugin API "
"reference)"
msgstr ""
msgid "path to current log filename for the buffer"
+2
View File
@@ -168,7 +168,9 @@ hook_line_exec (struct t_gui_line *line)
gui_buffer_type_string[line->data->buffer->type]);
HASHTABLE_SET_INT("y", line->data->y);
HASHTABLE_SET_TIME("date", line->data->date);
HASHTABLE_SET_INT("date_usec", line->data->date_usec);
HASHTABLE_SET_TIME("date_printed", line->data->date_printed);
HASHTABLE_SET_INT("date_usec_printed", line->data->date_usec_printed);
HASHTABLE_SET_STR_NOT_NULL("str_time", line->data->str_time);
HASHTABLE_SET_INT("tags_count", line->data->tags_count);
str_tags = string_rebuild_split_string (
+1
View File
@@ -168,6 +168,7 @@ hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line)
ptr_hook->callback_data,
buffer,
line->data->date,
line->data->date_usec,
line->data->tags_count,
(const char **)line->data->tags_array,
(int)line->data->displayed, (int)line->data->highlight,
+4 -4
View File
@@ -31,10 +31,10 @@ struct t_gui_line;
typedef int (t_hook_callback_print)(const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date, int tags_count,
const char **tags, int displayed,
int highlight, const char *prefix,
const char *message);
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message);
struct t_hook_print
{
+15 -29
View File
@@ -415,9 +415,7 @@ hook_timer_add_to_infolist (struct t_infolist_item *item,
void
hook_timer_print_log (struct t_hook *hook)
{
struct tm *local_time;
time_t seconds;
char text_time[1024];
char text_time[128];
if (!hook || !hook->hook_data)
return;
@@ -427,30 +425,18 @@ hook_timer_print_log (struct t_hook *hook)
log_printf (" interval. . . . . . . : %ld", HOOK_TIMER(hook, interval));
log_printf (" align_second. . . . . : %d", HOOK_TIMER(hook, align_second));
log_printf (" remaining_calls . . . : %d", HOOK_TIMER(hook, remaining_calls));
text_time[0] = '\0';
seconds = HOOK_TIMER(hook, last_exec).tv_sec;
local_time = localtime (&seconds);
if (local_time)
{
if (strftime (text_time, sizeof (text_time),
"%d/%m/%Y %H:%M:%S", local_time) == 0)
text_time[0] = '\0';
}
log_printf (" last_exec.tv_sec. . . : %lld (%s)",
(long long)(HOOK_TIMER(hook, last_exec.tv_sec)),
text_time);
log_printf (" last_exec.tv_usec . . : %ld", HOOK_TIMER(hook, last_exec.tv_usec));
text_time[0] = '\0';
seconds = HOOK_TIMER(hook, next_exec).tv_sec;
local_time = localtime (&seconds);
if (local_time)
{
if (strftime (text_time, sizeof (text_time),
"%d/%m/%Y %H:%M:%S", local_time) == 0)
text_time[0] = '\0';
}
log_printf (" next_exec.tv_sec. . . : %lld (%s)",
(long long)(HOOK_TIMER(hook, next_exec.tv_sec)),
text_time);
log_printf (" next_exec.tv_usec . . : %ld", HOOK_TIMER(hook, next_exec.tv_usec));
util_strftimeval (text_time, sizeof (text_time),
"%Y-%m-%dT%H:%M:%S.%f", &(HOOK_TIMER(hook, last_exec)));
log_printf (" last_exec . . . . . . : %s", text_time);
log_printf (" tv_sec. . . . . . . : %lld",
(long long)(HOOK_TIMER(hook, last_exec.tv_sec)));
log_printf (" tv_usec. . . . . . : %ld",
HOOK_TIMER(hook, last_exec.tv_usec));
util_strftimeval (text_time, sizeof (text_time),
"%Y-%m-%dT%H:%M:%S.%f", &(HOOK_TIMER(hook, next_exec)));
log_printf (" last_exec . . . . . . : %s", text_time);
log_printf (" tv_sec. . . . . . . : %lld",
(long long)(HOOK_TIMER(hook, next_exec.tv_sec)));
log_printf (" tv_usec. . . . . . : %ld",
HOOK_TIMER(hook, next_exec.tv_usec));
}
+14 -7
View File
@@ -3170,8 +3170,9 @@ config_weechat_init_options ()
config_look_bare_display_time_format = config_file_new_option (
weechat_config_file, weechat_config_section_look,
"bare_display_time_format", "string",
N_("time format in bare display mode (see man strftime for "
"date/time specifiers)"),
N_("time format in bare display mode (see API man strftime for "
"date/time specifiers, extra specifiers are supported, see "
"function util_strftimeval in Plugin API reference)"),
NULL, 0, 0, "%H:%M", NULL, 0,
NULL, NULL, NULL,
&config_change_buffer_content, NULL, NULL,
@@ -3250,10 +3251,14 @@ config_weechat_init_options ()
"buffer_time_format", "string",
/* TRANSLATORS: string "${color:xxx}" must NOT be translated */
N_("time format for each line displayed in buffers (see man "
"strftime for date/time specifiers) (note: content is evaluated, "
"so you can use colors with format \"${color:xxx}\", see /help "
"eval); for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\""),
"strftime for date/time specifiers, extra specifiers are "
"supported, see function util_strftimeval in Plugin API reference) "
"(note: content is evaluated, so you can use colors with format "
"\"${color:xxx}\", see /help eval); "
"for example time using grayscale: "
"\"${color:252}%H${color:243}%M${color:237}%S\", "
"the same with milliseconds: "
"\"${color:252}%H${color:243}%M${color:237}%S.%.3\""),
NULL, 0, 0, "%H:%M:%S", NULL, 0,
NULL, NULL, NULL,
&config_change_buffer_time_format, NULL, NULL,
@@ -4060,7 +4065,9 @@ config_weechat_init_options ()
config_look_quote_time_format = config_file_new_option (
weechat_config_file, weechat_config_section_look,
"quote_time_format", "string",
N_("time format when quoting a message (see /help cursor)"),
N_("time format when quoting a message (see /help cursor) "
"(see man strftime for date/time specifiers, extra specifiers "
"are supported, see function util_strftimeval in Plugin API reference)"),
NULL, 0, 0, "%H:%M:%S", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_read_marker = config_file_new_option (
+20 -14
View File
@@ -636,13 +636,16 @@ upgrade_weechat_read_buffer_line (struct t_infolist *infolist)
switch (upgrade_current_buffer->type)
{
case GUI_BUFFER_TYPE_FORMATTED:
new_line = gui_line_new (upgrade_current_buffer,
-1,
infolist_time (infolist, "date"),
infolist_time (infolist, "date_printed"),
infolist_string (infolist, "tags"),
infolist_string (infolist, "prefix"),
infolist_string (infolist, "message"));
new_line = gui_line_new (
upgrade_current_buffer,
-1,
infolist_time (infolist, "date"),
infolist_integer (infolist, "date_usec"),
infolist_time (infolist, "date_printed"),
infolist_integer (infolist, "date_usec_printed"),
infolist_string (infolist, "tags"),
infolist_string (infolist, "prefix"),
infolist_string (infolist, "message"));
if (new_line)
{
new_line->data->id = infolist_integer (infolist, "id");
@@ -654,13 +657,16 @@ upgrade_weechat_read_buffer_line (struct t_infolist *infolist)
}
break;
case GUI_BUFFER_TYPE_FREE:
new_line = gui_line_new (upgrade_current_buffer,
infolist_integer (infolist, "y"),
infolist_time (infolist, "date"),
infolist_time (infolist, "date_printed"),
infolist_string (infolist, "tags"),
NULL,
infolist_string (infolist, "message"));
new_line = gui_line_new (
upgrade_current_buffer,
infolist_integer (infolist, "y"),
infolist_time (infolist, "date"),
infolist_integer (infolist, "date_usec"),
infolist_time (infolist, "date_printed"),
infolist_integer (infolist, "date_usec_printed"),
infolist_string (infolist, "tags"),
NULL,
infolist_string (infolist, "message"));
if (new_line)
{
new_line->data->id = infolist_integer (infolist, "id");
+73
View File
@@ -163,6 +163,79 @@ util_get_time_string (const time_t *date)
return text_time;
}
/*
* Formats date and time like strftime and adds additional formats for support
* of microseconds: "%.N" where N is an integer between 1 and 6: first N
* digits of microseconds (for example "%.3" is milliseconds, on 3 digits).
* Format "%f" is an alias of "%.6" (microseconds, zero-padded to 6 digits).
*/
int
util_strftimeval (char *string, int max, const char *format, struct timeval *tv)
{
char **format2, str_usec[32];
const char *ptr_format;
struct tm *local_time;
int length, bytes;
if (!string || (max <= 0) || !format || !tv)
return 0;
string[0] = '\0';
if (!format[0])
return 0;
format2 = string_dyn_alloc (strlen (format) + 1);
if (!format2)
return 0;
ptr_format = format;
while (ptr_format && ptr_format[0])
{
if ((ptr_format[0] == '%') && (ptr_format[1] == '%'))
{
string_dyn_concat (format2, "%%", -1);
ptr_format += 2;
}
else if ((ptr_format[0] == '%') && (ptr_format[1] == '.')
&& (ptr_format[2] >= '1') && (ptr_format[2] <= '6'))
{
snprintf (str_usec, sizeof (str_usec),
"%06ld", (long)(tv->tv_usec));
length = ptr_format[2] - '1' + 1;
str_usec[length] = '\0';
string_dyn_concat (format2, str_usec, -1);
ptr_format += 3;
}
else if ((ptr_format[0] == '%') && (ptr_format[1] == 'f'))
{
snprintf (str_usec, sizeof (str_usec),
"%06ld", (long)(tv->tv_usec));
string_dyn_concat (format2, str_usec, -1);
ptr_format += 2;
}
else
{
string_dyn_concat (format2, ptr_format, 1);
ptr_format++;
}
}
local_time = localtime (&(tv->tv_sec));
if (!local_time)
{
string_dyn_free (format2, 1);
return 0;
}
bytes = strftime (string, max, *format2, local_time);
string_dyn_free (format2, 1);
return bytes;
}
/*
* Returns difference between two times.
*
+2
View File
@@ -31,6 +31,8 @@ extern void util_timeval_add (struct timeval *tv, long long interval);
/* time */
extern char *util_get_microseconds_string (long long diff);
extern const char *util_get_time_string (const time_t *date);
extern int util_strftimeval (char *string, int max, const char *format,
struct timeval *tv);
extern void util_get_time_diff (time_t time1, time_t time2,
time_t *total_seconds,
int *days, int *hours, int *minutes,
+7 -6
View File
@@ -35,6 +35,7 @@
#include "../../core/wee-hook.h"
#include "../../core/wee-string.h"
#include "../../core/wee-utf8.h"
#include "../../core/wee-util.h"
#include "../../plugins/plugin.h"
#include "../gui-buffer.h"
#include "../gui-chat.h"
@@ -2103,7 +2104,7 @@ gui_chat_get_bare_line (struct t_gui_line *line)
{
char *prefix, *message, str_time[256], *str_line;
const char *tag_prefix_nick;
struct tm *local_time;
struct timeval tv;
int length;
prefix = NULL;
@@ -2125,11 +2126,11 @@ gui_chat_get_bare_line (struct t_gui_line *line)
&& CONFIG_STRING(config_look_bare_display_time_format)
&& CONFIG_STRING(config_look_bare_display_time_format)[0])
{
local_time = localtime (&line->data->date);
if (strftime (str_time, sizeof (str_time),
CONFIG_STRING(config_look_bare_display_time_format),
local_time) == 0)
str_time[0] = '\0';
tv.tv_sec = line->data->date;
tv.tv_usec = line->data->date_usec;
util_strftimeval (str_time, sizeof (str_time),
CONFIG_STRING(config_look_bare_display_time_format),
&tv);
}
tag_prefix_nick = gui_line_search_tag_starting_with (line, "prefix_nick_");
+3 -1
View File
@@ -5299,12 +5299,14 @@ gui_buffer_dump_hexa (struct t_gui_buffer *buffer)
free (tags);
snprintf (buf, sizeof (buf), "%s", ctime (&ptr_line->data->date));
buf[strlen (buf) - 1] = '\0';
log_printf (" date: %lld = %s",
log_printf (" date: %lld = %s",
(long long)(ptr_line->data->date), buf);
log_printf (" date_usec: %d", ptr_line->data->date_usec);
snprintf (buf, sizeof (buf), "%s", ctime (&ptr_line->data->date_printed));
buf[strlen (buf) - 1] = '\0';
log_printf (" date_printed: %lld = %s",
(long long)ptr_line->data->date_printed, buf);
log_printf (" date_usec_printed: %d", ptr_line->data->date_usec_printed);
/* display raw message for line */
if (ptr_line->data->message)
+80 -45
View File
@@ -29,6 +29,7 @@
#include <stdarg.h>
#include <ctype.h>
#include <time.h>
#include <sys/time.h>
#include <regex.h>
#include "../core/weechat.h"
@@ -38,6 +39,7 @@
#include "../core/wee-hook.h"
#include "../core/wee-string.h"
#include "../core/wee-utf8.h"
#include "../core/wee-util.h"
#include "../plugins/plugin.h"
#include "gui-chat.h"
#include "gui-buffer.h"
@@ -388,12 +390,12 @@ gui_chat_get_word_info (struct t_gui_window *window,
*/
char *
gui_chat_get_time_string (time_t date)
gui_chat_get_time_string (time_t date, int date_usec)
{
char text_time[128], text_time2[(128*3)+16], text_time_char[2];
char *text_with_color;
int i, time_first_digit, time_last_digit, last_color;
struct tm *local_time;
struct timeval tv;
if (date == 0)
return NULL;
@@ -402,12 +404,11 @@ gui_chat_get_time_string (time_t date)
|| !CONFIG_STRING(config_look_buffer_time_format)[0])
return NULL;
local_time = localtime (&date);
if (!local_time)
return NULL;
if (strftime (text_time, sizeof (text_time),
CONFIG_STRING(config_look_buffer_time_format),
local_time) == 0)
tv.tv_sec = date;
tv.tv_usec = date_usec;
if (util_strftimeval (text_time, sizeof (text_time),
CONFIG_STRING(config_look_buffer_time_format),
&tv) == 0)
return NULL;
if (strstr (text_time, "${"))
@@ -499,7 +500,7 @@ gui_chat_get_time_string (time_t date)
int
gui_chat_get_time_length ()
{
time_t date;
struct timeval tv_now;
char *text_time;
int length;
@@ -508,8 +509,8 @@ gui_chat_get_time_length ()
return 0;
length = 0;
date = time (NULL);
text_time = gui_chat_get_time_string (date);
gettimeofday (&tv_now, NULL);
text_time = gui_chat_get_time_string (tv_now.tv_sec, tv_now.tv_usec);
if (text_time)
{
@@ -540,7 +541,9 @@ gui_chat_change_time_format ()
{
if (ptr_line->data->str_time)
free (ptr_line->data->str_time);
ptr_line->data->str_time = gui_chat_get_time_string (ptr_line->data->date);
ptr_line->data->str_time = gui_chat_get_time_string (
ptr_line->data->date,
ptr_line->data->date_usec);
}
}
}
@@ -586,11 +589,13 @@ gui_chat_buffer_valid (struct t_gui_buffer *buffer,
*/
void
gui_chat_printf_date_tags_internal (struct t_gui_buffer *buffer,
time_t date,
time_t date_printed,
const char *tags,
char *message)
gui_chat_printf_datetime_tags_internal (struct t_gui_buffer *buffer,
time_t date,
int date_usec,
time_t date_printed,
int date_usec_printed,
const char *tags,
char *message)
{
int display_time, length_data, length_str;
char *ptr_msg, *pos_prefix, *pos_tab;
@@ -639,7 +644,9 @@ gui_chat_printf_date_tags_internal (struct t_gui_buffer *buffer,
new_line = gui_line_new (buffer,
-1,
(display_time) ? date : 0,
(display_time) ? date_usec : 0,
date_printed,
date_usec_printed,
tags,
pos_prefix,
ptr_msg);
@@ -734,7 +741,10 @@ gui_chat_printf_date_tags_internal (struct t_gui_buffer *buffer,
}
}
if ((new_line->data->date == 0) && display_time)
{
new_line->data->date = new_line->data->date_printed;
new_line->data->date_usec = new_line->data->date_usec_printed;
}
if (new_line->data->prefix)
string_shared_free (new_line->data->prefix);
if (pos_prefix)
@@ -860,10 +870,11 @@ gui_chat_print_lines_waiting_buffer (FILE *f)
*/
void
gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
const char *tags, const char *message, ...)
gui_chat_printf_datetime_tags (struct t_gui_buffer *buffer,
time_t date, int date_usec,
const char *tags, const char *message, ...)
{
time_t date_printed;
struct timeval tv_date_printed;
char *pos, *pos_end;
int one_line;
@@ -884,9 +895,12 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
utf8_normalize (vbuffer, '?');
date_printed = time (NULL);
gettimeofday (&tv_date_printed, NULL);
if (date <= 0)
date = date_printed;
{
date = tv_date_printed.tv_sec;
date_usec = tv_date_printed.tv_usec;
}
one_line = 0;
pos = vbuffer;
@@ -907,8 +921,13 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
if (gui_init_ok)
{
gui_chat_printf_date_tags_internal (buffer, date, date_printed,
tags, pos);
gui_chat_printf_datetime_tags_internal (buffer,
date,
date_usec,
tv_date_printed.tv_sec,
tv_date_printed.tv_usec,
tags,
pos);
}
else
{
@@ -932,11 +951,12 @@ gui_chat_printf_date_tags (struct t_gui_buffer *buffer, time_t date,
*/
void
gui_chat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date,
const char *tags, const char *message, ...)
gui_chat_printf_y_datetime_tags (struct t_gui_buffer *buffer, int y,
time_t date, int date_usec,
const char *tags, const char *message, ...)
{
struct t_gui_line *ptr_line, *new_line, *new_line_empty;
time_t date_printed;
struct timeval tv_date_printed;
int i, last_y, num_lines_to_add;
if (!message)
@@ -958,12 +978,22 @@ gui_chat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date,
utf8_normalize (vbuffer, '?');
date_printed = time (NULL);
gettimeofday (&tv_date_printed, NULL);
if (date <= 0)
date = date_printed;
{
date = tv_date_printed.tv_sec;
date_usec = tv_date_printed.tv_usec;
}
new_line = gui_line_new (buffer, y, date, date_printed, tags,
NULL, vbuffer);
new_line = gui_line_new (buffer,
y,
date,
date_usec,
tv_date_printed.tv_sec,
tv_date_printed.tv_usec,
tags,
NULL,
vbuffer);
if (!new_line)
goto end;
@@ -1000,7 +1030,8 @@ gui_chat_printf_y_date_tags (struct t_gui_buffer *buffer, int y, time_t date,
for (i = y - num_lines_to_add; i < y; i++)
{
new_line_empty = gui_line_new (new_line->data->buffer,
i, 0, 0, NULL, NULL, "");
i, 0, 0, 0, 0, NULL, NULL,
"");
if (new_line_empty)
gui_line_add_y (new_line_empty);
}
@@ -1056,14 +1087,13 @@ gui_chat_hsignal_quote_line_cb (const void *pointer, void *data,
const char *signal,
struct t_hashtable *hashtable)
{
const char *date, *line, *prefix, *ptr_prefix, *message;
const char *ptr_date, *ptr_date_usec, *line, *prefix, *ptr_prefix, *message;
unsigned long value;
long number;
struct tm *local_time;
struct timeval tv;
struct t_gui_line *ptr_line;
int is_nick, length_time, length_nick_prefix, length_prefix;
int length_nick_suffix, length_message, length, rc;
time_t line_date;
char str_time[128], *str, *error;
/* make C compiler happy */
@@ -1075,23 +1105,28 @@ gui_chat_hsignal_quote_line_cb (const void *pointer, void *data,
/* get time */
str_time[0] = '\0';
date = (strstr (signal, "time")) ?
ptr_date = (strstr (signal, "time")) ?
hashtable_get (hashtable, "_chat_line_date") : NULL;
if (date)
if (ptr_date)
{
error = NULL;
number = strtol (date, &error, 10);
number = strtol (ptr_date, &error, 10);
if (error && !error[0])
{
line_date = (time_t)number;
local_time = localtime (&line_date);
if (local_time)
tv.tv_sec = (time_t)number;
tv.tv_usec = 0;
ptr_date_usec = (strstr (signal, "time")) ?
hashtable_get (hashtable, "_chat_line_date_usec") : NULL;
if (ptr_date_usec)
{
if (strftime (str_time, sizeof (str_time),
CONFIG_STRING(config_look_quote_time_format),
local_time) == 0)
str_time[0] = '\0';
error = NULL;
number = strtol (ptr_date_usec, &error, 10);
if (error && !error[0])
tv.tv_usec = (int)number;
}
util_strftimeval (str_time, sizeof (str_time),
CONFIG_STRING(config_look_quote_time_format),
&tv);
}
}
+20 -11
View File
@@ -28,11 +28,17 @@ struct t_gui_window;
struct t_gui_buffer;
struct t_gui_line;
#define gui_chat_printf(buffer, argz...) \
gui_chat_printf_date_tags(buffer, 0, NULL, ##argz)
#define gui_chat_printf(buffer, argz...) \
gui_chat_printf_datetime_tags(buffer, 0, 0, NULL, ##argz)
#define gui_chat_printf_y(buffer, y, argz...) \
gui_chat_printf_y_date_tags(buffer, y, 0, NULL, ##argz)
#define gui_chat_printf_date_tags(buffer, date, tags, argz...) \
gui_chat_printf_datetime_tags(buffer, date, 0, tags, ##argz)
#define gui_chat_printf_y(buffer, y, argz...) \
gui_chat_printf_y_datetime_tags(buffer, y, 0, 0, NULL, ##argz)
#define gui_chat_printf_y_date_tags(buffer, y, date, tags, argz...) \
gui_chat_printf_y_datetime_tags(buffer, y, date, 0, tags, ##argz)
#define GUI_CHAT_TAG_NO_HIGHLIGHT "no_highlight"
@@ -84,17 +90,20 @@ extern void gui_chat_get_word_info (struct t_gui_window *window,
int *word_end_offset,
int *word_length_with_spaces,
int *word_length);
extern char *gui_chat_get_time_string (time_t date);
extern char *gui_chat_get_time_string (time_t date, int date_usec);
extern int gui_chat_get_time_length ();
extern void gui_chat_change_time_format ();
extern int gui_chat_buffer_valid (struct t_gui_buffer *buffer,
int buffer_type);
extern void gui_chat_printf_date_tags (struct t_gui_buffer *buffer,
time_t date, const char *tags,
const char *message, ...);
extern void gui_chat_printf_y_date_tags (struct t_gui_buffer *buffer, int y,
time_t date, const char *tags,
const char *message, ...);
extern void gui_chat_printf_datetime_tags (struct t_gui_buffer *buffer,
time_t date, int date_usec,
const char *tags,
const char *message, ...);
extern void gui_chat_printf_y_datetime_tags (struct t_gui_buffer *buffer,
int y,
time_t date, int date_usec,
const char *tags,
const char *message, ...);
extern void gui_chat_print_lines_waiting_buffer (FILE *f);
extern int gui_chat_hsignal_quote_line_cb (const void *pointer, void *data,
const char *signal,
+4
View File
@@ -218,7 +218,9 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key)
HASHTABLE_SET_INT("_chat_line_x", focus_info->chat_line_x);
HASHTABLE_SET_INT("_chat_line_y", ((focus_info->chat_line)->data)->y);
HASHTABLE_SET_TIME("_chat_line_date", ((focus_info->chat_line)->data)->date);
HASHTABLE_SET_INT("_chat_line_date_usec", ((focus_info->chat_line)->data)->date_usec);
HASHTABLE_SET_TIME("_chat_line_date_printed", ((focus_info->chat_line)->data)->date_printed);
HASHTABLE_SET_INT("_chat_line_date_usec_printed", ((focus_info->chat_line)->data)->date_usec_printed);
HASHTABLE_SET_STR_NOT_NULL("_chat_line_time", str_time);
HASHTABLE_SET_STR_NOT_NULL("_chat_line_tags", str_tags);
HASHTABLE_SET_STR_NOT_NULL("_chat_line_nick", nick);
@@ -239,7 +241,9 @@ gui_focus_to_hashtable (struct t_gui_focus_info *focus_info, const char *key)
HASHTABLE_SET_STR("_chat_line_x", "-1");
HASHTABLE_SET_STR("_chat_line_y", "-1");
HASHTABLE_SET_STR("_chat_line_date", "-1");
HASHTABLE_SET_STR("_chat_line_date_usec", "-1");
HASHTABLE_SET_STR("_chat_line_date_printed", "-1");
HASHTABLE_SET_STR("_chat_line_date_usec_printed", "-1");
HASHTABLE_SET_STR("_chat_line_time", "");
HASHTABLE_SET_STR("_chat_line_tags", "");
HASHTABLE_SET_STR("_chat_line_nick", "");
+74 -5
View File
@@ -1480,8 +1480,10 @@ gui_line_set_highlight (struct t_gui_line *line, int max_notify_level)
*/
struct t_gui_line *
gui_line_new (struct t_gui_buffer *buffer, int y, time_t date,
time_t date_printed, const char *tags,
gui_line_new (struct t_gui_buffer *buffer, int y,
time_t date, int date_usec,
time_t date_printed, int date_usec_printed,
const char *tags,
const char *prefix, const char *message)
{
struct t_gui_line *new_line;
@@ -1523,8 +1525,10 @@ gui_line_new (struct t_gui_buffer *buffer, int y, time_t date,
0 : buffer->next_line_id + 1;
new_line->data->y = -1;
new_line->data->date = date;
new_line->data->date_usec = date_usec;
new_line->data->date_printed = date_printed;
new_line->data->str_time = gui_chat_get_time_string (date);
new_line->data->date_usec_printed = date_usec_printed;
new_line->data->str_time = gui_chat_get_time_string (date, date_usec);
gui_line_tags_alloc (new_line->data, tags);
new_line->data->refresh_needed = 0;
new_line->data->prefix = (prefix) ?
@@ -1542,7 +1546,9 @@ gui_line_new (struct t_gui_buffer *buffer, int y, time_t date,
new_line->data->id = y;
new_line->data->y = y;
new_line->data->date = date;
new_line->data->date_usec = date_usec;
new_line->data->date_printed = date_printed;
new_line->data->date_usec_printed = date_usec_printed;
new_line->data->str_time = NULL;
gui_line_tags_alloc (new_line->data, tags);
new_line->data->refresh_needed = 1;
@@ -1646,7 +1652,25 @@ gui_line_hook_update (struct t_gui_line *line,
line->data->date = (time_t)value;
if (line->data->str_time)
free (line->data->str_time);
line->data->str_time = gui_chat_get_time_string (line->data->date);
line->data->str_time = gui_chat_get_time_string (
line->data->date,
line->data->date_usec);
}
}
ptr_value2 = hashtable_get (hashtable2, "date_usec");
if (ptr_value2)
{
error = NULL;
value = strtol (ptr_value2, &error, 10);
if (error && !error[0] && (value >= 0) && (value <= 999999))
{
line->data->date_usec = (int)value;
if (line->data->str_time)
free (line->data->str_time);
line->data->str_time = gui_chat_get_time_string (
line->data->date,
line->data->date_usec);
}
}
@@ -1659,6 +1683,15 @@ gui_line_hook_update (struct t_gui_line *line,
line->data->date_printed = (time_t)value;
}
ptr_value2 = hashtable_get (hashtable2, "date_usec_printed");
if (ptr_value2)
{
error = NULL;
value = strtol (ptr_value2, &error, 10);
if (error && !error[0] && (value >= 0) && (value <= 999999))
line->data->date_usec_printed = (int)value;
}
ptr_value = hashtable_get (hashtable, "str_time");
ptr_value2 = hashtable_get (hashtable2, "str_time");
if (ptr_value2 && (!ptr_value || (strcmp (ptr_value, ptr_value2) != 0)))
@@ -1977,7 +2010,9 @@ void
gui_line_clear (struct t_gui_line *line)
{
line->data->date = 0;
line->data->date_usec = 0;
line->data->date_printed = 0;
line->data->date_usec_printed = 0;
if (line->data->str_time)
{
free (line->data->str_time);
@@ -2178,7 +2213,25 @@ gui_line_hdata_line_data_update_cb (void *data,
hdata_set (hdata, pointer, "date", value);
if (line_data->str_time)
free (line_data->str_time);
line_data->str_time = gui_chat_get_time_string (line_data->date);
line_data->str_time = gui_chat_get_time_string (
line_data->date,
line_data->date_usec);
rc++;
update_coords = 1;
}
}
if (hashtable_has_key (hashtable, "date_usec"))
{
value = hashtable_get (hashtable, "date_usec");
if (value)
{
hdata_set (hdata, pointer, "date_usec", value);
if (line_data->str_time)
free (line_data->str_time);
line_data->str_time = gui_chat_get_time_string (
line_data->date,
line_data->date_usec);
rc++;
update_coords = 1;
}
@@ -2194,6 +2247,16 @@ gui_line_hdata_line_data_update_cb (void *data,
}
}
if (hashtable_has_key (hashtable, "date_usec_printed"))
{
value = hashtable_get (hashtable, "date_usec_printed");
if (value)
{
hdata_set (hdata, pointer, "date_usec_printed", value);
rc++;
}
}
if (hashtable_has_key (hashtable, "tags_array"))
{
value = hashtable_get (hashtable, "tags_array");
@@ -2269,7 +2332,9 @@ gui_line_hdata_line_data_cb (const void *pointer, void *data,
HDATA_VAR(struct t_gui_line_data, id, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_line_data, y, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_line_data, date, TIME, 1, NULL, NULL);
HDATA_VAR(struct t_gui_line_data, date_usec, INTEGER, 1, NULL, NULL);
HDATA_VAR(struct t_gui_line_data, date_printed, TIME, 1, NULL, NULL);
HDATA_VAR(struct t_gui_line_data, date_usec_printed, INTEGER, 1, NULL, NULL);
HDATA_VAR(struct t_gui_line_data, str_time, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_gui_line_data, tags_count, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_gui_line_data, tags_array, SHARED_STRING, 1, "*,tags_count", NULL);
@@ -2314,8 +2379,12 @@ gui_line_add_to_infolist (struct t_infolist *infolist,
return 0;
if (!infolist_new_var_time (ptr_item, "date", line->data->date))
return 0;
if (!infolist_new_var_integer (ptr_item, "date_usec", line->data->date_usec))
return 0;
if (!infolist_new_var_time (ptr_item, "date_printed", line->data->date_printed))
return 0;
if (!infolist_new_var_integer (ptr_item, "date_usec_printed", line->data->date_usec_printed))
return 0;
if (!infolist_new_var_string (ptr_item, "str_time", line->data->str_time))
return 0;
+4
View File
@@ -35,7 +35,9 @@ struct t_gui_line_data
/* free buffer: equals to "y" */
int y; /* line position (for free buffer) */
time_t date; /* date/time of line (may be past) */
int date_usec; /* microseconds for date */
time_t date_printed; /* date/time when weechat print it */
int date_usec_printed; /* microseconds for date printed */
char *str_time; /* time string (for display) */
int tags_count; /* number of tags for line */
char **tags_array; /* tags for line */
@@ -124,7 +126,9 @@ extern void gui_line_set_highlight (struct t_gui_line *line,
extern struct t_gui_line *gui_line_new (struct t_gui_buffer *buffer,
int y,
time_t date,
int date_usec,
time_t date_printed,
int date_usec_printed,
const char *tags,
const char *prefix,
const char *message);
+49 -1
View File
@@ -2004,6 +2004,28 @@ weechat_guile_api_print_date_tags (SCM buffer, SCM date, SCM tags, SCM message)
API_RETURN_OK;
}
SCM
weechat_guile_api_print_datetime_tags (SCM buffer, SCM date, SCM date_usec,
SCM tags, SCM message)
{
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
if (!scm_is_string (buffer) || !scm_is_integer (date)
|| !scm_is_integer (date_usec) || !scm_is_string (tags)
|| !scm_is_string (message))
API_WRONG_ARGS(API_RETURN_ERROR);
plugin_script_api_printf_datetime_tags (
weechat_guile_plugin,
guile_current_script,
API_STR2PTR(API_SCM_TO_STRING(buffer)),
(time_t)scm_to_long (date),
scm_to_int (date_usec),
API_SCM_TO_STRING(tags),
"%s", API_SCM_TO_STRING(message));
API_RETURN_OK;
}
SCM
weechat_guile_api_print_y (SCM buffer, SCM y, SCM message)
{
@@ -2042,6 +2064,29 @@ weechat_guile_api_print_y_date_tags (SCM buffer, SCM y, SCM date, SCM tags,
API_RETURN_OK;
}
SCM
weechat_guile_api_print_y_datetime_tags (SCM buffer, SCM y, SCM date,
SCM date_usec, SCM tags, SCM message)
{
API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR);
if (!scm_is_string (buffer) || !scm_is_integer (y)
|| !scm_is_integer (date) || !scm_is_integer (date_usec)
|| !scm_is_string (tags) || !scm_is_string (message))
API_WRONG_ARGS(API_RETURN_ERROR);
plugin_script_api_printf_y_datetime_tags (
weechat_guile_plugin,
guile_current_script,
API_STR2PTR(API_SCM_TO_STRING(buffer)),
scm_to_int (y),
(time_t)scm_to_long (date),
scm_to_int (date_usec),
API_SCM_TO_STRING(tags),
"%s", API_SCM_TO_STRING(message));
API_RETURN_OK;
}
SCM
weechat_guile_api_log_print (SCM message)
{
@@ -2743,7 +2788,7 @@ weechat_guile_api_hook_line (SCM buffer_type, SCM buffer_name, SCM tags,
int
weechat_guile_api_hook_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
@@ -2756,6 +2801,7 @@ weechat_guile_api_hook_print_cb (const void *pointer, void *data,
int *rc, ret;
/* make C compiler happy */
(void) date_usec;
(void) tags_count;
script = (struct t_plugin_script *)pointer;
@@ -5353,8 +5399,10 @@ weechat_guile_api_module_init (void *data)
API_DEF_FUNC(color, 1);
API_DEF_FUNC(print, 2);
API_DEF_FUNC(print_date_tags, 4);
API_DEF_FUNC(print_datetime_tags, 5);
API_DEF_FUNC(print_y, 3);
API_DEF_FUNC(print_y_date_tags, 5);
API_DEF_FUNC(print_y_datetime_tags, 6);
API_DEF_FUNC(log_print, 1);
API_DEF_FUNC(hook_command, 7);
API_DEF_FUNC(hook_completion, 4);
+9 -2
View File
@@ -388,6 +388,7 @@ irc_command_me_channel_message (struct t_irc_server *server,
irc_input_user_message_display (
server,
0, /* date */
0, /* date_usec */
channel_name,
NULL, /* address */
"privmsg",
@@ -1974,6 +1975,7 @@ IRC_COMMAND_CALLBACK(ctcp)
irc_input_user_message_display (
ptr_server,
0, /* date */
0, /* date_usec */
ctcp_target,
NULL, /* address */
"privmsg",
@@ -3841,6 +3843,7 @@ IRC_COMMAND_CALLBACK(msg)
irc_input_user_message_display (
ptr_server,
0, /* date */
0, /* date_usec */
ptr_channel->name,
NULL, /* address */
"privmsg",
@@ -3864,6 +3867,7 @@ IRC_COMMAND_CALLBACK(msg)
irc_input_user_message_display (
ptr_server,
0, /* date */
0, /* date_usec */
targets[i],
NULL, /* address */
"privmsg",
@@ -4065,6 +4069,7 @@ IRC_COMMAND_CALLBACK(notice)
irc_input_user_message_display (
ptr_server,
0, /* date */
0, /* date_usec */
argv[arg_target],
NULL, /* address */
"notice",
@@ -4595,6 +4600,7 @@ IRC_COMMAND_CALLBACK(query)
irc_input_user_message_display (
ptr_server,
0, /* date */
0, /* date_usec */
ptr_channel->name,
NULL, /* address */
"privmsg",
@@ -7799,8 +7805,9 @@ irc_command_init ()
"condition \"xxx\", using following variables: output of function "
"irc_message_parse (like nick, command, channel, text, etc., see "
"function info_get_hashtable in plugin API reference for the list "
"of all variables), date (format: \"yyyy-mm-dd hh:mm:ss\"), server, "
"recv, sent, modified, redirected"),
"of all variables), date (format: \"%FT%T.%f\", see function "
"util_strftimeval in Plugin API reference), server, recv, sent, "
"modified, redirected"),
"",
N_("Examples:"),
AI(" /server listfull"),
+2 -1
View File
@@ -3114,7 +3114,8 @@ irc_config_init ()
irc_config_file, irc_config_section_look,
"ctcp_time_format", "string",
N_("time format used in answer to message CTCP TIME (see man "
"strftime for date/time specifiers)"),
"strftime for date/time specifiers, extra specifiers are supported, "
"see function util_strftimeval in Plugin API reference)"),
NULL, 0, 0, "%a, %d %b %Y %T %z", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
irc_config_look_display_account_message = weechat_config_new_option (
+22 -16
View File
@@ -185,11 +185,12 @@ irc_ctcp_display_request (struct t_irc_protocol_ctxt *ctxt,
&& !weechat_config_boolean (irc_config_look_display_ctcp_blocked))
return;
weechat_printf_date_tags (
weechat_printf_datetime_tags (
irc_msgbuffer_get_target_buffer (
ctxt->server, ctxt->nick, NULL, "ctcp",
(channel) ? channel->buffer : NULL),
ctxt->date,
ctxt->date_usec,
irc_protocol_tags (ctxt, "irc_ctcp"),
_("%sCTCP requested by %s%s%s: %s%s%s%s%s%s"),
weechat_prefix ("network"),
@@ -252,10 +253,11 @@ irc_ctcp_display_reply_from_nick (struct t_irc_protocol_ctxt *ctxt,
difftime = ((sec2 * 1000000) + usec2) -
((sec1 * 1000000) + usec1);
weechat_printf_date_tags (
weechat_printf_datetime_tags (
irc_msgbuffer_get_target_buffer (
ctxt->server, ctxt->nick, NULL, "ctcp", NULL),
ctxt->date,
ctxt->date_usec,
irc_protocol_tags (ctxt, "irc_ctcp"),
/* TRANSLATORS: %.3fs is a float number + "s" ("seconds") */
_("%sCTCP reply from %s%s%s: %s%s%s %.3fs"),
@@ -272,10 +274,11 @@ irc_ctcp_display_reply_from_nick (struct t_irc_protocol_ctxt *ctxt,
}
else
{
weechat_printf_date_tags (
weechat_printf_datetime_tags (
irc_msgbuffer_get_target_buffer (
ctxt->server, ctxt->nick, NULL, "ctcp", NULL),
ctxt->date,
ctxt->date_usec,
irc_protocol_tags (ctxt, "irc_ctcp"),
_("%sCTCP reply from %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
@@ -291,10 +294,11 @@ irc_ctcp_display_reply_from_nick (struct t_irc_protocol_ctxt *ctxt,
}
else
{
weechat_printf_date_tags (
weechat_printf_datetime_tags (
irc_msgbuffer_get_target_buffer (
ctxt->server, ctxt->nick, NULL, "ctcp", NULL),
ctxt->date,
ctxt->date_usec,
irc_protocol_tags (ctxt, NULL),
_("%sCTCP reply from %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
@@ -545,8 +549,7 @@ irc_ctcp_eval_reply (struct t_irc_server *server, const char *format)
struct t_hashtable *extra_vars;
char *info, *info_version, *info_version_git, *username, *realname;
char buf[4096], *value;
time_t now;
struct tm *local_time;
struct timeval tv_now;
struct utsname *buf_uname;
if (!server || !format)
@@ -661,13 +664,12 @@ irc_ctcp_eval_reply (struct t_irc_server *server, const char *format)
* ${time}: local date/time of user, example:
* Sat, 08 Jul 2023 21:11:19 +0200
*/
now = time (NULL);
local_time = localtime (&now);
gettimeofday (&tv_now, NULL);
setlocale (LC_ALL, "C");
if (strftime (buf, sizeof (buf),
weechat_config_string (irc_config_look_ctcp_time_format),
local_time) == 0)
buf[0] = '\0';
weechat_util_strftimeval (
buf, sizeof (buf),
weechat_config_string (irc_config_look_ctcp_time_format),
&tv_now);
setlocale (LC_ALL, "");
weechat_hashtable_set (extra_vars, "time", buf);
@@ -1389,9 +1391,10 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt,
ctxt->params[0][0]))
{
/* STATUSMSG action */
weechat_printf_date_tags (
weechat_printf_datetime_tags (
channel->buffer,
ctxt->date,
ctxt->date_usec,
irc_protocol_tags (
ctxt,
(ctxt->nick_is_me) ?
@@ -1414,9 +1417,10 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt,
else
{
/* standard action */
weechat_printf_date_tags (
weechat_printf_datetime_tags (
channel->buffer,
ctxt->date,
ctxt->date_usec,
irc_protocol_tags (
ctxt,
(ctxt->nick_is_me) ?
@@ -1456,9 +1460,10 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt,
if (!ptr_channel->topic)
irc_channel_set_topic (ptr_channel, ctxt->address);
weechat_printf_date_tags (
weechat_printf_datetime_tags (
ptr_channel->buffer,
ctxt->date,
ctxt->date_usec,
irc_protocol_tags (
ctxt,
(ctxt->nick_is_me) ?
@@ -1535,11 +1540,12 @@ irc_ctcp_recv (struct t_irc_protocol_ctxt *ctxt,
{
if (weechat_config_boolean (irc_config_look_display_ctcp_unknown))
{
weechat_printf_date_tags (
weechat_printf_datetime_tags (
irc_msgbuffer_get_target_buffer (
ctxt->server, ctxt->nick, NULL, "ctcp",
(channel) ? channel->buffer : NULL),
ctxt->date,
ctxt->date_usec,
irc_protocol_tags (ctxt, "irc_ctcp"),
_("%sUnknown CTCP requested by %s%s%s: %s%s%s%s%s"),
weechat_prefix ("network"),
+3
View File
@@ -64,6 +64,7 @@
void
irc_input_user_message_display (struct t_irc_server *server,
time_t date,
int date_usec,
const char *target,
const char *address,
const char *command,
@@ -86,6 +87,7 @@ irc_input_user_message_display (struct t_irc_server *server,
memset (&ctxt, 0, sizeof (ctxt));
ctxt.server = server;
ctxt.date = date;
ctxt.date_usec = date_usec;
ctxt.address = (char *)address;
ctxt.command = (char *)command;
@@ -317,6 +319,7 @@ irc_input_send_user_message (struct t_gui_buffer *buffer, int flags,
irc_input_user_message_display (
ptr_server,
0, /* date */
0, /* date_usec */
ptr_channel->name,
NULL, /* address */
"privmsg",
+1
View File
@@ -26,6 +26,7 @@ struct t_gui_buffer;
extern void irc_input_user_message_display (struct t_irc_server *server,
time_t date,
int date_usec,
const char *target,
const char *address,
const char *command,
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -63,6 +63,7 @@ struct t_irc_protocol_ctxt
{
struct t_irc_server *server; /* IRC server */
time_t date; /* message date */
int date_usec; /* microseconds of date */
char *irc_message; /* whole raw IRC message */
struct t_hashtable *tags; /* IRC tags */
char *nick; /* nick of sender */
@@ -88,7 +89,6 @@ struct t_irc_protocol_msg
extern const char *irc_protocol_tags (struct t_irc_protocol_ctxt *ctxt,
const char *extra_tags);
extern time_t irc_protocol_parse_time (const char *time);
extern void irc_protocol_recv_command (struct t_irc_server *server,
const char *irc_message,
const char *msg_command,
+21 -16
View File
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include "../weechat-plugin.h"
#include "irc.h"
@@ -80,7 +81,7 @@ irc_raw_message_match_filter (struct t_irc_raw_message *raw_message,
int match;
char *command, *result, str_date[128];
struct t_hashtable *hashtable;
struct tm *date_tmp;
struct timeval tv;
if (!filter || !filter[0])
return 1;
@@ -92,12 +93,10 @@ irc_raw_message_match_filter (struct t_irc_raw_message *raw_message,
raw_message->message);
if (hashtable)
{
date_tmp = localtime (&(raw_message->date));
if (strftime (str_date, sizeof (str_date),
"%Y-%m-%d %H:%M:%S", date_tmp) == 0)
{
str_date[0] = '\0';
}
tv.tv_sec = raw_message->date;
tv.tv_usec = raw_message->date_usec;
weechat_util_strftimeval (str_date, sizeof (str_date),
"%FT%T.%f", &tv);
weechat_hashtable_set (hashtable, "date", str_date);
weechat_hashtable_set (hashtable,
"server", raw_message->server->name);
@@ -301,9 +300,11 @@ irc_raw_message_print (struct t_irc_raw_message *raw_message)
(raw_message->server) ? (raw_message->server)->name : "");
}
weechat_printf_date_tags (
weechat_printf_datetime_tags (
irc_raw_buffer,
raw_message->date, NULL,
raw_message->date,
raw_message->date_usec,
NULL,
"%s\t%s",
prefix,
(buf2) ? buf2 : ((buf) ? buf : raw_message->message));
@@ -532,7 +533,8 @@ irc_raw_message_remove_old ()
*/
struct t_irc_raw_message *
irc_raw_message_add_to_list (time_t date, struct t_irc_server *server,
irc_raw_message_add_to_list (time_t date, int date_usec,
struct t_irc_server *server,
int flags, const char *message)
{
struct t_irc_raw_message *new_raw_message;
@@ -546,6 +548,7 @@ irc_raw_message_add_to_list (time_t date, struct t_irc_server *server,
if (new_raw_message)
{
new_raw_message->date = date;
new_raw_message->date_usec = date_usec;
new_raw_message->server = server;
new_raw_message->flags = flags;
new_raw_message->message = strdup (message);
@@ -574,7 +577,7 @@ irc_raw_print (struct t_irc_server *server, int flags,
const char *message)
{
struct t_irc_raw_message *new_raw_message;
time_t now;
struct timeval tv_now;
if (!message)
return;
@@ -583,10 +586,9 @@ irc_raw_print (struct t_irc_server *server, int flags,
if (!irc_raw_buffer && (weechat_irc_plugin->debug >= 1))
irc_raw_open (0);
now = time (NULL);
new_raw_message = irc_raw_message_add_to_list (now, server, flags,
message);
gettimeofday (&tv_now, NULL);
new_raw_message = irc_raw_message_add_to_list (
tv_now.tv_sec, tv_now.tv_usec, server, flags, message);
if (new_raw_message)
{
if (irc_raw_buffer)
@@ -598,7 +600,8 @@ irc_raw_print (struct t_irc_server *server, int flags,
if (weechat_irc_plugin->debug >= 2)
{
new_raw_message = irc_raw_message_add_to_list (
now,
tv_now.tv_sec,
tv_now.tv_usec,
server,
flags | IRC_RAW_FLAG_BINARY,
message);
@@ -635,6 +638,8 @@ irc_raw_add_to_infolist (struct t_infolist *infolist,
if (!weechat_infolist_new_var_time (ptr_item, "date", raw_message->date))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "date_usec", raw_message->date_usec))
return 0;
if (!weechat_infolist_new_var_string (ptr_item, "server", raw_message->server->name))
return 0;
if (!weechat_infolist_new_var_integer (ptr_item, "flags", raw_message->flags))
+2
View File
@@ -41,6 +41,7 @@ struct t_irc_server;
struct t_irc_raw_message
{
time_t date; /* date/time of message */
int date_usec; /* microseconds of date */
struct t_irc_server *server; /* server */
int flags; /* flags */
char *message; /* message */
@@ -59,6 +60,7 @@ extern void irc_raw_open (int switch_to_buffer);
extern void irc_raw_set_filter (const char *filter);
extern void irc_raw_filter_options (const char *filter);
extern struct t_irc_raw_message *irc_raw_message_add_to_list (time_t date,
int date_usec,
struct t_irc_server *server,
int flags,
const char *message);
+1
View File
@@ -969,6 +969,7 @@ irc_upgrade_read_cb (const void *pointer, void *data,
{
irc_raw_message_add_to_list (
weechat_infolist_time (infolist, "date"),
weechat_infolist_integer (infolist, "date_usec"),
ptr_server,
weechat_infolist_integer (infolist, "flags"),
weechat_infolist_string (infolist, "message"));
+70 -13
View File
@@ -1903,6 +1903,31 @@ API_FUNC(print_date_tags)
API_RETURN_OK;
}
API_FUNC(print_datetime_tags)
{
long date;
int date_usec;
API_INIT_FUNC(1, "print_datetime_tags", "sniss", API_RETURN_ERROR);
v8::String::Utf8Value buffer(args[0]);
date = args[1]->IntegerValue();
date_usec = args[2]->IntegerValue();
v8::String::Utf8Value tags(args[3]);
v8::String::Utf8Value message(args[4]);
plugin_script_api_printf_datetime_tags (
weechat_js_plugin,
js_current_script,
(struct t_gui_buffer *)API_STR2PTR(*buffer),
(time_t)date,
date_usec,
*tags,
"%s", *message);
API_RETURN_OK;
}
API_FUNC(print_y)
{
int y;
@@ -1913,11 +1938,12 @@ API_FUNC(print_y)
y = args[1]->IntegerValue();
v8::String::Utf8Value message(args[2]);
plugin_script_api_printf_y (weechat_js_plugin,
js_current_script,
(struct t_gui_buffer *)API_STR2PTR(*buffer),
y,
"%s", *message);
plugin_script_api_printf_y (
weechat_js_plugin,
js_current_script,
(struct t_gui_buffer *)API_STR2PTR(*buffer),
y,
"%s", *message);
API_RETURN_OK;
}
@@ -1935,13 +1961,41 @@ API_FUNC(print_y_date_tags)
v8::String::Utf8Value tags(args[3]);
v8::String::Utf8Value message(args[4]);
plugin_script_api_printf_y_date_tags (weechat_js_plugin,
js_current_script,
(struct t_gui_buffer *)API_STR2PTR(*buffer),
y,
(time_t)date,
*tags,
"%s", *message);
plugin_script_api_printf_y_date_tags (
weechat_js_plugin,
js_current_script,
(struct t_gui_buffer *)API_STR2PTR(*buffer),
y,
(time_t)date,
*tags,
"%s", *message);
API_RETURN_OK;
}
API_FUNC(print_y_datetime_tags)
{
int y, date_usec;
long date;
API_INIT_FUNC(1, "print_y_datetime_tags", "siniss", API_RETURN_ERROR);
v8::String::Utf8Value buffer(args[0]);
y = args[1]->IntegerValue();
date = args[2]->IntegerValue();
date_usec = args[3]->IntegerValue();
v8::String::Utf8Value tags(args[4]);
v8::String::Utf8Value message(args[5]);
plugin_script_api_printf_y_datetime_tags (
weechat_js_plugin,
js_current_script,
(struct t_gui_buffer *)API_STR2PTR(*buffer),
y,
(time_t)date,
date_usec,
*tags,
"%s", *message);
API_RETURN_OK;
}
@@ -2667,7 +2721,7 @@ API_FUNC(hook_line)
int
weechat_js_api_hook_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
@@ -2680,6 +2734,7 @@ weechat_js_api_hook_print_cb (const void *pointer, void *data,
int *rc, ret;
/* make C compiler happy */
(void) date_usec;
(void) tags_count;
script = (struct t_plugin_script *)pointer;
@@ -5297,8 +5352,10 @@ WeechatJsV8::loadLibs()
API_DEF_FUNC(color);
API_DEF_FUNC(print);
API_DEF_FUNC(print_date_tags);
API_DEF_FUNC(print_datetime_tags);
API_DEF_FUNC(print_y);
API_DEF_FUNC(print_y_date_tags);
API_DEF_FUNC(print_y_datetime_tags);
API_DEF_FUNC(log_print);
API_DEF_FUNC(hook_command);
API_DEF_FUNC(hook_completion);
+14 -24
View File
@@ -27,6 +27,8 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <time.h>
#include <sys/time.h>
#include <sys/stat.h>
#include "../weechat-plugin.h"
@@ -236,8 +238,7 @@ logger_buffer_create_log_file (struct t_logger_buffer *logger_buffer)
{
char *charset, *message, buf_time[256], buf_beginning[1024];
int log_level, rc;
time_t seconds;
struct tm *date_tmp;
struct timeval tv_now;
struct stat statbuf;
if (logger_buffer->log_file)
@@ -311,16 +312,11 @@ logger_buffer_create_log_file (struct t_logger_buffer *logger_buffer)
if (weechat_config_boolean (logger_config_file_info_lines)
&& logger_buffer->write_start_info_line)
{
buf_time[0] = '\0';
seconds = time (NULL);
date_tmp = localtime (&seconds);
if (date_tmp)
{
if (strftime (buf_time, sizeof (buf_time) - 1,
weechat_config_string (logger_config_file_time_format),
date_tmp) == 0)
buf_time[0] = '\0';
}
gettimeofday (&tv_now, NULL);
weechat_util_strftimeval (
buf_time, sizeof (buf_time),
weechat_config_string (logger_config_file_time_format),
&tv_now);
snprintf (buf_beginning, sizeof (buf_beginning),
_("%s\t**** Beginning of log ****"),
buf_time);
@@ -663,8 +659,7 @@ logger_buffer_write_line (struct t_logger_buffer *logger_buffer,
void
logger_buffer_stop (struct t_logger_buffer *logger_buffer, int write_info_line)
{
time_t seconds;
struct tm *date_tmp;
struct timeval tv_now;
char buf_time[256];
if (!logger_buffer)
@@ -674,16 +669,11 @@ logger_buffer_stop (struct t_logger_buffer *logger_buffer, int write_info_line)
{
if (write_info_line && weechat_config_boolean (logger_config_file_info_lines))
{
buf_time[0] = '\0';
seconds = time (NULL);
date_tmp = localtime (&seconds);
if (date_tmp)
{
if (strftime (buf_time, sizeof (buf_time) - 1,
weechat_config_string (logger_config_file_time_format),
date_tmp) == 0)
buf_time[0] = '\0';
}
gettimeofday (&tv_now, NULL);
weechat_util_strftimeval (
buf_time, sizeof (buf_time),
weechat_config_string (logger_config_file_time_format),
&tv_now);
logger_buffer_write_line (logger_buffer,
_("%s\t**** End of log ****"),
buf_time);
+2 -1
View File
@@ -716,7 +716,8 @@ logger_config_init ()
logger_config_file, logger_config_section_file,
"time_format", "string",
N_("timestamp used in log files (see man strftime for date/time "
"specifiers)"),
"specifiers, extra specifiers are supported, see function "
"util_strftimeval in Plugin API reference)"),
NULL, 0, 0, "%Y-%m-%d %H:%M:%S", NULL, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
}
+11 -13
View File
@@ -25,6 +25,7 @@
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <sys/time.h>
#include "../weechat-plugin.h"
#include "logger.h"
@@ -150,7 +151,7 @@ logger_get_file_path ()
seconds = time (NULL);
date_tmp = localtime (&seconds);
path2[0] = '\0';
if (strftime (path2, length - 1, path, date_tmp) == 0)
if (strftime (path2, length, path, date_tmp) == 0)
path2[0] = '\0';
if (weechat_logger_plugin->debug)
@@ -378,7 +379,7 @@ logger_get_mask_expanded (struct t_gui_buffer *buffer, const char *mask)
seconds = time (NULL);
date_tmp = localtime (&seconds);
mask2[0] = '\0';
if (strftime (mask2, length - 1, mask, date_tmp) == 0)
if (strftime (mask2, length, mask, date_tmp) == 0)
mask2[0] = '\0';
/*
@@ -695,13 +696,13 @@ logger_get_line_tag_info (int tags_count, const char **tags,
int
logger_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer, time_t date,
struct t_gui_buffer *buffer, time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
struct t_logger_buffer *ptr_logger_buffer;
struct tm *date_tmp;
struct timeval tv;
char buf_time[256], *prefix_ansi, *message_ansi;
const char *ptr_prefix, *ptr_message;
int line_log_level, prefix_is_nick, color_lines;
@@ -740,15 +741,12 @@ logger_print_cb (const void *pointer, void *data,
ptr_prefix = prefix;
ptr_message = message;
}
buf_time[0] = '\0';
date_tmp = localtime (&date);
if (date_tmp)
{
if (strftime (buf_time, sizeof (buf_time) - 1,
weechat_config_string (logger_config_file_time_format),
date_tmp) == 0)
buf_time[0] = '\0';
}
tv.tv_sec = date;
tv.tv_usec = date_usec;
weechat_util_strftimeval (
buf_time, sizeof (buf_time),
weechat_config_string (logger_config_file_time_format),
&tv);
logger_buffer_write_line (
ptr_logger_buffer,
+2 -1
View File
@@ -41,7 +41,8 @@ extern char *logger_build_option_name (struct t_gui_buffer *buffer);
extern int logger_get_level_for_buffer (struct t_gui_buffer *buffer);
extern char *logger_get_filename (struct t_gui_buffer *buffer);
extern int logger_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer, time_t date,
struct t_gui_buffer *buffer,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message);
+60 -1
View File
@@ -2107,6 +2107,33 @@ API_FUNC(print_date_tags)
API_RETURN_OK;
}
API_FUNC(print_datetime_tags)
{
const char *buffer, *tags, *message;
long date;
int date_usec;
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
if (lua_gettop (L) < 5)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = lua_tostring (L, -5);
date = lua_tonumber (L, -4);
date_usec = lua_tonumber (L, -3);
tags = lua_tostring (L, -2);
message = lua_tostring (L, -1);
plugin_script_api_printf_datetime_tags (weechat_lua_plugin,
lua_current_script,
API_STR2PTR(buffer),
(time_t)date,
date_usec,
tags,
"%s", message);
API_RETURN_OK;
}
API_FUNC(print_y)
{
const char *buffer, *message;
@@ -2156,6 +2183,35 @@ API_FUNC(print_y_date_tags)
API_RETURN_OK;
}
API_FUNC(print_y_datetime_tags)
{
const char *buffer, *tags, *message;
int y, date_usec;
long date;
API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR);
if (lua_gettop (L) < 6)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = lua_tostring (L, -6);
y = lua_tonumber (L, -5);
date = lua_tonumber (L, -4);
date_usec = lua_tonumber (L, -3);
tags = lua_tostring (L, -2);
message = lua_tostring (L, -1);
plugin_script_api_printf_y_datetime_tags (weechat_lua_plugin,
lua_current_script,
API_STR2PTR(buffer),
y,
(time_t)date,
date_usec,
tags,
"%s", message);
API_RETURN_OK;
}
API_FUNC(log_print)
{
const char *message;
@@ -2891,7 +2947,7 @@ API_FUNC(hook_line)
int
weechat_lua_api_hook_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
@@ -2904,6 +2960,7 @@ weechat_lua_api_hook_print_cb (const void *pointer, void *data,
int *rc, ret;
/* make C compiler happy */
(void) date_usec;
(void) tags_count;
script = (struct t_plugin_script *)pointer;
@@ -5662,8 +5719,10 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
API_DEF_FUNC(color),
API_DEF_FUNC(print),
API_DEF_FUNC(print_date_tags),
API_DEF_FUNC(print_datetime_tags),
API_DEF_FUNC(print_y),
API_DEF_FUNC(print_y_date_tags),
API_DEF_FUNC(print_y_datetime_tags),
API_DEF_FUNC(log_print),
API_DEF_FUNC(hook_command),
API_DEF_FUNC(hook_completion),
+54 -2
View File
@@ -2015,6 +2015,30 @@ API_FUNC(print_date_tags)
API_RETURN_OK;
}
API_FUNC(print_datetime_tags)
{
char *buffer, *tags, *message;
dXSARGS;
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
if (items < 5)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = SvPV_nolen (ST (0));
tags = SvPV_nolen (ST (3));
message = SvPV_nolen (ST (4));
plugin_script_api_printf_datetime_tags (weechat_perl_plugin,
perl_current_script,
API_STR2PTR(buffer),
(time_t)(SvIV (ST (1))), /* date */
SvIV (ST (2)), /* date_usec */
tags,
"%s", message);
API_RETURN_OK;
}
API_FUNC(print_y)
{
char *buffer, *message;
@@ -2030,7 +2054,7 @@ API_FUNC(print_y)
plugin_script_api_printf_y (weechat_perl_plugin,
perl_current_script,
API_STR2PTR(buffer),
SvIV (ST (1)),
SvIV (ST (1)), /* y */
"%s", message);
API_RETURN_OK;
@@ -2060,6 +2084,31 @@ API_FUNC(print_y_date_tags)
API_RETURN_OK;
}
API_FUNC(print_y_datetime_tags)
{
char *buffer, *tags, *message;
dXSARGS;
API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR);
if (items < 5)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = SvPV_nolen (ST (0));
tags = SvPV_nolen (ST (4));
message = SvPV_nolen (ST (5));
plugin_script_api_printf_y_datetime_tags (weechat_perl_plugin,
perl_current_script,
API_STR2PTR(buffer),
SvIV (ST (1)), /* y */
(time_t)(SvIV (ST (2))), /* date */
SvIV (ST (3)), /* date_usec */
tags,
"%s", message);
API_RETURN_OK;
}
API_FUNC(log_print)
{
dXSARGS;
@@ -2777,7 +2826,7 @@ API_FUNC(hook_line)
int
weechat_perl_api_hook_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
@@ -2790,6 +2839,7 @@ weechat_perl_api_hook_print_cb (const void *pointer, void *data,
int *rc, ret;
/* make C compiler happy */
(void) date_usec;
(void) tags_count;
script = (struct t_plugin_script *)pointer;
@@ -5606,8 +5656,10 @@ weechat_perl_api_init (pTHX)
API_DEF_FUNC(color);
API_DEF_FUNC(print);
API_DEF_FUNC(print_date_tags);
API_DEF_FUNC(print_datetime_tags);
API_DEF_FUNC(print_y);
API_DEF_FUNC(print_y_date_tags);
API_DEF_FUNC(print_y_datetime_tags);
API_DEF_FUNC(log_print);
API_DEF_FUNC(hook_command);
API_DEF_FUNC(hook_completion);
+72 -1
View File
@@ -2183,6 +2183,38 @@ API_FUNC(print_date_tags)
API_RETURN_OK;
}
API_FUNC(print_datetime_tags)
{
zend_string *z_buffer, *z_tags, *z_message;
zend_long z_date, z_date_usec;
struct t_gui_buffer *buffer;
time_t date;
int date_usec;
char *tags, *message;
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
if (zend_parse_parameters (ZEND_NUM_ARGS(), "SllSS", &z_buffer, &z_date,
&z_date_usec, &z_tags, &z_message) == FAILURE)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
date = (time_t)z_date;
date_usec = (int)z_date_usec;
tags = ZSTR_VAL(z_tags);
message = ZSTR_VAL(z_message);
plugin_script_api_printf_datetime_tags (weechat_php_plugin,
php_current_script,
buffer,
date,
date_usec,
(const char *)tags,
"%s",
message);
API_RETURN_OK;
}
API_FUNC(print_y)
{
zend_string *z_buffer, *z_message;
@@ -2242,6 +2274,41 @@ API_FUNC(print_y_date_tags)
API_RETURN_OK;
}
API_FUNC(print_y_datetime_tags)
{
zend_string *z_buffer, *z_tags, *z_message;
zend_long z_y, z_date, z_date_usec;
struct t_gui_buffer *buffer;
int y, date_usec;
time_t date;
char *tags, *message;
API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR);
if (zend_parse_parameters (ZEND_NUM_ARGS(), "SlllSS", &z_buffer, &z_y,
&z_date, &z_date_usec, &z_tags,
&z_message) == FAILURE)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
y = (int)z_y;
date = (time_t)z_date;
date_usec = (int)z_date_usec;
tags = ZSTR_VAL(z_tags);
message = ZSTR_VAL(z_message);
plugin_script_api_printf_y_datetime_tags (weechat_php_plugin,
php_current_script,
buffer,
y,
date,
date_usec,
(const char *)tags,
"%s",
message);
API_RETURN_OK;
}
API_FUNC(log_print)
{
zend_string *z_message;
@@ -2871,7 +2938,8 @@ API_FUNC(hook_line)
static int
weechat_php_api_hook_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer, time_t date,
struct t_gui_buffer *buffer,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
@@ -2879,6 +2947,9 @@ weechat_php_api_hook_print_cb (const void *pointer, void *data,
int rc;
void *func_argv[9];
/* make C compiler happy */
(void) date_usec;
func_argv[1] = (char *)API_PTR2STR(buffer);
func_argv[2] = &date;
func_argv[3] = &tags_count;
+2
View File
@@ -129,8 +129,10 @@ PHP_FUNCTION(weechat_prefix);
PHP_FUNCTION(weechat_color);
PHP_FUNCTION(weechat_print);
PHP_FUNCTION(weechat_print_date_tags);
PHP_FUNCTION(weechat_print_datetime_tags);
PHP_FUNCTION(weechat_print_y);
PHP_FUNCTION(weechat_print_y_date_tags);
PHP_FUNCTION(weechat_print_y_datetime_tags);
PHP_FUNCTION(weechat_log_print);
PHP_FUNCTION(weechat_hook_command);
PHP_FUNCTION(weechat_hook_completion);
+2
View File
@@ -187,8 +187,10 @@ const zend_function_entry weechat_functions[] = {
PHP_FE(weechat_color, arginfo_weechat_color)
PHP_FE(weechat_print, arginfo_weechat_print)
PHP_FE(weechat_print_date_tags, arginfo_weechat_print_date_tags)
PHP_FE(weechat_print_datetime_tags, arginfo_weechat_print_datetime_tags)
PHP_FE(weechat_print_y, arginfo_weechat_print_y)
PHP_FE(weechat_print_y_date_tags, arginfo_weechat_print_y_date_tags)
PHP_FE(weechat_print_y_datetime_tags, arginfo_weechat_print_y_datetime_tags)
PHP_FE(weechat_log_print, arginfo_weechat_log_print)
PHP_FE(weechat_hook_command, arginfo_weechat_hook_command)
PHP_FE(weechat_hook_completion, arginfo_weechat_hook_completion)
+2
View File
@@ -95,8 +95,10 @@ function weechat_prefix(string $p0): string {}
function weechat_color(string $p0): string {}
function weechat_print(string $p0, string $p1): int {}
function weechat_print_date_tags(string $p0, int $p1, string $p2, string $p3): int {}
function weechat_print_datetime_tags(string $p0, int $p1, int $p2, string $p3, string $p4): int {}
function weechat_print_y(string $p0, int $p1, string $p2): int {}
function weechat_print_y_date_tags(string $p0, int $p1, int $p2, string $p3, string $p4): int {}
function weechat_print_y_datetime_tags(string $p0, int $p1, int $p2, int $p3, string $p4, string $p5): int {}
function weechat_log_print(string $p0): int {}
function weechat_hook_command(string $p0, string $p1, string $p2, string $p3, string $p4, mixed $p5, string $p6): string {}
function weechat_hook_completion(string $p0, string $p1, mixed $p2, string $p3): string {}
+14 -3
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 614392b6be26030a5d7b12437562aec08ad7052c */
* Stub hash: b6e9e3f12ed24566eb77aa0c08bf3e7c5d866b76 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_register, 0, 7, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p0, IS_STRING, 0)
@@ -239,18 +239,29 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_print_date_tags, 0, 4, I
ZEND_ARG_TYPE_INFO(0, p3, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_print_datetime_tags, 0, 5, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p0, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, p1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p2, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p3, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, p4, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_print_y, 0, 3, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p0, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, p1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p2, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_print_y_date_tags, 0, 5, IS_LONG, 0)
#define arginfo_weechat_print_y_date_tags arginfo_weechat_print_datetime_tags
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_print_y_datetime_tags, 0, 6, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p0, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, p1, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p2, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p3, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, p3, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p4, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, p5, IS_STRING, 0)
ZEND_END_ARG_INFO()
#define arginfo_weechat_log_print arginfo_weechat_charset_set
+27 -23
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 614392b6be26030a5d7b12437562aec08ad7052c */
* Stub hash: b6e9e3f12ed24566eb77aa0c08bf3e7c5d866b76 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_weechat_register, 0, 0, 7)
ZEND_ARG_INFO(0, p0)
@@ -192,9 +192,7 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_print_date_tags arginfo_weechat_string_eval_expression
#define arginfo_weechat_print_y arginfo_weechat_ngettext
ZEND_BEGIN_ARG_INFO_EX(arginfo_weechat_print_y_date_tags, 0, 0, 5)
ZEND_BEGIN_ARG_INFO_EX(arginfo_weechat_print_datetime_tags, 0, 0, 5)
ZEND_ARG_INFO(0, p0)
ZEND_ARG_INFO(0, p1)
ZEND_ARG_INFO(0, p2)
@@ -202,6 +200,19 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_weechat_print_y_date_tags, 0, 0, 5)
ZEND_ARG_INFO(0, p4)
ZEND_END_ARG_INFO()
#define arginfo_weechat_print_y arginfo_weechat_ngettext
#define arginfo_weechat_print_y_date_tags arginfo_weechat_print_datetime_tags
ZEND_BEGIN_ARG_INFO_EX(arginfo_weechat_print_y_datetime_tags, 0, 0, 6)
ZEND_ARG_INFO(0, p0)
ZEND_ARG_INFO(0, p1)
ZEND_ARG_INFO(0, p2)
ZEND_ARG_INFO(0, p3)
ZEND_ARG_INFO(0, p4)
ZEND_ARG_INFO(0, p5)
ZEND_END_ARG_INFO()
#define arginfo_weechat_log_print arginfo_weechat_plugin_get_name
#define arginfo_weechat_hook_command arginfo_weechat_register
@@ -214,28 +225,21 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_hook_command_run arginfo_weechat_ngettext
#define arginfo_weechat_hook_timer arginfo_weechat_print_y_date_tags
#define arginfo_weechat_hook_timer arginfo_weechat_print_datetime_tags
ZEND_BEGIN_ARG_INFO_EX(arginfo_weechat_hook_fd, 0, 0, 6)
ZEND_ARG_INFO(0, p0)
ZEND_ARG_INFO(0, p1)
ZEND_ARG_INFO(0, p2)
ZEND_ARG_INFO(0, p3)
ZEND_ARG_INFO(0, p4)
ZEND_ARG_INFO(0, p5)
ZEND_END_ARG_INFO()
#define arginfo_weechat_hook_fd arginfo_weechat_print_y_datetime_tags
#define arginfo_weechat_hook_process arginfo_weechat_string_eval_expression
#define arginfo_weechat_hook_process_hashtable arginfo_weechat_print_y_date_tags
#define arginfo_weechat_hook_process_hashtable arginfo_weechat_print_datetime_tags
#define arginfo_weechat_hook_url arginfo_weechat_print_y_date_tags
#define arginfo_weechat_hook_url arginfo_weechat_print_datetime_tags
#define arginfo_weechat_hook_connect arginfo_weechat_list_new
#define arginfo_weechat_hook_line arginfo_weechat_print_y_date_tags
#define arginfo_weechat_hook_line arginfo_weechat_print_datetime_tags
#define arginfo_weechat_hook_print arginfo_weechat_hook_fd
#define arginfo_weechat_hook_print arginfo_weechat_print_y_datetime_tags
#define arginfo_weechat_hook_signal arginfo_weechat_ngettext
@@ -251,11 +255,11 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_hook_modifier_exec arginfo_weechat_ngettext
#define arginfo_weechat_hook_info arginfo_weechat_print_y_date_tags
#define arginfo_weechat_hook_info arginfo_weechat_print_datetime_tags
#define arginfo_weechat_hook_info_hashtable arginfo_weechat_register
#define arginfo_weechat_hook_infolist arginfo_weechat_hook_fd
#define arginfo_weechat_hook_infolist arginfo_weechat_print_y_datetime_tags
#define arginfo_weechat_hook_focus arginfo_weechat_ngettext
@@ -265,9 +269,9 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_unhook_all arginfo_weechat_plugin_get_name
#define arginfo_weechat_buffer_new arginfo_weechat_print_y_date_tags
#define arginfo_weechat_buffer_new arginfo_weechat_print_datetime_tags
#define arginfo_weechat_buffer_new_props arginfo_weechat_hook_fd
#define arginfo_weechat_buffer_new_props arginfo_weechat_print_y_datetime_tags
#define arginfo_weechat_buffer_search arginfo_weechat_iconv_to_internal
@@ -307,7 +311,7 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_window_set_title arginfo_weechat_plugin_get_name
#define arginfo_weechat_nicklist_add_group arginfo_weechat_print_y_date_tags
#define arginfo_weechat_nicklist_add_group arginfo_weechat_print_datetime_tags
#define arginfo_weechat_nicklist_search_group arginfo_weechat_ngettext
@@ -441,7 +445,7 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_hdata_hashtable arginfo_weechat_ngettext
#define arginfo_weechat_hdata_compare arginfo_weechat_print_y_date_tags
#define arginfo_weechat_hdata_compare arginfo_weechat_print_datetime_tags
#define arginfo_weechat_hdata_update arginfo_weechat_ngettext
+58
View File
@@ -390,6 +390,34 @@ plugin_script_api_printf_date_tags (struct t_weechat_plugin *weechat_plugin,
free (vbuffer);
}
/*
* Prints a message, with optional date/time (with microseconds) and tags.
*/
void
plugin_script_api_printf_datetime_tags (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
time_t date, int date_usec,
const char *tags,
const char *format, ...)
{
char *buf2;
weechat_va_format (format);
if (!vbuffer)
return;
buf2 = (script && script->charset && script->charset[0]) ?
weechat_iconv_to_internal (script->charset, vbuffer) : NULL;
weechat_printf_datetime_tags (buffer, date, date_usec, tags,
"%s", (buf2) ? buf2 : vbuffer);
if (buf2)
free (buf2);
free (vbuffer);
}
/*
* Prints a message on a buffer with free content.
*/
@@ -442,6 +470,35 @@ plugin_script_api_printf_y_date_tags (struct t_weechat_plugin *weechat_plugin,
free (vbuffer);
}
/*
* Prints a message on a buffer with free content, with optional date/time
* (with microseconds) and tags.
*/
void
plugin_script_api_printf_y_datetime_tags (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer, int y,
time_t date, int date_usec,
const char *tags,
const char *format, ...)
{
char *buf2;
weechat_va_format (format);
if (!vbuffer)
return;
buf2 = (script && script->charset && script->charset[0]) ?
weechat_iconv_to_internal (script->charset, vbuffer) : NULL;
weechat_printf_y_datetime_tags (buffer, y, date, date_usec, tags,
"%s", (buf2) ? buf2 : vbuffer);
if (buf2)
free (buf2);
free (vbuffer);
}
/*
* Prints a message in WeeChat log file.
*/
@@ -857,6 +914,7 @@ plugin_script_api_hook_print (struct t_weechat_plugin *weechat_plugin,
void *data,
struct t_gui_buffer *buffer,
time_t date,
int date_usec,
int tags_count,
const char **tags,
int displayed, int highlight,
+14
View File
@@ -126,6 +126,12 @@ extern void plugin_script_api_printf_date_tags (struct t_weechat_plugin *weechat
struct t_gui_buffer *buffer,
time_t date, const char *tags,
const char *format, ...);
extern void plugin_script_api_printf_datetime_tags (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
time_t date, int date_usec,
const char *tags,
const char *format, ...);
extern void plugin_script_api_printf_y (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
@@ -136,6 +142,13 @@ extern void plugin_script_api_printf_y_date_tags (struct t_weechat_plugin *weech
int y, time_t date,
const char *tags,
const char *format, ...);
extern void plugin_script_api_printf_y_datetime_tags (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_gui_buffer *buffer,
int y,
time_t date, int date_usec,
const char *tags,
const char *format, ...);
extern void plugin_script_api_log_printf (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
const char *format, ...);
@@ -256,6 +269,7 @@ extern struct t_hook *plugin_script_api_hook_print (struct t_weechat_plugin *wee
void *data,
struct t_gui_buffer *buffer,
time_t date,
int date_usec,
int tags_count,
const char **tags,
int displayed,
+3 -2
View File
@@ -694,6 +694,7 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
new_plugin->util_timeval_diff = &util_timeval_diff;
new_plugin->util_timeval_add = &util_timeval_add;
new_plugin->util_get_time_string = &util_get_time_string;
new_plugin->util_strftimeval = &util_strftimeval;
new_plugin->util_version_number = &util_version_number;
new_plugin->list_new = &weelist_new;
@@ -789,8 +790,8 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
new_plugin->prefix = &plugin_api_prefix;
new_plugin->color = &plugin_api_color;
new_plugin->printf_date_tags = &gui_chat_printf_date_tags;
new_plugin->printf_y_date_tags = &gui_chat_printf_y_date_tags;
new_plugin->printf_datetime_tags = &gui_chat_printf_datetime_tags;
new_plugin->printf_y_datetime_tags = &gui_chat_printf_y_datetime_tags;
new_plugin->log_printf = &log_printf;
new_plugin->hook_command = &hook_command;
+61 -1
View File
@@ -2012,6 +2012,33 @@ API_FUNC(prnt_date_tags)
API_RETURN_OK;
}
API_FUNC(prnt_datetime_tags)
{
char *buffer, *tags, *message;
long date;
int date_usec;
API_INIT_FUNC(1, "prnt_datetime_tags", API_RETURN_ERROR);
buffer = NULL;
date = 0;
date_usec = 0;
tags = NULL;
message = NULL;
if (!PyArg_ParseTuple (args, "sliss", &buffer, &date, &date_usec, &tags,
&message))
API_WRONG_ARGS(API_RETURN_ERROR);
plugin_script_api_printf_datetime_tags (weechat_python_plugin,
python_current_script,
API_STR2PTR(buffer),
(time_t)date,
date_usec,
tags,
"%s", message);
API_RETURN_OK;
}
API_FUNC(prnt_y)
{
char *buffer, *message;
@@ -2059,6 +2086,36 @@ API_FUNC(prnt_y_date_tags)
API_RETURN_OK;
}
API_FUNC(prnt_y_datetime_tags)
{
char *buffer, *tags, *message;
int y;
long date;
int date_usec;
API_INIT_FUNC(1, "prnt_y_datetime_tags", API_RETURN_ERROR);
buffer = NULL;
y = 0;
date = 0;
date_usec = 0;
tags = NULL;
message = NULL;
if (!PyArg_ParseTuple (args, "siliss", &buffer, &y, &date, &date_usec,
&tags, &message))
API_WRONG_ARGS(API_RETURN_ERROR);
plugin_script_api_printf_y_datetime_tags (weechat_python_plugin,
python_current_script,
API_STR2PTR(buffer),
y,
(time_t)date,
date_usec,
tags,
"%s", message);
API_RETURN_OK;
}
API_FUNC(log_print)
{
char *message;
@@ -2797,7 +2854,7 @@ API_FUNC(hook_line)
int
weechat_python_api_hook_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
@@ -2810,6 +2867,7 @@ weechat_python_api_hook_print_cb (const void *pointer, void *data,
int *rc, ret;
/* make C compiler happy */
(void) date_usec;
(void) tags_count;
script = (struct t_plugin_script *)pointer;
@@ -5527,8 +5585,10 @@ PyMethodDef weechat_python_funcs[] =
API_DEF_FUNC(color),
API_DEF_FUNC(prnt),
API_DEF_FUNC(prnt_date_tags),
API_DEF_FUNC(prnt_datetime_tags),
API_DEF_FUNC(prnt_y),
API_DEF_FUNC(prnt_y_date_tags),
API_DEF_FUNC(prnt_y_datetime_tags),
API_DEF_FUNC(log_print),
API_DEF_FUNC(hook_command),
API_DEF_FUNC(hook_completion),
+24
View File
@@ -1156,6 +1156,20 @@ def prnt_date_tags(buffer: str, date: int, tags: str, message: str) -> int:
...
def prnt_datetime_tags(buffer: str, date: int, date_usec: int, tags: str, message: str) -> int:
"""`prnt_datetime_tags in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_prnt_datetime_tags>`_
::
# example
now = time.time()
time_sec = int(now)
time_usec = int((now * 1000000) % 1000000)
weechat.prnt_datetime_tags("", time_sec - 120, time_usec, "notify_message",
"Message 2 minutes ago, with a tag 'notify_message'")
"""
...
def prnt_y(buffer: str, y: int, message: str) -> int:
"""`prnt_y in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_prnt_y>`_
::
@@ -1176,6 +1190,16 @@ def prnt_y_date_tags(buffer: str, y: int, date: int, tags: str, message: str) ->
...
def prnt_y_datetime_tags(buffer: str, y: int, date: int, date_usec: int, tags: str, message: str) -> int:
"""`prnt_y_datetime_tags in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_prnt_y_datetime_tags>`_
::
# example
weechat.prnt_y_datetime_tags("", 2, 0, 0, "my_tag", "My message on third line with a tag")
"""
...
def log_print(message: str) -> int:
"""`log_print in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_log_print>`_
::
@@ -1143,11 +1143,11 @@ relay_weechat_protocol_signal_buffer_cb (const void *pointer, void *data,
snprintf (cmd_hdata, sizeof (cmd_hdata),
"line_data:0x%lx",
(unsigned long)ptr_line_data);
relay_weechat_msg_add_hdata (msg, cmd_hdata,
"buffer,date,date_printed,"
"displayed,notify_level,"
"highlight,tags_array,prefix,"
"message");
relay_weechat_msg_add_hdata (
msg, cmd_hdata,
"buffer,date,date_usec,date_printed,date_usec_printed,"
"displayed,notify_level,highlight,tags_array,"
"prefix,message");
relay_weechat_msg_send (ptr_client, msg);
relay_weechat_msg_free (msg);
}
+81 -1
View File
@@ -2486,6 +2486,43 @@ weechat_ruby_api_print_date_tags (VALUE class, VALUE buffer, VALUE date,
API_RETURN_OK;
}
static VALUE
weechat_ruby_api_print_datetime_tags (VALUE class, VALUE buffer, VALUE date,
VALUE date_usec, VALUE tags,
VALUE message)
{
char *c_buffer, *c_tags, *c_message;
time_t c_date;
int c_date_usec;
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
if (NIL_P (buffer) || NIL_P (date) || NIL_P (date_usec) || NIL_P (tags)
|| NIL_P (message))
API_WRONG_ARGS(API_RETURN_ERROR);
Check_Type (buffer, T_STRING);
CHECK_INTEGER(date);
CHECK_INTEGER(date_usec);
Check_Type (tags, T_STRING);
Check_Type (message, T_STRING);
c_buffer = StringValuePtr (buffer);
c_date = NUM2ULONG (date);
c_date_usec = NUM2INT (date_usec);
c_tags = StringValuePtr (tags);
c_message = StringValuePtr (message);
plugin_script_api_printf_datetime_tags (weechat_ruby_plugin,
ruby_current_script,
API_STR2PTR(c_buffer),
c_date,
c_date_usec,
c_tags,
"%s", c_message);
API_RETURN_OK;
}
static VALUE
weechat_ruby_api_print_y (VALUE class, VALUE buffer, VALUE y, VALUE message)
{
@@ -2549,6 +2586,46 @@ weechat_ruby_api_print_y_date_tags (VALUE class, VALUE buffer, VALUE y,
API_RETURN_OK;
}
static VALUE
weechat_ruby_api_print_y_datetime_tags (VALUE class, VALUE buffer, VALUE y,
VALUE date, VALUE date_usec, VALUE tags,
VALUE message)
{
char *c_buffer, *c_tags, *c_message;
int c_y, c_date_usec;
time_t c_date;
API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR);
if (NIL_P (buffer) || NIL_P (y) || NIL_P (date) || NIL_P (date_usec)
|| NIL_P (tags) || NIL_P (message))
API_WRONG_ARGS(API_RETURN_ERROR);
Check_Type (buffer, T_STRING);
CHECK_INTEGER(y);
CHECK_INTEGER(date);
CHECK_INTEGER(date_usec);
Check_Type (tags, T_STRING);
Check_Type (message, T_STRING);
c_buffer = StringValuePtr (buffer);
c_y = NUM2INT (y);
c_date = NUM2ULONG (date);
c_date_usec = NUM2INT (date_usec);
c_tags = StringValuePtr (tags);
c_message = StringValuePtr (message);
plugin_script_api_printf_y_datetime_tags (weechat_ruby_plugin,
ruby_current_script,
API_STR2PTR(c_buffer),
c_y,
c_date,
c_date_usec,
c_tags,
"%s", c_message);
API_RETURN_OK;
}
static VALUE
weechat_ruby_api_log_print (VALUE class, VALUE message)
{
@@ -3400,7 +3477,7 @@ weechat_ruby_api_hook_line (VALUE class, VALUE buffer_type, VALUE buffer_name,
int
weechat_ruby_api_hook_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
@@ -3413,6 +3490,7 @@ weechat_ruby_api_hook_print_cb (const void *pointer, void *data,
int *rc, ret;
/* make C compiler happy */
(void) date_usec;
(void) tags_count;
script = (struct t_plugin_script *)pointer;
@@ -6838,8 +6916,10 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
API_DEF_FUNC(color, 1);
API_DEF_FUNC(print, 2);
API_DEF_FUNC(print_date_tags, 4);
API_DEF_FUNC(print_datetime_tags, 5);
API_DEF_FUNC(print_y, 3);
API_DEF_FUNC(print_y_date_tags, 5);
API_DEF_FUNC(print_y_datetime_tags, 6);
API_DEF_FUNC(log_print, 1);
API_DEF_FUNC(hook_command, 7);
API_DEF_FUNC(hook_completion, 4);
+72 -1
View File
@@ -2277,6 +2277,38 @@ API_FUNC(print_date_tags)
API_RETURN_OK;
}
API_FUNC(print_datetime_tags)
{
Tcl_Obj *objp;
char *buffer, *tags, *message;
int i, date_usec;
long date;
API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR);
if (objc < 6)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetLongFromObj (interp, objv[2], &date) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetIntFromObj (interp, objv[3], &date_usec) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = Tcl_GetStringFromObj (objv[1], &i);
tags = Tcl_GetStringFromObj (objv[4], &i);
message = Tcl_GetStringFromObj (objv[5], &i);
plugin_script_api_printf_datetime_tags (weechat_tcl_plugin,
tcl_current_script,
API_STR2PTR(buffer),
(time_t)date,
date_usec,
tags,
"%s", message);
API_RETURN_OK;
}
API_FUNC(print_y)
{
Tcl_Obj *objp;
@@ -2334,6 +2366,42 @@ API_FUNC(print_y_date_tags)
API_RETURN_OK;
}
API_FUNC(print_y_datetime_tags)
{
Tcl_Obj *objp;
char *buffer, *tags, *message;
int i, y, date_usec;
long date;
API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR);
if (objc < 7)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetIntFromObj (interp, objv[2], &y) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetLongFromObj (interp, objv[3], &date) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
if (Tcl_GetIntFromObj (interp, objv[4], &date_usec) != TCL_OK)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = Tcl_GetStringFromObj (objv[1], &i);
tags = Tcl_GetStringFromObj (objv[5], &i);
message = Tcl_GetStringFromObj (objv[6], &i);
plugin_script_api_printf_y_datetime_tags (weechat_tcl_plugin,
tcl_current_script,
API_STR2PTR(buffer),
y,
(time_t)date,
date_usec,
tags,
"%s", message);
API_RETURN_OK;
}
API_FUNC(log_print)
{
Tcl_Obj *objp;
@@ -3097,7 +3165,7 @@ API_FUNC(hook_line)
int
weechat_tcl_api_hook_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
@@ -3110,6 +3178,7 @@ weechat_tcl_api_hook_print_cb (const void *pointer, void *data,
int *rc, ret;
/* make C compiler happy */
(void) date_usec;
(void) tags_count;
script = (struct t_plugin_script *)pointer;
@@ -6118,8 +6187,10 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
API_DEF_FUNC(color);
API_DEF_FUNC(print);
API_DEF_FUNC(print_date_tags);
API_DEF_FUNC(print_datetime_tags);
API_DEF_FUNC(print_y);
API_DEF_FUNC(print_y_date_tags);
API_DEF_FUNC(print_y_datetime_tags);
API_DEF_FUNC(log_print);
API_DEF_FUNC(hook_command);
API_DEF_FUNC(hook_completion);
+11 -21
View File
@@ -1143,13 +1143,14 @@ end:
int
trigger_callback_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date, int tags_count, const char **tags,
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight, const char *prefix,
const char *message)
{
char *str_tags, *str_tags2, str_temp[128], *str_no_color;
int length;
struct tm *date_tmp;
struct timeval tv;
TRIGGER_CALLBACK_CB_INIT(WEECHAT_RC_OK);
@@ -1166,14 +1167,10 @@ trigger_callback_print_cb (const void *pointer, void *data,
/* add data in hashtables used for conditions/replace/command */
trigger_callback_set_common_vars (trigger, ctx.extra_vars);
weechat_hashtable_set (ctx.pointers, "buffer", buffer);
date_tmp = localtime (&date);
if (date_tmp)
{
if (strftime (str_temp, sizeof (str_temp),
"%Y-%m-%d %H:%M:%S", date_tmp) == 0)
str_temp[0] = '\0';
weechat_hashtable_set (ctx.extra_vars, "tg_date", str_temp);
}
tv.tv_sec = date;
tv.tv_usec = date_usec;
weechat_util_strftimeval (str_temp, sizeof (str_temp), "%FT%T.%f", &tv);
weechat_hashtable_set (ctx.extra_vars, "tg_date", str_temp);
snprintf (str_temp, sizeof (str_temp), "%d", displayed);
weechat_hashtable_set (ctx.extra_vars, "tg_displayed", str_temp);
snprintf (str_temp, sizeof (str_temp), "%d", highlight);
@@ -1313,8 +1310,7 @@ trigger_callback_timer_cb (const void *pointer, void *data,
{
char str_temp[128];
int i;
time_t date;
struct tm *date_tmp;
struct timeval tv_now;
TRIGGER_CALLBACK_CB_INIT(WEECHAT_RC_OK);
@@ -1337,15 +1333,9 @@ trigger_callback_timer_cb (const void *pointer, void *data,
trigger_callback_set_common_vars (trigger, ctx.extra_vars);
snprintf (str_temp, sizeof (str_temp), "%d", remaining_calls);
weechat_hashtable_set (ctx.extra_vars, "tg_remaining_calls", str_temp);
date = time (NULL);
date_tmp = localtime (&date);
if (date_tmp)
{
if (strftime (str_temp, sizeof (str_temp),
"%Y-%m-%d %H:%M:%S", date_tmp) == 0)
str_temp[0] = '\0';
weechat_hashtable_set (ctx.extra_vars, "tg_date", str_temp);
}
gettimeofday (&tv_now, NULL);
weechat_util_strftimeval (str_temp, sizeof (str_temp), "%FT%T.%f", &tv_now);
weechat_hashtable_set (ctx.extra_vars, "tg_date", str_temp);
/* execute the trigger (conditions, regex, command) */
if (!trigger_callback_execute (trigger, &ctx))
+4 -4
View File
@@ -122,10 +122,10 @@ extern struct t_hashtable *trigger_callback_line_cb (const void *pointer, void
struct t_hashtable *line);
extern int trigger_callback_print_cb (const void *pointer, void *data,
struct t_gui_buffer *buffer,
time_t date, int tags_count,
const char **tags, int displayed,
int highlight, const char *prefix,
const char *message);
time_t date, int date_usec,
int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message);
extern int trigger_callback_command_cb (const void *pointer,
void *data,
struct t_gui_buffer *buffer,
+38 -18
View File
@@ -68,7 +68,7 @@ struct timeval;
* please change the date with current one; for a second change at same
* date, increment the 01, otherwise please keep 01.
*/
#define WEECHAT_PLUGIN_API_VERSION "20231017-01"
#define WEECHAT_PLUGIN_API_VERSION "20231226-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -240,8 +240,8 @@ struct timeval;
#define WEECHAT_COMMAND_MIN_ARGS(__min_args, __option) \
if (argc < __min_args) \
{ \
weechat_printf_date_tags ( \
NULL, 0, "no_filter", \
weechat_printf_datetime_tags ( \
NULL, 0, 0, "no_filter", \
_("%sToo few arguments for command \"%s%s%s\" " \
"(help on command: /help %s)"), \
weechat_prefix ("error"), \
@@ -255,8 +255,8 @@ struct timeval;
/* macro to return error in callback of hook_command */
#define WEECHAT_COMMAND_ERROR \
{ \
weechat_printf_date_tags ( \
NULL, 0, "no_filter", \
weechat_printf_datetime_tags ( \
NULL, 0, 0, "no_filter", \
_("%sError with command \"%s\" " \
"(help on command: /help %s)"), \
weechat_prefix ("error"), \
@@ -437,6 +437,8 @@ struct t_weechat_plugin
long long (*util_timeval_diff) (struct timeval *tv1, struct timeval *tv2);
void (*util_timeval_add) (struct timeval *tv, long long interval);
const char *(*util_get_time_string) (const time_t *date);
int (*util_strftimeval) (char *string, int max, const char *format,
struct timeval *tv);
int (*util_version_number) (const char *version);
/* sorted lists */
@@ -695,11 +697,13 @@ struct t_weechat_plugin
/* display */
const char *(*prefix) (const char *prefix);
const char *(*color) (const char *color_name);
void (*printf_date_tags) (struct t_gui_buffer *buffer, time_t date,
const char *tags, const char *message, ...);
void (*printf_y_date_tags) (struct t_gui_buffer *buffer, int y,
time_t date, const char *tags,
const char *message, ...);
void (*printf_datetime_tags) (struct t_gui_buffer *buffer,
time_t date, int date_usec,
const char *tags, const char *message, ...);
void (*printf_y_datetime_tags) (struct t_gui_buffer *buffer, int y,
time_t date, int date_usec,
const char *tags,
const char *message, ...);
void (*log_printf) (const char *message, ...);
/* hooks */
@@ -814,6 +818,7 @@ struct t_weechat_plugin
void *data,
struct t_gui_buffer *buffer,
time_t date,
int date_usec,
int tags_count,
const char **tags,
int displayed,
@@ -1492,6 +1497,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
(weechat_plugin->util_timeval_add)(__time, __interval)
#define weechat_util_get_time_string(__date) \
(weechat_plugin->util_get_time_string)(__date)
#define weechat_util_strftimeval(__string, __max, __format, __tv) \
(weechat_plugin->util_strftimeval)(__string, __max, __format, __tv)
#define weechat_util_version_number(__version) \
(weechat_plugin->util_version_number)(__version)
@@ -1790,19 +1797,32 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
#define weechat_color(__color_name) \
(weechat_plugin->color)(__color_name)
#define weechat_printf(__buffer, __message, __argz...) \
(weechat_plugin->printf_date_tags)(__buffer, 0, NULL, __message, \
##__argz)
(weechat_plugin->printf_datetime_tags)(__buffer, 0, 0, NULL, \
__message, ##__argz)
#define weechat_printf_date_tags(__buffer, __date, __tags, __message, \
__argz...) \
(weechat_plugin->printf_date_tags)(__buffer, __date, __tags, \
__message, ##__argz)
(weechat_plugin->printf_datetime_tags)(__buffer, __date, 0, __tags, \
__message, ##__argz)
#define weechat_printf_datetime_tags(__buffer, __date, __date_usec, \
__tags, __message, __argz...) \
(weechat_plugin->printf_datetime_tags)(__buffer, __date, \
__date_usec, __tags, \
__message, ##__argz)
#define weechat_printf_y(__buffer, __y, __message, __argz...) \
(weechat_plugin->printf_y_date_tags)(__buffer, __y, 0, NULL, \
__message, ##__argz)
(weechat_plugin->printf_y_datetime_tags)(__buffer, __y, 0, 0, NULL, \
__message, ##__argz)
#define weechat_printf_y_date_tags(__buffer, __y, __date, __tags, \
__message, __argz...) \
(weechat_plugin->printf_y_date_tags)(__buffer, __y, __date, __tags, \
__message, ##__argz)
(weechat_plugin->printf_y_datetime_tags)(__buffer, __y, __date, 0, \
__tags, __message, \
##__argz)
#define weechat_printf_y_datetime_tags(__buffer, __y, __date, \
__date_usec, __tags, \
__message, __argz...) \
(weechat_plugin->printf_y_datetime_tags)(__buffer, __y, __date, \
__date_usec, __tags, \
__message, ##__argz)
#define weechat_log_printf(__message, __argz...) \
(weechat_plugin->log_printf)(__message, ##__argz)
+5 -4
View File
@@ -422,8 +422,8 @@ def test_display():
weechat.prnt('', '## test print core buffer')
weechat.prnt_date_tags('', 946681200, 'tag1,tag2',
'## test print_date_tags core buffer')
weechat.prnt_date_tags('', 2146383600, 'tag1,tag2',
'## test print_date_tags core buffer, January, 6th 2038')
weechat.prnt_datetime_tags('', 2146383600, 123456, 'tag1,tag2',
'## test print_date_tags core buffer, January, 6th 2038')
hdata_buffer = weechat.hdata_get('buffer')
hdata_lines = weechat.hdata_get('lines')
hdata_line = weechat.hdata_get('line')
@@ -433,6 +433,7 @@ def test_display():
line = weechat.hdata_pointer(hdata_lines, own_lines, 'last_line')
data = weechat.hdata_pointer(hdata_line, line, 'data')
check(weechat.hdata_time(hdata_line_data, data, 'date') == 2146383600)
check(weechat.hdata_integer(hdata_line_data, data, 'date_usec') == 123456)
buffer = weechat.buffer_new('test_formatted',
'buffer_input_cb', '', 'buffer_close_cb', '')
check(buffer != '')
@@ -448,8 +449,8 @@ def test_display():
weechat.prnt_y(buffer, 0, '## test print_y free buffer')
weechat.prnt_y_date_tags(buffer, 0, 946681200, 'tag1,tag2',
'## test print_y_date_tags free buffer')
weechat.prnt_y_date_tags(buffer, 1, 2146383600, 'tag1,tag2',
'## test print_y_date_tags free buffer, January, 6th 2038')
weechat.prnt_y_datetime_tags(buffer, 1, 2146383600, 123456, 'tag1,tag2',
'## test print_y_date_tags free buffer, January, 6th 2038')
weechat.buffer_close(buffer)
+2
View File
@@ -110,8 +110,10 @@ class WeechatScript(object): # pylint: disable=too-many-instance-attributes
functions = {
'prnt': 'print',
'prnt_date_tags': 'print_date_tags',
'prnt_datetime_tags': 'print_datetime_tags',
'prnt_y': 'print_y',
'prnt_y_date_tags': 'print_y_date_tags',
'prnt_y_datetime_tags': 'print_y_datetime_tags',
}
tests_count = 0
for node in ast.walk(self.tree):
+4 -2
View File
@@ -55,8 +55,9 @@ TEST_GROUP(Scripts)
static int
test_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, const char **tags, int displayed,
int highlight, const char *prefix, const char *message)
time_t date, int date_usec, int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
const char *pos;
char *error;
@@ -67,6 +68,7 @@ TEST_GROUP(Scripts)
(void) data;
(void) buffer;
(void) date;
(void) date_usec;
(void) tags_count;
(void) tags;
(void) displayed;
+4 -2
View File
@@ -118,14 +118,16 @@ exec_on_files_cb (void *data, const char *filename)
int
test_print_cb (const void *pointer, void *data, struct t_gui_buffer *buffer,
time_t date, int tags_count, const char **tags, int displayed,
int highlight, const char *prefix, const char *message)
time_t date, int date_usec, int tags_count, const char **tags,
int displayed, int highlight,
const char *prefix, const char *message)
{
/* make C++ compiler happy */
(void) pointer;
(void) data;
(void) buffer;
(void) date;
(void) date_usec;
(void) tags_count;
(void) tags;
(void) displayed;
+89
View File
@@ -140,6 +140,95 @@ TEST(CoreUtil, GetTimeString)
STRCMP_EQUAL("Sat, 01 Jan 2000 00:00:00", str_date);
}
/*
* Tests functions:
* util_strftimeval
*/
TEST(CoreUtil, Strftimeval)
{
struct timeval tv;
char str_time[256];
/* test date: 2023-12-25T10:29:09.456789Z */
tv.tv_sec = 1703500149;
tv.tv_usec = 456789;
LONGS_EQUAL(0, util_strftimeval (NULL, 0, NULL, NULL));
LONGS_EQUAL(0, util_strftimeval (str_time, 0, NULL, NULL));
LONGS_EQUAL(0, util_strftimeval (str_time, 0, "", NULL));
LONGS_EQUAL(0, util_strftimeval (str_time, -1, "", &tv));
strcpy (str_time, "test");
LONGS_EQUAL(0, util_strftimeval (str_time, sizeof (str_time), "", &tv));
STRCMP_EQUAL("", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(8, util_strftimeval (str_time, sizeof (str_time),
"%H:%M:%S", &tv));
STRCMP_EQUAL("10:29:09", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(19, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(19, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(21, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %% %H:%M:%S", &tv));
STRCMP_EQUAL("2023-12-25 % 10:29:09", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(21, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%.1", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.4", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(22, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%.2", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.45", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(23, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%.3", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.456", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(24, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%.4", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.4567", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(25, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%.5", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.45678", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(26, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%.6", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.456789", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(26, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%f", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.456789", str_time);
/* invalid microseconds digits (must be 1-6) */
strcpy (str_time, "test");
LONGS_EQUAL(23, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%.0", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.%.0", str_time);
strcpy (str_time, "test");
LONGS_EQUAL(23, util_strftimeval (str_time, sizeof (str_time),
"%Y-%m-%d %H:%M:%S.%.7", &tv));
STRCMP_EQUAL("2023-12-25 10:29:09.%.7", str_time);
}
/*
* Tests functions:
* util_get_time_diff
+66 -28
View File
@@ -428,35 +428,37 @@ TEST(GuiChat, PrintLinesWaitingBuffer)
/*
* Tests functions:
* gui_chat_printf_date_tags_internal
* gui_chat_printf_date_tags
* gui_chat_printf_datetime_tags_internal
* gui_chat_printf_datetime_tags
*/
TEST(GuiChat, PrintDateTags)
TEST(GuiChat, PrintDatetimeTags)
{
struct t_gui_line *ptr_last_line;
struct t_gui_line_data *ptr_data;
/* invalid buffer */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags ((struct t_gui_buffer *)0x1, 0, NULL, "test");
gui_chat_printf_datetime_tags ((struct t_gui_buffer *)0x1, 0, 0, NULL, "test");
POINTERS_EQUAL(ptr_last_line, gui_buffers->own_lines->last_line);
/* NULL message */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 0, NULL, NULL);
gui_chat_printf_datetime_tags (gui_buffers, 0, 0, NULL, NULL);
POINTERS_EQUAL(ptr_last_line, gui_buffers->own_lines->last_line);
/* empty message */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 0, NULL, "");
gui_chat_printf_datetime_tags (gui_buffers, 0, 0, NULL, "");
CHECK(ptr_last_line != gui_buffers->own_lines->last_line);
ptr_data = gui_buffers->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(gui_buffers, ptr_data->buffer);
LONGS_EQUAL(-1, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
CHECK(ptr_data->str_time && ptr_data->str_time[0]);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -470,14 +472,16 @@ TEST(GuiChat, PrintDateTags)
/* message (no prefix) */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 0, NULL, "this is a test");
gui_chat_printf_datetime_tags (gui_buffers, 0, 0, NULL, "this is a test");
CHECK(ptr_last_line != gui_buffers->own_lines->last_line);
ptr_data = gui_buffers->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(gui_buffers, ptr_data->buffer);
LONGS_EQUAL(-1, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
CHECK(ptr_data->str_time && ptr_data->str_time[0]);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -491,14 +495,16 @@ TEST(GuiChat, PrintDateTags)
/* message with prefix */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 0, NULL, "nick\tthis is a test");
gui_chat_printf_datetime_tags (gui_buffers, 0, 0, NULL, "nick\tthis is a test");
CHECK(ptr_last_line != gui_buffers->own_lines->last_line);
ptr_data = gui_buffers->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(gui_buffers, ptr_data->buffer);
LONGS_EQUAL(-1, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
CHECK(ptr_data->str_time && ptr_data->str_time[0]);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -512,14 +518,16 @@ TEST(GuiChat, PrintDateTags)
/* message with prefix */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 0, NULL, "nick\tthis is a test");
gui_chat_printf_datetime_tags (gui_buffers, 0, 0, NULL, "nick\tthis is a test");
CHECK(ptr_last_line != gui_buffers->own_lines->last_line);
ptr_data = gui_buffers->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(gui_buffers, ptr_data->buffer);
LONGS_EQUAL(-1, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
CHECK(ptr_data->str_time && ptr_data->str_time[0]);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -533,14 +541,16 @@ TEST(GuiChat, PrintDateTags)
/* message with ignored prefix (space + tab) */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 0, NULL, " \tthis is a test");
gui_chat_printf_datetime_tags (gui_buffers, 0, 0, NULL, " \tthis is a test");
CHECK(ptr_last_line != gui_buffers->own_lines->last_line);
ptr_data = gui_buffers->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(gui_buffers, ptr_data->buffer);
LONGS_EQUAL(-1, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
CHECK(ptr_data->str_time && ptr_data->str_time[0]);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -554,14 +564,16 @@ TEST(GuiChat, PrintDateTags)
/* message with no time displayed (two tabs) */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 0, NULL, "\t\tthis is a test");
gui_chat_printf_datetime_tags (gui_buffers, 0, 0, NULL, "\t\tthis is a test");
CHECK(ptr_last_line != gui_buffers->own_lines->last_line);
ptr_data = gui_buffers->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(gui_buffers, ptr_data->buffer);
LONGS_EQUAL(-1, ptr_data->y);
LONGS_EQUAL(0, ptr_data->date);
LONGS_EQUAL(0, ptr_data->date_usec);
CHECK(ptr_data->date_printed > 0);
CHECK((ptr_data->date_usec_printed >= 0) && (ptr_data->date_usec_printed <= 999999));
POINTERS_EQUAL(NULL, ptr_data->str_time);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -575,13 +587,15 @@ TEST(GuiChat, PrintDateTags)
/* message with past date */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 946681200, NULL, "nick\tthis is a test");
gui_chat_printf_datetime_tags (gui_buffers, 946681200, 123456, NULL,
"nick\tthis is a test");
CHECK(ptr_last_line != gui_buffers->own_lines->last_line);
ptr_data = gui_buffers->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(gui_buffers, ptr_data->buffer);
LONGS_EQUAL(-1, ptr_data->y);
LONGS_EQUAL(946681200, ptr_data->date);
LONGS_EQUAL(123456, ptr_data->date_usec);
CHECK(ptr_data->date < ptr_data->date_printed);
CHECK(ptr_data->str_time && ptr_data->str_time[0]);
LONGS_EQUAL(0, ptr_data->tags_count);
@@ -596,14 +610,17 @@ TEST(GuiChat, PrintDateTags)
/* message with empty tags */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 0, "", "nick\tthis is a test");
gui_chat_printf_datetime_tags (gui_buffers, 0, 0, "",
"nick\tthis is a test");
CHECK(ptr_last_line != gui_buffers->own_lines->last_line);
ptr_data = gui_buffers->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(gui_buffers, ptr_data->buffer);
LONGS_EQUAL(-1, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
CHECK(ptr_data->str_time && ptr_data->str_time[0]);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -617,14 +634,17 @@ TEST(GuiChat, PrintDateTags)
/* message with 3 tags */
ptr_last_line = gui_buffers->own_lines->last_line;
gui_chat_printf_date_tags (gui_buffers, 0, "tag1,tag2,tag3", "nick\tthis is a test");
gui_chat_printf_datetime_tags (gui_buffers, 0, 0, "tag1,tag2,tag3",
"nick\tthis is a test");
CHECK(ptr_last_line != gui_buffers->own_lines->last_line);
ptr_data = gui_buffers->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(gui_buffers, ptr_data->buffer);
LONGS_EQUAL(-1, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
CHECK(ptr_data->str_time && ptr_data->str_time[0]);
LONGS_EQUAL(3, ptr_data->tags_count);
CHECK(ptr_data->tags_array);
@@ -642,10 +662,10 @@ TEST(GuiChat, PrintDateTags)
/*
* Tests functions:
* gui_chat_printf_y_date_tags
* gui_chat_printf_y_datetime_tags
*/
TEST(GuiChat, PrintYDateTags)
TEST(GuiChat, PrintYDatetimeTags)
{
struct t_gui_buffer *buffer;
struct t_gui_line_data *ptr_data;
@@ -655,30 +675,34 @@ TEST(GuiChat, PrintYDateTags)
gui_buffer_set (buffer, "type", "free");
/* invalid buffer pointer */
gui_chat_printf_y_date_tags ((struct t_gui_buffer *)0x1, 0, 0, NULL, "test");
gui_chat_printf_y_datetime_tags ((struct t_gui_buffer *)0x1, 0, 0, 0, NULL,
"test");
POINTERS_EQUAL(NULL, buffer->own_lines->last_line);
/* invalid buffer: not with free content */
gui_chat_printf_y_date_tags (gui_buffers, 0, 0, NULL, "test");
gui_chat_printf_y_datetime_tags (gui_buffers, 0, 0, 0, NULL, "test");
POINTERS_EQUAL(NULL, buffer->own_lines->last_line);
/* NULL message */
gui_chat_printf_y_date_tags (buffer, 0, 0, NULL, NULL);
gui_chat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, NULL);
POINTERS_EQUAL(NULL, buffer->own_lines->last_line);
/* empty message */
gui_chat_printf_y_date_tags (buffer, 0, 0, NULL, "");
gui_chat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "");
POINTERS_EQUAL(NULL, buffer->own_lines->last_line);
/* message on first line */
gui_chat_printf_y_date_tags (buffer, 0, 0, NULL, "this is a test on line 1");
gui_chat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL,
"this is a test on line 1");
CHECK(buffer->own_lines->last_line);
ptr_data = buffer->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(buffer, ptr_data->buffer);
LONGS_EQUAL(0, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
POINTERS_EQUAL(NULL, ptr_data->str_time);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -691,14 +715,17 @@ TEST(GuiChat, PrintYDateTags)
STRCMP_EQUAL("this is a test on line 1", ptr_data->message);
/* message on first line with past date */
gui_chat_printf_y_date_tags (buffer, 0, 946681200, NULL, "this is a test on line 1");
gui_chat_printf_y_datetime_tags (buffer, 0, 946681200, 123456, NULL,
"this is a test on line 1");
CHECK(buffer->own_lines->last_line);
ptr_data = buffer->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(buffer, ptr_data->buffer);
LONGS_EQUAL(0, ptr_data->y);
LONGS_EQUAL(946681200, ptr_data->date);
LONGS_EQUAL(123456, ptr_data->date_usec);
CHECK(ptr_data->date < ptr_data->date_printed);
CHECK((ptr_data->date_usec_printed >= 0) && (ptr_data->date_usec_printed <= 999999));
POINTERS_EQUAL(NULL, ptr_data->str_time);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -711,14 +738,17 @@ TEST(GuiChat, PrintYDateTags)
STRCMP_EQUAL("this is a test on line 1", ptr_data->message);
/* message on first line with empty tags */
gui_chat_printf_y_date_tags (buffer, 0, 0, "", "this is a test on line 1");
gui_chat_printf_y_datetime_tags (buffer, 0, 0, 0, "",
"this is a test on line 1");
CHECK(buffer->own_lines->last_line);
ptr_data = buffer->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(buffer, ptr_data->buffer);
LONGS_EQUAL(0, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
POINTERS_EQUAL(NULL, ptr_data->str_time);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -731,14 +761,17 @@ TEST(GuiChat, PrintYDateTags)
STRCMP_EQUAL("this is a test on line 1", ptr_data->message);
/* message on first line with 3 tags */
gui_chat_printf_y_date_tags (buffer, 0, 0, "tag1,tag2,tag3", "this is a test on line 1");
gui_chat_printf_y_datetime_tags (buffer, 0, 0, 0, "tag1,tag2,tag3",
"this is a test on line 1");
CHECK(buffer->own_lines->last_line);
ptr_data = buffer->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(buffer, ptr_data->buffer);
LONGS_EQUAL(0, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
POINTERS_EQUAL(NULL, ptr_data->str_time);
LONGS_EQUAL(3, ptr_data->tags_count);
CHECK(ptr_data->tags_array);
@@ -754,14 +787,17 @@ TEST(GuiChat, PrintYDateTags)
STRCMP_EQUAL("this is a test on line 1", ptr_data->message);
/* message on third line */
gui_chat_printf_y_date_tags (buffer, 2, 0, NULL, "this is a test on line 3");
gui_chat_printf_y_datetime_tags (buffer, 2, 0, 0, NULL,
"this is a test on line 3");
CHECK(buffer->own_lines->last_line);
ptr_data = buffer->own_lines->last_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(buffer, ptr_data->buffer);
LONGS_EQUAL(2, ptr_data->y);
CHECK(ptr_data->date > 0);
CHECK((ptr_data->date_usec >= 0) && (ptr_data->date_usec <= 999999));
CHECK(ptr_data->date == ptr_data->date_printed);
CHECK(ptr_data->date_usec == ptr_data->date_usec_printed);
POINTERS_EQUAL(NULL, ptr_data->str_time);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -774,13 +810,15 @@ TEST(GuiChat, PrintYDateTags)
STRCMP_EQUAL("this is a test on line 3", ptr_data->message);
/* delete first line */
gui_chat_printf_y_date_tags (buffer, 0, 0, NULL, "");
gui_chat_printf_y_datetime_tags (buffer, 0, 0, 0, NULL, "");
ptr_data = buffer->own_lines->first_line->data;
CHECK(ptr_data);
POINTERS_EQUAL(buffer, ptr_data->buffer);
LONGS_EQUAL(0, ptr_data->y);
LONGS_EQUAL(0, ptr_data->date);
LONGS_EQUAL(0, ptr_data->date_usec);
LONGS_EQUAL(0, ptr_data->date_printed);
LONGS_EQUAL(0, ptr_data->date_usec_printed);
POINTERS_EQUAL(NULL, ptr_data->str_time);
LONGS_EQUAL(0, ptr_data->tags_count);
POINTERS_EQUAL(NULL, ptr_data->tags_array);
@@ -793,13 +831,13 @@ TEST(GuiChat, PrintYDateTags)
STRCMP_EQUAL("", ptr_data->message);
/* delete third line */
gui_chat_printf_y_date_tags (buffer, 2, 0, NULL, "");
gui_chat_printf_y_datetime_tags (buffer, 2, 0, 0, NULL, "");
CHECK(buffer->own_lines->first_line);
CHECK(buffer->own_lines->first_line->next_line);
POINTERS_EQUAL(NULL, buffer->own_lines->first_line->next_line->next_line);
/* delete second line */
gui_chat_printf_y_date_tags (buffer, 1, 0, NULL, "");
gui_chat_printf_y_datetime_tags (buffer, 1, 0, 0, NULL, "");
CHECK(buffer->own_lines->first_line);
POINTERS_EQUAL(NULL, buffer->own_lines->first_line->next_line);
+61 -22
View File
@@ -24,6 +24,8 @@
extern "C"
{
#include <string.h>
#include <time.h>
#include <sys/time.h>
#include "src/core/wee-config.h"
#include "src/core/wee-string.h"
#include "src/gui/gui-buffer.h"
@@ -35,7 +37,7 @@ extern "C"
}
#define WEE_BUILD_STR_PREFIX_MSG(__result, __prefix, __message) \
line = gui_line_new (gui_buffers, -1, 0, 0, "tag1,tag2", \
line = gui_line_new (gui_buffers, -1, 0, 0, 0, 0, "tag1,tag2", \
__prefix, __message); \
str = gui_line_build_string_prefix_message (line->data->prefix, \
line->data->message); \
@@ -45,7 +47,7 @@ extern "C"
free (line);
#define WEE_BUILD_STR_MSG_TAGS(__tags, __message, __colors) \
line = gui_line_new (gui_buffers, -1, 0, 0, __tags, \
line = gui_line_new (gui_buffers, -1, 0, 0, 0, 0, __tags, \
NULL, __message); \
str = gui_line_build_string_message_tags (line->data->message, \
line->data->tags_count, \
@@ -218,7 +220,7 @@ TEST(GuiLine, BuildStringMessageTags)
struct t_gui_line *line;
char *str, str_message[256], str_result[256];
line = gui_line_new (gui_buffers, -1, 0, 0, "tag1,tag2", NULL, "test");
line = gui_line_new (gui_buffers, -1, 0, 0, 0, 0, "tag1,tag2", NULL, "test");
POINTERS_EQUAL(NULL,
gui_line_build_string_message_tags (line->data->message,
-1,
@@ -846,21 +848,30 @@ TEST(GuiLine, New)
{
struct t_gui_buffer *buffer;
struct t_gui_line *line1, *line2, *line3, *line4;
time_t date_printed, date;
struct timeval date_printed, date;
char *str_time;
date_printed = time (NULL);
date = date_printed - 1;
str_time = gui_chat_get_time_string (date);
gettimeofday (&date_printed, NULL);
date.tv_sec = date_printed.tv_sec - 1;
date.tv_usec = date_printed.tv_usec;
str_time = gui_chat_get_time_string (date.tv_sec, date.tv_usec);
POINTERS_EQUAL(NULL,
gui_line_new (NULL, 0, date, date_printed, NULL, NULL, NULL));
gui_line_new (
NULL, 0,
date.tv_sec, date.tv_usec,
date_printed.tv_sec, date_printed.tv_usec,
NULL, NULL, NULL));
/* create a new test buffer (formatted content) */
buffer = gui_buffer_new_user ("test", GUI_BUFFER_TYPE_FORMATTED);
CHECK(buffer);
line1 = gui_line_new (buffer, 0, date, date_printed, NULL, NULL, NULL);
line1 = gui_line_new (buffer,
0,
date.tv_sec, date.tv_usec,
date_printed.tv_sec, date_printed.tv_usec,
NULL, NULL, NULL);
CHECK(line1);
CHECK(line1->data);
POINTERS_EQUAL(NULL, line1->prev_line);
@@ -868,8 +879,10 @@ TEST(GuiLine, New)
POINTERS_EQUAL(buffer, line1->data->buffer);
LONGS_EQUAL(0, line1->data->id);
LONGS_EQUAL(-1, line1->data->y);
LONGS_EQUAL(date, line1->data->date);
LONGS_EQUAL(date_printed, line1->data->date_printed);
LONGS_EQUAL(date.tv_sec, line1->data->date);
LONGS_EQUAL(date.tv_usec, line1->data->date_usec);
LONGS_EQUAL(date_printed.tv_sec, line1->data->date_printed);
LONGS_EQUAL(date_printed.tv_usec, line1->data->date_usec_printed);
STRCMP_EQUAL(str_time, line1->data->str_time);
LONGS_EQUAL(0, line1->data->tags_count);
POINTERS_EQUAL(NULL, line1->data->tags_array);
@@ -884,7 +897,11 @@ TEST(GuiLine, New)
POINTERS_EQUAL(NULL, line1->prev_line);
POINTERS_EQUAL(NULL, line1->next_line);
line2 = gui_line_new (buffer, 0, date, date_printed, "tag1,tag2,tag3",
line2 = gui_line_new (buffer,
0,
date.tv_sec, date.tv_usec,
date_printed.tv_sec, date_printed.tv_usec,
"tag1,tag2,tag3",
"prefix", "message");
CHECK(line2);
CHECK(line2->data);
@@ -893,8 +910,10 @@ TEST(GuiLine, New)
POINTERS_EQUAL(buffer, line2->data->buffer);
LONGS_EQUAL(1, line2->data->id);
LONGS_EQUAL(-1, line2->data->y);
LONGS_EQUAL(date, line2->data->date);
LONGS_EQUAL(date_printed, line2->data->date_printed);
LONGS_EQUAL(date.tv_sec, line2->data->date);
LONGS_EQUAL(date.tv_usec, line2->data->date_usec);
LONGS_EQUAL(date_printed.tv_sec, line2->data->date_printed);
LONGS_EQUAL(date_printed.tv_usec, line2->data->date_usec_printed);
STRCMP_EQUAL(str_time, line2->data->str_time);
LONGS_EQUAL(3, line2->data->tags_count);
CHECK(line2->data->tags_array);
@@ -914,10 +933,18 @@ TEST(GuiLine, New)
/* simulate next_line_id == INT_MAX and display 2 lines */
buffer->next_line_id = INT_MAX;
line3 = gui_line_new (buffer, 0, date, date_printed, NULL, NULL, "test");
line3 = gui_line_new (buffer,
0,
date.tv_sec, date.tv_usec,
date_printed.tv_sec, date_printed.tv_usec,
NULL, NULL, "test");
CHECK(line3);
LONGS_EQUAL(INT_MAX, line3->data->id);
line4 = gui_line_new (buffer, 0, date, date_printed, NULL, NULL, "test");
line4 = gui_line_new (buffer,
0,
date.tv_sec, date.tv_usec,
date_printed.tv_sec, date_printed.tv_usec,
NULL, NULL, "test");
CHECK(line4);
LONGS_EQUAL(0, line4->data->id);
@@ -927,7 +954,11 @@ TEST(GuiLine, New)
buffer = gui_buffer_new_user ("test", GUI_BUFFER_TYPE_FREE);
CHECK(buffer);
line1 = gui_line_new (buffer, 0, date, date_printed, NULL, NULL, NULL);
line1 = gui_line_new (buffer,
0,
date.tv_sec, date.tv_usec,
date_printed.tv_sec, date_printed.tv_usec,
NULL, NULL, NULL);
CHECK(line1);
CHECK(line1->data);
POINTERS_EQUAL(NULL, line1->prev_line);
@@ -935,8 +966,10 @@ TEST(GuiLine, New)
POINTERS_EQUAL(buffer, line1->data->buffer);
LONGS_EQUAL(0, line1->data->id);
LONGS_EQUAL(0, line1->data->y);
LONGS_EQUAL(date, line1->data->date);
LONGS_EQUAL(date_printed, line1->data->date_printed);
LONGS_EQUAL(date.tv_sec, line1->data->date);
LONGS_EQUAL(date.tv_usec, line1->data->date_usec);
LONGS_EQUAL(date_printed.tv_sec, line1->data->date_printed);
LONGS_EQUAL(date_printed.tv_usec, line1->data->date_usec_printed);
POINTERS_EQUAL(NULL, line1->data->str_time);
LONGS_EQUAL(0, line1->data->tags_count);
POINTERS_EQUAL(NULL, line1->data->tags_array);
@@ -951,7 +984,11 @@ TEST(GuiLine, New)
POINTERS_EQUAL(NULL, line1->prev_line);
POINTERS_EQUAL(NULL, line1->next_line);
line2 = gui_line_new (buffer, 3, date, date_printed, "tag1,tag2,tag3",
line2 = gui_line_new (buffer,
3,
date.tv_sec, date.tv_usec,
date_printed.tv_sec, date_printed.tv_usec,
"tag1,tag2,tag3",
NULL, "message");
CHECK(line2);
CHECK(line2->data);
@@ -960,8 +997,10 @@ TEST(GuiLine, New)
POINTERS_EQUAL(buffer, line2->data->buffer);
LONGS_EQUAL(3, line2->data->id);
LONGS_EQUAL(3, line2->data->y);
LONGS_EQUAL(date, line2->data->date);
LONGS_EQUAL(date_printed, line2->data->date_printed);
LONGS_EQUAL(date.tv_sec, line2->data->date);
LONGS_EQUAL(date.tv_usec, line2->data->date_usec);
LONGS_EQUAL(date_printed.tv_sec, line2->data->date_printed);
LONGS_EQUAL(date_printed.tv_usec, line2->data->date_usec_printed);
POINTERS_EQUAL(NULL, line2->data->str_time);
LONGS_EQUAL(3, line2->data->tags_count);
CHECK(line2->data->tags_array);
+34 -12
View File
@@ -28,6 +28,7 @@ extern "C"
{
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "src/core/wee-arraylist.h"
#include "src/core/wee-config-file.h"
#include "src/core/wee-hashtable.h"
@@ -56,6 +57,8 @@ extern const char *irc_protocol_nick_address (struct t_irc_server *server,
struct t_irc_nick *nick,
const char *nickname,
const char *address);
extern void irc_protocol_parse_time (const char *time, time_t *date,
int *date_usec);
extern char *irc_protocol_string_params (const char **params,
int arg_start, int arg_end);
extern char *irc_protocol_cap_to_enable (const char *capabilities,
@@ -89,6 +92,14 @@ extern char *irc_protocol_cap_to_enable (const char *capabilities,
__extra_tags)); \
}
#define WEE_CHECK_PARSE_TIME(__result_date, __result_date_usec, \
__time) \
date = 1; \
date_usec = 1; \
irc_protocol_parse_time (__time, &date, &date_usec); \
LONGS_EQUAL(__result_date, date); \
LONGS_EQUAL(__result_date_usec, date_usec);
#define WEE_CHECK_CAP_TO_ENABLE(__result, __string, __sasl_requested) \
str = irc_protocol_cap_to_enable (__string, __sasl_requested); \
STRCMP_EQUAL(__result, str); \
@@ -589,25 +600,36 @@ TEST(IrcProtocolWithServer, Tags)
TEST(IrcProtocol, ParseTime)
{
time_t date;
int date_usec;
/* invalid time formats */
LONGS_EQUAL(0, irc_protocol_parse_time (NULL));
LONGS_EQUAL(0, irc_protocol_parse_time (""));
LONGS_EQUAL(0, irc_protocol_parse_time ("invalid"));
WEE_CHECK_PARSE_TIME(0, 0, NULL);
WEE_CHECK_PARSE_TIME(0, 0, "");
WEE_CHECK_PARSE_TIME(0, 0, "invalid");
/* incomplete time formats */
LONGS_EQUAL(0, irc_protocol_parse_time ("2019-01"));
LONGS_EQUAL(0, irc_protocol_parse_time ("2019-01-13"));
LONGS_EQUAL(0, irc_protocol_parse_time ("2019-01-13T14"));
LONGS_EQUAL(0, irc_protocol_parse_time ("2019-01-13T14:37"));
WEE_CHECK_PARSE_TIME(0, 0, "2019-01");
WEE_CHECK_PARSE_TIME(0, 0, "2019-01-13");
WEE_CHECK_PARSE_TIME(0, 0, "2019-01-13T14");
WEE_CHECK_PARSE_TIME(0, 0, "2019-01-13T14:37");
/* valid time with ISO 8601 format*/
LONGS_EQUAL(1547386699, irc_protocol_parse_time ("2019-01-13T13:38:19.123Z"));
LONGS_EQUAL(1547386699, irc_protocol_parse_time ("2019-01-13T13:38:19.123"));
LONGS_EQUAL(1547386699, irc_protocol_parse_time ("2019-01-13T13:38:19"));
WEE_CHECK_PARSE_TIME(1547386699, 0, "2019-01-13T13:38:19");
WEE_CHECK_PARSE_TIME(1547386699, 0, "2019-01-13T13:38:19Z");
WEE_CHECK_PARSE_TIME(1547386699, 123, "2019-01-13T13:38:19.000123");
WEE_CHECK_PARSE_TIME(1547386699, 123, "2019-01-13T13:38:19.000123Z");
WEE_CHECK_PARSE_TIME(1547386699, 123000, "2019-01-13T13:38:19.123");
WEE_CHECK_PARSE_TIME(1547386699, 123000, "2019-01-13T13:38:19.123Z");
WEE_CHECK_PARSE_TIME(1547386699, 123456, "2019-01-13T13:38:19.123456");
WEE_CHECK_PARSE_TIME(1547386699, 123456, "2019-01-13T13:38:19.123456789");
/* valid time as timestamp */
LONGS_EQUAL(1547386699, irc_protocol_parse_time ("1547386699.123"));
LONGS_EQUAL(1547386699, irc_protocol_parse_time ("1547386699"));
WEE_CHECK_PARSE_TIME(1547386699, 0, "1547386699");
WEE_CHECK_PARSE_TIME(1547386699, 123, "1547386699.000123");
WEE_CHECK_PARSE_TIME(1547386699, 123000, "1547386699.123");
WEE_CHECK_PARSE_TIME(1547386699, 123456, "1547386699.123456");
WEE_CHECK_PARSE_TIME(1547386699, 123456, "1547386699.123456789");
}
/*