![]() |
FOSSology
4.6.0-rc1
Open Source License Compliance by Open Source Software
|
Stage 3 demonstration. 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... | |
Stage 3 demonstration.
This is stage 3 and demonstrates the fundamental agent requirements:
Definition in file regexscan-Stage3.c.
| 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 121 of file regexscan-Stage3.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 59 of file regexscan-Stage3.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 169 of file regexscan-Stage3.c.
| void Usage | ( | char * | Name | ) |
Usage description for this regexscan agent.
Say how to run this program.
Definition at line 272 of file regexscan-Stage3.c.
| PGconn* pgConn = NULL |
Database connection.
DB connection.
Database connection.
Definition at line 47 of file regexscan-Stage3.c.
| char SQL[256] |