X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fos_regex%2Fos_pcre2.c;fp=src%2Fos_regex%2Fos_pcre2.c;h=7ea665df178ebb995e024a18dc4010e8e9a52ce5;hp=0000000000000000000000000000000000000000;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b diff --git a/src/os_regex/os_pcre2.c b/src/os_regex/os_pcre2.c new file mode 100644 index 0000000..7ea665d --- /dev/null +++ b/src/os_regex/os_pcre2.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2009 Trend Micro Inc. + * All right reserved. + * + * This program is a free software; you can redistribute it + * and/or modify it under the terms of the GNU General Public + * License (version 2) as published by the FSF - Free Software + * Foundation + */ + +#include +#include +#include + +#include "os_regex.h" + +int OS_Pcre2(const char *pattern, const char *str) +{ + int r_code = 0; + OSPcre2 reg; + + if (OSPcre2_Compile(pattern, ®, PCRE2_UTF | PCRE2_NO_UTF_CHECK | PCRE2_CASELESS)) { + if(OSPcre2_Execute(str, ®)) { + r_code = 1; + } + + OSPcre2_FreePattern(®); + } + + return (r_code); +} +