Changeset 77a194c in mainline for uspace/lib/clui/nchoice.h


Ignore:
Timestamp:
2015-11-04T18:55:46Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
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.
Message:

Merge new disk partitioning architecture.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/clui/nchoice.h

    r5265eea4 r77a194c  
    11/*
    2  * Copyright (c) 2009 Jiri Svoboda
    3  * Copyright (c) 2011-2013 Dominik Taborsky
     2 * Copyright (c) 2015 Jiri Svoboda
    43 * All rights reserved.
    54 *
     
    2827 */
    2928
    30 /** @addtogroup libgpt
     29/** @addtogroup libclui
    3130 * @{
    3231 */
    33 /** @file
     32/**
     33 * @file Numerical choice
    3434 */
    3535
    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>
    3841
    3942typedef 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;
    4646
    47 /** GPT header */
    4847typedef 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;
    6455
    65 /** GPT partition entry */
    6656typedef 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
     67extern int nchoice_create(nchoice_t **);
     68extern void nchoice_destroy(nchoice_t *);
     69extern int nchoice_set_prompt(nchoice_t *, const char *);
     70extern int nchoice_add(nchoice_t *, const char *, void *, nchoice_flag_t);
     71extern int nchoice_get(nchoice_t *, void **);
    7472
    7573#endif
     74
     75/** @}
     76 */
Note: See TracChangeset for help on using the changeset viewer.