Mercurial > irccd
changeset 248:b8d09c237835
Misc: change comment length to 80
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 17 Aug 2016 22:03:43 +0200 |
parents | 4dec71ea1326 |
children | c2c40fc0beb1 |
files | irccd/main.cpp lib/irccd/alias.hpp lib/irccd/command.cpp lib/irccd/command.hpp lib/irccd/fs.cpp lib/irccd/fs.hpp lib/irccd/irccd.cpp lib/irccd/irccd.hpp lib/irccd/irccdctl.cpp lib/irccd/logger.cpp lib/irccd/logger.hpp lib/irccd/mod-directory.cpp lib/irccd/mod-file.hpp lib/irccd/mod-plugin.cpp lib/irccd/mod-server.cpp lib/irccd/mod-util.cpp lib/irccd/path.cpp lib/irccd/path.hpp lib/irccd/plugin-js.cpp lib/irccd/server.cpp lib/irccd/server.hpp lib/irccd/service-plugin.hpp lib/irccd/system.cpp lib/irccd/transport.hpp lib/irccd/util.cpp lib/irccd/util.hpp |
diffstat | 26 files changed, 194 insertions(+), 131 deletions(-) [+] |
line wrap: on
line diff
--- a/irccd/main.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/irccd/main.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -215,7 +215,8 @@ /* * Order matters, please be careful when changing this. * - * 1. Open logs as early as possible to use the defined outputs on any loading errors. + * 1. Open logs as early as possible to use the defined outputs on any + * loading errors. */ // [logs] and [format] sections.
--- a/lib/irccd/alias.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/alias.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -36,8 +36,8 @@ * \class AliasArg * \brief Describe an alias argument. * - * When the user specify arguments, it can precise an applied argument or a placeholder that will be substituted - * during command line invocation. + * When the user specify arguments, it can precise an applied argument or a + * placeholder that will be substituted during command line invocation. * * Placeholders are placed using %n where n is an integer starting from 0. */ @@ -94,7 +94,8 @@ * \class AliasCommand * \brief Describe a user-provided alias command. * - * An alias command is just a command with a set of applied or placeholders arguments. + * An alias command is just a command with a set of applied or placeholders + * arguments. */ class AliasCommand { private: @@ -139,8 +140,8 @@ * \class Alias * \brief A set of commands to execute with their arguments. * - * An alias is a composition of AliasCommand, typically, the user is able to set an alias that execute a list of - * specified commands in order they are defined. + * An alias is a composition of AliasCommand, typically, the user is able to set + * an alias that execute a list of specified commands in order they are defined. */ class Alias : public std::vector<AliasCommand> { private:
--- a/lib/irccd/command.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/command.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -70,7 +70,8 @@ * typeNameList * ------------------------------------------------------------------ * - * Construct a list of names to send a convenient error message if properties are invalid, example: string, int or bool expected. + * Construct a list of names to send a convenient error message if properties + * are invalid, example: string, int or bool expected. */ std::string typeNameList(const std::vector<json::value_t> &types)
--- a/lib/irccd/command.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/command.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -165,7 +165,8 @@ /** * \brief Command line arguments to irccdctl. * - * This class contains the resolved arguments from command line that can apply to the command. + * This class contains the resolved arguments from command line that can apply + * to the command. */ class CommandRequest { public: @@ -298,23 +299,26 @@ /** * \brief Invokable command. * - * A remote command is a invokable command in the irccd daemon. You can register dynamically any remote command you - * like using Application::addCommand. + * A remote command is a invokable command in the irccd daemon. You can register + * dynamically any remote command you like using Application::addCommand. * - * The remote command will be usable directly from irccdctl without any other code. + * The remote command will be usable directly from irccdctl without any other + * code. * - * A remote command can have options and arguments. Options always come first, before arguments. + * A remote command can have options and arguments. Options always come first, + * before arguments. * * The command workflow is defined as follow: * - * 1. User wants to invoke a command, request() is called and return a JSON object containaing the request, it it send - * to the daemon. + * 1. User wants to invoke a command, request() is called and return a JSON + * object containaing the request, it it send to the daemon. * - * 2. The daemon receive the request and execute it using exec(). It returns a JSON object containint the request result - * or error if any. + * 2. The daemon receive the request and execute it using exec(). It returns a + * JSON object containint the request result or error if any. * - * 3. Finally, the command receives the result in result() function and user can manipulate it. For convenience, the - * default implementation shows the error if any. + * 3. Finally, the command receives the result in result() function and user can + * manipulate it. For convenience, the default implementation shows the error + * if any. */ class Command { public: @@ -474,7 +478,8 @@ /** * Prepare a JSON request to the daemon. * - * If the command is local and does not need to send anything to irccd's instance, return a null JSON value. + * If the command is local and does not need to send anything to irccd's + * instance, return a null JSON value. * * The default implementation just send the command name with no arguments. * @@ -488,12 +493,14 @@ /** * Execute the command in the daemon. * - * The user can return an object with any properties to forward to the client. Irccd will automatically - * add the command name and the appropriate status code. + * The user can return an object with any properties to forward to the + * client. Irccd will automatically add the command name and the appropriate + * status code. * * The default return an empty object which indicates success. * - * If any exception is thrown from this function, it is forwarded to the client as error status. + * If any exception is thrown from this function, it is forwarded to the + * client as error status. * * \param irccd the instance * \param request the JSON request @@ -504,7 +511,8 @@ /** * What to do when receiving the response from irccd. * - * This default implementation just check for an error string and shows it if any. + * This default implementation just check for an error string and shows it + * if any. * * \param irccdctl the irccdctl instance * \param response the JSON response @@ -527,7 +535,8 @@ /** * Constructor an option description. * - * Simple and long keys must not start with '-' or '--', they will be added automatically. + * Simple and long keys must not start with '-' or '--', they will be added + * automatically. * * If arg is not empty, the option takes an argument. *
--- a/lib/irccd/fs.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/fs.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -80,7 +80,8 @@ * hasAccess. * ------------------------------------------------------------------ * - * Check if we have access to the file specified, mode is the same used as std::fopen. + * Check if we have access to the file specified, mode is the same used as + * std::fopen. */ bool hasAccess(const std::string &path, const std::string &mode) {
--- a/lib/irccd/fs.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/fs.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -172,7 +172,8 @@ /** * Check if a file exists. * - * If HAVE_ACCESS is defined, the function access is used, otherwise stat is used. + * If HAVE_ACCESS is defined, the function access is used, otherwise stat is + * used. * * \param path the path to check * \return true if the path exists @@ -286,8 +287,10 @@ std::string findIf(const std::string &base, Predicate &&predicate) { /* - * Do not go deeply to the tree before testing all files in the current directory for performances reasons, we iterate - * this directory to search for the entry name and iterate again over all sub directories if not found. + * Do not go deeply to the tree before testing all files in the current + * directory for performances reasons, we iterate this directory to search + * for the entry name and iterate again over all sub directories if not + * found. */ std::string path; std::vector<Entry> entries = readdir(base);
--- a/lib/irccd/irccd.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/irccd.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -101,8 +101,8 @@ void Irccd::dispatch() { /* - * Make a copy because the events can add other events while we are iterating it. Also lock because the timers - * may alter these events too. + * Make a copy because the events can add other events while we are + * iterating it. Also lock because the timers may alter these events too. */ std::vector<std::function<void (Irccd &)>> copy;
--- a/lib/irccd/irccd.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/irccd.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -151,8 +151,8 @@ } /** - * Add an event to the queue. This will immediately signals the event loop to interrupt itself to dispatch - * the pending events. + * Add an event to the queue. This will immediately signals the event loop + * to interrupt itself to dispatch the pending events. * * \param ev the event * \note Thread-safe
--- a/lib/irccd/irccdctl.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/irccdctl.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -451,7 +451,10 @@ if (args.size() > cmd.max()) throw std::runtime_error("too many arguments"); - // 4. Construct the request, if the returned value is not an object, do not send anything (e.g. help). + /* + * 4. Construct the request, if the returned value is not an object, do not + * send anything (e.g. help). + */ nlohmann::json request = cmd.request(*this, CommandRequest(std::move(requestOptions), std::move(args))); if (!request.is_object())
--- a/lib/irccd/logger.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/logger.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -51,8 +51,8 @@ * Buffer -- output buffer. * ------------------------------------------------------------------ * - * This class inherits from std::stringbuf and writes the messages to the specified interface function which is one of - * info, warning and debug. + * This class inherits from std::stringbuf and writes the messages to the + * specified interface function which is one of info, warning and debug. */ class Buffer : public std::stringbuf {
--- a/lib/irccd/logger.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/logger.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -154,7 +154,8 @@ */ /** - * \brief Logger implementation for console output using std::cout and std::cerr. + * \brief Logger implementation for console output using std::cout and + * std::cerr. */ class Console : public Interface { public:
--- a/lib/irccd/mod-directory.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/mod-directory.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -55,7 +55,8 @@ } /* - * Find an entry recursively (or not) in a directory using a predicate which can be used to test for regular expression, equality. + * Find an entry recursively (or not) in a directory using a predicate which can + * be used to test for regular expression, equality. * * Do not use this function directly, use: * @@ -121,7 +122,8 @@ * - Directory.find * - Directory.prototype.find * - * The patternIndex is the argument where to test if the argument is a regex or a string. + * The patternIndex is the argument where to test if the argument is a regex or + * a string. */ duk_ret_t find(duk_context *ctx, std::string base, bool recursive, int patternIndex) {
--- a/lib/irccd/mod-file.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/mod-file.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -154,7 +154,8 @@ /** * Construct the file as this. * - * The object prototype takes ownership of fp and will be deleted once collected. + * The object prototype takes ownership of fp and will be deleted once + * collected. * * \pre fp != nullptr * \param ctx the the context
--- a/lib/irccd/mod-plugin.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/mod-plugin.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -58,10 +58,12 @@ * set * ------------------------------------------------------------------ * - * This setter is used to replace the Irccd.Plugin.(config|format) property when the plugin assign a new one. + * This setter is used to replace the Irccd.Plugin.(config|format) property when + * the plugin assign a new one. * - * Because the plugin configuration always has higher priority, when a new object is assigned to 'config' or to the 'format' property, - * the plugin configuration is merged to the assigned one, adding or replacing any values. + * Because the plugin configuration always has higher priority, when a new + * object is assigned to 'config' or to the 'format' property, the plugin + * configuration is merged to the assigned one, adding or replacing any values. * * Example: * @@ -178,8 +180,9 @@ * - version: (string) the version * * Arguments: - * - name, the plugin identifier, if not specified the current plugin is selected. - * duk_idx_turns: + * - name, the plugin identifier, if not specified the current plugin is + * selected. + * Returns: * The plugin information or undefined if the plugin was not found. */ duk_idx_t info(duk_context *ctx) @@ -215,7 +218,7 @@ * * Get the list of plugins, the array returned contains all plugin names. * - * duk_idx_turns: + * Returns: * The list of all plugin names. */ duk_idx_t list(duk_context *ctx) @@ -231,7 +234,8 @@ * Function: Irccd.Plugin.load(name) * ------------------------------------------------------------------ * - * Load a plugin by name. This function will search through the standard directories. + * Load a plugin by name. This function will search through the standard + * directories. * * Arguments: * - name, the plugin identifier.
--- a/lib/irccd/mod-server.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/mod-server.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -484,7 +484,8 @@ * Function: Irccd.Server.remove(name) * ------------------------------------------------------------------ * - * Remove a server from the irccd instance. You can pass the server object since it's coercible to a string. + * Remove a server from the irccd instance. You can pass the server object since + * it's coercible to a string. * * Arguments: * - name the server name.
--- a/lib/irccd/mod-util.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/mod-util.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -27,7 +27,8 @@ namespace { /** - * Read parameters for Irccd.Util.format function, the object is defined as follow: + * Read parameters for Irccd.Util.format function, the object is defined as + * following: * * { * date: the date object
--- a/lib/irccd/path.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/path.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -73,7 +73,8 @@ * * This variable stores the program base directory. * - * If it is empty, the program was not able to detect it (e.g. error, not supported). + * If it is empty, the program was not able to detect it (e.g. error, not + * supported). */ std::string base; @@ -371,16 +372,16 @@ base = executablePath(); } catch (const std::exception &) { /* - * If an exception is thrown, that means the operatin system supports a function to get the executable - * path but it failed. + * If an exception is thrown, that means the operatin system supports a + * function to get the executable path but it failed. * * TODO: show a waning */ } /* - * If we could not get the application path from the native function, check if argv[0] is an absolute path - * and use that from there. + * If we could not get the application path from the native function, check + * if argv[0] is an absolute path and use that from there. * * Otherwise, search from the PATH. *
--- a/lib/irccd/path.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/path.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -64,8 +64,8 @@ /** * This function must be called before at the beginning of the main. * - * It use system dependant program path lookup if available and fallbacks to the path given as argument if any failure - * was encoutered. + * It use system dependant program path lookup if available and fallbacks to the + * path given as argument if any failure was encoutered. * * \param argv0 the path to the executable (argv[0]) */ @@ -94,7 +94,8 @@ /** * Generic function for multiple paths. * - * This function will add more directories than pathSystem*() and pathUser*() functions. + * This function will add more directories than pathSystem*() and pathUser*() + * functions. * * \pre setApplicationPath must have been called * \param path the type of path
--- a/lib/irccd/plugin-js.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/plugin-js.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -137,7 +137,8 @@ : Plugin(name, path) { /* - * Create two special tables for configuration and formats, they are referenced later as + * Create two special tables for configuration and formats, they are + * referenced later as * * - Irccd.Plugin.config * - Irccd.Plugin.format @@ -256,8 +257,9 @@ duk_pop(m_context); /* - * We put configuration and formats after loading the file and before calling onLoad to allow the plugin adding configuration - * to Irccd.Plugin.(config|format) before the user. + * We put configuration and formats after loading the file and before + * calling onLoad to allow the plugin adding configuration to + * Irccd.Plugin.(config|format) before the user. */ setConfig(irccd.pluginService().config(name())); setFormats(irccd.pluginService().formats(name()));
--- a/lib/irccd/server.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/server.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -144,8 +144,8 @@ * cleanPrefix * ------------------------------------------------------------------ * - * Remove the user prefix only if it is present in the mode table, for example removes @ from @irccd if and only if - * @ is a character mode (e.g. operator). + * Remove the user prefix only if it is present in the mode table, for example + * removes @ from @irccd if and only if @ is a character mode (e.g. operator). */ std::string cleanPrefix(const std::map<ChannelMode, char> &modes, std::string nickname) { @@ -258,8 +258,8 @@ join(strify(params[1])); /* - * The libircclient says that invite contains the target nickname, it's quite - * uncommon to need it so it is passed as the last argument to be + * The libircclient says that invite contains the target nickname, it's + * quit uncommon to need it so it is passed as the last argument to be * optional in the plugin. */ onInvite(InviteEvent{shared_from_this(), strify(orig), strify(params[1]), strify(params[0])}); @@ -303,7 +303,10 @@ void Server::handleNotice(const char *orig, const char **params) noexcept { - // Like handleInvite, the notice provides the target nickname, we discard it. + /* + * Like handleInvite, the notice provides the target nickname, we discard + * it. + */ onNotice(NoticeEvent{shared_from_this(), strify(orig), strify(params[1])}); } @@ -318,7 +321,8 @@ * params[2] == channel * params[3] == list of users with their prefixes * - * IDEA for the future: maybe give the appropriate mode as a second parameter in onNames. + * IDEA for the future: maybe give the appropriate mode as a second + * parameter in onNames. */ if (c < 4 || params[2] == nullptr || params[3] == nullptr) return; @@ -822,13 +826,15 @@ void Server::ConnectingState::prepare(Server &server, fd_set &setinput, fd_set &setoutput, net::Handle &maxfd) { /* - * The connect function will either fail if the hostname wasn't resolved or if any of the internal functions - * fail. + * The connect function will either fail if the hostname wasn't resolved or + * if any of the internal functions fail. * - * It returns success if the connection was successful but it does not mean that connection is established. + * It returns success if the connection was successful but it does not mean + * that connection is established. * - * Because this function will be called repeatidly, the connection was started and we're still not - * connected in the specified timeout time, we mark the server as disconnected. + * Because this function will be called repeatidly, the connection was + * started and we're still not connected in the specified timeout time, we + * mark the server as disconnected. * * Otherwise, the libircclient event_connect will change the state. */ @@ -848,9 +854,8 @@ irc_add_select_descriptors(*server.m_session, &setinput, &setoutput, reinterpret_cast<int *>(&maxfd)); } else { /* - * This is needed if irccd is started before DHCP or if DNS cache is outdated. - * - * For more information see bug #190. + * This is needed if irccd is started before DHCP or if DNS cache is + * outdated. */ #if !defined(IRCCD_SYSTEM_WINDOWS) (void)res_init();
--- a/lib/irccd/server.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/server.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -50,11 +50,11 @@ * \brief Prefixes for nicknames. */ enum class ChannelMode { - Creator = 'O', //!< Channel creator - HalfOperator = 'h', //!< Half operator - Operator = 'o', //!< Channel operator - Protection = 'a', //!< Unkillable - Voiced = 'v' //!< Voice power + Creator = 'O', //!< Channel creator + HalfOperator = 'h', //!< Half operator + Operator = 'o', //!< Channel operator + Protection = 'a', //!< Unkillable + Voiced = 'v' //!< Voice power }; /** @@ -62,8 +62,8 @@ */ class Channel { public: - std::string name; //!< the channel to join - std::string password; //!< the optional password + std::string name; //!< the channel to join + std::string password; //!< the optional password }; /** @@ -71,11 +71,11 @@ */ class Whois { public: - std::string nick; //!< user's nickname - std::string user; //!< user's user - std::string host; //!< hostname - std::string realname; //!< realname - std::vector<std::string> channels; //!< the channels where the user is + std::string nick; //!< user's nickname + std::string user; //!< user's user + std::string host; //!< hostname + std::string realname; //!< realname + std::vector<std::string> channels; //!< the channels where the user is }; /** @@ -256,15 +256,18 @@ /** * \brief The class that connect to a IRC server * - * The server is a class that stores callbacks which will be called on IRC events. It is the lowest part of the connection to a server, it - * can be used directly by the user to connect to a server. + * The server is a class that stores callbacks which will be called on IRC + * events. It is the lowest part of the connection to a server, it can be used + * directly by the user to connect to a server. * * The server has several signals that will be emitted when data has arrived. * - * When adding a server to the ServerService in irccd, these signals are connected to generate events that will be dispatched to the plugins - * and to the transports. + * When adding a server to the ServerService in irccd, these signals are + * connected to generate events that will be dispatched to the plugins and to + * the transports. * - * Note: the server is set in non blocking mode, commands are placed in a queue and sent when only when they are ready. + * Note: the server is set in non blocking mode, commands are placed in a queue + * and sent when only when they are ready. */ class Server : public std::enable_shared_from_this<Server> { public: @@ -277,11 +280,11 @@ * \brief Various options for server. */ enum { - Ipv6 = (1 << 0), //!< Connect using IPv6 - Ssl = (1 << 1), //!< Use SSL - SslVerify = (1 << 2), //!< Verify SSL - AutoRejoin = (1 << 3), //!< Auto rejoin a channel after being kicked - JoinInvite = (1 << 4) //!< Join a channel on invitation + Ipv6 = (1 << 0), //!< Connect using IPv6 + Ssl = (1 << 1), //!< Use SSL + SslVerify = (1 << 2), //!< Verify SSL + AutoRejoin = (1 << 3), //!< Auto rejoin a kick + JoinInvite = (1 << 4) //!< Join a channel on invitation }; /** @@ -354,7 +357,8 @@ * * Triggered on a CTCP Action. * - * This is both used in a channel and in a private message so the target may be a channel or your nickname. + * This is both used in a channel and in a private message so the target may + * be a channel or your nickname. */ Signal<MeEvent> onMe; @@ -504,7 +508,8 @@ IRCCD_EXPORT static std::shared_ptr<Server> fromJson(const nlohmann::json &object); /** - * Split a channel from the form channel:password into a ServerChannel object. + * Split a channel from the form channel:password into a ServerChannel + * object. * * \param value the value * \return a channel @@ -631,7 +636,8 @@ /** * Set the nickname. * - * If the server is connected, send a nickname command to the IRC server, otherwise change it locally. + * If the server is connected, send a nickname command to the IRC server, + * otherwise change it locally. * * \param nickname the nickname */ @@ -921,7 +927,8 @@ /** * Part from a channel. * - * Please note that the reason is not supported on all servers so if you want portability, don't provide it. + * Please note that the reason is not supported on all servers so if you + * want portability, don't provide it. * * \param channel the channel to leave * \param reason the optional reason
--- a/lib/irccd/service-plugin.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/service-plugin.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -137,7 +137,8 @@ IRCCD_EXPORT PluginFormats formats(const std::string &name) const; /** - * Convenient wrapper that loads a plugin, call onLoad and add it to the registry. + * Convenient wrapper that loads a plugin, call onLoad and add it to the + * registry. * * Any errors are printed using logger. *
--- a/lib/irccd/system.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/system.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -81,13 +81,16 @@ * setHelper * ------------------------------------------------------------------ * - * This is an helper for setting the uid or gid. It accepts both numeric and string uid and gid. + * This is an helper for setting the uid or gid. It accepts both numeric and + * string uid and gid. * - * If a name is specified as uid/group, the lookup function will be called and must be getpwname or - * getgrname. Then, to get the id from the returned structure (struct passwd, struct group), the getter - * function will return either pw_uid or gr_gid. + * If a name is specified as uid/group, the lookup function will be called and + * must be getpwname or getgrname. Then, to get the id from the returned + * structure (struct passwd, struct group), the getter function will return + * either pw_uid or gr_gid. * - * Finally, when the id is resolved, the setter function (setuid, setgid) will be called. + * Finally, when the id is resolved, the setter function (setuid, setgid) will + * be called. * * - typeName the type of id (uid or gid) * - value the value (numeric or name) @@ -121,8 +124,9 @@ } /* - * XXX: the setprogname() function keeps a pointer without copying it so when main's argv is modified, we're not using - * the same name so create our own copy. + * XXX: the setprogname() function keeps a pointer without copying it so when + * main's argv is modified, we're not using the same name so create our own + * copy. */ std::string programNameCopy;
--- a/lib/irccd/transport.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/transport.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -223,7 +223,8 @@ /** * \brief Bring networking between irccd and irccdctl. * - * This class contains a master sockets for listening to TCP connections, it is then processed by irccd. + * This class contains a master sockets for listening to TCP connections, it is + * then processed by irccd. * * The transport class supports the following domains: * @@ -232,7 +233,8 @@ * | IPv4, IPv6 | TransportServerIp | * | Unix (not on Windows) | TransportServerUnix | * - * Note: IPv4 and IPv6 can be combined, using TransportServer::IPv6 and its option. + * Note: IPv4 and IPv6 can be combined, using TransportServer::IPv6 and its + * option. */ class TransportServer { private:
--- a/lib/irccd/util.cpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/util.cpp Wed Aug 17 22:03:43 2016 +0200 @@ -240,8 +240,8 @@ std::string format(std::string text, const Substitution ¶ms) { /* - * Change the date format before anything else to avoid interpolation with keywords and - * user input. + * Change the date format before anything else to avoid interpolation with + * keywords and user input. */ if (params.flags & Substitution::Date) text = substituteDate(text, params); @@ -270,8 +270,9 @@ } /* - * If the next token is different from the previous one, just let the next iteration parse the string because - * we can have the following constructs. + * If the next token is different from the previous one, just let the + * next iteration parse the string because we can have the following + * constructs. * * "@#{var}" -> "@value" */ @@ -281,8 +282,8 @@ } /* - * Write the token only if it's not a variable because at this step we may have the following - * constructs. + * Write the token only if it's not a variable because at this step we + * may have the following constructs. * * "##" -> "##" * "##hello" -> "##hello"
--- a/lib/irccd/util.hpp Wed Aug 17 21:27:45 2016 +0200 +++ b/lib/irccd/util.hpp Wed Aug 17 22:03:43 2016 +0200 @@ -51,10 +51,11 @@ * \enum MessageType * \brief Describe which type of message has been received * - * On channels and queries, you may have a special command or a standard message depending on the - * beginning of the message. + * On channels and queries, you may have a special command or a standard message + * depending on the beginning of the message. * - * Example: `!reminder help' may invoke the command event if a plugin reminder exists. + * Example: `!reminder help' may invoke the command event if a plugin reminder + * exists. */ enum class MessageType { Command, //!< special command @@ -104,8 +105,8 @@ * * ## Syntax * - * The syntax is <strong>?{}</strong> where <strong>?</strong> is replaced by one of the token defined below. Braces - * are mandatory and cannot be ommited. + * The syntax is <strong>?{}</strong> where <strong>?</strong> is replaced by + * one of the token defined below. Braces are mandatory and cannot be ommited. * * To write a literal template construct, prepend the token twice. * @@ -113,23 +114,30 @@ * * The following templates are available: * - * - <strong>\#{name}</strong>: name will be substituted from the keywords in params, - * - <strong>\${name}</strong>: name will be substituted from the environment variable, - * - <strong>\@{attributes}</strong>: the attributes will be substituted to IRC colors (see below), + * - <strong>\#{name}</strong>: name will be substituted from the keywords in + * params, + * - <strong>\${name}</strong>: name will be substituted from the environment + * variable, + * - <strong>\@{attributes}</strong>: the attributes will be substituted to IRC + * colors (see below), * - <strong>%</strong>, any format accepted by strftime(3). * * ## Attributes * - * The attribute format is composed of three parts, foreground, background and modifiers, each separated by a comma. + * The attribute format is composed of three parts, foreground, background and + * modifiers, each separated by a comma. * - * **Note:** you cannot omit parameters, to specify the background, you must specify the foreground. + * **Note:** you cannot omit parameters, to specify the background, you must + * specify the foreground. * * ## Examples * * ### Valid constructs * - * - <strong>\#{target}, welcome</strong>: if target is set to "irccd", becomes "irccd, welcome", - * - <strong>\@{red}\#{target}</strong>: if target is specified, it is written in red, + * - <strong>\#{target}, welcome</strong>: if target is set to "irccd", + * becomes "irccd, welcome", + * - <strong>\@{red}\#{target}</strong>: if target is specified, it is written + * in red, * * ### Invalid or literals constructs * @@ -141,8 +149,10 @@ * ### Colors & attributes * * - <strong>\@{red,blue}</strong>: will write text red on blue background, - * - <strong>\@{default,yellow}</strong>: will write default color text on yellow background, - * - <strong>\@{white,black,bold,underline}</strong>: will write white text on black in both bold and underline. + * - <strong>\@{default,yellow}</strong>: will write default color text on + * yellow background, + * - <strong>\@{white,black,bold,underline}</strong>: will write white text on + * black in both bold and underline. */ IRCCD_EXPORT std::string format(std::string text, const Substitution ¶ms = {}); @@ -291,8 +301,8 @@ * * This function will try to convert the string to number in the limits of T. * - * If the string is not a number or if the converted value is out of range than specified boundaries, an exception is - * thrown. + * If the string is not a number or if the converted value is out of range than + * specified boundaries, an exception is thrown. * * By default, the function will use numeric limits from T. *