summaryrefslogtreecommitdiff
path: root/src/plugins/guile/weechat-guile-api.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-12-26 18:37:21 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-12-26 19:44:37 +0100
commit9fb3d3f14c17f8307f04907d5f57034410dc7010 (patch)
tree239415921e803382adf1abb9a334456c5d96711b /src/plugins/guile/weechat-guile-api.c
parent57f80a4c1fac3d5b3c194206c900b1066f9a565e (diff)
downloadweechat-9fb3d3f14c17f8307f04907d5f57034410dc7010.zip
core: store microseconds in buffer lines (closes #649)
Diffstat (limited to 'src/plugins/guile/weechat-guile-api.c')
-rw-r--r--src/plugins/guile/weechat-guile-api.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c
index ff2c051cb..6f48f548a 100644
--- a/src/plugins/guile/weechat-guile-api.c
+++ b/src/plugins/guile/weechat-guile-api.c
@@ -2005,6 +2005,28 @@ weechat_guile_api_print_date_tags (SCM buffer, SCM date, SCM tags, SCM message)
}
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)
{
API_INIT_FUNC(1, "print_y", API_RETURN_ERROR);
@@ -2043,6 +2065,29 @@ weechat_guile_api_print_y_date_tags (SCM buffer, SCM y, SCM date, SCM tags,
}
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)
{
API_INIT_FUNC(1, "log_print", API_RETURN_ERROR);
@@ -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);