source: rtems/cpukit/sapi/src/rbtree.c @ 3db9c820

Last change on this file since 3db9c820 was 3db9c820, checked in by Sebastian Huber <sebastian.huber@…>, on 11/28/20 at 10:16:28

sapi: Canonicalize @defgroup and @file comments

Adjust group identifier and names to be in line with a common pattern.
Use common phrases for the group and file brief descriptions.

Update #3706.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup RTEMSAPIClassicRBTrees
5 *
6 * @brief This source file contains the implementation of
7 *   rtems_rbtree_initialize().
8 */
9
10/*
11 *  Copyright (c) 2010 Gedare Bloom.
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#ifdef HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/rbtree.h>
23#include <rtems/score/address.h>
24
25void rtems_rbtree_initialize(
26  rtems_rbtree_control *the_rbtree,
27  rtems_rbtree_compare  compare,
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  rtems_rbtree_node *next;
36
37  /* could do sanity checks here */
38  rtems_rbtree_initialize_empty( the_rbtree );
39
40  count = number_nodes;
41  next = starting_address;
42
43  while ( count-- ) {
44    rtems_rbtree_insert( the_rbtree, next, compare, is_unique );
45    next = (rtems_rbtree_node *) _Addresses_Add_offset( next, node_size );
46  }
47}
Note: See TracBrowser for help on using the repository browser.