|
|
|
@ -1,3 +1,20 @@
|
|
|
|
|
/* wXMPPd - (Trying to be) full featured XMPP daemon
|
|
|
|
|
* Copyright (C) 2011 Gergely Polonkai
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <glib.h>
|
|
|
|
|
#include <libxml/parser.h>
|
|
|
|
@ -8,6 +25,8 @@ gchar *config_dir = NULL;
|
|
|
|
|
gchar *cl_modules_dir = NULL;
|
|
|
|
|
gchar *cl_keys_file = NULL;
|
|
|
|
|
|
|
|
|
|
wxmppd_config_t *activeConfig = NULL;
|
|
|
|
|
|
|
|
|
|
static GOptionEntry optionEntries[] = {
|
|
|
|
|
{ "config-dir", 'c', 0, G_OPTION_ARG_FILENAME, &config_dir, "Directory where configuration files can be found", "DIRECTORY" },
|
|
|
|
|
{ "module-dir", 'm', 0, G_OPTION_ARG_FILENAME, &cl_modules_dir, "Directory of the module files", "DIRECTORY" },
|
|
|
|
@ -47,21 +66,24 @@ main(int argc, char **argv)
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
activeConfig = wxmppd_copyConfig(configObject);
|
|
|
|
|
wxmppd_freeConfig(&configObject);
|
|
|
|
|
|
|
|
|
|
if (cl_modules_dir != NULL)
|
|
|
|
|
{
|
|
|
|
|
if (configObject->modules_dir != NULL)
|
|
|
|
|
if (activeConfig->modules_dir != NULL)
|
|
|
|
|
{
|
|
|
|
|
g_free(configObject->modules_dir);
|
|
|
|
|
g_free(activeConfig->modules_dir);
|
|
|
|
|
}
|
|
|
|
|
configObject->modules_dir = g_strdup(cl_modules_dir);
|
|
|
|
|
activeConfig->modules_dir = g_strdup(cl_modules_dir);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (configObject->modules_dir == NULL)
|
|
|
|
|
if (activeConfig->modules_dir == NULL)
|
|
|
|
|
{
|
|
|
|
|
configObject->modules_dir = g_strdup_printf("%s/wxmppd", LIBDIR);
|
|
|
|
|
activeConfig->modules_dir = g_strdup_printf("%s/wxmppd", LIBDIR);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf("%s\n", configObject->modules_dir);
|
|
|
|
|
wxmppd_setActiveModules();
|
|
|
|
|
|
|
|
|
|
xmlCleanupParser();
|
|
|
|
|
|
|
|
|
|