![]() |
FOSSology
4.5.1
Open Source License Compliance by Open Source Software
|
Regular expression scanning agent. Tutorial sample code. More...
#include <stdlib.h>#include <stdio.h>#include <unistd.h>#include <string.h>#include <ctype.h>#include <signal.h>#include <libgen.h>#include <regex.h>#include <stdbool.h>#include "libfossology.h"
Go to the source code of this file.
Macros | |
| #define | MAXCMD 4096 |
| #define | myBUFSIZ 2048 |
Functions | |
| int | regexScan (regex_t *regex, char *regexStr, FILE *scanFilePtr, char *fileName) |
| Scan a file for a regex - regular expression. the regex is compiled in this function for performance. More... | |
| int | pfileNumToNames (char *pfileNum, char *pfileRepoName, char *pfileRealName) |
| Creates filenames from pfile_pk value. More... | |
| int | regexScanUpload (char *uploadNum, char *regexStr) |
| Scan an Upload for a regex - regular expression. gets a list of files in an upload and calls regexScan() More... | |
| void | Usage (char *Name) |
| Usage description for this regexscan agent. More... | |
| int | main (int argc, char *argv[]) |
Variables | |
| char | SQL [256] |
| For DB. More... | |
| PGconn * | pgConn = NULL |
| Database connection. More... | |
| int pfileNumToNames | ( | char * | pfileNum, |
| char * | pfileRepoName, | ||
| char * | pfileRealName | ||
| ) |
Creates filenames from pfile_pk value.
| pfileNum | string containing pfile_pk value |
| pfileRepoName | string with repo path and filename |
| pfileRealName | string with original filename |
Definition at line 141 of file regexscan.c.
| int regexScan | ( | regex_t * | regex, |
| char * | regexStr, | ||
| FILE * | scanFilePtr, | ||
| char * | fileName | ||
| ) |
Scan a file for a regex - regular expression.
the regex is compiled in this function for performance.
| regex | holds the compiled regular expression |
| regexStr | string containing the regex |
| scanFilePtr | handle for file to scan |
| fileName | string name of file to scan |
Definition at line 79 of file regexscan.c.
| int regexScanUpload | ( | char * | uploadNum, |
| char * | regexStr | ||
| ) |
Scan an Upload for a regex - regular expression.
gets a list of files in an upload and calls regexScan()
| uploadNum | string containing upload_pk value |
| regexStr | string containing the regex |
Definition at line 190 of file regexscan.c.
| void Usage | ( | char * | Name | ) |
Usage description for this regexscan agent.
Say how to run this program.
| Name | Path of the binary |
Definition at line 294 of file regexscan.c.
| PGconn* pgConn = NULL |
| char SQL[256] |