]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/breg.h
kes Correctly detect Ubuntu systems, and add ubuntu platform directory.
[bacula/bacula] / bacula / src / lib / breg.h
index 9c1e50a8c7d6c0dbc4dbafa7cf3f5ecabc817090..27ddfbbd1fe1dc59fdcdccd86a8d9ab544d4cec1 100644 (file)
@@ -12,8 +12,8 @@
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
  * free_bregexp(breg);
  */
 
+#define BREG_NREGS 11
+
 /*
  * Structure for BREGEXP ressource
  */
 class BREGEXP {
 public:
-   POOLMEM *result;            /* match result */
-   bool success;               /* match is ok */
+   POOLMEM *result;             /* match result */
+   bool success;                /* match is ok */
 
    char *replace(const char *fname); /* return this.result */
    void debug();
 
    /* private */
-   POOLMEM *expr;              /* search epression */
-   POOLMEM *subst;             /* substitution */
-   regex_t preg;               /* regex_t result of regcomp() */
-   struct re_registers regs;   /* contains match */
-   char *eor;                  /* end of regexp in expr */
-
-   int *_regs_match;
-   
+   POOLMEM *expr;               /* search epression */
+   POOLMEM *subst;              /* substitution */
+   regex_t preg;                /* regex_t result of regcomp() */
+   regmatch_t regs[BREG_NREGS]; /* contains match */
+   char *eor;                   /* end of regexp in expr */
+
    char *return_fname(const char *fname, int len); /* return fname as result */
-   char *edit_subst(const char *fname, struct re_registers *regs);
-   int compute_dest_len(const char *fname, struct re_registers *regs);
+   char *edit_subst(const char *fname, regmatch_t regs[]);
+   int compute_dest_len(const char *fname, regmatch_t regs[]);
    bool extract_regexp(const char *motif);
 };
 
@@ -100,20 +100,20 @@ void free_bregexps(alist *bregexps); /* you have to free alist */
 
 /* get regexp size */
 int bregexp_get_build_where_size(char *strip_prefix, 
-                                char *add_prefix, 
-                                char *add_suffix);
+                                 char *add_prefix, 
+                                 char *add_suffix);
 
 /* get a bregexp string from user arguments 
  * you must allocate it with bregexp_get_build_where_size();
  */
 char *bregexp_build_where(char *dest, int str_size,
-                         char *strip_prefix, 
+                          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);
+char *bregexp_escape_string(char *dest, const char *src, const char sep);
 
 #endif /* __BREG_H_ */