Teks sumber — English
Terjemahan — Bahasa Indonesia
Functions for number conversion and formatted string output.
Fungsi-fungsi untuk konversi angka dan output string yang diformat
:c:func:`PyOS_snprintf` and :c:func:`PyOS_vsnprintf` wrap the Standard C library functions :c:func:`snprintf` and :c:func:`vsnprintf`. Their purpose is to guarantee consistent behavior in corner cases, which the Standard C functions do not.
The wrappers ensure that ``str[size-1]`` is always ``'\0'`` upon return. They never write more than *size* bytes (including the trailing ``'\0'``) into str. Both functions require that ``str != NULL``, ``size > 0``, ``format != NULL`` and ``size < INT_MAX``. Note that this means there is no equivalent to the C99 ``n = snprintf(NULL, 0, ...)`` which would determine the necessary buffer size.
The return value (*rv*) for these functions should be interpreted as follows:
The following functions provide locale-independent string to number conversions.
Case insensitive comparison of strings. These functions work almost identically to :c:func:`!strcmp` and :c:func:`!strncmp` (respectively), except that they ignore the case of ASCII characters.
These functions do not use the locale.