Dev Area
What you can find here:
1 Basic information on the development process
1.1 What you need to know before contributing
WeIRCd is an IRCd started by a single person, a long-term project that also contains some older source that doesn't adhere to a good coding style, is hard to maintain and not so easy to understand for new developers not being involved so far.
This means if you want to improve WeIRCd, it is often much easier to use the documented and clean module API to develop a module which adds the functionality you want to implement.
At modules you can easily work on your own without interfering with other developers, having your very own, encapsulated piece of extending code that gets lateron dynamically loaded as module.
If you want to work on the core code anyway, the most important part is to communicate with other developers to find out what needs to be done and what is already worked on.
1.2 How to develop modules for WeIRCd
A module is an externally compiled library loaded at runtime by WeIRCd which extends its functionality.
It can be written in C/C++ and is basically a program providing specific functions which WeIRCd will call which can then in turn use the module API functions of WeIRCd to return information to it or to combine a new sort of functionality. The module can also include new libraries and is therefore able to implement very different types of complex new features for WeIRCd.
- You write modules in C/C++ source files where you include the WeIRCd header files. You just need to include the main API header file and those APIs you additionally want to use. Header files can be found at the API documentation (they are also contained in every WeIRCd source code release inside the "modules" sub folder).
- Please note that in normal cases, you do not need to link any libs. Most standard system libs are already linked by WeIRCd itself and you can use everything that WeIRCd also has linked (you still need to include the header files though). For example, the Windows API and Winsock functionality is already linked and provided by WeIRCd, so if you want to use them, do not link them again. Only if you want to use some external lib that is providing some more extensions than just system functions, you will most likely need to link it (e.g. SQlite, cURL or whatever you might want to have for your module).
- If you include header files for additional system libs you want to use, note that <strings.h>, <stdio.h> and <malloc.h> are already included by weircd_api.h for your convenience (so you can use malloc(), free(), sprintf and some other standard string functions like strlen() without including/linking anything)
- Do never use stdin/stdout/stderr in your module_InfoQuery() function (that is, things like printf())! WeIRCd is just looking for information related to your module and might print something out itself to inform the user about its investigations and if you output anything to stdout everything will probably be mixed up. You can use stdout/stderr for error messages though in the actual run, but please always make sure that it is absolutely clear to the user where the error originates from, that is, your module (e.g. by prefixing with "module name: ...").
- WeIRCd is GPLv3 (only) licensed. As they are loaded into the program space, I am pretty sure they also have to be GPLv3 licensed.
- Please note that the WeIRCd API includes some nifty string functions which can make your life easier (check the main api header file). Feel free to use them!
- WeIRCd is not thread-safe. This also means you should never do something that eats a lof of time or blocks the execution for a longer time, as it will stop the whole IRCd!
- When you are done, just compile it to a .dll file (or .so/.dynlib depending on your operating system) using your favourite compiler and you should be done.
The module API is documented at this place:
- API documentation
- WeIRCd's bugtracker listing bugs you might run into
1.2.1 List of modules that already exist
(None)
1.3 Contributing to the WeIRCd core
To contribute to the core code, you need to know in the first place where to obtain the very latest development source (written in C):- Download current development code as zip archive
- Browse the current development code
- A git repository containing the source code can be found here
- The bug tracker is always referenced by http://eloxoph.com/weircd/report-bugs
Please note, as mentioned above in section 1.1, that it is extremely important and vital to join us in chat so any development processes can be coordinated. Don't just turn up with patches out of nothing which cover areas which might already be worked on - it's not a deadly sin, but it is probably just needless work already done by someone else or unappicable after some heavy changes on that code part you also wanted to patch.
2 Contacting other developers
Join us in #weircd at irc.eloxoph.com! (Can be easily done through this web page)