Commit graph

36 commits

Author SHA1 Message Date
e0373d693d Update file_format.md
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 45s
Make strings NULL-terminated.
2024-07-04 13:48:39 +09:00
004f4f2cd9 revise file_format.md
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
2024-07-04 13:13:52 +09:00
174d30a8b6 Update file_format.md
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
Resolves #11 .
2024-07-04 13:10:22 +09:00
518ac3ebe1 parser: Enable existing codepath for OSX
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 5s
The Unix functions/headers used in parser for getting files/dirs from
the given positional arguments are also available in OSX
(theoretically), so they are now enabled for OSX platforms.

TODO: Add getting files/dirs code for the Windows platform.
2024-07-04 11:54:15 +09:00
6ee347da12 Handle symbolic links separately
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 4s
Previous implementation could loop forever following a symbolic link
that goes backwards. This commit makes symbolic links an "unhandled file
type" for now.
2024-07-03 20:25:42 +09:00
c9df661cd3 "platforms.h" include should be before its usage
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 4s
2024-07-03 20:01:19 +09:00
e06e65e5e8 Impl. parser accepting files and dirs
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 4s
Fix memory leak in hash_map.

Current "main" prints specified files and subfiles of specified
directories.

TODO: Handle symbolic links
2024-07-03 19:56:26 +09:00
8d912ce780 Remove 'extern' from parser.h 2024-07-03 17:55:35 +09:00
69051a6c24 Add helpers for conversion to/from big-endian
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
Also added tests for big-endian-conversion functions.
2024-07-02 14:25:01 +09:00
eb1f09b551 Revise file_format
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 4s
The changes should allow for the .simplearchive file to be directly
outputted to standard out in a single pass.

Resolves #10 .
2024-07-02 14:02:38 +09:00
3172920c9c Some work on arg parser
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 7s
Also added unit tests for arg parser.
2024-07-01 15:13:06 +09:00
467c09a0e4 Fix unit test for priority heap
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
2024-06-30 20:02:47 +09:00
9e95c5e292 Change priority_heap to accept "less_fn"
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
This allows for reverse order in the priority heap by using a "more_fn"
in place of a "less fn".
2024-06-30 17:29:24 +09:00
d815f67b2d Minor fix to doc comment about priority heap
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
2024-06-30 15:35:27 +09:00
fbe62ba5b2 Impl. priority heap, minor tweaks/fixes
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
Implemented a priority heap.

Added tests for the priority heap.

Add a "default" lcg generator function.

Tweak hash_map to use the default lcg generator function.

`clang-format`.
2024-06-30 15:32:17 +09:00
ea919f3eb3 Add platforms.h header to determine platform
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 3s
The platforms.h header will allow for using/implementing OS-specific
code that will differ based on the platform the program is compiled for.
2024-06-29 16:52:17 +09:00
86a68eef83 Add action/workflow to run unit tests
All checks were successful
Run Unit Tests / build-and-run-unit-tests (push) Successful in 4s
Currently only runs `test_datastructures`.
2024-06-29 16:13:15 +09:00
aa00131020 Update README.md 2024-06-29 16:00:59 +09:00
0a2aef0fd1 Fix cosmopolitan/Makefile missing files 2024-06-28 19:35:06 +09:00
aa2a1bf583 Fix hashing in hash_map (hopefully finally) 2024-06-28 18:19:29 +09:00
da72a2387f Fix hash_map hashing (hopefully the final time) 2024-06-28 18:17:38 +09:00
c5b2ca6dff Fix hashing in hash_map 2024-06-28 18:15:40 +09:00
d6878b0f1d Revert "Minor additions to unit test of data structures"
This reverts commit f1bab48fb5.

Unnecessary checks were added that were already checked by the preceding
for statement.
2024-06-28 17:40:29 +09:00
f1bab48fb5 Minor additions to unit test of data structures 2024-06-28 17:38:43 +09:00
4d260e4a7b Impl. hash_map
Also implemented the linear congruential generator algorithm for
generating hash values for the hash_map.

Tweaks to linked_list api to support "check functions" with supplied
user data.
2024-06-28 17:31:34 +09:00
6ac7edbb3b Implement a linked list data structure 2024-06-28 13:54:38 +09:00
5b60a2fe1b Create Makefile for building with cosmocc
Resolves #9.
2024-06-28 13:02:26 +09:00
dc9ddcfa76 Update README.md 2024-06-27 17:21:59 +09:00
7c25300e2b Rename executable to lowercase 2024-06-27 17:20:46 +09:00
c1b914cb8e Remove unnecessary prints, clang-format 2024-06-27 13:30:18 +09:00
21752fb504 Fix invalid memory usage bug causing invalid free
realloc(...) was not used propertly. The number of items to be
reallocated was specified, but not the size of each item.
2024-06-27 13:28:53 +09:00
44080e85cc Impl. parser (TODO Fix invalid free crash)
During testing, having at least three positional args cause an invalid
free crash. Should be investigated and fixed.
2024-06-27 11:57:29 +09:00
002590379e Update file_format.md
Add support for per-file compressing by storing the
compressor/decompressor commands in the per-file header part of the
.simplearchive.
2024-06-27 10:36:06 +09:00
49c6923200 Define file format (version 0 file format)
Resolves #1.
2024-06-27 10:14:10 +09:00
37b31beb63 Add LICENSE, README.md, and license info in source 2024-06-26 19:19:21 +09:00
5db711bd62 Create skeleton C project 2024-06-26 17:57:23 +09:00