FOSSology  4.7.1
Open Source License Compliance by Open Source Software
ReuserUtils.hpp
Go to the documentation of this file.
1 /*
2  SPDX-License-Identifier: GPL-2.0-only
3  Author: Dietmar Helmut Leher <helmut.leher.ext@vaillant-group.com>
4  SPDX-FileCopyrightText: © 2026 Vaillant GmbH
5 */
6 #pragma once
7 
14 #define AGENT_NAME "reuser"
15 #define AGENT_DESC "reuser agent"
16 #define AGENT_ARS "reuser_ars"
17 
18 #include "ReuserDatabaseHandler.hpp"
19 #include "ReuserState.hpp"
20 #include "ReuserTypes.hpp"
21 #include "libfossologyCPP.hpp"
22 
23 extern "C" {
24 #include "libfossagent.h"
25 #include "libfossscheduler.h"
26 }
27 
30 
33 
35 int writeARS(const ReuserState& state, int arsId, int uploadId, int success,
37 
39 void bail(int exitval);
40 
42 bool processUploadId(const ReuserState& /*state*/, int uploadId,
43  ReuserDatabaseHandler& databaseHandler);
bool processUploadId(const ReuserState &, int uploadId, ReuserDatabaseHandler &databaseHandler)
Process one upload through all active reuse relationships.
Definition: ReuserUtils.cc:60
int queryAgentId(fo::DbManager &dbManager)
Query and register the agent id. Bails on failure.
int writeARS(const ReuserState &state, int arsId, int uploadId, int success, fo::DbManager &dbManager)
Write (insert/update) an ARS record.
Definition: ReuserUtils.cc:47
ReuserState getState(fo::DbManager &dbManager)
Create a ReuserState from the database (registers agent key).
Definition: utils.cc:13
void bail(int exitval)
Disconnect scheduler and exit.
Database handler for the reuser agent.
Holds the runtime state of the reuser agent (agent id).
Definition: ReuserState.hpp:15
DB wrapper for agents.
The main FOSSology CPP library.
fo_dbManager * dbManager
fo_dbManager object
Definition: process.c:16