Example #1
0
BOOL FTrjLabel(LPCSTR lsz, BYTE *rgb, UINT *pib)
{
        UINT i;
        BYTE bOff;

        rglbl[clbl].lszLabel = lsz;
        rglbl[clbl].dwOff = *pib;
        clbl++;
        assert(clbl < CELEM_ARRAY(rglbl));

        for (i=0; i<clblref; )
        {
                if (_ftcscmp(lsz, rglblref[i].lszLabel) == 0)
                {
                        bOff = *pib - (rglblref[i].dwOff + 1);
                        rgb[rglblref[i].dwOff] = bOff;
                        _fmemmove(&rglblref[i], &rglblref[i+1],
                                (clblref-i-1)*sizeof(LABEL));
                        clblref--;
                }
                else
                {
                        i++;
                }
        }

        return TRUE;
}
Example #2
0
void slidemsgTab(int howmany)
{
    uint numnuked;
   
    numnuked = cfg.nmessages - howmany;
   
    _fmemmove(&msgTab1[howmany], msgTab1,
            (uint)(numnuked * (sizeof(*msgTab1)) ));
    _fmemmove(&msgTab2[howmany], msgTab2,
            (uint)(numnuked * (sizeof(*msgTab2)) ));
/*  _fmemmove(&msgTab3[howmany], msgTab3,
            (uint)(numnuked * (sizeof(*msgTab3)) )); */
    _fmemmove(&msgTab4[howmany], msgTab4,
            (uint)(numnuked * (sizeof(*msgTab4)) ));
    _fmemmove(&msgTab5[howmany], msgTab5,
            (uint)(numnuked * (sizeof(*msgTab5)) ));
    _fmemmove(&msgTab6[howmany], msgTab6,
            (uint)(numnuked * (sizeof(*msgTab6)) ));
    _fmemmove(&msgTab7[howmany], msgTab7,
            (uint)(numnuked * (sizeof(*msgTab7)) ));
    _fmemmove(&msgTab8[howmany], msgTab8,
            (uint)(numnuked * (sizeof(*msgTab8)) ));
/*  _fmemmove(&msgTab9[howmany], msgTab9,
            (uint)(numnuked * (sizeof(*msgTab9)) )); */
}
void DIR_ReadNr (short num,struct DIR_rec *dest)
{
    struct DIR_rec _far *zeiger=DIR_top,speicher;
    register short za,laenge,co;

    if (num<=DIR_eintraege && num>0)
       {
	 laenge=sizeof(speicher);
	 _fmemmove((void _far*)&speicher,zeiger,laenge);
	 co=DIR_eintraege-num;

	 for (za=1;za<=co;za++)
	    {
	       zeiger=speicher.vorher;
	       _fmemmove((void _far*)&speicher,zeiger,laenge);
	    }
	 *dest=speicher;
       }
}
Example #4
0
//==================================================================================
//	_FormatPStr(void FAR *pdata, long count)
//
//==================================================================================
static	VOID NEAR PASCAL	_FormatPStr(sBYTE FAR *pData, sBYTE FAR *msg)
{
	int	iMsgLen	= _fstrlen(msg);
	int	iDataLen	= (uBYTE)pData[0];
	if ((iMsgLen + iDataLen)  < sizeof(SZMSGBUF))
		iDataLen = sizeof(SZMSGBUF) - (uBYTE)iMsgLen;
		
	if (iDataLen > 0)
		_fmemmove(&(msg[iMsgLen]), pData + 1, iDataLen);
	iMsgLen += (uBYTE)pData[0];
	msg[iMsgLen] = 0;		//	make sure to null terminate the string
}
Example #5
0
static void AppendMenuItemW(INT MenuGroup, PWSTR pString)
{	LPPOPUPLIST NewItem;

	if (PopupInUse+1 /*NULL element at end*/ >= PopupAllocated) {
		LPLPPOPUPLIST np;

		if ((np = _fcalloc(PopupAllocated+100, sizeof(LPPOPUPLIST))) == NULL)
			return;
		if (PopupInUse) {
			_fmemcpy(np, PopupList, PopupInUse*sizeof(LPPOPUPLIST));
			_ffree(PopupList);
		}
		PopupList = np;
		PopupAllocated += 100;
	}
	NewItem = _fcalloc(1, sizeof(POPUPLIST) + wcslen(pString)*sizeof(WCHAR));
	if (NewItem != NULL) {
		int i;

		wcscpy(NewItem->Name, pString);
		if ((i = wcslen(pString)) > MaxLen) MaxLen = i;
		NewItem->MenuGroup = (BYTE)MenuGroup;
		/*binary array search...*/
		{	int i, d;

			if (PopupInUse) {
				BOOL Less;

				for (d=PopupInUse-1; d & (d-1); d &= d-1);
				/*d = largest power of 2 less than PopupInUse*/
				i = d;
				if (i) i += i-1;
				for (;;) {
					Less = i < PopupInUse
						   && ( PopupList[i]->MenuGroup <  MenuGroup ||
							   (PopupList[i]->MenuGroup == MenuGroup
								&& lstrcmpiW(PopupList[i]->Name, pString) < 0));
					if (Less) i += d;
					else i -= d;
					if (!d) break;
					d >>= 1;
				}
				if (Less) ++i;
			} else i = 0;
			if (i < PopupInUse)
				_fmemmove(PopupList+i+1, PopupList+i,
						  (PopupInUse-i)*sizeof(LPPOPUPLIST));
			assert(i >= 0);
			assert(i < PopupAllocated);
			++PopupInUse;
			PopupList[i] = NewItem;
		}
Example #6
0
VOID DeleteMotion(LEVEL_DATA *pLevel, INT index)
{
  INT i;
  BYTE *p;
  WORD wSize;
  POLYGON huge *pPolygon;

  if (index < 0 || index > pLevel->nMotions - 1)
  {
    return;
  }

  //
  //  Update the motion index of affected polygons.
  //

  pPolygon = pLevel->pPolygonData;

  for(i = 0; i < pLevel->nPolygons; ++i)
  {
    if (pPolygon->motion_index == index)
    {
      pPolygon->motion_index = -1;
    }
    else if (pPolygon->motion_index > index)
    {
      --pPolygon->motion_index;
    }

    ++pPolygon;
  }

  //
  //  Now delete the motion.
  //

  p = (BYTE *)(&pLevel->pMotionData[index]);

  wSize = (pLevel->nMotions - index - 1) * sizeof(MOTION);

  if (wSize > 0)
  {
    _fmemmove(p, p + sizeof(MOTION), wSize);
  }

  --pLevel->nMotions;

  pLevel->bRebuildZone = TRUE;

  return;

} // DeleteMotion
void DIR_ReleaseAll(void)
{
    struct DIR_rec speicher;
    size_t	   laenge;

    while (DIR_eintraege>0)
	{
	  laenge=sizeof(speicher);
	  _fmemmove((void _far*)&speicher,DIR_top,laenge);

	  _ffree(DIR_top);
	  DIR_top=speicher.vorher;
	  DIR_eintraege--;
	}
}
Example #8
0
/*--------------------------------------------------------------------------
 * Function: _SetMemoryString
 * Expects:  HWND        hDlg
 *           LPDLGVALS   lpDlgVals;
 * Returns:  nothing
 * Purpose:  To Set the static string for the 'Memory display' of the assert
 *           dialog box.
 * History:  11/7/94     Initial Revision (mdh)
 *--------------------------------------------------------------------------
 */
static VOID NEAR PASCAL	_SetMemoryString( HWND hDlg, LPDLGVALS lpdlgVals )
{
	char		szTmp[32];
	SZMSGBUF	szBuf;

	if (lpdlgVals->ulCount > 0)
		{
		_NumToHexStr((long)lpdlgVals->lpvData, szTmp, 8);

		_fstrcpy(szBuf, _szMemoryMessage);
		_fmemmove(&(szBuf[kAddressOffset]), szTmp, _fstrlen(szTmp));

		switch (lpdlgVals->ulFormat)
			{
			case 'b':
			case 'B':
				_FormatBytes(((sBYTE FAR*)lpdlgVals->lpvData), lpdlgVals->ulCount, (sBYTE FAR*)szBuf);
				break;
	
			case 'w':
			case 'W':
				_FormatWords(((sBYTE FAR*)lpdlgVals->lpvData), lpdlgVals->ulCount, (sBYTE FAR*)szBuf);
				break;
	
			case 'l':
			case 'L':
				_FormatLongs(((sBYTE FAR*)lpdlgVals->lpvData), lpdlgVals->ulCount, (sBYTE FAR*)szBuf);
				break;
	
			case 's':
			case 'S':
				_FormatCStr(((sBYTE FAR*)lpdlgVals->lpvData),  szBuf);
				break;
	
			case 'p':
			case 'P':
				_FormatPStr(((sBYTE FAR*)lpdlgVals->lpvData), szBuf);
				break;
			}
		}
	else
		*szBuf = 0;		//	Null terminate the string.
	
	SetWindowText( GetDlgItem( hDlg, DLGID_MEMORYTEXT ), szBuf );
}	
Example #9
0
void env_subVarOffset(word segm, word offset)
{	register unsigned moveStart;

	DBG_ENTER("env_subVarOffset", Suppl_env)
	DBG_ARGUMENTS( ("env=%u, ofs=%u", segm, offset) )

	chkMem
	assert(segm);
	assert(offset < env_endOfVars(segm));

	moveStart = offset + env_varlen(segm, offset);

	_fmemmove(MK_FP(segm, offset), MK_FP(segm, moveStart),
		env_firstFree(segm) - moveStart);
	chkMem

	DBG_EXIT
}
Example #10
0
VOID DeleteMark(LEVEL_DATA *pLevel, INT index)
{
  BYTE *p;
  WORD wSize;

  if (index < 0 || index > pLevel->nMarks - 1)
  {
    return;
  }

  p = (BYTE *)(&pLevel->pMarkData[index]);

  wSize = (pLevel->nMarks - index - 1) * sizeof(MARK);

  if (wSize > 0)
  {
    _fmemmove(p, p + sizeof(MARK), wSize);
  }

  --pLevel->nMarks;

  return;

} // DeleteMark
Example #11
0
// add a variable to the environment or alias to the alias list
int PASCAL add_list( LPTSTR pszVariable, TCHAR _far *pchList )
{
	LPTSTR pszLine;
	TCHAR _far *pszVarName, _far *pszArgument, _far *pszEndOfList, _far *pszLastVariable;
	unsigned int uLength;
	int nError = 0;

	if ( pchList == 0L )
		pchList = glpEnvironment;

	pszLine = pszVariable;
	if ( *pszLine == _TEXT('=') ) {
		return ( error( ERROR_4DOS_BAD_SYNTAX, pszVariable ));
	}

	for ( ; (( *pszLine ) && ( *pszLine != _TEXT('=') )); pszLine++ ) {

		if ( pchList != glpEnvironment ) {

			if ( iswhite( *pszLine )) {
				strcpy( pszLine, skipspace( pszLine ) );
				break;
			}
		}
		else	    // ensure environment entry is in upper case
			*pszLine = (unsigned char)_ctoupper( *pszLine );
	}

	// stupid kludge to strip quotes from PATH for compatibility with
	//   COMMAND.COM
	if (( fWin95 ) && ( pchList == glpEnvironment )) {

		char szVarName[8];

		if (( uLength = ( pszLine - pszVariable )) > 7 )
			uLength = 7;

		sprintf( szVarName, "%.*s", uLength, pszVariable );
		if ( stricmp( szVarName, PATH_VAR ) == 0 )
			StripQuotes( pszLine );
	}

	if ( *pszLine == _TEXT('=') ) {

		// point to the first char of the argument
		pszLine++;

		// collapse whitespace around '=' in aliases, but not in env
		//   variables, for COMMAND.COM compatibility (set abc def= ghi)
		if ( pchList != glpEnvironment )
			strcpy( pszLine, skipspace( pszLine ));

	} else if ( *pszLine ) {
		// add the missing '='
		strins( pszLine, _TEXT("=") );
		pszLine++;
	}

	// removing single back quotes at the beginning and end of an alias
	//   argument (they're illegal there; the user is probably making a
	//   mistake with ALIAS /R)
	if (( *pszLine == SINGLE_QUOTE ) && ( pchList != glpEnvironment )) {

		// remove leading single quote
		strcpy( pszLine, pszLine + 1 );

		// remove trailing single quote
		if ((( uLength = strlen( pszLine )) != 0 ) && ( pszLine[--uLength] == SINGLE_QUOTE ))
			pszLine[uLength] = _TEXT('\0');
	}

	// block other processes & threads while updating list
	if ( pchList != glpEnvironment ) {
		// disable task switches under Windows and DESQview
		CriticalSection( 1 );
	}

	// get pointers to beginning & end of list space
	pszEndOfList = pchList + ((( pchList == glpAliasList ) ? gpIniptr->AliasSize : gpIniptr->EnvSize ) - 4 );

	// get pointer to end of environment or alias variables
	pszLastVariable = end_of_env( pchList );

	uLength = strlen( pszVariable ) + 1;

	// check for modification or deletion of existing entry
	if (( pszArgument = get_list( pszVariable, pchList )) != 0L ) {

		// get the start of the alias or variable name
		for ( pszVarName = pszArgument; (( pszVarName > pchList ) && ( pszVarName[-1] != _TEXT('\0') )); pszVarName-- )
			;

		if ( *pszLine == _TEXT('\0') ) {
			// delete an alias or environment variable
			_fmemmove( pszVarName, next_env( pszVarName ), (unsigned int)( (ULONG_PTR)pszLastVariable - (ULONG_PTR)next_env(pszVarName)) + sizeof(TCHAR));
		} else {
			// get the relative length (vs. the old variable)
			uLength = strlen( pszLine ) - _fstrlen( pszArgument );
		}
	}

	if ( *pszLine != _TEXT('\0') ) {

		// check for out of space
		if (( pszLastVariable + ( uLength * sizeof(TCHAR) )) >= pszEndOfList ) {

			if ( pchList == glpAliasList )
				nError = error( ERROR_4DOS_OUT_OF_ALIAS, NULL );
			else if ( pchList == glpEnvironment )
				nError = error( ERROR_4DOS_OUT_OF_ENVIRONMENT, NULL);
			else
				nError = error( ERROR_NOT_ENOUGH_MEMORY, NULL );
			goto add_bye;
		}

		if ( pszArgument != 0L ) {

			// modify an existing value
			//   adjust the space & insert new value
			pszVarName = next_env( pszVarName );
			_fmemmove(( pszVarName + uLength ), pszVarName, (unsigned int)(( (ULONG_PTR)pszLastVariable - (ULONG_PTR)pszVarName ) + sizeof(TCHAR) ));
			_fstrcpy( pszArgument, pszLine );

		} else {
			// put it at the end & add an extra null
			_fstrcpy( pszLastVariable, pszVariable );
			pszLastVariable[uLength] = _TEXT('\0');
		}
	}

add_bye:
	if ( pchList != glpEnvironment ) {
		// re-enable task switches under Windows and DESQview
		CriticalSection( 0 );
	}

	return nError;
}
Example #12
0
DWORD FAR PASCAL OBSVocSyn (float FAR *lpflSrcBuf, DWORD ulOutDen, 
                 long lSmpTim, DWORD ulWinPts, DWORD ulFFTPts, 
                 float flPchShf, float flSynThr, LPOBSB pobOBSBlk)
{
    MGAFLT FAR *lpmaMGABuf;
    MGAFLT FAR *lpmaPrvBuf;
    float  FAR *lpflCosBuf;
    float  FAR *lpflIdxBuf;
    float  FAR *lpflOutBuf;
    DWORD       ulOscCnt;
    float       flPchInc;
    float       flFrqInc;
    float       flAmpInc;
    float       flCurAmp;
    float       flCurFrq;
    float       flCurIdx;
    DWORD       ulCpxPts = ulFFTPts >> 1;                
    DWORD       uli;
    DWORD       ulj;

    /********************************************************************/
    /********************************************************************/
    ulOscCnt = (DWORD) ((flPchShf > 1) ? ulCpxPts / flPchShf : ulCpxPts);
    flPchInc =  flPchShf * pobOBSBlk->flTabInc;

    /********************************************************************/
    /********************************************************************/
    if (!(lpmaPrvBuf = GloMemLck (pobOBSBlk->mhPrvBuf))) {
        return (0L);
    }
    if (!(lpflCosBuf = GloMemLck (pobOBSBlk->mhCosBuf))) {
        GloMemUnL (pobOBSBlk->mhPrvBuf);
        return (0L);
    }
    if (!(lpflIdxBuf = GloMemLck (pobOBSBlk->mhIdxBuf))) {
        GloMemUnL (pobOBSBlk->mhPrvBuf);
        GloMemUnL (pobOBSBlk->mhCosBuf);
        return (0L);
    }
    if (!(lpflOutBuf = GloMemLck (pobOBSBlk->mhWrkBuf))) {
        GloMemUnL (pobOBSBlk->mhPrvBuf);
        GloMemUnL (pobOBSBlk->mhCosBuf);
        GloMemUnL (pobOBSBlk->mhIdxBuf);
        return (0L);
    }
    lpmaMGABuf = (LPVOID) lpflSrcBuf;

    /********************************************************************/
    /* Generate I output samples from input Mag / Ang buffer            */
    /********************************************************************/
    for (uli=0L; uli < ulOscCnt; uli++) {
        lpmaMGABuf[uli].flAng *= flPchInc;
        flCurFrq = lpmaPrvBuf[uli].flAng;
        flFrqInc = (lpmaMGABuf[uli].flAng - flCurFrq) / (float) ulOutDen;
        flCurIdx = lpflIdxBuf[uli];

        /****************************************************************/
        /****************************************************************/
        if (lpmaMGABuf[uli].flMag < flSynThr) lpmaMGABuf[uli].flMag = 0;
        flCurAmp = lpmaPrvBuf[uli].flMag;
        flAmpInc = (lpmaMGABuf[uli].flMag - flCurAmp) / (float) ulOutDen;

        /****************************************************************/
        /* Inc Frq / Amp from beginning to end of output                */
        /****************************************************************/
        if (flAmpInc || flCurAmp) for (ulj=0; ulj < ulOutDen; ulj++) {
            // lpflOutBuf[ulj] += flCurAmp * cos (db2PI * flCurIdx / OBSCOSTAB);           
            lpflOutBuf[ulj] += flCurAmp * lpflCosBuf[(DWORD) flCurIdx];           
            flCurAmp += flAmpInc;
            flCurIdx += (flCurFrq + ulj * flFrqInc);
            while (flCurIdx >= OBSCOSTAB) flCurIdx -= (float) OBSCOSTAB;
            while (flCurIdx <          0) flCurIdx += (float) OBSCOSTAB;
        }
        lpmaPrvBuf[uli] = lpmaMGABuf[uli];
        lpflIdxBuf[uli] = flCurIdx;

    }

    /********************************************************************/
    /* If output time >= 0, output first batch & shift remaining left   */
    /********************************************************************/
    if (lSmpTim) _fmemcpy (lpflSrcBuf, lpflOutBuf, 
        (WORD) ulOutDen * sizeof (*lpflOutBuf));
    _fmemmove (lpflOutBuf, &lpflOutBuf[ulOutDen], 
        (WORD) (ulWinPts - ulOutDen) * sizeof (*lpflOutBuf));          
    for (uli=ulWinPts - ulOutDen; uli<ulWinPts; uli++) lpflOutBuf[uli] = 0;        

    /********************************************************************/
    /********************************************************************/
    GloMemUnL (pobOBSBlk->mhPrvBuf);
    GloMemUnL (pobOBSBlk->mhCosBuf);
    GloMemUnL (pobOBSBlk->mhIdxBuf);
    GloMemUnL (pobOBSBlk->mhWrkBuf); 

    /********************************************************************/
    /********************************************************************/
    return ((lSmpTim >= 0L) ? ulOutDen : 0L);

}
Example #13
0
VOID DeleteGroup(LEVEL_DATA *pLevel, INT index)
{
  INT i;
  BYTE *p;
  WORD wSize;
  POLYGON huge *pPolygon;
  VERTEX huge *pVertex;

  if (index < 0 || index > pLevel->nGroups - 1)
  {
    return;
  }

  //
  //  Update the group index of affected polygons.
  //

  pPolygon = pLevel->pPolygonData;

  for(i = 0; i < pLevel->nPolygons; ++i)
  {
    if (pPolygon->group_index == index)
    {
      pPolygon->group_index = -1;
    }
    else if (pPolygon->group_index > index)
    {
      --pPolygon->group_index;
    }

    ++pPolygon;
  }

  //
  //  Update the group index of affected vertices.
  //

  pVertex = pLevel->pVertexData;

  for(i = 0; i < pLevel->nVertices; ++i)
  {
    if (pVertex->group_index == index)
    {
      pVertex->group_index = -1;
    }
    else if (pVertex->group_index > index)
    {
      --pVertex->group_index;
    }

    ++pVertex;
  }

  //
  //  Now delete the group.
  //

  p = (BYTE *)(&pLevel->pGroupData[index]);

  wSize = (pLevel->nGroups - index - 1) * sizeof(GROUP);

  if (wSize > 0)
  {
    _fmemmove(p, p + sizeof(GROUP), wSize);
  }

  --pLevel->nGroups;

  return;

} // DeleteGroup
Example #14
0
VOID DeleteTrigger(LEVEL_DATA *pLevel, INT index)
{
  INT i;
  BYTE *p;
  WORD wSize;
  VERTEX huge *pVertex;

  if (index < 0 || index > pLevel->nTriggers - 1)
  {
    return;
  }

  //
  //  Update the trigger index of affected motions.
  //

  for(i = 0; i < pLevel->nMotions; ++i)
  {
    if (pLevel->pMotionData[i].trigger_index == index)
    {
      pLevel->pMotionData[i].trigger_index = -1;
    }
    else if (pLevel->pMotionData[i].trigger_index > index)
    {
      --pLevel->pMotionData[i].trigger_index;
    }
  }

  //
  //  Update the trigger index of affected vertices.
  //

  pVertex = pLevel->pVertexData;

  for(i = 0; i < pLevel->nVertices; ++i)
  {
    if (pVertex->trigger_index == index)
    {
      pVertex->trigger_index = -1;
    }
    else if (pVertex->trigger_index > index)
    {
      --pVertex->trigger_index;
    }

    ++pVertex;
  }

  //
  //  Now delete the trigger.
  //

  p = (BYTE *)(&pLevel->pTriggerData[index]);

  wSize = (WORD)(pLevel->nTriggers - index - 1) * sizeof(TRIGGER);

  if (wSize > 0)
  {
    _fmemmove(p, p + sizeof(TRIGGER), wSize);
  }

  --pLevel->nTriggers;

  pLevel->bRebuildZone = TRUE;

  return;

} // DeleteTrigger
Example #15
0
WORD FAR PASCAL EffWinRsp (WINTYP usWinTyp, CPXFLT FAR *lpXfrBuf, DWORD ulXfrLen) 
{
/********************************************************************/
/* Note: There appears to be no advantage in expanding window first */
/********************************************************************/
float flWinLen =1;
//  #define     MINMULSIZ  2
//  #define     MAXMULSIZ  8
    #define     MINMULSIZ  1
    #define     MAXMULSIZ  1
    VISMEMHDL   mhInfHdl;
    CPXFLT FAR *lpInfBuf;
    DWORD       ulInfLen;
    DWORD       uli;

    /********************************************************************/
    /* Allocate "infinite" filter bufffer                               */
    /* If no space, simply leave original in place                      */
    /* Note limit size to 64K until all routines can handle large blks  */
    /********************************************************************/
    if ((VISMEMHDL) NULL == (mhInfHdl = GloAloBlk (GMEM_MOVEABLE, ulXfrLen * sizeof (*lpXfrBuf), 
      MINMULSIZ, min (0x8000L / (ulXfrLen * sizeof (*lpXfrBuf)), MAXMULSIZ), 
      &ulInfLen))) 
        return ((WORD) -1);
    if (NULL == (lpInfBuf = GloMemLck (mhInfHdl))) { 
        GloAloRel (mhInfHdl);
        return ((WORD) -1);
    }
    ulInfLen /= sizeof (*lpInfBuf);

if ((flWinLen <= 0) || (flWinLen > 1)) return ((WORD) -1);
    
    /********************************************************************/
    /* Round infinite FFT point count to power of two                   */
    /********************************************************************/
    ulInfLen = (DWORD) pow (2, (floor (LOGBASTWO (ulInfLen))));

    /********************************************************************/
    /* Duplicate filter and extend with zeros                           */
    /********************************************************************/
    _fmemmove (lpInfBuf, lpXfrBuf, (WORD) (ulXfrLen * sizeof (*lpXfrBuf)));
    for (uli=ulXfrLen; uli < ulInfLen; uli++) 
        lpInfBuf[uli].flRea = lpInfBuf[uli].flImg = 0;       
    
    /********************************************************************/
    /* Transform to time domain & window.                               */
    /* Truncate series and return to frequency domain                   */ 
    /* Note: Use asymetrical Hanning window (tail half of series)       */
    /********************************************************************/
    EffFFTRea ((float FAR *) lpInfBuf, (WORD) ulInfLen, EFFFFTINV);
ulXfrLen = (DWORD) (ulXfrLen * flWinLen);
    for (uli=0; uli < ulXfrLen; uli++) { 
        float   flHanWin = (float) EffFIRWin (usWinTyp, 
                (WORD) ((ulXfrLen * 2) + 1), (WORD) (ulXfrLen + uli));
        lpInfBuf[uli].flRea *= flHanWin;
        lpInfBuf[uli].flImg *= flHanWin;
    }
    for (uli=ulXfrLen; uli < ulInfLen; uli++)
        lpInfBuf[uli].flRea = lpInfBuf[uli].flImg = 0;       
ulXfrLen = (DWORD) (ulXfrLen / flWinLen);
    EffFFTRea ((float FAR *) lpInfBuf, (WORD) ulInfLen, EFFFFTFWD);

    /********************************************************************/
    /* Copy back to source buffer                                       */
    /********************************************************************/
    _fmemmove (lpXfrBuf, lpInfBuf, (WORD) (ulXfrLen * sizeof (*lpXfrBuf)));

    /********************************************************************/
    /********************************************************************/
    GloUnLRel (mhInfHdl);
    return (0);

}
Example #16
0
void scFar*  scFar scCDecl SCmemmove( void scFar*		dst,
									  const void scFar*	src,
									  long				len )
{
	return _fmemmove( dst, src, (size_t)len );
}
void DIR_Make	(char *name,unsigned attr)
{
   struct DIR_rec ds,_far *zgr;
   size_t laenge=sizeof(ds);
   struct find_t fileinfo;
   char buf[30],drive;
   int aktdr;

   DIR_ReleaseAll();

   /* LAUFWERKE EINLESEN */
   /* Wenn laufwerk anwaehlbar, dann existiert es */
   aktdr=_getdrive();
   for(drive=1;drive<27;drive++)
	if(!_chdrive(drive))
	  {
	    sprintf(ds.name,"[ %c:         ]",drive+'A'-1);
	    ds.driveident=1;
	    ds.dirident=0;
	    zgr=_fmalloc(laenge);
	    if (zgr!=NULL)
	      {
		 ds.vorher=DIR_top;
		 DIR_top=zgr;
		 _fmemmove(DIR_top,&ds,laenge);
		 DIR_eintraege++;
	      }
	  }
   _chdrive(aktdr);

   /* SUBDIRS EINLESEN EINLESEN */
   ds.driveident=0;
   ds.dirident=1;
   if (!_dos_findfirst("*.*",_A_SUBDIR,&fileinfo))
    do {
	 if(fileinfo.attrib & _A_SUBDIR)
	    {
	      while (strlen(fileinfo.name)<12)
		strcat(fileinfo.name," ");

	      strcpy(ds.name,"<");
	      strcat(ds.name,fileinfo.name);
	      strcat(ds.name,">");
	      zgr=_fmalloc(laenge);
	      if (zgr!=NULL && strcmp(ds.name,"<.           >"))
	       {
		  ds.vorher=DIR_top;
		  DIR_top=zgr;
		  _fmemmove(DIR_top,&ds,laenge);
		  DIR_eintraege++;
	       }
	    }
       } while(!_dos_findnext(&fileinfo));


   /* FILES EINLESEN */
   ds.driveident=0;
   ds.dirident=0;
   if (!_dos_findfirst(name,attr,&fileinfo))
    do {
	 if(!(fileinfo.attrib & _A_SUBDIR))
	    {  /* Eintrag */
	       while (strlen(fileinfo.name)<12)
		strcat(fileinfo.name," ");

	       strcpy(ds.name," ");
	       strcat(ds.name,fileinfo.name);
	       strcat(ds.name," ");

	       ds.laenge=fileinfo.size;
	       sprintf(buf,"%2.2d/%02.2d/%02.2d",fileinfo.wr_date & 0x1f,
		     (fileinfo.wr_date>>5) & 0x0f,(fileinfo.wr_date>>9)+80);

	       strcpy(ds.datum,buf);
	       zgr=_fmalloc(laenge);
	       if (zgr!=NULL)
		 {
		   ds.vorher=DIR_top;
		   DIR_top=zgr;
		   _fmemmove(DIR_top,&ds,laenge);
		   DIR_eintraege++;
		 }
	    }
	} while(!_dos_findnext(&fileinfo));

}