Category : C Source Code
Archive   : HEAPMAN.ZIP
Filename : MOVEHIGH.C
Output of file : MOVEHIGH.C contained in archive : HEAPMAN.ZIP
#include "mm.h"
MoveHigh(anAdrs, LastHighest)
long *anAdrs, *LastHighest;
/*
Moves blks so that they are contiguous in application heap. Blocks
are copied back to front.
calling params:
ptr to blk to be moved
destination adrs
return params:
modified ptr
err | noErr
Author: Byro
Creation: 01/10/91
Modified: 01/28/91
Revision:
*/
{
char *dst,
*src;
int blockSize,
i;
long *tempPtr;
dataStruct *aBlkPtr;
tempPtr = (long *) *anAdrs;
if (*tempPtr == NIL) /* empty ele */
return(!NO_ERR);
/* get blk size */
aBlkPtr = (dataStruct *) *tempPtr;
blockSize = aBlkPtr->blkSize;
dst = (char *) (LastHighest); /* compute highest byte to copy */
src = (char *) aBlkPtr + blockSize;
if (src == dst)
return(NO_ERR); /* blk already moved! ret */
/* cpy mem back 2 front order */
for (i = ZERO; i <= blockSize; i++)
{
/* cpy a byte at a time */
/* os9 function memcpy(dst, src, 1); */
movmem(src, dst, 1);
dst--;
src--;
}
*tempPtr = (long) ++dst; /* update ptr in mpt ele field */
return(NO_ERR);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/