HPCToolkit
binarytree.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "binarytree.h"
Include dependency graph for binarytree.c:

Go to the source code of this file.

Macros

#define MAX_SUBTREE_STR   32768
 
#define MAX_LEFT_LEAD_STR   256
 

Functions

static void subtree_tostr2 (binarytree_t *subtree, val_tostr tostr, char valstr[], char *left_lead, char result[])
 
binarytree_tbinarytree_new (size_t size, mem_alloc m_alloc)
 
void binarytree_del (binarytree_t **root, mem_free m_free)
 
void * binarytree_rootval (binarytree_t *tree)
 
binarytree_tbinarytree_leftsubtree (binarytree_t *tree)
 
binarytree_tbinarytree_rightsubtree (binarytree_t *tree)
 
void binarytree_set_leftsubtree (binarytree_t *tree, binarytree_t *subtree)
 
void binarytree_set_rightsubtree (binarytree_t *tree, binarytree_t *subtree)
 
int binarytree_count (binarytree_t *tree)
 
binarytree_tbinarytree_list_to_tree (binarytree_t **head, int count)
 
void binarytree_listify_helper (binarytree_t *root, binarytree_t **tail)
 
binarytree_tbinarytree_listify (binarytree_t *root)
 
binarytree_tbinarytree_listalloc (size_t elt_size, int num_elts, mem_alloc m_alloc)
 
binarytree_tbinarytree_find (binarytree_t *root, val_cmp matches, void *val)
 
void binarytree_tostring (binarytree_t *tree, val_tostr tostr, char valstr[], char result[])
 
void binarytree_tostring_indent (binarytree_t *root, val_tostr tostr, char valstr[], char *indents, char result[])
 
int binarytree_height (binarytree_t *root)
 
binarytree_tbinarytree_insert (binarytree_t *root, val_cmp compare, binarytree_t *key)
 

Macro Definition Documentation

◆ MAX_LEFT_LEAD_STR

#define MAX_LEFT_LEAD_STR   256

Definition at line 84 of file binarytree.c.

◆ MAX_SUBTREE_STR

#define MAX_SUBTREE_STR   32768

Definition at line 83 of file binarytree.c.

Function Documentation

◆ binarytree_count()

int binarytree_count ( binarytree_t tree)

Definition at line 204 of file binarytree.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binarytree_del()

void binarytree_del ( binarytree_t **  root,
mem_free  m_free 
)

Definition at line 150 of file binarytree.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binarytree_find()

binarytree_t* binarytree_find ( binarytree_t root,
val_cmp  matches,
void *  val 
)

Definition at line 257 of file binarytree.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binarytree_height()

int binarytree_height ( binarytree_t root)

Definition at line 305 of file binarytree.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binarytree_insert()

binarytree_t* binarytree_insert ( binarytree_t root,
val_cmp  compare,
binarytree_t key 
)

Definition at line 316 of file binarytree.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binarytree_leftsubtree()

binarytree_t* binarytree_leftsubtree ( binarytree_t tree)

Definition at line 171 of file binarytree.c.

Here is the caller graph for this function:

◆ binarytree_list_to_tree()

binarytree_t* binarytree_list_to_tree ( binarytree_t **  head,
int  count 
)

Definition at line 211 of file binarytree.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binarytree_listalloc()

binarytree_t* binarytree_listalloc ( size_t  elt_size,
int  num_elts,
mem_alloc  m_alloc 
)

Definition at line 245 of file binarytree.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binarytree_listify()

binarytree_t* binarytree_listify ( binarytree_t root)

Definition at line 237 of file binarytree.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ binarytree_listify_helper()

void binarytree_listify_helper ( binarytree_t root,
binarytree_t **  tail 
)

Definition at line 225 of file binarytree.c.

Here is the caller graph for this function:

◆ binarytree_new()

binarytree_t* binarytree_new ( size_t  size,
mem_alloc  m_alloc 
)

Definition at line 141 of file binarytree.c.

Here is the caller graph for this function:

◆ binarytree_rightsubtree()

binarytree_t* binarytree_rightsubtree ( binarytree_t tree)

Definition at line 179 of file binarytree.c.

Here is the caller graph for this function:

◆ binarytree_rootval()

void* binarytree_rootval ( binarytree_t tree)

Definition at line 163 of file binarytree.c.

Here is the caller graph for this function:

◆ binarytree_set_leftsubtree()

void binarytree_set_leftsubtree ( binarytree_t tree,
binarytree_t subtree 
)

Definition at line 186 of file binarytree.c.

Here is the caller graph for this function:

◆ binarytree_set_rightsubtree()

void binarytree_set_rightsubtree ( binarytree_t tree,
binarytree_t subtree 
)

Definition at line 195 of file binarytree.c.

Here is the caller graph for this function:

◆ binarytree_tostring()

void binarytree_tostring ( binarytree_t tree,
val_tostr  tostr,
char  valstr[],
char  result[] 
)

Definition at line 271 of file binarytree.c.

Here is the call graph for this function:

◆ binarytree_tostring_indent()

void binarytree_tostring_indent ( binarytree_t root,
val_tostr  tostr,
char  valstr[],
char *  indents,
char  result[] 
)

Definition at line 278 of file binarytree.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subtree_tostr2()

static void subtree_tostr2 ( binarytree_t subtree,
val_tostr  tostr,
char  valstr[],
char *  left_lead,
char  result[] 
)
static

Definition at line 107 of file binarytree.c.

Here is the caller graph for this function: