2
* weechat-tcl-api.c - tcl API functions
2
4
* Copyright (C) 2008-2010 Dmitry Kobylin <fnfal@academ.tsc.ru>
3
5
* Copyright (C) 2008 Julien Louis <ptitlouis@sysif.net>
4
* Copyright (C) 2008-2012 Sebastien Helleu <flashcode@flashtux.org>
6
* Copyright (C) 2008-2013 Sebastien Helleu <flashcode@flashtux.org>
7
* Copyright (C) 2012 Simon Arlott
6
9
* This file is part of WeeChat, the extensible chat client.
308
309
API_RETURN_STRING(result);
312
* weechat_tcl_api_charset_set: set script charset
316
313
weechat_tcl_api_charset_set (ClientData clientData, Tcl_Interp *interp,
317
314
int objc, Tcl_Obj *CONST objv[])
333
* weechat_tcl_api_iconv_to_internal: convert string to internal WeeChat
338
330
weechat_tcl_api_iconv_to_internal (ClientData clientData, Tcl_Interp *interp,
339
331
int objc, Tcl_Obj *CONST objv[])
354
346
API_RETURN_STRING_FREE(result);
358
* weechat_tcl_api_iconv_from_internal: convert string from WeeChat inernal
359
* charset to another one
363
350
weechat_tcl_api_iconv_from_internal (ClientData clientData, Tcl_Interp *interp,
364
351
int objc, Tcl_Obj *CONST objv[])
379
366
API_RETURN_STRING_FREE(result);
383
* weechat_tcl_api_gettext: get translated string
387
370
weechat_tcl_api_gettext (ClientData clientData, Tcl_Interp *interp,
388
371
int objc, Tcl_Obj *CONST objv[])
400
383
API_RETURN_STRING(result);
404
* weechat_tcl_api_ngettext: get translated string with plural form
408
387
weechat_tcl_api_ngettext (ClientData clientData, Tcl_Interp *interp,
409
388
int objc, Tcl_Obj *CONST objv[])
428
407
API_RETURN_STRING(result);
432
* weechat_tcl_api_string_match: return 1 if string matches a mask
433
* mask can begin or end with "*", no other "*"
434
* are allowed inside mask
438
411
weechat_tcl_api_string_match (ClientData clientData, Tcl_Interp *interp,
439
412
int objc, Tcl_Obj *CONST objv[])
457
430
API_RETURN_INT(result);
461
* weechat_tcl_api_string_has_highlight: return 1 if string contains a
462
* highlight (using list of words to
464
* return 0 if no highlight is found in
469
434
weechat_tcl_api_string_has_highlight (ClientData clientData,
470
435
Tcl_Interp *interp,
486
451
API_RETURN_INT(result);
490
* weechat_tcl_api_string_has_highlight_regex: return 1 if string contains a
491
* highlight (using a regular
493
* return 0 if no highlight is
498
455
weechat_tcl_api_string_has_highlight_regex (ClientData clientData,
499
456
Tcl_Interp *interp,
515
472
API_RETURN_INT(result);
519
* weechat_tcl_api_string_mask_to_regex: convert a mask (string with only
520
* "*" as wildcard) to a regex, paying
521
* attention to special chars in a
526
476
weechat_tcl_api_string_mask_to_regex (ClientData clientData,
527
477
Tcl_Interp *interp,
542
492
API_RETURN_STRING_FREE(result);
546
* weechat_tcl_api_string_remove_color: remove WeeChat color codes from string
550
496
weechat_tcl_api_string_remove_color (ClientData clientData, Tcl_Interp *interp,
551
497
int objc, Tcl_Obj *CONST objv[])
566
512
API_RETURN_STRING_FREE(result);
570
* weechat_tcl_api_string_is_command_char: check if first char of string is a
575
516
weechat_tcl_api_string_is_command_char (ClientData clientData, Tcl_Interp *interp,
576
517
int objc, Tcl_Obj *CONST objv[])
587
528
API_RETURN_INT(result);
591
* weechat_tcl_api_string_input_for_buffer: return string with input text
592
* for buffer or empty string if
597
532
weechat_tcl_api_string_input_for_buffer (ClientData clientData, Tcl_Interp *interp,
598
533
int objc, Tcl_Obj *CONST objv[])
610
545
API_RETURN_STRING(result);
614
* weechat_tcl_api_mkdir_home: create a directory in WeeChat home
549
weechat_tcl_api_string_eval_expression (ClientData clientData,
551
int objc, Tcl_Obj *CONST objv[])
555
struct t_hashtable *pointers, *extra_vars;
558
API_FUNC(1, "string_eval_expression", API_RETURN_EMPTY);
560
API_WRONG_ARGS(API_RETURN_EMPTY);
562
expr = Tcl_GetStringFromObj (objv[1], &i);
563
pointers = weechat_tcl_dict_to_hashtable (interp, objv[2],
564
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
565
WEECHAT_HASHTABLE_STRING,
566
WEECHAT_HASHTABLE_POINTER);
567
extra_vars = weechat_tcl_dict_to_hashtable (interp, objv[3],
568
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
569
WEECHAT_HASHTABLE_STRING,
570
WEECHAT_HASHTABLE_STRING);
572
result = weechat_string_eval_expression (expr, pointers, extra_vars);
575
weechat_hashtable_free (pointers);
577
weechat_hashtable_free (extra_vars);
579
API_RETURN_STRING_FREE(result);
618
583
weechat_tcl_api_mkdir_home (ClientData clientData, Tcl_Interp *interp,
635
600
API_RETURN_ERROR;
639
* weechat_tcl_api_mkdir: create a directory
643
604
weechat_tcl_api_mkdir (ClientData clientData, Tcl_Interp *interp,
644
605
int objc, Tcl_Obj *CONST objv[])
660
621
API_RETURN_ERROR;
664
* weechat_tcl_api_mkdir_parents: create a directory and make parent
665
* directories as needed
669
625
weechat_tcl_api_mkdir_parents (ClientData clientData, Tcl_Interp *interp,
670
626
int objc, Tcl_Obj *CONST objv[])
686
642
API_RETURN_ERROR;
690
* weechat_tcl_api_list_new: create a new list
694
646
weechat_tcl_api_list_new (ClientData clientData, Tcl_Interp *interp,
695
647
int objc, Tcl_Obj *CONST objv[])
709
661
API_RETURN_STRING_FREE(result);
713
* weechat_tcl_api_list_add: add a string to list
717
665
weechat_tcl_api_list_add (ClientData clientData, Tcl_Interp *interp,
718
666
int objc, Tcl_Obj *CONST objv[])
739
687
API_RETURN_STRING_FREE(result);
743
* weechat_tcl_api_list_search: search a string in list
747
691
weechat_tcl_api_list_search (ClientData clientData, Tcl_Interp *interp,
748
692
int objc, Tcl_Obj *CONST objv[])
764
708
API_RETURN_STRING_FREE(result);
768
* weechat_tcl_api_list_search_pos: search position of a string in list
772
712
weechat_tcl_api_list_search_pos (ClientData clientData, Tcl_Interp *interp,
773
713
int objc, Tcl_Obj *CONST objv[])
788
728
API_RETURN_INT(pos);
792
* weechat_tcl_api_list_casesearch: search a string in list (ignore case)
796
732
weechat_tcl_api_list_casesearch (ClientData clientData, Tcl_Interp *interp,
797
733
int objc, Tcl_Obj *CONST objv[])
813
749
API_RETURN_STRING_FREE(result);
817
* weechat_tcl_api_list_casesearch_pos: search position of a string in list
822
753
weechat_tcl_api_list_casesearch_pos (ClientData clientData, Tcl_Interp *interp,
823
754
int objc, Tcl_Obj *CONST objv[])
838
769
API_RETURN_INT(pos);
842
* weechat_tcl_api_list_get: get item by position
846
773
weechat_tcl_api_list_get (ClientData clientData, Tcl_Interp *interp,
847
774
int objc, Tcl_Obj *CONST objv[])
863
790
API_RETURN_STRING_FREE(result);
867
* weechat_tcl_api_list_set: set new value for item
871
794
weechat_tcl_api_list_set (ClientData clientData, Tcl_Interp *interp,
872
795
int objc, Tcl_Obj *CONST objv[])
891
* weechat_tcl_api_list_next: get next item
895
814
weechat_tcl_api_list_next (ClientData clientData, Tcl_Interp *interp,
896
815
int objc, Tcl_Obj *CONST objv[])
908
827
API_RETURN_STRING_FREE(result);
912
* weechat_tcl_api_list_prev: get previous item
916
831
weechat_tcl_api_list_prev (ClientData clientData, Tcl_Interp *interp,
917
832
int objc, Tcl_Obj *CONST objv[])
929
844
API_RETURN_STRING_FREE(result);
933
* weechat_tcl_api_list_string: get string value of item
937
848
weechat_tcl_api_list_string (ClientData clientData, Tcl_Interp *interp,
938
849
int objc, Tcl_Obj *CONST objv[])
950
861
API_RETURN_STRING(result);
954
* weechat_tcl_api_list_size: get number of elements in list
958
865
weechat_tcl_api_list_size (ClientData clientData, Tcl_Interp *interp,
959
866
int objc, Tcl_Obj *CONST objv[])
971
878
API_RETURN_INT(size);
975
* weechat_tcl_api_list_remove: remove item from list
979
882
weechat_tcl_api_list_remove (ClientData clientData, Tcl_Interp *interp,
980
883
int objc, Tcl_Obj *CONST objv[])
1000
* weechat_tcl_api_list_remove_all: remove all items from list
1004
903
weechat_tcl_api_list_remove_all (ClientData clientData, Tcl_Interp *interp,
1005
904
int objc, Tcl_Obj *CONST objv[])
1022
* weechat_tcl_api_list_free: free list
1026
921
weechat_tcl_api_list_free (ClientData clientData, Tcl_Interp *interp,
1027
922
int objc, Tcl_Obj *CONST objv[])
1080
971
return WEECHAT_CONFIG_READ_FILE_NOT_FOUND;
1084
* weechat_tcl_api_config_new: create a new configuration file
1088
975
weechat_tcl_api_config_new (ClientData clientData, Tcl_Interp *interp,
1089
976
int objc, Tcl_Obj *CONST objv[])
1110
997
API_RETURN_STRING_FREE(result);
1114
* weechat_tcl_api_config_section_read_cb: callback for reading option in
1119
1001
weechat_tcl_api_config_section_read_cb (void *data,
1120
1002
struct t_config_file *config_file,
1159
1041
return WEECHAT_CONFIG_OPTION_SET_ERROR;
1163
* weechat_tcl_api_config_section_write_cb: callback for writing section
1167
1045
weechat_tcl_api_config_section_write_cb (void *data,
1168
1046
struct t_config_file *config_file,
1202
1080
return WEECHAT_CONFIG_WRITE_ERROR;
1206
* weechat_tcl_api_config_section_write_default_cb: callback for writing
1207
* default values for section
1211
1084
weechat_tcl_api_config_section_write_default_cb (void *data,
1212
1085
struct t_config_file *config_file,
1246
1119
return WEECHAT_CONFIG_WRITE_ERROR;
1250
* weechat_tcl_api_config_section_create_option_cb: callback to create an
1255
1123
weechat_tcl_api_config_section_create_option_cb (void *data,
1256
1124
struct t_config_file *config_file,
1296
1164
return WEECHAT_CONFIG_OPTION_SET_ERROR;
1300
* weechat_tcl_api_config_section_delete_option_cb: callback to delete an
1305
1168
weechat_tcl_api_config_section_delete_option_cb (void *data,
1306
1169
struct t_config_file *config_file,
1346
1209
return WEECHAT_CONFIG_OPTION_UNSET_ERROR;
1350
* weechat_tcl_api_config_new_section: create a new section in configuration
1355
1213
weechat_tcl_api_config_new_section (ClientData clientData, Tcl_Interp *interp,
1356
1214
int objc, Tcl_Obj *CONST objv[])
1411
1269
API_RETURN_STRING_FREE(result);
1415
* weechat_tcl_api_config_search_section: search section in configuration file
1419
1273
weechat_tcl_api_config_search_section (ClientData clientData, Tcl_Interp *interp,
1420
1274
int objc, Tcl_Obj *CONST objv[])
1551
* weechat_tcl_api_config_new_option: create a new option in section
1555
1392
weechat_tcl_api_config_new_option (ClientData clientData, Tcl_Interp *interp,
1556
1393
int objc, Tcl_Obj *CONST objv[])
1612
1449
API_RETURN_STRING_FREE(result);
1616
* weechat_tcl_api_config_search_option: search option in configuration file or
1621
1453
weechat_tcl_api_config_search_option (ClientData clientData, Tcl_Interp *interp,
1622
1454
int objc, Tcl_Obj *CONST objv[])
1640
1472
API_RETURN_STRING_FREE(result);
1644
* weechat_tcl_api_config_string_to_boolean: return boolean value of a string
1648
1476
weechat_tcl_api_config_string_to_boolean (ClientData clientData, Tcl_Interp *interp,
1649
1477
int objc, Tcl_Obj *CONST objv[])
1660
1488
API_RETURN_INT(result);
1664
* weechat_tcl_api_config_option_reset: reset an option with default value
1668
1492
weechat_tcl_api_config_option_reset (ClientData clientData, Tcl_Interp *interp,
1669
1493
int objc, Tcl_Obj *CONST objv[])
1688
1512
API_RETURN_INT(rc);
1692
* weechat_tcl_api_config_option_set: set new value for option
1696
1516
weechat_tcl_api_config_option_set (ClientData clientData, Tcl_Interp *interp,
1697
1517
int objc, Tcl_Obj *CONST objv[])
1718
1538
API_RETURN_INT(rc);
1722
* weechat_tcl_api_config_option_set_null: set null (undefined)value for option
1726
1542
weechat_tcl_api_config_option_set_null (ClientData clientData, Tcl_Interp *interp,
1727
1543
int objc, Tcl_Obj *CONST objv[])
1746
1562
API_RETURN_INT(rc);
1750
* weechat_tcl_api_config_option_unset: unset an option
1754
1566
weechat_tcl_api_config_option_unset (ClientData clientData, Tcl_Interp *interp,
1755
1567
int objc, Tcl_Obj *CONST objv[])
1770
1582
API_RETURN_INT(rc);
1774
* weechat_tcl_api_config_option_rename: rename an option
1778
1586
weechat_tcl_api_config_option_rename (ClientData clientData, Tcl_Interp *interp,
1779
1587
int objc, Tcl_Obj *CONST objv[])
1799
* weechat_tcl_api_config_option_is_null: return 1 if value of option is null
1803
1607
weechat_tcl_api_config_option_is_null (ClientData clientData, Tcl_Interp *interp,
1804
1608
int objc, Tcl_Obj *CONST objv[])
1837
1636
API_RETURN_INT(result);
1841
* weechat_tcl_api_config_boolean: return boolean value of option
1845
1640
weechat_tcl_api_config_boolean (ClientData clientData, Tcl_Interp *interp,
1846
1641
int objc, Tcl_Obj *CONST objv[])
1857
1652
API_RETURN_INT(result);
1861
* weechat_tcl_api_config_boolean_default: return default boolean value of option
1865
1656
weechat_tcl_api_config_boolean_default (ClientData clientData, Tcl_Interp *interp,
1866
1657
int objc, Tcl_Obj *CONST objv[])
1877
1668
API_RETURN_INT(result);
1881
* weechat_tcl_api_config_integer: return integer value of option
1885
1672
weechat_tcl_api_config_integer (ClientData clientData, Tcl_Interp *interp,
1886
1673
int objc, Tcl_Obj *CONST objv[])
1897
1684
API_RETURN_INT(result);
1901
* weechat_tcl_api_config_integer_default: return default integer value of option
1905
1688
weechat_tcl_api_config_integer_default (ClientData clientData, Tcl_Interp *interp,
1906
1689
int objc, Tcl_Obj *CONST objv[])
1917
1700
API_RETURN_INT(result);
1921
* weechat_tcl_api_config_string: return string value of option
1925
1704
weechat_tcl_api_config_string (ClientData clientData, Tcl_Interp *interp,
1926
1705
int objc, Tcl_Obj *CONST objv[])
1938
1717
API_RETURN_STRING(result);
1942
* weechat_tcl_api_config_string_default: return default string value of option
1946
1721
weechat_tcl_api_config_string_default (ClientData clientData, Tcl_Interp *interp,
1947
1722
int objc, Tcl_Obj *CONST objv[])
1959
1734
API_RETURN_STRING(result);
1963
* weechat_tcl_api_config_color: return color value of option
1967
1738
weechat_tcl_api_config_color (ClientData clientData, Tcl_Interp *interp,
1968
1739
int objc, Tcl_Obj *CONST objv[])
1980
1751
API_RETURN_STRING(result);
1984
* weechat_tcl_api_config_color_default: return default color value of option
1988
1755
weechat_tcl_api_config_color_default (ClientData clientData, Tcl_Interp *interp,
1989
1756
int objc, Tcl_Obj *CONST objv[])
2001
1768
API_RETURN_STRING(result);
2005
* weechat_tcl_api_config_write_option: write an option in configuration file
2009
1772
weechat_tcl_api_config_write_option (ClientData clientData, Tcl_Interp *interp,
2010
1773
int objc, Tcl_Obj *CONST objv[])
2030
* weechat_tcl_api_config_write_line: write a line in configuration file
2034
1793
weechat_tcl_api_config_write_line (ClientData clientData, Tcl_Interp *interp,
2035
1794
int objc, Tcl_Obj *CONST objv[])
2056
* weechat_tcl_api_config_write: write configuration file
2060
1815
weechat_tcl_api_config_write (ClientData clientData, Tcl_Interp *interp,
2061
1816
int objc, Tcl_Obj *CONST objv[])
2073
1828
API_RETURN_INT(rc);
2077
* weechat_tcl_api_config_read: read configuration file
2081
1832
weechat_tcl_api_config_read (ClientData clientData, Tcl_Interp *interp,
2082
1833
int objc, Tcl_Obj *CONST objv[])
2094
1845
API_RETURN_INT(rc);
2098
* weechat_tcl_api_config_reload: reload configuration file
2102
1849
weechat_tcl_api_config_reload (ClientData clientData, Tcl_Interp *interp,
2103
1850
int objc, Tcl_Obj *CONST objv[])
2115
1862
API_RETURN_INT(rc);
2119
* weechat_tcl_api_config_option_free: free an option in configuration file
2123
1866
weechat_tcl_api_config_option_free (ClientData clientData, Tcl_Interp *interp,
2124
1867
int objc, Tcl_Obj *CONST objv[])
2141
* weechat_tcl_api_config_section_free_options: free all options of a section
2142
* in configuration file
2146
1884
weechat_tcl_api_config_section_free_options (ClientData clientData, Tcl_Interp *interp,
2147
1885
int objc, Tcl_Obj *CONST objv[])
2164
* weechat_tcl_api_config_section_free: free section in configuration file
2168
1902
weechat_tcl_api_config_section_free (ClientData clientData, Tcl_Interp *interp,
2169
1903
int objc, Tcl_Obj *CONST objv[])
2186
* weechat_tcl_api_config_free: free configuration file
2190
1920
weechat_tcl_api_config_free (ClientData clientData, Tcl_Interp *interp,
2191
1921
int objc, Tcl_Obj *CONST objv[])
2208
* weechat_tcl_api_config_get: get config option
2212
1938
weechat_tcl_api_config_get (ClientData clientData, Tcl_Interp *interp,
2213
1939
int objc, Tcl_Obj *CONST objv[])
2225
1951
API_RETURN_STRING_FREE(result);
2229
* weechat_tcl_api_config_get_plugin: get value of a plugin option
2233
1955
weechat_tcl_api_config_get_plugin (ClientData clientData, Tcl_Interp *interp,
2234
1956
int objc, Tcl_Obj *CONST objv[])
2248
1970
API_RETURN_STRING(result);
2252
* weechat_tcl_api_config_is_set_plugin: check if a plugin option is set
2256
1974
weechat_tcl_api_config_is_set_plugin (ClientData clientData, Tcl_Interp *interp,
2257
1975
int objc, Tcl_Obj *CONST objv[])
2273
1991
API_RETURN_INT(rc);
2277
* weechat_tcl_api_config_set_plugin: set value of a plugin option
2281
1995
weechat_tcl_api_config_set_plugin (ClientData clientData, Tcl_Interp *interp,
2282
1996
int objc, Tcl_Obj *CONST objv[])
2300
2014
API_RETURN_INT(rc);
2304
* weechat_tcl_api_config_set_desc_plugin: set description of a plugin option
2308
2018
weechat_tcl_api_config_set_desc_plugin (ClientData clientData, Tcl_Interp *interp,
2309
2019
int objc, Tcl_Obj *CONST objv[])
2331
* weechat_tcl_api_config_set_plugin: unset plugin option
2335
2041
weechat_tcl_api_config_unset_plugin (ClientData clientData, Tcl_Interp *interp,
2336
2042
int objc, Tcl_Obj *CONST objv[])
2352
2058
API_RETURN_INT(rc);
2356
* weechat_tcl_api_key_bind: bind key(s)
2360
2062
weechat_tcl_api_key_bind (ClientData clientData, Tcl_Interp *interp,
2361
2063
int objc, Tcl_Obj *CONST objv[])
2372
2074
context = Tcl_GetStringFromObj (objv[1], &i);
2373
2075
hashtable = weechat_tcl_dict_to_hashtable (interp, objv[2],
2374
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
2076
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
2077
WEECHAT_HASHTABLE_STRING,
2078
WEECHAT_HASHTABLE_STRING);
2376
2080
num_keys = weechat_key_bind (context, hashtable);
2381
2085
API_RETURN_INT(num_keys);
2385
* weechat_tcl_api_key_unbind: unbind key(s)
2389
2089
weechat_tcl_api_key_unbind (ClientData clientData, Tcl_Interp *interp,
2390
2090
int objc, Tcl_Obj *CONST objv[])
2405
2105
API_RETURN_INT(num_keys);
2409
* weechat_tcl_api_prefix: get a prefix, used for display
2413
2109
weechat_tcl_api_prefix (ClientData clientData, Tcl_Interp *interp,
2414
2110
int objc, Tcl_Obj *CONST objv[])
2426
2122
API_RETURN_STRING(result);
2430
* weechat_tcl_api_color: get a color code, used for display
2434
2126
weechat_tcl_api_color (ClientData clientData, Tcl_Interp *interp,
2435
2127
int objc, Tcl_Obj *CONST objv[])
2447
2139
API_RETURN_STRING(result);
2451
* weechat_tcl_api_print: print message in a buffer
2455
2143
weechat_tcl_api_print (ClientData clientData, Tcl_Interp *interp,
2456
2144
int objc, Tcl_Obj *CONST objv[])
2478
* weechat_tcl_api_print_date_tags: print message in a buffer with optional
2483
2166
weechat_tcl_api_print_date_tags (ClientData clientData, Tcl_Interp *interp,
2484
2167
int objc, Tcl_Obj *CONST objv[])
2512
* weechat_tcl_api_print_y: print message in a buffer with free content
2516
2195
weechat_tcl_api_print_y (ClientData clientData, Tcl_Interp *interp,
2517
2196
int objc, Tcl_Obj *CONST objv[])
2543
* weechat_tcl_api_log_print: print message in WeeChat log file
2547
2222
weechat_tcl_api_log_print (ClientData clientData, Tcl_Interp *interp,
2548
2223
int objc, Tcl_Obj *CONST objv[])
2569
* weechat_tcl_api_hook_command_cb: callback for command hooked
2573
2244
weechat_tcl_api_hook_command_cb (void *data, struct t_gui_buffer *buffer,
2574
2245
int argc, char **argv, char **argv_eol)
2610
2281
return WEECHAT_RC_ERROR;
2614
* weechat_tcl_api_hook_command: hook a command
2618
2285
weechat_tcl_api_hook_command (ClientData clientData, Tcl_Interp *interp,
2619
2286
int objc, Tcl_Obj *CONST objv[])
2691
2354
return WEECHAT_RC_ERROR;
2695
* weechat_tcl_api_hook_command_run: hook a command_run
2699
2358
weechat_tcl_api_hook_command_run (ClientData clientData, Tcl_Interp *interp,
2700
2359
int objc, Tcl_Obj *CONST objv[])
2762
2417
return WEECHAT_RC_ERROR;
2766
* weechat_tcl_api_hook_timer: hook a timer
2770
2421
weechat_tcl_api_hook_timer (ClientData clientData, Tcl_Interp *interp,
2771
2422
int objc, Tcl_Obj *CONST objv[])
2836
2483
return WEECHAT_RC_ERROR;
2840
* weechat_tcl_api_hook_fd: hook a fd
2844
2487
weechat_tcl_api_hook_fd (ClientData clientData, Tcl_Interp *interp,
2845
2488
int objc, Tcl_Obj *CONST objv[])
2871
2514
API_RETURN_STRING_FREE(result);
2875
* weechat_tcl_api_hook_process_cb: callback for process hooked
2879
2518
weechat_tcl_api_hook_process_cb (void *data,
2880
2519
const char *command, int return_code,
2914
2553
return WEECHAT_RC_ERROR;
2918
* weechat_tcl_api_hook_process: hook a process
2922
2557
weechat_tcl_api_hook_process (ClientData clientData, Tcl_Interp *interp,
2923
2558
int objc, Tcl_Obj *CONST objv[])
2973
2603
command = Tcl_GetStringFromObj (objv[1], &i);
2974
2604
options = weechat_tcl_dict_to_hashtable (interp, objv[2],
2975
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
2605
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
2606
WEECHAT_HASHTABLE_STRING,
2607
WEECHAT_HASHTABLE_STRING);
2976
2608
function = Tcl_GetStringFromObj (objv[4], &i);
2977
2609
data = Tcl_GetStringFromObj (objv[5], &i);
2991
2623
API_RETURN_STRING_FREE(result);
2995
* weechat_tcl_api_hook_connect_cb: callback for connect hooked
2999
2627
weechat_tcl_api_hook_connect_cb (void *data, int status, int gnutls_rc,
3000
const char *error, const char *ip_address)
2628
int sock, const char *error,
2629
const char *ip_address)
3002
2631
struct t_plugin_script_cb *script_callback;
3004
char str_status[32], str_gnutls_rc[32];
2633
char str_status[32], str_gnutls_rc[32], str_sock[32];
3005
2634
char empty_arg[1] = { '\0' };
3012
2641
snprintf (str_status, sizeof (str_status), "%d", status);
3013
2642
snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc);
2643
snprintf (str_sock, sizeof (str_sock), "%d", sock);
3015
2645
func_argv[0] = (script_callback->data) ? script_callback->data : empty_arg;
3016
2646
func_argv[1] = str_status;
3017
2647
func_argv[2] = str_gnutls_rc;
3018
func_argv[3] = (ip_address) ? (char *)ip_address : empty_arg;
3019
func_argv[4] = (error) ? (char *)error : empty_arg;
2648
func_argv[3] = str_sock;
2649
func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg;
2650
func_argv[5] = (error) ? (char *)error : empty_arg;
3021
2652
rc = (int *) weechat_tcl_exec (script_callback->script,
3022
2653
WEECHAT_SCRIPT_EXEC_INT,
3023
2654
script_callback->function,
3024
"sssss", func_argv);
2655
"ssssss", func_argv);
3027
2658
ret = WEECHAT_RC_ERROR;
3037
2668
return WEECHAT_RC_ERROR;
3041
* weechat_tcl_api_hook_connect: hook a connection
3045
2672
weechat_tcl_api_hook_connect (ClientData clientData, Tcl_Interp *interp,
3046
2673
int objc, Tcl_Obj *CONST objv[])
3049
2676
char *proxy, *address, *local_hostname, *function, *data, *result;
3050
int i, port, sock, ipv6;
2677
int i, port, ipv6, retry;
3052
2679
API_FUNC(1, "hook_connect", API_RETURN_EMPTY);
3054
2681
API_WRONG_ARGS(API_RETURN_EMPTY);
3056
2683
if ((Tcl_GetIntFromObj (interp, objv[3], &port) != TCL_OK)
3057
|| (Tcl_GetIntFromObj (interp, objv[4], &sock) != TCL_OK)
3058
|| (Tcl_GetIntFromObj (interp, objv[5], &ipv6) != TCL_OK))
2684
|| (Tcl_GetIntFromObj (interp, objv[4], &ipv6) != TCL_OK)
2685
|| (Tcl_GetIntFromObj (interp, objv[5], &retry) != TCL_OK))
3059
2686
API_WRONG_ARGS(API_RETURN_EMPTY);
3061
2688
proxy = Tcl_GetStringFromObj (objv[1], &i);
3147
2770
return WEECHAT_RC_ERROR;
3151
* weechat_tcl_api_hook_print: hook a print
3155
2774
weechat_tcl_api_hook_print (ClientData clientData, Tcl_Interp *interp,
3156
2775
int objc, Tcl_Obj *CONST objv[])
3185
2804
API_RETURN_STRING_FREE(result);
3189
* weechat_tcl_api_hook_signal_cb: callback for signal hooked
3193
2808
weechat_tcl_api_hook_signal_cb (void *data, const char *signal, const char *type_data,
3194
2809
void *signal_data)
3245
2860
return WEECHAT_RC_ERROR;
3249
* weechat_tcl_api_hook_signal: hook a signal
3253
2864
weechat_tcl_api_hook_signal (ClientData clientData, Tcl_Interp *interp,
3254
2865
int objc, Tcl_Obj *CONST objv[])
3275
2886
API_RETURN_STRING_FREE(result);
3279
* weechat_tcl_api_hook_signal_send: send a signal
3283
2890
weechat_tcl_api_hook_signal_send (ClientData clientData, Tcl_Interp *interp,
3284
2891
int objc, Tcl_Obj *CONST objv[])
3363
2966
return WEECHAT_RC_ERROR;
3367
* weechat_tcl_api_hook_hsignal: hook a hsignal
3371
2970
weechat_tcl_api_hook_hsignal (ClientData clientData, Tcl_Interp *interp,
3372
2971
int objc, Tcl_Obj *CONST objv[])
3393
2992
API_RETURN_STRING_FREE(result);
3397
* weechat_tcl_api_hook_hsignal_send: send a hsignal
3401
2996
weechat_tcl_api_hook_hsignal_send (ClientData clientData, Tcl_Interp *interp,
3402
2997
int objc, Tcl_Obj *CONST objv[])
3413
3008
signal = Tcl_GetStringFromObj (objv[1], &i);
3414
3009
hashtable = weechat_tcl_dict_to_hashtable (interp, objv[2],
3415
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
3010
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
3011
WEECHAT_HASHTABLE_STRING,
3012
WEECHAT_HASHTABLE_STRING);
3417
3014
weechat_hook_hsignal_send (signal, hashtable);
3461
3054
return WEECHAT_RC_ERROR;
3465
* weechat_tcl_api_hook_config: hook a config option
3469
3058
weechat_tcl_api_hook_config (ClientData clientData, Tcl_Interp *interp,
3470
3059
int objc, Tcl_Obj *CONST objv[])
3491
3080
API_RETURN_STRING_FREE(result);
3495
* weechat_tcl_api_hook_completion_cb: callback for completion hooked
3499
3084
weechat_tcl_api_hook_completion_cb (void *data, const char *completion_item,
3500
3085
struct t_gui_buffer *buffer,
3537
3122
return WEECHAT_RC_ERROR;
3541
* weechat_tcl_api_hook_completion: hook a completion
3545
3126
weechat_tcl_api_hook_completion (ClientData clientData, Tcl_Interp *interp,
3546
3127
int objc, Tcl_Obj *CONST objv[])
3569
3150
API_RETURN_STRING_FREE(result);
3573
* weechat_tcl_api_hook_completion_list_add: add a word to list for a completion
3577
3154
weechat_tcl_api_hook_completion_list_add (ClientData clientData, Tcl_Interp *interp,
3578
3155
int objc, Tcl_Obj *CONST objv[])
3604
* weechat_tcl_api_hook_modifier_cb: callback for modifier hooked
3608
3181
weechat_tcl_api_hook_modifier_cb (void *data, const char *modifier,
3609
3182
const char *modifier_data, const char *string)
3634
* weechat_tcl_api_hook_modifier: hook a modifier
3638
3207
weechat_tcl_api_hook_modifier (ClientData clientData, Tcl_Interp *interp,
3639
3208
int objc, Tcl_Obj *CONST objv[])
3660
3229
API_RETURN_STRING_FREE(result);
3664
* weechat_tcl_api_hook_modifier_exec: execute a modifier hook
3668
3233
weechat_tcl_api_hook_modifier_exec (ClientData clientData, Tcl_Interp *interp,
3669
3234
int objc, Tcl_Obj *CONST objv[])
3718
* weechat_tcl_api_hook_info: hook an info
3722
3279
weechat_tcl_api_hook_info (ClientData clientData, Tcl_Interp *interp,
3723
3280
int objc, Tcl_Obj *CONST objv[])
3748
3305
API_RETURN_STRING_FREE(result);
3752
* weechat_tcl_api_hook_info_hashtable_cb: callback for info_hashtable hooked
3755
3308
struct t_hashtable *
3756
3309
weechat_tcl_api_hook_info_hashtable_cb (void *data, const char *info_name,
3757
3310
struct t_hashtable *hashtable)
3781
* weechat_tcl_api_hook_info_hashtable: hook an info_hashtable
3785
3334
weechat_tcl_api_hook_info_hashtable (ClientData clientData, Tcl_Interp *interp,
3786
3335
int objc, Tcl_Obj *CONST objv[])
3814
3363
API_RETURN_STRING_FREE(result);
3818
* weechat_tcl_api_hook_infolist_cb: callback for infolist hooked
3821
3366
struct t_infolist *
3822
3367
weechat_tcl_api_hook_infolist_cb (void *data, const char *infolist_name,
3823
3368
void *pointer, const char *arguments)
3854
* weechat_tcl_api_hook_infolist: hook an infolist
3858
3399
weechat_tcl_api_hook_infolist (ClientData clientData, Tcl_Interp *interp,
3859
3400
int objc, Tcl_Obj *CONST objv[])
3887
3428
API_RETURN_STRING_FREE(result);
3891
* weechat_tcl_api_hook_focus_cb: callback for focus hooked
3894
3431
struct t_hashtable *
3895
3432
weechat_tcl_api_hook_focus_cb (void *data,
3896
3433
struct t_hashtable *info)
3919
* weechat_tcl_api_hook_focus: hook a focus
3923
3456
weechat_tcl_api_hook_focus (ClientData clientData, Tcl_Interp *interp,
3924
3457
int objc, Tcl_Obj *CONST objv[])
3945
3478
API_RETURN_STRING_FREE(result);
3949
* weechat_tcl_api_unhook: unhook something
3953
3482
weechat_tcl_api_unhook (ClientData clientData, Tcl_Interp *interp,
3954
3483
int objc, Tcl_Obj *CONST objv[])
3971
* weechat_tcl_api_unhook_all: unhook all for script
3975
3500
weechat_tcl_api_unhook_all (ClientData clientData, Tcl_Interp *interp,
3976
3501
int objc, Tcl_Obj *CONST objv[])
4069
3586
return WEECHAT_RC_ERROR;
4073
* weechat_tcl_api_buffer_new: create a new buffer
4077
3590
weechat_tcl_api_buffer_new (ClientData clientData, Tcl_Interp *interp,
4078
3591
int objc, Tcl_Obj *CONST objv[])
4105
3618
API_RETURN_STRING_FREE(result);
4109
* weechat_tcl_api_buffer_search: search a buffer
4113
3622
weechat_tcl_api_buffer_search (ClientData clientData, Tcl_Interp *interp,
4114
3623
int objc, Tcl_Obj *CONST objv[])
4129
3638
API_RETURN_STRING_FREE(result);
4133
* weechat_tcl_api_buffer_search_main: search main buffer (WeeChat core buffer)
4137
3642
weechat_tcl_api_buffer_search_main (ClientData clientData, Tcl_Interp *interp,
4138
3643
int objc, Tcl_Obj *CONST objv[])
4152
3657
API_RETURN_STRING_FREE(result);
4156
* weechat_tcl_api_current_buffer: get current buffer
4160
3661
weechat_tcl_api_current_buffer (ClientData clientData, Tcl_Interp *interp,
4161
3662
int objc, Tcl_Obj *CONST objv[])
4175
3676
API_RETURN_STRING_FREE(result);
4179
* weechat_tcl_api_buffer_clear: clear a buffer
4183
3680
weechat_tcl_api_buffer_clear (ClientData clientData, Tcl_Interp *interp,
4184
3681
int objc, Tcl_Obj *CONST objv[])
4199
* weechat_tcl_api_buffer_close: close a buffer
4203
3696
weechat_tcl_api_buffer_close (ClientData clientData, Tcl_Interp *interp,
4204
3697
int objc, Tcl_Obj *CONST objv[])
4221
* weechat_tcl_api_buffer_merge: merge a buffer to another buffer
4225
3714
weechat_tcl_api_buffer_merge (ClientData clientData, Tcl_Interp *interp,
4226
3715
int objc, Tcl_Obj *CONST objv[])
4242
* weechat_tcl_api_buffer_unmerge: unmerge a buffer from a group of merged
4247
3731
weechat_tcl_api_buffer_unmerge (ClientData clientData, Tcl_Interp *interp,
4248
3732
int objc, Tcl_Obj *CONST objv[])
4267
* weechat_tcl_api_buffer_get_integer: get a buffer property as integer
4271
3751
weechat_tcl_api_buffer_get_integer (ClientData clientData, Tcl_Interp *interp,
4272
3752
int objc, Tcl_Obj *CONST objv[])
4288
3768
API_RETURN_INT(result);
4292
* weechat_tcl_api_buffer_get_string: get a buffer property as string
4296
3772
weechat_tcl_api_buffer_get_string (ClientData clientData, Tcl_Interp *interp,
4297
3773
int objc, Tcl_Obj *CONST objv[])
4313
3789
API_RETURN_STRING(result);
4317
* weechat_tcl_api_buffer_get_pointer: get a buffer property as pointer
4321
3793
weechat_tcl_api_buffer_get_pointer (ClientData clientData, Tcl_Interp *interp,
4322
3794
int objc, Tcl_Obj *CONST objv[])
4338
3810
API_RETURN_STRING_FREE(result);
4342
* weechat_tcl_api_buffer_set: set a buffer property
4346
3814
weechat_tcl_api_buffer_set (ClientData clientData, Tcl_Interp *interp,
4347
3815
int objc, Tcl_Obj *CONST objv[])
4367
* weechat_tcl_api_buffer_string_replace_local_var: replace local variables ($var) in a string,
4368
* using value of local variables
4372
3835
weechat_tcl_api_buffer_string_replace_local_var (ClientData clientData, Tcl_Interp *interp,
4373
3836
int objc, Tcl_Obj *CONST objv[])
4388
3851
API_RETURN_STRING_FREE(result);
4392
* weechat_tcl_api_buffer_match_list: return 1 if buffers matches list of buffers
4396
3855
weechat_tcl_api_buffer_match_list (ClientData clientData, Tcl_Interp *interp,
4397
3856
int objc, Tcl_Obj *CONST objv[])
4413
3872
API_RETURN_INT(result);
4417
* weechat_tcl_api_current_window: get current window
4421
3876
weechat_tcl_api_current_window (ClientData clientData, Tcl_Interp *interp,
4422
3877
int objc, Tcl_Obj *CONST objv[])
4436
3891
API_RETURN_STRING_FREE(result);
4440
* weechat_tcl_api_window_search_with_buffer: search a window with buffer
4445
3895
weechat_tcl_api_window_search_with_buffer (ClientData clientData, Tcl_Interp *interp,
4446
3896
int objc, Tcl_Obj *CONST objv[])
4460
3910
API_RETURN_STRING_FREE(result);
4464
* weechat_tcl_api_window_get_integer: get a window property as integer
4468
3914
weechat_tcl_api_window_get_integer (ClientData clientData, Tcl_Interp *interp,
4469
3915
int objc, Tcl_Obj *CONST objv[])
4485
3931
API_RETURN_INT(result);
4489
* weechat_tcl_api_window_get_string: get a window property as string
4493
3935
weechat_tcl_api_window_get_string (ClientData clientData, Tcl_Interp *interp,
4494
3936
int objc, Tcl_Obj *CONST objv[])
4510
3952
API_RETURN_STRING(result);
4514
* weechat_tcl_api_window_get_pointer: get a window property as pointer
4518
3956
weechat_tcl_api_window_get_pointer (ClientData clientData, Tcl_Interp *interp,
4519
3957
int objc, Tcl_Obj *CONST objv[])
4535
3973
API_RETURN_STRING_FREE(result);
4539
* weechat_tcl_api_window_set_title: set window title
4543
3977
weechat_tcl_api_window_set_title (ClientData clientData, Tcl_Interp *interp,
4544
3978
int objc, Tcl_Obj *CONST objv[])
4562
* weechat_tcl_api_nicklist_add_group: add a group in nicklist
4566
3996
weechat_tcl_api_nicklist_add_group (ClientData clientData, Tcl_Interp *interp,
4567
3997
int objc, Tcl_Obj *CONST objv[])
4591
4021
API_RETURN_STRING_FREE(result);
4595
* weechat_tcl_api_nicklist_search_group: search a group in nicklist
4599
4025
weechat_tcl_api_nicklist_search_group (ClientData clientData, Tcl_Interp *interp,
4600
4026
int objc, Tcl_Obj *CONST objv[])
4618
4044
API_RETURN_STRING_FREE(result);
4622
* weechat_tcl_api_nicklist_add_nick: add a nick in nicklist
4626
4048
weechat_tcl_api_nicklist_add_nick (ClientData clientData, Tcl_Interp *interp,
4627
4049
int objc, Tcl_Obj *CONST objv[])
4655
4077
API_RETURN_STRING_FREE(result);
4659
* weechat_tcl_api_nicklist_search_nick: search a nick in nicklist
4663
4081
weechat_tcl_api_nicklist_search_nick (ClientData clientData, Tcl_Interp *interp,
4664
4082
int objc, Tcl_Obj *CONST objv[])
4682
4100
API_RETURN_STRING_FREE(result);
4686
* weechat_tcl_api_nicklist_remove_group: remove a group from nicklist
4690
4104
weechat_tcl_api_nicklist_remove_group (ClientData clientData, Tcl_Interp *interp,
4691
4105
int objc, Tcl_Obj *CONST objv[])
4711
* weechat_tcl_api_nicklist_remove_nick: remove a nick from nicklist
4715
4125
weechat_tcl_api_nicklist_remove_nick (ClientData clientData, Tcl_Interp *interp,
4716
4126
int objc, Tcl_Obj *CONST objv[])
4736
* weechat_tcl_api_nicklist_remove_all: remove all groups/nicks from nicklist
4740
4146
weechat_tcl_api_nicklist_remove_all (ClientData clientData, Tcl_Interp *interp,
4741
4147
int objc, Tcl_Obj *CONST objv[])
4838
4232
API_RETURN_STRING_FREE(result);
4842
* weechat_tcl_api_nicklist_group_set: set a group property
4846
4236
weechat_tcl_api_nicklist_group_set (ClientData clientData, Tcl_Interp *interp,
4847
4237
int objc, Tcl_Obj *CONST objv[])
4953
4331
API_RETURN_STRING_FREE(result);
4957
* weechat_tcl_api_nicklist_nick_set: set a nick property
4961
4335
weechat_tcl_api_nicklist_nick_set (ClientData clientData, Tcl_Interp *interp,
4962
4336
int objc, Tcl_Obj *CONST objv[])
4986
* weechat_tcl_api_bar_item_search: search a bar item
4990
4360
weechat_tcl_api_bar_item_search (ClientData clientData, Tcl_Interp *interp,
4991
4361
int objc, Tcl_Obj *CONST objv[])
5003
4373
API_RETURN_STRING_FREE(result);
5007
* weechat_tcl_api_bar_item_build_cb: callback for building bar item
5011
4377
weechat_tcl_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
5012
4378
struct t_gui_window *window)
5043
* weechat_tcl_api_bar_item_new: add a new bar item
5047
4409
weechat_tcl_api_bar_item_new (ClientData clientData, Tcl_Interp *interp,
5048
4410
int objc, Tcl_Obj *CONST objv[])
5069
4431
API_RETURN_STRING_FREE(result);
5073
* weechat_tcl_api_bar_item_update: update a bar item on screen
5077
4435
weechat_tcl_api_bar_item_update (ClientData clientData, Tcl_Interp *interp,
5078
4436
int objc, Tcl_Obj *CONST objv[])
5093
* weechat_tcl_api_bar_item_remove: remove a bar item
5097
4451
weechat_tcl_api_bar_item_remove (ClientData clientData, Tcl_Interp *interp,
5098
4452
int objc, Tcl_Obj *CONST objv[])
5115
* weechat_tcl_api_bar_search: search a bar
5119
4469
weechat_tcl_api_bar_search (ClientData clientData, Tcl_Interp *interp,
5120
4470
int objc, Tcl_Obj *CONST objv[])
5132
4482
API_RETURN_STRING_FREE(result);
5136
* weechat_tcl_api_bar_new: add a new bar
5140
4486
weechat_tcl_api_bar_new (ClientData clientData, Tcl_Interp *interp,
5141
4487
int objc, Tcl_Obj *CONST objv[])
5185
4531
API_RETURN_STRING_FREE(result);
5189
* weechat_tcl_api_bar_set: set a bar property
5193
4535
weechat_tcl_api_bar_set (ClientData clientData, Tcl_Interp *interp,
5194
4536
int objc, Tcl_Obj *CONST objv[])
5214
* weechat_tcl_api_bar_update: update a bar on screen
5218
4556
weechat_tcl_api_bar_update (ClientData clientData, Tcl_Interp *interp,
5219
4557
int objc, Tcl_Obj *CONST objv[])
5234
* weechat_tcl_api_bar_remove: remove a bar
5238
4572
weechat_tcl_api_bar_remove (ClientData clientData, Tcl_Interp *interp,
5239
4573
int objc, Tcl_Obj *CONST objv[])
5254
* weechat_tcl_api_command: execute a command on a buffer
5258
4588
weechat_tcl_api_command (ClientData clientData, Tcl_Interp *interp,
5259
4589
int objc, Tcl_Obj *CONST objv[])
5281
* weechat_tcl_api_info_get: get info (as string)
5285
4611
weechat_tcl_api_info_get (ClientData clientData, Tcl_Interp *interp,
5286
4612
int objc, Tcl_Obj *CONST objv[])
5299
4625
API_RETURN_STRING(result);
5303
* weechat_tcl_api_info_get_hashtable: get info (as hashtable)
5307
4629
weechat_tcl_api_info_get_hashtable (ClientData clientData, Tcl_Interp *interp,
5308
4630
int objc, Tcl_Obj *CONST objv[])
5316
4638
API_WRONG_ARGS(API_RETURN_EMPTY);
5318
4640
hashtable = weechat_tcl_dict_to_hashtable (interp, objv[2],
5319
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
4641
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
4642
WEECHAT_HASHTABLE_STRING,
4643
WEECHAT_HASHTABLE_STRING);
5321
4645
result_hashtable = weechat_info_get_hashtable (Tcl_GetStringFromObj (objv[1], &i),
5330
4654
API_RETURN_OBJ(result_dict);
5334
* weechat_tcl_api_infolist_new: create a new infolist
5338
4658
weechat_tcl_api_infolist_new (ClientData clientData, Tcl_Interp *interp,
5339
4659
int objc, Tcl_Obj *CONST objv[])
5353
4673
API_RETURN_STRING_FREE(result);
5357
* weechat_tcl_api_infolist_new_item: create new item in infolist
5361
4677
weechat_tcl_api_infolist_new_item (ClientData clientData, Tcl_Interp *interp,
5362
4678
int objc, Tcl_Obj *CONST objv[])
5374
4690
API_RETURN_STRING_FREE(result);
5378
* weechat_tcl_api_infolist_new_var_integer: create new integer variable in
5383
4694
weechat_tcl_api_infolist_new_var_integer (ClientData clientData, Tcl_Interp *interp,
5384
4695
int objc, Tcl_Obj *CONST objv[])
5401
4712
API_RETURN_STRING_FREE(result);
5405
* weechat_tcl_api_infolist_new_var_string: create new string variable in
5410
4716
weechat_tcl_api_infolist_new_var_string (ClientData clientData, Tcl_Interp *interp,
5411
4717
int objc, Tcl_Obj *CONST objv[])
5425
4731
API_RETURN_STRING_FREE(result);
5429
* weechat_tcl_api_infolist_new_var_pointer: create new pointer variable in infolist
5433
4735
weechat_tcl_api_infolist_new_var_pointer (ClientData clientData, Tcl_Interp *interp,
5434
4736
int objc, Tcl_Obj *CONST objv[])
5448
4750
API_RETURN_STRING_FREE(result);
5452
* weechat_tcl_api_infolist_new_var_time: create new time variable in infolist
5456
4754
weechat_tcl_api_infolist_new_var_time (ClientData clientData, Tcl_Interp *interp,
5457
4755
int objc, Tcl_Obj *CONST objv[])
5474
4772
API_RETURN_STRING_FREE(result);
5478
* weechat_tcl_api_infolist_get: get list with infos
5482
4776
weechat_tcl_api_infolist_get (ClientData clientData, Tcl_Interp *interp,
5483
4777
int objc, Tcl_Obj *CONST objv[])
5501
4795
API_RETURN_STRING_FREE(result);
5505
* weechat_tcl_api_infolist_next: move item pointer to next item in infolist
5509
4799
weechat_tcl_api_infolist_next (ClientData clientData, Tcl_Interp *interp,
5510
4800
int objc, Tcl_Obj *CONST objv[])
5521
4811
API_RETURN_INT(result);
5525
* weechat_tcl_api_infolist_prev: move item pointer to previous item in
5530
4815
weechat_tcl_api_infolist_prev (ClientData clientData, Tcl_Interp *interp,
5531
4816
int objc, Tcl_Obj *CONST objv[])
5568
* weechat_tcl_api_infolist_fields: get list of fields for current item of
5573
4848
weechat_tcl_api_infolist_fields (ClientData clientData, Tcl_Interp *interp,
5574
4849
int objc, Tcl_Obj *CONST objv[])
5586
4861
API_RETURN_STRING(result);
5590
* weechat_tcl_api_infolist_integer: get integer value of a variable in
5595
4865
weechat_tcl_api_infolist_integer (ClientData clientData, Tcl_Interp *interp,
5596
4866
int objc, Tcl_Obj *CONST objv[])
5611
4881
API_RETURN_INT(result);
5615
* weechat_tcl_api_infolist_string: get string value of a variable in infolist
5619
4885
weechat_tcl_api_infolist_string (ClientData clientData, Tcl_Interp *interp,
5620
4886
int objc, Tcl_Obj *CONST objv[])
5636
4902
API_RETURN_STRING(result);
5640
* weechat_tcl_api_infolist_pointer: get pointer value of a variable in
5645
4906
weechat_tcl_api_infolist_pointer (ClientData clientData, Tcl_Interp *interp,
5646
4907
int objc, Tcl_Obj *CONST objv[])
5661
4922
API_RETURN_STRING_FREE(result);
5665
* weechat_tcl_api_infolist_time: get time value of a variable in infolist
5669
4926
weechat_tcl_api_infolist_time (ClientData clientData, Tcl_Interp *interp,
5670
4927
int objc, Tcl_Obj *CONST objv[])
5692
4949
API_RETURN_STRING_FREE(result);
5696
* weechat_tcl_api_infolist_free: free infolist
5700
4953
weechat_tcl_api_infolist_free (ClientData clientData, Tcl_Interp *interp,
5701
4954
int objc, Tcl_Obj *CONST objv[])
5716
* weechat_tcl_api_hdata_get: get hdata
5720
4969
weechat_tcl_api_hdata_get (ClientData clientData, Tcl_Interp *interp,
5721
4970
int objc, Tcl_Obj *CONST objv[])
5735
4984
API_RETURN_STRING_FREE(result);
5739
* weechat_tcl_api_hdata_get_var_offset: get offset of variable in hdata
5743
4988
weechat_tcl_api_hdata_get_var_offset (ClientData clientData, Tcl_Interp *interp,
5744
4989
int objc, Tcl_Obj *CONST objv[])
5845
5075
API_RETURN_STRING(result);
5849
* weechat_tcl_api_hdata_get_var_hdata: get hdata for variable in hdata
5853
5079
weechat_tcl_api_hdata_get_var_hdata (ClientData clientData, Tcl_Interp *interp,
5854
5080
int objc, Tcl_Obj *CONST objv[])
5870
5096
API_RETURN_STRING(result);
5874
* weechat_tcl_api_hdata_get_list: get list pointer in hdata
5878
5100
weechat_tcl_api_hdata_get_list (ClientData clientData, Tcl_Interp *interp,
5879
5101
int objc, Tcl_Obj *CONST objv[])
5895
5117
API_RETURN_STRING_FREE(result);
5899
* weechat_tcl_api_hdata_check_pointer: check pointer with hdata/list
5903
5121
weechat_tcl_api_hdata_check_pointer (ClientData clientData, Tcl_Interp *interp,
5904
5122
int objc, Tcl_Obj *CONST objv[])
5922
5140
API_RETURN_INT(result);
5926
* weechat_tcl_api_hdata_move: move pointer to another element in list
5930
5144
weechat_tcl_api_hdata_move (ClientData clientData, Tcl_Interp *interp,
5931
5145
int objc, Tcl_Obj *CONST objv[])
5951
5165
API_RETURN_STRING_FREE(result);
5955
* weechat_tcl_api_hdata_char: get char value of a variable in structure
5960
5169
weechat_tcl_api_hdata_char (ClientData clientData, Tcl_Interp *interp,
5961
5170
int objc, Tcl_Obj *CONST objv[])
5979
5188
API_RETURN_INT(result);
5983
* weechat_tcl_api_hdata_integer: get integer value of a variable in structure
5988
5192
weechat_tcl_api_hdata_integer (ClientData clientData, Tcl_Interp *interp,
5989
5193
int objc, Tcl_Obj *CONST objv[])
6007
5211
API_RETURN_INT(result);
6011
* weechat_tcl_api_hdata_long: get long value of a variable in structure using
6016
5215
weechat_tcl_api_hdata_long (ClientData clientData, Tcl_Interp *interp,
6017
5216
int objc, Tcl_Obj *CONST objv[])
6035
5234
API_RETURN_LONG(result);
6039
* weechat_tcl_api_hdata_string: get string value of a variable in structure
6044
5238
weechat_tcl_api_hdata_string (ClientData clientData, Tcl_Interp *interp,
6045
5239
int objc, Tcl_Obj *CONST objv[])
6064
5258
API_RETURN_STRING(result);
6068
* weechat_tcl_api_hdata_pointer: get pointer value of a variable in structure
6073
5262
weechat_tcl_api_hdata_pointer (ClientData clientData, Tcl_Interp *interp,
6074
5263
int objc, Tcl_Obj *CONST objv[])
6092
5281
API_RETURN_STRING_FREE(result);
6096
* weechat_tcl_api_hdata_time: get time value of a variable in structure using
6101
5285
weechat_tcl_api_hdata_time (ClientData clientData, Tcl_Interp *interp,
6102
5286
int objc, Tcl_Obj *CONST objv[])
6124
5308
API_RETURN_STRING_FREE(result);
6128
* weechat_tcl_api_hdata_hashtable: get hashtable value of a variable in
6129
* structure using hdata
6133
5312
weechat_tcl_api_hdata_hashtable (ClientData clientData, Tcl_Interp *interp,
6134
5313
int objc, Tcl_Obj *CONST objv[])
6154
5333
API_RETURN_OBJ(result_dict);
6158
* weechat_tcl_api_hdata_update: update data in a hdata
6162
5337
weechat_tcl_api_hdata_update (ClientData clientData, Tcl_Interp *interp,
6163
5338
int objc, Tcl_Obj *CONST objv[])
6174
5349
hdata = Tcl_GetStringFromObj (objv[1], &i);
6175
5350
pointer = Tcl_GetStringFromObj (objv[2], &i);
6176
5351
hashtable = weechat_tcl_dict_to_hashtable (interp, objv[3],
6177
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
5352
WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
5353
WEECHAT_HASHTABLE_STRING,
5354
WEECHAT_HASHTABLE_STRING);
6179
5356
value = weechat_hdata_update (API_STR2PTR(hdata),
6180
5357
API_STR2PTR(pointer),
6186
5363
API_RETURN_INT(value);
6190
* weechat_tcl_api_hdata_get_string: get hdata property as string
6194
5367
weechat_tcl_api_hdata_get_string (ClientData clientData, Tcl_Interp *interp,
6195
5368
int objc, Tcl_Obj *CONST objv[])
6211
5384
API_RETURN_STRING(result);
6215
* weechat_tcl_api_upgrade_new: create an upgrade file
6219
5388
weechat_tcl_api_upgrade_new (ClientData clientData, Tcl_Interp *interp,
6220
5389
int objc, Tcl_Obj *CONST objv[])
6237
5406
API_RETURN_STRING_FREE(result);
6241
* weechat_tcl_api_upgrade_write_object: write object in upgrade file
6245
5410
weechat_tcl_api_upgrade_write_object (ClientData clientData, Tcl_Interp *interp,
6246
5411
int objc, Tcl_Obj *CONST objv[])
6315
5476
return WEECHAT_RC_ERROR;
6319
* weechat_tcl_api_upgrade_read: read upgrade file
6323
5480
weechat_tcl_api_upgrade_read (ClientData clientData, Tcl_Interp *interp,
6324
5481
int objc, Tcl_Obj *CONST objv[])
6345
5502
API_RETURN_INT(rc);
6349
* weechat_tcl_api_upgrade_close: close upgrade file
6353
5506
weechat_tcl_api_upgrade_close (ClientData clientData, Tcl_Interp *interp,
6354
5507
int objc, Tcl_Obj *CONST objv[])
6464
5617
Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_MEMORY_ERROR", Tcl_GetStringFromObj (objp, &i), 0);
6465
5618
Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_TIMEOUT);
6466
5619
Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_TIMEOUT", Tcl_GetStringFromObj (objp, &i), 0);
5620
Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_SOCKET_ERROR);
5621
Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_SOCKET_ERROR", Tcl_GetStringFromObj (objp, &i), 0);
6468
5623
Tcl_SetStringObj (objp, WEECHAT_HOOK_SIGNAL_STRING, -1);
6469
5624
Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_SIGNAL_STRING", Tcl_GetStringFromObj (objp, &i), 0);
6489
5644
API_DEF_FUNC(string_remove_color);
6490
5645
API_DEF_FUNC(string_is_command_char);
6491
5646
API_DEF_FUNC(string_input_for_buffer);
5647
API_DEF_FUNC(string_eval_expression);
6492
5648
API_DEF_FUNC(mkdir_home);
6493
5649
API_DEF_FUNC(mkdir);
6494
5650
API_DEF_FUNC(mkdir_parents);