Lines Matching defs:spec
3246 /* Locate negative zero "z" option within a UTF-8 format spec string.
3248 * The portion of the spec we're working with is [[fill]align][sign][z] */
3310 mpd_spec_t spec;
3370 if (!mpd_parse_fmt_str(&spec, fmt, CtxCaps(context))) {
3379 spec.fill[0] = '\xff';
3380 spec.fill[1] = '\0';
3394 if (dict_get_item_string(override, "decimal_point", &dot, &spec.dot) ||
3395 dict_get_item_string(override, "thousands_sep", &sep, &spec.sep) ||
3396 dict_get_item_string(override, "grouping", &grouping, &spec.grouping))
3400 if (mpd_validate_lconv(&spec) < 0) {
3407 size_t n = strlen(spec.dot);
3408 if (n > 1 || (n == 1 && !isascii((unsigned char)spec.dot[0]))) {
3410 dot = dotsep_as_utf8(spec.dot);
3414 spec.dot = PyBytes_AS_STRING(dot);
3416 n = strlen(spec.sep);
3417 if (n > 1 || (n == 1 && !isascii((unsigned char)spec.sep[0]))) {
3419 sep = dotsep_as_utf8(spec.sep);
3423 spec.sep = PyBytes_AS_STRING(sep);
3433 if (spec.prec >= 0) {
3434 switch (spec.type) {
3436 mpd_qrescale(&tmp, &tmp, -spec.prec, CTX(context), &status);
3440 mpd_qrescale(&tmp, &tmp, -spec.prec, CTX(context), &status);
3443 prec = (spec.prec == 0) ? 1 : spec.prec;
3450 _mpd_round(&tmp, &tmp, spec.prec+1, CTX(context), &status);
3465 decstring = mpd_qformat_spec(mpd, &spec, CTX(context), &status);