bintree_node_init.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*********************** -*- Mode: C -*- ***********************
  2. * File : bintree_node_init.c
  3. *---------------------------------------------------------------
  4. * Description
  5. * ===========
  6. * This operation is called to initialise a "clientnode" ready for
  7. * insertion into a tree. This is only required once after the memory
  8. * for a node has been allocated.
  9. *
  10. * tree - the tree instance to invoke this operation upon
  11. * clientnode - the node to initialise.
  12. *
  13. *---------------------------------------------------------------
  14. * Author : Graeme McKerrell
  15. * Created On : Wed Jan 28 09:57:06 2004
  16. * Status : TESTED
  17. *---------------------------------------------------------------
  18. * HISTORY
  19. * 7-Dec-2004 Graeme McKerrell
  20. * Renamed to the "lub_" namespace
  21. * 5-May-2004 Graeme McKerrell
  22. * updates following review
  23. * 27-Feb-2004 Graeme McKerrell
  24. * Updated to simplify the initialisation of nodes
  25. * 28-Jan-2004 Graeme McKerrell
  26. * Initial version
  27. *---------------------------------------------------------------
  28. * Copyright (C) 2004 3Com Corporation. All Rights Reserved.
  29. **************************************************************** */
  30. #include <assert.h>
  31. #include "private.h"
  32. /*--------------------------------------------------------- */
  33. void lub_bintree_node_init(lub_bintree_node_t * node)
  34. {
  35. assert(node);
  36. if (node) {
  37. node->left = NULL;
  38. node->right = NULL;
  39. }
  40. }
  41. /*--------------------------------------------------------- */