Commit graph

20 commits

Author SHA1 Message Date
Eric
aacf2324c7 improve decode time
atob() has been replaced with a lookup table, removing previous
conditionals and function calls necessary to decode.
2025-05-29 16:02:45 +02:00
Eric
debab62506 remove getsxts for better function readb
Decoding input is read faster now.
With this, all options have been tuned to a reasonable degree.
2025-05-29 13:48:49 +02:00
Eric
0a4a98390d improve printw to write faster
Now all encoding options are faster.
2025-05-29 00:51:00 +02:00
Eric
f0577d8ea0 decrease encode time
The functions encode and decode are now capable of processing larger
buffers with less conditional logic. Input and output functions need to
follow suit to make better use of this next. Encode without line
wrapping already makes use of these improvements, because input and
output are now entirely handled by <stdio.h> functions.
2025-05-28 23:24:05 +02:00
Eric
3194981825 repair Makefile to include -g in CFLAGS again 2025-05-28 20:33:16 +02:00
Eric
4e8bb86ddd change Makefile to be stricter
-Og enables better detection of bugs that would only occur in optimized
compilations and allows for slightly lesser than -O1 optimization that
does not interfere with debugging.
2025-05-28 17:55:13 +02:00
Eric
733a013ee7 remove bugs related to uninitialized variables
These bugs became visible when using optimization options. They were
either not present unoptimized or very unlikely to occur. However, given
the options, the resulting program would behave incorrectly and reliably
break under all circumstances.

The makefile will see the intended changes accordingly in the following
commit to ensure compatibility.
2025-05-28 17:31:07 +02:00
Eric
fa5095133a remove buffer size dependency from input functions
This should've been part of 848c37, when buffers were unwired from input
functions. Now buffer size is also no longer supplied in function calls
but assumed. It is up to the caller to provide appropriately sized
buffers.
2025-05-27 18:37:48 +02:00
Eric
b76c50a91b change header macro names to be more idiomatic 2025-05-27 15:14:55 +02:00
Eric
196c54cffa change newline termination behaviour when encoding
Before, encoded text would be newline terminated by default.
This was supposed to make short encoded strings easier to read when
using an interactive shell.
Now this only happens with the explicit line wrap option.
2025-05-27 02:09:21 +02:00
Eric
cd091b6a0c change help message to reflect new options -uw 2025-05-27 01:36:27 +02:00
Eric
0dba01d98e add linewrap option when encoding (76 columns) 2025-05-27 01:32:09 +02:00
Eric
6c7d699f1a add newline to end of file when encoding 2025-05-27 00:27:25 +02:00
Eric
623d0a5c3b add newline recognition for encoded input 2025-05-27 00:14:33 +02:00
Eric
a91be306b1 add base64url encoding option 2025-05-26 23:59:47 +02:00
Eric
8991fe1a69 correct Makefile recipe for encode.o
Since 848c37 encode.o no longer requires input.h.
2025-05-26 23:14:39 +02:00
Eric
28fcd5ed7a change file trans.{c,h} to encode.{c,h} 2025-05-26 23:12:16 +02:00
Eric
221a8588c0 add writing to file output option 2025-05-26 22:38:33 +02:00
Eric
848c3749d2 change function definitions
Buffers are no longer wired into any input or translation functions.
They are supplied as arguments through main.
2025-05-26 12:23:54 +02:00
Eric
9b1fe95a8e first commit 2025-05-26 00:06:22 +02:00