Commit d88471f4 authored by Brett Cannon's avatar Brett Cannon

Change signatures for arguments to "s" and friends to be the proper ``const

char *`` instead of just ``char *``.  Also added the mentioning of "const" in
some places where it was left out even when the signature already stated the
fact.

Closes bug #980925.
parent 83a64307
...@@ -384,7 +384,7 @@ and the entry in [square] brackets is the type of the C variable(s) ...@@ -384,7 +384,7 @@ and the entry in [square] brackets is the type of the C variable(s)
whose address should be passed. whose address should be passed.
\begin{description} \begin{description}
\item[\samp{s} (string or Unicode object) {[char *]}] \item[\samp{s} (string or Unicode object) {[const char *]}]
Convert a Python string or Unicode object to a C pointer to a Convert a Python string or Unicode object to a C pointer to a
character string. You must not provide storage for the string character string. You must not provide storage for the string
itself; a pointer to an existing string is stored into the character itself; a pointer to an existing string is stored into the character
...@@ -396,7 +396,7 @@ whose address should be passed. ...@@ -396,7 +396,7 @@ whose address should be passed.
raised. raised.
\item[\samp{s\#} (string, Unicode or any read buffer compatible object) \item[\samp{s\#} (string, Unicode or any read buffer compatible object)
{[char *, int]}] {[const char *, int]}]
This variant on \samp{s} stores into two C variables, the first one This variant on \samp{s} stores into two C variables, the first one
a pointer to a character string, the second one its length. In this a pointer to a character string, the second one its length. In this
case the Python string may contain embedded null bytes. Unicode case the Python string may contain embedded null bytes. Unicode
...@@ -405,12 +405,12 @@ whose address should be passed. ...@@ -405,12 +405,12 @@ whose address should be passed.
compatible objects pass back a reference to the raw internal data compatible objects pass back a reference to the raw internal data
representation. representation.
\item[\samp{z} (string or \code{None}) {[char *]}] \item[\samp{z} (string or \code{None}) {[const char *]}]
Like \samp{s}, but the Python object may also be \code{None}, in Like \samp{s}, but the Python object may also be \code{None}, in
which case the C pointer is set to \NULL. which case the C pointer is set to \NULL.
\item[\samp{z\#} (string or \code{None} or any read buffer \item[\samp{z\#} (string or \code{None} or any read buffer
compatible object) {[char *, int]}] compatible object) {[const char *, int]}]
This is to \samp{s\#} as \samp{z} is to \samp{s}. This is to \samp{s\#} as \samp{z} is to \samp{s}.
\item[\samp{u} (Unicode object) {[Py_UNICODE *]}] \item[\samp{u} (Unicode object) {[Py_UNICODE *]}]
...@@ -433,7 +433,7 @@ whose address should be passed. ...@@ -433,7 +433,7 @@ whose address should be passed.
encoded data without embedded NUL bytes. encoded data without embedded NUL bytes.
This format requires two arguments. The first is only used as This format requires two arguments. The first is only used as
input, and must be a \ctype{char*} which points to the name of an input, and must be a \ctype{const char*} which points to the name of an
encoding as a NUL-terminated string, or \NULL, in which case the encoding as a NUL-terminated string, or \NULL, in which case the
default encoding is used. An exception is raised if the named default encoding is used. An exception is raised if the named
encoding is not known to Python. The second argument must be a encoding is not known to Python. The second argument must be a
...@@ -461,7 +461,7 @@ whose address should be passed. ...@@ -461,7 +461,7 @@ whose address should be passed.
characters. characters.
It requires three arguments. The first is only used as input, and It requires three arguments. The first is only used as input, and
must be a \ctype{char*} which points to the name of an encoding as a must be a \ctype{const char*} which points to the name of an encoding as a
NUL-terminated string, or \NULL, in which case the default encoding NUL-terminated string, or \NULL, in which case the default encoding
is used. An exception is raised if the named encoding is not known is used. An exception is raised if the named encoding is not known
to Python. The second argument must be a \ctype{char**}; the value to Python. The second argument must be a \ctype{char**}; the value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment