Mercurial > hg > CbC > CbC_gcc
comparison include/splay-tree.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 /* A splay-tree datatype. | 1 /* A splay-tree datatype. |
2 Copyright (C) 1998-2018 Free Software Foundation, Inc. | 2 Copyright (C) 1998-2020 Free Software Foundation, Inc. |
3 Contributed by Mark Mitchell (mark@markmitchell.com). | 3 Contributed by Mark Mitchell (mark@markmitchell.com). |
4 | 4 |
5 This file is part of GCC. | 5 This file is part of GCC. |
6 | 6 |
7 GCC is free software; you can redistribute it and/or modify it | 7 GCC is free software; you can redistribute it and/or modify it |
56 /* The type of a function which compares two splay-tree keys. The | 56 /* The type of a function which compares two splay-tree keys. The |
57 function should return values as for qsort. */ | 57 function should return values as for qsort. */ |
58 typedef int (*splay_tree_compare_fn) (splay_tree_key, splay_tree_key); | 58 typedef int (*splay_tree_compare_fn) (splay_tree_key, splay_tree_key); |
59 | 59 |
60 /* The type of a function used to deallocate any resources associated | 60 /* The type of a function used to deallocate any resources associated |
61 with the key. */ | 61 with the key. If you provide this function, the splay tree |
62 will take the ownership of the memory of the splay_tree_key arg | |
63 of splay_tree_insert. This function is called to release the keys | |
64 present in the tree when calling splay_tree_delete or splay_tree_remove. | |
65 If splay_tree_insert is called with a key equal to a key already | |
66 present in the tree, the old key and old value will be released. */ | |
62 typedef void (*splay_tree_delete_key_fn) (splay_tree_key); | 67 typedef void (*splay_tree_delete_key_fn) (splay_tree_key); |
63 | 68 |
64 /* The type of a function used to deallocate any resources associated | 69 /* The type of a function used to deallocate any resources associated |
65 with the value. */ | 70 with the value. If you provide this function, the memory of the |
71 splay_tree_value arg of splay_tree_insert is managed similarly to | |
72 the splay_tree_key memory: see splay_tree_delete_key_fn. */ | |
66 typedef void (*splay_tree_delete_value_fn) (splay_tree_value); | 73 typedef void (*splay_tree_delete_value_fn) (splay_tree_value); |
67 | 74 |
68 /* The type of a function used to iterate over the tree. */ | 75 /* The type of a function used to iterate over the tree. */ |
69 typedef int (*splay_tree_foreach_fn) (splay_tree_node, void*); | 76 typedef int (*splay_tree_foreach_fn) (splay_tree_node, void*); |
70 | 77 |