sh(1): Raise WARNS to 6 and fix warnings.
[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 <string.h>
18 #include <errno.h>
19 #include <unistd.h>
20 #include <utime.h>
21 #include <dirent.h>
22 #include <signal.h>
23 #include <pwd.h>
24 #include <assert.h>
25 #ifndef NOMD5
26 #include <md5.h>
27 #endif
28 #if USE_PTHREADS
29 #include <pthread.h>
30 #endif
31
32 void logstd(const char *ctl, ...);
33 void logerr(const char *ctl, ...);
34 char *mprintf(const char *ctl, ...);
35 void fatal(const char *ctl, ...);
36 char *fextract(FILE *fi, int n, int *pc, int skip);
37
38 int fsmid_check(int64_t fsmid, const char *dpath);
39 void fsmid_flush(void);
40 #ifndef NOMD5
41 int md5_check(const char *spath, const char *dpath);
42 void md5_flush(void);
43 #endif
44
45 extern const char *MD5CacheFile;
46 extern const char *FSMIDCacheFile;
47
48 extern int SummaryOpt;
49 extern int CompressOpt;
50 extern int CurParallel;
51 extern int RunningAsUser;
52 extern int RunningAsRoot;
53
54 extern int64_t CountSourceBytes;
55 extern int64_t CountSourceItems;
56 extern int64_t CountCopiedItems;
57 extern int64_t CountSourceReadBytes;
58 extern int64_t CountTargetReadBytes;
59 extern int64_t CountWriteBytes;
60 extern int64_t CountRemovedItems;
61
62 #if USE_PTHREADS
63 extern pthread_mutex_t MasterMutex;
64 #endif
65
66 #ifdef DEBUG_MALLOC
67 void *debug_malloc(size_t bytes, const char *file, int line);
68 void debug_free(void *ptr);
69
70 #define malloc(bytes)   debug_malloc(bytes, __FILE__, __LINE__)
71 #define free(ptr)       debug_free(ptr)
72 #endif