1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-09 13:09:39 +03:00

Harmonize more parameter names in bulk.

Make sure that function declarations use names that exactly match the
corresponding names from function definitions in optimizer, parser,
utility, libpq, and "commands" code, as well as in remaining library
code.  Do the same for all code related to frontend programs (with the
exception of pg_dump/pg_dumpall related code).

Like other recent commits that cleaned up function parameter names, this
commit was written with help from clang-tidy.  Later commits will handle
ecpg and pg_dump/pg_dumpall.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAH2-WznJt9CMM9KJTMjJh_zbL5hD9oX44qdJ4aqZtjFi-zA3Tg@mail.gmail.com
This commit is contained in:
Peter Geoghegan
2022-09-20 13:09:30 -07:00
parent c3382a3c3c
commit a601366a46
131 changed files with 297 additions and 293 deletions

View File

@@ -381,7 +381,7 @@ static void closePGconn(PGconn *conn);
static void release_conn_addrinfo(PGconn *conn);
static void sendTerminateConn(PGconn *conn);
static PQconninfoOption *conninfo_init(PQExpBuffer errorMessage);
static PQconninfoOption *parse_connection_string(const char *conninfo,
static PQconninfoOption *parse_connection_string(const char *connstr,
PQExpBuffer errorMessage, bool use_defaults);
static int uri_prefix_length(const char *connstr);
static bool recognized_connection_string(const char *connstr);

View File

@@ -2808,12 +2808,12 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* PQgetline - gets a newline-terminated string from the backend.
*
* Chiefly here so that applications can use "COPY <rel> to stdout"
* and read the output string. Returns a null-terminated string in s.
* and read the output string. Returns a null-terminated string in `buffer`.
*
* XXX this routine is now deprecated, because it can't handle binary data.
* If called during a COPY BINARY we return EOF.
*
* PQgetline reads up to maxlen-1 characters (like fgets(3)) but strips
* PQgetline reads up to `length`-1 characters (like fgets(3)) but strips
* the terminating \n (like gets(3)).
*
* CAUTION: the caller is responsible for detecting the end-of-copy signal
@@ -2824,23 +2824,23 @@ PQgetCopyData(PGconn *conn, char **buffer, int async)
* 0 if EOL is reached (i.e., \n has been read)
* (this is required for backward-compatibility -- this
* routine used to always return EOF or 0, assuming that
* the line ended within maxlen bytes.)
* the line ended within `length` bytes.)
* 1 in other cases (i.e., the buffer was filled before \n is reached)
*/
int
PQgetline(PGconn *conn, char *s, int maxlen)
PQgetline(PGconn *conn, char *buffer, int length)
{
if (!s || maxlen <= 0)
if (!buffer || length <= 0)
return EOF;
*s = '\0';
/* maxlen must be at least 3 to hold the \. terminator! */
if (maxlen < 3)
*buffer = '\0';
/* length must be at least 3 to hold the \. terminator! */
if (length < 3)
return EOF;
if (!conn)
return EOF;
return pqGetline3(conn, s, maxlen);
return pqGetline3(conn, buffer, length);
}
/*
@@ -2892,9 +2892,9 @@ PQgetlineAsync(PGconn *conn, char *buffer, int bufsize)
* send failure.
*/
int
PQputline(PGconn *conn, const char *s)
PQputline(PGconn *conn, const char *string)
{
return PQputnbytes(conn, s, strlen(s));
return PQputnbytes(conn, string, strlen(string));
}
/*

View File

@@ -22,8 +22,8 @@ extern int pq_verify_peer_name_matches_certificate_name(PGconn *conn,
const char *namedata, size_t namelen,
char **store_name);
extern int pq_verify_peer_name_matches_certificate_ip(PGconn *conn,
const unsigned char *addrdata,
size_t addrlen,
const unsigned char *ipdata,
size_t iplen,
char **store_name);
extern bool pq_verify_peer_name_matches_certificate(PGconn *conn);

View File

@@ -68,14 +68,14 @@
static int verify_cb(int ok, X509_STORE_CTX *ctx);
static int openssl_verify_peer_name_matches_certificate_name(PGconn *conn,
ASN1_STRING *name,
ASN1_STRING *name_entry,
char **store_name);
static int openssl_verify_peer_name_matches_certificate_ip(PGconn *conn,
ASN1_OCTET_STRING *addr_entry,
char **store_name);
static void destroy_ssl_system(void);
static int initialize_SSL(PGconn *conn);
static PostgresPollingStatusType open_client_SSL(PGconn *);
static PostgresPollingStatusType open_client_SSL(PGconn *conn);
static char *SSLerrmessage(unsigned long ecode);
static void SSLerrfree(char *buf);
static int PQssl_passwd_cb(char *buf, int size, int rwflag, void *userdata);

View File

@@ -483,7 +483,7 @@ extern int PQputCopyEnd(PGconn *conn, const char *errormsg);
extern int PQgetCopyData(PGconn *conn, char **buffer, int async);
/* Deprecated routines for copy in/out */
extern int PQgetline(PGconn *conn, char *string, int length);
extern int PQgetline(PGconn *conn, char *buffer, int length);
extern int PQputline(PGconn *conn, const char *string);
extern int PQgetlineAsync(PGconn *conn, char *buffer, int bufsize);
extern int PQputnbytes(PGconn *conn, const char *buffer, int nbytes);
@@ -591,7 +591,7 @@ extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_lengt
extern void PQprint(FILE *fout, /* output stream */
const PGresult *res,
const PQprintOpt *ps); /* option structure */
const PQprintOpt *po); /* option structure */
/*
* really old printing routines