2 Copyright (c) 2009,2011 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 #include <atalk/standards.h>
20 #include <sys/types.h>
23 #include <arpa/inet.h>
25 #include <atalk/ftw.h>
26 #include <atalk/volinfo.h>
27 #include <atalk/cnid.h>
28 #include <atalk/compat.h>
30 #define DIR_DOT_OR_DOTDOT(a) \
31 ((strcmp(a, ".") == 0) || (strcmp(a, "..") == 0))
33 #ifndef TIMESPEC_TO_TIMEVAL
34 #define TIMESPEC_TO_TIMEVAL(tv, ts) { \
35 (tv)->tv_sec = (ts)->tv_sec; \
36 (tv)->tv_usec = (ts)->tv_nsec / 1000; \
40 enum logtype {STD, DBG};
43 _log(STD, __VA_ARGS__)
47 _log(STD, __VA_ARGS__); \
52 struct volinfo volinfo;
54 char db_stamp[ADEDLEN_PRIVSYN];
57 extern int log_verbose; /* Logging flag */
58 extern void _log(enum logtype lt, char *fmt, ...);
60 extern int ad_ls(int argc, char **argv);
61 extern int ad_cp(int argc, char **argv);
62 extern int ad_rm(int argc, char **argv);
63 extern int ad_mv(int argc, char **argv);
64 extern int ad_find(int argc, char **argv);
67 extern int openvol(const char *path, afpvol_t *vol);
68 extern void closevol(afpvol_t *vol);
69 extern cnid_t cnid_for_path(const afpvol_t *vol, const char *path, cnid_t *did);
70 extern cnid_t cnid_for_paths_parent(const afpvol_t *vol, const char *path, cnid_t *did);
71 extern char *utompath(const struct volinfo *volinfo, const char *upath);
72 extern int convert_dots_encoding(const afpvol_t *svol, const afpvol_t *dvol, char *path, size_t buflen);
75 char *p_end;/* pointer to NULL at end of path */
76 char *target_end;/* pointer to end of target base */
77 char p_path[MAXPATHLEN + 2];/* pointer to the start of a path */
81 extern int fflag, iflag, lflag, nflag, pflag, vflag;