MINOR: pattern: The function "pattern_register()" is no longer used.

Remove the function "pattern_register()" and its prototype because it
is no longer used.
This commit is contained in:
Thierry FOURNIER 2014-01-27 17:20:07 +01:00 committed by Willy Tarreau
parent 3534d881bc
commit aa222aadb6
2 changed files with 0 additions and 51 deletions

View File

@ -28,19 +28,6 @@
#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 */

View 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.
*/