Update version for release
[tftp-hpa.git] / tftpd / remap.h
blob53150741bbefbd4ec95962500583c34c8a7a9339
1 /* $Id$ */
2 /* ----------------------------------------------------------------------- *
3 *
4 * Copyright 2001 H. Peter Anvin - All Rights Reserved
6 * This program is free software available under the same license
7 * as the "OpenBSD" operating system, distributed at
8 * http://www.openbsd.org/.
10 * ----------------------------------------------------------------------- */
13 * remap.h
15 * Prototypes for regular-expression based filename remapping.
18 #ifndef TFTPD_REMAP_H
19 #define TFTPD_REMAP_H
21 /* Opaque type */
22 struct rule;
24 #ifdef WITH_REGEX
26 /* This is called when we encounter a substitution like \i. The
27 macro character is passed as the first argument; the output buffer,
28 if any, is passed as the second argument. The function should return
29 the number of characters output, or -1 on failure. */
30 typedef int (*match_pattern_callback)(char, char *);
32 /* Read a rule file */
33 struct rule *parserulefile(FILE *);
35 /* Destroy a rule file data structure */
36 void freerules(struct rule *);
38 /* Execute a rule set on a string; returns a malloc'd new string. */
39 char *rewrite_string(const char *, const struct rule *, int,
40 match_pattern_callback, const char **);
42 #endif /* WITH_REGEX */
43 #endif /* TFTPD_REMAP_H */