FOSSology  4.4.0
Open Source License Compliance by Open Source Software
nomos_regex.h
1 /*
2  SPDX-FileCopyrightText: © 2006-2009 Hewlett-Packard Development Company, L.P.
3  SPDX-FileCopyrightText: © 2014 Siemens AG
4 
5  SPDX-License-Identifier: GPL-2.0-only
6 */
7 
8 #ifndef _NOMOS_REGEX_H
9 #define _NOMOS_REGEX_H
10 #include <regex.h>
11 #include <ctype.h>
12 #include "nomos.h"
13 #include "util.h"
14 #include <_autodefs.h>
15 
16 extern regex_t regc[NFOOTPRINTS];
17 
18 void regexError(int ret, regex_t *regc, char *regex);
19 int endsIn(char *s, char *suffix);
20 int lineInFile(char *pathname, char *regex);
21 int textInFile(char *pathname, char *regex, int flags);
22 int strGrep(char *regex, char *data, int flags);
23 int idxGrep(int index, char *data, int flags);
24 int idxGrep_recordPosition(int index, char *data, int flags);
25 int idxGrep_recordPositionDoctored(int index, char *data, int flags);
26 int idxGrep_recordIndex(int index, char *data, int flags);
27 int idxGrep_base(int index, char *data, int flags, int mode);
28 int strNbuf(char *data, char *str);
29 int strNbuf_noGlobals(char *data, char *str , regmatch_t* matchPos, int doSave , char* saveData);
30 int matchOnce(int isPlain,char *data, char* regex, regex_t *rp, regmatch_t* regmatch );
31 regmatch_t* getRegmatch_t(GArray* in,int index);
32 void rememberWhatWeFound(GArray* highlight, GArray* regmatch_tArray, int index, int mode);
33 void recordIndex(GArray* indexList, int index);
34 
35 #endif /* _NOMOS_REGEX_H */
int s
The socket that the CLI will use to communicate.
Definition: fo_cli.c:37
Nomos header file.
int idxGrep_base(int index, char *data, int flags, int mode)
compile a regex, and perform the search (on data?)
Definition: nomos_regex.c:324
regmatch_t * getRegmatch_t(GArray *in, int index)
From a given array, get regex match from a given index.
Definition: nomos_regex.c:473
int idxGrep_recordPosition(int index, char *data, int flags)
compile a regex, perform the search and record findings
Definition: nomos_regex.c:220
int idxGrep(int index, char *data, int flags)
compile a regex, and perform the search (on data?)
Definition: nomos_regex.c:205
int lineInFile(char *pathname, char *regex)
Check if a line exists in a file.
Definition: nomos_regex.c:81
void recordIndex(GArray *indexList, int index)
Add a given index to index list.
Definition: nomos_regex.c:452
int strGrep(char *regex, char *data, int flags)
General-purpose grep function, used for one-time-only searches.
Definition: nomos_regex.c:139
int idxGrep_recordPositionDoctored(int index, char *data, int flags)
compile a regex, perform the search and record findings
Definition: nomos_regex.c:241
int strNbuf(char *data, char *str)
Check if a string exists in buffer (case insensitive)
Definition: nomos_regex.c:528
int strNbuf_noGlobals(char *data, char *str, regmatch_t *matchPos, int doSave, char *saveData)
This is our own internal, case-insensitive version of strstr().
Definition: nomos_regex.c:538
int matchOnce(int isPlain, char *data, char *regex, regex_t *rp, regmatch_t *regmatch)
Perform a regex match on a given data and return only first match.
Definition: nomos_regex.c:282
int endsIn(char *s, char *suffix)
Check if a string ends with given suffix.
Definition: nomos_regex.c:56
void regexError(int ret, regex_t *regc, char *regex)
Log an error caused by regex.
Definition: nomos_regex.c:38
int idxGrep_recordIndex(int index, char *data, int flags)
compile a regex, perform the search and record index
Definition: nomos_regex.c:263
int textInFile(char *pathname, char *regex, int flags)
Check if a regex passes in a file.
Definition: nomos_regex.c:100
void rememberWhatWeFound(GArray *highlight, GArray *regmatch_tArray, int index, int mode)
Store regex matches in highlight array.
Definition: nomos_regex.c:485