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

Commit724bf74

Browse files
committed
These are two minor corrections to libpq's PQsetNoticeProcessor function.
One, it now returns the previous hook. That way people don't have to digaround in libpq-int.h for that information anymore. It previouslyreturned void, so there should be no incompatibilities.Second, you cannot set the callback to NULL anymore. (Of course you canstill call it with NULL just to get the current hook.) The way libpq usesthe callback pointer, having a NULL there wasn't very healthy.Peter Eisentraut
1 parent021146f commit724bf74

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

‎src/interfaces/libpq/fe-connect.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.103 1999/09/27 03:13:16 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.104 1999/10/26 04:49:00 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1575,13 +1575,19 @@ PQuntrace(PGconn *conn)
15751575
}
15761576
}
15771577

1578-
void
1578+
PQnoticeProcessor
15791579
PQsetNoticeProcessor(PGconn*conn,PQnoticeProcessorproc,void*arg)
15801580
{
1581+
PQnoticeProcessorold;
15811582
if (conn==NULL)
1582-
return;
1583+
returnNULL;
1584+
1585+
old=conn->noticeHook;
1586+
if (proc) {
15831587
conn->noticeHook=proc;
15841588
conn->noticeArg=arg;
1589+
}
1590+
returnold;
15851591
}
15861592

15871593
/*

‎src/interfaces/libpq/libpq-fe.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: libpq-fe.h,v 1.50 1999/05/25 16:15:13 momjian Exp $
9+
* $Id: libpq-fe.h,v 1.51 1999/10/26 04:49:00 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -193,9 +193,7 @@ extern"C"
193193
externvoidPQuntrace(PGconn*conn);
194194

195195
/* Override default notice processor */
196-
externvoidPQsetNoticeProcessor(PGconn*conn,
197-
PQnoticeProcessorproc,
198-
void*arg);
196+
externPQnoticeProcessorPQsetNoticeProcessor(PGconn*conn,PQnoticeProcessorproc,void*arg);
199197

200198
/* === in fe-exec.c === */
201199

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp