~ubuntu-branches/ubuntu/oneiric/weechat/oneiric

« back to all changes in this revision

Viewing changes to doc/it/weechat_plugin_api.it.txt

  • Committer: Bazaar Package Importer
  • Author(s): Emmanuel Bouthenot
  • Date: 2010-12-27 23:29:46 UTC
  • mfrom: (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20101227232946-fh2eh42bmeushi0u
Tags: 0.3.3-3
* Upload to unstable.
* Downgrade tcl-dev dependency to 8.4 until tcl 8.5 hit unstable.
* Add a patch to make cmake aware of python 2.7 (Closes: #606989).
  Thanks to Matthias Klose.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
Referenze API per Plugin di WeeChat
2
2
===================================
3
 
FlashCode <flashcode@flashtux.org>
 
3
Sébastien Helleu <flashcode@flashtux.org>
4
4
 
5
5
 
6
6
Questo manuale documenta il client di chat WeeChat, ed è parte
159
159
 
160
160
WEECHAT_PLUGIN_NAME("double");
161
161
WEECHAT_PLUGIN_DESCRIPTION("Test plugin for WeeChat");
162
 
WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>");
 
162
WEECHAT_PLUGIN_AUTHOR("Sebastien Helleu <flashcode@flashtux.org>");
163
163
WEECHAT_PLUGIN_VERSION("0.1");
164
164
WEECHAT_PLUGIN_LICENSE("GPL3");
165
165
 
193
193
    weechat_plugin = plugin;
194
194
    
195
195
    weechat_hook_command ("double",
196
 
                          "Visualizza due volte un messaggio "
197
 
                          "oppure esegue un comando due volte",
198
 
                          "messaggio | comando",
199
 
                          "messaggio: messaggio da visualizzare due volte\n"
200
 
                          "comando: comando da eseguire due volte",
 
196
                          "Visualizza due volte un messaggio "
 
197
                          "oppure esegue un comando due volte",
 
198
                          "messaggio | comando",
 
199
                          "messaggio: messaggio da visualizzare due volte\n"
 
200
                          "comando: comando da eseguire due volte",
201
201
                          NULL,
202
202
                          &command_double_cb, NULL);
203
203
    
601
601
int diff = weechat_strcasecmp ("aaa", "CCC"); /* == -2 */
602
602
----------------------------------------
603
603
 
 
604
weechat_strncasecmp
 
605
^^^^^^^^^^^^^^^^^^^
 
606
 
 
607
Confronta stringa indipendente da caso (maiuscole o minuscole) e da locale, per
 
608
un numero 'max' di caratteri.
 
609
 
 
610
Prototipo:
 
611
 
 
612
[source,C]
 
613
----------------------------------------
 
614
int weechat_strncasecmp (const char *string1, const char *string2, int max);
 
615
----------------------------------------
 
616
 
 
617
Argomenti:
 
618
 
 
619
* 'string1': prima stringa da comparare
 
620
* 'string2': seconda stringa da comparare
 
621
* 'max': numero massimo di caratteri da comparare
 
622
 
 
623
Valore restituito:
 
624
 
 
625
* differenze tra le due stringhe:
 
626
** negativa se stringa1 < stringa2
 
627
** zero se stringa1 == stringa1
 
628
** positiva se stringa1 > stringa2
 
629
 
 
630
Esempio in C:
 
631
 
 
632
[source,C]
 
633
----------------------------------------
 
634
int diff = weechat_strncasecmp ("aabb", "aacc", 2); /* == 0 */
 
635
----------------------------------------
 
636
 
604
637
weechat_strcmp_ignore_chars
605
638
^^^^^^^^^^^^^^^^^^^^^^^^^^^
606
639
 
747
780
free (str);
748
781
----------------------------------------
749
782
 
 
783
weechat_string_expand_home
 
784
^^^^^^^^^^^^^^^^^^^^^^^^^^
 
785
 
 
786
_Novità nella versione 0.3.3._
 
787
 
 
788
Sostituisce la `~` iniziale con la stringa con la cartella home. Se la stringa
 
789
non inizia con `~`, viene restituita la stessa stringa.
 
790
 
 
791
Prototipo:
 
792
 
 
793
[source,C]
 
794
----------------------------------------
 
795
char *weechat_string_expand_home (const char *path);
 
796
----------------------------------------
 
797
 
 
798
Argomenti:
 
799
 
 
800
* 'path': percorso
 
801
 
 
802
Valore restituito:
 
803
 
 
804
* percorso con la `~` iniziale sostituita dalla cartella home (deve essere
 
805
  liberata chiamando "free" dopo l'uso)
 
806
 
 
807
Esempio in C:
 
808
 
 
809
[source,C]
 
810
----------------------------------------
 
811
char *str = weechat_string_expand_home ("~/file.txt");
 
812
/* result: "/home/xxx/file.txt" */
 
813
/* ... */
 
814
free (str);
 
815
----------------------------------------
 
816
 
750
817
weechat_string_remove_quotes
751
818
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
752
819
 
1174
1241
weechat_string_encode_base64
1175
1242
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1176
1243
 
 
1244
_Novità nella versione 0.3.2._
 
1245
 
1177
1246
Codifica una stringa in base64.
1178
1247
 
1179
1248
Prototype:
1202
1271
weechat_string_decode_base64
1203
1272
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1204
1273
 
1205
 
Decodifca una stringa in base64.
1206
 
 
1207
 
Prototype:
 
1274
_Novità nella versione 0.3.2._
 
1275
 
 
1276
Decodifica una stringa in base64.
 
1277
 
 
1278
Prototipo:
1208
1279
 
1209
1280
[source,C]
1210
1281
----------------------------------------
1211
1282
int weechat_string_decode_base64 (const char *from, char *to);
1212
1283
----------------------------------------
1213
1284
 
1214
 
Arguments:
 
1285
Argomenti:
1215
1286
 
1216
1287
* 'from': stringa da decodificare
1217
1288
* 'to': puntatore alla stringa per memorizzare il risultato (deve essere
1234
1305
weechat_string_is_command_char
1235
1306
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1236
1307
 
 
1308
_Novità nella versione 0.3.2._
 
1309
 
1237
1310
Verifica che il primo carattere della stringa sia un carattere comando
1238
1311
(il comando carattere predefinito è '/').
1239
1312
 
1276
1349
weechat_string_input_for_buffer
1277
1350
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1278
1351
 
 
1352
_Novità nella versione 0.3.2._
 
1353
 
1279
1354
Restituisce il puntatore al testo in input per il buffer (puntatore all'interno
1280
1355
dell'argomento "string"), oppure NULL se è un comando.
1281
1356
 
1472
1547
char *next_char = weechat_utf8_next_char (string);
1473
1548
----------------------------------------
1474
1549
 
 
1550
weechat_utf8_char_int
 
1551
^^^^^^^^^^^^^^^^^^^^^
 
1552
 
 
1553
Restituisce un carattere UTF-8 come intero.
 
1554
 
 
1555
Prototipo:
 
1556
 
 
1557
[source,C]
 
1558
----------------------------------------
 
1559
int weechat_utf8_char_int (const char *string);
 
1560
----------------------------------------
 
1561
 
 
1562
Argomenti:
 
1563
 
 
1564
* 'string': stringa
 
1565
 
 
1566
Valore restituito:
 
1567
 
 
1568
* carattere UTF-8 come intero
 
1569
 
 
1570
Esempio in C:
 
1571
 
 
1572
[source,C]
 
1573
----------------------------------------
 
1574
int char_int = weechat_utf8_char_int ("être"); /* "ê" come intero */
 
1575
----------------------------------------
 
1576
 
1475
1577
weechat_utf8_char_size
1476
1578
^^^^^^^^^^^^^^^^^^^^^^
1477
1579
 
1584
1686
int length_on_screen = weechat_utf8_strlen_screen ("é"); /* == 1 */
1585
1687
----------------------------------------
1586
1688
 
 
1689
weechat_utf8_charcmp
 
1690
^^^^^^^^^^^^^^^^^^^^
 
1691
 
 
1692
Confronta due caratteri UTF-8.
 
1693
 
 
1694
Prototipo:
 
1695
 
 
1696
[source,C]
 
1697
----------------------------------------
 
1698
int weechat_utf8_charcmp (const char *string1, const char *string2);
 
1699
----------------------------------------
 
1700
 
 
1701
Argomenti:
 
1702
 
 
1703
* 'string1': prima stringa da comparare
 
1704
* 'string2': seconda stringa da comparare
 
1705
 
 
1706
Valore restituito:
 
1707
 
 
1708
* differenza tra i primi caratteri di ogni stringa:
 
1709
** negativa se char1 < char2
 
1710
** zero se char1 == char2
 
1711
** positivao se char1 > char2
 
1712
 
 
1713
Esempio in C:
 
1714
 
 
1715
[source,C]
 
1716
----------------------------------------
 
1717
int diff = weechat_utf8_charcmp ("aaa", "ccc"); /* == -2 */
 
1718
----------------------------------------
 
1719
 
1587
1720
weechat_utf8_charcasecmp
1588
1721
^^^^^^^^^^^^^^^^^^^^^^^^
1589
1722
 
1928
2061
weechat_exec_on_files ("/tmp", 0, NULL, &callback);
1929
2062
----------------------------------------
1930
2063
 
 
2064
weechat_file_get_content
 
2065
^^^^^^^^^^^^^^^^^^^^^^^^
 
2066
 
 
2067
_Novità nella versione 0.3.1._
 
2068
 
 
2069
Ottiene il contenuto del file di testo in una stringa.
 
2070
 
 
2071
Prototipo:
 
2072
 
 
2073
[source,C]
 
2074
----------------------------------------
 
2075
char *weechat_file_get_content (const char *filename);
 
2076
----------------------------------------
 
2077
 
 
2078
Argomenti:
 
2079
 
 
2080
* 'filename': percorso e nome file
 
2081
 
 
2082
Valore restituito:
 
2083
 
 
2084
* contenuto del file come stringa (deve essere liberata chiamando "free dopo
 
2085
  l'uso)
 
2086
 
 
2087
Esempio in C:
 
2088
 
 
2089
[source,C]
 
2090
----------------------------------------
 
2091
char *content;
 
2092
 
 
2093
content = weechat_file_get_content ("/tmp/test.txt");
 
2094
/* ... */
 
2095
free (content);
 
2096
----------------------------------------
 
2097
 
1931
2098
[[util]]
1932
2099
Utilità
1933
2100
~~~~~~~
2022
2189
weechat_util_get_time_string
2023
2190
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2024
2191
 
 
2192
_Novità nella versione 0.3.2._
 
2193
 
2025
2194
Riceve data/ora come stringa compilata con "strftime".
2026
2195
 
2027
2196
Prototipo:
2547
2716
weechat.list_free(list)
2548
2717
----------------------------------------
2549
2718
 
 
2719
[[hashtables]]
 
2720
Tabelle hash
 
2721
~~~~~~~~~~~~
 
2722
 
 
2723
Funzioni per le tabelle hash.
 
2724
 
 
2725
weechat_hashtable_new
 
2726
^^^^^^^^^^^^^^^^^^^^^
 
2727
 
 
2728
_Novità nella versione 0.3.3._
 
2729
 
 
2730
Crea una nuova tabella hash.
 
2731
 
 
2732
Prototipo:
 
2733
 
 
2734
[source,C]
 
2735
----------------------------------------
 
2736
struct t_hashtable *weechat_hashtable_new (int size,
 
2737
                                           const char *type_keys,
 
2738
                                           const char *type_values,
 
2739
                                           unsigned int (*callback_hash_key)(struct t_hashtable *hashtable,
 
2740
                                                                             const void *key),
 
2741
                                           int (*callback_keycmp)(struct t_hashtable *hashtable,
 
2742
                                                                  const void *key1,
 
2743
                                                                  const void *key2));
 
2744
----------------------------------------
 
2745
 
 
2746
Arguments:
 
2747
 
 
2748
* 'size': dimensione dell'array interno per memorizzare le chiavi con hash, un
 
2749
  valore più alto usa più memoria, ma ha migliori performance. (questo *non* è
 
2750
  un limite per il numero di elementi nella tabella hash)
 
2751
* 'type_keys': tipo per le chiavi nella tabella hash:
 
2752
** 'WEECHAT_HASHTABLE_INTEGER'
 
2753
** 'WEECHAT_HASHTABLE_STRING'
 
2754
** 'WEECHAT_HASHTABLE_POINTER'
 
2755
** 'WEECHAT_HASHTABLE_BUFFER'
 
2756
** 'WEECHAT_HASHTABLE_TIME'
 
2757
* 'type_values': tipo per i valori nella tabella hash:
 
2758
** 'WEECHAT_HASHTABLE_INTEGER'
 
2759
** 'WEECHAT_HASHTABLE_STRING'
 
2760
** 'WEECHAT_HASHTABLE_POINTER'
 
2761
** 'WEECHAT_HASHTABLE_BUFFER'
 
2762
** 'WEECHAT_HASHTABLE_TIME'
 
2763
* 'callback_hash_key': callback utilizzata per effettuare un "hash" di una
 
2764
  chiave (chiave come valore intero), può essere NULL se il tipo della chiave è
 
2765
  "string" (viene usata una funzione predefinita per le stringhe, e solo per le
 
2766
  stringhe)
 
2767
* 'callback_keycmp': callback utilizzata per comparare due chiavi, può essere
 
2768
  NULL se il tipo di valore è "string" (una funzione di confronto predefinita è
 
2769
  usata per le stringhe e solo per le stringhe)
 
2770
 
 
2771
Valore restituito:
 
2772
 
 
2773
* puntatore alla nuova tabella hash, NULL in caso di errore
 
2774
 
 
2775
Esempio in C:
 
2776
 
 
2777
[source,C]
 
2778
----------------------------------------
 
2779
struct t_hashtable *hashtable = weechat_hashtable_new (8,
 
2780
                                                       WEECHAT_HASHTABLE_STRING,
 
2781
                                                       WEECHAT_HASHTABLE_STRING,
 
2782
                                                       NULL,
 
2783
                                                       NULL);
 
2784
----------------------------------------
 
2785
 
 
2786
weechat_hashtable_set_with_size
 
2787
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
2788
 
 
2789
_Novità nella versione 0.3.3._
 
2790
 
 
2791
Aggiunge o aggiorna un elemento nella tabella hash con la dimensione per la
 
2792
chiave ed il valore.
 
2793
 
 
2794
Prototipo:
 
2795
 
 
2796
[source,C]
 
2797
----------------------------------------
 
2798
int weechat_hashtable_set_with_size (struct t_hashtable *hashtable,
 
2799
                                     void *key, int key_size,
 
2800
                                     void *value, int value_size);
 
2801
----------------------------------------
 
2802
 
 
2803
Arguments:
 
2804
 
 
2805
* 'hashtable': puntatore alla tabella hash
 
2806
* 'key': puntatore alla chiave
 
2807
* 'key_size': dimensione della chiave (in byte), usata solo se il tipo delle
 
2808
   chiavi nella tabella hash è "buffer"
 
2809
* 'value': puntatore al valore
 
2810
* 'value_size': dimensione del valore (in byte), utilizzata solo se il tipo dei
 
2811
   valori nella tabella è "buffer"
 
2812
 
 
2813
Valore restituito:
 
2814
 
 
2815
* 1 se ok, 0 in caso di errore
 
2816
 
 
2817
Esempio in C:
 
2818
 
 
2819
[source,C]
 
2820
----------------------------------------
 
2821
weechat_hashtable_set_with_size (hashtable, "my_key", 0,
 
2822
                                 my_buffer, sizeof (my_buffer_struct));
 
2823
----------------------------------------
 
2824
 
 
2825
weechat_hashtable_set
 
2826
^^^^^^^^^^^^^^^^^^^^^
 
2827
 
 
2828
_Novità nella versione 0.3.3._
 
2829
 
 
2830
Aggiunge o aggiorna un elemento nella tabella hash.
 
2831
 
 
2832
Prototipo:
 
2833
 
 
2834
[source,C]
 
2835
----------------------------------------
 
2836
int weechat_hashtable_set (struct t_hashtable *hashtable,
 
2837
                           void *key, void *value);
 
2838
----------------------------------------
 
2839
 
 
2840
Argomenti:
 
2841
 
 
2842
* 'hashtable': puntatore alla tabella hash
 
2843
* 'key': puntatore alla chiave
 
2844
* 'value': puntatore al valore
 
2845
 
 
2846
Valore restituito:
 
2847
 
 
2848
* 1 se ok, 0 in caso di errore
 
2849
 
 
2850
Esempio in C:
 
2851
 
 
2852
[source,C]
 
2853
----------------------------------------
 
2854
weechat_hashtable_set (hashtable, "my_key", "my_value");
 
2855
----------------------------------------
 
2856
 
 
2857
weechat_hashtable_get
 
2858
^^^^^^^^^^^^^^^^^^^^^
 
2859
 
 
2860
_Novità nella versione 0.3.3._
 
2861
 
 
2862
Ottiene il valore associato ad una chiave in una tabella hash.
 
2863
 
 
2864
Prototipo:
 
2865
 
 
2866
[source,C]
 
2867
----------------------------------------
 
2868
void *weechat_hashtable_get (struct t_hashtable *hashtable, void *key);
 
2869
----------------------------------------
 
2870
 
 
2871
Argomenti:
 
2872
 
 
2873
* 'hashtable': puntatore alla tabella hash
 
2874
* 'key': puntatore alla chiave
 
2875
 
 
2876
Valore restituito:
 
2877
 
 
2878
* valore per la chiave, NULL se non trovata
 
2879
 
 
2880
Esempio in C:
 
2881
 
 
2882
[source,C]
 
2883
----------------------------------------
 
2884
void *value = weechat_hashtable_get (hashtable, "my_key");
 
2885
----------------------------------------
 
2886
 
 
2887
weechat_hashtable_map
 
2888
^^^^^^^^^^^^^^^^^^^^^
 
2889
 
 
2890
_Novità nella versione 0.3.3._
 
2891
 
 
2892
Chiama una funzione su tutte le voci della tabella hash.
 
2893
 
 
2894
Prototipo:
 
2895
 
 
2896
[source,C]
 
2897
----------------------------------------
 
2898
void hashtable_map (struct t_hashlist *hashlist,
 
2899
                    int (*callback_map)(void *data,
 
2900
                                        struct t_hashtable *hashtable,
 
2901
                                        const void *key,
 
2902
                                        const void *value),
 
2903
                    void *callback_map_data);
 
2904
----------------------------------------
 
2905
 
 
2906
Argomenti:
 
2907
 
 
2908
* 'hashtable': puntatore alla tabella hash
 
2909
* 'callback_map': funzione chiamata per ogni voce nella tabella hash
 
2910
* 'callback_map_data': puntatore fornito alla mappa di callback quando chiamata
 
2911
 
 
2912
Esempio in C:
 
2913
 
 
2914
[source,C]
 
2915
----------------------------------------
 
2916
void
 
2917
map_cb (void *data, struct t_hashtable *hashtable,
 
2918
        const void *key, const void *value)
 
2919
{
 
2920
    /* display key and value (they are both strings here) */
 
2921
    weechat_printf (NULL, "key: '%s', value: '%s'",
 
2922
                    (const char *)key,
 
2923
                    (const char *)value);
 
2924
}
 
2925
/* ... */
 
2926
weechat_hashtable_map (hashtable, &map_cb, NULL);
 
2927
----------------------------------------
 
2928
 
 
2929
weechat_hashtable_get_integer
 
2930
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
2931
 
 
2932
_Novità nella versione 0.3.3._
 
2933
 
 
2934
Restituisce un valore intero per la proprietà di una tabella hash.
 
2935
 
 
2936
Prototipo:
 
2937
 
 
2938
[source,C]
 
2939
----------------------------------------
 
2940
int weechat_hashtable_get_integer (struct t_hashtable *hashtable,
 
2941
                                   void *property);
 
2942
----------------------------------------
 
2943
 
 
2944
Argomenti:
 
2945
 
 
2946
* 'hashtable': puntatore alla tabella hash
 
2947
* 'property': nome della proprietà:
 
2948
** 'size': dimensione dell'array interno "htable" nella tabella hash
 
2949
** 'items_count': numero di elementi nella tabella hash
 
2950
 
 
2951
Valore restituito:
 
2952
 
 
2953
* valore intero della proprietà
 
2954
 
 
2955
Esempio in C:
 
2956
 
 
2957
[source,C]
 
2958
----------------------------------------
 
2959
int items_count = weechat_hashtable_get_integer (hashtable, "items_count");
 
2960
----------------------------------------
 
2961
 
 
2962
weechat_hashtable_add_to_infolist
 
2963
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
2964
 
 
2965
_Novità nella versione 0.3.3._
 
2966
 
 
2967
Aggiunge elementi della tabella hash ad un elemento della lista info.
 
2968
 
 
2969
Prototipo:
 
2970
 
 
2971
[source,C]
 
2972
----------------------------------------
 
2973
int weechat_hashtable_add_to_infolist (struct t_hashtable *hashtable,
 
2974
                                       struct t_infolist_item *infolist_item,
 
2975
                                       const char *prefix);
 
2976
----------------------------------------
 
2977
 
 
2978
Argomenti:
 
2979
 
 
2980
* 'hashtable': puntatore alla tabella hash
 
2981
* 'infolist_item': puntatore all'elemento della lista info
 
2982
* 'prefix': stringa usata come prefisso per i nomi nella lista info
 
2983
 
 
2984
Valore restituito:
 
2985
 
 
2986
* 1 se ok, 0 in caso di errore
 
2987
 
 
2988
Esempio in C:
 
2989
 
 
2990
[source,C]
 
2991
----------------------------------------
 
2992
weechat_hashtable_add_to_infolist (hashtable, infolist_item, "testhash");
 
2993
 
 
2994
/* se la tabella hash contiene:
 
2995
     "key1" => "value 1"
 
2996
     "key2" => "value 2"
 
2997
   allora le seguenti variabili verranno aggiunti all'elemento  della lista info:
 
2998
     "testhash_name_00001"  = "key1"
 
2999
     "testhash_value_00001" = "value 1"
 
3000
     "testhash_name_00002"  = "key2"
 
3001
     "testhash_value_00002" = "value 2"
 
3002
*/
 
3003
----------------------------------------
 
3004
 
 
3005
weechat_hashtable_remove
 
3006
^^^^^^^^^^^^^^^^^^^^^^^^
 
3007
 
 
3008
_Novità nella versione 0.3.3._
 
3009
 
 
3010
Rimuove un elemento in una tabella hash.
 
3011
 
 
3012
Prototipo:
 
3013
 
 
3014
[source,C]
 
3015
----------------------------------------
 
3016
void weechat_hashtable_remove (struct t_hashtable *hashtable, const void *key);
 
3017
----------------------------------------
 
3018
 
 
3019
Argomenti:
 
3020
 
 
3021
* 'hashtable': puntatore alla tabella hash
 
3022
* 'key': puntatore alla chiave
 
3023
 
 
3024
Esempio in C:
 
3025
 
 
3026
[source,C]
 
3027
----------------------------------------
 
3028
weechat_hashtable_remove (hashtable, "my_key");
 
3029
----------------------------------------
 
3030
 
 
3031
weechat_hashtable_remove_all
 
3032
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
3033
 
 
3034
_Novità nella versione 0.3.3._
 
3035
 
 
3036
Rimuove tutti gli elementi in una tabella hash.
 
3037
 
 
3038
Prototipo:
 
3039
 
 
3040
[source,C]
 
3041
----------------------------------------
 
3042
void weechat_hashtable_remove_all (struct t_hashtable *hashtable);
 
3043
----------------------------------------
 
3044
 
 
3045
Argomenti:
 
3046
 
 
3047
* 'hashtable': puntatore alla tabella hash
 
3048
 
 
3049
Esempio in C:
 
3050
 
 
3051
[source,C]
 
3052
----------------------------------------
 
3053
weechat_hashtable_remove_all (hashtable);
 
3054
----------------------------------------
 
3055
 
 
3056
weechat_hashtable_free
 
3057
^^^^^^^^^^^^^^^^^^^^^^
 
3058
 
 
3059
_Novità nella versione 0.3.3._
 
3060
 
 
3061
Libera una tabella hash.
 
3062
 
 
3063
Prototipo:
 
3064
 
 
3065
[source,C]
 
3066
----------------------------------------
 
3067
void weechat_hashtable_free (struct t_hashtable *hashtable);
 
3068
----------------------------------------
 
3069
 
 
3070
Argomenti:
 
3071
 
 
3072
* 'hashtable': puntatore alla tabella hash
 
3073
 
 
3074
Esempio in C:
 
3075
 
 
3076
[source,C]
 
3077
----------------------------------------
 
3078
weechat_hashtable_free (hashtable);
 
3079
----------------------------------------
 
3080
 
2550
3081
[[configuration_files]]
2551
3082
File di configurazione
2552
3083
~~~~~~~~~~~~~~~~~~~~~~
3128
3659
option = weechat.config_search_option(config_file, section, "option")
3129
3660
----------------------------------------
3130
3661
 
 
3662
weechat_config_search_section_option
 
3663
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
3664
 
 
3665
Cerca una sezione ed un'opzione in un file di configurazione o sezione.
 
3666
 
 
3667
Prototipo:
 
3668
 
 
3669
[source,C]
 
3670
----------------------------------------
 
3671
void weechat_config_search_section_option (struct t_config_file *config_file,
 
3672
                                           struct t_config_section *section,
 
3673
                                           const char *option_name,
 
3674
                                           struct t_config_section **section_found,
 
3675
                                           struct t_config_option **option_found);
 
3676
----------------------------------------
 
3677
 
 
3678
Arguments:
 
3679
 
 
3680
* 'config_file': puntatore al file di configurazione
 
3681
* 'section': puntatore alla sezione
 
3682
* 'option_name': nome dell'opzione
 
3683
* 'section_found': puntatore al puntatore della sezione, sarà impostato alla
 
3684
  sezione dell'opzione, se viene trovata
 
3685
* 'option_found': puntatore al puntatore dell'opzione, sarà impostato al
 
3686
  puntatore di un'opzione, se viene trovata
 
3687
 
 
3688
Esempio in C:
 
3689
 
 
3690
[source,C]
 
3691
----------------------------------------
 
3692
struct t_config_section *ptr_section;
 
3693
struct t_config_option *ptr_option;
 
3694
 
 
3695
weechat_config_search_section_option(config_file,
 
3696
                                     section,
 
3697
                                     "option",
 
3698
                                     &ptr_section,
 
3699
                                     &ptr_option);
 
3700
if (ptr_option)
 
3701
{
 
3702
    /* opzione trovata */
 
3703
}
 
3704
else
 
3705
{
 
3706
    /* opzione non trovata */
 
3707
}
 
3708
----------------------------------------
 
3709
 
3131
3710
weechat_config_search_with_string
3132
3711
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3133
3712
 
5150
5729
                   const char *command)
5151
5730
{
5152
5731
    weechat_printf (NULL,
5153
 
                    "Vuoi completare? Sto mangiando il completamento, ahah!);
 
5732
                    "Vuoi completare? Sto mangiando il completamento, ahah!);
5154
5733
    return WEECHAT_RC_OK_EAT;
5155
5734
}
5156
5735