1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

doc: mention callback argument "callback_pointer" in differences with C API (scripting guide)

This commit is contained in:
Sébastien Helleu
2020-05-27 22:26:31 +02:00
parent c4832737e9
commit b56843de87
6 changed files with 23 additions and 15 deletions
+4 -3
View File
@@ -416,9 +416,10 @@ Beinahe alle WeeChat Callbacks müssen entweder WEECHAT_RC_OK oder WEECHAT_RC_ER
Ergebnis zurück liefern. Eine Ausnahme bildet das modifier Callback, hier wird ein
String als Rückgabewert erwartet.
C Callbacks nutzen ein "Data" Argument welches ein Pointer ist. In der
Skript API ist "Data" ein String der jeden Wert haben darf (es handelt sich
nicht um einen Pointer).
// TRANSLATION MISSING
C callbacks are using "callback_pointer" and "callback_data" arguments, which
are pointers. In script API, there is only "callback_data" (or "data"), and it
is a string instead of a pointer.
callback Beispiele, für jede Skriptsprache:
+3 -2
View File
@@ -400,8 +400,9 @@ otherwise you may see a nice crash report ;)
Almost all WeeChat callbacks must return WEECHAT_RC_OK or WEECHAT_RC_ERROR
(exception is modifier callback, which returns a string).
C callbacks are using a "data" argument, which is a pointer. In script API,
this "data" is a string with a any value (it's not a pointer).
C callbacks are using "callback_pointer" and "callback_data" arguments, which
are pointers. In script API, there is only "callback_data" (or "data"), and it
is a string instead of a pointer.
Example of callback, for each language:
+4 -3
View File
@@ -418,9 +418,10 @@ Toutes les fonction de rappel WeeChat doivent retourner WEECHAT_RC_OK ou
WEECHAT_RC_ERROR (l'exception est la fonction de rappel du modificateur, qui
retourne une chaîne de caractères).
Les fonction de rappel C utilisent un paramètre "data", qui est un pointeur.
Dans l'API script, ce "data" est une chaîne de caractères avec n'importe quelle
valeur (ce n'est pas un pointeur).
Les fonctions de rappel C utilisent des paramètres "callback_pointer" et
"callback_data", qui sont des pointeurs. Dans l'API script, il y a seulement
"callback_data" (ou "data"), et il s'agit d'une chaîne de caractères au lieu
d'un pointeur.
Exemple de fonction de rappel, pour chaque langage :
+4 -3
View File
@@ -426,9 +426,10 @@ Quasi tutte le callback di WeeChat devono restituire WEECHAT_RC_OK
oppure WEECHAT_RC_ERROR (l'eccezione è la callback modifier, che
restituisce una stringa).
Le callback in C utilizzano un argomento "data", che è un puntatore.
Nelle API per gli script, questo "data" è una stringa con un qualsiasi
valore (non è un puntatore).
// TRANSLATION MISSING
C callbacks are using "callback_pointer" and "callback_data" arguments, which
are pointers. In script API, there is only "callback_data" (or "data"), and it
is a string instead of a pointer.
Esempio di callback, per ogni linguaggio:
+4 -2
View File
@@ -419,8 +419,10 @@ WeeChat の多くのスクリプト API
ほとんど全ての WeeChat コールバックは WEECHAT_RC_OK または WEECHAT_RC_ERROR
を返さなければいけません (modifier コールバックは例外で、これは文字列を返します)。
C 言語コールバックはポインタ型の "data" 引数を利用します。スクリプト API
では、"data" は文字列型で任意の値を取れます (ポインタ型ではありません)。
// TRANSLATION MISSING
C callbacks are using "callback_pointer" and "callback_data" arguments, which
are pointers. In script API, there is only "callback_data" (or "data"), and it
is a string instead of a pointer.
各プログラミング言語でコールバックを利用する例:
+4 -2
View File
@@ -405,8 +405,10 @@ wypadku możesz zobaczyć ładny raport o błędzie ;)
Prawie wszystkie callbacki muszą zwrócić WEECHAT_RC_OK lub WEECHAT_RC_ERROR
(wyjątkiem jest callback modyfikujący, który zwraca ciąg).
Callbacki C używają argumentu "data", który jest wskaźnikiem. W API skryptów,
"data" jest ciągiem o dowolnej wartości (nie jest wskaźnikiem).
// TRANSLATION MISSING
C callbacks are using "callback_pointer" and "callback_data" arguments, which
are pointers. In script API, there is only "callback_data" (or "data"), and it
is a string instead of a pointer.
Przykłady callbacków dla każdego języka: