]> git.seodisparate.com - SimpleArchiver/log
SimpleArchiver
6 months agoAdd compiler hardening flags
Stephen Seo [Thu, 26 Sep 2024 08:31:06 +0000 (17:31 +0900)]
Add compiler hardening flags

7 months agoImpl. way to set custom hasher for hash_map
Stephen Seo [Sat, 21 Sep 2024 09:43:23 +0000 (18:43 +0900)]
Impl. way to set custom hasher for hash_map

7 months agoConvert "unsigned long long" to "uint64_t"
Stephen Seo [Sat, 21 Sep 2024 02:55:26 +0000 (11:55 +0900)]
Convert "unsigned long long" to "uint64_t"

Missed during previous changes using stdint.h .

7 months ago`clang-format`
Stephen Seo [Sat, 21 Sep 2024 02:43:25 +0000 (11:43 +0900)]
`clang-format`

7 months agoUse stdint.h types instead of "int", "long", etc.
Stephen Seo [Fri, 20 Sep 2024 12:40:35 +0000 (21:40 +0900)]
Use stdint.h types instead of "int", "long", etc.

7 months agoAdd single-ptr variants data structures' free fns
Stephen Seo [Fri, 13 Sep 2024 03:51:09 +0000 (12:51 +0900)]
Add single-ptr variants data structures' free fns

7 months agoRefactor priority-heap insert fn
Stephen Seo [Fri, 13 Sep 2024 02:33:15 +0000 (11:33 +0900)]
Refactor priority-heap insert fn

priority-heap insert now takes a pointer to a priority-heap instead of a
double pointer.

7 months agoRefactor data_structures/hash_map rehash fn
Stephen Seo [Wed, 11 Sep 2024 03:46:27 +0000 (12:46 +0900)]
Refactor data_structures/hash_map rehash fn

7 months agoCleanup related to change of hash-map insert fn
Stephen Seo [Mon, 9 Sep 2024 08:10:17 +0000 (17:10 +0900)]
Cleanup related to change of hash-map insert fn

7 months agoRefactor hash_map insert to use single ptr
Stephen Seo [Mon, 9 Sep 2024 02:25:00 +0000 (11:25 +0900)]
Refactor hash_map insert to use single ptr

Previous implementation used a double ptr for inserting into a hash map.
This refactoring allows for only needing to use a single ptr.

Fixes https://git.seodisparate.com/stephenseo/SimpleArchiver/issues/17 .

7 months agoFixes related to compiler warnings
Stephen Seo [Fri, 6 Sep 2024 05:23:27 +0000 (14:23 +0900)]
Fixes related to compiler warnings

Fix integer mismatch usages/comparisons.

Use "size_t" instead of "unsigned int" for data structures.

7 months agohash_map: Use const where applicable
Stephen Seo [Wed, 4 Sep 2024 06:30:37 +0000 (15:30 +0900)]
hash_map: Use const where applicable

7 months agohash_map iter fn: const key-value, update unittest
Stephen Seo [Sun, 1 Sep 2024 06:40:17 +0000 (15:40 +0900)]
hash_map iter fn: const key-value, update unittest

7 months agoImpl. hash_map iter, clang-format
Stephen Seo [Sun, 1 Sep 2024 06:11:57 +0000 (15:11 +0900)]
Impl. hash_map iter, clang-format

7 months agoSwitch to ISC License
Stephen Seo [Fri, 30 Aug 2024 02:35:17 +0000 (11:35 +0900)]
Switch to ISC License

8 months agoCleanup/refactorings
Stephen Seo [Mon, 29 Jul 2024 07:31:10 +0000 (16:31 +0900)]
Cleanup/refactorings

Moved common functions to helpers.h, and similar cleanup/refactorings.

8 months agoAdd NULL check when printing cwd on temp file fail
Stephen Seo [Fri, 26 Jul 2024 07:25:02 +0000 (16:25 +0900)]
Add NULL check when printing cwd on temp file fail

8 months agoMore verbose log when failing to create temp file
Stephen Seo [Fri, 26 Jul 2024 07:23:50 +0000 (16:23 +0900)]
More verbose log when failing to create temp file

8 months agoImprove file-count logs
Stephen Seo [Fri, 26 Jul 2024 07:18:07 +0000 (16:18 +0900)]
Improve file-count logs

8 months agoAdd check if file(s) are readable when archiving
Stephen Seo [Fri, 26 Jul 2024 07:01:39 +0000 (16:01 +0900)]
Add check if file(s) are readable when archiving

Also some minor changes like more error logs and refactorings.

8 months ago"Fix" windows build
Stephen Seo [Fri, 26 Jul 2024 04:23:51 +0000 (13:23 +0900)]
"Fix" windows build

TODO:
    Native Windows implementation.

8 months agoFix "-C <dir>" usage
Stephen Seo [Fri, 26 Jul 2024 04:17:11 +0000 (13:17 +0900)]
Fix "-C <dir>" usage

TODO:
    Merge re-used functions into "helpers".

8 months agoUpdate README.md
Stephen Seo [Fri, 26 Jul 2024 03:42:43 +0000 (12:42 +0900)]
Update README.md

8 months agoImpl. "-C <dir>", refactorings
Stephen Seo [Fri, 26 Jul 2024 03:39:56 +0000 (12:39 +0900)]
Impl. "-C <dir>", refactorings

8 months agoUpdate README.md
Stephen Seo [Thu, 25 Jul 2024 01:46:00 +0000 (10:46 +0900)]
Update README.md

8 months agoImpl. being able to set dir for temporary files
Stephen Seo [Thu, 25 Jul 2024 01:42:31 +0000 (10:42 +0900)]
Impl. being able to set dir for temporary files

8 months agoRefactor parser, setup for different temp dir
Stephen Seo [Thu, 25 Jul 2024 01:26:34 +0000 (10:26 +0900)]
Refactor parser, setup for different temp dir

8 months agoMinor help-text/doc fix
Stephen Seo [Wed, 24 Jul 2024 06:27:05 +0000 (15:27 +0900)]
Minor help-text/doc fix

8 months agoUpdate README.md
Stephen Seo [Wed, 24 Jul 2024 06:24:44 +0000 (15:24 +0900)]
Update README.md

8 months agoUpdate README.md
Stephen Seo [Wed, 24 Jul 2024 06:22:39 +0000 (15:22 +0900)]
Update README.md

8 months agoUpdate README.md
Stephen Seo [Wed, 24 Jul 2024 06:21:04 +0000 (15:21 +0900)]
Update README.md

8 months agoComment out debug print
Stephen Seo [Wed, 24 Jul 2024 06:05:01 +0000 (15:05 +0900)]
Comment out debug print

8 months ago"Fix" windows build
Stephen Seo [Wed, 24 Jul 2024 06:03:34 +0000 (15:03 +0900)]
"Fix" windows build

8 months agoImpl. link extracting
Stephen Seo [Wed, 24 Jul 2024 05:52:35 +0000 (14:52 +0900)]
Impl. link extracting

8 months agoAdd abs_path check when referring out of archive
Stephen Seo [Wed, 24 Jul 2024 05:31:38 +0000 (14:31 +0900)]
Add abs_path check when referring out of archive

If absolute paths are enabled, and a link points to something outside of
the archive, a flag is set on the symlink entry to prefer absolute
paths.

8 months agoCreate "set" of filenames for use when archiving
Stephen Seo [Wed, 24 Jul 2024 05:05:05 +0000 (14:05 +0900)]
Create "set" of filenames for use when archiving

8 months agoSplit off code into internal helper function
Stephen Seo [Wed, 24 Jul 2024 05:04:19 +0000 (14:04 +0900)]
Split off code into internal helper function

Function gets absolute path to given filename.

8 months agoMinor tweak to includes in archiver
Stephen Seo [Wed, 24 Jul 2024 05:03:03 +0000 (14:03 +0900)]
Minor tweak to includes in archiver

8 months agoUpdate file_format.md
Stephen Seo [Wed, 24 Jul 2024 04:33:46 +0000 (13:33 +0900)]
Update file_format.md

8 months agoAdd "--no-abs-symlink" to not store absolute paths
Stephen Seo [Wed, 24 Jul 2024 04:32:39 +0000 (13:32 +0900)]
Add "--no-abs-symlink" to not store absolute paths

8 months agoImpl. archiving abs/rel-paths for symbolic links
Stephen Seo [Tue, 23 Jul 2024 06:28:59 +0000 (15:28 +0900)]
Impl. archiving abs/rel-paths for symbolic links

TODO:
    Choosing the ideal link based on if link points to an archived file.
    Extracting (creating) symbolic links from archive.

8 months agoSet user permission bits if non-Unix platform
Stephen Seo [Tue, 23 Jul 2024 05:16:57 +0000 (14:16 +0900)]
Set user permission bits if non-Unix platform

9 months agoFix improper handling of unsupported symlinks
Stephen Seo [Mon, 22 Jul 2024 05:01:01 +0000 (14:01 +0900)]
Fix improper handling of unsupported symlinks

TODO:
    Archive symlinks properly.
    Extract symlinks properly.

9 months agoSupport "-f -" to read/write archive stdin/stdout
Stephen Seo [Fri, 19 Jul 2024 07:45:51 +0000 (16:45 +0900)]
Support "-f -" to read/write archive stdin/stdout

9 months agoUse SIGPIPE handling on UNIX platforms
Stephen Seo [Fri, 19 Jul 2024 03:15:20 +0000 (12:15 +0900)]
Use SIGPIPE handling on UNIX platforms

9 months agoImprove error handling
Stephen Seo [Fri, 19 Jul 2024 03:13:54 +0000 (12:13 +0900)]
Improve error handling

Handle SIGPIPE.

9 months agoMore robust error handling
Stephen Seo [Fri, 19 Jul 2024 02:29:14 +0000 (11:29 +0900)]
More robust error handling

9 months agoFix robust cleanup of temporary compressed file
Stephen Seo [Thu, 18 Jul 2024 13:56:12 +0000 (22:56 +0900)]
Fix robust cleanup of temporary compressed file

9 months agoMore robust handling of bad compressor cmd
Stephen Seo [Thu, 18 Jul 2024 13:32:04 +0000 (22:32 +0900)]
More robust handling of bad compressor cmd

9 months agoDo not create archive file on failure
Stephen Seo [Thu, 18 Jul 2024 13:09:03 +0000 (22:09 +0900)]
Do not create archive file on failure

9 months agoMore robust cleanup of temporary file
Stephen Seo [Thu, 18 Jul 2024 13:08:48 +0000 (22:08 +0900)]
More robust cleanup of temporary file

9 months agoImprove error print
Stephen Seo [Thu, 18 Jul 2024 09:55:42 +0000 (18:55 +0900)]
Improve error print

9 months agoPrint permissions when in "-t" mode
Stephen Seo [Thu, 18 Jul 2024 06:57:45 +0000 (15:57 +0900)]
Print permissions when in "-t" mode

9 months agoFix error when checking with "-t"
Stephen Seo [Thu, 18 Jul 2024 06:49:22 +0000 (15:49 +0900)]
Fix error when checking with "-t"

9 months agoImprove error printing
Stephen Seo [Thu, 18 Jul 2024 06:46:27 +0000 (15:46 +0900)]
Improve error printing

9 months agoRemove unnecessary "include"s
Stephen Seo [Thu, 18 Jul 2024 06:36:09 +0000 (15:36 +0900)]
Remove unnecessary "include"s

9 months agoComment out debug print
Stephen Seo [Thu, 18 Jul 2024 06:32:48 +0000 (15:32 +0900)]
Comment out debug print

9 months agoImpl. extract "white-list"
Stephen Seo [Thu, 18 Jul 2024 06:30:05 +0000 (15:30 +0900)]
Impl. extract "white-list"

When extracting, the given positional args will determine a "white-list"
of files to extract. If no positional args are given, then all files in
the archive will be extracted.

9 months agoImprove error handling when parsing/extracting
Stephen Seo [Thu, 18 Jul 2024 05:39:01 +0000 (14:39 +0900)]
Improve error handling when parsing/extracting

9 months agoFix extracting when no compressor was used
Stephen Seo [Thu, 18 Jul 2024 05:17:50 +0000 (14:17 +0900)]
Fix extracting when no compressor was used

9 months agoStore/restore file permissions
Stephen Seo [Thu, 18 Jul 2024 05:02:15 +0000 (14:02 +0900)]
Store/restore file permissions

9 months ago"Fix" windows build
Stephen Seo [Thu, 18 Jul 2024 04:33:35 +0000 (13:33 +0900)]
"Fix" windows build

9 months agoImplement extracting from archive
Stephen Seo [Thu, 18 Jul 2024 04:16:24 +0000 (13:16 +0900)]
Implement extracting from archive

