2 * Copyright (c) 2010 Zmanda, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 as published
6 * by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
18 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
26 char * validate_regexp(const char *regex);
28 /* quote any non-alphanumeric characters in str, so that the result will only
29 * match the original string. If anchor is true, then add ^ and $ to make sure
30 * that substrings will not match. Note that the resulting regular expression
31 * will not work with match_host, match_disk, etc., since those do not technically
32 * support quoting metacharacters */
33 char * clean_regex(const char *str, gboolean anchor);
35 /* Make an Amanda host expression that will match the given string exactly. */
36 char * make_exact_host_expression(const char *host);
38 /* Make an Amanda disk expression that will match the given string exactly. */
39 char * make_exact_disk_expression(const char *disk);
41 int match(const char *regex, const char *str);
43 int match_no_newline(const char *regex, const char *str);
45 char * validate_glob(const char *glob);
47 char * glob_to_regex(const char *glob);
49 int match_glob(const char *glob, const char *str);
51 int match_tar(const char *glob, const char *str);
53 int match_host(const char *glob, const char *host);
55 int match_datestamp(const char *dateexp, const char *datestamp);
57 int match_level(const char *levelexp, const char *level);
59 int match_disk(const char *glob, const char *disk);