~ubuntu-branches/ubuntu/lucid/python2.6/lucid

« back to all changes in this revision

Viewing changes to Doc/c-api/string.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-10-03 12:03:05 UTC
  • mto: (10.1.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20091003120305-hij6yssh0figh590
Tags: upstream-2.6.3
ImportĀ upstreamĀ versionĀ 2.6.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
   *len* on success, and *NULL* on failure.  If *v* is *NULL*, the contents of the
59
59
   string are uninitialized.
60
60
 
 
61
   .. versionchanged:: 2.5
 
62
      This function used an :ctype:`int` type for *len*. This might require
 
63
      changes in your code for properly supporting 64-bit systems.
 
64
 
61
65
 
62
66
.. cfunction:: PyObject* PyString_FromFormat(const char *format, ...)
63
67
 
132
136
 
133
137
   Return the length of the string in string object *string*.
134
138
 
 
139
   .. versionchanged:: 2.5
 
140
      This function returned an :ctype:`int` type. This might require changes
 
141
      in your code for properly supporting 64-bit systems.
 
142
 
135
143
 
136
144
.. cfunction:: Py_ssize_t PyString_GET_SIZE(PyObject *string)
137
145
 
138
146
   Macro form of :cfunc:`PyString_Size` but without error checking.
139
147
 
 
148
   .. versionchanged:: 2.5
 
149
      This macro returned an :ctype:`int` type. This might require changes in
 
150
      your code for properly supporting 64-bit systems.
 
151
 
140
152
 
141
153
.. cfunction:: char* PyString_AsString(PyObject *string)
142
154
 
172
184
   *string* and operates on that.  If *string* is not a string object at all,
173
185
   :cfunc:`PyString_AsStringAndSize` returns ``-1`` and raises :exc:`TypeError`.
174
186
 
 
187
   .. versionchanged:: 2.5
 
188
      This function used an :ctype:`int *` type for *length*. This might
 
189
      require changes in your code for properly supporting 64-bit systems.
 
190
 
175
191
 
176
192
.. cfunction:: void PyString_Concat(PyObject **string, PyObject *newpart)
177
193
 
200
216
   fails, the original string object at *\*string* is deallocated, *\*string* is
201
217
   set to *NULL*, a memory exception is set, and ``-1`` is returned.
202
218
 
 
219
   .. versionchanged:: 2.5
 
220
      This function used an :ctype:`int` type for *newsize*. This might
 
221
      require changes in your code for properly supporting 64-bit systems.
203
222
 
204
223
.. cfunction:: PyObject* PyString_Format(PyObject *format, PyObject *args)
205
224
 
236
255
   The codec to be used is looked up using the Python codec registry.  Return
237
256
   *NULL* if an exception was raised by the codec.
238
257
 
 
258
   .. versionchanged:: 2.5
 
259
      This function used an :ctype:`int` type for *size*. This might require
 
260
      changes in your code for properly supporting 64-bit systems.
 
261
 
239
262
 
240
263
.. cfunction:: PyObject* PyString_AsDecodedObject(PyObject *str, const char *encoding, const char *errors)
241
264
 
254
277
   :meth:`encode` method. The codec to be used is looked up using the Python codec
255
278
   registry.  Return *NULL* if an exception was raised by the codec.
256
279
 
 
280
   .. versionchanged:: 2.5
 
281
      This function used an :ctype:`int` type for *size*. This might require
 
282
      changes in your code for properly supporting 64-bit systems.
 
283
 
257
284
 
258
285
.. cfunction:: PyObject* PyString_AsEncodedObject(PyObject *str, const char *encoding, const char *errors)
259
286