version 1.2, 2014/01/29 14:16:53
|
version 1.5, 2024/01/22 15:24:28
|
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 - 2014 | 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 649 name##_RB_INSERT(struct name *head, struct type *elm)
|
Line 649 name##_RB_INSERT(struct name *head, struct type *elm)
|
{ \ |
{ \ |
struct type *tmp; \ |
struct type *tmp; \ |
struct type *parent = NULL; \ |
struct type *parent = NULL; \ |
int comp = 0; \ | long comp = 0; \ |
tmp = RB_ROOT(head); \ |
tmp = RB_ROOT(head); \ |
while (tmp) { \ |
while (tmp) { \ |
parent = tmp; \ |
parent = tmp; \ |
Line 679 attr struct type * \
|
Line 679 attr struct type * \
|
name##_RB_FIND(struct name *head, struct type *elm) \ |
name##_RB_FIND(struct name *head, struct type *elm) \ |
{ \ |
{ \ |
struct type *tmp = RB_ROOT(head); \ |
struct type *tmp = RB_ROOT(head); \ |
int comp; \ | long comp; \ |
while (tmp) { \ |
while (tmp) { \ |
comp = cmp(elm, tmp); \ |
comp = cmp(elm, tmp); \ |
if (comp < 0) \ |
if (comp < 0) \ |
Line 698 name##_RB_NFIND(struct name *head, struct type *elm)
|
Line 698 name##_RB_NFIND(struct name *head, struct type *elm)
|
{ \ |
{ \ |
struct type *tmp = RB_ROOT(head); \ |
struct type *tmp = RB_ROOT(head); \ |
struct type *res = NULL; \ |
struct type *res = NULL; \ |
int comp; \ | long comp; \ |
while (tmp) { \ |
while (tmp) { \ |
comp = cmp(elm, tmp); \ |
comp = cmp(elm, tmp); \ |
if (comp < 0) { \ |
if (comp < 0) { \ |
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) \ |