fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_get, "gethostname()=`%s'\n"),myname);
fprintf(stderr,_("gethostname()=`%s'\n"),myname);
int main(int argc, char **argv){	int c;	char type='\0';	int option_index = 0;	int what = 0;	char myname[MAXHOSTNAMELEN+1] = { 0 };	char *file=NULL;	static const struct option long_options[] =	{		{"domain", no_argument, 0, 'd'},		{"file", required_argument, 0, 'F'},		{"fqdn", no_argument, 0, 'f'},		{"help", no_argument, 0, 'h'},		{"long", no_argument, 0, 'f'},		{"short", no_argument, 0, 's'},		{"version", no_argument, 0, 'V'},		{"verbose", no_argument, 0, 'v'},		{"alias", no_argument, 0, 'a'},		{"ip-address", no_argument, 0, 'i'},		{"nis", no_argument, 0, 'y'},		{"yp", no_argument, 0, 'y'},		{0, 0, 0, 0}	};#if NLS	setlocale (LC_MESSAGES, "");	catfd = catopen ("nettools", MCLoadBySet);#endif	program_name = (rindex(argv[0], '/')) ? rindex(argv[0], '/') + 1 : argv[0];	if (!strcmp(program_name,"ypdomainname") || 	    !strcmp(program_name,"domainname")   || 	    !strcmp(program_name,"nisdomainname"))		what = 3;	if (!strcmp(program_name,"dnsdomainname"))		what = 2;		while((c = getopt_long(argc, argv, "adfF:h?isVvy", long_options, &option_index)) != EOF)	switch(c)	{		case 'd':			what = 2;			break;		case 'a':		case 'f':		case 'i':		case 's':			what = 1;			type=c;			break;		case 'y':			what = 3;			break;		case 'F':			file=optarg;									break;		case 'v':			opt_v++;			break;		case 'V':			version();		case '?':		case 'h':		default:			usage();	};	switch(what) {		case 2:			if (file || (optind < argc)) {				fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_nodns1,					   "%s: You can't change the DNS domain name with this command\n"), program_name);				fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_nodns2,					   "\nUnless you are using bind or NIS for host lookups you can change the DNS\n"));				fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_nodns3,					   "domain name (which is part of the FQDN) in the /etc/hosts file.\n"));				NLS_CATCLOSE(catfd)				exit(1);			}			type='d';						/* NOBREAK */		case 0:			if (file) {				setfilename(file,SETHOST);				break;			}			if (optind < argc) {				sethname(argv[optind]);				break;			}		case 1:			gethostname(myname, sizeof(myname));			if (opt_v)				fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_get, 					"gethostname()=`%s'\n"),myname);			if (!type)				printf("%s\n",myname);			else				showhname(myname,type);			break;		case 3:			if (file) {				setfilename(file,SETDOMAIN);				break;			}			if (optind < argc) {				setdname(argv[optind]);				break;			}			getdomainname(myname,sizeof(myname));			if (opt_v)				fprintf(stderr,NLS_CATGETS(catfd, hostnameSet, hostname_verb_dget, 					"getdomainname()=`%s'\n"),myname);			printf("%s\n",myname);			break;	}	NLS_CATCLOSE(catfd)	exit(0);}