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

api: add function file_compare (issue #2250)

This commit is contained in:
Sébastien Helleu
2025-05-07 20:42:46 +02:00
parent 9a661aecd0
commit 51d24fd2da
11 changed files with 391 additions and 7 deletions
+37
View File
@@ -4624,6 +4624,43 @@ if (weechat_file_compress ("/tmp/test.txt", "/tmp/test.txt.zst", "zstd", 50))
[NOTE]
This function is not available in scripting API.
==== file_compare
_WeeChat ≥ 4.7.0._
Compare the content of two files.
Prototype:
[source,c]
----
int weechat_file_compare (const char *filename1, const char *filename2);
----
Arguments:
* _filename1_: first file to compare
* _filename2_: second file to compare
Return value:
* 0: both files have same content
* 1: content is different
* 2: error (file not found or read error)
C example:
[source,c]
----
if (weechat_file_compare ("/tmp/test.txt", "/tmp/test2.txt") == 0)
{
/* same content */
}
----
[NOTE]
This function is not available in scripting API.
[[util]]
=== Util
+37
View File
@@ -4703,6 +4703,43 @@ if (weechat_file_compress ("/tmp/test.txt", "/tmp/test.txt.zst", "zstd", 50))
[NOTE]
Cette fonction n'est pas disponible dans l'API script.
==== file_compare
_WeeChat ≥ 4.7.0._
Compare the content of two files.
Prototype:
[source,c]
----
int weechat_file_compare (const char *filename1, const char *filename2);
----
Arguments:
* _filename1_: first file to compare
* _filename2_: second file to compare
Return value:
* 0: both files have same content
* 1: content is different
* 2: error (file not found or read error)
C example:
[source,c]
----
if (weechat_file_compare ("/tmp/test.txt", "/tmp/test2.txt") == 0)
{
/* same content */
}
----
[NOTE]
This function is not available in scripting API.
[[util]]
=== Util
+38
View File
@@ -4831,6 +4831,44 @@ if (weechat_file_compress ("/tmp/test.txt", "/tmp/test.txt.zst", "zstd", 50))
[NOTE]
Questa funzione non è disponibile nelle API per lo scripting.
// TRANSLATION MISSING
==== file_compare
_WeeChat ≥ 4.7.0._
Compare the content of two files.
Prototipo:
[source,c]
----
int weechat_file_compare (const char *filename1, const char *filename2);
----
Argomenti:
* _filename1_: first file to compare
* _filename2_: second file to compare
Valore restituito:
* 0: both files have same content
* 1: content is different
* 2: error (file not found or read error)
Esempio in C:
[source,c]
----
if (weechat_file_compare ("/tmp/test.txt", "/tmp/test2.txt") == 0)
{
/* same content */
}
----
[NOTE]
Questa funzione non è disponibile nelle API per lo scripting.
[[util]]
=== Utilità
+38
View File
@@ -4756,6 +4756,44 @@ if (weechat_file_compress ("/tmp/test.txt", "/tmp/test.txt.zst", "zstd", 50))
[NOTE]
スクリプト API ではこの関数を利用できません。
// TRANSLATION MISSING
==== file_compare
_WeeChat ≥ 4.7.0._
Compare the content of two files.
プロトタイプ:
[source,c]
----
int weechat_file_compare (const char *filename1, const char *filename2);
----
引数:
* _filename1_: first file to compare
* _filename2_: second file to compare
戻り値:
* 0: both files have same content
* 1: content is different
* 2: error (file not found or read error)
C 言語での使用例:
[source,c]
----
if (weechat_file_compare ("/tmp/test.txt", "/tmp/test2.txt") == 0)
{
/* same content */
}
----
[NOTE]
スクリプト API ではこの関数を利用できません。
[[util]]
=== ユーティリティ
+38
View File
@@ -4484,6 +4484,44 @@ if (weechat_file_compress ("/tmp/test.txt", "/tmp/test.txt.zst", "zstd", 50))
[NOTE]
Ова функција није доступна у API скриптовања.
// TRANSLATION MISSING
==== file_compare
_WeeChat ≥ 4.7.0._
Compare the content of two files.
Прототип:
[source,c]
----
int weechat_file_compare (const char *filename1, const char *filename2);
----
Аргументи:
* _filename1_: first file to compare
* _filename2_: second file to compare
Повратна вредност:
* 0: both files have same content
* 1: content is different
* 2: error (file not found or read error)
C пример:
[source,c]
----
if (weechat_file_compare ("/tmp/test.txt", "/tmp/test2.txt") == 0)
{
/* same content */
}
----
[NOTE]
Ова функција није доступна у API скриптовања.
[[util]]
=== Алати