Dev:Unreal Architecture

Unreal's architecture is made of several important components:

Core
The core includes several components listed in more detail below, but is responsible for loading the configuration, interacting with sockets and low-level I/O, server linking, and other core functionality to the IRCd.


 * Socket Engine
 * "Core" modes
 * "Core" commands
 * Configuration parsing
 * Server linking
 * Client connections
 * Resource management

Modules
Modules are used to extend unreal, and make use of a variety of features to integrate with the core code and with each other - a list of the features that modules use is below with links to more details.


 * Hook API - Hooks are used to allow o
 * Command API - Used to implement new, or override existing, commands that the IRCd accepts
 * EFunction API - Used to implement "core" functionality in modules, e.g. instance JOIN is implemented as an EFunc
 * Extended Mode API - Used to register snomasks, umodes, and cmodes beyond the "core" functionality
 * Send API - Used to leverage pre-written efficient implementations of various "send" logic in the core, e.g. send to a channel
 * Callback API - Used to register callbacks to be invoked when a particular event occurs
 * Module Storage - Used to store metadata from a module with a particular user, channel, or other object - useful if you need to store more detailed information about a given object in the core than simply a single character (a mode) and are fine with it being local to the module only.
 * Find API - Includes a number of methods to locate clients, servers, channels, and other objects.

Coding Standards
Throughout Unreal, we generally assume we have C89 support as our baseline, that means we try not to require C99 support anywhere within the code. Furthermore, while we do use POSIX specific features where necessary (socket engine comes to mind) we try to explicitly provide alternatives to make everything we do compatible with Win32.

As a general goal, any modules you write, or patches you submit, should aim to support following environments and compilers:


 * GCC and Generic POSIX Systems
 * clang and Generic POSIX Systems
 * Win32 using a MSVC compiler (not mingw or through cygwin)

In terms of coding style, Unreal is descended from the original IRCd, and so has numerous places in the code where we should and hope to do a better job with in the future. Towards that goal, we want to avoid the following things wherever possible


 * goto statements, with some exceptions for breaking out of nested loops
 * non-explicit variable names
 * K&R style method prototypes

So please avoid putting any of these into the codebase.