~ubuntu-branches/ubuntu/saucy/weechat/saucy-proposed

« back to all changes in this revision

Viewing changes to src/plugins/plugin.c

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bouthenot
  • Date: 2011-10-26 20:10:09 UTC
  • mfrom: (1.1.17)
  • Revision ID: package-import@ubuntu.com-20111026201009-kfryfq42cc8qddih
Tags: 0.3.6-1
* New upstream release
  - Fix a FTBFS due to wrong detection of ncursesw headers
    (Closes: #646299)
* Add new doc-base files (Polish translations).
* Install html documentation in /usr/share/doc/weechat/html instead
  of /usr/share/doc/weechat
* Add a symlink from /usr/share/doc/weechat/html to
/usr/share/doc/weechat-doc/html so that it will be easier to find
documentation when weechat-doc is installed (Closes: #632621)
* Add a Suggest on weechat-doc for weechat and weechat-curses. Thanks to
Jonathan Nieder for the proposal.
* Fix the cmake invokation from debian/rules (cflags and ldflags)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include <errno.h>
29
29
#include <stdlib.h>
 
30
#include <stddef.h>
30
31
#include <unistd.h>
31
32
#include <libgen.h>
32
33
#include <stdarg.h>
39
40
#include "../core/weechat.h"
40
41
#include "../core/wee-config.h"
41
42
#include "../core/wee-hashtable.h"
 
43
#include "../core/wee-hdata.h"
42
44
#include "../core/wee-hook.h"
43
45
#include "../core/wee-infolist.h"
44
46
#include "../core/wee-list.h"
53
55
#include "../gui/gui-buffer.h"
54
56
#include "../gui/gui-chat.h"
55
57
#include "../gui/gui-color.h"
 
58
#include "../gui/gui-key.h"
56
59
#include "../gui/gui-nicklist.h"
57
60
#include "../gui/gui-window.h"
58
61
#include "plugin.h"
578
581
        new_plugin->config_set_desc_plugin = &plugin_api_config_set_desc_plugin;
579
582
        new_plugin->config_unset_plugin = &plugin_api_config_unset_plugin;
580
583
        
 
584
        new_plugin->key_bind = &gui_key_bind_plugin;
 
585
        new_plugin->key_unbind = &gui_key_unbind_plugin;
 
586
        
581
587
        new_plugin->prefix = &plugin_api_prefix;
582
588
        new_plugin->color = &plugin_api_color;
583
589
        new_plugin->printf_date_tags = &gui_chat_printf_date_tags;
604
610
        new_plugin->hook_info = &hook_info;
605
611
        new_plugin->hook_info_hashtable = &hook_info_hashtable;
606
612
        new_plugin->hook_infolist = &hook_infolist;
 
613
        new_plugin->hook_hdata = &hook_hdata;
 
614
        new_plugin->hook_focus = &hook_focus;
607
615
        new_plugin->unhook = &unhook;
608
616
        new_plugin->unhook_all = &unhook_all_plugin;
609
617
        
680
688
        new_plugin->infolist_buffer = &plugin_api_infolist_buffer;
681
689
        new_plugin->infolist_time = &plugin_api_infolist_time;
682
690
        new_plugin->infolist_free = &plugin_api_infolist_free;
 
691
 
 
692
        new_plugin->hdata_new = &hdata_new;
 
693
        new_plugin->hdata_new_var = &hdata_new_var;
 
694
        new_plugin->hdata_new_list = &hdata_new_list;
 
695
        new_plugin->hdata_get = &hook_hdata_get;
 
696
        new_plugin->hdata_get_var_offset = &hdata_get_var_offset;
 
697
        new_plugin->hdata_get_var_type = &hdata_get_var_type;
 
698
        new_plugin->hdata_get_var_type_string = &hdata_get_var_type_string;
 
699
        new_plugin->hdata_get_var_hdata = &hdata_get_var_hdata;
 
700
        new_plugin->hdata_get_var = &hdata_get_var;
 
701
        new_plugin->hdata_get_var_at_offset = &hdata_get_var_at_offset;
 
702
        new_plugin->hdata_get_list = &hdata_get_list;
 
703
        new_plugin->hdata_move = &hdata_move;
 
704
        new_plugin->hdata_integer = &hdata_integer;
 
705
        new_plugin->hdata_long = &hdata_long;
 
706
        new_plugin->hdata_string = &hdata_string;
 
707
        new_plugin->hdata_pointer = &hdata_pointer;
 
708
        new_plugin->hdata_time = &hdata_time;
 
709
        new_plugin->hdata_get_string = &hdata_get_string;
683
710
        
684
711
        new_plugin->upgrade_new = &upgrade_file_new;
685
712
        new_plugin->upgrade_write_object = &upgrade_file_write_object;
907
934
    /* remove all hooks */
908
935
    unhook_all_plugin (plugin);
909
936
    
 
937
    /* remove all infolists */
 
938
    infolist_free_all_plugin (plugin);
 
939
    
 
940
    /* remove all hdata */
 
941
    hdata_free_all_plugin (plugin);
 
942
    
910
943
    /* remove all bar items */
911
944
    gui_bar_item_free_all_plugin (plugin);
912
945
    
1136
1169
}
1137
1170
 
1138
1171
/*
 
1172
 * plugin_hdata_plugin_cb: return hdata for plugin
 
1173
 */
 
1174
 
 
1175
struct t_hdata *
 
1176
plugin_hdata_plugin_cb (void *data, const char *hdata_name)
 
1177
{
 
1178
    struct t_hdata *hdata;
 
1179
    
 
1180
    /* make C compiler happy */
 
1181
    (void) data;
 
1182
    
 
1183
    hdata = hdata_new (NULL, hdata_name, "prev_plugin", "next_plugin");
 
1184
    if (hdata)
 
1185
    {
 
1186
        HDATA_VAR(struct t_weechat_plugin, filename, STRING, NULL);
 
1187
        HDATA_VAR(struct t_weechat_plugin, handle, POINTER, NULL);
 
1188
        HDATA_VAR(struct t_weechat_plugin, name, STRING, NULL);
 
1189
        HDATA_VAR(struct t_weechat_plugin, description, STRING, NULL);
 
1190
        HDATA_VAR(struct t_weechat_plugin, author, STRING, NULL);
 
1191
        HDATA_VAR(struct t_weechat_plugin, version, STRING, NULL);
 
1192
        HDATA_VAR(struct t_weechat_plugin, license, STRING, NULL);
 
1193
        HDATA_VAR(struct t_weechat_plugin, charset, STRING, NULL);
 
1194
        HDATA_VAR(struct t_weechat_plugin, debug, INTEGER, NULL);
 
1195
        HDATA_VAR(struct t_weechat_plugin, prev_plugin, POINTER, hdata_name);
 
1196
        HDATA_VAR(struct t_weechat_plugin, next_plugin, POINTER, hdata_name);
 
1197
        HDATA_LIST(weechat_plugins);
 
1198
        HDATA_LIST(last_weechat_plugin);
 
1199
    }
 
1200
    return hdata;
 
1201
}
 
1202
 
 
1203
/*
1139
1204
 * plugin_add_to_infolist: add a plugin in an infolist
1140
1205
 *                         return 1 if ok, 0 if error
1141
1206
 */