Commit Graph

330 Commits

Author SHA1 Message Date
Vreixo Formoso bf51fba3bc Ensure ce is set to 0 at the beginning of calc size. 2007-12-26 19:05:06 +01:00
Vreixo Formoso ddd703e7c4 Fix several bugs related to RR SL/NM fields (PT 2 :). 2007-12-26 18:19:00 +01:00
Vreixo Formoso 5f6b5fd930 Guard against wrong POSIX filenames in node. 2007-12-26 16:34:07 +01:00
Vreixo Formoso 6509134411 Fix bug with RR NM and SL entries. 2007-12-26 12:48:48 +01:00
Vreixo Formoso 49344b3ca9 Fix bug in path table size computation. 2007-12-25 23:33:37 +01:00
Vreixo Formoso d954957d83 If needed, add version number to symlinks and special files too. 2007-12-25 18:59:20 +01:00
Vreixo Formoso bf0c1dd219 Add nlink and ino fields. No true usage for now. 2007-12-25 18:51:00 +01:00
Vreixo Formoso f8f2dcb6b0 RockRidge support, now RR/SUSP entries are correctly written.
This also fix a little bug, ensuring SP is written first to the "." 
entry of the directory record.
2007-12-25 18:35:10 +01:00
Vreixo Formoso 54038ec54b Functions to add RR/SUSP entries. Fix little bugs. 2007-12-25 17:53:17 +01:00
Vreixo Formoso c3af3553df Define functions to generate and write the RR/SUSP fields. 2007-12-24 16:29:57 +01:00
Vreixo Formoso 778e39ba3c Take care about the RR entries when computing the size, and cache it.
When computing the size of the directory structures, take care about the size
taken by the RR/SUSP fields. Also, cache that size, otherwise we need to do
this computation several times and it is ugly, because the CE entries need to 
know where the Continuation Area will be stored.
2007-12-24 14:24:09 +01:00
Vreixo Formoso 98b2dc2658 Take into account that System Use Field may be padded. 2007-12-24 14:04:15 +01:00
Vreixo Formoso d48c553f40 Implement function to compute the size needed for RR field. 2007-12-24 04:31:15 +01:00
Vreixo Formoso 9de0be2602 Guard in public API agains bad names or link destinations. 2007-12-24 04:20:29 +01:00
Vreixo Formoso 227b17f251 Store a pointer to the real parent in reparent dirs. 2007-12-23 17:41:21 +01:00
Vreixo Formoso 811655a9a1 Mangle file names inside root directory after reorder the tree. 2007-12-23 17:19:07 +01:00
Vreixo Formoso 041858360a Handle reallocation of directories. 2007-12-23 17:11:32 +01:00
Vreixo Formoso ca1385cce1 Begin RR support. Symlinks and Special files added to low level tree. 2007-12-23 16:16:26 +01:00
Vreixo Formoso b8aa48038b Minor changes. 2007-12-23 15:39:41 +01:00
Vreixo Formoso 002a832ac3 Minor changes. 2007-12-23 02:58:54 +01:00
Vreixo Formoso 6154fb1f0a Replace the pipe with the ring buffer. 2007-12-23 02:46:35 +01:00
Vreixo Formoso 94e687d9d3 Add a ring buffer implementation.
This is intented to replace the pipe between the writer and reader 
threads. That way we can have a much better control of cancelation 
situations. Still to be optimized.
2007-12-23 02:24:21 +01:00
Vreixo Formoso 9ec475a900 Change iso name conversion functions back to old style. 2007-12-22 20:49:30 +01:00
Vreixo Formoso 9e9c077c6e Minimize charset conversion errors, ignoring when we can't do better.
If a file name is encoded in a different encoding than default input, current
implementation make image generation to be cancelled. As this can happen quite
frequent, due to files from discs or Windows partitions incorrectly mounted,
the best we can do is just ignore this, replacing the wrong character with a
'_'.
2007-12-22 19:44:02 +01:00
Vreixo Formoso de3c4e4962 Little demo program to test image generation. 2007-12-22 17:09:49 +01:00
Vreixo Formoso 35ef22cdd7 Implement ECMA-119 burn_source and writer thread handling.
At this time, nglibisofs is able to output an image!! Note that communication
between writer and read thread is done via a pipe. That will be replaced by a
ring buffer in the near future.
2007-12-22 17:09:28 +01:00
Vreixo Formoso 2ab23693db Replace path table size computation by a recursive version.
The recursive version wastes less memory, as it doesn't need the path table
array.
2007-12-22 16:02:29 +01:00
Vreixo Formoso d07fed1a4c Add write function. Fix bug in PVD writing and dir. record len computation. 2007-12-22 14:45:00 +01:00
Vreixo Formoso 42731f4135 Fix bug in create tree, to propertly handle ignored files.
Due to a bug, when a file was ignored (for example, a dir whose deep 
level was greater than 8), all its parents where ignored, what causes 
root to be ignored!
2007-12-22 14:32:31 +01:00
Vreixo Formoso 5cf2980c9c Append version number to file ids. 2007-12-21 23:08:21 +01:00
Vreixo Formoso 2fd3195747 Write the path tables on the ISO structure. 2007-12-21 22:53:48 +01:00
Vreixo Formoso 31ee89c47b Code to write directory structure of the ECMA-119 tree. 2007-12-21 00:35:43 +01:00
Vreixo Formoso 46ffb6d33d Fix implementation of PVD writing. 2007-12-21 00:05:41 +01:00
Vreixo Formoso 2f383215ff Implement Writer for file contents.
Some aspects, such as better reporting of file bigger or smaller than 
expected is needed, but all situations are handled propertly.
2007-12-20 22:17:18 +01:00
Vreixo Formoso 449ed65fe9 Improve IsoStream interface implementation. 2007-12-20 20:58:03 +01:00
Vreixo Formoso a161f4249c Improve IsoFileSource interface implementation. 2007-12-20 20:47:39 +01:00
Vreixo Formoso f2e3a2c9fc Guard against empty names. 2007-12-20 16:09:29 +01:00
Vreixo Formoso e6bd1586d6 Replace glibc tsearch() with a custom red-black tree implementation.
The library supplied tree estructure is not enought for our needs, due to its
limited API. Thus, we have implemented a suitable red-black tree.
2007-12-20 00:25:25 +01:00
Vreixo Formoso 5eb3a7e038 Implementation of function to write the PVD.
The directory entry for the root directory is still missing.
2007-12-18 21:55:01 +01:00
Vreixo Formoso 2dc15ab164 Add some util functions, mostly copied from old libisofs. 2007-12-18 21:51:33 +01:00
Vreixo Formoso 39bde82ff6 Move size, ino, dev cache from IsoFileSrc to IsoStream.
That is a better decission, as it reduces the number of stat() call 
needed, and anyway some Streams will need the size.
2007-12-18 20:46:28 +01:00
Vreixo Formoso 5b93cb4cdc Fix bug, root refcount must be initialized to 1. 2007-12-18 10:54:09 +01:00
Vreixo Formoso 36894d6a23 Implementation of the write function to use by the Writers. 2007-12-18 00:37:24 +01:00
Vreixo Formoso 257b08bfcf Code to compute position of directory records and path tables. 2007-12-18 00:20:03 +01:00
Vreixo Formoso 5e2de57aa9 Initial structure for ECMA-119 writer. 2007-12-17 23:22:19 +01:00
Vreixo Formoso 159b775d22 Improve message functions to support message formating in printf style. 2007-12-17 21:12:51 +01:00
Vreixo Formoso f279676b6b Check file size to ensure file bigger than 4GB are not added to image. 2007-12-17 20:47:53 +01:00
Vreixo Formoso c8715941e6 Define some functions and responsabilities for image generation.
Still very preliminary work.
2007-12-16 19:10:47 +01:00
Vreixo Formoso c03d4d9b33 Implementation of name mangling algorithm.
This has to ensure that file names are unique among all files in an iso 
directory. Current implementation can be improved by using a hash table 
to keep the names, instead of iterate over all children. An alternative 
method, keeping children sorted all the time, thus allowing binary 
search, has been considered but discarded.                          

Current implementation support up to 9,999,999 equal files per 
directory.
2007-12-16 17:32:05 +01:00
Vreixo Formoso 56cdd00638 Sorting of nodes in a dir acording to ECMA-119, 9.3. 2007-12-15 18:40:33 +01:00