diff --git a/examples/list.c b/examples/list.c index c8f85aa..b3e1c78 100644 --- a/examples/list.c +++ b/examples/list.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2023, apio. + * + * SPDX-License-Identifier: BSD-2-Clause + * + * list.c: Example utility which lists files in a tar archive. + */ + #include #include diff --git a/examples/untar.c b/examples/untar.c index 97bc363..040942d 100644 --- a/examples/untar.c +++ b/examples/untar.c @@ -1,4 +1,10 @@ -/* Simple untar example for POSIX systems using minitar. */ +/* + * Copyright (c) 2023, apio. + * + * SPDX-License-Identifier: BSD-2-Clause + * + * untar.c: Example utility which extracts files from a tar archive (POSIX only). + */ #include #include diff --git a/minitar.h b/minitar.h index 34a49fc..2fbf1f3 100644 --- a/minitar.h +++ b/minitar.h @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2022-2023, apio. + * + * SPDX-License-Identifier: BSD-2-Clause + * + * minitar.h: The minitar header. + */ + #ifndef MINITAR_H #define MINITAR_H #include diff --git a/src/tar.c b/src/tar.c index 1242e82..7cc8123 100644 --- a/src/tar.c +++ b/src/tar.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2022-2023, apio. + * + * SPDX-License-Identifier: BSD-2-Clause + * + * tar.c: minitar API implementation. + */ + #include "tar.h" #include "minitar.h" #include @@ -26,8 +34,7 @@ int minitar_close(struct minitar* mp) // Try to read a valid header, and construct an entry from it. If the 512-byte block at the current read offset is not a // valid header, valid is set to 0 so we can try again with the next block. In any other case, valid is set to 1. This -// helps distinguish valid return values, null pointers that should be returned to the user (for example, EOF), and -// invalid headers where we should just try again until we find a valid one. +// helps distinguish valid return values, EOF, and invalid headers that we should just skip. static int minitar_try_to_read_valid_entry(struct minitar* mp, struct minitar_entry* out, int* valid) { struct tar_header hdr; diff --git a/src/tar.h b/src/tar.h index 4547fcc..ba6d37a 100644 --- a/src/tar.h +++ b/src/tar.h @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2022-2023, apio. + * + * SPDX-License-Identifier: BSD-2-Clause + * + * tar.h: tar header structure. + */ + #ifndef MINITAR_TAR_H #define MINITAR_TAR_H diff --git a/src/util.c b/src/util.c index aaa33fb..b771d08 100644 --- a/src/util.c +++ b/src/util.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2022-2023, apio. + * + * SPDX-License-Identifier: BSD-2-Clause + * + * util.c: Utility functions for minitar. + */ + #include "minitar.h" #include "tar.h" #include