-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: uuid: code refactor for proper maintain between uuid bin and string
Changes in lib/uuid.c to: - uuid_str_to_bin() - uuid_bin_to_str() New parameter is added to specify input/output string format in listed functions This change allows easy recognize which UUID type is or should be stored in given string array. Binary data of UUID and GUID is always stored in big endian, only string representations are different as follows. String byte: 0 36 String char: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx string UUID: be be be be be string GUID: le le le be be This patch also updates functions calls and declarations in a whole code. Signed-off-by: Przemyslaw Marczak <[email protected]> Cc: Stephen Warren <[email protected]> Cc: Lukasz Majewski <[email protected]> Cc: [email protected]
- Loading branch information
1 parent
a96a0e6
commit d718ded
Showing
5 changed files
with
91 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (C) 2014 Samsung Electronics | ||
* Przemyslaw Marczak <[email protected]> | ||
* | ||
* SPDX-License-Identifier: GPL-2.0+ | ||
*/ | ||
#ifndef __UUID_H__ | ||
#define __UUID_H__ | ||
|
||
enum { | ||
UUID_STR_FORMAT_STD, | ||
UUID_STR_FORMAT_GUID | ||
}; | ||
|
||
#define UUID_STR_LEN 36 | ||
#define UUID_BIN_LEN 16 | ||
|
||
int uuid_str_valid(const char *uuid); | ||
int uuid_str_to_bin(char *uuid_str, unsigned char *uuid_bin, int str_format); | ||
void uuid_bin_to_str(unsigned char *uuid_bin, char *uuid_str, int str_format); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters