Updating ChangeLog for 4.22.10
[centerim.git] / src / centermain.cc
blob15789b8b086beefbad4fc992332d6cd10f97fe51
1 /*
3 * centerim main() function
4 * $Id: centermain.cc,v 1.16 2002/07/07 22:58:18 konst Exp $
6 * Copyright (C) 2001 by Konstantin Klyagin <k@thekonst.net>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
25 #include <sys/types.h>
26 #include <sys/stat.h>
28 #include "centerim.h"
29 #include "icqface.h"
30 #include "icqconf.h"
31 #include "icqcontacts.h"
32 #include "icqmlist.h"
33 #include "icqgroups.h"
35 #ifdef HAVE_LIBOTR
36 #include "imotr.h"
37 #endif
39 centerim cicq;
40 icqconf* conf=icqconf::instance();
41 icqcontacts clist;
42 icqface face;
43 icqlist lst;
44 icqgroups groups;
46 #ifdef ENABLE_NLS
48 #include <locale.h>
49 #include <libintl.h>
51 #endif
53 int main(int argc, char **argv) {
54 char savedir[1024];
56 getcwd(savedir, 1024);
58 try {
59 srand((unsigned int) time(NULL));
61 #ifdef ENABLE_NLS
62 setlocale(LC_ALL, "");
63 bindtextdomain(PACKAGE, LOCALEDIR);
64 textdomain(PACKAGE);
65 #endif
67 conf->commandline(argc, argv);
68 #ifdef HAVE_LIBOTR
69 otr.init();
70 #endif
72 cicq.exec();
74 } catch(exception e) {
75 cerr << "Caught exception: " << e.what() << endl;
78 chdir(savedir);