18 #ifndef NINKA_AGENT_UTILS_HPP 19 #define NINKA_AGENT_UTILS_HPP 21 #define AGENT_NAME "ninka" 22 #define AGENT_DESC "ninka agent" 23 #define AGENT_ARS "ninka_ars" 28 #include "licensematch.hpp" 40 void bail(
int exitval);
44 bool saveLicenseMatchesToDatabase(
const State& state,
const vector<LicenseMatch>& matches,
unsigned long pFileId,
NinkaDatabaseHandler& databaseHandler);
46 #endif // NINKA_AGENT_UTILS_HPP void bail(int exitval)
Disconnect with scheduler returning an error code and exit.
CopyrightState getState(CliOptions &&cliOptions)
Create a new state for the current agent based on CliOptions.
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.
Class to handle file related operations.
bool processUploadId(const CopyrightState &state, int agentId, int uploadId, CopyrightDatabaseHandler &databaseHandler, bool ignoreFilesWithMimeType)
Process a given upload id, scan from statements and add to database.
The main FOSSology C library.
fo_dbManager * dbManager
fo_dbManager object
int queryAgentId(PGconn *dbConn)
Get agent id, exit if agent id is incorrect.
int writeARS(int agentId, int arsId, int uploadId, int success, const fo::DbManager &dbManager)
Call C function fo_WriteARS() and translate the arguments.
void matchPFileWithLicenses(CopyrightState const &state, int agentId, unsigned long pFileId, CopyrightDatabaseHandler &databaseHandler)
Get the file contents, scan for statements and save findings to database.
Utility functions for file handling.