File: main.c

package info (click to toggle)
gnome-network 1.0.2-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,968 kB
  • ctags: 1,007
  • sloc: ansic: 8,129; sh: 6,837; objc: 961; makefile: 251
file content (56 lines) | stat: -rw-r--r-- 985 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* GnomeTalk: Main module
 * (C) 1997 the Free Software Foundation
 *
 * Author: Federico Mena
 */

#include <config.h>
#include <unistd.h>
#include "gnome.h"
#include "global.h"
#include "names.h"
#include "protocol.h"

#ifndef GNOMELOCALEDIR
#define GNOMELOCALEDIR "/usr/share/locale"
#endif

/* Arguments we parsed out of the command line.  */
static char *user;
static char *tty;

const struct poptOption options [] = {
	{ NULL, '\0', 0, NULL, 0 }
};

int
main(int argc, char **argv)
{
	poptContext ctx;
	char **args;

	bindtextdomain(PACKAGE, GNOMELOCALEDIR);
	textdomain(PACKAGE);
	
	gnome_init_with_popt_table ("gnometalk", VERSION, argc, argv, options, 0, &ctx);
	args = poptGetArgs (ctx);
	while (args && *args){
		if (user){
			if (!tty)
				tty = *args;
		} else
			user = *args;
		args++;
	}
	poptFreeContext (ctx);
	
	init_protocol ();
	if (user == NULL)
		get_names_from_user ();
	else
		if (!init_names (user, tty))
			get_names_from_user ();

	gtk_main();
	return 0;
}