To create new wiki account, please join us on #znc at freenode and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Difference between revisions of "Writing modules"

From ZNC
Jump to: navigation, search
(Perl)
(docs url)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
=== C++ ===
 
=== C++ ===
  
* Look at ZNC API [http://people.znc.in/~psychon/znc/doc here] or directly in ZNC headers
+
* Look at ZNC API [http://docs.znc.in/ here] or directly in ZNC headers
 
* Create your own module.cpp file (you can look into the [[sample]] module's [https://github.com/znc/znc/blob/master/modules/sample.cpp source] for help. Of course, you can look to other existing [[:Category:Core Modules|modules]] too)
 
* Create your own module.cpp file (you can look into the [[sample]] module's [https://github.com/znc/znc/blob/master/modules/sample.cpp source] for help. Of course, you can look to other existing [[:Category:Core Modules|modules]] too)
 
* #include <znc/main.h> and <znc/Modules.h>
 
* #include <znc/main.h> and <znc/Modules.h>
Line 14: Line 14:
  
 
=== Python ===
 
=== Python ===
Look [[modpython|here]].
+
Look at [[modpython]].
  
 
[[Category:Modules]]
 
[[Category:Modules]]

Latest revision as of 10:28, 21 April 2014

C++[edit]

  • Look at ZNC API here or directly in ZNC headers
  • Create your own module.cpp file (you can look into the sample module's source for help. Of course, you can look to other existing modules too)
  • #include <znc/main.h> and <znc/Modules.h>
  • Create a new class derived from CModule overriding any module hooks that you need
  • Be sure to add the macro call MODULEDEFS(CYourClass) at the END of the file
  • Compile your module into a shared object (.so file) (See Compiling modules)
  • Place the .so file into your ~/.znc/modules directory !!!WARNING!!! if you overwrite a .so file while znc has it loaded, it can and probably will crash znc, /msg *status unloadmod foo first!

Perl[edit]

Look at modperl.

Python[edit]

Look at modpython.