From 5ada36c1e4d95098a3da010f1844fed16447ce7a Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 3 Dec 1999 17:35:05 +0000 Subject: Rename libpq++.H to libpq++.h. --- src/interfaces/libpq++/CHANGES | 2 +- src/interfaces/libpq++/Makefile.in | 4 +- src/interfaces/libpq++/libpq++.H | 191 ------------------------------------- src/interfaces/libpq++/libpq++.h | 191 +++++++++++++++++++++++++++++++++++++ 4 files changed, 194 insertions(+), 194 deletions(-) delete mode 100644 src/interfaces/libpq++/libpq++.H create mode 100644 src/interfaces/libpq++/libpq++.h (limited to 'src') diff --git a/src/interfaces/libpq++/CHANGES b/src/interfaces/libpq++/CHANGES index 45ce0d0ac1f..1f75e4d94a4 100644 --- a/src/interfaces/libpq++/CHANGES +++ b/src/interfaces/libpq++/CHANGES @@ -2,7 +2,7 @@ 5/18/1999 - vv --------- -* Rewrote libpq++.H +* Rewrote libpq++.h * Incremented shared library version to 3.0 * Cleaned up makefiles * Made examples use the installed versions of the library and header diff --git a/src/interfaces/libpq++/Makefile.in b/src/interfaces/libpq++/Makefile.in index cf4d35a81fd..f30156f2195 100644 --- a/src/interfaces/libpq++/Makefile.in +++ b/src/interfaces/libpq++/Makefile.in @@ -6,7 +6,7 @@ # Copyright (c) 1994, Regents of the University of California # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.17 1999/09/07 18:10:49 tgl Exp $ +# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.18 1999/12/03 17:35:05 momjian Exp $ # #------------------------------------------------------------------------- @@ -75,7 +75,7 @@ install: install-headers install-lib $(install-shlib-dep) LIBPGXXDIR = libpq++ LIBPGXXHEADERDIR = $(HEADERDIR)/$(LIBPGXXDIR) -MAINHEADER = libpq++.H +MAINHEADER = libpq++.h LIBPGXXHEADERS = pgconnection.h \ pgdatabase.h \ pgtransdb.h \ diff --git a/src/interfaces/libpq++/libpq++.H b/src/interfaces/libpq++/libpq++.H deleted file mode 100644 index 13c4b7ffecf..00000000000 --- a/src/interfaces/libpq++/libpq++.H +++ /dev/null @@ -1,191 +0,0 @@ - -/*------------------------------------------------------------------------- - * - * libpq++.H - * - * - * DESCRIPTION - * C++ client interface to Postgres - * used for building front-end applications - * - * NOTES - * Currently under construction. - * - * Copyright (c) 1994, Regents of the University of California - * - * - *------------------------------------------------------------------------- - */ - -#ifndef LIBPQXX_H -#define LIBPQXX_H - -#include -#include -#include - -extern "C" { -#include "config.h" -#include "postgres.h" -#include "libpq-fe.h" -} - -static char rcsid[] = "$Id: libpq++.H,v 1.7 1999/10/22 19:05:02 momjian Exp $"; - - -// **************************************************************** -// -// PgConnection - a connection made to a postgres backend -// -// **************************************************************** -class PgConnection { -protected: - PGconn* pgConn; // Connection Structures - PGresult* pgResult; // Query Result - int pgCloseConnection; // Flag indicating whether the connection should be closed - ConnStatusType Connect(const char* conninfo); - string IntToString(int); - PgConnection(); - -public: - PgConnection(const char* conninfo); // use reasonable and environment defaults - ~PgConnection(); // close connection and clean up - - ConnStatusType Status(); - int ConnectionBad(); - const char* ErrorMessage(); - - // returns the database name of the connection - const char* DBName(); - - ExecStatusType Exec(const char* query); // send a query to the backend - int ExecCommandOk(const char* query); // send a command and check if it's - int ExecTuplesOk(const char* query); // send a command and check if tuple - PGnotify* Notifies(); -}; - -// **************************************************************** -// -// PgDatabase - a class for accessing databases -// -// **************************************************************** -class PgDatabase : public PgConnection { -protected: - PgDatabase() : PgConnection() {} // Do not connect - -public: - // connect to the database with conninfo - PgDatabase(const char *conninfo) : PgConnection(conninfo) {}; - ~PgDatabase() {}; // close connection and clean up - // query result access - int Tuples(); - int CmdTuples(); - int Fields(); - const char* FieldName(int field_num); - int FieldNum(const char *field_name); - Oid FieldType(int field_num); - Oid FieldType(const char *field_name); - short FieldSize(int field_num); - short FieldSize(const char *field_name); - const char* GetValue(int tup_num, int field_num); - const char* GetValue(int tup_num, const char *field_name); - int GetIsNull(int tup_num, int field_num); - int GetIsNull(int tup_num, const char* field_name); - int GetLength(int tup_num, int field_num); - int GetLength(int tup_num, const char* field_name); - void DisplayTuples(FILE *out = 0, int fillAlign = 1, - const char* fieldSep = "|",int printHeader = 1, int quiet = 0) ; - void PrintTuples(FILE *out = 0, int printAttName = 1, - int terseOutput = 0, int width = 0) ; - - // copy command related access - int GetLine(char* string, int length); - void PutLine(const char* string); - const char *OidStatus(); - int EndCopy(); -}; - - - -// **************************************************************** -// -// PGLargeObject - a class for accessing Large Object in a database -// -// **************************************************************** -class PgLargeObject : public PgConnection { -public: - PgLargeObject(const char* conninfo = 0); // use reasonable defaults and create large object - PgLargeObject(Oid lobjId, const char* conninfo = 0); // use reasonable defaults and open large object - ~PgLargeObject(); // close connection and clean up - - void Create(); - void Open(); - void Close(); - int Read(char* buf, int len); - int Write(const char* buf, int len); - int LSeek(int offset, int whence); - int Tell(); - int Unlink(); - Oid LOid(); - Oid Import(const char* filename); - int Export(const char* filename); - string Status(); -}; - - -// **************************************************************** -// -// PgTransaction - a class for running transactions against databases -// -// **************************************************************** -class PgTransaction : public PgDatabase { -protected: - ExecStatusType BeginTransaction(); - ExecStatusType EndTransaction(); - PgTransaction() : PgDatabase() {} // Do not connect - -public: - PgTransaction(const char* conninfo); // use reasonable & environment defaults - // connect to the database with given environment and database name - PgTransaction(const PgConnection&); - virtual ~PgTransaction(); // close connection and clean up - -}; - - -// **************************************************************** -// -// PgCursor - a class for querying databases using a cursor -// -// **************************************************************** -class PgCursor : public PgTransaction { -protected: - int Fetch(const string& num, const string& dir); - string pgCursor; - PgCursor() : PgTransaction() {} // Do not connect - -public: - PgCursor(const char* dbName, const char* cursor); // use reasonable & environment defaults - // connect to the database with given environment and database name - PgCursor(const PgConnection&, const char* cursor); - virtual ~PgCursor(); // close connection and clean up - - // Commands associated with cursor interface - int Declare(const string& query, int binary = 0); // Declare a cursor with given name - int Fetch(const char* dir = "FORWARD"); // Fetch ALL tuples in given direction - int Fetch(unsigned num, const char* dir = "FORWARD"); // Fetch specified amount of tuples - int Close(); // Close the cursor - - // Accessors to the cursor name - const char* Cursor(); - void Cursor(const string& cursor); -}; - - - -// buffer size -#define BUFSIZE 1024 - -#endif /* LIBPQXX_H */ - - diff --git a/src/interfaces/libpq++/libpq++.h b/src/interfaces/libpq++/libpq++.h new file mode 100644 index 00000000000..5631ded2f77 --- /dev/null +++ b/src/interfaces/libpq++/libpq++.h @@ -0,0 +1,191 @@ + +/*------------------------------------------------------------------------- + * + * libpq++.h + * + * + * DESCRIPTION + * C++ client interface to Postgres + * used for building front-end applications + * + * NOTES + * Currently under construction. + * + * Copyright (c) 1994, Regents of the University of California + * + * + *------------------------------------------------------------------------- + */ + +#ifndef LIBPQXX_H +#define LIBPQXX_H + +#include +#include +#include + +extern "C" { +#include "config.h" +#include "postgres.h" +#include "libpq-fe.h" +} + +static char rcsid[] = "$Id: libpq++.h,v 1.3 1999/12/03 17:35:05 momjian Exp $"; + + +// **************************************************************** +// +// PgConnection - a connection made to a postgres backend +// +// **************************************************************** +class PgConnection { +protected: + PGconn* pgConn; // Connection Structures + PGresult* pgResult; // Query Result + int pgCloseConnection; // Flag indicating whether the connection should be closed + ConnStatusType Connect(const char* conninfo); + string IntToString(int); + PgConnection(); + +public: + PgConnection(const char* conninfo); // use reasonable and environment defaults + ~PgConnection(); // close connection and clean up + + ConnStatusType Status(); + int ConnectionBad(); + const char* ErrorMessage(); + + // returns the database name of the connection + const char* DBName(); + + ExecStatusType Exec(const char* query); // send a query to the backend + int ExecCommandOk(const char* query); // send a command and check if it's + int ExecTuplesOk(const char* query); // send a command and check if tuple + PGnotify* Notifies(); +}; + +// **************************************************************** +// +// PgDatabase - a class for accessing databases +// +// **************************************************************** +class PgDatabase : public PgConnection { +protected: + PgDatabase() : PgConnection() {} // Do not connect + +public: + // connect to the database with conninfo + PgDatabase(const char *conninfo) : PgConnection(conninfo) {}; + ~PgDatabase() {}; // close connection and clean up + // query result access + int Tuples(); + int CmdTuples(); + int Fields(); + const char* FieldName(int field_num); + int FieldNum(const char *field_name); + Oid FieldType(int field_num); + Oid FieldType(const char *field_name); + short FieldSize(int field_num); + short FieldSize(const char *field_name); + const char* GetValue(int tup_num, int field_num); + const char* GetValue(int tup_num, const char *field_name); + int GetIsNull(int tup_num, int field_num); + int GetIsNull(int tup_num, const char* field_name); + int GetLength(int tup_num, int field_num); + int GetLength(int tup_num, const char* field_name); + void DisplayTuples(FILE *out = 0, int fillAlign = 1, + const char* fieldSep = "|",int printHeader = 1, int quiet = 0) ; + void PrintTuples(FILE *out = 0, int printAttName = 1, + int terseOutput = 0, int width = 0) ; + + // copy command related access + int GetLine(char* string, int length); + void PutLine(const char* string); + const char *OidStatus(); + int EndCopy(); +}; + + + +// **************************************************************** +// +// PGLargeObject - a class for accessing Large Object in a database +// +// **************************************************************** +class PgLargeObject : public PgConnection { +public: + PgLargeObject(const char* conninfo = 0); // use reasonable defaults and create large object + PgLargeObject(Oid lobjId, const char* conninfo = 0); // use reasonable defaults and open large object + ~PgLargeObject(); // close connection and clean up + + void Create(); + void Open(); + void Close(); + int Read(char* buf, int len); + int Write(const char* buf, int len); + int LSeek(int offset, int whence); + int Tell(); + int Unlink(); + Oid LOid(); + Oid Import(const char* filename); + int Export(const char* filename); + string Status(); +}; + + +// **************************************************************** +// +// PgTransaction - a class for running transactions against databases +// +// **************************************************************** +class PgTransaction : public PgDatabase { +protected: + ExecStatusType BeginTransaction(); + ExecStatusType EndTransaction(); + PgTransaction() : PgDatabase() {} // Do not connect + +public: + PgTransaction(const char* conninfo); // use reasonable & environment defaults + // connect to the database with given environment and database name + PgTransaction(const PgConnection&); + virtual ~PgTransaction(); // close connection and clean up + +}; + + +// **************************************************************** +// +// PgCursor - a class for querying databases using a cursor +// +// **************************************************************** +class PgCursor : public PgTransaction { +protected: + int Fetch(const string& num, const string& dir); + string pgCursor; + PgCursor() : PgTransaction() {} // Do not connect + +public: + PgCursor(const char* dbName, const char* cursor); // use reasonable & environment defaults + // connect to the database with given environment and database name + PgCursor(const PgConnection&, const char* cursor); + virtual ~PgCursor(); // close connection and clean up + + // Commands associated with cursor interface + int Declare(const string& query, int binary = 0); // Declare a cursor with given name + int Fetch(const char* dir = "FORWARD"); // Fetch ALL tuples in given direction + int Fetch(unsigned num, const char* dir = "FORWARD"); // Fetch specified amount of tuples + int Close(); // Close the cursor + + // Accessors to the cursor name + const char* Cursor(); + void Cursor(const string& cursor); +}; + + + +// buffer size +#define BUFSIZE 1024 + +#endif /* LIBPQXX_H */ + + -- cgit v1.2.3