bzero(&new, sizeof(struct cfdata));
userconf_add(dev,len,unit,state)	char *dev;	int len;	short unit, state;{	int i = 0, found = 0;	struct cfdata new = {0};	int  val, max_unit;	if (userconf_maxdev == userconf_totdev) {		printf("No more space for new devices.\n");		return;	}	if (state == FSTATE_FOUND) {		printf("Device not complete number or * is missing/n");		return;	}	for (i = 0; cfdata[i].cf_driver; i++)		if (strlen(cfdata[i].cf_driver->cd_name) == len &&		    strncasecmp(dev,cfdata[i].cf_driver->cd_name,len) == 0)			found = 1;	if (!found) {		printf("No device of this type exists.\n");		return;	}		userconf_add_read("Clone Device (DevNo, 'q' or '?')",			  'a',dev,len,&val);		if (val != -1) {		new = cfdata[val];		new.cf_unit = unit;		new.cf_fstate = state;		userconf_add_read("Insert before Device (DevNo, 'q' or '?')",				  'i',dev,len,&val);	}	if (val != -1) {		/* Insert the new record */		for (i = userconf_maxdev; val <= i; i--) {			cfdata[i+1] = cfdata[i];		}		cfdata[val] = new;		/* Fix indexs in pv */				for (i = 0; i < pv_size; i++) {			if ((pv[i] != -1) && (pv[i] >= val)) {				pv[i] = pv[i]++;			}		}		/* Fix indexs in cfroots */				for (i = 0; i < cfroots_size; i++) {			if ((cfroots[i] != -1) && (cfroots[i] >= val)) {				cfroots[i] = cfroots[i]++;			}		}		userconf_maxdev++;		max_unit = -1;		/* Find max unit number of the device type */				i = 0;		while(cfdata[i].cf_attach != 0) {			if (strlen(cfdata[i].cf_driver->cd_name) == len &&			    strncasecmp(dev,					cfdata[i].cf_driver->cd_name,					len) == 0) {				switch (cfdata[i].cf_fstate) {				case FSTATE_NOTFOUND:				case FSTATE_DNOTFOUND:					if (cfdata[i].cf_unit > max_unit)						max_unit = cfdata[i].cf_unit;					break;				default:					break;				}			}			i++;		}		/* For all * entries set unit number to max+1 */		max_unit++;				i = 0;		while(cfdata[i].cf_attach != 0) {			if (strlen(cfdata[i].cf_driver->cd_name) == len &&			    strncasecmp(dev,					cfdata[i].cf_driver->cd_name,					len) == 0) {				switch (cfdata[i].cf_fstate) {				case FSTATE_STAR:				case FSTATE_DSTAR:					cfdata[i].cf_unit = max_unit;					break;				default:					break;				}			}			i++;		}				userconf_pdev(val);	}	/* cf_attach, cf_driver, cf_unit, cf_state, cf_loc, cf_flags,	   cf_parents, cf_locnames, cf_locnames and cf_ivstubs */}