1 /*
2 Copyright (C) 2020 Siemens AG
3 
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 version 2 as published by the Free Software Foundation.
7 
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 GNU General Public License for more details.
12 
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
16 */
17 
18 /*
19 **
20  * \file
21  * this is provide a dummy values for library function to make ununpack agent standalone
22  */
23 #include "standalone.h"
24 #include <sys/stat.h>
25 #include <stdio.h>
26 #include <glib.h>
27 #include <errno.h>
28 
29 int result = 0;
30 
fo_scheduler_heart(int i)31 void  fo_scheduler_heart(int i){}
fo_scheduler_connect(int * argc,char ** argv,PGconn ** db_conn)32 void  fo_scheduler_connect(int* argc, char** argv, PGconn** db_conn){}
fo_scheduler_disconnect(int retcode)33 void  fo_scheduler_disconnect(int retcode){}
fo_scheduler_next()34 char* fo_scheduler_next(){return(0);}
fo_scheduler_userID()35 int   fo_scheduler_userID(){return(0);}
fo_scheduler_set_special(int option,int value)36 void  fo_scheduler_set_special(int option, int value){}
fo_scheduler_get_special(int option)37 int   fo_scheduler_get_special(int option){return(0);}
fo_sysconfig(const char * sectionname,const char * variablename)38 char* fo_sysconfig(const char* sectionname, const char* variablename){return(0);}
fo_GetAgentKey(PGconn * pgConn,const char * agent_name,long unused,const char * cpunused,const char * agent_desc)39 int   fo_GetAgentKey   (PGconn *pgConn, const char *agent_name, long unused, const char *cpunused, const char *agent_desc){return(0);}
fo_WriteARS(PGconn * pgConn,int ars_pk,int upload_pk,int agent_pk,const char * tableName,const char * ars_status,int ars_success)40 int   fo_WriteARS(PGconn *pgConn, int ars_pk, int upload_pk, int agent_pk,
41                          const char *tableName, const char *ars_status, int ars_success){return(0);}
fo_checkPQcommand(PGconn * pgConn,PGresult * result,char * sql,char * FileID,int LineNumb)42 int     fo_checkPQcommand(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb){return(0);}
fo_checkPQresult(PGconn * pgConn,PGresult * result,char * sql,char * FileID,int LineNumb)43 int     fo_checkPQresult(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb){return(0);}
fo_tableExists(PGconn * pgConn,const char * tableName)44 int     fo_tableExists(PGconn *pgConn, const char *tableName){return(0);}
GetUploadPerm(PGconn * pgConn,long UploadPk,int user_pk)45 int     GetUploadPerm(PGconn *pgConn, long UploadPk, int user_pk){return(10);}
fo_CreateARSTable(PGconn * pgConn,const char * tableName)46 int     fo_CreateARSTable(PGconn* pgConn, const char* tableName){return(0);}
47 
PQresultStatus(const PGresult * res)48 int   PQresultStatus(const PGresult *res){ return(PGRES_COMMAND_OK);}
PQresultErrorMessage(const PGresult * res)49 char* PQresultErrorMessage(const PGresult *res){return(0);}
PQresultErrorField(const PGresult * res,int fieldcode)50 char* PQresultErrorField(const PGresult *res, int fieldcode){return(0);}
PQntuples(const PGresult * res)51 int   PQntuples(const PGresult *res){return(1);}
PQexec(PGconn * conn,const char * query)52 PGresult *PQexec(PGconn *conn, const char *query){return(0);}
PQclear(PGresult * res)53 void  PQclear(PGresult *res){}
PQgetvalue(const PGresult * res,int tup_num,int field_num)54 char* PQgetvalue(const PGresult *res, int tup_num, int field_num){return("1");}
PQescapeStringConn(PGconn * conn,char * to,const char * from,size_t length,int * error)55 size_t PQescapeStringConn(PGconn *conn,
56                    char *to, const char *from, size_t length, int *error){*error=0;return(0);}
PQfinish(PGconn * conn)57 void  PQfinish(PGconn *conn){}
58 
PQsetNoticeProcessor(PGconn * pgConn,char * SQLNoticeProcessor,char * SQL)59 void  PQsetNoticeProcessor(PGconn *pgConn, char *SQLNoticeProcessor, char *SQL){}
60 
fo_RepMkPath(char * Type,char * Filename)61 char*   fo_RepMkPath (char *Type, char *Filename){return(0);}
fo_RepExist(char * Type,char * Filename)62 int   fo_RepExist(char* Type, char* Filename){return 1;}
fo_RepExist2(char * Type,char * Filename)63 int   fo_RepExist2(char* Type, char* Filename){return 0;}
fo_RepImport(char * Source,char * Type,char * Filename,int HardLink)64 int   fo_RepImport(char* Source, char* Type, char* Filename, int HardLink){return 0;}
65