2 Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
18 #define _XOPEN_SOURCE 600
20 #include <sys/types.h>
24 #include <atalk/ftw.h>
25 #include <atalk/volinfo.h>
27 #define STRCMP(a,b,c) (strcmp(a,c) b 0)
29 #define DIR_DOT_OR_DOTDOT(a) \
30 ((strcmp(a, ".") == 0) || (strcmp(a, "..") == 0))
32 enum logtype {STD, DBG};
35 _log(STD, __VA_ARGS__)
39 _log(STD, __VA_ARGS__); \
44 struct volinfo volinfo;
48 extern int log_verbose; /* Logging flag */
49 extern void _log(enum logtype lt, char *fmt, ...);
51 extern struct volinfo svolinfo, dvolinfo;
52 extern struct vol svolume, dvolume;
54 extern int ad_ls(int argc, char **argv);
55 extern int ad_cp(int argc, char **argv);
58 extern int newvol(const char *path, afpvol_t *vol);
59 extern void freevol(afpvol_t *vol);
60 extern cnid_t cnid_for_path(const struct volinfo *vi, const struct vol *vol, const char *path);
61 extern char *utompath(const struct volinfo *volinfo, char *upath);
64 const struct FTW *ftw;
68 const struct stat *ftw_statp;
72 char *p_end;/* pointer to NULL at end of path */
73 char *target_end;/* pointer to end of target base */
74 char p_path[PATH_MAX];/* pointer to the start of a path */
78 extern int fflag, iflag, lflag, nflag, pflag, vflag;
79 extern volatile sig_atomic_t info;
81 extern int ftw_copy_file(const struct FTW *, const char *, const struct stat *, int);
82 extern int copy_link(const struct FTW *, const char *, const struct stat *, int);
83 extern int setfile(const struct stat *, int);
84 extern int preserve_dir_acls(const struct stat *, char *, char *);
85 extern int preserve_fd_acls(int, int);