TODO:
    Storing file permissions to be extracted with same permissions.
    Archiving and extracting symbolic links.

9 months agoAdd helper to create dirs from filepath
Stephen Seo [Thu, 18 Jul 2024 02:53:00 +0000 (11:53 +0900)]
Add helper to create dirs from filepath

9 months agoUse waitpid on compress to avoid defunct processes
Stephen Seo [Wed, 17 Jul 2024 10:00:34 +0000 (19:00 +0900)]
Use waitpid on compress to avoid defunct processes

9 months agoOutput when writing file to archive
Stephen Seo [Wed, 17 Jul 2024 08:22:09 +0000 (17:22 +0900)]
Output when writing file to archive

9 months agoImpl. compressing with arbitrary command
Stephen Seo [Wed, 17 Jul 2024 07:37:32 +0000 (16:37 +0900)]
Impl. compressing with arbitrary command

TODO:
    Archive extracting.
    Create archive with symbolic links.

9 months agoMinor fixes
Stephen Seo [Wed, 17 Jul 2024 06:01:39 +0000 (15:01 +0900)]
Minor fixes

9 months agoImpl. setup for de/compression
Stephen Seo [Wed, 17 Jul 2024 05:32:39 +0000 (14:32 +0900)]
Impl. setup for de/compression

Some setup code in preparation of doing the actual file compression when
creating an archive.

9 months ago"-t": Note that file is compressed if compressed
Stephen Seo [Wed, 17 Jul 2024 04:35:04 +0000 (13:35 +0900)]
"-t": Note that file is compressed if compressed

9 months agoImpl. "-t" command (printing archive info)
Stephen Seo [Wed, 17 Jul 2024 04:30:05 +0000 (13:30 +0900)]
Impl. "-t" command (printing archive info)

TODO:
    Write symbolic links into archive when creating.
    Use De/compressor cmds when creating archive.
    Extracting archive.

9 months agoUpdate parser flags to allow "checking" with "-t"
Stephen Seo [Wed, 17 Jul 2024 03:13:33 +0000 (12:13 +0900)]
Update parser flags to allow "checking" with "-t"

9 months agoAdd "status progress" when archiving
Stephen Seo [Tue, 16 Jul 2024 07:44:54 +0000 (16:44 +0900)]
Add "status progress" when archiving

9 months agoImpl. basic functionality "MVP"
Stephen Seo [Tue, 16 Jul 2024 07:16:58 +0000 (16:16 +0900)]
Impl. basic functionality "MVP"

"MinimumViableProduct", resolves #2 .

TODO:
  Support de/compressor cmds when creating archive.
  Support symbolic links when creating archive.
  Support extracting archive.

9 months agobig-endian convert: Use stdint.h
Stephen Seo [Mon, 15 Jul 2024 07:59:15 +0000 (16:59 +0900)]
big-endian convert: Use stdint.h

Replace "unsigned short" with uint16_t, "unsigned int" with uint32_t,
and "unsigned long long" with uint64_t.

9 months agoMinor tweaks to file format
Stephen Seo [Mon, 15 Jul 2024 06:43:14 +0000 (15:43 +0900)]
Minor tweaks to file format

9 months agoAdd "--overwrite-create"
Stephen Seo [Thu, 11 Jul 2024 07:56:23 +0000 (16:56 +0900)]
Add "--overwrite-create"

Default behavior is now to NOT overwrite existing archive files for
storing output unless "--overwrite-create" is specified.

9 months agoRevise file_format.md
Stephen Seo [Sun, 7 Jul 2024 05:43:32 +0000 (14:43 +0900)]
Revise file_format.md

Specify how symlink paths should be handled if they do not exist (path
size of 0).

9 months agoImpl. handling symbolic links
Stephen Seo [Thu, 4 Jul 2024 05:48:56 +0000 (14:48 +0900)]
Impl. handling symbolic links

9 months agoRemove unnecessary "TODO" in comment.
Stephen Seo [Thu, 4 Jul 2024 04:50:32 +0000 (13:50 +0900)]
Remove unnecessary "TODO" in comment.

9 months agoUpdate file_format.md
Stephen Seo [Thu, 4 Jul 2024 04:48:39 +0000 (13:48 +0900)]
Update file_format.md

