~alivema4ever/ubuntu/trusty/weechat/lp-1299347-fix

« back to all changes in this revision

Viewing changes to src/plugins/tcl/weechat-tcl-api.c

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bouthenot
  • Date: 2013-01-23 18:44:36 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20130123184436-pillcj7jmtyyj00j
Tags: 0.4.0-1
* New upstream release.
* Bump Standards-Version to 3.9.4
* Remove UPGRADE_0.3 from doc (no more included in upstream sources).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
 
2
 * weechat-tcl-api.c - tcl API functions
 
3
 *
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
5
8
 *
6
9
 * This file is part of WeeChat, the extensible chat client.
7
10
 *
19
22
 * along with WeeChat.  If not, see <http://www.gnu.org/licenses/>.
20
23
 */
21
24
 
22
 
/*
23
 
 * weechat-tcl-api.c: tcl API functions
24
 
 */
25
 
 
26
25
#undef _
27
26
 
28
27
#include <tcl.h>
208
207
 
209
208
 
210
209
/*
211
 
 * weechat_tcl_api_register: startup function for all WeeChat Tcl scripts
 
210
 * Registers a tcl script.
212
211
 */
213
212
 
214
213
static int
284
283
}
285
284
 
286
285
/*
287
 
 * weechat_tcl_api_plugin_get_name: get name of plugin (return "core" for
288
 
 *                                  WeeChat core)
 
286
 * Wrappers for functions in scripting API.
 
287
 *
 
288
 * For more info about these functions, look at their implementation in WeeChat
 
289
 * core.
289
290
 */
290
291
 
291
292
static int
308
309
    API_RETURN_STRING(result);
309
310
}
310
311
 
311
 
/*
312
 
 * weechat_tcl_api_charset_set: set script charset
313
 
 */
314
 
 
315
312
static int
316
313
weechat_tcl_api_charset_set (ClientData clientData, Tcl_Interp *interp,
317
314
                             int objc, Tcl_Obj *CONST objv[])
329
326
    API_RETURN_OK;
330
327
}
331
328
 
332
 
/*
333
 
 * weechat_tcl_api_iconv_to_internal: convert string to internal WeeChat
334
 
 *                                    charset
335
 
 */
336
 
 
337
329
static int
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);
355
347
}
356
348
 
357
 
/*
358
 
 * weechat_tcl_api_iconv_from_internal: convert string from WeeChat inernal
359
 
 *                                      charset to another one
360
 
 */
361
 
 
362
349
static int
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);
380
367
}
381
368
 
382
 
/*
383
 
 * weechat_tcl_api_gettext: get translated string
384
 
 */
385
 
 
386
369
static int
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);
401
384
}
402
385
 
403
 
/*
404
 
 * weechat_tcl_api_ngettext: get translated string with plural form
405
 
 */
406
 
 
407
386
static int
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);
429
408
}
430
409
 
431
 
/*
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
435
 
 */
436
 
 
437
410
static int
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);
458
431
}
459
432
 
460
 
/*
461
 
 * weechat_tcl_api_string_has_highlight: return 1 if string contains a
462
 
 *                                       highlight (using list of words to
463
 
 *                                       highlight)
464
 
 *                                       return 0 if no highlight is found in
465
 
 *                                       string
466
 
 */
467
 
 
468
433
static int
469
434
weechat_tcl_api_string_has_highlight (ClientData clientData,
470
435
                                      Tcl_Interp *interp,
486
451
    API_RETURN_INT(result);
487
452
}
488
453
 
489
 
/*
490
 
 * weechat_tcl_api_string_has_highlight_regex: return 1 if string contains a
491
 
 *                                             highlight (using a regular
492
 
 *                                             expression)
493
 
 *                                             return 0 if no highlight is
494
 
 *                                             found in string
495
 
 */
496
 
 
497
454
static int
498
455
weechat_tcl_api_string_has_highlight_regex (ClientData clientData,
499
456
                                            Tcl_Interp *interp,
515
472
    API_RETURN_INT(result);
516
473
}
517
474
 
518
 
/*
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
522
 
 *                                       regex
523
 
 */
524
 
 
525
475
static int
526
476
weechat_tcl_api_string_mask_to_regex (ClientData clientData,
527
477
                                      Tcl_Interp *interp,
542
492
    API_RETURN_STRING_FREE(result);
543
493
}
544
494
 
545
 
/*
546
 
 * weechat_tcl_api_string_remove_color: remove WeeChat color codes from string
547
 
 */
548
 
 
549
495
static int
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);
567
513
}
568
514
 
569
 
/*
570
 
 * weechat_tcl_api_string_is_command_char: check if first char of string is a
571
 
 *                                         command char
572
 
 */
573
 
 
574
515
static int
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);
588
529
}
589
530
 
590
 
/*
591
 
 * weechat_tcl_api_string_input_for_buffer: return string with input text
592
 
 *                                          for buffer or empty string if
593
 
 *                                          it's a command
594
 
 */
595
 
 
596
531
static int
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);
611
546
}
612
547
 
613
 
/*
614
 
 * weechat_tcl_api_mkdir_home: create a directory in WeeChat home
615
 
 */
 
548
static int
 
549
weechat_tcl_api_string_eval_expression (ClientData clientData,
 
550
                                        Tcl_Interp *interp,
 
551
                                        int objc, Tcl_Obj *CONST objv[])
 
552
{
 
553
    Tcl_Obj *objp;
 
554
    char *expr, *result;
 
555
    struct t_hashtable *pointers, *extra_vars;
 
556
    int i;
 
557
 
 
558
    API_FUNC(1, "string_eval_expression", API_RETURN_EMPTY);
 
559
    if (objc < 4)
 
560
        API_WRONG_ARGS(API_RETURN_EMPTY);
 
561
 
 
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);
 
571
 
 
572
    result = weechat_string_eval_expression (expr, pointers, extra_vars);
 
573
 
 
574
    if (pointers)
 
575
        weechat_hashtable_free (pointers);
 
576
    if (extra_vars)
 
577
        weechat_hashtable_free (extra_vars);
 
578
 
 
579
    API_RETURN_STRING_FREE(result);
 
580
}
616
581
 
617
582
static int
618
583
weechat_tcl_api_mkdir_home (ClientData clientData, Tcl_Interp *interp,
635
600
    API_RETURN_ERROR;
636
601
}
637
602
 
638
 
/*
639
 
 * weechat_tcl_api_mkdir: create a directory
640
 
 */
641
 
 
642
603
static int
643
604
weechat_tcl_api_mkdir (ClientData clientData, Tcl_Interp *interp,
644
605
                       int objc, Tcl_Obj *CONST objv[])
660
621
    API_RETURN_ERROR;
661
622
}
662
623
 
663
 
/*
664
 
 * weechat_tcl_api_mkdir_parents: create a directory and make parent
665
 
 *                                directories as needed
666
 
 */
667
 
 
668
624
static int
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;
687
643
}
688
644
 
689
 
/*
690
 
 * weechat_tcl_api_list_new: create a new list
691
 
 */
692
 
 
693
645
static int
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);
710
662
}
711
663
 
712
 
/*
713
 
 * weechat_tcl_api_list_add: add a string to list
714
 
 */
715
 
 
716
664
static int
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);
740
688
}
741
689
 
742
 
/*
743
 
 * weechat_tcl_api_list_search: search a string in list
744
 
 */
745
 
 
746
690
static int
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);
765
709
}
766
710
 
767
 
/*
768
 
 * weechat_tcl_api_list_search_pos: search position of a string in list
769
 
 */
770
 
 
771
711
static int
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);
789
729
}
790
730
 
791
 
/*
792
 
 * weechat_tcl_api_list_casesearch: search a string in list (ignore case)
793
 
 */
794
 
 
795
731
static int
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);
814
750
}
815
751
 
816
 
/*
817
 
 * weechat_tcl_api_list_casesearch_pos: search position of a string in list
818
 
 *                                      (ignore case)
819
 
 */
820
 
 
821
752
static int
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);
839
770
}
840
771
 
841
 
/*
842
 
 * weechat_tcl_api_list_get: get item by position
843
 
 */
844
 
 
845
772
static int
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);
864
791
}
865
792
 
866
 
/*
867
 
 * weechat_tcl_api_list_set: set new value for item
868
 
 */
869
 
 
870
793
static int
871
794
weechat_tcl_api_list_set (ClientData clientData, Tcl_Interp *interp,
872
795
                          int objc, Tcl_Obj *CONST objv[])
