12 #include "standalone.h"
27 char*
fo_sysconfig(
const char* sectionname,
const char* variablename){
return(0);}
28 int fo_GetAgentKey (PGconn *
pgConn,
const char *agent_name,
long unused,
const char *cpunused,
const char *agent_desc){
return(0);}
30 const char *tableName,
const char *ars_status,
int ars_success){
return(0);}
37 int PQresultStatus(
const PGresult *res){
return(PGRES_COMMAND_OK);}
38 char* PQresultErrorMessage(
const PGresult *res){
return(0);}
39 char* PQresultErrorField(
const PGresult *res,
int fieldcode){
return(0);}
40 int PQntuples(
const PGresult *res){
return(1);}
41 PGresult *PQexec(PGconn *conn,
const char *query){
return(0);}
42 void PQclear(PGresult *res){}
43 char* PQgetvalue(
const PGresult *res,
int tup_num,
int field_num){
return(
"1");}
44 size_t PQescapeStringConn(PGconn *conn,
45 char *to,
const char *from,
size_t length,
int *error){*error=0;
return(0);}
46 void PQfinish(PGconn *conn){}
char SQL[256]
SQL query to execute.
PGconn * pgConn
Database connection.
FUNCTION int fo_CreateARSTable(PGconn *pgConn, const char *tableName)
Create ars table if it doesn't already exist.
char * fo_RepMkPath(const char *Type, char *Filename)
Given a filename, construct the full path to the file.
int fo_RepExist2(char *Type, char *Filename)
Determine if a file exists.
int fo_RepImport(char *Source, char *Type, char *Filename, int Link)
Import a file into the repository.
int fo_RepExist(char *Type, char *Filename)
Determine if a file exists.
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...
void fo_scheduler_set_special(int option, int value)
Sets something special about the agent within the scheduler.
char * fo_sysconfig(const char *sectionname, const char *variablename)
gets a system configuration variable from the configuration data.
int fo_WriteARS(PGconn *pgConn, int ars_pk, int upload_pk, int agent_pk, const char *tableName, const char *ars_status, int ars_success)
Write ars record.
int fo_checkPQresult(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb)
Check the result status of a postgres SELECT.
int fo_scheduler_get_special(int option)
Gets if a particular special attribute is set in the scheduler.
int fo_GetAgentKey(PGconn *pgConn, const char *agent_name, long unused, const char *cpunused, const char *agent_desc)
Get the latest enabled agent key (agent_pk) from the database.
int fo_scheduler_userID()
Gets the id of the user that created the job that the agent is running.
int fo_tableExists(PGconn *pgConn, const char *tableName)
Check if table exists. Note, this assumes the database name is 'fossology'.
char * fo_scheduler_next()
Get the next data to process from the scheduler.
int fo_checkPQcommand(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb)
Check the result status of a postgres commands (not select) If an error occured, write the error to s...
void fo_scheduler_connect(int *argc, char **argv, PGconn **db_conn)
Establish a connection between an agent and the scheduler.
int GetUploadPerm(PGconn *pgConn, long UploadPk, int user_pk)
Get users permission to this upload.
PGconn * db_conn
The connection to Database.
void SQLNoticeProcessor(void *arg, const char *message)
Dummy postgresql notice processor. This prevents Notices from being written to stderr.