summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* (buffer): Initialise error to OKHEADmasterDaniel Silverstone2022-11-271-1/+1
| | | | Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* (buffer): Add parserutils_buffer_appendv()Daniel Silverstone2022-11-261-0/+33
| | | | Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* Endian: Improve host endian detection for older GCCs.Michael Drake2022-03-241-2/+2
| | | | Co-authored-by: John-Mark Bell <jmb@netsurf-browser.org>
* Buffer: Optimise to minimise memmove shuffles.Michael Drake2021-05-161-16/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously the data in the linear buffer was always stored at the start of the allocation, pointed to by `buffer->data`. This was achieved by memmoving every time data was consumed from the front. Now the allocation is pointed to by `buffer->alloc`, and the start of the data is pointed to by `buffer->data` (as before). This means client code does not need to change to get at the data. The advantage comes when we discard the from the start of the buffer, when some data is consumed. We now simply advance the data pointer by the number of bytes to be discarded, and reduce the buffer length by the same amount. If the used portion of the buffer now fits between the start of the allocation and the current start of the data, it is memcpyed to the allocation start, otherwise it is left alone. This is a significant optimisation when the size of the chunk is large, such as when loading from disc. (When the first (only) "chunk" is just the whole file.
* make unused variable macro more portableVincent Sanders2016-02-061-1/+1
|
* Fix memmove beyond buffer length in parserutlis_buffer_discard. Thanks to ↵Michael Drake2014-03-281-1/+1
| | | | Elie Roudninski.
* Replace use of abort() with assertions.John-Mark Bell2014-01-136-32/+20
|
* Fix non-iconv build.John-Mark Bell2014-01-131-2/+1
|
* Fix bounds checking. Fixes CID 1152178, 1152179.John-Mark Bell2014-01-122-2/+2
|
* Fix leak. Thanks to Ralf Junker.Michael Drake2014-01-101-1/+6
|
* Remove client allocation function.Michael Drake2013-12-1413-129/+56
|
* Fix input insertion.Vincent Sanders2012-07-051-1/+1
| | | | The gap in teh input was being created at the wrong insertion point!
* Update to new NSBUILD infrastructureDaniel Silverstone2012-06-296-6/+6
| | | | svn path=/trunk/libparserutils/; revision=14003
* Remove dead allocation which also isn't even usefully documentingDaniel Silverstone2012-03-251-1/+0
| | | | svn path=/trunk/libparserutils/; revision=13672
* Actually handle byte order marks in streams marked as utf16 or utf32John Mark Bell2011-07-191-13/+48
| | | | svn path=/trunk/libparserutils/; revision=12608
* Require iconv by default, as this is the most useful configurationJohn Mark Bell2011-04-211-9/+9
| | | | svn path=/trunk/libparserutils/; revision=12215
* Given that some iconv() implementations define the input buffer pointer to ↵John Mark Bell2011-03-091-2/+2
| | | | | | be a pointer to a pointer to const data, and some don't, hack around the issue by casting to void * svn path=/trunk/libparserutils/; revision=11950
* Internalise the internal symbol names.Daniel Silverstone2011-01-266-21/+21
| | | | svn path=/trunk/libparserutils/; revision=11493
* Fix profile and coverage targetsJohn Mark Bell2010-12-061-1/+3
| | | | svn path=/trunk/libparserutils/; revision=11022
* Remove spurious assignmentJohn Mark Bell2010-12-051-1/+1
| | | | svn path=/trunk/libparserutils/; revision=11015
* C89François Revel2010-12-051-1/+4
| | | | svn path=/trunk/libparserutils/; revision=11013
* Make sure we elide trailing non-characters when matching aliasesDaniel Silverstone2010-12-041-0/+4
| | | | svn path=/trunk/libparserutils/; revision=10973
* Remove init/final code and turn aliases into static data structure. r=vinceDaniel Silverstone2010-12-047-537/+80
| | | | svn path=/trunk/libparserutils/; revision=10961
* Fix bug where any encoding specified when creating an input stream would be ↵John Mark Bell2010-10-231-8/+18
| | | | | | | | replaced by UTF-8 if there was no charset detection callback provided, too. Tidy up the logic in this area, and add more commentary so it's clear. svn path=/trunk/libparserutils/; revision=10899
* Ensure we use the canonical charset name when invoking iconv_open()John Mark Bell2009-10-121-1/+2
| | | | svn path=/trunk/libparserutils/; revision=9628
* Correctly handle case where all of the following are true:John Mark Bell2009-07-251-3/+17
| | | | | | | | | 1) There's outstanding data to be read 2) We haven't read the first chunk of data 3) We've recieved EOF 4) There's insufficient input data to detect the charset svn path=/trunk/libparserutils/; revision=8789
* Make magic static.John Mark Bell2009-07-251-1/+1
| | | | svn path=/trunk/libparserutils/; revision=8788
* Less brain-dead constant for the benefit of ARM platforms.John Mark Bell2009-07-021-2/+2
| | | | svn path=/trunk/libparserutils/; revision=8268
* Remove dependency on a library providing ntohl/htonl.John Mark Bell2009-07-026-60/+60
| | | | svn path=/trunk/libparserutils/; revision=8267
* Inevitably, Windows requires winsock.h instead of the BSD stack headers.John Mark Bell2009-07-025-0/+20
| | | | svn path=/trunk/libparserutils/; revision=8263
* Reasons I hate TCPIPLibs:John Mark Bell2009-06-205-86/+96
| | | | | | | | | | | | 1) You need to include sys/types.h yourself 2) You need to ensure that netinet/in.h is included before arpa/inet.h 3) Neither arpa/inet.h nor netinet/in.h define htonl/ntohl -- it's in machine/endian.h which, fortunately, is included from sys/types.h Add a bunch of explicit casts to uint32_t to the results of calls to ntohl/htonl to appease Norcroft's "implicit narrowing cast" warning. svn path=/trunk/libparserutils/; revision=7891
* Lose dead codeJohn Mark Bell2009-05-271-5/+0
| | | | svn path=/trunk/libparserutils/; revision=7579
* Lose a bunch of trailing commas.John Mark Bell2009-04-151-1/+1
| | | | | | GCC 2.95 compatibility. svn path=/trunk/libparserutils/; revision=7094
* Remove chunkarray implementation. It's unused.John Mark Bell2009-04-153-261/+1
| | | | svn path=/trunk/libparserutils/; revision=7093
* Lose garbage todoJohn Mark Bell2009-04-011-3/+0
| | | | svn path=/trunk/libparserutils/; revision=7025
* Port to new buildsystemJohn Mark Bell2009-03-246-273/+13
| | | | svn path=/trunk/libparserutils/; revision=6854
* Add ability to retrieve vector length. Fix missing note in iteration apiDaniel Silverstone2009-02-151-0/+23
| | | | svn path=/trunk/libparserutils/; revision=6527
* Remove dict, hash and rbtree from libparserutilsDaniel Silverstone2009-02-145-1383/+1
| | | | svn path=/trunk/libparserutils/; revision=6512
* Ensure that parserutils_inputstream_peek(_slow)? have API documentation.John Mark Bell2009-01-091-1/+2
| | | | svn path=/trunk/libparserutils/; revision=6008
* Silence doxygen warnings.John Mark Bell2009-01-095-5/+9
| | | | svn path=/trunk/libparserutils/; revision=6007
* Correct return value when we can't find a charset in inputstream constructor.John Mark Bell2009-01-061-14/+62
| | | | | | Add new API to enable on-the-fly changing of the input charset. This is only possible if no data has been read from the stream. svn path=/trunk/libparserutils/; revision=5969
* Change API of inputstream_peek(_slow) to return errors. Joy.John Mark Bell2009-01-062-18/+31
| | | | svn path=/trunk/libparserutils/; revision=5965
* Make input filter correctly return _BADENCODING.John Mark Bell2009-01-062-5/+6
| | | | svn path=/trunk/libparserutils/; revision=5964
* C89François Revel2008-12-221-2/+3
| | | | svn path=/trunk/libparserutils/; revision=5920
* Fix build on 32bit platforms.John Mark Bell2008-12-021-2/+2
| | | | svn path=/trunk/libparserutils/; revision=5868
* Chunked arrays: Pack length of entries into array as a prefix to the data.John Mark Bell2008-12-014-55/+53
| | | | | | Limit maximum length of data items stored in hash/chunked array to 2^16-1. svn path=/trunk/libparserutils/; revision=5858
* Make things clearer through use of temporary variablesJohn Mark Bell2008-11-301-15/+19
| | | | svn path=/trunk/libparserutils/; revision=5853
* New datastructures:John Mark Bell2008-11-305-2/+581
| | | | | | | | | + Chunked array + Hash table (open addressing) Constify parameter to parserutils_stack_push svn path=/trunk/libparserutils/; revision=5850
* Pedantic whitespace changesJohn Mark Bell2008-11-305-12/+8
| | | | svn path=/trunk/libparserutils/; revision=5842
* C89François Revel2008-11-291-5/+6
| | | | svn path=/trunk/libparserutils/; revision=5840