Skip to content
Snippets Groups Projects
  1. Jan 09, 2023
  2. Jan 06, 2023
  3. Jan 05, 2023
  4. Jan 04, 2023
  5. Nov 24, 2022
  6. Nov 23, 2022
    • Jonathan Schöbel's avatar
      Validator: added copy method · 0aca3965
      Jonathan Schöbel authored
      Copying a Validator could be useful if multiple html versions are to be
      supported. Another use case is a blacklist XSS-Scanner.
      0aca3965
    • Jonathan Schöbel's avatar
      Validator: deregister tag · 95ba8a94
      Jonathan Schöbel authored
      A registered tag can be deregistered by calling SH_Validator_deregister.
      The data is removed, but the space is not deallocated, if it is not at
      the end. This prevents copying data on removal and saves expensive calls
      to realloc. Instead the empty space is added to the list of free blocks,
      which allows to refill these spaces, if a new tag is being registered.
      The space is finally deallocated, if the validator is being deallocated
      or the tag written in the last block is removed. In this case, heavy
      iteration is performed, as the list of free blocks is not ordered. The
      next last tag at that time is determined by iterating over the list of
      free blocks until some it is not found.
      Note that even if there can be a lot of gaps in between, the Validator
      will not allocate more space until all these gaps are refilled when a
      new tag is registered, thus new space is only being allocated, if there
      is really not enough space left.
      Due to the 4 nested loops, there was an issue related to the
      72(80)-column rule. It can't be abided without severely impacting the
      readability of the code.
      95ba8a94
  7. Nov 17, 2022
  8. Nov 16, 2022
    • Jonathan Schöbel's avatar
      Validator: restructured internal data · a0c9bb25
      Jonathan Schöbel authored
      The Validator saves the tags as an array. Now also another information
      is added, which slots aren't used currently to spare expensive calls to
      realloc. This led to a mere reimplementation of the functions. Tags
      can't be deleted by now, but the adding function supports reusing empty
      slots. Also the reading functions have to determine, whether a slot can
      be read or is empty.
      The tests were adjusted, but are buggy, so they should be rewritten in
      the future.
      
      Additionaly some annotations for splint were added.
      a0c9bb25
  9. 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
  10. 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