1 /*--------------------------------*-C-*---------------------------------*
2  * File:	rxvt.c
3  *----------------------------------------------------------------------*
4  *
5  * All portions of code are copyright by their respective author/s.
6  * Copyright (c) 1997-2001   Geoff Wing <gcw@pobox.com>
7  * Copyright (c) 2004        Jingmin Zhou <jimmyzhou@users.sourceforge.net>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  *----------------------------------------------------------------------*/
23 /*
24 ** $Id: rxvt.c,v 1.8 2004/11/11 00:20:28 cvs Exp $
25 */
26 
27 #include "../config.h"
28 #include "rxvt.h"
29 
30 
31 #ifdef DEBUG_VERBOSE
32 #define DEBUG_LEVEL 1
33 #else
34 #define DEBUG_LEVEL 0
35 #endif
36 
37 #if DEBUG_LEVEL
38 #define DBG_MSG(d,x) if(d <= DEBUG_LEVEL) fprintf x
39 #else
40 #define DBG_MSG(d,x)
41 #endif
42 
43 
44 /*----------------------------------------------------------------------*/
45 /* main() */
46 /* INTPROTO */
47 int
main(int argc,const char * const * argv)48 main(int argc, const char *const *argv)
49 {
50 	rxvt_t		 *rxvt_vars;
51 
52 	/*
53 	** Save and then give up any super-user privileges immediately
54 	** after program starts.
55 	** If we need privileges in any area then we must specifically
56 	** request it.
57 	** We should only need to be root in these cases:
58 	**  1.  write utmp entries on some systems
59 	**  2.  chown tty on some systems
60 	*/
61 	rxvt_privileges(SAVE);
62 	rxvt_privileges(IGNORE);
63 
64 	if ((rxvt_vars = rxvt_init(argc, argv)) == NULL)
65 		return EXIT_FAILURE;
66 	rxvt_main_loop(rxvt_vars);	/* main processing loop */
67 		return EXIT_SUCCESS;
68 }
69 /*----------------------- end-of-file (C source) -----------------------*/
70