cfengine  3.15.4
About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version.
  Fossies Dox: cfengine-3.15.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

matching.h
Go to the documentation of this file.
1 /*
2  Copyright 2019 Northern.tech AS
3 
4  This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
5 
6  This program is free software; you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by the
8  Free Software Foundation; version 3.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
18 
19  To the extent this program is licensed as part of the Enterprise
20  versions of CFEngine, the applicable Commercial Open Source License
21  (COSL) may apply to this file if you as a licensee so wish it. See
22  included file COSL.txt.
23 */
24 
25 #ifndef CFENGINE_MATCHING_H
26 #define CFENGINE_MATCHING_H
27 
28 #include <cf3.defs.h>
29 
30 bool IsRegex(const char *str); /* Pure */
31 bool IsRegexItemIn(const EvalContext *ctx, const Item *list, const char *regex); /* Uses context */
32 
33 char *ExtractFirstReference(const char *regexp, const char *teststring); /* Pure, not thread-safe */
34 
35 bool IsPathRegex(const char *str); /* Pure */
36 bool HasRegexMetaChars(const char *string);
37 void EscapeRegexChars(char *str, char *strEsc, int strEscSz); /* Pure */
38 void EscapeSpecialChars(const char *str, char *strEsc, int strEscSz, char *noEscseq, char *noEsclist); /* Pure */
39 size_t EscapeRegexCharsLen(const char *str); /* Pure */
40 char *EscapeChar(char *str, int strSz, char esc); /* Pure */
41 void AnchorRegex(const char *regex, char *out, int outSz); /* Pure */
42 
43 /**
44  result is malloced
45  */
46 char *AnchorRegexNew(const char *regex);
47 
48 #endif // MATCHING_H
void EscapeRegexChars(char *str, char *strEsc, int strEscSz)
Definition: matching.c:331
bool IsPathRegex(const char *str)
Definition: matching.c:192
size_t EscapeRegexCharsLen(const char *str)
Definition: matching.c:310
void AnchorRegex(const char *regex, char *out, int outSz)
Definition: matching.c:383
char * ExtractFirstReference(const char *regexp, const char *teststring)
Definition: matching.c:69
void EscapeSpecialChars(const char *str, char *strEsc, int strEscSz, char *noEscseq, char *noEsclist)
Definition: matching.c:264
bool IsRegexItemIn(const EvalContext *ctx, const Item *list, const char *regex)
Definition: matching.c:235
bool HasRegexMetaChars(const char *string)
Definition: matching.c:408
bool IsRegex(const char *str)
Definition: matching.c:96
char * AnchorRegexNew(const char *regex)
Definition: matching.c:395
char * EscapeChar(char *str, int strSz, char esc)
Definition: matching.c:356
Definition: item_lib.h:33