24 lines
539 B
C
24 lines
539 B
C
#ifndef TAR_H
|
|
#define TAR_H
|
|
|
|
#include "util.h"
|
|
|
|
struct tar_entry {
|
|
struct string file_name;
|
|
struct string data;
|
|
|
|
b32 is_dir;
|
|
struct tar_entry *next;
|
|
struct tar_entry *next_child; /* If entry is dir, points to first child. Otherwise points to next sibling. */
|
|
};
|
|
|
|
struct tar_archive {
|
|
struct dict *lookup;
|
|
struct tar_entry *head;
|
|
};
|
|
|
|
struct tar_archive tar_parse(struct arena *arena, struct string data, struct string prefix);
|
|
struct tar_entry *tar_get(struct tar_archive *archive, struct string name);
|
|
|
|
#endif
|