class BREGEXP {
public:
POOLMEM *result; /* match result */
- char *replace(const char *fname);
+ bool success; /* match is ok */
+
+ char *replace(const char *fname); /* return this.result */
void debug();
/* private */
/* fill an alist with BREGEXP from where */
alist *get_bregexps(const char *where);
-char *apply_bregexps(const char *fname, alist *bregexps);
+/* apply every regexps from the alist */
+bool apply_bregexps(const char *fname, alist *bregexps, char **result);
/* foreach_alist free RUNSCRIPT */
void free_bregexps(alist *bregexps); /* you have to free alist */
+/* get a bregexp string from user arguments */
+char *bregexp_build_where(char *strip_prefix,
+ char *add_prefix,
+ char *add_suffix);
+
+/* escape a string to regexp format (sep and \)
+ * dest must be long enough (dest = 2*src + 1)
+ */
+char *bregexp_escape_string(char *dest, char *src, char sep);
+
#endif /* __BREG_H_ */