2006-08-24 19:24:38 +00:00
|
|
|
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
|
|
|
|
/* vim: set noet ts=8 sts=8 sw=8 : */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file joliet.h
|
|
|
|
*
|
|
|
|
* Declare the filesystems trees that are Joliet-compatible and the public
|
|
|
|
* functions for tying them into an ecma119 volume.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LIBISO_JOLIET_H
|
|
|
|
#define LIBISO_JOLIET_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
struct ecma119_write_target;
|
|
|
|
struct iso_tree_node;
|
|
|
|
|
2007-06-05 22:01:26 +00:00
|
|
|
enum joliet_node_type {
|
2007-05-31 04:25:39 +00:00
|
|
|
JOLIET_FILE,
|
|
|
|
JOLIET_DIR
|
|
|
|
};
|
|
|
|
|
|
|
|
struct joliet_dir_info {
|
|
|
|
struct joliet_tree_node **children;
|
|
|
|
size_t nchildren;
|
|
|
|
size_t len;
|
|
|
|
size_t block;
|
|
|
|
};
|
|
|
|
|
2006-08-24 19:24:38 +00:00
|
|
|
struct joliet_tree_node
|
|
|
|
{
|
|
|
|
uint16_t *name; /**< In UCS-2BE. */
|
|
|
|
size_t dirent_len;
|
|
|
|
|
|
|
|
struct joliet_tree_node *parent;
|
|
|
|
struct ecma119_write_target *target;
|
2007-05-31 04:25:39 +00:00
|
|
|
|
2007-06-05 22:01:26 +00:00
|
|
|
enum joliet_node_type type;
|
2007-05-31 04:25:39 +00:00
|
|
|
union {
|
|
|
|
struct iso_file *file;
|
|
|
|
struct joliet_dir_info dir;
|
|
|
|
} info;
|
2006-08-24 19:24:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new joliet_tree that corresponds to the tree represented by
|
|
|
|
* \p iso_root.
|
|
|
|
*/
|
|
|
|
struct joliet_tree_node*
|
|
|
|
joliet_tree_create(struct ecma119_write_target *target,
|
|
|
|
struct iso_tree_node *iso_root);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Calculate the size of each directory in the joliet heirarchy.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
joliet_calc_dir_size(struct ecma119_write_target *t, struct joliet_tree_node*);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Calculate the position of each directory in the joliet heirarchy.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
joliet_calc_dir_pos(struct ecma119_write_target *t, struct joliet_tree_node*);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Calculate the size of the joliet path table and fill in the list of
|
|
|
|
* directories.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
joliet_prepare_path_tables(struct ecma119_write_target *t);
|
|
|
|
|
|
|
|
void
|
|
|
|
joliet_tree_free(struct joliet_tree_node *root);
|
|
|
|
|
|
|
|
void
|
|
|
|
joliet_wr_sup_vol_desc(struct ecma119_write_target *t, uint8_t *buf);
|
|
|
|
|
|
|
|
void
|
|
|
|
joliet_wr_l_path_table(struct ecma119_write_target *t, uint8_t *buf);
|
|
|
|
|
|
|
|
void
|
|
|
|
joliet_wr_m_path_table(struct ecma119_write_target *t, uint8_t *buf);
|
|
|
|
|
|
|
|
void
|
|
|
|
joliet_wr_dir_records(struct ecma119_write_target *t, uint8_t *buf);
|
|
|
|
|
|
|
|
#endif /* LIBISO_JOLIET_H */
|