Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Unified Diff: src/platform/vboot_reference/utility/cgpt/cgpt.h

Issue 2231002: complete 'cgpt show' and refactor for incoming commands. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/platform/vboot_reference/utility/cgpt/cgpt.h
diff --git a/src/platform/vboot_reference/utility/cgpt/cgpt.h b/src/platform/vboot_reference/utility/cgpt/cgpt.h
index 1b837efeedb10c040544a4102bdd8ef6e28eeef5..9e5800c15bd7cb5d0ca541206e1de198309625b5 100644
--- a/src/platform/vboot_reference/utility/cgpt/cgpt.h
+++ b/src/platform/vboot_reference/utility/cgpt/cgpt.h
@@ -89,6 +89,30 @@ int OpenDriveInLastArgument(const int argc,
char *const *argv,
struct drive *drive);
+/* GUID conversion functions. Accepted format:
+ *
+ * "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
+ *
+ * At least GUID_STRLEN bytes should be reserved in 'str' (included the tailing
+ * '\0').
+ */
+#define GUID_STRLEN 37
+void StrToGuid(const char *str, Guid *guid);
+void GuidToStr(const Guid *guid, char *str);
+
+/* Convert UTF16 string to UTF8. Rewritten from gpt utility.
+ * Caller must prepare enough space for UTF8. The rough estimation is:
+ *
+ * utf8 length = bytecount(utf16) * 1.5
+ */
+void UTF16ToUTF8(const uint16_t *utf16, uint8_t *utf8);
+/* Convert UTF8 string to UTF16. Rewritten from gpt utility.
+ * Caller must prepare enough space for UTF16. The conservative estimation is:
+ *
+ * utf16 bytecount = bytecount(utf8) / 3 * 4
+ */
+void UTF8ToUTF16(const uint8_t *utf8, uint16_t *utf16);
+
/* Describes the drive storing the GPT. */
struct drive {
int inited; /* indicated if this structure is valid */
@@ -112,6 +136,7 @@ extern const char* progname;
*/
int DriveOpen(const char *drive_path, struct drive *drive);
int DriveClose(struct drive *drive);
+int CheckValid(const struct drive *drive);
/* Function declarations for commands.
* The return value of these functions is passed to main()'s exit value. */
« no previous file with comments | « src/platform/vboot_reference/utility/cgpt/Makefile ('k') | src/platform/vboot_reference/utility/cgpt/cgpt.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698