mirror of
https://github.com/postgres/postgres.git
synced 2025-06-04 00:02:37 -04: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:
parent
a43b4ab111
commit
9042f58342
@ -1873,7 +1873,7 @@ int PQsslInUse(const PGconn *conn);
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="libpq-pqsslAttribute">
|
<varlistentry id="libpq-pqsslattribute">
|
||||||
<term><function>PQsslAttribute</function><indexterm><primary>PQsslAttribute</></></term>
|
<term><function>PQsslAttribute</function><indexterm><primary>PQsslAttribute</></></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
@ -1947,13 +1947,13 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
|
|||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="libpq-pqsslattributes">
|
<varlistentry id="libpq-pqsslattributenames">
|
||||||
<term><function>PQsslAttributes</function><indexterm><primary>PQsslAttributes</></></term>
|
<term><function>PQsslAttributeNames</function><indexterm><primary>PQsslAttributeNames</></></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Return an array of SSL attribute names available. The array is terminated by a NULL pointer.
|
Return an array of SSL attribute names available. The array is terminated by a NULL pointer.
|
||||||
<synopsis>
|
<synopsis>
|
||||||
const char **PQsslAttributes(const PGconn *conn);
|
const char * const * PQsslAttributeNames(const PGconn *conn);
|
||||||
</synopsis>
|
</synopsis>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -1963,15 +1963,15 @@ const char **PQsslAttributes(const PGconn *conn);
|
|||||||
<term><function>PQsslStruct</function><indexterm><primary>PQsslStruct</></></term>
|
<term><function>PQsslStruct</function><indexterm><primary>PQsslStruct</></></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Return a pointer to an SSL-implementation specific object describing
|
Return a pointer to an SSL-implementation-specific object describing
|
||||||
the connection.
|
the connection.
|
||||||
<synopsis>
|
<synopsis>
|
||||||
void *PQsslStruct(const PGconn *conn, const char *struct_name);
|
void *PQsslStruct(const PGconn *conn, const char *struct_name);
|
||||||
</synopsis>
|
</synopsis>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The structs available depends on the SSL implementation in use.
|
The struct(s) available depend on the SSL implementation in use.
|
||||||
For OpenSSL, there is one struct, under the name "OpenSSL",
|
For OpenSSL, there is one struct, available under the name "OpenSSL",
|
||||||
and it returns a pointer to the OpenSSL <literal>SSL</literal> struct.
|
and it returns a pointer to the OpenSSL <literal>SSL</literal> struct.
|
||||||
To use this function, code along the following lines could be used:
|
To use this function, code along the following lines could be used:
|
||||||
<programlisting><![CDATA[
|
<programlisting><![CDATA[
|
||||||
|
@ -608,18 +608,22 @@ FIXME: Add Andres
|
|||||||
2015-02-03 [91fa7b4] Heikki..: Add API functions to libpq to interrogate SSL ..
|
2015-02-03 [91fa7b4] Heikki..: Add API functions to libpq to interrogate SSL ..
|
||||||
-->
|
-->
|
||||||
<para>
|
<para>
|
||||||
Add <application>libpq</> function <link
|
Add <application>libpq</> functions to return <acronym>SSL</>
|
||||||
linkend="libpq-pqsslAttribute"><function>PQsslAttribute()</></>
|
information in an implementation-independent way (Heikki Linnakangas)
|
||||||
that returns <acronym>SSL</> information (Heikki Linnakangas)
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
While <link linkend="libpq-pqgetssl"><function>PQgetssl()</></>
|
While <link linkend="libpq-pqgetssl"><function>PQgetssl()</></> can
|
||||||
can still be used to call <productname>OpenSSL</>
|
still be used to call <productname>OpenSSL</> functions, it is now
|
||||||
functions, <function>PQsslAttribute()</> returns <acronym>SSL</>
|
considered deprecated because future versions
|
||||||
information in an <acronym>SSL</>-implementation-independent way.
|
of <application>libpq</> might support other <acronym>SSL</>
|
||||||
(Future versions of libpq might support other <acronym>SSL</>
|
implementations. When possible, use the new
|
||||||
implementations.)
|
functions <link
|
||||||
|
linkend="libpq-pqsslattribute"><function>PQsslAttribute()</></>, <link
|
||||||
|
linkend="libpq-pqsslattributenames"><function>PQsslAttributeNames()</></>,
|
||||||
|
and <link linkend="libpq-pqsslinuse"><function>PQsslInUse()</></>
|
||||||
|
to obtain <acronym>SSL</> information in
|
||||||
|
an <acronym>SSL</>-implementation-independent way.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
@ -167,6 +167,6 @@ lo_truncate64 164
|
|||||||
PQconninfo 165
|
PQconninfo 165
|
||||||
PQsslInUse 166
|
PQsslInUse 166
|
||||||
PQsslStruct 167
|
PQsslStruct 167
|
||||||
PQsslAttributes 168
|
PQsslAttributeNames 168
|
||||||
PQsslAttribute 169
|
PQsslAttribute 169
|
||||||
PQsetErrorContextVisibility 170
|
PQsetErrorContextVisibility 170
|
||||||
|
@ -1532,10 +1532,10 @@ PQsslStruct(PGconn *conn, const char *struct_name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char **
|
const char *const *
|
||||||
PQsslAttributes(PGconn *conn)
|
PQsslAttributeNames(PGconn *conn)
|
||||||
{
|
{
|
||||||
static const char *result[] = {
|
static const char *const result[] = {
|
||||||
"library",
|
"library",
|
||||||
"key_bits",
|
"key_bits",
|
||||||
"cipher",
|
"cipher",
|
||||||
|
@ -408,10 +408,10 @@ PQsslAttribute(PGconn *conn, const char *attribute_name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char **
|
const char *const *
|
||||||
PQsslAttributes(PGconn *conn)
|
PQsslAttributeNames(PGconn *conn)
|
||||||
{
|
{
|
||||||
static const char *result[] = {NULL};
|
static const char *const result[] = {NULL};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ extern int PQsetClientEncoding(PGconn *conn, const char *encoding);
|
|||||||
extern int PQsslInUse(PGconn *conn);
|
extern int PQsslInUse(PGconn *conn);
|
||||||
extern void *PQsslStruct(PGconn *conn, const char *struct_name);
|
extern void *PQsslStruct(PGconn *conn, const char *struct_name);
|
||||||
extern const char *PQsslAttribute(PGconn *conn, const char *attribute_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
|
/* Get the OpenSSL structure associated with a connection. Returns NULL for
|
||||||
* unencrypted connections or if any other TLS library is in use. */
|
* unencrypted connections or if any other TLS library is in use. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user