887
810
    API_RETURN_OK;
888
811
}
889
812
 
890
 
/*
891
 
 * weechat_tcl_api_list_next: get next item
892
 
 */
893
 
 
894
813
static int
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);
909
828
}
910
829
 
911
 
/*
912
 
 * weechat_tcl_api_list_prev: get previous item
913
 
 */
914
 
 
915
830
static int
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);
930
845
}
931
846
 
932
 
/*
933
 
 * weechat_tcl_api_list_string: get string value of item
934
 
 */
935
 
 
936
847
static int
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);
951
862
}
952
863
 
953
 
/*
954
 
 * weechat_tcl_api_list_size: get number of elements in list
955
 
 */
956
 
 
957
864
static int
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);
972
879
}
973
880
 
974
 
/*
975
 
 * weechat_tcl_api_list_remove: remove item from list
976
 
 */
977
 
 
978
881
static int
979
882
weechat_tcl_api_list_remove (ClientData clientData, Tcl_Interp *interp,
980
883
                             int objc, Tcl_Obj *CONST objv[])
996
899
    API_RETURN_OK;
997
900
}
998
901
 
999
 
/*
1000
 
 * weechat_tcl_api_list_remove_all: remove all items from list
1001
 
 */
1002
 
 
1003
902
static int
1004
903
weechat_tcl_api_list_remove_all (ClientData clientData, Tcl_Interp *interp,
1005
904
                                 int objc, Tcl_Obj *CONST objv[])
1018
917
    API_RETURN_OK;
1019
918
}
1020
919
 
1021
 
/*
1022
 
 * weechat_tcl_api_list_free: free list
1023
 
 */
1024
 
 
1025
920
static int
1026
921
weechat_tcl_api_list_free (ClientData clientData, Tcl_Interp *interp,
1027
922
                           int objc, Tcl_Obj *CONST objv[])
1038
933
    API_RETURN_OK;
1039
934
}
1040
935
 
1041
 
/*
1042
 
 * weechat_tcl_api_config_reload_cb: callback for config reload
1043
 
 */
1044
 
 
1045
936
int
1046
937
weechat_tcl_api_config_reload_cb (void *data,
1047
938
                                  struct t_config_file *config_file)
1080
971
    return WEECHAT_CONFIG_READ_FILE_NOT_FOUND;
1081
972
}
1082
973
 
1083
 
/*
1084
 
 * weechat_tcl_api_config_new: create a new configuration file
1085
 
 */
1086
 
 
1087
974
static int
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);
1111
998
}
1112
999
 
1113
 
/*
1114
 
 * weechat_tcl_api_config_section_read_cb: callback for reading option in
1115
 
 *                                         section
1116
 
 */
1117
 
 
1118
1000
int
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;
1160
1042
}
1161
1043
 
1162
 
/*
1163
 
 * weechat_tcl_api_config_section_write_cb: callback for writing section
1164
 
 */
1165
 
 
1166
1044
int
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;
1203
1081
}
1204
1082
 
1205
 
/*
1206
 
 * weechat_tcl_api_config_section_write_default_cb: callback for writing
1207
 
 *                                                   default values for section
1208
 
 */
1209
 
 
1210
1083
int
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;
1247
1120
}
1248
1121
 
1249
 
/*
1250
 
 * weechat_tcl_api_config_section_create_option_cb: callback to create an
1251
 
 *                                                  option
1252
 
 */
1253
 
 
1254
1122
int
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;
1297
1165
}
1298
1166
 
1299
 
/*
1300
 
 * weechat_tcl_api_config_section_delete_option_cb: callback to delete an
1301
 
 *                                                  option
1302
 
 */
1303
 
 
1304
1167
int
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;
1347
1210
}
1348
1211
 
1349
 
/*
1350
 
 * weechat_tcl_api_config_new_section: create a new section in configuration
1351
 
 *                                     file
1352
 
 */
1353
 
 
1354
1212
static int
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);
1412
1270
}
1413
1271
 
1414
 
/*
1415
 
 * weechat_tcl_api_config_search_section: search section in configuration file
1416
 
 */
1417
 
 
1418
1272
static int
1419
1273
weechat_tcl_api_config_search_section (ClientData clientData, Tcl_Interp *interp,
1420
1274
                                       int objc, Tcl_Obj *CONST objv[])
1437
1291
}
1438
1292
 
1439
1293
 
1440
 
/*
1441
 
 * weechat_tcl_api_config_option_check_value_cb: callback for checking new
1442
 
 *                                               value for option
1443
 
 */
1444
 
 
1445
1294
int
1446
1295
weechat_tcl_api_config_option_check_value_cb (void *data,
1447
1296
                                               struct t_config_option *option,
1481
1330
    return 0;
1482
1331
}
1483
1332
 
1484
 
/*
1485
 
 * weechat_tcl_api_config_option_change_cb: callback for option changed
1486
 
 */
1487
 
 
1488
1333
void
1489
1334
weechat_tcl_api_config_option_change_cb (void *data,
1490
1335
                                          struct t_config_option *option)
1514
1359
    }
1515
1360
}
1516
1361
 
1517
 
/*
1518
 
 * weechat_tcl_api_config_option_delete_cb: callback when option is deleted
1519
 
 */
1520
 
 
1521
1362
void
1522
1363
weechat_tcl_api_config_option_delete_cb (void *data,
1523
1364
                                          struct t_config_option *option)
1547
1388
    }
1548
1389
}
1549
1390
 
1550
 
/*
1551
 
 * weechat_tcl_api_config_new_option: create a new option in section
1552
 
 */
1553
 
 
1554
1391
static int
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);
1613
1450
}
1614
1451
 
1615
 
/*
1616
 
 * weechat_tcl_api_config_search_option: search option in configuration file or
1617
 
 *                                       section
1618
 
 */
1619
 
 
1620
1452
static int
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);
1641
1473
}
1642
1474
 
1643
 
/*
1644
 
 * weechat_tcl_api_config_string_to_boolean: return boolean value of a string
1645
 
 */
1646
 
 
1647
1475
static int
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);
1661
1489
}
1662
1490
 
1663
 
/*
1664
 
 * weechat_tcl_api_config_option_reset: reset an option with default value
1665
 
 */
1666
 
 
1667
1491
static int
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);
1689
1513
}
1690
1514
 
1691
 
/*
1692
 
 * weechat_tcl_api_config_option_set: set new value for option
1693
 
 */
1694
 
 
1695
1515
static int
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);
1719
1539
}
1720
1540
 
1721
 
/*
1722
 
 * weechat_tcl_api_config_option_set_null: set null (undefined)value for option
1723
 
 */
1724
 
 
1725
1541
static int
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);
1747
1563
}
1748
1564
 
1749
 
/*
1750
 
 * weechat_tcl_api_config_option_unset: unset an option
1751
 
 */
1752
 
 
1753
1565
static int
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);
1771
1583
}
1772
1584
 
1773
 
/*
1774
 
 * weechat_tcl_api_config_option_rename: rename an option
1775
 
 */
1776
 
 
1777
1585
static int
1778
1586
weechat_tcl_api_config_option_rename (ClientData clientData, Tcl_Interp *interp,
1779
1587
                                      int objc, Tcl_Obj *CONST objv[])
1795
1603
    API_RETURN_OK;
1796
1604
}
1797
1605
 
1798
 
/*
1799
 
 * weechat_tcl_api_config_option_is_null: return 1 if value of option is null
1800
 
 */
1801
 
 
1802
1606
static int
1803
1607
weechat_tcl_api_config_option_is_null (ClientData clientData, Tcl_Interp *interp,
1804
1608
                                       int objc, Tcl_Obj *CONST objv[])
1815
1619
    API_RETURN_INT(result);
1816
1620
}
1817
1621
 
1818
 
/*
1819
 
 * weechat_tcl_api_config_option_default_is_null: return 1 if default value of
1820
 
 *                                                option is null
1821
 
 */
1822
 
 
1823
1622
static int
1824
1623
weechat_tcl_api_config_option_default_is_null (ClientData clientData,
1825
1624
                                               Tcl_Interp *interp,
1837
1636
    API_RETURN_INT(result);
1838
1637
}
1839
1638
 
1840
 
/*
1841
 
 * weechat_tcl_api_config_boolean: return boolean value of option
1842
 
 */
1843
 
 
1844
1639
static int
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);
1858
1653
}
1859
1654
 
1860
 
/*
1861
 
 * weechat_tcl_api_config_boolean_default: return default boolean value of option
1862
 
 */
