0bd5f78be338ad929aac1f895f13e9268b0b9255
[claws.git] / src / string_match.h
1 /*
2  * Sylpheed -- regexp pattern matching utilities
3  * Copyright (C) 2001 Thomas Link, Hiroyuki Yamamoto
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef STRING_MATCH_H__
21 #define STRING_MATCH_H__
22
23 /* remove substring matching REXP from TXT. Destructive! */
24 /* for documentation of CFLAGS and EFLAGS see "man regex" */
25 /* returns -1 = not found; N = next find pos */
26 /* if the match is an empty string (e.g. "x\?"), the find position will
27    be increased by 1 */
28 int string_remove_match (char *txt, char *rexp, int cflags, int eflags);
29
30 /* remove all substrings matching REXP from TXT. Destructive! */
31 /* for documentation of CFLAGS and EFLAGS see "man regex" */
32 /* returns position of last replacement (i.e. TXT has been modified up
33    to this position, use this as the starting point for further mangling) */
34 int string_remove_all_matches   (char *txt, char *rexp, int cflags, int eflags);
35
36
37 #endif /* STRING_MATCH_H__ */
38