- Aug 16, 2023
-
-
Jonathan Schöbel authored
A attribute can be deregistered by calling SH_Validator_deregister_attr. Note that deregistering an attr, that was never registered is considered an error, but this may change, as technically it is not registered afterwards and sometimes (i.e. for a blacklist) it might be preferable to ensure, that a specific attr is not registered, but it is not clear whether there should be an error or not. Also the deallocating of the data used for an attr was moved to an extra method, as this is needed in several locations and it might be subject to change.
-
- Jul 27, 2023
-
-
Jonathan Schöbel authored
-
- Jul 26, 2023
-
-
Jonathan Schöbel authored
-
Jonathan Schöbel authored
-
- Jul 24, 2023
-
-
Jonathan Schöbel authored
The Validator also contains information about supported attrs. Currently they can't be initialized by a spec. Also it can only be queried whether an attr does exist at all and not whether it is supported in combination with a specific tag. The tests are missing.
-
- Jul 08, 2023
-
-
Jonathan Schöbel authored
There is a method to add a set of tags to a validator on initialisation. First this removes a user application from the burden of maintaining the html spec and also is more performant, as a lot of tags are to be inserted at once, so there aren't multiple allocation calls. As the validator needs the tags to be in order, the tags must be sorted on insertion. Of course it would be easier for the code, if the tags were already in order, but first there could be easily a mistake and second sorting the tags by an algorithm allows the tags to be specified in a logically grouped and those more maintainable order. For the sorting, insertion sort is used. Of course it has a worse quadratic time complexity, but in a constructor, I wouldn't introduce the overhead of memory managment a heap- or mergesort would introduce and in-place sorting is also out, because the data lies in ro-memory. Thus I choose an algorithm with constant space complexity. Also the 'long' running time is not so important, as the initilization only runs at startup once and the tags are not likely to exceed a few hundred so even a quadratic time isn't that bad.
-
- Jul 07, 2023
-
-
Jonathan Schöbel authored
Double inclusion accompanied with macro guards are a bit ugly in comparison to a separate file.
-
- Jul 05, 2023
-
-
Jonathan Schöbel authored
As the access must be fast, the tags are sorted when inserted, so that the search can take place in log-time.
-
Jonathan Schöbel authored
Instead of having one function performing all the tests, they are split into multiple functions. Also a bug was found.
-
Jonathan Schöbel authored
-
- Jul 04, 2023
-
-
Jonathan Schöbel authored
While it was very clever, the complex data structure of the tag array introduced in 'Validator: restructured internal data (a0c9bb25)' comes with a lot of runtime overhead. It reduces the calls to free and realloc, when a lot of tags are deleted and inserted subsequently, but burdens each call with a loop over the linked list of free blocks. This is even more important, as validator must be fast in checking, as this is done everytime something is inserted into the DOM-tree, but has not so tight requirements for registering new tags, as this is merely done at startup time.
-
Jonathan Schöbel authored
-
Jonathan Schöbel authored
To test static functions, static haven't to be declared as empty.
-
- Jul 02, 2023
-
-
Jonathan Schöbel authored
When a newline is encountered in the text, a <br /> is inserted and for wrap mode also a newline and an indent is inserted. Note that the indent is still missing at the front where it can't be inserted yet as SH_Text is still lacking basic functionality.
-
Jonathan Schöbel authored
The copy_and_replace function replaces a single character with a string, while copying. This may be replaced by an elaborate function as manipulating a text normally means that manipulating is deferred until needed, which this function contradicts to.
-
- Jul 01, 2023
-
-
Jonathan Schöbel authored
-
- Jun 29, 2023
-
-
Jonathan Schöbel authored
What the method does is merely squashing everything together as opposed to performing a direct copy.
-
Jonathan Schöbel authored
At the end of the pipeline a release is generated. A release automatically adds a tag, which in turn would trigger the pipeline a second time. This is prevented.
-
- Jun 24, 2023
-
-
Jonathan Schöbel authored
The marks are now allocated and the allocated, where appropriate.
-
Jonathan Schöbel authored
-
Jonathan Schöbel authored
-
Jonathan Schöbel authored
-
Jonathan Schöbel authored
A text_segment allocates memory in terms of chunks, this is now also done, when created from a string, but this means that we can't rely on strdup anymore, as it takes care of the allocation. Calling malloc ourselves shouldn't be such an overhead as at least glibc's strdup performs the exact same steps. Actually we should be spare a strlen call now, so it should be more perfomant.
-
Jonathan Schöbel authored
A mark will be used to point to a specific location inside of a text. Currently it can't do anything and isn't even used.
-
- Jun 21, 2023
-
-
Jonathan Schöbel authored
While it would be preferable, it doesn't seam to be possible to abstract over the internals of text_segment. That's why only some basic functionality is moved, but whether more is to follow, is not known yet.
-
Jonathan Schöbel authored
Adjusted error coding style, to current one.
-
Jonathan Schöbel authored
changed year and corrected email address
-
- Jun 20, 2023
-
-
Jonathan Schöbel authored
Some adjustments suggested by autoupdate and autoscan were added.
-
- Jun 19, 2023
-
-
Jonathan Schöbel authored
The html generation for both TextFragment and NodeFragment combined is tested. As the encoding semantics of the TextFragments are neither defined nor implemented, some tests are marked as XFAIL.
-
Jonathan Schöbel authored
Some basic text functionality is now directly supported via wrapper functions. Note that wrapper functions aren't tested in unit tests.
-
Jonathan Schöbel authored
While this method is neccessary to manipulate the content of a TextFragment, the TextFragment should abstract the semantics of Text. While simple wrapper functions for appending are to be added, methods purely manipulating the text, i.e. relying on the text's contents, wont get wrapper functions. Thus this method is still needed until a more sophisticated approach is implemented.
-
Jonathan Schöbel authored
-
Jonathan Schöbel authored
There are seperate build, test and release stages. Also the resulting package is uploaded. To do that a special script was written to get the real name of the package, which autoconf inserts into the scripts on configure-time.
-
- Jun 10, 2023
-
-
Jonathan Schöbel authored
The basic functionality to implement all abstract methods is added. This means, that TextFragment can be instantiated, but it can't do anything useful yet.
-
Jonathan Schöbel authored
The tests are mostly split in a variant with error checking and a variant without, as it is now common.
-
- Jun 09, 2023
-
-
Jonathan Schöbel authored
The function SH_Text_set_char allows to write a single character to a position, that already exists in the text. Thus overwriting another character. If the index is out of range, a value error is set and FALSE is returned.
-
- Jun 07, 2023
-
-
Jonathan Schöbel authored
While it should not be the case, that the Attr's internal method free's the passed attribute, as some of the other internal methods pass non-allocated pointers to it, the methods visible by the user should indeed free things, where the ownership of every inner element is already transfered. This was adjusted now. As some tests have taken advantage of the fact, that while not to be changed, the old pointers were still accessible, they had to be adjusted.
-
Jonathan Schöbel authored
The demo program now uses some of the new functionality.
-
Jonathan Schöbel authored
When there are methods in the api/abi, that take pointers to strings to store them in the library, there are two methods to do so. Either they are copying the string and leaving it intact, or they directly assign the given pointer to some internal storage. While the former method, is safer in terms of memory, as the user doesn't have to remember that he can't use the string anymore, the latter can be more efficient, as there is no extra strdup call, but the user is not allowed to change the pointer, free it and also can't use the pointer, because it can't be known whether it is already freed by the library. As it should be decideable by the user, the library often implements both approaches, where the method, that directly store pointers without creating a copy contains the raw_ prefix. The insert_attr_new methods were somewhat confusing in this regard, as it is likely to be expected, that they were copying the string, while in fact they did not. This is now fixed. The insert_attr_new methods copy the strings, while the added insert_attr_raw_new methods preserve the old behaviour of the insert_attr_new methods, thus allowing to let the user choose, what is more appropriate.
-
- Jun 06, 2023
-
-
Jonathan Schöbel authored
Fixed some memory leak detected by valgrind.
-