Commit 0bcec367 by Richard Kenner

(chain_member_purpose): New function.

From-SVN: r9292
parent df52f991
...@@ -1723,6 +1723,24 @@ chain_member_value (elem, chain) ...@@ -1723,6 +1723,24 @@ chain_member_value (elem, chain)
return 0; return 0;
} }
/* Return nonzero if ELEM is equal to TREE_PURPOSE (TREE_VALUE (CHAIN))
for any piece of chain CHAIN. */
int
chain_member_purpose (elem, chain)
tree elem, chain;
{
while (chain)
{
if (elem == TREE_PURPOSE (TREE_VALUE (chain)))
return 1;
chain = TREE_CHAIN (chain);
}
return 0;
}
/* Return the length of a chain of nodes chained through TREE_CHAIN. /* Return the length of a chain of nodes chained through TREE_CHAIN.
We expect a null pointer to mark the end of the chain. We expect a null pointer to mark the end of the chain.
This is the Lisp primitive `length'. */ This is the Lisp primitive `length'. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment