Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
This is a feature that FlylinkDC++ is experimenting with.
This implementation rewrites the file reader to use unbuffered I/O
calls, because the reader itself already does enough buffering.
The BZ2 reading is rewritten to use the lower-level bzDecompress rather
than bzRead API, because the latter seems harder to use w.r.t.
multistream bzip2 files.
It's slightly disappointing that the "high-level" bzRead API doesn't
handle multistream files automatically when the bzcat utility does.
Regardless of whether multistream file lists will actually be used, one
would expect ncdc to be able to read any bzip2 file that the bzcat
utility can read, hence this commit.
|
|
|
|
|
|
This fixes some blatant XML comformance issues with the old custom XML
parser. Yxml isn't fully comformant, either, but it's pretty close.
This also fixes a bug with loading file lists that contain a very large
attribute value somewhere. The old XML parser refused to load those, but
the new parser has no issues with it. AvaDC++ creates such lists.
This parser is a bit slower (2.7s -> 3.1s on a huge list), but I suppose
that isn't too surprising.
|
|
The ADC spec allows a '/' in a file or directory name, but only when
escaped with a '\'. I've no idea how to securely deal with such
filenames, so I'll just disallow them. The '\' character is also allowed
by the spec and should be escaped similarly. Those don't pose a problem
on unix-like systems, so I suppose we can keep allowing it. No attempt
is made to unescape filenames; it wouldn't matter.
|
|
As the ADC spec requires.
|
|
|
|
Shareaza 2.6.0.0 generates invalid files.xml.bz2 files.
|
|
This simplifies having to figure out which headers to include in each
file, and also removes the need to make a distinction between headers
that define structs/typedefs for data that may be passed between
multiple c files, and all other headers that are only used locally.
In the current build system, this'd probably slow down compilation time
a bit. If/when precompiled headers are used, this change will probably
improve the compilation time. Either way I doubt it's too noticable.
|
|
This change is only partially because my own programming style has just
changed a bit in this direction.* The other (and more practical) reason
is that makeheaders already creates the typedefs automatically, I've
just never used them. This automatic typedef creation was a bit
problematic in makeheaders' dependency resolution. E.g. 'struct hub' was
typedeffed to put the name 'hub' has a global type, but I also use 'hub'
as a variable in various places. This conflict is not really a problem
for plain C, as types and variables live in different namespaces, but
makeheaders doesn't really know that, and considered the hub structure
and its dependencies as a dependency of db.c, which uses the variable
'hub'. That's somewhat inefficient and messy...
These changes where mostly made by some runs of sed. If there were any
errors in these changes, I suspect the compiler would have found them.
(That is not to say I haven't done any basic verification myself, but,
you know, this change affects a *lot* of code >_>)
*) Not entirely, though. I was going more in the direction of using the
old struct names directly as typedefs, without the _t. This has the same
downside as mentioned above, so doesn't really work. :-(
|
|
This is a bit different from the previous approach where a .h file was
generated for each .c file as well, except that those .h files contained
all the exported definitions. With this new approach, the .h files are
not supposed to be included in any file besides the correspondig .c
file, and they now contain the exported definitions used from other .c
files. This is all explained in the makeheaders documentation at
http://www.hwaci.com/sw/mkhdr/makeheaders.html.
This will likely need a bit more tweaking here and there.
|
|
|
|
|