Lines Matching defs:chain

31 /** global chain. */
35 * @param chain the current chain or NULL for new chain
39 * @return newest filter in chain
41 struct filter *filter_create_ext (struct filter *chain, const char *cmd,
59 if (chain != NULL) {
60 /* append f to end of chain */
61 while (chain->next)
62 chain = chain->next;
63 chain->next = f;
96 * @param chain the current chain or NULL for new chain
101 * @return newest filter in chain
103 struct filter *filter_create_int (struct filter *chain,
121 if (chain != NULL) {
122 /* append f to end of chain */
123 while (chain->next)
124 chain = chain->next;
125 chain->next = f;
131 /** Fork and exec entire filter chain.
132 * @param chain The head of the chain.
135 bool filter_apply_chain (struct filter * chain)
140 /* Tricky recursion, since we want to begin the chain
144 if (chain)
145 filter_apply_chain (chain->next);
149 /* Now we are the right-most unprocessed link in the chain.
179 if (chain->filter_func) {
182 if ((r = chain->filter_func (chain)) == -1)
187 execvp (chain->argv[0],
188 (char **const) (chain->argv));
190 chain->argv[0]);
206 /** Truncate the chain to max_len number of filters.
207 * @param chain the current chain.
208 * @param max_len the maximum length of the chain.
209 * @return the resulting length of the chain.
211 int filter_truncate (struct filter *chain, int max_len)
215 if (!chain)
218 while (chain->next && len < max_len) {
219 chain = chain->next;
223 chain->next = NULL;
227 /** Splits the chain in order to write to a header file.
232 int filter_tee_header (struct filter *chain)
244 write_header = (chain->extra != NULL);
247 * through the running chain. Then create a new pipe to the H file as
248 * stdout, and fork the rest of the chain again.
256 if (freopen ((char *) chain->extra, "w", stdout) == NULL)
259 filter_apply_chain (chain->next);
313 (char *) chain->extra);
317 (char *) chain->extra);
341 int filter_fix_linedirs (struct filter *chain)
349 if (!chain)