Skip to content
Snippets Groups Projects
  1. Jan 04, 2023
    • Jonathan Schöbel's avatar
      disintegrated validator · 1e61c23e
      Jonathan Schöbel authored
      The validator was used to check that every created tag is validate.
      However I now think that validation should take place at a later time,
      so it is not mandatory.
      Thus developing the validator is now discontinued.
      1e61c23e
  2. 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
  3. 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
  4. Oct 15, 2022
    • Jonathan Schöbel's avatar
      Text: added constructor with initialization · aeca7dd7
      Jonathan Schöbel authored
      The constructor SH_Text_new_from_string accepts a string, with that the
      text is initialized. This can replace the so far needed two calls
      SH_Text_new and SH_Text_append_string.
      
      When writing the test, it was neccessary to simulate an overflow.
      Thereby a bug was detected regarding another overflow test. The bug was,
      that when SIZE_MAX % CHUNK_SIZE == 0 (which is normally true, if 2^n is
      taken as the value for CHUNK_SIZE) there can't be an overflow, so the
      test for an overflow fails. Actually there wasn't a neccesity to check
      for an overflow, as this could easily be bypassed by just allocating the
      requested size instead of the next chunk size, if this would be greater
      then SIZE_MAX.
      aeca7dd7
  5. Sep 20, 2022
  6. Sep 18, 2022
  7. Sep 01, 2022
  8. Jun 21, 2022
    • Jonathan Schöbel's avatar
      added Text · a71ce13c
      Jonathan Schöbel authored
      This is a data type to deal with frequently appending to a string.
      a71ce13c
    • Jonathan Schöbel's avatar
      look for duplicate tags in Validator · 47407f2d
      Jonathan Schöbel authored
      When a tag is made known to the Validator, which it already knows, the
      old id is returned and nothing is added.
      As this has to be checked by iterating over all known tags, a new helper
      function is written for both SH_Validator_check_tag and
      SH_Validator_register_tag: SH_Validator_get_tag.
      
      Because we want also to test this function, we have to include
      validator.c in the test file and override the static keyword by an empty
      macro. It isn't possible any more to check for correct overflowdetection
      by setting the index to UINT_MAX, because it will be iterated over all
      data, thus raising an SIGSEGV when doing so. This is solved by filling
      garbage unil UINT_MAX is really reached. As there would be an timeout
      and it would fill RAM with around 40 GB of garbage, UINT_MAX is
      overriden prior to inclusion of validator.c .
      47407f2d
  9. Aug 31, 2022
  10. Jun 21, 2022
    • Jonathan Schöbel's avatar
      added Validator · 7c9a245e
      Jonathan Schöbel authored
      Validator serves as an syntax checker, i. e. it can be requested whether
      a tag is allowed.
      7c9a245e
  11. Jun 20, 2022
Loading