Exemple #1
0
/* ins_app */
WORD ins_app(BYTE *pfname, ANODE *pa)
{			       
	LONG	tree;
	ANODE	*newpa;
	BYTE	pname[12];
	BYTE	ntypes[6*8];
	WORD	oicon, nicon;
	WORD	oflag, nflag;
	WORD	change, field;
	WORD	uninstalled, h;
#if MULTIAPP
	BYTE	memszstr[4];
	WORD	omemsz, nmemsz;
#endif

	tree = G.a_trees[ADINSAPP];
#if MULTIAPP
	LWSET(OB_NEXT(APMEMBOX),APMEMSZ);
#endif
	h = LWGET(OB_HEIGHT(APSCRLBA));
	LWSET(OB_HEIGHT(APFUPARO), gl_hbox + 2);
	LWSET(OB_Y(APFSVSLI), gl_hbox + 2);
	LWSET(OB_HEIGHT(APFSVSLI), h - (2 * (gl_hbox + 2)));
	LWSET(OB_Y(APFDNARO), h - (gl_hbox + 2));
	LWSET(OB_HEIGHT(APFDNARO), gl_hbox + 2);

	uninstalled = !is_installed(pa);
	LWSET(OB_STATE(APREMV), (uninstalled) ? DISABLED : NORMAL );
	/* stuff in appl name */
	fmt_str(pfname, &pname[0]);
	inf_sset(tree, APNAME, &pname[0]);
	/* stuff in docu types */
	insa_stypes(tree, pa->a_pdata);
	LWSET(OB_STATE(APYMEM), NORMAL);
	oflag = pa->a_flags;
	if (pa->a_flags & AF_ISCRYS)
	{
		field = APGEM;
		LWSET(OB_STATE(APYMEM), DISABLED);
	}
	else
		field = (pa->a_flags & AF_ISPARM) ? APPARMS : APDOS;
	LWSET(OB_STATE(field), SELECTED);

	field = (pa->a_flags & AF_ISFMEM) ? APYMEM : APNMEM;
	LWSET(OB_STATE(field), SELECTED);

	oicon = pa->a_aicon - IA_GENERIC;

#if MULTIAPP
	omemsz = pa->a_memreq;
	merge_str(&memszstr[0], "%W", &omemsz);
	inf_sset(tree, APMEMSZ, &memszstr[0]);
#endif

	insa_elev(tree, oicon, gl_numics);
	nicon = insa_dial(tree, oicon, gl_numics);
	change = FALSE;

#if MULTIAPP
	nmemsz = ins_latoi(LLGET(LLGET(OB_SPEC(APMEMSZ))));
#endif

	/* set memory flag */
	field = inf_gindex(tree, APYMEM, 2);
	nflag = (field == 0) ? AF_ISFMEM : 0;
	LWSET(OB_STATE(APYMEM + field), NORMAL);
	/* set type flags */
	field = inf_gindex(tree, APGEM, 3);
	if (field == 0)
		nflag = AF_ISCRYS | AF_ISGRAF;
	if (field == 2)
		nflag |= AF_ISPARM;
	LWSET(OB_STATE(APGEM + field), NORMAL);
	/* get button selection	*/
	field = inf_gindex(tree, APINST, 3);
	LWSET(OB_STATE(APINST + field), NORMAL);

	if ( field == 0 )
	{
		/* install the appl. if its uninstalled or has new types */
		insa_gtypes(tree, &ntypes[0]);
		if ( (uninstalled) || (!strcmp(&ntypes[0], pa->a_pdata)) )
		{
			newpa = (uninstalled) ? app_alloc(TRUE) : pa;

			if (newpa)
			{
				if ( (uninstalled) || (!strcmp(&ntypes[0], pa->a_pdata)) )
				{
					change = TRUE;
					ntypes[ strlen(&ntypes[0]) ] = '@';
					scan_str(&ntypes[0], &newpa->a_pdata);
				}

				if (newpa != pa)
				{
					uninstalled = change = TRUE;
					strcpy(&ntypes[0], pfname);
					ntypes[ strlen(&ntypes[0]) ] = '@';
					scan_str(&ntypes[0], &newpa->a_pappl);
					newpa->a_flags = nflag;
					newpa->a_type = AT_ISFILE;
					newpa->a_obid = NIL;
					newpa->a_letter = '\0';
					newpa->a_xspot = 0x0;
					newpa->a_yspot = 0x0;
				}
				pa = newpa;
			}
			else
				fun_alert(1, STAPGONE, NULL);
		}
		/* see if icon changed or flags changed */
		if ( (uninstalled) ||
#if MULTIAPP
			(omemsz != nmemsz) ||
#endif
			(oicon != nicon) ||
			(oflag != nflag) )
		{
			change = TRUE;
			pa->a_aicon = nicon + IA_GENERIC;
			pa->a_dicon = nicon + ID_GENERIC;
			pa->a_flags = nflag;
#if MULTIAPP
			pa->a_memreq = nmemsz;
#endif
		}
	}
	else if ( field == 1 )
	{
		/* remove installed app	*/
		if ( !uninstalled )
		{
			app_free(pa);
			change = TRUE;
		}
	}
	return(change);
} /* ins_app */
Exemple #2
0
static int
merge_hwe (struct hwentry * dst, struct hwentry * src)
{
	merge_str(vendor);
	merge_str(product);
	merge_str(revision);
	merge_str(uid_attribute);
	merge_str(features);
	merge_str(hwhandler);
	merge_str(selector);
	merge_str(checker_name);
	merge_str(prio_name);
	merge_str(prio_args);
	merge_str(alias_prefix);
	merge_str(bl_product);
	merge_num(pgpolicy);
	merge_num(pgfailback);
	merge_num(rr_weight);
	merge_num(no_path_retry);
	merge_num(minio);
	merge_num(minio_rq);
	merge_num(pg_timeout);
	merge_num(flush_on_last_del);
	merge_num(fast_io_fail);
	merge_num(dev_loss);
	merge_num(user_friendly_names);
	merge_num(retain_hwhandler);
	merge_num(detect_prio);

	/*
	 * Make sure features is consistent with
	 * no_path_retry
	 */
	if (dst->no_path_retry == NO_PATH_RETRY_FAIL)
		remove_feature(&dst->features, "queue_if_no_path");
	else if (dst->no_path_retry != NO_PATH_RETRY_UNDEF)
		add_feature(&dst->features, "queue_if_no_path");

	return 0;
}