Changeset 77a194c in mainline for uspace/lib/clui/nchoice.h
- Timestamp:
- 2015-11-04T18:55:46Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 44183b98
- Parents:
- 5265eea4 (diff), bfcde8d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/clui/nchoice.h
r5265eea4 r77a194c 1 1 /* 2 * Copyright (c) 2009 Jiri Svoboda 3 * Copyright (c) 2011-2013 Dominik Taborsky 2 * Copyright (c) 2015 Jiri Svoboda 4 3 * All rights reserved. 5 4 * … … 28 27 */ 29 28 30 /** @addtogroup lib gpt29 /** @addtogroup libclui 31 30 * @{ 32 31 */ 33 /** @file 32 /** 33 * @file Numerical choice 34 34 */ 35 35 36 #ifndef LIBGPT_GPT_H_ 37 #define LIBGPT_GPT_H_ 36 #ifndef LIBCLUI_NCHOICE_H_ 37 #define LIBCLUI_NCHOICE_H_ 38 39 #include <adt/list.h> 40 #include <tinput.h> 38 41 39 42 typedef enum { 40 AT_REQ_PART = 0, 41 AT_NO_BLOCK_IO, 42 AT_LEGACY_BOOT, 43 AT_UNDEFINED, 44 AT_SPECIFIC = 48 45 } gpt_attr_t; 43 /** This is the default option */ 44 ncf_default = 1 45 } nchoice_flag_t; 46 46 47 /** GPT header */48 47 typedef struct { 49 uint8_t efi_signature[8]; 50 uint8_t revision[4]; 51 uint32_t header_size; 52 uint32_t header_crc32; 53 uint32_t reserved; 54 uint64_t current_lba; 55 uint64_t alternate_lba; 56 uint64_t first_usable_lba; 57 uint64_t last_usable_lba; 58 uint8_t disk_guid[16]; 59 uint64_t entry_lba; 60 uint32_t fillries; 61 uint32_t entry_size; 62 uint32_t pe_array_crc32; 63 } __attribute__((packed)) gpt_header_t; 48 /** Link to nchoice_t.opts */ 49 link_t lchoice; 50 /** Option text */ 51 char *text; 52 /** User argument */ 53 void *arg; 54 } nchoice_opt_t; 64 55 65 /** GPT partition entry */66 56 typedef struct { 67 uint8_t part_type[16]; 68 uint8_t part_id[16]; 69 uint64_t start_lba; 70 uint64_t end_lba; 71 uint64_t attributes; 72 uint8_t part_name[72]; 73 } __attribute__((packed)) gpt_entry_t; 57 /** Prompt text */ 58 char *prompt; 59 /** Options */ 60 list_t opts; /* of nchoice_opt_t */ 61 /** Text input */ 62 tinput_t *tinput; 63 /** Default option */ 64 nchoice_opt_t *def_opt; 65 } nchoice_t; 66 67 extern int nchoice_create(nchoice_t **); 68 extern void nchoice_destroy(nchoice_t *); 69 extern int nchoice_set_prompt(nchoice_t *, const char *); 70 extern int nchoice_add(nchoice_t *, const char *, void *, nchoice_flag_t); 71 extern int nchoice_get(nchoice_t *, void **); 74 72 75 73 #endif 74 75 /** @} 76 */
Note:
See TracChangeset
for help on using the changeset viewer.