zdir_patch(3)
CZMQ Manual - CZMQ/2.2.1
Name
zdir_patch - work with directory patches
Synopsis
// Create new patch
CZMQ_EXPORT zdir_patch_t *
zdir_patch_new (const char *path, zfile_t *file,
zdir_patch_op_t op, const char *alias);
// Destroy a patch
CZMQ_EXPORT void
zdir_patch_destroy (zdir_patch_t **self_p);
// Create copy of a patch
CZMQ_EXPORT zdir_patch_t *
zdir_patch_dup (zdir_patch_t *self);
// Return patch file directory path
CZMQ_EXPORT char *
zdir_patch_path (zdir_patch_t *self);
// Return patch file item
CZMQ_EXPORT zfile_t *
zdir_patch_file (zdir_patch_t *self);
// Return operation
CZMQ_EXPORT zdir_patch_op_t
zdir_patch_op (zdir_patch_t *self);
// Return patch virtual file path
CZMQ_EXPORT char *
zdir_patch_vpath (zdir_patch_t *self);
// Calculate hash digest for file (create only)
CZMQ_EXPORT void
zdir_patch_digest_set (zdir_patch_t *self);
// Return hash digest for patch file
CZMQ_EXPORT char *
zdir_patch_digest (zdir_patch_t *self);
// Self test of this class
CZMQ_EXPORT int
zdir_patch_test (bool verbose);
Description
The zdir_patch class works with one patch, which says "create this file" or "delete this file" (referring to a zfile item each time).
Example
From zdir_patch_test method
zfile_t *file = zfile_new (".", "bilbo");
zdir_patch_t *patch = zdir_patch_new (".", file, patch_create, "/");
zfile_destroy (&file);
file = zdir_patch_file (patch);
assert (streq (zfile_filename (file, "."), "bilbo"));
assert (streq (zdir_patch_vpath (patch), "/bilbo")); zdir_patch_destroy (&patch);
See also
Authors
The CZMQ manual was written by Pieter Hintjens<moc.xitami|hp#moc.xitami|hp>.
Resources
Main web site: http://czmq.zeromq.org/
Report bugs to the ØMQ development mailing list: <gro.qmorez.stsil|ved-qmorez#gro.qmorez.stsil|ved-qmorez>
Copyright
Copyright (c) 1991-2014 iMatix and Contributors. License LGPLv3+: GNU LGPL 3 or later <http://gnu.org/licenses/lgpl.html>. This is free software: you are free to change it and redistribute it. There is NO WARRANTY, to the extent permitted by law. For details see the files COPYING and COPYING.LESSER included with the CZMQ distribution.