Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Simon Glass | f7ae6806 | 2011-11-02 09:52:07 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2000-2009 |
| 4 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
Simon Glass | f7ae6806 | 2011-11-02 09:52:07 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef __VSPRINTF_H |
| 8 | #define __VSPRINTF_H |
| 9 | |
Maxime Ripard | 9f6903f | 2016-07-05 10:26:36 +0200 | [diff] [blame] | 10 | #include <stdarg.h> |
Masahiro Yamada | 70ed993 | 2017-09-16 14:10:43 +0900 | [diff] [blame] | 11 | #include <linux/types.h> |
Maxime Ripard | 9f6903f | 2016-07-05 10:26:36 +0200 | [diff] [blame] | 12 | |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 13 | /** |
| 14 | * simple_strtoul - convert a string to an unsigned long |
| 15 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 16 | * @cp: The string to be converted |
| 17 | * @endp: Updated to point to the first character not converted |
| 18 | * @base: The number base to use (0 for the default) |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 19 | * Return: value decoded from string (0 if invalid) |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 20 | * |
| 21 | * Converts a string to an unsigned long. If there are invalid characters at |
| 22 | * the end these are ignored. In the worst case, if all characters are invalid, |
| 23 | * 0 is returned |
Simon Glass | f0722ed | 2021-07-24 09:03:31 -0600 | [diff] [blame] | 24 | * |
Simon Glass | 90877bb | 2021-07-24 09:03:38 -0600 | [diff] [blame] | 25 | * A hex prefix is supported (e.g. 0x123) regardless of the value of @base. |
| 26 | * If found, the base is set to hex (16). |
| 27 | * |
| 28 | * If @base is 0: |
| 29 | * - an octal '0' prefix (e.g. 0777) sets the base to octal (8). |
| 30 | * - otherwise the base defaults to decimal (10). |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 31 | */ |
Simon Glass | f7ae6806 | 2011-11-02 09:52:07 +0000 | [diff] [blame] | 32 | ulong simple_strtoul(const char *cp, char **endp, unsigned int base); |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 33 | |
| 34 | /** |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 35 | * hex_strtoul - convert a string in hex to an unsigned long |
| 36 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 37 | * @cp: The string to be converted |
| 38 | * @endp: Updated to point to the first character not converted |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 39 | * Return: value decoded from string (0 if invalid) |
Simon Glass | 3ff49ec | 2021-07-24 09:03:29 -0600 | [diff] [blame] | 40 | * |
| 41 | * Converts a hex string to an unsigned long. If there are invalid characters at |
| 42 | * the end these are ignored. In the worst case, if all characters are invalid, |
| 43 | * 0 is returned |
| 44 | */ |
| 45 | unsigned long hextoul(const char *cp, char **endp); |
| 46 | |
| 47 | /** |
Simon Glass | ff9b903 | 2021-07-24 09:03:30 -0600 | [diff] [blame] | 48 | * dec_strtoul - convert a string in decimal to an unsigned long |
| 49 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 50 | * @cp: The string to be converted |
| 51 | * @endp: Updated to point to the first character not converted |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 52 | * Return: value decoded from string (0 if invalid) |
Simon Glass | ff9b903 | 2021-07-24 09:03:30 -0600 | [diff] [blame] | 53 | * |
| 54 | * Converts a decimal string to an unsigned long. If there are invalid |
| 55 | * characters at the end these are ignored. In the worst case, if all characters |
| 56 | * are invalid, 0 is returned |
| 57 | */ |
| 58 | unsigned long dectoul(const char *cp, char **endp); |
| 59 | |
| 60 | /** |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 61 | * strict_strtoul - convert a string to an unsigned long strictly |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 62 | * @cp: The string to be converted |
| 63 | * @base: The number base to use (0 for the default) |
| 64 | * @res: The converted result value |
| 65 | * Return: 0 if conversion is successful and `*res` is set to the converted |
| 66 | * value, otherwise it returns -EINVAL and `*res` is set to 0. |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 67 | * |
| 68 | * strict_strtoul converts a string to an unsigned long only if the |
| 69 | * string is really an unsigned long string, any string containing |
| 70 | * any invalid char at the tail will be rejected and -EINVAL is returned, |
| 71 | * only a newline char at the tail is acceptible because people generally |
| 72 | * change a module parameter in the following way: |
| 73 | * |
| 74 | * echo 1024 > /sys/module/e1000/parameters/copybreak |
| 75 | * |
| 76 | * echo will append a newline to the tail. |
| 77 | * |
Simon Glass | 90877bb | 2021-07-24 09:03:38 -0600 | [diff] [blame] | 78 | * A hex prefix is supported (e.g. 0x123) regardless of the value of @base. |
| 79 | * If found, the base is set to hex (16). |
| 80 | * |
| 81 | * If @base is 0: |
| 82 | * - an octal '0' prefix (e.g. 0777) sets the base to octal (8). |
| 83 | * - otherwise the base defaults to decimal (10). |
Simon Glass | f0722ed | 2021-07-24 09:03:31 -0600 | [diff] [blame] | 84 | * |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 85 | * Copied this function from Linux 2.6.38 commit ID: |
| 86 | * 521cb40b0c44418a4fd36dc633f575813d59a43d |
| 87 | * |
| 88 | */ |
Simon Glass | f7ae6806 | 2011-11-02 09:52:07 +0000 | [diff] [blame] | 89 | int strict_strtoul(const char *cp, unsigned int base, unsigned long *res); |
| 90 | unsigned long long simple_strtoull(const char *cp, char **endp, |
| 91 | unsigned int base); |
| 92 | long simple_strtol(const char *cp, char **endp, unsigned int base); |
Roland Gaudig | fd8b034 | 2021-07-23 12:29:18 +0000 | [diff] [blame] | 93 | long long simple_strtoll(const char *cp, char **endp, unsigned int base); |
Simon Glass | 509dbf9 | 2015-02-27 22:06:32 -0700 | [diff] [blame] | 94 | |
| 95 | /** |
Simon Glass | 4aaa460 | 2015-06-23 15:39:08 -0600 | [diff] [blame] | 96 | * trailing_strtol() - extract a trailing integer from a string |
| 97 | * |
| 98 | * Given a string this finds a trailing number on the string and returns it. |
| 99 | * For example, "abc123" would return 123. |
| 100 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 101 | * @str: String to examine |
Simon Glass | e74efcd | 2022-04-24 23:30:55 -0600 | [diff] [blame] | 102 | * Return: trailing number if found, else -1 |
Simon Glass | 4aaa460 | 2015-06-23 15:39:08 -0600 | [diff] [blame] | 103 | */ |
| 104 | long trailing_strtol(const char *str); |
| 105 | |
| 106 | /** |
| 107 | * trailing_strtoln() - extract a trailing integer from a fixed-length string |
| 108 | * |
| 109 | * Given a fixed-length string this finds a trailing number on the string |
| 110 | * and returns it. For example, "abc123" would return 123. Only the |
| 111 | * characters between @str and @end - 1 are examined. If @end is NULL, it is |
| 112 | * set to str + strlen(str). |
| 113 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 114 | * @str: String to examine |
Simon Glass | 4aaa460 | 2015-06-23 15:39:08 -0600 | [diff] [blame] | 115 | * @end: Pointer to end of string to examine, or NULL to use the |
| 116 | * whole string |
Simon Glass | e74efcd | 2022-04-24 23:30:55 -0600 | [diff] [blame] | 117 | * Return: trailing number if found, else -1 |
Simon Glass | 4aaa460 | 2015-06-23 15:39:08 -0600 | [diff] [blame] | 118 | */ |
| 119 | long trailing_strtoln(const char *str, const char *end); |
| 120 | |
| 121 | /** |
Simon Glass | 509dbf9 | 2015-02-27 22:06:32 -0700 | [diff] [blame] | 122 | * panic() - Print a message and reset/hang |
| 123 | * |
| 124 | * Prints a message on the console(s) and then resets. If CONFIG_PANIC_HANG is |
Vagrant Cascadian | 259b1fb | 2016-10-23 20:45:19 -0700 | [diff] [blame] | 125 | * defined, then it will hang instead of resetting. |
Simon Glass | 509dbf9 | 2015-02-27 22:06:32 -0700 | [diff] [blame] | 126 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 127 | * @fmt: printf() format string for message, which should not include |
Simon Glass | 509dbf9 | 2015-02-27 22:06:32 -0700 | [diff] [blame] | 128 | * \n, followed by arguments |
| 129 | */ |
Simon Glass | f7ae6806 | 2011-11-02 09:52:07 +0000 | [diff] [blame] | 130 | void panic(const char *fmt, ...) |
| 131 | __attribute__ ((format (__printf__, 1, 2), noreturn)); |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 132 | |
| 133 | /** |
Simon Glass | 509dbf9 | 2015-02-27 22:06:32 -0700 | [diff] [blame] | 134 | * panic_str() - Print a message and reset/hang |
| 135 | * |
| 136 | * Prints a message on the console(s) and then resets. If CONFIG_PANIC_HANG is |
Vagrant Cascadian | 259b1fb | 2016-10-23 20:45:19 -0700 | [diff] [blame] | 137 | * defined, then it will hang instead of resetting. |
Simon Glass | 509dbf9 | 2015-02-27 22:06:32 -0700 | [diff] [blame] | 138 | * |
| 139 | * This function can be used instead of panic() when your board does not |
| 140 | * already use printf(), * to keep code size small. |
| 141 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 142 | * @str: string to display, which should not include \n |
Simon Glass | 509dbf9 | 2015-02-27 22:06:32 -0700 | [diff] [blame] | 143 | */ |
| 144 | void panic_str(const char *str) __attribute__ ((noreturn)); |
| 145 | |
| 146 | /** |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 147 | * Format a string and place it in a buffer |
| 148 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 149 | * @buf: The buffer to place the result into |
| 150 | * @fmt: The format string to use |
| 151 | * @...: Arguments for the format string |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 152 | * |
| 153 | * The function returns the number of characters written |
| 154 | * into @buf. |
| 155 | * |
| 156 | * See the vsprintf() documentation for format string extensions over C99. |
| 157 | */ |
Simon Glass | f7ae6806 | 2011-11-02 09:52:07 +0000 | [diff] [blame] | 158 | int sprintf(char *buf, const char *fmt, ...) |
| 159 | __attribute__ ((format (__printf__, 2, 3))); |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 160 | |
| 161 | /** |
| 162 | * Format a string and place it in a buffer (va_list version) |
| 163 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 164 | * @buf: The buffer to place the result into |
| 165 | * @fmt: The format string to use |
| 166 | * @args: Arguments for the format string |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 167 | * Return: the number of characters which have been written into |
Heinrich Schuchardt | 2066253 | 2017-09-06 17:55:13 +0200 | [diff] [blame] | 168 | * the @buf not including the trailing '\0'. |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 169 | * |
| 170 | * If you're not already dealing with a va_list consider using scnprintf(). |
| 171 | * |
| 172 | * See the vsprintf() documentation for format string extensions over C99. |
| 173 | */ |
Simon Glass | f7ae6806 | 2011-11-02 09:52:07 +0000 | [diff] [blame] | 174 | int vsprintf(char *buf, const char *fmt, va_list args); |
Simon Glass | 978739d | 2021-10-14 12:48:06 -0600 | [diff] [blame] | 175 | |
| 176 | /** |
| 177 | * simple_itoa() - convert an unsigned integer to a string |
| 178 | * |
| 179 | * This returns a static string containing the decimal representation of the |
Simon Glass | 1f46718 | 2021-10-14 12:48:07 -0600 | [diff] [blame] | 180 | * given value. The returned value may be overwritten by other calls to other |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 181 | * simple... functions, so should be used immediately |
Simon Glass | 978739d | 2021-10-14 12:48:06 -0600 | [diff] [blame] | 182 | * |
| 183 | * @val: Value to convert |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 184 | * Return: string containing the decimal representation of @val |
Simon Glass | 978739d | 2021-10-14 12:48:06 -0600 | [diff] [blame] | 185 | */ |
| 186 | char *simple_itoa(ulong val); |
Simon Glass | f7ae6806 | 2011-11-02 09:52:07 +0000 | [diff] [blame] | 187 | |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 188 | /** |
Simon Glass | 1f46718 | 2021-10-14 12:48:07 -0600 | [diff] [blame] | 189 | * simple_xtoa() - convert an unsigned integer to a hex string |
| 190 | * |
| 191 | * This returns a static string containing the hexadecimal representation of the |
| 192 | * given value. The returned value may be overwritten by other calls to other |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 193 | * simple... functions, so should be used immediately |
Simon Glass | 1f46718 | 2021-10-14 12:48:07 -0600 | [diff] [blame] | 194 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 195 | * @num: Value to convert |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 196 | * Return: string containing the hexecimal representation of @val |
Simon Glass | 1f46718 | 2021-10-14 12:48:07 -0600 | [diff] [blame] | 197 | */ |
| 198 | char *simple_xtoa(ulong num); |
| 199 | |
| 200 | /** |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 201 | * Format a string and place it in a buffer |
| 202 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 203 | * @buf: The buffer to place the result into |
| 204 | * @size: The size of the buffer, including the trailing null space |
| 205 | * @fmt: The format string to use |
| 206 | * @...: Arguments for the format string |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 207 | * Return: the number of characters which would be |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 208 | * generated for the given input, excluding the trailing null, |
| 209 | * as per ISO C99. If the return is greater than or equal to |
| 210 | * @size, the resulting string is truncated. |
| 211 | * |
| 212 | * See the vsprintf() documentation for format string extensions over C99. |
| 213 | */ |
Sonny Rao | cd55bde | 2011-11-02 09:52:08 +0000 | [diff] [blame] | 214 | int snprintf(char *buf, size_t size, const char *fmt, ...) |
| 215 | __attribute__ ((format (__printf__, 3, 4))); |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 216 | |
| 217 | /** |
| 218 | * Format a string and place it in a buffer |
| 219 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 220 | * @buf: The buffer to place the result into |
| 221 | * @size: The size of the buffer, including the trailing null space |
| 222 | * @fmt: The format string to use |
| 223 | * @...: Arguments for the format string |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 224 | * |
| 225 | * The return value is the number of characters written into @buf not including |
| 226 | * the trailing '\0'. If @size is == 0 the function returns 0. |
| 227 | * |
| 228 | * See the vsprintf() documentation for format string extensions over C99. |
| 229 | */ |
Sonny Rao | cd55bde | 2011-11-02 09:52:08 +0000 | [diff] [blame] | 230 | int scnprintf(char *buf, size_t size, const char *fmt, ...) |
| 231 | __attribute__ ((format (__printf__, 3, 4))); |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 232 | |
| 233 | /** |
| 234 | * Format a string and place it in a buffer (base function) |
| 235 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 236 | * @buf: The buffer to place the result into |
| 237 | * @size: The size of the buffer, including the trailing null space |
| 238 | * @fmt: The format string to use |
| 239 | * @args: Arguments for the format string |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 240 | * Return: The number characters which would be generated for the given |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 241 | * input, excluding the trailing '\0', as per ISO C99. Note that fewer |
| 242 | * characters may be written if this number of characters is >= size. |
| 243 | * |
| 244 | * This function follows C99 vsnprintf, but has some extensions: |
| 245 | * %pS output the name of a text symbol |
| 246 | * %pF output the name of a function pointer |
| 247 | * %pR output the address range in a struct resource |
| 248 | * |
| 249 | * The function returns the number of characters which would be |
| 250 | * generated for the given input, excluding the trailing '\0', |
| 251 | * as per ISO C99. |
| 252 | * |
| 253 | * Call this function if you are already dealing with a va_list. |
| 254 | * You probably want snprintf() instead. |
| 255 | */ |
Sonny Rao | cd55bde | 2011-11-02 09:52:08 +0000 | [diff] [blame] | 256 | int vsnprintf(char *buf, size_t size, const char *fmt, va_list args); |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 257 | |
| 258 | /** |
| 259 | * Format a string and place it in a buffer (va_list version) |
| 260 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 261 | * @buf: The buffer to place the result into |
| 262 | * @size: The size of the buffer, including the trailing null space |
| 263 | * @fmt: The format string to use |
| 264 | * @args: Arguments for the format string |
Heinrich Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 265 | * Return: the number of characters which have been written into |
Simon Glass | 71d4f18 | 2011-11-02 09:52:09 +0000 | [diff] [blame] | 266 | * the @buf not including the trailing '\0'. If @size is == 0 the function |
| 267 | * returns 0. |
| 268 | * |
| 269 | * If you're not already dealing with a va_list consider using scnprintf(). |
| 270 | * |
| 271 | * See the vsprintf() documentation for format string extensions over C99. |
| 272 | */ |
Sonny Rao | cd55bde | 2011-11-02 09:52:08 +0000 | [diff] [blame] | 273 | int vscnprintf(char *buf, size_t size, const char *fmt, va_list args); |
Sonny Rao | cd55bde | 2011-11-02 09:52:08 +0000 | [diff] [blame] | 274 | |
Simon Glass | b09cfd8 | 2013-06-11 11:14:38 -0700 | [diff] [blame] | 275 | /** |
| 276 | * print_grouped_ull() - print a value with digits grouped by ',' |
| 277 | * |
| 278 | * This prints a value with grouped digits, like 12,345,678 to make it easier |
| 279 | * to read. |
| 280 | * |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 281 | * @int_val: Value to print |
| 282 | * @digits: Number of digiits to print |
Simon Glass | b09cfd8 | 2013-06-11 11:14:38 -0700 | [diff] [blame] | 283 | */ |
| 284 | void print_grouped_ull(unsigned long long int_val, int digits); |
| 285 | |
Heiko Schocher | 7e5a16c | 2015-04-27 07:42:05 +0200 | [diff] [blame] | 286 | bool str2off(const char *p, loff_t *num); |
| 287 | bool str2long(const char *p, ulong *num); |
Simon Glass | f5c208d | 2019-11-14 12:57:20 -0700 | [diff] [blame] | 288 | |
| 289 | /** |
| 290 | * strmhz() - Convert a value to a Hz string |
| 291 | * |
| 292 | * This creates a string indicating the number of MHz of a value. For example, |
| 293 | * 2700000 produces "2.7". |
| 294 | * @buf: Buffer to hold output string, which must be large enough |
| 295 | * @hz: Value to convert |
| 296 | */ |
| 297 | char *strmhz(char *buf, unsigned long hz); |
Simon Glass | 811a260 | 2020-04-08 08:32:56 -0600 | [diff] [blame] | 298 | |
| 299 | /** |
| 300 | * str_to_upper() - Convert a string to upper case |
| 301 | * |
| 302 | * This simply uses toupper() on each character of the string. |
| 303 | * |
| 304 | * @in: String to convert (must be large enough to hold the output string) |
| 305 | * @out: Buffer to put converted string |
| 306 | * @len: Number of bytes available in @out (SIZE_MAX for all) |
| 307 | */ |
| 308 | void str_to_upper(const char *in, char *out, size_t len); |
| 309 | |
Andrii Anisov | 6e29ac4 | 2020-08-06 12:42:52 +0300 | [diff] [blame] | 310 | /** |
Samuel Dionne-Riel | de46493 | 2021-12-20 18:19:16 -0500 | [diff] [blame] | 311 | * vsscanf - Unformat a buffer into a list of arguments |
Simon Glass | b2c6f09 | 2022-04-24 23:30:56 -0600 | [diff] [blame^] | 312 | * @inp: input buffer |
| 313 | * @fmt0: format of buffer |
| 314 | * @ap: arguments |
Samuel Dionne-Riel | de46493 | 2021-12-20 18:19:16 -0500 | [diff] [blame] | 315 | */ |
| 316 | int vsscanf(const char *inp, char const *fmt0, va_list ap); |
| 317 | |
| 318 | /** |
Andrii Anisov | 6e29ac4 | 2020-08-06 12:42:52 +0300 | [diff] [blame] | 319 | * sscanf - Unformat a buffer into a list of arguments |
| 320 | * @buf: input buffer |
| 321 | * @fmt: formatting of buffer |
| 322 | * @...: resulting arguments |
| 323 | */ |
| 324 | int sscanf(const char *buf, const char *fmt, ...); |
| 325 | |
Simon Glass | f7ae6806 | 2011-11-02 09:52:07 +0000 | [diff] [blame] | 326 | #endif |