Merge branch 'vendor/OPENSSH'
[dragonfly.git] / bin / cpdup / cpdup.h
1 /*
2  * CPDUP.H
3  *
4  * $DragonFly: src/bin/cpdup/cpdup.h,v 1.9 2008/04/14 05:40:51 dillon Exp $
5  */
6
7 #include <sys/param.h>
8 #include <sys/time.h>
9 #include <sys/stat.h>
10 #include <sys/file.h>
11
12 #include <fcntl.h>
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <stdarg.h>
16 #include <stddef.h>
17 #include <stdint.h>
18 #include <string.h>
19 #include <errno.h>
20 #include <unistd.h>
21 #include <utime.h>
22 #include <dirent.h>
23 #include <signal.h>
24 #include <pwd.h>
25 #include <fnmatch.h>
26 #include <assert.h>
27 #ifndef NOMD5
28 #include <md5.h>
29 #endif
30
31 void logstd(const char *ctl, ...);
32 void logerr(const char *ctl, ...);
33 char *mprintf(const char *ctl, ...);
34 void fatal(const char *ctl, ...);
35 char *fextract(FILE *fi, int n, int *pc, int skip);
36
37 int fsmid_check(int64_t fsmid, const char *dpath);
38 void fsmid_flush(void);
39 #ifndef NOMD5
40 int md5_check(const char *spath, const char *dpath);
41 void md5_flush(void);
42 #endif
43
44 extern const char *MD5CacheFile;
45 extern const char *FSMIDCacheFile;
46
47 extern int QuietOpt;
48 extern int SummaryOpt;
49 extern int CompressOpt;
50 extern int DstRootPrivs;
51
52 extern int ssh_argc;
53 extern const char *ssh_argv[];
54
55 extern int64_t CountSourceBytes;
56 extern int64_t CountSourceItems;
57 extern int64_t CountCopiedItems;
58 extern int64_t CountSourceReadBytes;
59 extern int64_t CountTargetReadBytes;
60 extern int64_t CountWriteBytes;
61 extern int64_t CountRemovedItems;
62
63 #ifdef DEBUG_MALLOC
64 void *debug_malloc(size_t bytes, const char *file, int line);
65 void debug_free(void *ptr);
66
67 #define malloc(bytes)   debug_malloc(bytes, __FILE__, __LINE__)
68 #define free(ptr)       debug_free(ptr)
69 #endif