1863
 
 
1864
1655
static int
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);
1878
1669
}
1879
1670
 
1880
 
/*
1881
 
 * weechat_tcl_api_config_integer: return integer value of option
1882
 
 */
1883
 
 
1884
1671
static int
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);
1898
1685
}
1899
1686
 
1900
 
/*
1901
 
 * weechat_tcl_api_config_integer_default: return default integer value of option
1902
 
 */
1903
 
 
1904
1687
static int
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);
1918
1701
}
1919
1702
 
1920
 
/*
1921
 
 * weechat_tcl_api_config_string: return string value of option
1922
 
 */
1923
 
 
1924
1703
static int
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);
1939
1718
}
1940
1719
 
1941
 
/*
1942
 
 * weechat_tcl_api_config_string_default: return default string value of option
1943
 
 */
1944
 
 
1945
1720
static int
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);
1960
1735
}
1961
1736
 
1962
 
/*
1963
 
 * weechat_tcl_api_config_color: return color value of option
1964
 
 */
1965
 
 
1966
1737
static int
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);
1981
1752
}
1982
1753
 
1983
 
/*
1984
 
 * weechat_tcl_api_config_color_default: return default color value of option
1985
 
 */
1986
 
 
1987
1754
static int
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);
2002
1769
}
2003
1770
 
2004
 
/*
2005
 
 * weechat_tcl_api_config_write_option: write an option in configuration file
2006
 
 */
2007
 
 
2008
1771
static int
2009
1772
weechat_tcl_api_config_write_option (ClientData clientData, Tcl_Interp *interp,
2010
1773
                                     int objc, Tcl_Obj *CONST objv[])
2026
1789
    API_RETURN_OK;
2027
1790
}
2028
1791
 
2029
 
/*
2030
 
 * weechat_tcl_api_config_write_line: write a line in configuration file
2031
 
 */
2032
 
 
2033
1792
static int
2034
1793
weechat_tcl_api_config_write_line (ClientData clientData, Tcl_Interp *interp,
2035
1794
                                   int objc, Tcl_Obj *CONST objv[])
2052
1811
    API_RETURN_OK;
2053
1812
}
2054
1813
 
2055
 
/*
2056
 
 * weechat_tcl_api_config_write: write configuration file
2057
 
 */
2058
 
 
2059
1814
static int
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);
2074
1829
}
2075
1830
 
2076
 
/*
2077
 
 * weechat_tcl_api_config_read: read configuration file
2078
 
 */
2079
 
 
2080
1831
static int
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);
2095
1846
}
2096
1847
 
2097
 
/*
2098
 
 * weechat_tcl_api_config_reload: reload configuration file
2099
 
 */
2100
 
 
2101
1848
static int
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);
2116
1863
}
2117
1864
 
2118
 
/*
2119
 
 * weechat_tcl_api_config_option_free: free an option in configuration file
2120
 
 */
2121
 
 
2122
1865
static int
2123
1866
weechat_tcl_api_config_option_free (ClientData clientData, Tcl_Interp *interp,
2124
1867
                                    int objc, Tcl_Obj *CONST objv[])
2137
1880
    API_RETURN_OK;
2138
1881
}
2139
1882
 
2140
 
/*
2141
 
 * weechat_tcl_api_config_section_free_options: free all options of a section
2142
 
 *                                              in configuration file
2143
 
 */
2144
 
 
2145
1883
static int
2146
1884
weechat_tcl_api_config_section_free_options (ClientData clientData, Tcl_Interp *interp,
2147
1885
                                             int objc, Tcl_Obj *CONST objv[])
2160
1898
    API_RETURN_OK;
2161
1899
}
2162
1900
 
2163
 
/*
2164
 
 * weechat_tcl_api_config_section_free: free section in configuration file
2165
 
 */
2166
 
 
2167
1901
static int
2168
1902
weechat_tcl_api_config_section_free (ClientData clientData, Tcl_Interp *interp,
2169
1903
                                     int objc, Tcl_Obj *CONST objv[])
2182
1916
    API_RETURN_OK;
2183
1917
}
2184
1918
 
2185
 
/*
2186
 
 * weechat_tcl_api_config_free: free configuration file
2187
 
 */
2188
 
 
2189
1919
static int
2190
1920
weechat_tcl_api_config_free (ClientData clientData, Tcl_Interp *interp,
2191
1921
                             int objc, Tcl_Obj *CONST objv[])
2204
1934
    API_RETURN_OK;
2205
1935
}
2206
1936
 
2207
 
/*
2208
 
 * weechat_tcl_api_config_get: get config option
2209
 
 */
2210
 
 
2211
1937
static int
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);
2226
1952
}
2227
1953
 
2228
 
/*
2229
 
 * weechat_tcl_api_config_get_plugin: get value of a plugin option
2230
 
 */
2231
 
 
2232
1954
static int
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);
2249
1971
}
2250
1972
 
2251
 
/*
2252
 
 * weechat_tcl_api_config_is_set_plugin: check if a plugin option is set
2253
 
 */
2254
 
 
2255
1973
static int
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);
2274
1992
}
2275
1993
 
2276
 
/*
2277
 
 * weechat_tcl_api_config_set_plugin: set value of a plugin option
2278
 
 */
2279
 
 
2280
1994
static int
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);
2301
2015
}
2302
2016
 
2303
 
/*
2304
 
 * weechat_tcl_api_config_set_desc_plugin: set description of a plugin option
2305
 
 */
2306
 
 
2307
2017
static int
2308
2018
weechat_tcl_api_config_set_desc_plugin (ClientData clientData, Tcl_Interp *interp,
2309
2019
                                        int objc, Tcl_Obj *CONST objv[])
2327
2037
    API_RETURN_OK;
2328
2038
}
2329
2039
 
2330
 
/*
2331
 
 * weechat_tcl_api_config_set_plugin: unset plugin option
2332
 
 */
2333
 
 
2334
2040
static int
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);
2353
2059
}
2354
2060
 
2355
 
/*
2356
 
 * weechat_tcl_api_key_bind: bind key(s)
2357
 
 */
2358
 
 
2359
2061
static int
2360
2062
weechat_tcl_api_key_bind (ClientData clientData, Tcl_Interp *interp,
2361
2063
                          int objc, Tcl_Obj *CONST objv[])
2371
2073
 
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);
2375
2079
 
2376
2080
    num_keys = weechat_key_bind (context, hashtable);
2377
2081
 
2381
2085
    API_RETURN_INT(num_keys);
2382
2086
}
2383
2087
 
2384
 
/*
2385
 
 * weechat_tcl_api_key_unbind: unbind key(s)
2386
 
 */
2387
 
 
2388
2088
static int
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);
2406
2106
}
2407
2107
 
2408
 
/*
2409
 
 * weechat_tcl_api_prefix: get a prefix, used for display
2410
 
 */
2411
 
 
2412
2108
static int
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);
2427
2123
}
2428
2124
 
2429
 
/*
2430
 
 * weechat_tcl_api_color: get a color code, used for display
2431
 
 */
2432
 
 
2433
2125
static int
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);
2448
2140
}
2449
2141
 
2450
 
/*
2451
 
 * weechat_tcl_api_print: print message in a buffer
2452
 
 */
2453
 
 
2454
2142
static int
2455
2143
weechat_tcl_api_print (ClientData clientData, Tcl_Interp *interp,
2456
2144
                       int objc, Tcl_Obj *CONST objv[])
2474
2162
    API_RETURN_OK;
2475
2163
}
2476
2164
 
2477
 
/*
2478
 
 * weechat_tcl_api_print_date_tags: print message in a buffer with optional
2479
 
 *                                  date and tags
2480
 
 */
2481
 
 
2482
2165
static int
2483
2166
weechat_tcl_api_print_date_tags (ClientData clientData, Tcl_Interp *interp,
2484
2167
                                 int objc, Tcl_Obj *CONST objv[])
2508
2191
    API_RETURN_OK;
2509
2192
}
2510
2193
 
2511
 
/*
2512
 
 * weechat_tcl_api_print_y: print message in a buffer with free content
2513
 
 */
2514
 
 
2515
2194
static int
2516
2195
weechat_tcl_api_print_y (ClientData clientData, Tcl_Interp *interp,
2517
2196
                         int objc, Tcl_Obj *CONST objv[])
2539
2218
    API_RETURN_OK;
2540
2219
}
2541
2220
 
2542
 
/*
2543
 
 * weechat_tcl_api_log_print: print message in WeeChat log file
2544
 
 */
