Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb14c99d

Browse files
committed
Here it is. Remove or rename the current interfaces/libpq++ and untar
this file in interfaces/It will all need to be checked in. I used the char *rcsid[] method forcvs ids so it can be strings | grep'd to find version numbers. The newversion for the library is 3.0.Run configure from src/ to create the Makefile and it should be good togo.I did minimal documentation references in the README, I'll see if I canget something to Tom Lockhart rather quickly.Vince.
1 parent795f6ca commitb14c99d

28 files changed

+549
-581
lines changed

‎src/interfaces/libpq++/CHANGES

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
5/18/1999 - vv
3+
---------
4+
5+
*Rewrote libpq++.H
6+
*Added CVS IDs
7+
*Incremented shared library version to 3.0
8+
*Cleaned up makefiles
9+
*Made examples use the installed versions of the library and header
10+
11+
12+
4/26/1999 - vv
13+
---------
14+
15+
*Changed PrintTuples and DisplayTuples in PgDatabase to use PQprint()
16+
17+
18+
19+
4/14/1999 - vv
20+
---------
21+
22+
*Changed connection routines to use PQconnectdb()
23+
*Connect now returns CONNECTION_OK or CONNECTION_BAD
24+
*Eliminated pgEnv
25+
*Changed error handler to return proper messages
26+
*New function LOid() returns Large Object ID
27+
*New function Status() returns Large Object Status
28+
29+
30+
31+
32+
33+

‎src/interfaces/libpq++/Makefile.in

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
# Copyright (c) 1994, Regents of the University of California
77
#
88
# IDENTIFICATION
9-
# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.11 1999/01/17 06:19:39 momjian Exp $
9+
# $Header: /cvsroot/pgsql/src/interfaces/libpq++/Attic/Makefile.in,v 1.12 1999/05/23 01:03:57 momjian Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

1313
NAME= pq++
14-
SO_MAJOR_VERSION=2
14+
SO_MAJOR_VERSION=3
1515
SO_MINOR_VERSION= 0
1616

1717
SRCDIR= @top_srcdir@
@@ -42,20 +42,16 @@ ifdef KRBVERS
4242
CXXFLAGS+=$(KRBFLAGS)
4343
endif
4444

45-
OBJS =pgenv.opgconnection.o pgtransdb.o pgcursordb.o pglobject.o
45+
OBJS =pgconnection.opgdatabase.o pgtransdb.o pgcursordb.o pglobject.o
4646

47-
ifeq ($(PORTNAME), win)
48-
SHLIB_LINK+= -L../libpq -lpq -lstdc++
49-
else
5047
SHLIB_LINK= -L../libpq -lpq
51-
endif
5248

5349
# Shared library stuff, also default 'all' target
5450
include$(SRCDIR)/Makefile.shlib
5551

5652

5753
# Pull shared-lib CFLAGS into CXXFLAGS
58-
CXXFLAGS+=$(CFLAGS)
54+
CXXFLAGS+=$(CFLAGS) -Wno-unused
5955

6056

6157
.PHONY: examples
@@ -68,9 +64,8 @@ install: install-headers install-lib $(install-shlib-dep)
6864

6965
LIBPGXXDIR = libpq++
7066
LIBPGXXHEADERDIR =$(HEADERDIR)/$(LIBPGXXDIR)
71-
MAINHEADER = libpq++.h
72-
LIBPGXXHEADERS = pgenv.h\
73-
pgconnection.h\
67+
MAINHEADER = libpq++.H
68+
LIBPGXXHEADERS = pgconnection.h\
7469
pgdatabase.h\
7570
pgtransdb.h\
7671
pgcursordb.h\
@@ -91,9 +86,6 @@ beforeinstall-headers:
9186
clean:
9287
rm -f libpq++.a$(shlib)$(OBJS)
9388
$(MAKE) -C examples clean
94-
ifeq ($(PORTNAME), win)
95-
rm -f pq++.def
96-
endif
9789

9890
depdepend:
9991
$(CXX) -MM$(CXXFLAGS)*.cc>depend

‎src/interfaces/libpq++/README

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
This directory contains libpq++, the C++ language interface to POSTGRESQL.
2-
libpq++ is implemented on of the libpq library. Users would benefit
3-
from reading the chapter on libpq in the PostgreSQL users manual
4-
before using libpq++.
51

6-
The initial version of this implementation was done by William Wanders
7-
(wwanders@sci.kun.nl)
2+
Based on the original work by William Wanders (wwanders@sci.kun.nl)
3+
and Jolly Chen (jolly@cs.berkeley.edu), this is the first set of
4+
changes to libpq++ since ~1997. Pgenv has been removed, deprecated
5+
functions removed and/or updated and error handling rewritten,
6+
however for the most part it remains as a wrapper around libpq.
7+
The documentation on libpq is recommended reading to understand
8+
the function of libpq++.
89

9-
This is only a preliminary attempt at providing something useful for
10-
people who would like to use C++ to build frontend applications to
11-
PostgreSQL. The API provided herein is subject to change in later
12-
versions of PostgreSQL.
10+
The API provided herein is subject to change in later versions of
11+
PostgreSQL.
1312

1413
For details on how to to use libpq++, see the man page in the man/
15-
subdirectory and the test programs in the examples/ subdirectory.
14+
subdirectory and the test programs in the examples/ subdirectory.
1615

17-
libpq++ has been tested with g++, version 2.7.0
16+
** PgConnection has been changed to accept either the environment
17+
variables or conninfo style strings. See the PQconnectdb in the
18+
documentation on libpq for details.
19+
20+
libpq++ has only been tested with g++, version 2.7.2.1
21+
22+
Vince Vielhaber (vev@michvhf.com)
23+
Tue May 18 08:30:00 EDT 1999
1824

19-
- Jolly Chen
20-
jolly@cs.berkeley.edu
2125

22-
Tue Sep 5 11:09:51 PDT 1995

‎src/interfaces/libpq++/TODO

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
*Implement exceptions
3+
*Binary Large Objects segfaulting
4+
*Many other things I have yet to discover
5+
6+

‎src/interfaces/libpq++/dependencies

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,30 @@
22
# Dependencies for libpq++ C++ library for Postgres SQL
33
#
44
# Author: Leo Shuster (lsh@lubrizol.com)
5+
# Updated 18 May 1999 by Vince Vielhaber (vev@michvhf.com)
56
###########################################################################
6-
pgenv.o ::pgenv.cc \
7-
pgenv.h
87

98
pgconnection.o :: pgconnection.cc \
109
pgconnection.h \
11-
pgenv.h \
1210
$(LIBPQDIR)/libpq-fe.h \
1311
$(LIBPQDIR)/fe-auth.h
1412

1513
pgtransdb.o :: pgtransdb.cc \
1614
pgtransdb.h \
1715
pgdatabase.h \
1816
pgconnection.h \
19-
pgenv.h \
2017
$(LIBPQDIR)/libpq-fe.h \
2118
$(LIBPQDIR)/fe-auth.h
2219

2320
pgcursordb.o :: pgcursordb.cc \
2421
pgcursordb.h \
2522
pgdatabase.h \
2623
pgconnection.h \
27-
pgenv.h \
2824
$(LIBPQDIR)/libpq-fe.h \
2925
$(LIBPQDIR)/fe-auth.h
3026

3127
pglobject.o ::pglobject.cc \
3228
pglobject.h \
3329
pgconnection.h \
34-
pgenv.h \
3530
$(LIBPQDIR)/libpq-fe.h \
3631
$(LIBPQHEADERDIR)/libpq-fs.h

‎src/interfaces/libpq++/examples/Makefile

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@
22
# Makefile for example programs
33
#
44

5-
SRCDIR= ../../..
6-
include ../../../Makefile.global
75

86
LIBNAME= libpq++
7+
HEADERDIR= /usr/local/pgsql/include
8+
LIBPQDIR= /usr/local/pgsql/lib
9+
910

1011
# We have to override -Werror, which makes warnings, fatal, because we
1112
# inevitably get the warning, "abstract declarator used as declaration"
1213
# because of our inclusion of c.h and we don't know how to stop that.
1314

14-
CXXFLAGS=$(CFLAGS) -Wno-error
15+
CXXFLAGS=$(CFLAGS) -Wno-error -Wno-unused -Wl,-Bdynamic
16+
17+
INCLUDE_OPT= -I$(HEADERDIR)
1518

16-
INCLUDE_OPT=\
17-
-I..\
18-
-I../../../backend\
19-
-I../../../include\
20-
-I$(LIBPQDIR)\
21-
-I$(HEADERDIR)
2219
CXXFLAGS+=$(INCLUDE_OPT)
2320

24-
LDFLAGS+= -L.. -lpq++ -L$(LIBPQDIR) -lpq
21+
LDFLAGS+= -L$(LIBPQDIR) -lpq++
2522

2623
#
2724
# And where libpq goes, so goes the authentication stuff...
@@ -34,17 +31,12 @@ endif
3431
PROGS=testlibpq0 testlibpq1 testlibpq2 testlibpq3\
3532
testlibpq4 testlibpq5 testlibpq6 testlo
3633

37-
all:submake$(PROGS)
34+
all:$(PROGS)
3835

39-
$(PROGS):% :%.cc ../$(LIBNAME).a
36+
$(PROGS):% :%.cc
4037
$(CXX)$(CXXFLAGS) -o$@$@.cc$(LDFLAGS)
4138

4239
.PHONY: submake
43-
submake:
44-
$(MAKE) -C..$(LIBNAME).a
45-
46-
../$(LIBNAME).a:
47-
$(MAKE) -C..$(LIBNAME).a
4840

4941
clean:
5042
rm -f$(PROGS)

