home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d2xx / d282 / rcs.lha / RCS / rcs.zoo / rcs / rsbx.lib / orphanchildren.c < prev    next >
C/C++ Source or Header  |  1989-11-04  |  1KB  |  58 lines

  1. /****** rsbx.lib/OrphanChildren() ********************************************
  2. *
  3. *   NAME
  4. *    OrphanChildren -- Orphan all child processes of this process.
  5. *
  6. *   SYNOPSIS
  7. *    OrphanChildren()
  8. *
  9. *    void OrphanChildren( void );
  10. *
  11. *   FUNCTION
  12. *    This function orphans all child processes of this process and frees
  13. *        the memory used to keep track of the children.
  14. *
  15. *   INPUTS
  16. *
  17. *   RESULT
  18. *
  19. *   NOTES
  20. *
  21. *   SEE ALSO
  22. *    ChildStatus(), CreateFamily(), EmptyMorgue(), LaunchChildl(),
  23. *    LaunchChildv(), OrphanChild(), WaitChild().
  24. *
  25. *   BUGS
  26. *    None Known.
  27. *
  28. ******************************************************************************
  29. *
  30. */
  31.  
  32. #include <rsbx/childtasking.h>
  33.  
  34. void OrphanChildren( void )
  35.     {
  36.     struct ChildNode *node;
  37.  
  38.     Forbid();
  39.     EmptyMorgue();
  40.     DeletePort(_Children->Morgue);
  41.  
  42.     while ((node = (struct ChildNode *)_Children->ChildList.mlh_Head) &&
  43.         node->node.mln_Succ)
  44.         {
  45.         if (node->notice.noticeptr)
  46.             {
  47.             *node->notice.noticeptr = NULL;
  48.             }
  49.         Remove((struct Node *)node);
  50.         FreeMem(node, sizeof(struct ChildNode));
  51.         }
  52.  
  53.     FreeMem(_Children, sizeof(*_Children));
  54.     _Children = NULL;
  55.     
  56.     Permit();
  57.     }
  58.