Exemple #1
0
/* write a string to the diagnostic log file */
void
	kcpDiagLog (	KpChar_p	string)
{
initializedGlobals_p	iGP;
KpChar_t				diagName[256];
KpFileId				fd;
KpFileProps_t			fileProps;

	iGP = getInitializedGlobals ();
	if (iGP != NULL) {
		SetKCPDataDirProps (&fileProps);

#if defined (KPMAC) || defined (KPMSMAC)
		strcpy (fileProps.fileType, "TEXT");
		strcpy (diagName, iGP->KCPDataDir);	/* make the full name */
		strcat (diagName, "kcpdiag.log");
#else
		strcpy (diagName, "kcpdiag.log");
#endif

		if (KpFileOpen (diagName, "a", &fileProps, &fd)) {
			KpFileWrite (fd, string, strlen (string));
			(void) KpFileClose (fd);
		}
	}
}
Exemple #2
0
/*--------------------------------------------------------------------
 * FUNCTION NAME
 * callProgress - Macintosh Version
 *
 * DESCRIPTION
 * This function calls the user's call back function
 * must be done as separate subroutine so that progress function
 * address is addressed via the A6 stack
 *
 *--------------------------------------------------------------------*/
static PTErr_t FAR PASCAL
	callProgress (	callBack_p	callBack,
					KpInt32_t	percent)
{
initializedGlobals_p	iGP;
PTRelay_t		relay;
PTErr_t 		theReturn;

#if defined (KPMACPPC)
long			thisA5;
#endif

	if (callBack->progressFunc == NULL) {
		return KCP_SUCCESS;
	}

	iGP = getInitializedGlobals ();
	if (iGP == NULL) {
		return KCP_NO_PROCESS_GLOBAL_MEM;
	}

	relay = iGP->callBackRelay;

	/* do the progress call-back */
#if defined (KPMACPPC)
	thisA5 = SetA5 (callBack->gHostA5);
	
		/* PPC or 68K callback code? */
	if ( ((UniversalProcPtr)callBack->progressFunc)->goMixedModeTrap == _MixedModeMagic) {
		theReturn = (PTErr_t) CallUniversalProc ((UniversalProcPtr)callBack->progressFunc,
												uppCallProgressProcInfo, percent);
	}
	else {						/* callback code is 68K */
		theReturn = (PTErr_t) CallUniversalProc ((UniversalProcPtr)relay, upprelayProcInfo,
						callBack->gHostA5, callBack->gHostA4, callBack->progressFunc, percent);
	}
	SetA5 (thisA5);
#endif
#if defined (KPMAC68K)
		theReturn = (PTErr_t)relay (callBack->gHostA5, callBack->gHostA4, callBack->progressFunc, percent);
#endif

	return (theReturn);
}
Exemple #3
0
PTErr_t
	PTGetMPState (KpUInt32_p MP_Available, KpUInt32_p MP_Used)
{
	initializedGlobals_p	iGblP;

#if defined (KCP_MACPPC_MP)
	KCPInitializeMP ();
#endif

	iGblP = getInitializedGlobals ();
	if (iGblP == NULL) {
		return KCP_NO_PROCESS_GLOBAL_MEM;
	}

	*MP_Available = iGblP->numProcessorsAvailable;
	*MP_Used = iGblP->numProcessors;

	return KCP_SUCCESS;
}
Exemple #4
0
void
	saveFut (	fut_p		futp,
			 	KpChar_p	name)
{
KpFileProps_t	fileProps;
KpChar_t		fullName[256];
initializedGlobals_p	iGP;

	SetKCPDataDirProps (&fileProps);

	iGP = getInitializedGlobals ();

	if (iGP != NULL) {
		strcpy (fullName, iGP->KCPDataDir);	/* make the full name */
		strcat (fullName, name);

		makeFutTblDat (futp);	/* make the fut data tables */

		fut_store_fp (futp, fullName, fileProps);
	}
}
Exemple #5
0
PTErr_t
	PTSetMPState (KpUInt32_t MP_Used)
{
	initializedGlobals_p	iGblP;

#if defined (KCP_MACPPC_MP)
	KCPInitializeMP ();
#endif

	iGblP = getInitializedGlobals ();
	if (iGblP == NULL) {
		return KCP_NO_PROCESS_GLOBAL_MEM;
	}

	if (MP_Used > iGblP->numProcessorsAvailable) {
		iGblP->numProcessors = iGblP->numProcessorsAvailable; /* limit it to numProcessorsAvailable */
	} else if (MP_Used < 1) {
		iGblP->numProcessors = 1;
	} else {
		iGblP->numProcessors = MP_Used;
	}

	return KCP_SUCCESS;
}