case 'x': rcs_suffixes = rcs_optarg; break;
checkin_main(int argc, char **argv){	int i, ch, status;	struct checkin_params pb;	pb.date = DATE_NOW;	pb.file = NULL;	pb.rcs_msg = pb.username = NULL;	pb.state = pb.symbol = NULL;	pb.newrev =  NULL;	pb.fmode = pb.flags = status = 0;	pb.flags = INTERACTIVE;	pb.openflags = RCS_RDWR|RCS_CREATE;	while ((ch = rcs_getopt(argc, argv, CI_OPTSTRING)) != -1) {		switch (ch) {		case 'd':			if (rcs_optarg == NULL)				pb.date = DATE_MTIME;			else if ((pb.date = cvs_date_parse(rcs_optarg)) <= 0) {				cvs_log(LP_ERR, "invalide date");				exit(1);			}			break;		case 'f':			rcs_set_rev(rcs_optarg, &pb.newrev);			pb.flags |= FORCE;			break;		case 'h':			(usage)();			exit(0);		case 'i':			rcs_set_rev(rcs_optarg, &pb.newrev);			pb.openflags |= RCS_CREATE;			break;		case 'j':			rcs_set_rev(rcs_optarg, &pb.newrev);			pb.openflags &= ~RCS_CREATE;			break;		case 'l':			rcs_set_rev(rcs_optarg, &pb.newrev);			pb.flags |= CO_LOCK;			break;		case 'M':			rcs_set_rev(rcs_optarg, &pb.newrev);			pb.flags |= CO_REVDATE;			break;		case 'm':			pb.rcs_msg = rcs_optarg;			if (pb.rcs_msg == NULL) {				cvs_log(LP_ERR,				    "missing message for -m option");				exit(1);			}			pb.flags &= ~INTERACTIVE;			break;		case 'N':			if ((pb.symbol = strdup(rcs_optarg)) == NULL) {				cvs_log(LP_ERRNO, "out of memory");				exit(1);			}			if (rcs_sym_check(pb.symbol) != 1) {				cvs_log(LP_ERR, "invalid symbol `%s'",				    pb.symbol);				exit(1);			}			pb.flags |= CI_SYMFORCE;			break;		case 'n':			if ((pb.symbol = strdup(rcs_optarg)) == NULL) {				cvs_log(LP_ERRNO, "out of memory");				exit(1);			}			if (rcs_sym_check(pb.symbol) != 1) {				cvs_log(LP_ERR, "invalid symbol `%s'",				    pb.symbol);				exit(1);			}			break;		case 'q':			verbose = 0;			break;		case 'r':			rcs_set_rev(rcs_optarg, &pb.newrev);			pb.flags |= CI_DEFAULT;			break;		case 's':			pb.state = rcs_optarg;			if (rcs_state_check(pb.state) < 0) {				cvs_log(LP_ERR, "invalid state `%s'",				    pb.state);				exit(1);			}			break;		case 'u':			rcs_set_rev(rcs_optarg, &pb.newrev);			pb.flags |= CO_UNLOCK;			break;		case 'V':			printf("%s\n", rcs_version);			exit(0);		case 'w':			pb.username = rcs_optarg;			break;		default:			(usage)();			exit(1);		}	}	argc -= rcs_optind;	argv += rcs_optind;	if (argc == 0) {		cvs_log(LP_ERR, "no input file");		(usage)();		exit(1);	}	if ((pb.username == NULL) && (pb.username = getlogin()) == NULL) {		cvs_log(LP_ERRNO, "failed to get username");		exit(1);	}	for (i = 0; i < argc; i++) {		pb.filename = argv[i];		/*		 * Test for existence of ,v file. If we are expected to		 * create one, set NEWFILE flag.		 */		if ((pb.openflags & RCS_CREATE)		    && (rcs_statfile(pb.filename, pb.fpath,			    sizeof(pb.fpath)) < 0))			pb.flags |= NEWFILE;		else			pb.openflags &= ~RCS_CREATE;		/*		 * If we are to create a new ,v file, we must decide where it		 * should go.		 */		if (pb.flags & NEWFILE) {			char *fpath = checkin_choose_rcsfile(pb.filename);			if (fpath == NULL) {				status = 1;				continue;			}			strlcpy(pb.fpath, fpath, sizeof(pb.fpath));			free(fpath);		}		pb.file = rcs_open(pb.fpath, pb.openflags, pb.fmode);		if (pb.file == NULL) {			cvs_log(LP_ERR, "failed to open rcsfile '%s'",			    pb.fpath);			exit(1);		}		if (verbose == 1)			printf("%s  <--  %s\n", pb.fpath, pb.filename);				if (pb.flags & NEWFILE)			status = checkin_init(&pb);		else			status = checkin_update(&pb);	}	return (status);}