Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab994cc

Browse files
committed
Rename PQsslAttributes() to PQsslAttributeNames(), and const-ify fully.
Per discussion, the original name was a bit misleading, andPQsslAttributeNames() seems more apropos. It's not quite too late tochange 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-tostrings.Minor documentation wordsmithing while at it.Lars Kanis, slight adjustments by me
1 parent44fc251 commitab994cc

File tree

6 files changed

+31
-27
lines changed

6 files changed

+31
-27
lines changed

‎doc/src/sgml/libpq.sgml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@ int PQsslInUse(const PGconn *conn);
18731873
</listitem>
18741874
</varlistentry>
18751875

1876-
<varlistentry id="libpq-pqsslAttribute">
1876+
<varlistentry id="libpq-pqsslattribute">
18771877
<term><function>PQsslAttribute</function><indexterm><primary>PQsslAttribute</></></term>
18781878
<listitem>
18791879
<para>
@@ -1947,13 +1947,13 @@ const char *PQsslAttribute(const PGconn *conn, const char *attribute_name);
19471947
</listitem>
19481948
</varlistentry>
19491949

1950-
<varlistentry id="libpq-pqsslattributes">
1951-
<term><function>PQsslAttributes</function><indexterm><primary>PQsslAttributes</></></term>
1950+
<varlistentry id="libpq-pqsslattributenames">
1951+
<term><function>PQsslAttributeNames</function><indexterm><primary>PQsslAttributeNames</></></term>
19521952
<listitem>
19531953
<para>
19541954
Return an array of SSL attribute names available. The array is terminated by a NULL pointer.
19551955
<synopsis>
1956-
const char **PQsslAttributes(const PGconn *conn);
1956+
const char * const * PQsslAttributeNames(const PGconn *conn);
19571957
</synopsis>
19581958
</para>
19591959
</listitem>
@@ -1963,15 +1963,15 @@ const char **PQsslAttributes(const PGconn *conn);
19631963
<term><function>PQsslStruct</function><indexterm><primary>PQsslStruct</></></term>
19641964
<listitem>
19651965
<para>
1966-
Return a pointer to an SSL-implementationspecific object describing
1966+
Return a pointer to an SSL-implementation-specific object describing
19671967
the connection.
19681968
<synopsis>
19691969
void *PQsslStruct(const PGconn *conn, const char *struct_name);
19701970
</synopsis>
19711971
</para>
19721972
<para>
1973-
Thestructs availabledepends on the SSL implementation in use.
1974-
For OpenSSL, there is one struct, under the name "OpenSSL",
1973+
Thestruct(s) availabledepend on the SSL implementation in use.
1974+
For OpenSSL, there is one struct,availableunder the name "OpenSSL",
19751975
and it returns a pointer to the OpenSSL <literal>SSL</literal> struct.
19761976
To use this function, code along the following lines could be used:
19771977
<programlisting><![CDATA[

‎doc/src/sgml/release-9.5.sgml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -608,18 +608,22 @@ FIXME: Add Andres
608608
2015-02-03 [91fa7b4] Heikki..: Add API functions to libpq to interrogate SSL ..
609609
-->
610610
<para>
611-
Add <application>libpq</> function <link
612-
linkend="libpq-pqsslAttribute"><function>PQsslAttribute()</></>
613-
that returns <acronym>SSL</> information (Heikki Linnakangas)
614-
</para>
615-
616-
<para>
617-
While <link linkend="libpq-pqgetssl"><function>PQgetssl()</></>
618-
can still be used to call <productname>OpenSSL</>
619-
functions, <function>PQsslAttribute()</> returns <acronym>SSL</>
620-
information in an <acronym>SSL</>-implementation-independent way.
621-
(Future versions of libpq might support other <acronym>SSL</>
622-
implementations.)
611+
Add <application>libpq</> functions to return <acronym>SSL</>
612+
information in an implementation-independent way (Heikki Linnakangas)
613+
</para>
614+
615+
<para>
616+
While <link linkend="libpq-pqgetssl"><function>PQgetssl()</></> can
617+
still be used to call <productname>OpenSSL</> functions, it is now
618+
considered deprecated because future versions
619+
of <application>libpq</> might support other <acronym>SSL</>
620+
implementations. When possible, use the new
621+
functions <link
622+
linkend="libpq-pqsslattribute"><function>PQsslAttribute()</></>, <link
623+
linkend="libpq-pqsslattributenames"><function>PQsslAttributeNames()</></>,
624+
and <link linkend="libpq-pqsslinuse"><function>PQsslInUse()</></>
625+
to obtain <acronym>SSL</> information in
626+
an <acronym>SSL</>-implementation-independent way.
623627
</para>
624628
</listitem>
625629

‎src/interfaces/libpq/exports.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,5 +167,5 @@ lo_truncate64 164
167167
PQconninfo 165
168168
PQsslInUse 166
169169
PQsslStruct 167
170-
PQsslAttributes 168
170+
PQsslAttributeNames 168
171171
PQsslAttribute 169

‎src/interfaces/libpq/fe-secure-openssl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,10 +1532,10 @@ PQsslStruct(PGconn *conn, const char *struct_name)
15321532
returnNULL;
15331533
}
15341534

1535-
constchar**
1536-
PQsslAttributes(PGconn*conn)
1535+
constchar*const*
1536+
PQsslAttributeNames(PGconn*conn)
15371537
{
1538-
staticconstchar*result[]= {
1538+
staticconstchar*constresult[]= {
15391539
"library",
15401540
"key_bits",
15411541
"cipher",

‎src/interfaces/libpq/fe-secure.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,10 @@ PQsslAttribute(PGconn *conn, const char *attribute_name)
408408
returnNULL;
409409
}
410410

411-
constchar**
412-
PQsslAttributes(PGconn*conn)
411+
constchar*const*
412+
PQsslAttributeNames(PGconn*conn)
413413
{
414-
staticconstchar*result[]= {NULL};
414+
staticconstchar*constresult[]= {NULL};
415415

416416
returnresult;
417417
}

‎src/interfaces/libpq/libpq-fe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ extern intPQsetClientEncoding(PGconn *conn, const char *encoding);
322322
externintPQsslInUse(PGconn*conn);
323323
externvoid*PQsslStruct(PGconn*conn,constchar*struct_name);
324324
externconstchar*PQsslAttribute(PGconn*conn,constchar*attribute_name);
325-
externconstchar**PQsslAttributes(PGconn*conn);
325+
externconstchar*const*PQsslAttributeNames(PGconn*conn);
326326

327327
/* Get the OpenSSL structure associated with a connection. Returns NULL for
328328
* unencrypted connections or if any other TLS library is in use. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp