mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
lib: Add a function to convert a string to a hex value
Add an xtoa() function, similar to itoa() but for hex instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Artem Lapkin <email2tema@gmail.com> Tested-by: Artem Lapkin <email2tema@gmail.com>
This commit is contained in:
parent
3bfb0f719a
commit
4a255ea3b6
3 changed files with 56 additions and 4 deletions
|
@ -177,14 +177,26 @@ int vsprintf(char *buf, const char *fmt, va_list args);
|
|||
* simple_itoa() - convert an unsigned integer to a string
|
||||
*
|
||||
* This returns a static string containing the decimal representation of the
|
||||
* given value. The returned value may be overwritten by other calls to the
|
||||
* same function, so should be used immediately
|
||||
* given value. The returned value may be overwritten by other calls to other
|
||||
* simple_... functions, so should be used immediately
|
||||
*
|
||||
* @val: Value to convert
|
||||
* @return string containing the decimal representation of @val
|
||||
*/
|
||||
char *simple_itoa(ulong val);
|
||||
|
||||
/**
|
||||
* simple_xtoa() - convert an unsigned integer to a hex string
|
||||
*
|
||||
* This returns a static string containing the hexadecimal representation of the
|
||||
* given value. The returned value may be overwritten by other calls to other
|
||||
* simple_... functions, so should be used immediately
|
||||
*
|
||||
* @val: Value to convert
|
||||
* @return string containing the hexecimal representation of @val
|
||||
*/
|
||||
char *simple_xtoa(ulong num);
|
||||
|
||||
/**
|
||||
* Format a string and place it in a buffer
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue