Loading...
Searching...
No Matches
oscap_pcre.h
/*
* Copyright 2023 Red Hat Inc., Durham, North Carolina.
* All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors:
* Evgenii Kolesnikov <ekolesni@redhat.com>
*/
#ifndef OSCAP_PCRE_
#define OSCAP_PCRE_
typedef struct oscap_pcre oscap_pcre_t;
typedef enum {
OSCAP_PCRE_OPTS_NONE = 0x0001,
OSCAP_PCRE_OPTS_UTF8 = 0x0002,
OSCAP_PCRE_OPTS_MULTILINE = 0x0004,
OSCAP_PCRE_OPTS_DOTALL = 0x0008,
OSCAP_PCRE_OPTS_CASELESS = 0x0010,
OSCAP_PCRE_OPTS_NO_UTF8_CHECK = 0x0020,
OSCAP_PCRE_OPTS_PARTIAL = 0x0040,
} oscap_pcre_options_t;
typedef enum {
OSCAP_PCRE_ERR_NOMATCH = -1,
OSCAP_PCRE_ERR_PARTIAL = -2,
OSCAP_PCRE_ERR_BADPARTIAL = -3,
OSCAP_PCRE_ERR_BADUTF8 = -10,
OSCAP_PCRE_ERR_RECURSIONLIMIT = -21,
OSCAP_PCRE_ERR_UNKNOWN = -100,
} oscap_pcre_error_t;
oscap_pcre_t* oscap_pcre_compile(const char *pattern, oscap_pcre_options_t options,
char **errptr, int *erroffset);
int oscap_pcre_exec(const oscap_pcre_t *opcre, const char *subject,
int length, int startoffset, oscap_pcre_options_t options,
int *ovector, int ovecsize);
void oscap_pcre_free(oscap_pcre_t *opcre);
void oscap_pcre_set_match_limit_recursion(oscap_pcre_t *opcre, unsigned long limit);
int oscap_pcre_get_substrings(char *str, int *ofs, oscap_pcre_t *re, int want_substrs, char ***substrings);
void oscap_pcre_err_free(char *err);
#endif
oscap_pcre
Definition oscap_pcre.c:40