Return the memory address where the 'parent' node stores the specified * 'child' pointer, so that the caller can update the pointer with another * one if needed. The function assumes it will find a match, otherwise the * operation is an undefined behavior (it will continue scanning the * memory without any bound checking). */
| 932 | * operation is an undefined behavior (it will continue scanning the |
| 933 | * memory without any bound checking). */ |
| 934 | raxNode **raxFindParentLink(raxNode *parent, raxNode *child) { |
| 935 | raxNode **cp = raxNodeFirstChildPtr(parent); |
| 936 | raxNode *c; |
| 937 | while(1) { |
| 938 | memcpy(&c,cp,sizeof(c)); |
| 939 | if (c == child) break; |
| 940 | cp++; |
| 941 | } |
| 942 | return cp; |
| 943 | } |
| 944 | |
| 945 | /* Low level child removal from node. The new node pointer (after the child |
| 946 | * removal) is returned. Note that this function does not fix the pointer |