aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/libpq/fe-exec.c
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2022-09-20 13:09:30 -0700
committerPeter Geoghegan <pg@bowt.ie>2022-09-20 13:09:30 -0700
commita601366a460f68472bf70c4d94c57baa0a3ed1b2 (patch)
treee2dbfff4d642eab7d34661367ec1b4938033c2a8 /src/interfaces/libpq/fe-exec.c
parentc3382a3c3ccda6df126c95bf37dcc762480c5202 (diff)
downloadpostgresql-a601366a460f68472bf70c4d94c57baa0a3ed1b2.tar.gz
postgresql-a601366a460f68472bf70c4d94c57baa0a3ed1b2.zip
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
Diffstat (limited to 'src/interfaces/libpq/fe-exec.c')
-rw-r--r--src/interfaces/libpq/fe-exec.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index bb874f7f509..97f6894244d 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -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));
}
/*