"Fossies" - the Fresh Open Source Software Archive 
Member "xorriso-1.5.4/libisofs/ecma119_tree.h" (30 Jan 2021, 3060 Bytes) of package /linux/misc/xorriso-1.5.4.pl02.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "ecma119_tree.h" see the
Fossies "Dox" file reference documentation.
1 /*
2 * Copyright (c) 2007 Vreixo Formoso
3 * 2012 - 2014 Thomas Schmitt
4 *
5 * This file is part of the libisofs project; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License version 2
7 * or later as published by the Free Software Foundation.
8 * See COPYING file for details.
9 */
10
11 #ifndef LIBISO_ECMA119_TREE_H_
12 #define LIBISO_ECMA119_TREE_H_
13
14 #include "libisofs.h"
15 #include "ecma119.h"
16
17 enum ecma119_node_type {
18 ECMA119_FILE,
19 ECMA119_DIR,
20 ECMA119_SYMLINK,
21 ECMA119_SPECIAL,
22 ECMA119_PLACEHOLDER
23 };
24
25 /**
26 * Struct with info about a node representing a directory
27 */
28 struct ecma119_dir_info
29 {
30 /* Block where the directory entries will be written on image */
31 size_t block;
32
33 size_t nchildren;
34 Ecma119Node **children;
35
36 /*
37 * Size of the dir, i.e., sum of the lengths of all directory records.
38 * It is computed by calc_dir_size() [ecma119.c].
39 * Note that this don't include the length of any SUSP Continuation
40 * Area needed by the dir, but it includes the size of the SUSP entries
41 * than fit in the directory records System Use Field.
42 */
43 size_t len;
44
45 /**
46 * Real parent if the dir has been reallocated. NULL otherwise.
47 */
48 Ecma119Node *real_parent;
49 };
50
51 /**
52 * A node for a tree containing all the information necessary for writing
53 * an ISO9660 volume.
54 */
55 struct ecma119_node
56 {
57 /**
58 * Name in ASCII, conforming to selected ISO level.
59 * Version number is not include, it is added on the fly
60 */
61 char *iso_name;
62
63 Ecma119Node *parent;
64
65 IsoNode *node; /*< reference to the iso node */
66
67 uint32_t ino;
68
69 nlink_t nlink;
70
71 /**< file, symlink, special, directory or placeholder */
72 enum ecma119_node_type type;
73 union
74 {
75 IsoFileSrc *file;
76 struct ecma119_dir_info *dir;
77 /** this field points to the relocated directory. */
78 Ecma119Node *real_me;
79 } info;
80 };
81
82
83 /* For recording files which are hidden in ECMA-119 */
84 struct iso_filesrc_list_item
85 {
86 IsoFileSrc *src;
87 struct iso_filesrc_list_item *next;
88 };
89
90 int iso_filesrc_list_destroy(struct iso_filesrc_list_item **start_item);
91
92
93 /**
94 *
95 */
96 int ecma119_tree_create(Ecma119Image *img);
97
98 /**
99 * Free an Ecma119Node, and its children if node is a dir
100 */
101 void ecma119_node_free(Ecma119Node *node);
102
103 /**
104 * Search the tree for a certain IsoNode and return its owning Ecma119Node
105 * or NULL.
106 */
107 Ecma119Node *ecma119_search_iso_node(Ecma119Image *img, IsoNode *node);
108
109 /**
110 * Tell whether node is a dedicated relocation directory which only contains
111 * relocated directories.
112 */
113 int ecma119_is_dedicated_reloc_dir(Ecma119Image *img, Ecma119Node *node);
114
115 /**
116 * Determines the ECMA-119 name from node name.
117 * @param flag bit0= Do not issue error messages
118 */
119 int iso_get_ecma119_name(IsoWriteOpts *opts, char *input_charset, int imgid,
120 char *node_name, enum IsoNodeType node_type,
121 char **name, int flag);
122
123
124 #endif /*LIBISO_ECMA119_TREE_H_*/