home *** CD-ROM | disk | FTP | other *** search
- #include "MPP.h"
-
- extern struct List ForcedEditList;
- extern struct MPMessage *ForcedEditMsg;
-
-
- extern struct MPSem *MPSem;
- extern LONG LVActive, NodeCnt;
- extern UWORD CurrentList;
-
- struct DefaultNode *GetActiveNode(void)
- {
- struct Node *n;
- ULONG active;
-
- if(ForcedEditMsg)
- {
- n=(struct Node *)ForcedEditMsg->Data;
- }
- else
- {
- active=LVActive;
- if(IsListEmpty(&MPSem->PromotionList[CurrentList]))
- n=NULL;
- else
- {
- n=MPSem->PromotionList[CurrentList].lh_Head;
- while(active>0 && n->ln_Succ)
- {
- n=n->ln_Succ;
- active--;
- }
- if(!n->ln_Succ)
- {
- LVActive=0;
- n=MPSem->PromotionList[CurrentList].lh_Head;
- }
- }
- }
- return((struct DefaultNode *)n);
- }
-
- LONG CountNodes(struct List *List)
- {
- struct Node *n;
- LONG nodecnt=0;
-
- //NodeCnt=0;
- //n=(struct DefaultNode *)(MPSem->PromotionList[CurrentList].lh_Head);
- n=List->lh_Head;
- while(n->ln_Succ)
- {
- n=n->ln_Succ;
- nodecnt++;
- }
- return(nodecnt);
- }
-