summaryrefslogtreecommitdiff
path: root/source/fitz/filter-flate.c
AgeCommit message (Collapse)Author
2018-04-03Don't implicitly drop in fz_open_* chained filters.Tor Andersson
2017-10-13Rename internals of flate filter.Robin Watts
This is to avoid conflict with the next commit.
2017-04-27Include required system headers.Tor Andersson
2016-09-14Add scripts to remove/replace 'static' from functions.Robin Watts
Getting a backtrace out with missing functions makes the backtrace much less useful. Some backtrace routines (such as that used by Memento on Android) are incapable of resolving static functions. We therefore provide 2 scripts (scripts/destatic.sh and scripts/restatic.sh) that respectively remove and replace the 'static' from function definitions. The scripts do not affect "static inline" or "static const" definitions, and they are are restricted to working in the source directory (excluding source/tools), thirdparty/mujs and the platform/{java,android} directories. The transformed source should NOT be checked in. To avoid problems with clashing symbols, some functions are renamed or tweaked slightly in this patch.
2016-06-17Use 'size_t' instead of int as appropriate.Robin Watts
This silences the many warnings we get when building for x64 in windows. This does not address any of the warnings we get in thirdparty libraries - in particular harfbuzz. These look (at a quick glance) harmless though.
2015-02-17Add ctx parameter and remove embedded contexts for API regularity.Tor Andersson
Purge several embedded contexts: Remove embedded context in fz_output. Remove embedded context in fz_stream. Remove embedded context in fz_device. Remove fz_rebind_stream (since it is no longer necessary). Remove embedded context in svg_device. Remove embedded context in XML parser. Add ctx argument to fz_document functions. Remove embedded context in fz_document. Remove embedded context in pdf_document. Remove embedded context in pdf_obj. Make fz_page independent of fz_document in the interface. We shouldn't need to pass the document to all functions handling a page. If a page is tied to the source document, it's redundant; otherwise it's just pointless. Fix reference counting oddity in fz_new_image_from_pixmap.
2015-02-17Rename fz_close_* and fz_free_* to fz_drop_*.Tor Andersson
Rename fz_close to fz_drop_stream. Rename fz_close_archive to fz_drop_archive. Rename fz_close_output to fz_drop_output. Rename fz_free_* to fz_drop_*. Rename pdf_free_* to pdf_drop_*. Rename xps_free_* to xps_drop_*.
2014-12-03Add ZIP file and directory reading module.Tor Andersson
2014-05-23Bug 695183: Inflate large buffers at a time for speed.Robin Watts
When I changed the stream implementations to use implementation specific buffers, rather than a generic public one in every fz_stream, I changed fz_read_byte to only get a single byte at a time. I noted at the time that the underlying stream was free to decode larger blocks if it wanted too, but I forgot to actually do this for the flate decoder. Fixing this here should solve the speed issues.
2014-03-17Rework fz_streams.Robin Watts
Currently fz_streams have a 4K buffer within their header. The call to read from a stream fills this buffer, resulting in more data being pulled from any underlying stream than we might like. This causes problems with the forthcoming 'leech' filter. Here we simplify the fields available in the public stream header. No specific buffer is given; simply the read and write pointers. The underlying 'read' function is replaced by a 'next' function that makes the next block of data available and returns the first character of it (or EOF). A caller to the 'next' function should supply the maximum number of bytes that it knows it will need (possibly not now, but eventually). This enables the underlying stream to efficiently decode just enough. The underlying stream is free to return fewer, or a greater number if it wants to. The exact size of the 'block' of data returned will depend on the filter in use and (possibly) the data therein. Callers can get the currently available amount of data by calling fz_available (but again should pass the maximum amount of data they know they will need). The only time this will ever return 0 is if we have hit EOF.
2014-01-02Add rebinding for fz_streams.Robin Watts
2013-09-27clip flate stream on data check error instead of rejecting it wholesaleSimon Bünzli
This is required e.g. for 1798_-_zlib_incorrect_data_check.pdf .
2013-06-20Rearrange source files.Tor Andersson