2545
 
 
2546
2221
static int
2547
2222
weechat_tcl_api_log_print (ClientData clientData, Tcl_Interp *interp,
2548
2223
                           int objc, Tcl_Obj *CONST objv[])
2565
2240
    API_RETURN_OK;
2566
2241
}
2567
2242
 
2568
 
/*
2569
 
 * weechat_tcl_api_hook_command_cb: callback for command hooked
2570
 
 */
2571
 
 
2572
2243
int
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;
2611
2282
}
2612
2283
 
2613
 
/*
2614
 
 * weechat_tcl_api_hook_command: hook a command
2615
 
 */
2616
 
 
2617
2284
static int
2618
2285
weechat_tcl_api_hook_command (ClientData clientData, Tcl_Interp *interp,
2619
2286
                              int objc, Tcl_Obj *CONST objv[])
2649
2316
    API_RETURN_STRING_FREE(result);
2650
2317
}
2651
2318
 
2652
 
/*
2653
 
 * weechat_tcl_api_hook_command_run_cb: callback for command_run hooked
2654
 
 */
2655
 
 
2656
2319
int
2657
2320
weechat_tcl_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer,
2658
2321
                                     const char *command)
2691
2354
    return WEECHAT_RC_ERROR;
2692
2355
}
2693
2356
 
2694
 
/*
2695
 
 * weechat_tcl_api_hook_command_run: hook a command_run
2696
 
 */
2697
 
 
2698
2357
static int
2699
2358
weechat_tcl_api_hook_command_run (ClientData clientData, Tcl_Interp *interp,
2700
2359
                                  int objc, Tcl_Obj *CONST objv[])
2721
2380
    API_RETURN_STRING_FREE(result);
2722
2381
}
2723
2382
 
2724
 
/*
2725
 
 * weechat_tcl_api_hook_timer_cb: callback for timer hooked
2726
 
 */
2727
 
 
2728
2383
int
2729
2384
weechat_tcl_api_hook_timer_cb (void *data, int remaining_calls)
2730
2385
{
2762
2417
    return WEECHAT_RC_ERROR;
2763
2418
}
2764
2419
 
2765
 
/*
2766
 
 * weechat_tcl_api_hook_timer: hook a timer
2767
 
 */
2768
 
 
2769
2420
static int
2770
2421
weechat_tcl_api_hook_timer (ClientData clientData, Tcl_Interp *interp,
2771
2422
                            int objc, Tcl_Obj *CONST objv[])
2796
2447
    API_RETURN_STRING_FREE(result);
2797
2448
}
2798
2449
 
2799
 
/*
2800
 
 * weechat_tcl_api_hook_fd_cb: callback for fd hooked
2801
 
 */
2802
 
 
2803
2450
int
2804
2451
weechat_tcl_api_hook_fd_cb (void *data, int fd)
2805
2452
{
2836
2483
    return WEECHAT_RC_ERROR;
2837
2484
}
2838
2485
 
2839
 
/*
2840
 
 * weechat_tcl_api_hook_fd: hook a fd
2841
 
 */
2842
 
 
2843
2486
static int
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);
2872
2515
}
2873
2516
 
2874
 
/*
2875
 
 * weechat_tcl_api_hook_process_cb: callback for process hooked
2876
 
 */
2877
 
 
2878
2517
int
2879
2518
weechat_tcl_api_hook_process_cb (void *data,
2880
2519
                                 const char *command, int return_code,
2914
2553
    return WEECHAT_RC_ERROR;
2915
2554
}
2916
2555
 
2917
 
/*
2918
 
 * weechat_tcl_api_hook_process: hook a process
2919
 
 */
2920
 
 
2921
2556
static int
2922
2557
weechat_tcl_api_hook_process (ClientData clientData, Tcl_Interp *interp,
2923
2558
                              int objc, Tcl_Obj *CONST objv[])
2948
2583
    API_RETURN_STRING_FREE(result);
2949
2584
}
2950
2585
 
2951
 
/*
2952
 
 * weechat_tcl_api_hook_process_hashtable: hook a process with options in
2953
 
 *                                         a hashtable
2954
 
 */
2955
 
 
2956
2586
static int
2957
2587
weechat_tcl_api_hook_process_hashtable (ClientData clientData,
2958
2588
                                        Tcl_Interp *interp,
2972
2602
 
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);
2978
2610
 
2991
2623
    API_RETURN_STRING_FREE(result);
2992
2624
}
2993
2625
 
2994
 
/*
2995
 
 * weechat_tcl_api_hook_connect_cb: callback for connect hooked
2996
 
 */
2997
 
 
2998
2626
int
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)
3001
2630
{
3002
2631
    struct t_plugin_script_cb *script_callback;
3003
 
    void *func_argv[5];
3004
 
    char str_status[32], str_gnutls_rc[32];
 
2632
    void *func_argv[6];
 
2633
    char str_status[32], str_gnutls_rc[32], str_sock[32];
3005
2634
    char empty_arg[1] = { '\0' };
3006
2635
    int *rc, ret;
3007
2636
 
3011
2640
    {
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);
3014
2644
 
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;
3020
2651
 
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);
3025
2656
 
3026
2657
        if (!rc)
3027
2658
            ret = WEECHAT_RC_ERROR;
3037
2668
    return WEECHAT_RC_ERROR;
3038
2669
}
3039
2670
 
3040
 
/*
3041
 
 * weechat_tcl_api_hook_connect: hook a connection
3042
 
 */
3043
 
 
3044
2671
static int
3045
2672
weechat_tcl_api_hook_connect (ClientData clientData, Tcl_Interp *interp,
3046
2673
                              int objc, Tcl_Obj *CONST objv[])
3047
2674
{
3048
2675
    Tcl_Obj *objp;
3049
2676
    char *proxy, *address, *local_hostname, *function, *data, *result;
3050
 
    int i, port, sock, ipv6;
 
2677
    int i, port, ipv6, retry;
3051
2678
 
3052
2679
    API_FUNC(1, "hook_connect", API_RETURN_EMPTY);
3053
2680
    if (objc < 9)
3054
2681
        API_WRONG_ARGS(API_RETURN_EMPTY);
3055
2682
 
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);
3060
2687
 
3061
2688
    proxy = Tcl_GetStringFromObj (objv[1], &i);
3069
2696
                                                         proxy,
3070
2697
                                                         address,
3071
2698
                                                         port,
3072
 
                                                         sock,
3073
2699
                                                         ipv6,
 
2700
                                                         retry,
3074
2701
                                                         NULL, /* gnutls session */
3075
2702
                                                         NULL, /* gnutls callback */
3076
2703
                                                         0,    /* gnutls DH key size */
3083
2710
    API_RETURN_STRING_FREE(result);
3084
2711
}
3085
2712
 
3086
 
/*
3087
 
 * weechat_tcl_api_hook_print_cb: callback for print hooked
3088
 
 */
3089
 
 
3090
2713
int
3091
2714
weechat_tcl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
3092
2715
                               time_t date,
3147
2770
    return WEECHAT_RC_ERROR;
3148
2771
}
3149
2772
 
3150
 
/*
3151
 
 * weechat_tcl_api_hook_print: hook a print
3152
 
 */
3153
 
 
3154
2773
static int
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);
3186
2805
}
3187
2806
 
3188
 
/*
3189
 
 * weechat_tcl_api_hook_signal_cb: callback for signal hooked
3190
 
 */
3191
 
 
3192
2807
int
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;
3246
2861
}
3247
2862
 
3248
 
/*
3249
 
 * weechat_tcl_api_hook_signal: hook a signal
3250
 
 */
3251
 
 
3252
2863
static int
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);
3276
2887
}
3277
2888
 
3278
 
/*
3279
 
 * weechat_tcl_api_hook_signal_send: send a signal
3280
 
 */
3281
 
 
3282
2889
static int
3283
2890
weechat_tcl_api_hook_signal_send (ClientData clientData, Tcl_Interp *interp,
3284
2891
                                  int objc, Tcl_Obj *CONST objv[])
3323
2930
    API_RETURN_ERROR;
3324
2931
}
3325
2932
 
3326
 
/*
3327
 
 * weechat_tcl_api_hook_hsignal_cb: callback for hsignal hooked
3328
 
 */
3329
 
 
3330
2933
int
3331
2934
weechat_tcl_api_hook_hsignal_cb (void *data, const char *signal,
3332
2935
                                 struct t_hashtable *hashtable)
3363
2966
    return WEECHAT_RC_ERROR;
