8 #ifndef MONK_AGENT_MATCH_H
9 #define MONK_AGENT_MATCH_H
14 #include "string_operations.h"
17 #define MATCH_TYPE_FULL 0
18 #define MATCH_TYPE_DIFF 1
30 int (*onAll)(
MonkState* state,
const File* file,
const GArray* matches);
35 int (*onBetweenIndividualOutputs)(
MonkState* state);
40 void match_array_free(GArray* matches);
41 #define match_array_index(matches, i) (g_array_index(matches, Match*, i))
45 #if GLIB_CHECK_VERSION(2,32,0)
46 void match_destroyNotify(gpointer matchP);
52 GArray* findAllMatchesBetween(
const File* file,
const Licenses* licenses,
unsigned maxAllowedDiff,
unsigned minAdjacentMatches,
unsigned maxLeadingDiff);
58 size_t textStartPosition,
size_t searchStartPosition,
60 unsigned maxAllowedDiff,
unsigned minAdjacentMatches);
62 GArray* filterNonOverlappingMatches(GArray* matches);
63 int match_partialComparator(
const Match* thisMatch,
const Match* otherMatch);
67 char* formatMatchArray(GArray* matchInfo);
void matchPFileWithLicenses(CopyrightState const &state, int agentId, unsigned long pFileId, CopyrightDatabaseHandler &databaseHandler)
Get the file contents, scan for statements and save findings to database.
void matchFileWithLicenses(const string &sContent, unsigned long pFileId, CopyrightState const &state, int agentId, CopyrightDatabaseHandler &databaseHandler)
Scan a given file with all available scanners and save findings to database.
Store the results of a regex match.