~aleteoryx/muditaos

ref: 36b0228de2c847f7e0f8bf7a215539609c82ebcd muditaos/host-tools/genlittlefs/parse_partitions.h -rw-r--r-- 670 bytes
36b0228d — Lefucjusz [BH-2100] Fix crash when seeking in large MP3 file 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/blob/master/LICENSE.md

#pragma once
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>

typedef int part_type_t;

enum part_type_options
{
    scan_all_partitions = -1
};

struct partition
{
    off_t start;
    off_t end;
    part_type_t type;
};

struct partition *find_partitions(const char *filename, part_type_t ptype, size_t *nelems)
    __attribute__((nonnull(1, 3)));

void print_partitions(const struct partition *part, size_t nparts);

int write_partition_bootunit(const char *filename, int part_num, uint32_t block_size);