Imported Upstream version 1.4.0
[platform/upstream/libzip.git] / man / zip_source_function.mdoc
index d902ca8..6c4683d 100644 (file)
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd November 6, 2017
+.Dd December 18, 2017
 .Dt ZIP_SOURCE_FUNCTION 3
 .Os
 .Sh NAME
-.Nm zip_source_function
+.Nm zip_source_function ,
+.Nm zip_source_function_create
 .Nd create data source from function
 .Sh LIBRARY
 libzip (-lzip)
@@ -112,6 +113,17 @@ and
 .Ss Dv ZIP_SOURCE_BEGIN_WRITE
 Prepare the source for writing.
 Use this to create any temporary file(s).
+.Ss Dv ZIP_SOURCE_BEGIN_WRITE_CLONING
+Prepare the source for writing, keeping the first
+.Ar len
+bytes of the original file.
+Only implement this command if it is more efficient than copying the
+data, and if it does not destructively overwrite the original file
+(you still have to be able to execute
+.Dv ZIP_SOURCE_ROLLBACK_WRITE ) .
+.Pp
+The next write should happen at byte
+.Ar offset .
 .Ss Dv ZIP_SOURCE_CLOSE
 Reading is done.
 .Ss Dv ZIP_SOURCE_COMMIT_WRITE
@@ -251,6 +263,8 @@ If the function is unable to provide the data again, it should
 return \-1.
 .Pp
 .Dv ZIP_SOURCE_BEGIN_WRITE
+or
+.Dv ZIP_SOURCE_BEGIN_WRITE_CLONING
 will be called before
 .Dv ZIP_SOURCE_WRITE ,
 .Dv ZIP_SOURCE_SEEK_WRITE ,
@@ -279,6 +293,8 @@ will be called before
 .Dv ZIP_SOURCE_FREE ,
 and similarly for
 .Dv ZIP_SOURCE_BEGIN_WRITE
+or
+.Dv ZIP_SOURCE_BEGIN_WRITE_CLONING
 and
 .Dv ZIP_SOURCE_COMMIT_WRITE
 or
@@ -307,6 +323,11 @@ Required memory could not be allocated.
 .Xr zip_replace 3 ,
 .Xr zip_source 3 ,
 .Xr zip_stat_init 3
+.Sh HISTORY
+.Fn zip_source_function
+and
+.Fn zip_source_function_create
+were added in libzip 1.0.
 .Sh AUTHORS
 .An -nosplit
 .An Dieter Baron Aq Mt dillo@nih.at