chore: Add copyright headers to all source files
This commit is contained in:
parent
bacc971007
commit
9a7629459e
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
11
src/tar.c
11
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 <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;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user