mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
From: Magnus Hagander <mha@sollentuna.net>
Here is a first patch to cleanup the backend side of libpq. This patch removes all external dependencies on the "Pfin" and "Pfout" that are declared in pqcomm.h. These variables are also changed to "static" to make sure. Almost all the change is in the handler of the "copy" command - most other areas of the backend already used the correct functions. This change will make the way for cleanup of the internal stuff there - now that all the functions accessing the file descriptors are confined to a single directory.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
*
|
||||
* Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: pqcomm.c,v 1.59 1998/12/14 06:50:27 scrappy Exp $
|
||||
* $Id: pqcomm.c,v 1.60 1999/01/11 03:56:06 scrappy Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -75,7 +75,7 @@
|
||||
* declarations
|
||||
* ----------------
|
||||
*/
|
||||
FILE *Pfout,
|
||||
static FILE *Pfout,
|
||||
*Pfin,
|
||||
*Pfdebug; /* debugging libpq */
|
||||
|
||||
@@ -98,7 +98,7 @@ pq_init(int fd)
|
||||
}
|
||||
|
||||
/* -------------------------
|
||||
* pq_getc(File* fin)
|
||||
* pq_getchar()
|
||||
*
|
||||
* get a character from the input file,
|
||||
*
|
||||
@@ -107,20 +107,29 @@ pq_init(int fd)
|
||||
* used for debugging libpq
|
||||
*/
|
||||
|
||||
#if 0 /* not used anymore */
|
||||
|
||||
static int
|
||||
pq_getc(FILE *fin)
|
||||
int
|
||||
pq_getchar(void)
|
||||
{
|
||||
int c;
|
||||
|
||||
c = getc(fin);
|
||||
c = getc(Pfin);
|
||||
if (Pfdebug && c != EOF)
|
||||
putc(c, Pfdebug);
|
||||
return c;
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
* --------------------------------
|
||||
* pq_peekchar - get 1 character from connection, but leave it in the stream
|
||||
*/
|
||||
int
|
||||
pq_peekchar(void) {
|
||||
char c = getc(Pfin);
|
||||
ungetc(c,Pfin);
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* --------------------------------
|
||||
* pq_gettty - return the name of the tty in the given buffer
|
||||
|
||||
Reference in New Issue
Block a user