]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/patches/testing/breg.h
ebl update
[bacula/bacula] / bacula / patches / testing / breg.h
index 606575af8472f6e9261b13b32bd1cc511c7dcf81..101f50eee6617c276576f9205da621e02a23b168 100644 (file)
@@ -60,7 +60,9 @@
 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 */
@@ -90,9 +92,20 @@ void free_bregexp(BREGEXP *script);
 /* 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_ */