Added autoconf instructions to README
[libtar.git] / doc / th_read.3
blob97ad0bf9886061c0a09eff4017e8c1e41a3bf8c6
1 .TH th_read 3 "Jan 2001" "University of Illinois" "C Library Calls"
2 .SH NAME
3 th_read, th_write \- read and write a file header block from a tar archive
4 .SH SYNOPSIS
5 .B #include <libtar.h>
6 .P
7 .BI "int th_read(TAR *" t ");"
9 .BI "int th_write(TAR *" t ");"
10 .SH VERSION
11 This man page documents version 1.2 of \fBlibtar\fP.
12 .SH DESCRIPTION
13 The \fBth_read\fP() function reads the next block from the tar archive
14 associated with the \fITAR\fP handle \fIt\fP.  It then sets the
15 current tar header associated with \fIt\fP to the contents of the block
16 read.
18 The \fBth_write\fP() function writes the contents of the current
19 tar header associated with \fIt\fP to the tar archive associated
20 with \fIt\fP.
21 .SH RETURN VALUE
22 On successful completion, \fBth_read\fP() and \fBth_write\fP() will
23 return 0.  On failure, they will return \-1 and set \fIerrno\fP to an
24 appropriate value.
26 On \fIEOF\fP, \fBth_read\fP() will return 1.
27 .SH ERRORS
28 \fBth_read\fP() and \fBth_write\fP() will fail if:
29 .IP \fBEINVAL\fP
30 Less than \fBT_BLOCKSIZE\fP blocks were read or written.
31 .PP
32 .SH SEE ALSO
33 .BR tar_block_read (3),
34 .BR tar_block_write (3)