/*++ /* NAME /* tok822_tree 3 /* SUMMARY /* assorted token tree operators /* SYNOPSIS /* #include <tok822.h> /* /* TOK822 *tok822_append(t1, t2) /* TOK822 *t1; /* TOK822 *t2; /* /* TOK822 *tok822_prepend(t1, t2) /* TOK822 *t1; /* TOK822 *t2; /* /* TOK822 *tok822_cut_before(tp) /* TOK822 *tp; /* /* TOK822 *tok822_cut_after(tp) /* TOK822 *tp; /* /* TOK822 *tok822_unlink(tp) /* TOK822 *tp; /* /* TOK822 *tok822_sub_append(t1, t2) /* TOK822 *t1; /* /* TOK822 *tok822_sub_prepend(t1, t2) /* TOK822 *t1; /* TOK822 *t2; /* /* TOK822 *tok822_sub_keep_before(t1, t2) /* TOK822 *tp; /* /* TOK822 *tok822_sub_keep_after(t1, t2) /* TOK822 *tp; /* /* int tok822_apply(list, type, action) /* TOK822 *list; /* int type; /* int (*action)(TOK822 *token); /* /* int tok822_grep(list, type) /* TOK822 *list; /* int type; /* /* TOK822 *tok822_free_tree(tp) /* TOK822 *tp; /* DESCRIPTION /* This module manipulates trees of token structures. Trees grow /* to the right or downwards. Operators are provided to cut and /* combine trees in various manners. /* /* tok822_append() appends the token list \fIt2\fR to the right /* of token list \fIt1\fR. The result is the last token in \fIt2\fR. /* The appended list inherits the \fIowner\fR attribute from \fIt1\fR. /* The parent node, if any, is not updated. /* /* tok822_prepend() inserts the token list \fIt2\fR to the left /* of token \fIt1\fR. The result is the last token in \fIt2\fR. /* The appended list inherits the \fIowner\fR attribute from \fIt1\fR. /* The parent node, if any, is not updated. /* /* tok822_cut_before() breaks a token list on the left side of \fItp\fR /* and returns the left neighbor of \tItp\fR. /* /* tok822_cut_after() breaks a token list on the right side of \fItp\fR /* and returns the right neighbor of \tItp\fR. /* /* tok822_unlink() disconnects a token from its left and right neighbors /* and returns the left neighbor of \tItp\fR. /* /* tok822_sub_append() appends the token list \fIt2\fR to the right /* of the token list below \fIt1\fR. The result is the last token /* in \fIt2\fR. /* /* tok822_sub_prepend() prepends the token list \fIt2\fR to the left /* of the token list below \fIt1\fR. The result is the last token /* in \fIt2\fR. /* /* tok822_sub_keep_before() keeps the token list below \fIt1\fR on the /* left side of \fIt2\fR and returns the tail of the disconnected list. /* /* tok822_sub_keep_after() keeps the token list below \fIt1\fR on the /* right side of \fIt2\fR and returns the head of the disconnected list. /* /* tok822_apply() applies the specified action routine to all tokens /* matching the given type (to all tokens when a null type is given). /* Processing terminates when the action routine returns a non-zero /* value. The result is the last result returned by the action routine. /* tok822_apply() does not traverse vertical links. /* /* tok822_grep() returns a null-terminated array of pointers to tokens /* matching the specified type (all tokens when a null type is given). /* tok822_grep() does not traverse vertical links. The result must be /* given to myfree(). /* /* tok822_free_tree() destroys a tree of token structures and /* conveniently returns a null pointer. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
/* System library. */
#include <sys_defs.h>
/* Utility library. */
#include <mymalloc.h> #include <vstring.h>
/* Global library. */
#include"tok822.h"
/* tok822_append - insert token list, return end of inserted list */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.