‎src/interfaces/libpq++/examples/testlibpq0.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/examples/Attic/testlibpq0.cc,v 1.3 1997/02/13 10:00:42 scrappy Exp $
12+
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/examples/Attic/testlibpq0.cc,v 1.4 1999/05/23 01:04:05 momjian Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
1616

1717
#include<iostream.h>
18-
#include<libpq++.h>
18+
#include<libpq++.H>
1919

2020
intmain()
2121
{
2222
// Open the connection to the database and make sure it's OK
23-
PgDatabasedata("template1");
23+
PgDatabasedata("dbname=template1");
2424
if ( data.ConnectionBad() ) {
2525
cout <<"Connection was unsuccessful..." << endl
2626
<<"Error message returned:" << data.ErrorMessage() << endl;

‎src/interfaces/libpq++/examples/testlibpq1.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
#include<iostream.h>
1010
#include<iomanip.h>
11-
#include<libpq++.h>
11+
#include<libpq++.H>
1212

1313
intmain()
1414
{
1515
// Begin, by establishing a connection to the backend.
1616
// When no parameters are given then the system will
1717
// try to use reasonable defaults by looking up environment variables
1818
// or, failing that, using hardwired constants
19-
constchar* dbName ="template1";
19+
constchar* dbName ="dbname=template1";
2020
PgDatabasedata(dbName);
2121

2222
// check to see that the backend connection was successfully made

‎src/interfaces/libpq++/examples/testlibpq2.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
#include<iostream.h>
1010
#include<iomanip.h>
11-
#include<libpq++.h>
11+
#include<libpq++.H>
1212

1313
intmain()
1414
{
1515
// Begin, by establishing a connection to the backend.
1616
// When no parameters are given then the system will
1717
// try to use reasonable defaults by looking up environment variables
1818
// or, failing that, using hardwired constants
19-
constchar* dbName ="template1";
19+
constchar* dbName ="dbname=template1";
2020
PgTransactiondata(dbName);
2121

2222
// check to see that the backend connection was successfully made

‎src/interfaces/libpq++/examples/testlibpq3.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#include<iostream.h>
1111
#include<iomanip.h>
12-
#include<libpq++.h>
12+
#include<libpq++.H>
1313

1414
intmain()
1515
{
@@ -19,7 +19,7 @@ int main()
1919
// or, failing that, using hardwired constants.
2020
// Create a cursor database query object.
2121
// All queries using cursor will be performed through this object.
22-
constchar* dbName ="template1";
22+
constchar* dbName ="dbname=template1";
2323
PgCursorcData(dbName,"myportal");
2424

2525
// check to see that the backend connection was successfully made

‎src/interfaces/libpq++/examples/testlibpq4.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ INSERT INTO TBL1 values (10);
1919
*
2020
*/
2121
#include<iostream.h>
22-
#include<libpq++.h>
22+
#include<libpq++.H>
2323
#include<stdlib.h>
2424

2525
main()
2626
{
2727
// Begin, by connecting to the backend using hardwired constants
2828
// and a test database created by the user prior to the invokation
2929
// of this test program.
30-
char* dbName =getenv("USER");// change this to the name of your test database
30+
char* dbName ="dbname=template1";
3131
PgDatabasedata(dbName);
3232

3333
// Check to see that the backend connection was successfully made

‎src/interfaces/libpq++/examples/testlibpq5.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ tuple 1: got
2727
*
2828
*/
2929
#include<iostream.h>
30-
#include<libpq++.h>
30+
#include<libpq++.H>
3131
#include<stdlib.h>
3232
extern"C" {
3333
#include"postgres.h"// for Postgres types
@@ -39,7 +39,7 @@ main()
3939
// Begin, by connecting to the backend using hardwired constants
4040
// and a test database created by the user prior to the invokation
4141
// of this test program. Connect using cursor interface.
42-
char* dbName =getenv("USER");// change this to the name of your test database
42+
char* dbName ="dbname=template1";// change this to the name of your test database
4343
PgCursordata(dbName,"mycursor");
4444

4545
// check to see that the backend connection was successfully made

‎src/interfaces/libpq++/examples/testlibpq6.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
*
66
*/
77
#include<iostream.h>
8-
#include<libpq++.h>
8+
#include<libpq++.H>
99
#include<stdlib.h>
1010

1111
main()
1212
{
1313
// Begin, by connecting to the backend using hardwired constants
1414
// and a test database created by the user prior to the invokation
1515
// of this test program. Connect using transaction interface.
16-
char* dbName =getenv("USER");// change this to the name of your test database
16+
char* dbName ="dbname=template1";
1717
PgTransactiondata(dbName);
1818

1919
// check to see that the backend connection was successfully made

‎src/interfaces/libpq++/examples/testlo.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/examples/Attic/testlo.cc,v 1.3 1997/02/13 10:01:05 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq++/examples/Attic/testlo.cc,v 1.4 1999/05/2301:04:07 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#include<iostream.h>
15-
#include<libpq++.h>
15+
#include<libpq++.H>
1616
#include<stdlib.h>
1717

1818
intmain(int argc,char **argv)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp