Consistently use "superuser" instead of "super user"
[pgsql.git] / src / include / pgtar.h
blob6d47ece652044b1080dff0eb3174f8b539bc6fdd
1 /*-------------------------------------------------------------------------
3 * pgtar.h
4 * Functions for manipulating tarfile datastructures (src/port/tar.c)
7 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/pgtar.h
12 *-------------------------------------------------------------------------
14 #ifndef PG_TAR_H
15 #define PG_TAR_H
17 #define TAR_BLOCK_SIZE 512
19 enum tarError
21 TAR_OK = 0,
22 TAR_NAME_TOO_LONG,
23 TAR_SYMLINK_TOO_LONG
26 extern enum tarError tarCreateHeader(char *h, const char *filename,
27 const char *linktarget, pgoff_t size,
28 mode_t mode, uid_t uid, gid_t gid,
29 time_t mtime);
30 extern uint64 read_tar_number(const char *s, int len);
31 extern void print_tar_number(char *s, int len, uint64 val);
32 extern int tarChecksum(char *header);
35 * Compute the number of padding bytes required for an entry in a tar
36 * archive. We must pad out to a multiple of TAR_BLOCK_SIZE. Since that's
37 * a power of 2, we can use TYPEALIGN().
39 static inline size_t
40 tarPaddingBytesRequired(size_t len)
42 return TYPEALIGN(TAR_BLOCK_SIZE, len) - len;
45 #endif