From: Thierry FOURNIER Date: Mon, 27 Jan 2014 16:20:07 +0000 (+0100) Subject: MINOR: pattern: The function "pattern_register()" is no longer used. X-Git-Tag: v1.5-dev23~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa222aadb6ff870cc97ea99640ce5004411f9681;p=thirdparty%2Fhaproxy.git MINOR: pattern: The function "pattern_register()" is no longer used. Remove the function "pattern_register()" and its prototype because it is no longer used. --- diff --git a/include/proto/pattern.h b/include/proto/pattern.h index 830630b249..bccac653f4 100644 --- a/include/proto/pattern.h +++ b/include/proto/pattern.h @@ -28,19 +28,6 @@ #include #include -/* parse the with compliant parser. 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 - * . - * - * The function returns 1 if the processing is ok, return 0 - * if the parser fails, with 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 */ diff --git a/src/pattern.c b/src/pattern.c index 8625048901..e4a6b0b981 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -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 is non-NULL, an error message will * be returned there on errors and the caller will have to free it. */