linux/drivers/firmware/efi/libstub/vsprintf.c

// SPDX-License-Identifier: GPL-2.0-only
/* -*- linux-c -*- ------------------------------------------------------- *
 *
 *   Copyright (C) 1991, 1992 Linus Torvalds
 *   Copyright 2007 rPath, Inc. - All Rights Reserved
 *
 * ----------------------------------------------------------------------- */

/*
 * Oh, it's a waste of space, but oh-so-yummy for debugging.
 */

#include <linux/stdarg.h>

#include <linux/compiler.h>
#include <linux/ctype.h>
#include <linux/kernel.h>
#include <linux/limits.h>
#include <linux/string.h>
#include <linux/types.h>

static
int skip_atoi(const char **s)
{}

/*
 * put_dec_full4 handles numbers in the range 0 <= r < 10000.
 * The multiplier 0xccd is round(2^15/10), and the approximation
 * r/10 == (r * 0xccd) >> 15 is exact for all r < 16389.
 */
static
void put_dec_full4(char *end, unsigned int r)
{}

/* put_dec is copied from lib/vsprintf.c with small modifications */

/*
 * Call put_dec_full4 on x % 10000, return x / 10000.
 * The approximation x/10000 == (x * 0x346DC5D7) >> 43
 * holds for all x < 1,128,869,999.  The largest value this
 * helper will ever be asked to convert is 1,125,520,955.
 * (second call in the put_dec code, assuming n is all-ones).
 */
static
unsigned int put_dec_helper4(char *end, unsigned int x)
{}

/* Based on code by Douglas W. Jones found at
 * <http://www.cs.uiowa.edu/~jones/bcd/decimal.html#sixtyfour>
 * (with permission from the author).
 * Performs no 64-bit division and hence should be fast on 32-bit machines.
 */
static
char *put_dec(char *end, unsigned long long n)
{}

static
char *number(char *end, unsigned long long num, int base, char locase)
{}

#define ZEROPAD
#define SIGN
#define PLUS
#define SPACE
#define LEFT
#define SMALL
#define SPECIAL
#define WIDE

static
int get_flags(const char **fmt)
{}

static
int get_int(const char **fmt, va_list *ap)
{}

static
unsigned long long get_number(int sign, int qualifier, va_list *ap)
{}

static
char get_sign(long long *num, int flags)
{}

static
size_t utf16s_utf8nlen(const u16 *s16, size_t maxlen)
{}

static
u32 utf16_to_utf32(const u16 **s16)
{}

#define PUTC(c)

int vsnprintf(char *buf, size_t size, const char *fmt, va_list ap)
{}

int snprintf(char *buf, size_t size, const char *fmt, ...)
{}