int ptype_uint64_print(struct ptype *p, char *val, size_t size, char *format) { uint64_t *v = p->value; if (format) { int argtypes[1]; int tot = parse_printf_format(format, 1, argtypes); if (tot > 1 || (argtypes[0] & ~PA_FLAG_MASK) != PA_INT) { format = "%"PRIu64; } } else { format = "%"PRIu64; } return snprintf(val, size, format, (uint64_t)*v); }
static int query_parse_option(struct tunefs_operation *op, char *arg) { int argtype; if (!arg) { errorf("No query format specified\n"); return 1; } /* * We want to make sure that there are no "standard" specifiers in * the format, only our own. */ if (parse_printf_format(arg, 1, &argtype)) { errorf("Unknown type specifier in the query format: " "\"%s\"\n", arg); return 1; } op->to_private = arg; return 0; }