pedroconfig.cpp revision 38fb914eb3aced01da1c1ca278e5da766d340c21
/*
* Implementation the Pedro mini-XMPP client
*
* Authors:
* Bob Jamison
*
* Copyright (C) 2005-2007 Bob Jamison
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
====================================================
We are expecting an xml file with this format:
<pedro>
<!-- zero to many of these -->
<account>
<name>Jabber's Main Server</name>
<host>jabber.org</host>
<port>5222</port>
<username>myname</username>
<password>mypassword</password>
</account>
</pedro>
====================================================
*/
#include "pedroconfig.h"
#include "pedrodom.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
namespace Pedro
{
{
char *end;
val = 0L;
return val;
}
{
if (!root)
{
error("Error in configuration syntax");
return false;
}
{
}
for (unsigned int i=0 ; i<accountElems .size() ; i++)
{
str = "unnamed account";
str = "jabber.org";
if (port == 0)
port = 5222;
str = "noname";
str = "nopass";
}
delete root;
return true;
}
{
if (!f)
{
error("Could not open configuration file '%s' for reading",
return false;
}
while (!feof(f))
{
}
fclose(f);
return false;
return true;
}
{
char fmtbuf[32];
{
}
return buf;
}
{
if (!f)
{
error("Could not open configuration file '%s' for writing",
return false;
}
{
return false;
}
fclose(f);
return false;
return true;
}
/**
*
*/
{
return mucGroup;
}
/**
*
*/
{
}
/**
*
*/
{
return mucHost;
}
/**
*
*/
{
}
/**
*
*/
{
return mucNick;
}
/**
*
*/
{
}
/**
*
*/
{
return mucPassword;
}
/**
*
*/
{
mucPassword = val;
}
/**
*
*/
{
return accounts;
}
/**
*
*/
{
return false;
if (accountExists(name))
return false;
return true;
}
/**
*
*/
{
return false;
{
return true;
}
return false;
}
/**
*
*/
{
return;
{
else
iter++;
}
}
/**
*
*/
{
return false;
{
{
return true;
}
}
return false;
}
} //namespace Pedro
//########################################################################
//# E N D O F F I L E
//########################################################################