FOSSology  4.4.0
Open Source License Compliance by Open Source Software
libfossdb.h
1 /*
2  SPDX-FileCopyrightText: © 2011 Hewlett-Packard Development Company, L.P.
3 
4  SPDX-License-Identifier: LGPL-2.1-only
5 */
6 #ifndef LIBFOSSDB_H
7 #define LIBFOSSDB_H
8 
9 #include <stdlib.h>
10 #include <stdio.h>
11 #include <errno.h>
12 #include <unistd.h>
13 #include <string.h>
14 #include <ctype.h>
15 #include <libpq-fe.h>
16 
17 PGconn* fo_dbconnect(char* DBConfFile, char** ErrorBuf);
18 int fo_checkPQcommand(PGconn* pgConn, PGresult* result, char* sql, char* FileID, int LineNumb);
19 int fo_checkPQresult(PGconn* pgConn, PGresult* result, char* sql, char* FileID, int LineNumb);
20 int fo_tableExists(PGconn* pgConn, const char* tableName);
21 
22 #endif /* LIBFOSSDB_H */
PGconn * pgConn
Database connection.
Definition: adj2nest.c:86
PGconn * fo_dbconnect(char *DBConfFile, char **ErrorBuf)
Connect to a database. The default is Db.conf.
Definition: libfossdb.c:29
int fo_checkPQresult(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb)
Check the result status of a postgres SELECT.
Definition: libfossdb.c:170
int fo_tableExists(PGconn *pgConn, const char *tableName)
Check if table exists. Note, this assumes the database name is 'fossology'.
Definition: libfossdb.c:232
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...
Definition: libfossdb.c:204
char * DBConfFile
DB conf file location.
Definition: testRun.c:21