summaryrefslogtreecommitdiff
path: root/include/parserutils
Commit message (Collapse)AuthorAgeFilesLines
* (buffer): Add parserutils_buffer_appendv()Daniel Silverstone2022-11-261-0/+2
| | | | Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
* Buffer: Optimise to minimise memmove shuffles.Michael Drake2021-05-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Replace use of abort() with assertions.John-Mark Bell2014-01-131-4/+1
|
* Remove client allocation function.Michael Drake2013-12-146-13/+3
|
* Remove init/final code and turn aliases into static data structure. r=vinceDaniel Silverstone2010-12-041-7/+0
| | | | svn path=/trunk/libparserutils/; revision=10961
* Sprinkle some C++ scoping aroundJohn Mark Bell2010-10-2312-0/+108
| | | | svn path=/trunk/libparserutils/; revision=10901
* Fix whitespaceJohn Mark Bell2010-10-231-1/+1
| | | | svn path=/trunk/libparserutils/; revision=10898
* Lose a bunch of trailing commas.John Mark Bell2009-04-151-2/+2
| | | | | | GCC 2.95 compatibility. svn path=/trunk/libparserutils/; revision=7094
* Add ability to retrieve vector length. Fix missing note in iteration apiDaniel Silverstone2009-02-151-0/+1
| | | | svn path=/trunk/libparserutils/; revision=6527
* Remove dict, hash and rbtree from libparserutilsDaniel Silverstone2009-02-142-67/+0
| | | | 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
* Correct return value when we can't find a charset in inputstream constructor.John Mark Bell2009-01-061-0/+4
| | | | | | 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-31/+28
| | | | svn path=/trunk/libparserutils/; revision=5965
* Dubious optimisation I've had sitting around for ages.John Mark Bell2009-01-061-2/+4
| | | | svn path=/trunk/libparserutils/; revision=5963
* Use temporary variables rather than indirecting through pointers all the time.John Mark Bell2008-12-011-8/+13
| | | | svn path=/trunk/libparserutils/; revision=5861
* Chunked arrays: Pack length of entries into array as a prefix to the data.John Mark Bell2008-12-011-3/+3
| | | | | | Limit maximum length of data items stored in hash/chunked array to 2^16-1. svn path=/trunk/libparserutils/; revision=5858
* New datastructures:John Mark Bell2008-11-302-1/+33
| | | | | | | | | + Chunked array + Hash table (open addressing) Constify parameter to parserutils_stack_push svn path=/trunk/libparserutils/; revision=5850
* Return errors from dictionary constructor/destructorJohn Mark Bell2008-11-091-2/+3
| | | | svn path=/trunk/libparserutils/; revision=5673
* Return errors from constructors and destructors.John Mark Bell2008-11-086-15/+21
| | | | svn path=/trunk/libparserutils/; revision=5652
* Add API to vector to permit peeking.John Mark Bell2008-10-181-0/+2
| | | | svn path=/trunk/libparserutils/; revision=5596
* Only randomise the inputstream if RANDOMISE_INPUTSTREAM is defined.John Mark Bell2008-09-171-0/+2
| | | | | | | This will prevent exhorbitant memory leakage when running make test in client code. svn path=/trunk/libparserutils/; revision=5365
* Conditionalise noisy logging. I quite like to be able to run hubbub's ↵John Mark Bell2008-08-231-3/+5
| | | | | | testsuite without running out of hard drive space. svn path=/trunk/libparserutils/; revision=5183
* Fix formatting strings so it won't whinge on amd64Daniel Silverstone2008-08-221-2/+2
| | | | svn path=/trunk/libparserutils/; revision=5171
* Yet more debug.John Mark Bell2008-08-181-1/+19
| | | | svn path=/trunk/libparserutils/; revision=5149
* Only attempt to randomise the utf8 buffer when NDEBUG is not defined.John Mark Bell2008-08-131-0/+2
| | | | | | | Note that, if lpu is built with NDEBUG defined, then the randomisation is a NOP. Therefore, to use the randomisation, you want to build debug versions of both lpu and whatever's using it. svn path=/trunk/libparserutils/; revision=5085
* Move the location of the utf8 buffer every time we're asked for a character ↵John Mark Bell2008-08-132-0/+4
| | | | | | | | in debug mode. This leaks memory lots, deliberately. svn path=/trunk/libparserutils/; revision=5081
* ConstifyJohn Mark Bell2008-07-301-1/+2
| | | | svn path=/trunk/libparserutils/; revision=4827
* Make parserutils_dict_entry public.John Mark Bell2008-07-303-1/+68
| | | | | | Add basic implementations of a stack and a vector. svn path=/trunk/libparserutils/; revision=4824
* Pedantic spelling changes of encoding names UTF-8, UTF-16 and UCS-4John Tytgat2008-06-282-4/+4
| | | | svn path=/trunk/libparserutils/; revision=4469
* Have some generic dictionary implementation.John Mark Bell2008-05-101-0/+28
| | | | | | Even comes with testcases, which is nice. svn path=/trunk/libparserutils/; revision=4138
* Import parser construction utility libraryJohn Mark Bell2008-05-0110-0/+484
svn path=/trunk/libparserutils/; revision=4111