7 #include "scancode.hpp"
14 #define return_sched(retval) \
16 fo_scheduler_disconnect((retval));\
20 int main(
int argc,
char* argv[])
25 bool ignoreFilesWithMimeType;
26 if(!parseCommandLine(argc, argv, scanFlags, ignoreFilesWithMimeType)){
32 if (!databaseHandler.createTables())
34 LOG_FATAL(
"initialization failed \n");
42 if (uploadId == 0)
continue;
49 if (!
processUploadId(state, uploadId, databaseHandler,ignoreFilesWithMimeType))
void setCliOptions(string cliOptions)
setter for command line interface options
int writeARS(int agentId, int arsId, int uploadId, int success, const fo::DbManager &dbManager)
Call C function fo_WriteARS() and translate the arguments.
CopyrightState getState(CliOptions &&cliOptions)
Create a new state for the current agent based on CliOptions.
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.
void bail(int exitval)
Disconnect with scheduler returning an error code and exit.
void fo_scheduler_disconnect(int retcode)
Disconnect the scheduler connection.
void fo_scheduler_heart(int i)
This function must be called by agents to let the scheduler know they are alive and how many items th...
char * fo_scheduler_current()
Get the last read string from the scheduler.
char * fo_scheduler_next()
Get the next data to process from the scheduler.
fo_dbManager * dbManager
fo_dbManager object
#define return_sched(retval)