/*
 * Copyright (c) 2001-2002  Ben Fennema
 * Copyright (c) 2016-2019  Pali Rohár <pali.rohar@gmail.com>
 * All rights reserved.
 * Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd.
 *
 * Author:     zhangsheng<zhangsheng@uniontech.com>
 *
 * Maintainer: max-lv<lvwujun@uniontech.com>
 *             xushitong<xushitong@uniontech.com>
 *             lanxuesong<lanxuesong@uniontech.com>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef READDISC_H
#define READDISC_H

#include <stdio.h>

#include <linux/limits.h>

#include "ecma_167.h"

typedef struct udf_image_ udf_image;

typedef struct _dir_ {
    struct _dir_ *parent, **children;
    uint32_t c_len;
    uint32_t numfiles;
    uint32_t c_capcity;
    uint32_t fid_len;
    char *fid_data;
    char name[NAME_MAX];
    char path[PATH_MAX];
    uint8_t fe[2048]; // Warning: blocksize must is 2048
} Directory;


int read_disc(int, udf_image *, Directory *);
int read_offset(int, udf_image *, void *, loff_t, size_t, int);
void clear_dir(Directory *dir);

#endif // READDISC_H
