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>
26 #include <atalk/cnid.h>
28 #define STRCMP(a,b,c) (strcmp(a,c) b 0)
30 #define DIR_DOT_OR_DOTDOT(a) \
31 ((strcmp(a, ".") == 0) || (strcmp(a, "..") == 0))
33 enum logtype {STD, DBG};
36 _log(STD, __VA_ARGS__)
40 _log(STD, __VA_ARGS__); \
45 struct volinfo volinfo;
47 char db_stamp[ADEDLEN_PRIVSYN];
50 extern int log_verbose; /* Logging flag */
51 extern void _log(enum logtype lt, char *fmt, ...);
53 extern int ad_ls(int argc, char **argv);
54 extern int ad_cp(int argc, char **argv);
57 extern int openvol(const char *path, afpvol_t *vol);
58 extern void closevol(afpvol_t *vol);
59 extern cnid_t cnid_for_path(const struct volinfo *vi, const struct vol *vol, const char *path);
60 extern char *utompath(const struct volinfo *volinfo, char *upath);
63 const struct FTW *ftw;
67 const struct stat *ftw_statp;
71 char *p_end;/* pointer to NULL at end of path */
72 char *target_end;/* pointer to end of target base */
73 char p_path[PATH_MAX];/* pointer to the start of a path */
77 extern int fflag, iflag, lflag, nflag, pflag, vflag;