COUNT GetIndexFromStarShip (QUEUE *pShipQ, HLINK hStarShip) { COUNT Index; Index = 0; while (hStarShip != GetHeadLink (pShipQ)) { HLINK hNextShip; LINK *StarShipPtr; StarShipPtr = LockLink (pShipQ, hStarShip); hNextShip = _GetPredLink (StarShipPtr); UnlockLink (pShipQ, hStarShip); hStarShip = hNextShip; ++Index; } return Index; }
COUNT GetIndexFromStarShip (PQUEUE pShipQ, HSTARSHIP hStarShip) { COUNT Index; Index = 0; while (hStarShip != GetHeadLink (pShipQ)) { HSTARSHIP hNextShip; STARSHIPPTR StarShipPtr; StarShipPtr = LockStarShip (pShipQ, hStarShip); hNextShip = _GetPredLink (StarShipPtr); UnlockStarShip (pShipQ, hStarShip); hStarShip = hNextShip; ++Index; } return (Index); }