1 #ifndef FIO_PARSE_PATTERN_H
2 #define FIO_PARSE_PATTERN_H
7 * Pattern format description. The input for 'parse_pattern'.
8 * Describes format with its name and callback, which should
9 * be called to paste something inside the buffer.
11 struct pattern_fmt_desc {
14 int (*paste)(char *buf, unsigned int len, void *priv);
18 * Pattern format. The output of 'parse_pattern'.
19 * Describes the exact position inside the xbuffer.
23 const struct pattern_fmt_desc *desc;
26 int parse_and_fill_pattern(const char *in, unsigned int in_len,
27 char *out, unsigned int out_len,
28 const struct pattern_fmt_desc *fmt_desc,
29 unsigned int fmt_desc_sz,
30 struct pattern_fmt *fmt,
31 unsigned int *fmt_sz_out);
33 int paste_format_inplace(char *pattern, unsigned int pattern_len,
34 struct pattern_fmt *fmt, unsigned int fmt_sz,
37 int paste_format(const char *pattern, unsigned int pattern_len,
38 struct pattern_fmt *fmt, unsigned int fmt_sz,
39 char *out, unsigned int out_len, void *priv);
41 int cpy_pattern(const char *pattern, unsigned int pattern_len,
42 char *out, unsigned int out_len);
44 int cmp_pattern(const char *pattern, unsigned int pattern_size,
45 unsigned int off, const char *buf, unsigned int len);