Revision 725270cb filter/filter.c

View differences:

filter/filter.c
10 10
/**
11 11
 * DOC: Filters
12 12
 *
13
 * You can find sources of filters language in |filter/|
14
 * directory. |filter/config.Y| filter grammar, and basically translates
15
 * source from user into tree of &f_inst structures. These trees are
16
 * later interpreted using code in |filter/filter.c|. Filters internally
17
 * work with values/variables in struct f_val, which contains type of
18
 * value and value.
13
 * You can find sources of the filter language in |filter/|
14
 * directory. File |filter/config.Y| contains filter grammar and basically translates
15
 * the source from user into a tree of &f_inst structures. These trees are
16
 * later interpreted using code in |filter/filter.c|.
19 17
 *
20
 * Filter consists of tree of &f_inst structures, one structure per
21
 * "instruction". Each &f_inst contains code, aux value which is
22
 * usually type of data this instruction operates on, and two generic
23
 * arguments (a1, a2). Some instructions contain pointer(s) to other
24
 * instructions in their (a1, a2) fields.
18
 * A filter is represented by a tree of &f_inst structures, one structure per
19
 * "instruction". Each &f_inst contains @code, @aux value which is
20
 * usually the data type this instruction operates on and two generic
21
 * arguments (@a1, @a2). Some instructions contain pointer(s) to other
22
 * instructions in their (@a1, @a2) fields.
25 23
 *
26
 * Filters use structure &f_val for its variables. Each &f_val
27
 * contains type and value. Types are constants prefixed with %T_. Few
28
 * of types are special; %T_RETURN can be or-ed with type to indicate
29
 * that return from function/from whole filter should be
30
 * forced. Important thing about &f_val s is that they may be copied
31
 * with simple =. That's fine for all currently defined types: strings
24
 * Filters use a &f_val structure for their data. Each &f_val
25
 * contains type and value (types are constants prefixed with %T_). Few
26
 * of the types are special; %T_RETURN can be or-ed with a type to indicate
27
 * that return from a function or from the whole filter should be
28
 * forced. Important thing about &f_val's is that they may be copied
29
 * with a simple |=|. That's fine for all currently defined types: strings
32 30
 * are read-only (and therefore okay), paths are copied for each
33 31
 * operation (okay too).
34 32
 */

Also available in: Unified diff