void th_set_from_stat(TAR *t, struct stat *s);
void th_set_type(TAR *t, mode_t mode);
void th_set_path(TAR *t, char *pathname);
void th_set_link(TAR *t, char *linkname);
void th_set_device(TAR *t, dev_t device);
void th_set_user(TAR *t, uid_t uid);
void th_set_group(TAR *t, gid_t gid);
void th_set_mode(TAR *t, mode_t mode);
void th_set_mtime(TAR *t, time_t fmtime);
void th_set_size(TAR *t, off_t fsize);
The th_set_from_stat() function uses the other th_set_*() functions to set all of the fields at once, based on the data passed to it in the argument s.
The th_finish() function sets the appropriate constants for the magic and version fields. It then calculates the header checksum and fills in the checksum field.