version 1.3, 2015/06/25 17:53:49
|
version 1.4, 2023/03/14 22:36:13
|
Line 12 terms:
|
Line 12 terms:
|
All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
|
|
Copyright 2004 - 2015 | Copyright 2004 - 2023 |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
|
|
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 958 attr struct type * \
|
Line 958 attr struct type * \
|
name##_AVL_FIND(struct name *head, struct type *elm) \ |
name##_AVL_FIND(struct name *head, struct type *elm) \ |
{ \ |
{ \ |
struct type *t = AVL_ROOT(head); \ |
struct type *t = AVL_ROOT(head); \ |
int comp; \ | long comp; \ |
| \ |
while (t) { \ |
while (t) { \ |
comp = cmp(t, elm); \ |
comp = cmp(t, elm); \ |
if (!comp) \ |
if (!comp) \ |
Line 977 name##_AVL_NFIND(struct name *head, struct type *elm)
|
Line 978 name##_AVL_NFIND(struct name *head, struct type *elm)
|
{ \ |
{ \ |
struct type *t = AVL_ROOT(head); \ |
struct type *t = AVL_ROOT(head); \ |
struct type *res = NULL; \ |
struct type *res = NULL; \ |
int comp; \ | long comp; \ |
| \ |
while (t) { \ |
while (t) { \ |
comp = cmp(t, elm); \ |
comp = cmp(t, elm); \ |
if (!comp) \ |
if (!comp) \ |
Line 997 name##_AVL_NEXT(struct name *head, struct type *elm)
|
Line 999 name##_AVL_NEXT(struct name *head, struct type *elm)
|
{ \ |
{ \ |
struct type *t = AVL_ROOT(head); \ |
struct type *t = AVL_ROOT(head); \ |
struct type *res = NULL; \ |
struct type *res = NULL; \ |
int comp; \ | long comp; \ |
| \ |
while (t) { \ |
while (t) { \ |
comp = cmp(t, elm); \ |
comp = cmp(t, elm); \ |
if (comp < 0) { \ |
if (comp < 0) { \ |
Line 1015 name##_AVL_PREV(struct name *head, struct type *elm)
|
Line 1018 name##_AVL_PREV(struct name *head, struct type *elm)
|
{ \ |
{ \ |
struct type *t = AVL_ROOT(head); \ |
struct type *t = AVL_ROOT(head); \ |
struct type *res = NULL; \ |
struct type *res = NULL; \ |
int comp; \ | long comp; \ |
| \ |
while (t) { \ |
while (t) { \ |
comp = cmp(t, elm); \ |
comp = cmp(t, elm); \ |
if (comp > 0) { \ |
if (comp > 0) { \ |
Line 1034 name##_AVL_INSERT(struct name *head, struct type *elm)
|
Line 1038 name##_AVL_INSERT(struct name *head, struct type *elm)
|
struct type *temp, **pt; \ |
struct type *temp, **pt; \ |
struct type **ancestors[AVL_MAX_HEIGHT] = { 0 }; \ |
struct type **ancestors[AVL_MAX_HEIGHT] = { 0 }; \ |
register int i; \ |
register int i; \ |
int comp; \ | long comp; \ |
\ |
\ |
for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT && *pt; i++) { \ |
for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT && *pt; i++) { \ |
temp = *pt; \ |
temp = *pt; \ |
Line 1062 name##_AVL_REMOVE(struct name *head, struct type *elm)
|
Line 1066 name##_AVL_REMOVE(struct name *head, struct type *elm)
|
struct type *temp, *old, **dp, **pt; \ |
struct type *temp, *old, **dp, **pt; \ |
struct type **ancestors[AVL_MAX_HEIGHT] = { 0 }; \ |
struct type **ancestors[AVL_MAX_HEIGHT] = { 0 }; \ |
register int i; \ |
register int i; \ |
int comp, delcnt; \ | int delcnt; \ |
| long comp; \ |
\ |
\ |
for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT; i++) { \ |
for (i = 0, pt = &AVL_ROOT(head); i < AVL_MAX_HEIGHT; i++) { \ |
if (!*pt) \ |
if (!*pt) \ |