]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: pattern: The function "pattern_register()" is no longer used.
authorThierry FOURNIER <tfournier@exceliance.fr>
Mon, 27 Jan 2014 16:20:07 +0000 (17:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 17 Mar 2014 17:06:07 +0000 (18:06 +0100)
Remove the function "pattern_register()" and its prototype because it
is no longer used.

include/proto/pattern.h
src/pattern.c

index 830630b24993bdbce25192a17619c4ba9aefc4fb..bccac653f40a11e0157ce8b2eb3c67bc62753e66 100644 (file)
 #include <common/standard.h>
 #include <types/pattern.h>
 
-/* parse the <args> with <expr> compliant parser. <pattern> is a context for
- * the current parsed acl. It must initialized at NULL:
- *
- *    struct pattern *pattern = NULL
- *    pattern_register(..., &pattern, ...);
- *
- * patflag are a lot of 'PAT_F_*' flags pattern compatible. see
- * <types/acl.h>.
- *
- * The function returns 1 if the processing is ok, return 0
- * if the parser fails, with <err> message filled.
- */
-int pattern_register(struct pattern_head *head, int unique_id, int refflags, const char *arg, struct sample_storage *smp, int patflags, char **err);
 void pattern_finalize_config(void);
 
 /* return the PAT_MATCH_* index for match name "name", or < 0 if not found */
index 8625048901710919edc700bb0251377c0c99cffc..e4a6b0b981c1c825307b19311ac246cd748f878a 100644 (file)
@@ -2014,44 +2014,6 @@ struct pattern_expr *pattern_new_expr(struct pattern_head *head, struct pat_ref
        return expr;
 }
 
-/* return 1 if the process is ok
- * return -1 if the parser fail. The err message is filled.
- * return -2 if out of memory
- */
-int pattern_register(struct pattern_head *head,
-                     int unique_id, int refflags,
-                     const char *arg,
-                     struct sample_storage *smp,
-                     int patflags, char **err)
-{
-       struct pattern_expr *expr;
-       struct pat_ref *ref;
-
-       /* Look if the unique id already exists. If exists, abort the acl creation. */
-       if (unique_id >= 0) {
-               ref = pat_ref_lookupid(unique_id);
-               if (ref) {
-                       memprintf(err, "The unique id \"%d\" is already used.", unique_id);
-                       return 0;
-               }
-       }
-
-       /* Create new reference. */
-       ref = pat_ref_newid(unique_id, refflags);
-       if (!ref) {
-               memprintf(err, "out of memory");
-               return 0;
-       }
-
-       /* create new pattern_expr. */
-       expr = pattern_new_expr(head, ref, err);
-       if (!expr)
-               return 0;
-
-       /* Index value. */
-       return pattern_add(expr, arg, smp, patflags, err);
-}
-
 /* Reads patterns from a file. If <err_msg> is non-NULL, an error message will
  * be returned there on errors and the caller will have to free it.
  */