7 /* token list search operators
11 /* TOK822 *tok822_find_type(head, type)
15 /* TOK822 *tok822_rfind_type(tail, type)
19 /* This module implements token list search operations.
21 /* tok822_find_type() searches a list of tokens for the first
22 /* instance of the specified token type. The result is the
23 /* found token or a null pointer when the search failed.
25 /* tok822_rfind_type() searches a list of tokens in reverse direction
26 /* for the first instance of the specified token type. The result
27 /* is the found token or a null pointer when the search failed.
31 /* The Secure Mailer license must be distributed with this software.
34 /* IBM T.J. Watson Research
36 /* Yorktown Heights, NY 10598, USA
43 /* Utility library. */
51 /* tok822_find_type - find specific token type, forward search */
53 TOK822
*tok822_find_type(TOK822
*head
, int op
)
57 for (tp
= head
; tp
!= 0 && tp
->type
!= op
; tp
= tp
->next
)
62 /* tok822_rfind_type - find specific token type, backward search */
64 TOK822
*tok822_rfind_type(TOK822
*tail
, int op
)
68 for (tp
= tail
; tp
!= 0 && tp
->type
!= op
; tp
= tp
->prev
)