Category : C Source Code
Archive   : HEAPMAN.ZIP
Filename : SORTMPT.C

 
Output of file : SORTMPT.C contained in archive : HEAPMAN.ZIP
#include "mm.h"

void SortMPT()

/*
Reorders the master ptr table starting from the highest and down to
the lowest adrs in the table.

calling params:
none

return params:
none
Author: Byro
Creation: 01/10/91
Modified: 01/31/91
Revision:

*/

{
int i;
long *currentAdrs = NIL,
*lastHighest = (long *) A_HIGH_NUMBER,
*thisHndl = NIL;
unsigned long myTemp;

extern long gMPTsize,
*gTableSizeCountAdrs;


/* find the highest adrs in the mpt

Debugger(); */
FindNext(&lastHighest);

/* store highest adrs in gTableSizeCountAdrs field */

currentAdrs = gTableSizeCountAdrs;
currentAdrs++;
/* *currentAdrs = (long) lastHighest; */

while (lastHighest != NIL)
{
/* look for next lowest adrs */

i = 1;
myTemp = (unsigned long) gTableSizeCountAdrs + (i * BYTE_OFFSET);
thisHndl = (long *) myTemp;

while (((long *) *thisHndl != lastHighest) && (i <= gMPTsize))
{
i++;
myTemp = (unsigned long) gTableSizeCountAdrs + (i * BYTE_OFFSET);
thisHndl = (long *) myTemp;
}

*currentAdrs = (long) thisHndl; /* put hndl to next lowest adrs field in current adrs fild */
currentAdrs = thisHndl;
currentAdrs++;
FindNext(&lastHighest);
}
*currentAdrs = NIL; /* set last adrs field to nil */
}


  3 Responses to “Category : C Source Code
Archive   : HEAPMAN.ZIP
Filename : SORTMPT.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/