-
Notifications
You must be signed in to change notification settings - Fork 72
/
fmq_patch.h
executable file
·88 lines (66 loc) · 2.35 KB
/
fmq_patch.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/* =========================================================================
fmq_patch - work with directory patches
-------------------------------------------------------------------------
Copyright (c) 1991-2012 iMatix Corporation -- http://www.imatix.com
Copyright other contributors as noted in the AUTHORS file.
This file is part of FILEMQ, see http://filemq.org.
This is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option)
any later version.
This software is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABIL-
ITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
=========================================================================
*/
#ifndef __FMQ_PATCH_H_INCLUDED__
#define __FMQ_PATCH_H_INCLUDED__
typedef enum {
patch_create = 1,
patch_delete = 2
} fmq_patch_op_t;
#ifdef __cplusplus
extern "C" {
#endif
// Opaque class structure
typedef struct _fmq_patch_t fmq_patch_t;
// Create new patch
fmq_patch_t *
fmq_patch_new (char *path, fmq_file_t *file, fmq_patch_op_t op, char *alias);
// Destroy a patch
void
fmq_patch_destroy (fmq_patch_t **self_p);
// Create copy of a patch
fmq_patch_t *
fmq_patch_dup (fmq_patch_t *self);
// Return patch file directory path
char *
fmq_patch_path (fmq_patch_t *self);
// Return patch file item
fmq_file_t *
fmq_patch_file (fmq_patch_t *self);
// Return operation
fmq_patch_op_t
fmq_patch_op (fmq_patch_t *self);
// Return patch virtual file name
char *
fmq_patch_virtual (fmq_patch_t *self);
// Set patch virtual file name
void
fmq_patch_virtual_set (fmq_patch_t *self, char *virtual);
// Calculate hash digest for file (create only)
fmq_patch_t *
fmq_patch_digest_set (fmq_patch_t *self);
// Return hash digest for patch file
char *
fmq_patch_digest (fmq_patch_t *self);
// Self test of this class
int
fmq_patch_test (bool verbose);
#ifdef __cplusplus
}
#endif
#endif