3364
2967
}
3365
2968
 
3366
 
/*
3367
 
 * weechat_tcl_api_hook_hsignal: hook a hsignal
3368
 
 */
3369
 
 
3370
2969
static int
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);
3394
2993
}
3395
2994
 
3396
 
/*
3397
 
 * weechat_tcl_api_hook_hsignal_send: send a hsignal
3398
 
 */
3399
 
 
3400
2995
static int
3401
2996
weechat_tcl_api_hook_hsignal_send (ClientData clientData, Tcl_Interp *interp,
3402
2997
                                   int objc, Tcl_Obj *CONST objv[])
3412
3007
 
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);
3416
3013
 
3417
3014
    weechat_hook_hsignal_send (signal, hashtable);
3418
3015
 
3422
3019
    API_RETURN_OK;
3423
3020
}
3424
3021
 
3425
 
/*
3426
 
 * weechat_tcl_api_hook_config_cb: callback for config option hooked
3427
 
 */
3428
 
 
3429
3022
int
3430
3023
weechat_tcl_api_hook_config_cb (void *data, const char *option, const char *value)
3431
3024
{
3461
3054
    return WEECHAT_RC_ERROR;
3462
3055
}
3463
3056
 
3464
 
/*
3465
 
 * weechat_tcl_api_hook_config: hook a config option
3466
 
 */
3467
 
 
3468
3057
static int
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);
3492
3081
}
3493
3082
 
3494
 
/*
3495
 
 * weechat_tcl_api_hook_completion_cb: callback for completion hooked
3496
 
 */
3497
 
 
3498
3083
int
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;
3538
3123
}
3539
3124
 
3540
 
/*
3541
 
 * weechat_tcl_api_hook_completion: hook a completion
3542
 
 */
3543
 
 
3544
3125
static int
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);
3570
3151
}
3571
3152
 
3572
 
/*
3573
 
 * weechat_tcl_api_hook_completion_list_add: add a word to list for a completion
3574
 
 */
3575
 
 
3576
3153
static int
3577
3154
weechat_tcl_api_hook_completion_list_add (ClientData clientData, Tcl_Interp *interp,
3578
3155
                                          int objc, Tcl_Obj *CONST objv[])
3600
3177
    API_RETURN_OK;
3601
3178
}
3602
3179
 
3603
 
/*
3604
 
 * weechat_tcl_api_hook_modifier_cb: callback for modifier hooked
3605
 
 */
3606
 
 
3607
3180
char *
3608
3181
weechat_tcl_api_hook_modifier_cb (void *data, const char *modifier,
3609
3182
                                   const char *modifier_data, const char *string)
3630
3203
    return NULL;
3631
3204
}
3632
3205
 
3633
 
/*
3634
 
 * weechat_tcl_api_hook_modifier: hook a modifier
3635
 
 */
3636
 
 
3637
3206
static int
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);
3661
3230
}
3662
3231
 
3663
 
/*
3664
 
 * weechat_tcl_api_hook_modifier_exec: execute a modifier hook
3665
 
 */
3666
 
 
3667
3232
static int
3668
3233
weechat_tcl_api_hook_modifier_exec (ClientData clientData, Tcl_Interp *interp,
3669
3234
                                    int objc, Tcl_Obj *CONST objv[])
3685
3250
    API_RETURN_STRING_FREE(result);
3686
3251
}
3687
3252
 
3688
 
/*
3689
 
 * weechat_tcl_api_hook_info_cb: callback for info hooked
3690
 
 */
3691
 
 
3692
3253
const char *
3693
3254
weechat_tcl_api_hook_info_cb (void *data, const char *info_name,
3694
3255
                               const char *arguments)
3714
3275
    return NULL;
3715
3276
}
3716
3277
 
3717
 
/*
3718
 
 * weechat_tcl_api_hook_info: hook an info
3719
 
 */
3720
 
 
3721
3278
static int
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);
3749
3306
}
3750
3307
 
3751
 
/*
3752
 
 * weechat_tcl_api_hook_info_hashtable_cb: callback for info_hashtable hooked
3753
 
 */
3754
 
 
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)
3777
3330
    return NULL;
3778
3331
}
3779
3332
 
3780
 
/*
3781
 
 * weechat_tcl_api_hook_info_hashtable: hook an info_hashtable
3782
 
 */
3783
 
 
3784
3333
static int
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);
3815
3364
}
3816
3365
 
3817
 
/*
3818
 
 * weechat_tcl_api_hook_infolist_cb: callback for infolist hooked
3819
 
 */
3820
 
 
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)
3850
3395
    return NULL;
3851
3396
}
3852
3397
 
3853
 
/*
3854
 
 * weechat_tcl_api_hook_infolist: hook an infolist
3855
 
 */
3856
 
 
3857
3398
static int
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);
3888
3429
}
3889
3430
 
3890
 
/*
3891
 
 * weechat_tcl_api_hook_focus_cb: callback for focus hooked
3892
 
 */
3893
 
 
3894
3431
struct t_hashtable *
3895
3432
weechat_tcl_api_hook_focus_cb (void *data,
3896
3433
                               struct t_hashtable *info)
3915
3452
    return NULL;
3916
3453
}
3917
3454
 
3918
 
/*
3919
 
 * weechat_tcl_api_hook_focus: hook a focus
3920
 
 */
3921
 
 
3922
3455
static int
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);
3946
3479
}
3947
3480
 
3948
 
/*
3949
 
 * weechat_tcl_api_unhook: unhook something
3950
 
 */
3951
 
 
3952
3481
static int
3953
3482
weechat_tcl_api_unhook (ClientData clientData, Tcl_Interp *interp,
3954
3483
                        int objc, Tcl_Obj *CONST objv[])
3967
3496
    API_RETURN_OK;
3968
3497
}
3969
3498
 
3970
 
/*
3971
 
 * weechat_tcl_api_unhook_all: unhook all for script
3972
 
 */
3973
 
 
3974
3499
static int
3975
3500
weechat_tcl_api_unhook_all (ClientData clientData, Tcl_Interp *interp,
3976
3501
                            int objc, Tcl_Obj *CONST objv[])
3989
3514
    API_RETURN_OK;
3990
3515
}
3991
3516
 
3992
 
/*
3993
 
 * weechat_tcl_api_buffer_input_data_cb: callback for input data in a buffer
3994
 
 */
3995
 
 
3996
3517
int
3997
3518
weechat_tcl_api_buffer_input_data_cb (void *data, struct t_gui_buffer *buffer,
3998
3519
                                       const char *input_data)
4030
3551
    return WEECHAT_RC_ERROR;
4031
3552
}
4032
3553
 
4033
 
/*
4034
 
 * weechat_tcl_api_buffer_close_cb: callback for buffer closed
4035
 
 */
4036
 
 
4037
3554
int
4038
3555
weechat_tcl_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
4039
3556
{
4069
3586
    return WEECHAT_RC_ERROR;
4070
3587
}
4071
3588
 
4072
 
/*
4073
 
 * weechat_tcl_api_buffer_new: create a new buffer
4074
 
 */
4075
 
 
4076
3589
static int
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);
4106
3619
}
4107
3620
 
4108
 
/*
4109
 
 * weechat_tcl_api_buffer_search: search a buffer
4110
 
 */
4111
 
 
4112
3621
static int
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);
4130
3639
}
4131
3640
 
4132
 
/*
4133
 
 * weechat_tcl_api_buffer_search_main: search main buffer (WeeChat core buffer)
4134
 
 */
4135
 
 
4136
3641
static int
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);
4153
3658
}
4154
3659
 
4155
 
/*
4156
 
 * weechat_tcl_api_current_buffer: get current buffer
4157
 
 */
4158
 
 
4159
3660
static int
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);
4176
3677
}
4177
3678
 
4178
 
/*
4179
 
 * weechat_tcl_api_buffer_clear: clear a buffer
4180
 
 */
4181
 
 
4182
3679
static int
4183
3680
weechat_tcl_api_buffer_clear (ClientData clientData, Tcl_Interp *interp,
4184
3681
                              int objc, Tcl_Obj *CONST objv[])
4195
3692
    API_RETURN_OK;
4196
3693
}
4197
3694
 
4198
 
/*
4199
 
 * weechat_tcl_api_buffer_close: close a buffer
4200
 
 */
4201
 
 
4202
3695
static int
4203
3696
weechat_tcl_api_buffer_close (ClientData clientData, Tcl_Interp *interp,
4204
3697
                              int objc, Tcl_Obj *CONST objv[])
