Document zip_{g,s}et_archive_flag.

--HG--
branch : HEAD
diff --git a/man/Makefile.am b/man/Makefile.am
index f7cbb08..17e8782 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -21,6 +21,7 @@
 	zip_fopen.mdoc \
 	zip_fread.mdoc \
 	zip_get_archive_comment.mdoc \
+	zip_get_archive_flag.mdoc \
 	zip_get_file_comment.mdoc \
 	zip_get_name.mdoc \
 	zip_get_num_files.mdoc \
@@ -28,6 +29,7 @@
 	zip_open.mdoc \
 	zip_rename.mdoc \
 	zip_set_archive_comment.mdoc \
+	zip_set_archive_flag.mdoc \
 	zip_set_file_comment.mdoc \
 	zip_source_buffer.mdoc \
 	zip_source_file.mdoc \
diff --git a/man/libzip.man b/man/libzip.man
index 8d35249..516c41a 100644
--- a/man/libzip.man
+++ b/man/libzip.man
@@ -33,7 +33,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.TH LIBZIP 3 "April 23, 2006" NiH
+.TH LIBZIP 3 "June 4, 2008" NiH
 .SH "NAME"
 libzip \- library for manipulating zip archives
 .SH "LIBRARY"
@@ -61,6 +61,7 @@
 .SS "miscellaneous"
 zip_stat(3)
 zip_get_archive_comment(3)
+zip_get_archive_flag(3)
 zip_get_file_comment(3)
 zip_get_name(3)
 zip_get_num_files(3)
@@ -89,6 +90,7 @@
 zip_close(3)
 .SS "miscellaneous"
 zip_set_archive_comment(3)
+zip_set_archive_flag(3)
 .SH "ERROR HANDLING"
 zip_error_to_str(3)
 zip_strerror(3)
diff --git a/man/libzip.mdoc b/man/libzip.mdoc
index f329f9e..97c9d6b 100644
--- a/man/libzip.mdoc
+++ b/man/libzip.mdoc
@@ -31,7 +31,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 23, 2006
+.Dd June 4, 2008
 .Dt LIBZIP 3
 .Os
 .Sh NAME
@@ -62,6 +62,7 @@
 .Ss miscellaneous
 .Xr zip_stat 3
 .Xr zip_get_archive_comment 3
+.Xr zip_get_archive_flag 3
 .Xr zip_get_file_comment 3
 .Xr zip_get_name 3
 .Xr zip_get_num_files 3
@@ -90,6 +91,7 @@
 .Xr zip_close 3
 .Ss miscellaneous
 .Xr zip_set_archive_comment 3
+.Xr zip_set_archive_flag 3
 .Sh ERROR HANDLING
 .Xr zip_error_to_str 3
 .Xr zip_strerror 3
diff --git a/man/zip_get_archive_flag.man b/man/zip_get_archive_flag.man
new file mode 100644
index 0000000..9fb25f9
--- /dev/null
+++ b/man/zip_get_archive_flag.man
@@ -0,0 +1,77 @@
+.\" zip_get_archive_flag.mdoc \-- get comment for file in zip
+.\" Copyright (C) 2008 Dieter Baron and Thomas Klausner
+.\"
+.\" This file is part of libzip, a library to manipulate ZIP files.
+.\" The authors can be contacted at <libzip@nih.at>
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in
+.\"    the documentation and/or other materials provided with the
+.\"    distribution.
+.\" 3. The names of the authors may not be used to endorse or promote
+.\"    products derived from this software without specific prior
+.\"    written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.TH ZIP_GET_ARCHIVE_FLAG 3 "June 4, 2008" NiH
+.SH "NAME"
+zip_get_archive_flag \- get status flags for zip
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+#include <zip.h>
+.PP
+int
+zip_get_archive_flag(struct zip *archive, int flag, int flags);
+.SH "DESCRIPTION"
+The
+zip_get_archive_flag
+function returns if the flag
+\fBflag\fR
+is set for the archive
+\fBarchive.\fR
+The archive flags might have been changed with
+zip_set_archive_flag;
+if
+\fBflags\fR
+is set to
+\fBZIP_FL_UNCHANGED,\fR
+the original unchanged flags are tested.
+.PP
+Supported flags are:
+.RS
+.TP 21
+\fBZIP_AFL_TORRENT\fR
+The archive is torrent-zipped.
+.RE
+.SH "RETURN VALUES"
+zip_get_archive_flag
+returns 1 if
+\fBflag\fR
+is set for
+\fBarchive,\fR
+and 0 if not.
+.SH "SEE ALSO"
+libzip(3),
+zip_set_archive_flag(3)
+.SH "AUTHORS"
+
+Dieter Baron <dillo@giga.or.at>
+and
+Thomas Klausner <tk@giga.or.at>
diff --git a/man/zip_get_archive_flag.mdoc b/man/zip_get_archive_flag.mdoc
new file mode 100644
index 0000000..9dd708f
--- /dev/null
+++ b/man/zip_get_archive_flag.mdoc
@@ -0,0 +1,78 @@
+.\" zip_get_archive_flag.mdoc -- get comment for file in zip
+.\" Copyright (C) 2008 Dieter Baron and Thomas Klausner
+.\"
+.\" This file is part of libzip, a library to manipulate ZIP files.
+.\" The authors can be contacted at <libzip@nih.at>
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in
+.\"    the documentation and/or other materials provided with the
+.\"    distribution.
+.\" 3. The names of the authors may not be used to endorse or promote
+.\"    products derived from this software without specific prior
+.\"    written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd June 4, 2008
+.Dt ZIP_GET_ARCHIVE_FLAG 3
+.Os
+.Sh NAME
+.Nm zip_get_archive_flag
+.Nd get status flags for zip
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft int
+.Fn zip_get_archive_flag "struct zip *archive" "int flag" "int flags"
+.Sh DESCRIPTION
+The
+.Fn zip_get_archive_flag
+function returns if the flag
+.Ar flag
+is set for the archive
+.Ar archive .
+The archive flags might have been changed with
+.Fn zip_set_archive_flag ;
+if
+.Ar flags
+is set to
+.Dv ZIP_FL_UNCHANGED ,
+the original unchanged flags are tested.
+.Pp
+Supported flags are:
+.Bl -tag -width XZIPXAFLXTORRENTXXX
+.It Dv ZIP_AFL_TORRENT
+The archive is torrent-zipped.
+.El
+.Sh RETURN VALUES
+.Fn zip_get_archive_flag
+returns 1 if
+.Ar flag
+is set for
+.Ar archive ,
+and 0 if not.
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_set_archive_flag 3
+.Sh AUTHORS
+.An -nosplit
+.An Dieter Baron Aq dillo@giga.or.at
+and
+.An Thomas Klausner Aq tk@giga.or.at
diff --git a/man/zip_set_archive_flag.man b/man/zip_set_archive_flag.man
new file mode 100644
index 0000000..8b5b1cc
--- /dev/null
+++ b/man/zip_set_archive_flag.man
@@ -0,0 +1,73 @@
+.\" zip_set_archive_flag.mdoc \-- set zip archive flag
+.\" Copyright (C) 2008 Dieter Baron and Thomas Klausner
+.\"
+.\" This file is part of libzip, a library to manipulate ZIP archives.
+.\" The authors can be contacted at <libzip@nih.at>
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in
+.\"    the documentation and/or other materials provided with the
+.\"    distribution.
+.\" 3. The names of the authors may not be used to endorse or promote
+.\"    products derived from this software without specific prior
+.\"    written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.TH ZIP_SET_ARCHIVE_FLAG 3 "June 4, 2008" NiH
+.SH "NAME"
+zip_set_archive_flag \- set zip archive flag
+.SH "LIBRARY"
+libzip (-lzip)
+.SH "SYNOPSIS"
+#include <zip.h>
+.PP
+int
+zip_set_archive_flag(struct zip *archive, int flag, int value);
+.SH "DESCRIPTION"
+The
+zip_set_archive_flag
+function sets the flag
+\fBflag\fR
+for the archive
+\fBarchive\fR
+to the value
+\fBvalue.\fR
+.PP
+Supported flags are:
+.RS
+.TP 21
+\fBZIP_AFL_TORRENT\fR
+Create a torrent-zipped archive.
+This restricts the values that can be set from the application side.
+In particular, time stamps are not saved and the order of the files in
+the archive is alphabetical.
+No file comments or extended attributes are allowed and the archive
+comment can not be chosen.
+.RE
+.SH "RETURN VALUES"
+Upon successful completion 0 is returned.
+Currently, there are no error cases.
+.SH "SEE ALSO"
+libzip(3),
+zip_get_archive_flag(3)
+.SH "AUTHORS"
+
+Dieter Baron <dillo@giga.or.at>
+and
+Thomas Klausner <tk@giga.or.at>
diff --git a/man/zip_set_archive_flag.mdoc b/man/zip_set_archive_flag.mdoc
new file mode 100644
index 0000000..92dc403
--- /dev/null
+++ b/man/zip_set_archive_flag.mdoc
@@ -0,0 +1,74 @@
+.\" zip_set_archive_flag.mdoc -- set zip archive flag
+.\" Copyright (C) 2008 Dieter Baron and Thomas Klausner
+.\"
+.\" This file is part of libzip, a library to manipulate ZIP archives.
+.\" The authors can be contacted at <libzip@nih.at>
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in
+.\"    the documentation and/or other materials provided with the
+.\"    distribution.
+.\" 3. The names of the authors may not be used to endorse or promote
+.\"    products derived from this software without specific prior
+.\"    written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
+.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd June 4, 2008
+.Dt ZIP_SET_ARCHIVE_FLAG 3
+.Os
+.Sh NAME
+.Nm zip_set_archive_flag
+.Nd set zip archive flag
+.Sh LIBRARY
+libzip (-lzip)
+.Sh SYNOPSIS
+.In zip.h
+.Ft int
+.Fn zip_set_archive_flag "struct zip *archive" "int flag" "int value"
+.Sh DESCRIPTION
+The
+.Fn zip_set_archive_flag
+function sets the flag
+.Ar flag
+for the archive
+.Ar archive
+to the value
+.Ar value .
+.Pp
+Supported flags are:
+.Bl -tag -width XZIPXAFLXTORRENTXXX
+.It Dv ZIP_AFL_TORRENT
+Create a torrent-zipped archive.
+This restricts the values that can be set from the application side.
+In particular, time stamps are not saved and the order of the files in
+the archive is alphabetical.
+No file comments or extended attributes are allowed and the archive
+comment can not be chosen.
+.El
+.Sh RETURN VALUES
+Upon successful completion 0 is returned.
+Currently, there are no error cases.
+.Sh SEE ALSO
+.Xr libzip 3 ,
+.Xr zip_get_archive_flag 3
+.Sh AUTHORS
+.An -nosplit
+.An Dieter Baron Aq dillo@giga.or.at
+and
+.An Thomas Klausner Aq tk@giga.or.at