Lines Matching refs:format
44 /* The translation function for each format character is table driven */
46 char format;
116 """.format(argname=argname, paramname=self.name,
128 /* Helper for integer format codes: converts an arbitrary Python object to a
351 /* Helper to format the range error exceptions */
367 "'%c' format requires 0 <= number <= %zu",
368 f->format,
373 "'%c' format requires %zd <= number <= %zd",
374 f->format,
552 "byte format requires -128 <= number <= 127");
567 "ubyte format requires 0 <= number <= 255");
579 "char format requires a bytes object of length 1");
595 "short format requires %d <= number <= %d",
613 "ushort format requires 0 <= number <= %u",
1259 /* Get the table entry for a format code */
1264 for (; f->format != '\0'; f++) {
1265 if (f->format == c) {
1269 PyErr_SetString(state->StructError, "bad char in struct format");
1274 /* Align a size according to a format code. Return -1 on overflow. */
1281 if (e->format == c) {
1296 /* calculate the size of a format string */
1342 "repeat count given without format specifier");
1459 format: object
1464 the format string.
1466 See help(struct) for more on format strings.
1470 Struct___init___impl(PyStructObject *self, PyObject *format)
1475 if (PyUnicode_Check(format)) {
1476 format = PyUnicode_AsASCIIString(format);
1477 if (format == NULL)
1481 Py_INCREF(format);
1484 if (!PyBytes_Check(format)) {
1485 Py_DECREF(format);
1489 _PyType_Name(Py_TYPE(format)));
1493 Py_SETREF(self->s_format, format);
1545 if (e->format == 's') {
1547 } else if (e->format == 'p') {
1577 Unpack according to the format string Struct.format. The buffer's size
1580 See help(struct) for more on format strings.
1606 Values are unpacked according to the format string Struct.format.
1611 See help(struct) for more on format strings.
1828 if (e->format == 's') {
1850 } else if (e->format == 'p') {
1896 to the format string S.format. See help(struct) for more on format\n\
1938 Pack the values v1, v2, ... according to the format string S.format\n\
1941 help(struct) for more on format strings.");
2083 {"format", (getter)s_get_format, (setter)NULL, "struct format string", NULL},
2183 format as s_object: cache_struct
2186 Return size in bytes of the struct described by the format string.
2197 "pack(format, v1, v2, ...) -> bytes\n\
2200 to the format string. See help(struct) for more on format strings.");
2206 PyObject *format, *result;
2209 PyErr_SetString(PyExc_TypeError, "missing format argument");
2212 format = args[0];
2214 if (!cache_struct_converter(module, format, (PyStructObject **)&s_object)) {
2223 "pack_into(format, buffer, offset, v1, v2, ...)\n\
2225 Pack the values v1, v2, ... according to the format string and write\n\
2228 on format strings.");
2234 PyObject *format, *result;
2237 PyErr_SetString(PyExc_TypeError, "missing format argument");
2240 format = args[0];
2242 if (!cache_struct_converter(module, format, (PyStructObject **)&s_object)) {
2253 format as s_object: cache_struct
2257 Return a tuple containing values unpacked according to the format string.
2259 The buffer's size in bytes must be calcsize(format).
2261 See help(struct) for more on format strings.
2274 format as s_object: cache_struct
2279 Return a tuple containing values unpacked according to the format string.
2281 The buffer's size, minus offset, must be at least calcsize(format).
2283 See help(struct) for more on format strings.
2297 format as s_object: cache_struct
2303 The bytes are unpacked according to the format string, like
2306 Requires that the bytes length be a multiple of the format struct size.
2334 and also as format strings (explained below) to describe the layout of data\n\
2337 The optional first format char indicates byte order, size and alignment:\n\
2352 Special cases (only available in native format):\n\
2427 while (native->format != '\0' && other->format != '\0') {
2429 while (ptr->format != '\0') {
2430 if (ptr->format == native->format) {
2440 "unknown" float format */
2441 if (ptr->format == 'd' || ptr->format == 'f')
2444 if (ptr->format == '?')