summaryrefslogtreecommitdiff
path: root/src/test/examples
diff options
context:
space:
mode:
authorBruce Momjian2005-10-15 02:49:52 +0000
committerBruce Momjian2005-10-15 02:49:52 +0000
commit1dc34982511d91ef8a2b71bdcb870f067c1b3da9 (patch)
tree1046adab1d4b964e0c38afeec0ee6546f61d9a8a /src/test/examples
parent790c01d28099587bbe2c623d4389b62ee49b1dee (diff)
Standard pgindent run for 8.1.
Diffstat (limited to 'src/test/examples')
-rw-r--r--src/test/examples/testlibpq.c17
-rw-r--r--src/test/examples/testlibpq2.c18
-rw-r--r--src/test/examples/testlibpq3.c31
-rw-r--r--src/test/examples/testlibpq4.c11
4 files changed, 35 insertions, 42 deletions
diff --git a/src/test/examples/testlibpq.c b/src/test/examples/testlibpq.c
index 3295076481..b27c17386a 100644
--- a/src/test/examples/testlibpq.c
+++ b/src/test/examples/testlibpq.c
@@ -26,9 +26,8 @@ main(int argc, char **argv)
/*
* If the user supplies a parameter on the command line, use it as the
- * conninfo string; otherwise default to setting dbname=postgres and
- * using environment variables or defaults for all other connection
- * parameters.
+ * conninfo string; otherwise default to setting dbname=postgres and using
+ * environment variables or defaults for all other connection parameters.
*/
if (argc > 1)
conninfo = argv[1];
@@ -47,10 +46,10 @@ main(int argc, char **argv)
}
/*
- * Our test case here involves using a cursor, for which we must be
- * inside a transaction block. We could do the whole thing with a
- * single PQexec() of "select * from pg_database", but that's too
- * trivial to make a good example.
+ * Our test case here involves using a cursor, for which we must be inside
+ * a transaction block. We could do the whole thing with a single
+ * PQexec() of "select * from pg_database", but that's too trivial to make
+ * a good example.
*/
/* Start a transaction block */
@@ -63,8 +62,8 @@ main(int argc, char **argv)
}
/*
- * Should PQclear PGresult whenever it is no longer needed to avoid
- * memory leaks
+ * Should PQclear PGresult whenever it is no longer needed to avoid memory
+ * leaks
*/
PQclear(res);
diff --git a/src/test/examples/testlibpq2.c b/src/test/examples/testlibpq2.c
index 9f1e96d8da..5949c1364e 100644
--- a/src/test/examples/testlibpq2.c
+++ b/src/test/examples/testlibpq2.c
@@ -46,9 +46,8 @@ main(int argc, char **argv)
/*
* If the user supplies a parameter on the command line, use it as the
- * conninfo string; otherwise default to setting dbname=postgres and
- * using environment variables or defaults for all other connection
- * parameters.
+ * conninfo string; otherwise default to setting dbname=postgres and using
+ * environment variables or defaults for all other connection parameters.
*/
if (argc > 1)
conninfo = argv[1];
@@ -67,8 +66,7 @@ main(int argc, char **argv)
}
/*
- * Issue LISTEN command to enable notifications from the rule's
- * NOTIFY.
+ * Issue LISTEN command to enable notifications from the rule's NOTIFY.
*/
res = PQexec(conn, "LISTEN TBL2");
if (PQresultStatus(res) != PGRES_COMMAND_OK)
@@ -79,8 +77,8 @@ main(int argc, char **argv)
}
/*
- * should PQclear PGresult whenever it is no longer needed to avoid
- * memory leaks
+ * should PQclear PGresult whenever it is no longer needed to avoid memory
+ * leaks
*/
PQclear(res);
@@ -89,9 +87,9 @@ main(int argc, char **argv)
while (nnotifies < 4)
{
/*
- * Sleep until something happens on the connection. We use
- * select(2) to wait for input, but you could also use poll() or
- * similar facilities.
+ * Sleep until something happens on the connection. We use select(2)
+ * to wait for input, but you could also use poll() or similar
+ * facilities.
*/
int sock;
fd_set input_mask;
diff --git a/src/test/examples/testlibpq3.c b/src/test/examples/testlibpq3.c
index 49b03066cd..918d142c7b 100644
--- a/src/test/examples/testlibpq3.c
+++ b/src/test/examples/testlibpq3.c
@@ -51,9 +51,8 @@ main(int argc, char **argv)
/*
* If the user supplies a parameter on the command line, use it as the
- * conninfo string; otherwise default to setting dbname=postgres and
- * using environment variables or defaults for all other connection
- * parameters.
+ * conninfo string; otherwise default to setting dbname=postgres and using
+ * environment variables or defaults for all other connection parameters.
*/
if (argc > 1)
conninfo = argv[1];
@@ -72,12 +71,11 @@ main(int argc, char **argv)
}
/*
- * The point of this program is to illustrate use of PQexecParams()
- * with out-of-line parameters, as well as binary transmission of
- * results. By using out-of-line parameters we can avoid a lot of
- * tedious mucking about with quoting and escaping. Notice how we
- * don't have to do anything special with the quote mark in the
- * parameter value.
+ * The point of this program is to illustrate use of PQexecParams() with
+ * out-of-line parameters, as well as binary transmission of results. By
+ * using out-of-line parameters we can avoid a lot of tedious mucking
+ * about with quoting and escaping. Notice how we don't have to do
+ * anything special with the quote mark in the parameter value.
*/
/* Here is our out-of-line parameter value */
@@ -118,19 +116,18 @@ main(int argc, char **argv)
bptr = PQgetvalue(res, i, b_fnum);
/*
- * The binary representation of INT4 is in network byte order,
- * which we'd better coerce to the local byte order.
+ * The binary representation of INT4 is in network byte order, which
+ * we'd better coerce to the local byte order.
*/
ival = ntohl(*((uint32_t *) iptr));
/*
- * The binary representation of TEXT is, well, text, and since
- * libpq was nice enough to append a zero byte to it, it'll work
- * just fine as a C string.
+ * The binary representation of TEXT is, well, text, and since libpq
+ * was nice enough to append a zero byte to it, it'll work just fine
+ * as a C string.
*
- * The binary representation of BYTEA is a bunch of bytes, which
- * could include embedded nulls so we have to pay attention to
- * field length.
+ * The binary representation of BYTEA is a bunch of bytes, which could
+ * include embedded nulls so we have to pay attention to field length.
*/
blen = PQgetlength(res, i, b_fnum);
diff --git a/src/test/examples/testlibpq4.c b/src/test/examples/testlibpq4.c
index 977e4edd99..71b7d25f13 100644
--- a/src/test/examples/testlibpq4.c
+++ b/src/test/examples/testlibpq4.c
@@ -66,8 +66,8 @@ main(int argc, char **argv)
/*
* begin, by setting the parameters for a backend connection if the
* parameters are null, then the system will try to use reasonable
- * defaults by looking up environment variables or, failing that,
- * using hardwired constants
+ * defaults by looking up environment variables or, failing that, using
+ * hardwired constants
*/
pghost = NULL; /* host name of the backend server */
pgport = NULL; /* port of the backend server */
@@ -92,14 +92,13 @@ main(int argc, char **argv)
}
/*
- * make sure to PQclear() a PGresult whenever it is no longer
- * needed to avoid memory leaks
+ * make sure to PQclear() a PGresult whenever it is no longer needed to
+ * avoid memory leaks
*/
PQclear(res1);
/*
- * fetch instances from the pg_database, the system catalog of
- * databases
+ * fetch instances from the pg_database, the system catalog of databases
*/
res1 = PQexec(conn1, "DECLARE myportal CURSOR FOR select * from pg_database");
if (PQresultStatus(res1) != PGRES_COMMAND_OK)