1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Rename PQsslAttributes() to PQsslAttributeNames(), and const-ify fully.

Per discussion, the original name was a bit misleading, and
PQsslAttributeNames() seems more apropos.  It's not quite too late to
change this in 9.5, so let's change it while we can.

Also, make sure that the pointer array is const, not only the pointed-to
strings.

Minor documentation wordsmithing while at it.

Lars Kanis, slight adjustments by me
This commit is contained in:
Tom Lane
2015-11-07 16:13:49 -05:00
parent 44fc251536
commit ab994cc00e
6 changed files with 28 additions and 24 deletions

View File

@ -167,5 +167,5 @@ lo_truncate64 164
PQconninfo 165
PQsslInUse 166
PQsslStruct 167
PQsslAttributes 168
PQsslAttributeNames 168
PQsslAttribute 169

View File

@ -1532,10 +1532,10 @@ PQsslStruct(PGconn *conn, const char *struct_name)
return NULL;
}
const char **
PQsslAttributes(PGconn *conn)
const char *const *
PQsslAttributeNames(PGconn *conn)
{
static const char *result[] = {
static const char *const result[] = {
"library",
"key_bits",
"cipher",

View File

@ -408,10 +408,10 @@ PQsslAttribute(PGconn *conn, const char *attribute_name)
return NULL;
}
const char **
PQsslAttributes(PGconn *conn)
const char *const *
PQsslAttributeNames(PGconn *conn)
{
static const char *result[] = {NULL};
static const char *const result[] = {NULL};
return result;
}

View File

@ -322,7 +322,7 @@ extern int PQsetClientEncoding(PGconn *conn, const char *encoding);
extern int PQsslInUse(PGconn *conn);
extern void *PQsslStruct(PGconn *conn, const char *struct_name);
extern const char *PQsslAttribute(PGconn *conn, const char *attribute_name);
extern const char **PQsslAttributes(PGconn *conn);
extern const char *const * PQsslAttributeNames(PGconn *conn);
/* Get the OpenSSL structure associated with a connection. Returns NULL for
* unencrypted connections or if any other TLS library is in use. */