chore: Add copyright headers to all source files

This commit is contained in:
apio 2023-01-12 21:04:52 +01:00
parent bacc971007
commit 9a7629459e
Signed by: apio
GPG Key ID: B8A7D06E42258954
6 changed files with 48 additions and 3 deletions

View File

@ -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 <minitar.h>
#include <stdio.h>

View File

@ -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 <errno.h>
#include <fcntl.h>

View File

@ -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 <stddef.h>

View File

@ -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 <stdio.h>
@ -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;

View File

@ -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

View File

@ -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 <ctype.h>