Make strings NULL-terminated.

9 months agorevise file_format.md
Stephen Seo [Thu, 4 Jul 2024 04:13:52 +0000 (13:13 +0900)]
revise file_format.md

9 months agoUpdate file_format.md
Stephen Seo [Thu, 4 Jul 2024 04:10:22 +0000 (13:10 +0900)]
Update file_format.md

Resolves #11 .

9 months agoparser: Enable existing codepath for OSX
Stephen Seo [Thu, 4 Jul 2024 02:54:15 +0000 (11:54 +0900)]
parser: Enable existing codepath for OSX

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.

9 months agoHandle symbolic links separately
Stephen Seo [Wed, 3 Jul 2024 11:25:42 +0000 (20:25 +0900)]
Handle symbolic links separately

Previous implementation could loop forever following a symbolic link
that goes backwards. This commit makes symbolic links an "unhandled file
type" for now.

9 months ago"platforms.h" include should be before its usage
Stephen Seo [Wed, 3 Jul 2024 11:01:03 +0000 (20:01 +0900)]
"platforms.h" include should be before its usage

9 months agoImpl. parser accepting files and dirs
Stephen Seo [Wed, 3 Jul 2024 10:54:44 +0000 (19:54 +0900)]
Impl. parser accepting files and dirs

Fix memory leak in hash_map.

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

TODO: Handle symbolic links

9 months agoRemove 'extern' from parser.h
Stephen Seo [Wed, 3 Jul 2024 08:55:35 +0000 (17:55 +0900)]
Remove 'extern' from parser.h

9 months agoAdd helpers for conversion to/from big-endian
Stephen Seo [Tue, 2 Jul 2024 05:25:01 +0000 (14:25 +0900)]
Add helpers for conversion to/from big-endian

Also added tests for big-endian-conversion functions.

9 months agoRevise file_format
Stephen Seo [Tue, 2 Jul 2024 05:02:38 +0000 (14:02 +0900)]
Revise file_format

The changes should allow for the .simplearchive file to be directly
outputted to standard out in a single pass.

Resolves #10 .

9 months agoSome work on arg parser
Stephen Seo [Mon, 1 Jul 2024 06:13:06 +0000 (15:13 +0900)]
Some work on arg parser

Also added unit tests for arg parser.

9 months agoFix unit test for priority heap
Stephen Seo [Sun, 30 Jun 2024 11:02:47 +0000 (20:02 +0900)]
Fix unit test for priority heap

9 months agoChange priority_heap to accept "less_fn"
Stephen Seo [Sun, 30 Jun 2024 08:29:24 +0000 (17:29 +0900)]
Change priority_heap to accept "less_fn"

This allows for reverse order in the priority heap by using a "more_fn"
in place of a "less fn".

9 months agoMinor fix to doc comment about priority heap
Stephen Seo [Sun, 30 Jun 2024 06:35:27 +0000 (15:35 +0900)]
Minor fix to doc comment about priority heap

9 months agoImpl. priority heap, minor tweaks/fixes
Stephen Seo [Sun, 30 Jun 2024 06:32:17 +0000 (15:32 +0900)]
Impl. priority heap, minor tweaks/fixes

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`.

9 months agoAdd `platforms.h` header to determine platform
Stephen Seo [Sat, 29 Jun 2024 07:52:17 +0000 (16:52 +0900)]
Add `platforms.h` header to determine platform

The platforms.h header will allow for using/implementing OS-specific
code that will differ based on the platform the program is compiled for.

9 months agoAdd action/workflow to run unit tests
Stephen Seo [Sat, 29 Jun 2024 07:13:15 +0000 (16:13 +0900)]
Add action/workflow to run unit tests

Currently only runs `test_datastructures`.

9 months agoUpdate README.md
Stephen Seo [Sat, 29 Jun 2024 07:00:59 +0000 (16:00 +0900)]
Update README.md

9 months agoFix cosmopolitan/Makefile missing files
Stephen Seo [Fri, 28 Jun 2024 10:35:06 +0000 (19:35 +0900)]
Fix cosmopolitan/Makefile missing files

9 months agoFix hashing in hash_map (hopefully finally)
Stephen Seo [Fri, 28 Jun 2024 09:19:29 +0000 (18:19 +0900)]
Fix hashing in hash_map (hopefully finally)