4217
3710
    API_RETURN_OK;
4218
3711
}
4219
3712
 
4220
 
/*
4221
 
 * weechat_tcl_api_buffer_merge: merge a buffer to another buffer
4222
 
 */
4223
 
 
4224
3713
static int
4225
3714
weechat_tcl_api_buffer_merge (ClientData clientData, Tcl_Interp *interp,
4226
3715
                              int objc, Tcl_Obj *CONST objv[])
4238
3727
    API_RETURN_OK;
4239
3728
}
4240
3729
 
4241
 
/*
4242
 
 * weechat_tcl_api_buffer_unmerge: unmerge a buffer from a group of merged
4243
 
 *                                 buffers
4244
 
 */
4245
 
 
4246
3730
static int
4247
3731
weechat_tcl_api_buffer_unmerge (ClientData clientData, Tcl_Interp *interp,
4248
3732
                                int objc, Tcl_Obj *CONST objv[])
4263
3747
    API_RETURN_OK;
4264
3748
}
4265
3749
 
4266
 
/*
4267
 
 * weechat_tcl_api_buffer_get_integer: get a buffer property as integer
4268
 
 */
4269
 
 
4270
3750
static int
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);
4289
3769
}
4290
3770
 
4291
 
/*
4292
 
 * weechat_tcl_api_buffer_get_string: get a buffer property as string
4293
 
 */
4294
 
 
4295
3771
static int
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);
4314
3790
}
4315
3791
 
4316
 
/*
4317
 
 * weechat_tcl_api_buffer_get_pointer: get a buffer property as pointer
4318
 
 */
4319
 
 
4320
3792
static int
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);
4339
3811
}
4340
3812
 
4341
 
/*
4342
 
 * weechat_tcl_api_buffer_set: set a buffer property
4343
 
 */
4344
 
 
4345
3813
static int
4346
3814
weechat_tcl_api_buffer_set (ClientData clientData, Tcl_Interp *interp,
4347
3815
                            int objc, Tcl_Obj *CONST objv[])
4363
3831
    API_RETURN_OK;
4364
3832
}
4365
3833
 
4366
 
/*
4367
 
 * weechat_tcl_api_buffer_string_replace_local_var: replace local variables ($var) in a string,
4368
 
 *                                                  using value of local variables
4369
 
 */
4370
 
 
4371
3834
static int
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);
4389
3852
}
4390
3853
 
4391
 
/*
4392
 
 * weechat_tcl_api_buffer_match_list: return 1 if buffers matches list of buffers
4393
 
 */
4394
 
 
4395
3854
static int
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);
4414
3873
}
4415
3874
 
4416
 
/*
4417
 
 * weechat_tcl_api_current_window: get current window
4418
 
 */
4419
 
 
4420
3875
static int
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);
4437
3892
}
4438
3893
 
4439
 
/*
4440
 
 * weechat_tcl_api_window_search_with_buffer: search a window with buffer
4441
 
 *                                            pointer
4442
 
 */
4443
 
 
4444
3894
static int
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);
4461
3911
}
4462
3912
 
4463
 
/*
4464
 
 * weechat_tcl_api_window_get_integer: get a window property as integer
4465
 
 */
4466
 
 
4467
3913
static int
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);
4486
3932
}
4487
3933
 
4488
 
/*
4489
 
 * weechat_tcl_api_window_get_string: get a window property as string
4490
 
 */
4491
 
 
4492
3934
static int
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);
4511
3953
}
4512
3954
 
4513
 
/*
4514
 
 * weechat_tcl_api_window_get_pointer: get a window property as pointer
4515
 
 */
4516
 
 
4517
3955
static int
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);
4536
3974
}
4537
3975
 
4538
 
/*
4539
 
 * weechat_tcl_api_window_set_title: set window title
4540
 
 */
4541
 
 
4542
3976
static int
4543
3977
weechat_tcl_api_window_set_title (ClientData clientData, Tcl_Interp *interp,
4544
3978
                                  int objc, Tcl_Obj *CONST objv[])
4558
3992
    API_RETURN_OK;
4559
3993
}
4560
3994
 
4561
 
/*
4562
 
 * weechat_tcl_api_nicklist_add_group: add a group in nicklist
4563
 
 */
4564
 
 
4565
3995
static int
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);
4592
4022
}
4593
4023
 
4594
 
/*
4595
 
 * weechat_tcl_api_nicklist_search_group: search a group in nicklist
4596
 
 */
4597
 
 
4598
4024
static int
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);
4619
4045
}
4620
4046
 
4621
 
/*
4622
 
 * weechat_tcl_api_nicklist_add_nick: add a nick in nicklist
4623
 
 */
4624
 
 
4625
4047
static int
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);
4656
4078
}
4657
4079
 
4658
 
/*
4659
 
 * weechat_tcl_api_nicklist_search_nick: search a nick in nicklist
4660
 
 */
4661
 
 
4662
4080
static int
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);
4683
4101
}
4684
4102
 
4685
 
/*
4686
 
 * weechat_tcl_api_nicklist_remove_group: remove a group from nicklist
4687
 
 */
4688
 
 
4689
4103
static int
4690
4104
weechat_tcl_api_nicklist_remove_group (ClientData clientData, Tcl_Interp *interp,
4691
4105
                                       int objc, Tcl_Obj *CONST objv[])
4707
4121
    API_RETURN_OK;
4708
4122
}
4709
4123
 
4710
 
/*
4711
 
 * weechat_tcl_api_nicklist_remove_nick: remove a nick from nicklist
4712
 
 */
4713
 
 
4714
4124
static int
4715
4125
weechat_tcl_api_nicklist_remove_nick (ClientData clientData, Tcl_Interp *interp,
4716
4126
                                      int objc, Tcl_Obj *CONST objv[])
4732
4142
    API_RETURN_OK;
4733
4143
}
4734
4144
 
4735
 
/*
4736
 
 * weechat_tcl_api_nicklist_remove_all: remove all groups/nicks from nicklist
4737
 
 */
4738
 
 
4739
4145
static int
4740
4146
weechat_tcl_api_nicklist_remove_all (ClientData clientData, Tcl_Interp *interp,
4741
4147
                                     int objc, Tcl_Obj *CONST objv[])
4752
4158
    API_RETURN_OK;
4753
4159
}
4754
4160
 
4755
 
/*
4756
 
 * weechat_tcl_api_nicklist_group_get_integer: get a group property as integer
4757
 
 */
4758
 
 
4759
4161
static int
4760
4162
weechat_tcl_api_nicklist_group_get_integer (ClientData clientData,
4761
4163
                                            Tcl_Interp *interp,
4781
4183
    API_RETURN_INT(result);
4782
4184
}
4783
4185
 
4784
 
/*
4785
 
 * weechat_tcl_api_nicklist_group_get_string: get a group property as string
4786
 
 */
4787
 
 
4788
4186
static int
4789
4187
weechat_tcl_api_nicklist_group_get_string (ClientData clientData,
4790
4188
                                           Tcl_Interp *interp,
4810
4208
    API_RETURN_STRING(result);
4811
4209
}
4812
4210
 
4813
 
/*
4814
 
 * weechat_tcl_api_nicklist_group_get_pointer: get a group property as pointer
4815
 
 */
4816
 
 
4817
4211
static int
4818
4212
weechat_tcl_api_nicklist_group_get_pointer (ClientData clientData,
4819
4213
                                            Tcl_Interp *interp,
4838
4232
    API_RETURN_STRING_FREE(result);
4839
4233
}
4840
4234
 
4841
 
/*
4842
 
 * weechat_tcl_api_nicklist_group_set: set a group property
4843
 
 */
4844
 
 
4845
4235
static int
4846
4236
weechat_tcl_api_nicklist_group_set (ClientData clientData, Tcl_Interp *interp,
4847
4237
                                    int objc, Tcl_Obj *CONST objv[])
4867
4257
    API_RETURN_OK;
4868
4258
}
4869
4259
 
4870
 
/*
4871
 
 * weechat_tcl_api_nicklist_nick_get_integer: get a nick property as integer
4872
 
 */
4873
 
 
4874
4260
static int
4875
4261
weechat_tcl_api_nicklist_nick_get_integer (ClientData clientData,
4876
4262
                                           Tcl_Interp *interp,
4896
4282
    API_RETURN_INT(result);
4897
4283
}
4898
4284
 
4899
 
/*
4900
 
 * weechat_tcl_api_nicklist_nick_get_string: get a nick property as string
4901
 
 */
