Lines Matching defs:chain

33 /** global chain. */
37 * @param chain the current chain or NULL for new chain
41 * @return newest filter in chain
44 filter_create_ext(struct filter * chain, const char *cmd,
61 if (chain != NULL) {
62 /* append f to end of chain */
63 while (chain->next)
64 chain = chain->next;
65 chain->next = f;
90 * @param chain the current chain or NULL for new chain
95 * @return newest filter in chain
98 filter_create_int(struct filter * chain,
115 if (chain != NULL) {
116 /* append f to end of chain */
117 while (chain->next)
118 chain = chain->next;
119 chain->next = f;
124 /** Fork and exec entire filter chain.
125 * @param chain The head of the chain.
129 filter_apply_chain(struct filter * chain)
134 * Tricky recursion, since we want to begin the chain at the END.
138 if (chain)
139 filter_apply_chain(chain->next);
144 * Now we are the right-most unprocessed link in the chain.
176 if (chain->filter_func) {
177 if (chain->filter_func(chain) == -1)
181 execvp(chain->argv[0],
182 (char **const) (chain->argv));
184 chain->argv[0]);
199 /** Truncate the chain to max_len number of filters.
200 * @param chain the current chain.
201 * @param max_len the maximum length of the chain.
202 * @return the resulting length of the chain.
205 filter_truncate(struct filter * chain, int max_len)
209 if (!chain)
212 while (chain->next && len < max_len) {
213 chain = chain->next;
217 chain->next = NULL;
221 /** Splits the chain in order to write to a header file.
227 filter_tee_header(struct filter * chain)
240 write_header = (chain->extra != NULL);
244 * through the running chain. Then create a new pipe to the H file as
245 * stdout, and fork the rest of the chain again.
253 if (freopen((char *) chain->extra, "w", stdout) == NULL)
256 filter_apply_chain(chain->next);
313 (char *) chain->extra);
317 (char *) chain->extra);
341 filter_fix_linedirs(struct filter * chain)
349 if (!chain)