Changeset 77a194c in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2015-11-04T18:55:46Z (10 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.

Location:
uspace/lib/c/include
Files:
6 added
2 edited
3 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/imath.h

    r5265eea4 r77a194c  
    11/*
    2  * Copyright (c) 2012-2013 Dominik Taborsky
     2 * Copyright (c) 2015 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup hdisk
     29/** @addtogroup libc
    3030 * @{
    3131 */
    3232/** @file
     33 * @brief Integer math functions
    3334 */
    3435
    35 #ifndef __INPUT_H__
    36 #define __INPUT_H__
     36#ifndef LIBC_IMATH_H_
     37#define LIBC_IMATH_H_
    3738
    38 #include <tinput.h>
     39#include <stdint.h>
    3940
    40 extern int get_input_line(tinput_t *, char **);
    41 extern uint8_t get_input_uint8(tinput_t *);
    42 extern uint32_t get_input_uint32(tinput_t *);
    43 extern uint64_t get_input_uint64(tinput_t *);
    44 extern size_t get_input_size_t(tinput_t *);
     41extern int ipow10_u64(unsigned, uint64_t *);
     42extern unsigned ilog10_u64(uint64_t);
    4543
    4644#endif
     45
     46/**
     47 * @}
     48 */
  • uspace/lib/c/include/ipc/services.h

    r5265eea4 r77a194c  
    5959#define SERVICE_NAME_UDP      "net/udp"
    6060#define SERVICE_NAME_TCP      "net/tcp"
     61#define SERVICE_NAME_VBD      "vbd"
     62#define SERVICE_NAME_VOLSRV   "volsrv"
    6163
    6264#endif
  • uspace/lib/c/include/str.h

    r5265eea4 r77a194c  
    8282extern int str_cmp(const char *s1, const char *s2);
    8383extern int str_lcmp(const char *s1, const char *s2, size_t max_len);
     84extern int str_casecmp(const char *s1, const char *s2);
     85extern int str_lcasecmp(const char *s1, const char *s2, size_t max_len);
    8486
    8587extern bool str_test_prefix(const char *s, const char *p);
  • uspace/lib/c/include/types/vol.h

    r5265eea4 r77a194c  
    11/*
    2  * Copyright (c) 2012-2013 Dominik Taborsky
     2 * Copyright (c) 2015 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup hdisk
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef __COMMON_H__
    36 #define __COMMON_H__
     35#ifndef LIBC_TYPES_VOL_H_
     36#define LIBC_TYPES_VOL_H_
    3737
    38 #include <libmbr.h>
    39 #include <libgpt.h>
     38#include <async.h>
    4039
    4140typedef enum {
    42         LYT_NONE,
    43         LYT_MBR,
    44         LYT_GPT,
    45 } layouts_t;
     41        /** Partition is empty */
     42        vpc_empty,
     43        /** Partition contains a recognized filesystem */
     44        vpc_fs,
     45        /** Partition contains unrecognized data */
     46        vpc_unknown
     47} vol_part_cnt_t;
    4648
    47 typedef union {
    48         mbr_label_t *mbr;
    49         gpt_label_t *gpt;
    50 } label_data_t;
     49/** File system type */
     50typedef enum {
     51        fs_exfat,
     52        fs_fat,
     53        fs_minix,
     54        fs_ext4
     55} vol_fstype_t;
    5156
    52 typedef struct label {
    53         layouts_t layout;
    54         aoff64_t blocks;
    55         service_id_t device;
    56         label_data_t data;
    57         unsigned int alignment;
    58         int (* destroy_label)(struct label *);
    59         int (* add_part)(struct label *, tinput_t *);
    60         int (* delete_part)(struct label *, tinput_t *);
    61         int (* new_label)(struct label *);
    62         int (* print_parts)(struct label *);
    63         int (* read_parts)(struct label *);
    64         int (* write_parts)(struct label *);
    65         int (* extra_funcs)(struct label *, tinput_t *);
    66 } label_t;
     57#define VOL_FSTYPE_LIMIT (fs_ext4 + 1)
     58#define VOL_FSTYPE_DEFAULT fs_minix
     59
     60/** Volume service */
     61typedef struct vol {
     62        /** Volume service session */
     63        async_sess_t *sess;
     64} vol_t;
     65
     66/** Partition information */
     67typedef struct {
     68        /** Partition content type */
     69        vol_part_cnt_t pcnt;
     70        /** Filesystem type */
     71        vol_fstype_t fstype;
     72} vol_part_info_t;
    6773
    6874#endif
     75
     76/** @}
     77 */
  • uspace/lib/c/include/vol.h

    r5265eea4 r77a194c  
    11/*
    2  * Copyright (c) 2012-2013 Dominik Taborsky
     2 * Copyright (c) 2015 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup hdisk
     29/** @addtogroup libc
    3030 * @{
    3131 */
     
    3333 */
    3434
    35 #ifndef __FUNC_NONE_H__
    36 #define __FUNC_NONE_H__
     35#ifndef LIBC_VOL_H_
     36#define LIBC_VOL_H_
    3737
     38#include <async.h>
    3839#include <loc.h>
    39 #include <tinput.h>
    40 #include "common.h"
     40#include <stdint.h>
     41#include <types/label.h>
     42#include <types/vol.h>
    4143
    42 extern int construct_none_label(label_t *);
    43 extern int add_none_part(label_t *, tinput_t *);
    44 extern int delete_none_part(label_t *, tinput_t *);
    45 extern int destroy_none_label(label_t *);
    46 extern int new_none_label(label_t *);
    47 extern int print_none_parts(label_t *);
    48 extern int read_none_parts(label_t *);
    49 extern int write_none_parts(label_t *);
    50 extern int extra_none_funcs(label_t *, tinput_t *);
     44extern int vol_create(vol_t **);
     45extern void vol_destroy(vol_t *);
     46extern int vol_get_parts(vol_t *, service_id_t **, size_t *);
     47extern int vol_part_add(vol_t *, service_id_t);
     48extern int vol_part_info(vol_t *, service_id_t, vol_part_info_t *);
     49extern int vol_part_empty(vol_t *, service_id_t);
     50extern int vol_part_mkfs(vol_t *, service_id_t, vol_fstype_t);
    5151
    5252#endif
     53
     54/** @}
     55 */
Note: See TracChangeset for help on using the changeset viewer.