FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
libfossdb.h
1 /**************************************************************
2 Copyright (C) 2011 Hewlett-Packard Development Company, L.P.
3 
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License version 2.1 as published by the Free Software Foundation.
7 
8 This library 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 GNU
11 Lesser General Public License for more details.
12 
13 You should have received a copy of the GNU Lesser General Public License
14 along with this library; if not, write to the Free Software Foundation, Inc.0
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 **************************************************************/
17 #ifndef LIBFOSSDB_H
18 #define LIBFOSSDB_H
19 
20 #include <stdlib.h>
21 #include <stdio.h>
22 #include <errno.h>
23 #include <unistd.h>
24 #include <string.h>
25 #include <ctype.h>
26 #include <libpq-fe.h>
27 
28 PGconn* fo_dbconnect(char* DBConfFile, char** ErrorBuf);
29 int fo_checkPQcommand(PGconn* pgConn, PGresult* result, char* sql, char* FileID, int LineNumb);
30 int fo_checkPQresult(PGconn* pgConn, PGresult* result, char* sql, char* FileID, int LineNumb);
31 int fo_tableExists(PGconn* pgConn, const char* tableName);
32 
33 #endif /* LIBFOSSDB_H */
char * DBConfFile
DB conf file location.
Definition: testRun.c:33
int fo_checkPQresult(PGconn *pgConn, PGresult *result, char *sql, char *FileID, int LineNumb)
Check the result status of a postgres SELECT.
Definition: libfossdb.c:181
PGconn * pgConn
Database connection.
Definition: adj2nest.c:98
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:215
int fo_tableExists(PGconn *pgConn, const char *tableName)
Check if table exists. Note, this assumes the database name is &#39;fossology&#39;.
Definition: libfossdb.c:243
PGconn * fo_dbconnect(char *DBConfFile, char **ErrorBuf)
Connect to a database. The default is Db.conf.
Definition: libfossdb.c:40