git/archive-tar.c

/*
 * Copyright (c) 2005, 2006 Rene Scharfe
 */

#define USE_THE_REPOSITORY_VARIABLE

#include "git-compat-util.h"
#include "config.h"
#include "gettext.h"
#include "git-zlib.h"
#include "hex.h"
#include "tar.h"
#include "archive.h"
#include "object-store-ll.h"
#include "strbuf.h"
#include "streaming.h"
#include "run-command.h"
#include "write-or-die.h"

#define RECORDSIZE
#define BLOCKSIZE

static char block[BLOCKSIZE];
static unsigned long offset;

static int tar_umask =;

static int write_tar_filter_archive(const struct archiver *ar,
				    struct archiver_args *args);

/*
 * This is the max value that a ustar size header can specify, as it is fixed
 * at 11 octal digits. POSIX specifies that we switch to extended headers at
 * this size.
 *
 * Likewise for the mtime (which happens to use a buffer of the same size).
 */
#if ULONG_MAX == 0xFFFFFFFF
#define USTAR_MAX_SIZE
#else
#define USTAR_MAX_SIZE
#endif
#if TIME_MAX == 0xFFFFFFFF
#define USTAR_MAX_MTIME
#else
#define USTAR_MAX_MTIME
#endif

static void tar_write_block(const void *buf)
{}

static void (*write_block)(const void *) =;

/* writes out the whole block, but only if it is full */
static void write_if_needed(void)
{}

/*
 * queues up writes, so that all our write(2) calls write exactly one
 * full block; pads writes to RECORDSIZE
 */
static void do_write_blocked(const void *data, unsigned long size)
{}

static void finish_record(void)
{}

static void write_blocked(const void *data, unsigned long size)
{}

/*
 * The end of tar archives is marked by 2*512 nul bytes and after that
 * follows the rest of the block (if any).
 */
static void write_trailer(void)
{}

/*
 * queues up writes, so that all our write(2) calls write exactly one
 * full block; pads writes to RECORDSIZE
 */
static int stream_blocked(struct repository *r, const struct object_id *oid)
{}

/*
 * pax extended header records have the format "%u %s=%s\n".  %u contains
 * the size of the whole string (including the %u), the first %s is the
 * keyword, the second one is the value.  This function constructs such a
 * string and appends it to a struct strbuf.
 */
static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword,
				     const char *value, size_t valuelen)
{}

/*
 * Like strbuf_append_ext_header, but for numeric values.
 */
static void strbuf_append_ext_header_uint(struct strbuf *sb,
					  const char *keyword,
					  uintmax_t value)
{}

static unsigned int ustar_header_chksum(const struct ustar_header *header)
{}

static size_t get_path_prefix(const char *path, size_t pathlen, size_t maxlen)
{}

static void prepare_header(struct archiver_args *args,
			   struct ustar_header *header,
			   unsigned int mode, unsigned long size)
{}

static void write_extended_header(struct archiver_args *args,
				  const struct object_id *oid,
				  const void *buffer, unsigned long size)
{}

static int write_tar_entry(struct archiver_args *args,
			   const struct object_id *oid,
			   const char *path, size_t pathlen,
			   unsigned int mode,
			   void *buffer, unsigned long size)
{}

static void write_global_extended_header(struct archiver_args *args)
{}

static struct archiver **tar_filters;
static int nr_tar_filters;
static int alloc_tar_filters;

static struct archiver *find_tar_filter(const char *name, size_t len)
{}

static int tar_filter_config(const char *var, const char *value,
			     void *data UNUSED)
{}

static int git_tar_config(const char *var, const char *value,
			  const struct config_context *ctx, void *cb)
{}

static int write_tar_archive(const struct archiver *ar UNUSED,
			     struct archiver_args *args)
{}

static git_zstream gzstream;
static unsigned char outbuf[16384];

static void tgz_deflate(int flush)
{}

static void tgz_write_block(const void *data)
{}

static const char internal_gzip_command[] =;

static int write_tar_filter_archive(const struct archiver *ar,
				    struct archiver_args *args)
{}

static struct archiver tar_archiver =;

void init_tar_archiver(void)
{}