mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
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:
parent
3534d881bc
commit
aa222aadb6
@ -28,19 +28,6 @@
|
|||||||
#include <common/standard.h>
|
#include <common/standard.h>
|
||||||
#include <types/pattern.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);
|
void pattern_finalize_config(void);
|
||||||
|
|
||||||
/* return the PAT_MATCH_* index for match name "name", or < 0 if not found */
|
/* return the PAT_MATCH_* index for match name "name", or < 0 if not found */
|
||||||
|
@ -2014,44 +2014,6 @@ struct pattern_expr *pattern_new_expr(struct pattern_head *head, struct pat_ref
|
|||||||
return expr;
|
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
|
/* 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.
|
* be returned there on errors and the caller will have to free it.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user