1 #ifndef FIO_PARSE_PATTERN_H
2 #define FIO_PARSE_PATTERN_H
5 * Pattern format description. The input for 'parse_pattern'.
6 * Describes format with its name and callback, which should
7 * be called to paste something inside the buffer.
9 struct pattern_fmt_desc {
12 int (*paste)(char *buf, unsigned int len, void *priv);
16 * Pattern format. The output of 'parse_pattern'.
17 * Describes the exact position inside the xbuffer.
21 const struct pattern_fmt_desc *desc;
24 int parse_and_fill_pattern(const char *in, unsigned int in_len,
25 char *out, unsigned int out_len,
26 const struct pattern_fmt_desc *fmt_desc,
27 struct pattern_fmt *fmt,
28 unsigned int *fmt_sz_out);
30 int paste_format_inplace(char *pattern, unsigned int pattern_len,
31 struct pattern_fmt *fmt, unsigned int fmt_sz,
34 int paste_format(const char *pattern, unsigned int pattern_len,
35 struct pattern_fmt *fmt, unsigned int fmt_sz,
36 char *out, unsigned int out_len, void *priv);
38 int cpy_pattern(const char *pattern, unsigned int pattern_len,
39 char *out, unsigned int out_len);
41 int cmp_pattern(const char *pattern, unsigned int pattern_size,
42 unsigned int off, const char *buf, unsigned int len);