1 /* ----------------------------------------------------------------------- *
3 * Copyright 2001-2007 H. Peter Anvin - All Rights Reserved
5 * This program is free software available under the same license
6 * as the "OpenBSD" operating system, distributed at
7 * http://www.openbsd.org/.
9 * ----------------------------------------------------------------------- */
14 * Prototypes for regular-expression based filename remapping.
25 /* This is called when we encounter a substitution like \i. The
26 macro character is passed as the first argument; the output buffer,
27 if any, is passed as the second argument. The function should return
28 the number of characters output, or -1 on failure. */
29 typedef int (*match_pattern_callback
) (char, char *);
31 /* Read a rule file */
32 struct rule
*parserulefile(FILE *);
34 /* Destroy a rule file data structure */
35 void freerules(struct rule
*);
37 /* Execute a rule set on a string; returns a malloc'd new string. */
38 char *rewrite_string(const char *, const struct rule
*, char,
39 match_pattern_callback
, const char **);
41 #endif /* WITH_REGEX */
42 #endif /* TFTPD_REMAP_H */