summaryrefslogtreecommitdiff
path: root/src/utils
Commit message (Collapse)AuthorAgeFilesLines
* (buffer): Initialise error to OKDaniel 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.
* Remove client allocation function.Michael Drake2013-12-143-52/+27
|
* 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-291-1/+1
| | | | svn path=/trunk/libparserutils/; revision=14003
* 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-021-0/+40
| | | | svn path=/trunk/libparserutils/; revision=8267
* Remove chunkarray implementation. It's unused.John Mark Bell2009-04-153-261/+1
| | | | svn path=/trunk/libparserutils/; revision=7093
* Port to new buildsystemJohn Mark Bell2009-03-241-47/+2
| | | | 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
* Silence doxygen warnings.John Mark Bell2009-01-091-1/+4
| | | | svn path=/trunk/libparserutils/; revision=6007
* Change API of inputstream_peek(_slow) to return errors. Joy.John Mark Bell2009-01-061-0/+5
| | | | svn path=/trunk/libparserutils/; revision=5965
* 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
* C89François Revel2008-11-295-8/+23
| | | | svn path=/trunk/libparserutils/; revision=5838
* Return errors from dictionary constructor/destructorJohn Mark Bell2008-11-091-12/+21
| | | | svn path=/trunk/libparserutils/; revision=5673
* Return errors from constructors and destructors.John Mark Bell2008-11-087-86/+129
| | | | svn path=/trunk/libparserutils/; revision=5652
* Add API to vector to permit peeking.John Mark Bell2008-10-181-0/+20
| | | | svn path=/trunk/libparserutils/; revision=5596
* Tidy up CFLAGS/LDFLAGSJohn Mark Bell2008-09-051-1/+1
| | | | svn path=/trunk/libparserutils/; revision=5249
* ISO-8859-n codec. This needs some testing.John Mark Bell2008-09-041-0/+4
| | | | svn path=/trunk/libparserutils/; revision=5233
* Move the location of the utf8 buffer every time we're asked for a character ↵John Mark Bell2008-08-131-0/+24
| | | | | | | | in debug mode. This leaks memory lots, deliberately. svn path=/trunk/libparserutils/; revision=5081
* Rather more optimal data comparator -- compare data lengths first then, if ↵John Mark Bell2008-08-011-4/+4
| | | | | | they're equal, compare the actual data. svn path=/trunk/libparserutils/; revision=4856
* ConstifyJohn Mark Bell2008-07-301-1/+2
| | | | svn path=/trunk/libparserutils/; revision=4827
* Make parserutils_dict_entry public.John Mark Bell2008-07-304-10/+381
| | | | | | Add basic implementations of a stack and a vector. svn path=/trunk/libparserutils/; revision=4824
* Fix compiler errors when ptrs are 64bit.John Tytgat2008-06-281-1/+1
| | | | svn path=/trunk/libparserutils/; revision=4468
* Have some generic dictionary implementation.John Mark Bell2008-05-104-1/+1048
| | | | | | Even comes with testcases, which is nice. svn path=/trunk/libparserutils/; revision=4138
* Import parser construction utility libraryJohn Mark Bell2008-05-014-0/+303
svn path=/trunk/libparserutils/; revision=4111