source: rtems/cpukit/score/src/rbtree.c @ f031df0e

4.115
Last change on this file since f031df0e was f2f63d1, checked in by Alex Ivanov <alexivanov97@…>, on 11/29/12 at 23:14:28

score misc: Score misc: Clean up Doxygen #7 (GCI 2012)

This patch is a task from GCI 2012 which improves the Doxygen
comments in the RTEMS source.

https://google-melange.appspot.com/gci/task/view/google/gci2012/7986214

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/**
2 *  @file
3 *
4 *  @brief Initialize a RBTree Header
5 *  @ingroup ScoreRBTree
6 */
7
8/*
9 *  Copyright (c) 2010 Gedare Bloom.
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 */
15
16#if HAVE_CONFIG_H
17#include "config.h"
18#endif
19
20#include <rtems/system.h>
21#include <rtems/score/address.h>
22#include <rtems/score/rbtree.h>
23#include <rtems/score/isr.h>
24
25void _RBTree_Initialize(
26  RBTree_Control          *the_rbtree,
27  RBTree_Compare_function  compare_function,
28  void                    *starting_address,
29  size_t                   number_nodes,
30  size_t                   node_size,
31  bool                     is_unique
32)
33{
34  size_t      count;
35  RBTree_Node *next;
36
37  /* TODO: Error message? */
38  if (!the_rbtree) return;
39
40  /* could do sanity checks here */
41  _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique);
42
43  count = number_nodes;
44  next  = starting_address;
45  while ( count-- ) {
46    _RBTree_Insert_unprotected(the_rbtree, next);
47    next           = (RBTree_Node *)
48                        _Addresses_Add_offset( (void *) next, node_size );
49  }
50}
Note: See TracBrowser for help on using the repository browser.