Skip to content

Major overhaul#2

Draft
Dove6 wants to merge 34 commits intomasterfrom
library
Draft

Major overhaul#2
Dove6 wants to merge 34 commits intomasterfrom
library

Conversation

@Dove6
Copy link
Copy Markdown
Owner

@Dove6 Dove6 commented Jan 1, 2022

including, but not limited to...

  • transforming the tool into a library that can be used (freely and conveniently) in other projects,
  • providing a clear, well-documented API,
  • making code more readable thanks to better structuring and variable names,
  • using a standarized directory layout,
  • employing a build script for trouble-free app building

Dove6 added 30 commits November 7, 2019 01:35
In preparation for transformation to a library
Included hyperlink to Polish version
Merging online README.md update with local changes
With the use of Doxygen
Also moved library's public header to /include and performed small changes in .gitignore
…e no. 1, started implementation of functions, moved html docs to /docs
…ng two settings structs

Functions' implementation in progress
Added AMKD_WARNING_UNKNOWN_ENCODING warning, updated docs
Also made some small fixes and updated docs
Fix bugs preventing the library form working correctly:
  add header at the beggining of encoded string,
  simplify code structure and improve compatibility with original
    algorithm,
  refine AMkd_deallocate_result:
    fix infinite loop bug caused by performing strstr search not
      from after previous occurence, but from its exact occurence
      (which returned the same result),
    put header length into consideration while calculating size
      of encoded string,
    remove unintended zero-division by changing variable checked
      inside of conditional statement,
  make AMkd_strip_header comply with specification.

Add AMkd_deallocate_result for the sake of simplicity
and unumbiguity of freeing result strings.
Add debug output.
Force usage of CRLF line endings (both in encode and decoded
string).
Add freeing of memory in example0.
Increment minor version number according to last changes. Set README.md as main page.
Instead of single return error code for storing one error or one
warning, use divalent error indicator and take additional structure
(consisting of error code and warning binary flag register) as
a function argument. It keeps checking function state simple (by
just comparing return code), while allowing to provide more
detailed data (which, of course, user may discard).
In relation to this change, divide AMkd_error enumeration into
AMkd_error_code responsible for critical errors
and AMkd_warning_flags for other.

Add a few more error codes.
Update documentation (to version 0.7.0)

Reduce AMkd_compare_configs() to a single case: comparing the whole
structure. Rename the function to AMkd_compare_settings().
Detect line ending sequence in input string and handle them
accordingly (maintaining CRLF in output string though).
Add a new warning flag associated with line ending detection (for
the case when it can't be done).
Create functions for translating error codes and warning flags
into appriopriate string messages.

example0.c:
Append null terminator after the read file contents, which fixes
memory-related issues.
Accordingly to the previous commit
Remove an unused variable (detected_line_break in AMkd.c:AMkd_encode)
Add spaces before comments.
Make DEBUG ifdefs activate if VERBOSE_DEBUG is used as well.
Fix printf type specifiers for size_t arguments.
 and thus move responsibility for stripping headers to users (I wonder if it
 would be needed at all) and get rid of scanf in every other function.
Also, fix a bug in `count_set_bits` function that caused counter
 variable not to be updated.
 to be returned if non-line break input sequence results in a line break
 after encoding.

Return progress indicator in case of errors.

Update docs.
 moving the responsibility of calling `AMkd_detect_encoding` to users.
Update docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant