libisofs-legacy/libisofs/susp.h

77 lines
2.3 KiB
C
Raw Normal View History

2006-08-15 20:37:04 +00:00
/* vim: set noet ts=8 sts=8 sw=8 : */
/**
* Functions and structures used for SUSP (IEEE 1281).
*
* Please refer to IEEE P1281 System Use Sharing Protocol, draft standard
* version 1.12 for more details.
2006-08-15 20:37:04 +00:00
*/
#ifndef __ISO_SUSP
#define __ISO_SUSP
2006-08-24 19:23:37 +00:00
#include <stdint.h>
2006-08-15 20:37:04 +00:00
/* SUSP is only present in standard ecma119 */
struct ecma119_write_target;
2006-08-24 19:23:37 +00:00
struct ecma119_tree_node;
2006-08-15 20:37:04 +00:00
/** This contains the information that needs to go in the SUSP area of a file.
*/
struct susp_info
{
int n_susp_fields; /**< Number of SUSP fields */
2006-08-24 19:23:37 +00:00
uint8_t **susp_fields; /**< Data for each SUSP field */
2006-08-15 20:37:04 +00:00
/* the next 3 relate to CE and are filled out by susp_add_CE. */
int n_fields_fit; /**< How many of the above SUSP fields fit
* within this node's dirent. */
int non_CE_len; /**< Length of the part of the SUSP area that
* fits in the dirent. */
int CE_len; /**< Length of the part of the SUSP area that
* will go in a CE area. */
};
/**
* Add a CE System Use Entry to the given tree node. A "CE" is used to add
* a continuation area, where additional System Use Entry can be written.
* See IEEE P1281, section 5.1.
*/
2006-08-24 19:23:37 +00:00
void susp_add_CE(struct ecma119_write_target *, struct ecma119_tree_node *);
2006-08-15 20:37:04 +00:00
/**
* Add a SP System Use Entry to the "." entry of the directory. The SP provide
* an identifier that the SUSP is used within the volume. The SP shall be
* recorded in the "." entry of the root directory.
* See IEEE P1281, section 5.3 for more details.
*
* this is special because it doesn't modify the susp fields of the
* directory; it modifies the susp fields of the "." entry in the directory.
*/
2006-08-24 19:23:37 +00:00
void susp_add_SP(struct ecma119_write_target *, struct ecma119_tree_node *);
2006-08-15 20:37:04 +00:00
/** Once all the directories and files are laid out, recurse through the tree
* and finalize all SUSP CE entries. */
2006-08-24 19:23:37 +00:00
void susp_finalize(struct ecma119_write_target *, struct ecma119_tree_node *);
2006-08-15 20:37:04 +00:00
void susp_append(struct ecma119_write_target *,
2006-08-24 19:23:37 +00:00
struct susp_info *,
uint8_t *);
2006-08-15 20:37:04 +00:00
void susp_insert(struct ecma119_write_target *,
2006-08-24 19:23:37 +00:00
struct susp_info *,
uint8_t *,
2006-08-15 20:37:04 +00:00
int pos);
2006-08-24 19:23:37 +00:00
uint8_t *susp_find(struct susp_info *,
const char *);
2006-08-15 20:37:04 +00:00
void susp_write(struct ecma119_write_target *,
struct susp_info *,
2006-08-24 19:23:37 +00:00
uint8_t *);
2006-08-15 20:37:04 +00:00
void susp_write_CE(struct ecma119_write_target *,
struct susp_info *,
2006-08-24 19:23:37 +00:00
uint8_t *);
2006-08-15 20:37:04 +00:00
void susp_free_fields(struct susp_info *);
#endif /* __ISO_SUSP */