path: root/src/fl_load.c
AgeCommit message (Collapse)AuthorFilesLines
2019-03-26Version bump + year bump + Changelog update for 1.211.21Yorhel1-1/+1
2016-12-30Version & date bump + Changelog update for 1.201.20Yorhel1-1/+1
2016-12-16fl_load: Add support for reading multistream bzip2 filelistsYorhel1-31/+55
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.
2014-02-11Copyright year bumpYorhel1-1/+1
2013-09-27fl_load: Don't allow a <Directory> element inside a <File>Yorhel1-3/+6
2013-09-26Replace custom XML file list reader with the yxml libraryYorhel1-214/+198
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.
2013-05-19fl_load.c: Don't allow '/' in file or directory nameYorhel1-4/+8
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.
2013-05-15fl_load.c: Don't allow "." and ".." as file/dir names in files.xml.bz2Yorhel1-0/+8
As the ADC spec requires.
2013-02-04Copyright year bumpYorhel1-1/+1
2013-01-30fl_load.c: Use case-insensitive matching for XML elements and attributesYorhel1-9/+9
Shareaza generates invalid files.xml.bz2 files.
2013-01-24Move all system #includes into ncdc.hYorhel1-5/+0
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.
2012-05-13Programming style: typedef all structs with name_t and use thoseYorhel1-22/+22
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. :-(
2012-05-13Use makeheaders to generate a specific header for each .c fileYorhel1-0/+1
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 This will likely need a bit more tweaking here and there.
2012-05-12fl_load.c: Use str_concert() fallback if Name attr is not valid UTF-8Yorhel1-10/+2
2012-05-08Split fl_load into a separate file + rewrote it to use xmlread.cYorhel1-0/+377