Skip to content
Snippets Groups Projects
  1. Nov 09, 2023
  2. Jul 24, 2023
    • Jonathan Schöbel's avatar
      Validator: added attrs · 6c391521
      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.
      6c391521
  3. Jul 08, 2023
    • Jonathan Schöbel's avatar
      Validator: add initializer · 875cd8a3
      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.
      875cd8a3
  4. Jul 07, 2023
  5. Jun 24, 2023
  6. Jun 21, 2023
  7. Jun 10, 2023
  8. Mar 17, 2023
  9. Jan 09, 2023
  10. Jan 05, 2023
  11. Nov 17, 2022
  12. Nov 15, 2022
    • Jonathan Schöbel's avatar
      API change: error -> status for exception handling · 0e0fa194
      Jonathan Schöbel authored
      Instead of the trivial structure SH_Error, SH_Status is used. The name
      was chosen, because error/status is set independently whether an error
      has occurred. Beside the error type, it also contains the associated
      errno and an error message. The error message is also printed, when it
      is set. Generating error messages with variadic arguments is now also
      supported.
      There are also macros to check for a set status.
      
      The exception handling was removed for the *_free methods, because they
      can't fail predictably during runtime.
      
      Unfortunately the compiler reports, that inside the macro set_status
      printf may be called with NULL [printf (NULL)], although, this is
      explicitly debarred.
      0e0fa194
  13. Oct 17, 2022
    • Jonathan Schöbel's avatar
      setup library (make & API) · f86bd5cf
      Jonathan Schöbel authored
      The make process was restructured to create a library. For this libtool
      is used to provide both static and dynamic linking. Also header
      inclusion guards were introduced, to prevent clients of the library to
      include some single file without including others. The types were
      exported with forward declarations for better abstraction. When
      compiling the library, the macro LIB_SEFHT_COMPILATION is defined and
      symbol declarations are exported fully. For compiling the tests this
      macro is also defined, as the tests not only tests the API, but also the
      internal state, because a lot of errors couldn't be detected otherwise.
      f86bd5cf
Loading