Mercurial > ~mikael > mcabber > hg
comparison mcabber/doc/HOWTO_modules.txt @ 1625:e3b93594ee6c
Howto fixes
author | Myhailo Danylenko <isbear@ukrpost.net> |
---|---|
date | Mon, 19 Oct 2009 10:02:53 +0300 |
parents | a75611931642 |
children | 004739237999 |
comparison
equal
deleted
inserted
replaced
1624:a75611931642 | 1625:e3b93594ee6c |
---|---|
12 -------------------------------------------------------- | 12 -------------------------------------------------------- |
13 const gchar* g_module_check_init (GModule *module); | 13 const gchar* g_module_check_init (GModule *module); |
14 void g_module_unload (GModule *module); | 14 void g_module_unload (GModule *module); |
15 -------------------------------------------------------- | 15 -------------------------------------------------------- |
16 | 16 |
17 to do something when module is loaded and unloaded. | 17 to do something when module is loaded and unloaded. On |
18 success g_module_check_init should return NULL, and | |
19 error message otherwise. | |
18 | 20 |
19 As module is loaded, you can use mcabber functions, | 21 As module is loaded, you can use mcabber functions, |
20 declared in mcabber's header files (though you should | 22 declared in mcabber's header files (though you should |
21 consider, that they may change their calling conventions | 23 consider, that they may change their calling conventions |
22 some day). | 24 some day). |
79 time add or delete words from it's completion list. | 81 time add or delete words from it's completion list. |
80 For that use functions compl_add_category_word and | 82 For that use functions compl_add_category_word and |
81 compl_del_category_word. You can obtain current contents | 83 compl_del_category_word. You can obtain current contents |
82 of category by using gompl_get_category_list. If after | 84 of category by using gompl_get_category_list. If after |
83 execution dynlist is TRUE, you should free obtained | 85 execution dynlist is TRUE, you should free obtained |
84 list of commands. | 86 list of words (both, words and list). |
85 | 87 |
86 -------------------------------------------------------- | 88 -------------------------------------------------------- |
87 #include "hooks.h" | 89 #include "hooks.h" |
88 | 90 |
89 typedef struct { | 91 typedef struct { |
444 } | 446 } |
445 | 447 |
446 /* The End */ | 448 /* The End */ |
447 -------------------------------------------------------- | 449 -------------------------------------------------------- |
448 | 450 |
449 As you can see, here we used the fact, that right now | |
450 all the hooks provide "hook" argument as a first element | |
451 in args, however this can change in future. | |
452 | |
453 Note, that to compile this we also need to add loudmouth-1.0 | 451 Note, that to compile this we also need to add loudmouth-1.0 |
454 to pkg-config command line and to add -I. to compilation | 452 to pkg-config command line and to add -I. to compilation |
455 mode gcc command line (specify include directory with our | 453 mode gcc command line (specify include directory with our |
456 config.h as system include directory), so, you will have | 454 config.h as system include directory), so, you will have |
457 something like | 455 something like |
497 | 495 |
498 Further | 496 Further |
499 | 497 |
500 ============== | 498 ============== |
501 | 499 |
502 As mcabber-lm uses glib mainloop, you can use glib's | 500 As mcabber now uses glib mainloop, you can use glib's |
503 event sources, for example, fifo reading can be easily | 501 event sources, for example, fifo reading can be easily |
504 modularized with GIOChannels. | 502 modularized with GIOChannels. |
505 | 503 |
506 You can extend xmpp part of mcabber functionality by | 504 You can extend xmpp part of mcabber functionality by |
507 providing lm message handlers with high priority and | 505 providing lm message handlers with high priority and |