summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.asciidoc2
-rw-r--r--doc/en/weechat_plugin_api.en.asciidoc11
-rw-r--r--doc/fr/weechat_plugin_api.fr.asciidoc11
-rw-r--r--doc/it/weechat_plugin_api.it.asciidoc14
-rw-r--r--doc/ja/weechat_plugin_api.ja.asciidoc14
-rw-r--r--src/core/wee-util.c2
-rw-r--r--src/core/wee-util.h2
-rw-r--r--src/plugins/weechat-plugin.h4
8 files changed, 43 insertions, 17 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc
index fe15cef9f..1b8bbb5fd 100644
--- a/ChangeLog.asciidoc
+++ b/ChangeLog.asciidoc
@@ -41,7 +41,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* core: fix display of time in bare display when option
weechat.look.buffer_time_format is set to empty string (closes #441)
* api: fix type of value returned by functions strcasestr, utf8_prev_char,
- utf8_next_char and utf8_add_offset
+ utf8_next_char, utf8_add_offset and util_get_time_string
* api: fix type of value returned by function strcasestr
* fifo: fix send error on Cygwin when something is received in the pipe
(closes #436)
diff --git a/doc/en/weechat_plugin_api.en.asciidoc b/doc/en/weechat_plugin_api.en.asciidoc
index fb3082888..c9b12cb88 100644
--- a/doc/en/weechat_plugin_api.en.asciidoc
+++ b/doc/en/weechat_plugin_api.en.asciidoc
@@ -2960,21 +2960,26 @@ This function is not available in scripting API.
==== util_get_time_string
-_WeeChat ≥ 0.3.2._
+_WeeChat ≥ 0.3.2, updated in 1.3._
-Get date/time as a string built with "strftime".
+Get date/time as a string built with "strftime" and the format defined in
+option 'weechat.look.time_format'.
Prototype:
[source,C]
----
-char *weechat_util_get_time_string (const time_t *date);
+const char *weechat_util_get_time_string (const time_t *date);
----
Arguments:
* 'date': pointer to date
+Return value:
+
+* pointer to a string with date/time
+
C example:
[source,C]
diff --git a/doc/fr/weechat_plugin_api.fr.asciidoc b/doc/fr/weechat_plugin_api.fr.asciidoc
index d857d2747..79b5e7e64 100644
--- a/doc/fr/weechat_plugin_api.fr.asciidoc
+++ b/doc/fr/weechat_plugin_api.fr.asciidoc
@@ -3015,21 +3015,26 @@ Cette fonction n'est pas disponible dans l'API script.
==== util_get_time_string
-_WeeChat ≥ 0.3.2._
+_WeeChat ≥ 0.3.2, mise à jour dans la 1.3._
-Retourner la date/heure sous forme de chaîne construite avec "strftime".
+Retourner la date/heure sous forme de chaîne construite avec "strftime" et le
+format défini dans l'option 'weechat.look.time_format'.
Prototype :
[source,C]
----
-char *weechat_util_get_time_string (const time_t *date);
+const char *weechat_util_get_time_string (const time_t *date);
----
Paramètres :
* 'date' : pointeur vers la date
+Valeur de retour :
+
+* pointeur vers une chaîne contenant la date/heure
+
Exemple en C :
[source,C]
diff --git a/doc/it/weechat_plugin_api.it.asciidoc b/doc/it/weechat_plugin_api.it.asciidoc
index b1db3100a..46a547249 100644
--- a/doc/it/weechat_plugin_api.it.asciidoc
+++ b/doc/it/weechat_plugin_api.it.asciidoc
@@ -3060,21 +3060,29 @@ Questa funzione non è disponibile nelle API per lo scripting.
==== util_get_time_string
-_WeeChat ≥ 0.3.2._
+// TRANSLATION MISSING
+_WeeChat ≥ 0.3.2, updated in 1.3._
-Riceve data/ora come stringa compilata con "strftime".
+// TRANSLATION MISSING
+Get date/time as a string built with "strftime" and the format defined in
+option 'weechat.look.time_format'.
Prototipo:
[source,C]
----
-char *weechat_util_get_time_string (const time_t *date);
+const char *weechat_util_get_time_string (const time_t *date);
----
Argomenti:
* 'date': puntatore alla data
+Valore restituito:
+
+// TRANSLATION MISSING
+* pointer to a string with date/time
+
Esempio in C:
[source,C]
diff --git a/doc/ja/weechat_plugin_api.ja.asciidoc b/doc/ja/weechat_plugin_api.ja.asciidoc
index 848cbc26d..869b41351 100644
--- a/doc/ja/weechat_plugin_api.ja.asciidoc
+++ b/doc/ja/weechat_plugin_api.ja.asciidoc
@@ -2971,21 +2971,29 @@ weechat_util_timeval_add (&tv, 2000000); /* add 2 seconds */
==== util_get_time_string
-_WeeChat バージョン 0.3.2 以上で利用可。_
+// TRANSLATION MISSING
+_WeeChat ≥ 0.3.2, updated in 1.3._
-日付や時間を "strftime" で作った文字列で取得。
+// TRANSLATION MISSING
+Get date/time as a string built with "strftime" and the format defined in
+option 'weechat.look.time_format'.
プロトタイプ:
[source,C]
----
-char *weechat_util_get_time_string (const time_t *date);
+const char *weechat_util_get_time_string (const time_t *date);
----
引数:
* 'date': 日付へのポインタ
+戻り値:
+
+// TRANSLATION MISSING
+* pointer to a string with date/time
+
C 言語での使用例:
[source,C]
diff --git a/src/core/wee-util.c b/src/core/wee-util.c
index d2b6a3681..d4d4e8d8f 100644
--- a/src/core/wee-util.c
+++ b/src/core/wee-util.c
@@ -305,7 +305,7 @@ util_timeval_add (struct timeval *tv, long long interval)
* (can be localized).
*/
-char *
+const char *
util_get_time_string (const time_t *date)
{
struct tm *local_time;
diff --git a/src/core/wee-util.h b/src/core/wee-util.h
index 0103fb842..583dfc0d9 100644
--- a/src/core/wee-util.h
+++ b/src/core/wee-util.h
@@ -38,7 +38,7 @@ extern void util_setrlimit ();
extern int util_timeval_cmp (struct timeval *tv1, struct timeval *tv2);
extern long long util_timeval_diff (struct timeval *tv1, struct timeval *tv2);
extern void util_timeval_add (struct timeval *tv, long long interval);
-extern char *util_get_time_string (const time_t *date);
+extern const char *util_get_time_string (const time_t *date);
extern int util_signal_search (const char *name);
extern void util_catch_signal (int signum, void (*handler)(int));
extern int util_mkdir_home (const char *directory, int mode);
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index 51cf06281..31ed0fcfe 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -57,7 +57,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 "20150704-01"
+#define WEECHAT_PLUGIN_API_VERSION "20150704-02"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -347,7 +347,7 @@ struct t_weechat_plugin
int (*util_timeval_cmp) (struct timeval *tv1, struct timeval *tv2);
long long (*util_timeval_diff) (struct timeval *tv1, struct timeval *tv2);
void (*util_timeval_add) (struct timeval *tv, long long interval);
- char *(*util_get_time_string) (const time_t *date);
+ const char *(*util_get_time_string) (const time_t *date);
int (*util_version_number) (const char *version);
/* sorted lists */