*/
void ProcessCommand(userrec *user, std::string &cmd);
- /** Insert the default RFC1459 commands into the command hash.
- */
- void SetupCommandTable();
-
/** Finds the init_command symbol in a .so file
* @param v A function pointer to be initialized
* @param h A valid shared object handle
/** Load a command from a shared object on disk.
* @param name The shared object to load (without path)
+ * @return NULL on success, pointer to dlerrr() error message on failure
*/
- void LoadCommand(const char* name);
+ const char* LoadCommand(const char* name);
/** Removes a command if the sources match. Used as a helper for
* safe hash_map delete while iter in RemoveCommands(const char* source).
* @return True if the command was reloaded, false if it could not be found
* or another error occured
*/
- bool ReloadCommand(const char* cmd);
+ bool ReloadCommand(const char* cmd, userrec* user);
/** Default constructor.
* @param Instance The creator of this class
* @return True if the command was added
*/
bool CreateCommand(command_t *f, void* so_handle = NULL);
+
+ /** Insert the default RFC1459 commands into the command hash.
+ * Ignore any already loaded commands.
+ * @param user User to spool errors to, or if NULL, when an error occurs spool the errors to
+ * stdout then exit with EXIT_STATUS_HANDLER.
+ */
+ void SetupCommandTable(userrec* user);
};
/** Command handler class for the RELOAD command.