4902
 
 
4903
4285
static int
4904
4286
weechat_tcl_api_nicklist_nick_get_string (ClientData clientData,
4905
4287
                                          Tcl_Interp *interp,
4925
4307
    API_RETURN_STRING(result);
4926
4308
}
4927
4309
 
4928
 
/*
4929
 
 * weechat_tcl_api_nicklist_nick_get_pointer: get a nick property as pointer
4930
 
 */
4931
 
 
4932
4310
static int
4933
4311
weechat_tcl_api_nicklist_nick_get_pointer (ClientData clientData,
4934
4312
                                           Tcl_Interp *interp,
4953
4331
    API_RETURN_STRING_FREE(result);
4954
4332
}
4955
4333
 
4956
 
/*
4957
 
 * weechat_tcl_api_nicklist_nick_set: set a nick property
4958
 
 */
4959
 
 
4960
4334
static int
4961
4335
weechat_tcl_api_nicklist_nick_set (ClientData clientData, Tcl_Interp *interp,
4962
4336
                                   int objc, Tcl_Obj *CONST objv[])
4982
4356
    API_RETURN_OK;
4983
4357
}
4984
4358
 
4985
 
/*
4986
 
 * weechat_tcl_api_bar_item_search: search a bar item
4987
 
 */
4988
 
 
4989
4359
static int
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);
5004
4374
}
5005
4375
 
5006
 
/*
5007
 
 * weechat_tcl_api_bar_item_build_cb: callback for building bar item
5008
 
 */
5009
 
 
5010
4376
char *
5011
4377
weechat_tcl_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item,
5012
4378
                                   struct t_gui_window *window)
5039
4405
    return NULL;
5040
4406
}
5041
4407
 
5042
 
/*
5043
 
 * weechat_tcl_api_bar_item_new: add a new bar item
5044
 
 */
5045
 
 
5046
4408
static int
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);
5070
4432
}
5071
4433
 
5072
 
/*
5073
 
 * weechat_tcl_api_bar_item_update: update a bar item on screen
5074
 
 */
5075
 
 
5076
4434
static int
5077
4435
weechat_tcl_api_bar_item_update (ClientData clientData, Tcl_Interp *interp,
5078
4436
                                 int objc, Tcl_Obj *CONST objv[])
5089
4447
    API_RETURN_OK;
5090
4448
}
5091
4449
 
5092
 
/*
5093
 
 * weechat_tcl_api_bar_item_remove: remove a bar item
5094
 
 */
5095
 
 
5096
4450
static int
5097
4451
weechat_tcl_api_bar_item_remove (ClientData clientData, Tcl_Interp *interp,
5098
4452
                                 int objc, Tcl_Obj *CONST objv[])
5111
4465
    API_RETURN_OK;
5112
4466
}
5113
4467
 
5114
 
/*
5115
 
 * weechat_tcl_api_bar_search: search a bar
5116
 
 */
5117
 
 
5118
4468
static int
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);
5133
4483
}
5134
4484
 
5135
 
/*
5136
 
 * weechat_tcl_api_bar_new: add a new bar
5137
 
 */
5138
 
 
5139
4485
static int
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);
5186
4532
}
5187
4533
 
5188
 
/*
5189
 
 * weechat_tcl_api_bar_set: set a bar property
5190
 
 */
5191
 
 
5192
4534
static int
5193
4535
weechat_tcl_api_bar_set (ClientData clientData, Tcl_Interp *interp,
5194
4536
                         int objc, Tcl_Obj *CONST objv[])
5210
4552
    API_RETURN_OK;
5211
4553
}
5212
4554
 
5213
 
/*
5214
 
 * weechat_tcl_api_bar_update: update a bar on screen
5215
 
 */
5216
 
 
5217
4555
static int
5218
4556
weechat_tcl_api_bar_update (ClientData clientData, Tcl_Interp *interp,
5219
4557
                            int objc, Tcl_Obj *CONST objv[])
5230
4568
    API_RETURN_OK;
5231
4569
}
5232
4570
 
5233
 
/*
5234
 
 * weechat_tcl_api_bar_remove: remove a bar
5235
 
 */
5236
 
 
5237
4571
static int
5238
4572
weechat_tcl_api_bar_remove (ClientData clientData, Tcl_Interp *interp,
5239
4573
                            int objc, Tcl_Obj *CONST objv[])
5250
4584
    API_RETURN_OK;
5251
4585
}
5252
4586
 
5253
 
/*
5254
 
 * weechat_tcl_api_command: execute a command on a buffer
5255
 
 */
5256
 
 
5257
4587
static int
5258
4588
weechat_tcl_api_command (ClientData clientData, Tcl_Interp *interp,
5259
4589
                         int objc, Tcl_Obj *CONST objv[])
5277
4607
    API_RETURN_OK;
5278
4608
}
5279
4609
 
5280
 
/*
5281
 
 * weechat_tcl_api_info_get: get info (as string)
5282
 
 */
5283
 
 
5284
4610
static int
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);
5300
4626
}
5301
4627
 
5302
 
/*
5303
 
 * weechat_tcl_api_info_get_hashtable: get info (as hashtable)
5304
 
 */
5305
 
 
5306
4628
static int
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);
5317
4639
 
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);
5320
4644
 
5321
4645
    result_hashtable = weechat_info_get_hashtable (Tcl_GetStringFromObj (objv[1], &i),
5322
4646
                                                   hashtable);
5330
4654
    API_RETURN_OBJ(result_dict);
5331
4655
}
5332
4656
 
5333
 
/*
5334
 
 * weechat_tcl_api_infolist_new: create a new infolist
5335
 
 */
5336
 
 
5337
4657
static int
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);
5354
4674
}
5355
4675
 
5356
 
/*
5357
 
 * weechat_tcl_api_infolist_new_item: create new item in infolist
5358
 
 */
5359
 
 
5360
4676
static int
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);
5375
4691
}
5376
4692
 
5377
 
/*
5378
 
 * weechat_tcl_api_infolist_new_var_integer: create new integer variable in
5379
 
 *                                           infolist
5380
 
 */
5381
 
 
5382
4693
static int
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);
5402
4713
}
5403
4714
 
5404
 
/*
5405
 
 * weechat_tcl_api_infolist_new_var_string: create new string variable in
5406
 
 *                                          infolist
5407
 
 */
5408
 
 
5409
4715
static int
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);
5426
4732
}
5427
4733
 
5428
 
/*
5429
 
 * weechat_tcl_api_infolist_new_var_pointer: create new pointer variable in infolist
5430
 
 */
5431
 
 
5432
4734
static int
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);
5449
4751
}
5450
4752
 
5451
 
/*
5452
 
 * weechat_tcl_api_infolist_new_var_time: create new time variable in infolist
5453
 
 */
5454
 
 
5455
4753
static int
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);
5475
4773
}
5476
4774
 
5477
 
/*
5478
 
 * weechat_tcl_api_infolist_get: get list with infos
5479
 
 */
5480
 
 
5481
4775
static int
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);
5502
4796
}
5503
4797
 
5504
 
/*
5505
 
 * weechat_tcl_api_infolist_next: move item pointer to next item in infolist
5506
 
 */
5507
 
 
5508
4798
static int
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);
5522
4812
}
5523
4813
 
5524
 
/*
5525
 
 * weechat_tcl_api_infolist_prev: move item pointer to previous item in
5526
 
 *                                infolist
5527
 
 */
5528
 
 
5529
4814
static int
5530
4815
weechat_tcl_api_infolist_prev (ClientData clientData, Tcl_Interp *interp,
5531
4816
                               int objc, Tcl_Obj *CONST objv[])
5542
4827
    API_RETURN_INT(result);
5543
4828
}
5544
4829
 
5545
 
/*
5546
 
 * weechat_tcl_api_infolist_reset_item_cursor: reset pointer to current item in
5547
 
 *                                             infolist
5548
 
 */
5549
 
 
5550
4830
static int
5551
4831
weechat_tcl_api_infolist_reset_item_cursor (ClientData clientData,
5552
4832
                                            Tcl_Interp *interp,
5564
4844
    API_RETURN_OK;
5565
4845
}
5566
4846
 
5567
 
/*
5568
 
 * weechat_tcl_api_infolist_fields: get list of fields for current item of
5569
 
 *                                  infolist
5570
 
 */
5571
 
 
5572
4847
static int
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);
5587
4862
}
5588
4863
 
5589
 
