Make naming consistent across all files
This commit is contained in:
parent
4401b1ca3a
commit
97da894c0f
@ -37,7 +37,7 @@ The output of this example program when running it with an uncompressed tar arch
|
|||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### minitar_open
|
### minitar_open
|
||||||
`struct minitar* minitar_open(const char* filename)`
|
`struct minitar* minitar_open(const char* pathname)`
|
||||||
|
|
||||||
Opens a tar archive for reading, and returns a heap-allocated `struct minitar` which must be freed with `minitar_close()` after using it. If opening the file or allocating the struct fails, returns NULL.
|
Opens a tar archive for reading, and returns a heap-allocated `struct minitar` which must be freed with `minitar_close()` after using it. If opening the file or allocating the struct fails, returns NULL.
|
||||||
|
|
||||||
|
14
src/tar.c
14
src/tar.c
@ -4,15 +4,15 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
int minitar_read_header(struct minitar* mp, struct tar_header* hdr);
|
int minitar_read_header(struct minitar*, struct tar_header*);
|
||||||
int minitar_validate_header(struct tar_header* hdr);
|
int minitar_validate_header(struct tar_header*);
|
||||||
void minitar_parse_tar_header(struct tar_header* hdr, struct minitar_entry_metadata* metadata);
|
void minitar_parse_tar_header(struct tar_header*, struct minitar_entry_metadata*);
|
||||||
struct minitar_entry* minitar_dup_entry(struct minitar_entry* original);
|
struct minitar_entry* minitar_dup_entry(struct minitar_entry*);
|
||||||
char* minitar_read_file(struct minitar_entry_metadata* metadata, struct minitar* mp);
|
char* minitar_read_file(struct minitar_entry_metadata*, struct minitar*);
|
||||||
|
|
||||||
struct minitar* minitar_open(const char* path)
|
struct minitar* minitar_open(const char* pathname)
|
||||||
{
|
{
|
||||||
FILE* fp = fopen(path, "rb"); // On some systems, this might be necessary to read the file properly.
|
FILE* fp = fopen(pathname, "rb"); // On some systems, this might be necessary to read the file properly.
|
||||||
if (!fp) return NULL;
|
if (!fp) return NULL;
|
||||||
struct minitar* mp = malloc(sizeof(struct minitar));
|
struct minitar* mp = malloc(sizeof(struct minitar));
|
||||||
if (!mp)
|
if (!mp)
|
||||||
|
Loading…
Reference in New Issue
Block a user