/*
5590
 
 * weechat_tcl_api_infolist_integer: get integer value of a variable in
5591
 
 *                                   infolist
5592
 
 */
5593
 
 
5594
4864
static int
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);
5612
4882
}
5613
4883
 
5614
 
/*
5615
 
 * weechat_tcl_api_infolist_string: get string value of a variable in infolist
5616
 
 */
5617
 
 
5618
4884
static int
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);
5637
4903
}
5638
4904
 
5639
 
/*
5640
 
 * weechat_tcl_api_infolist_pointer: get pointer value of a variable in
5641
 
 *                                   infolist
5642
 
 */
5643
 
 
5644
4905
static int
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);
5662
4923
}
5663
4924
 
5664
 
/*
5665
 
 * weechat_tcl_api_infolist_time: get time value of a variable in infolist
5666
 
 */
5667
 
 
5668
4925
static int
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);
5693
4950
}
5694
4951
 
5695
 
/*
5696
 
 * weechat_tcl_api_infolist_free: free infolist
5697
 
 */
5698
 
 
5699
4952
static int
5700
4953
weechat_tcl_api_infolist_free (ClientData clientData, Tcl_Interp *interp,
5701
4954
                               int objc, Tcl_Obj *CONST objv[])
5712
4965
    API_RETURN_OK;
5713
4966
}
5714
4967
 
5715
 
/*
5716
 
 * weechat_tcl_api_hdata_get: get hdata
5717
 
 */
5718
 
 
5719
4968
static int
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);
5736
4985
}
5737
4986
 
5738
 
/*
5739
 
 * weechat_tcl_api_hdata_get_var_offset: get offset of variable in hdata
5740
 
 */
5741
 
 
5742
4987
static int
5743
4988
weechat_tcl_api_hdata_get_var_offset (ClientData clientData, Tcl_Interp *interp,
5744
4989
                                      int objc, Tcl_Obj *CONST objv[])
5759
5004
    API_RETURN_INT(result);
5760
5005
}
5761
5006
 
5762
 
/*
5763
 
 * weechat_tcl_api_hdata_get_var_type_string: get type of variable as string in
5764
 
 *                                            hdata
5765
 
 */
5766
 
 
5767
5007
static int
5768
5008
weechat_tcl_api_hdata_get_var_type_string (ClientData clientData,
5769
5009
                                           Tcl_Interp *interp,
5786
5026
    API_RETURN_STRING(result);
5787
5027
}
5788
5028
 
5789
 
/*
5790
 
 * weechat_tcl_api_hdata_get_var_array_size: get array_size for variable in
5791
 
 *                                           hdata
5792
 
 */
5793
 
 
5794
5029
static int
5795
5030
weechat_tcl_api_hdata_get_var_array_size (ClientData clientData,
5796
5031
                                          Tcl_Interp *interp,
5815
5050
    API_RETURN_INT(result);
5816
5051
}
5817
5052
 
5818
 
/*
5819
 
 * weechat_tcl_api_hdata_get_var_array_size_string: get array size for variable
5820
 
 *                                                  in hdata (as string)
5821
 
 */
5822
 
 
5823
5053
static int
5824
5054
weechat_tcl_api_hdata_get_var_array_size_string (ClientData clientData,
5825
5055
                                                 Tcl_Interp *interp,
5845
5075
    API_RETURN_STRING(result);
5846
5076
}
5847
5077
 
5848
 
/*
5849
 
 * weechat_tcl_api_hdata_get_var_hdata: get hdata for variable in hdata
5850
 
 */
5851
 
 
5852
5078
static int
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);
5871
5097
}
5872
5098
 
5873
 
/*
5874
 
 * weechat_tcl_api_hdata_get_list: get list pointer in hdata
5875
 
 */
5876
 
 
5877
5099
static int
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);
5896
5118
}
5897
5119
 
5898
 
/*
5899
 
 * weechat_tcl_api_hdata_check_pointer: check pointer with hdata/list
5900
 
 */
5901
 
 
5902
5120
static int
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);
5923
5141
}
5924
5142
 
5925
 
/*
5926
 
 * weechat_tcl_api_hdata_move: move pointer to another element in list
5927
 
 */
5928
 
 
5929
5143
static int
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);
5952
5166
}
5953
5167
 
5954
 
/*
5955
 
 * weechat_tcl_api_hdata_char: get char value of a variable in structure
5956
 
 *                             using hdata
5957
 
 */
5958
 
 
5959
5168
static int
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);
5980
5189
}
5981
5190
 
5982
 
/*
5983
 
 * weechat_tcl_api_hdata_integer: get integer value of a variable in structure
5984
 
 *                                using hdata
5985
 
 */
5986
 
 
5987
5191
static int
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);
6008
5212
}
6009
5213
 
6010
 
/*
6011
 
 * weechat_tcl_api_hdata_long: get long value of a variable in structure using
6012
 
 *                             hdata
6013
 
 */
6014
 
 
6015
5214
static int
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);
6036
5235
}
6037
5236
 
6038
 
/*
6039
 
 * weechat_tcl_api_hdata_string: get string value of a variable in structure
6040
 
 *                               using hdata
6041
 
 */
6042
 
 
6043
5237
static int
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);
6065
5259
}
6066
5260
 
6067
 
/*
6068
 
 * weechat_tcl_api_hdata_pointer: get pointer value of a variable in structure
6069
 
 *                                using hdata
6070
 
 */
6071
 
 
6072
5261
static int
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);
6093
5282
}
6094
5283
 
6095
 
/*
6096
 
 * weechat_tcl_api_hdata_time: get time value of a variable in structure using
6097
 
 *                             hdata
6098
 
 */
6099
 
 
6100
5284
static int
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);
6125
5309
}
6126
5310
 
6127
 
/*
6128
 
 * weechat_tcl_api_hdata_hashtable: get hashtable value of a variable in
6129
 
 *                                  structure using hdata
6130
 
 */
6131
 
 
6132
5311
static int
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);
6155
5334
}
6156
5335
 
6157
 
/*
6158
 
 * weechat_tcl_api_hdata_update: update data in a hdata
6159
 
 */
6160
 
 
6161
5336
static int
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);
6178
5355
 
6179
5356
    value = weechat_hdata_update (API_STR2PTR(hdata),
6180
5357
                                  API_STR2PTR(pointer),
6186
5363
    API_RETURN_INT(value);
6187
5364
}
6188
5365
 
6189
 
/*
6190
 
 * weechat_tcl_api_hdata_get_string: get hdata property as string
6191
 
 */
6192
 
 
6193
5366
static int
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);
6212
5385
}
6213
5386
 
6214
 
/*
6215
 
 * weechat_tcl_api_upgrade_new: create an upgrade file
6216
 
 */
6217
 
 
6218
5387
static int
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);
6238
5407
}
6239
5408
 
6240
 
/*
6241
 
 * weechat_tcl_api_upgrade_write_object: write object in upgrade file
6242
 
 */
6243
 
 
6244
5409
static int
6245
5410
weechat_tcl_api_upgrade_write_object (ClientData clientData, Tcl_Interp *interp,
6246
5411
                                      int objc, Tcl_Obj *CONST objv[])
6266
5431
    API_RETURN_INT(rc);
6267
5432
}
6268
5433
 
6269
 
/*
6270
 
 * weechat_tcl_api_upgrade_read_cb: callback for reading an object in upgrade file
6271
 
 */
6272
 
 
6273
5434
int
6274
5435
weechat_tcl_api_upgrade_read_cb (void *data,
6275
5436
                                 struct t_upgrade_file *upgrade_file,
6315
5476
    return WEECHAT_RC_ERROR;
6316
5477
}
6317
5478
 
6318
 
/*
6319
 
 * weechat_tcl_api_upgrade_read: read upgrade file
6320
 
 */
6321
 
 
6322
5479
static int
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);
6346
5503
}
6347
5504
 
6348
 
/*
6349
 
 * weechat_tcl_api_upgrade_close: close upgrade file
6350
 
 */
6351
 
 
6352
5505
static int
6353
5506
weechat_tcl_api_upgrade_close (ClientData clientData, Tcl_Interp *interp,
6354
5507
                               int objc, Tcl_Obj *CONST objv[])
6369
5522
}
6370
5523
 
6371
5524
/*
6372
 
 * weechat_tcl_api_init: initialize subroutines
 
5525
 * Initializes tcl functions and constants.
6373
5526
 */
6374
5527
 
6375
5528
void weechat_tcl_api_init (Tcl_Interp *interp)
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);
6467
5622
 
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);