]> arthur.barton.de Git - netatalk.git/blobdiff - bin/ad/ad.h
Merge master
[netatalk.git] / bin / ad / ad.h
index cb574d600ecd25f4067d88e0019ebe15e2bf66d9..360ac17369a0a4b8f7eadd79baa6850508038837 100644 (file)
 #ifndef AD_H
 #define AD_H
 
-#define _XOPEN_SOURCE 600
+#if !defined(__FreeBSD__)
+# define _XOPEN_SOURCE 600
+#endif
 
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <signal.h>
+#include <arpa/inet.h>
 
 #include <atalk/ftw.h>
 #include <atalk/volinfo.h>
 #include <atalk/cnid.h>
-
-#define STRCMP(a,b,c) (strcmp(a,c) b 0)
+#include <atalk/compat.h>
 
 #define DIR_DOT_OR_DOTDOT(a) \
         ((strcmp(a, ".") == 0) || (strcmp(a, "..") == 0))
 
+#ifndef TIMESPEC_TO_TIMEVAL
+#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+    (tv)->tv_sec = (ts)->tv_sec; \
+    (tv)->tv_usec = (ts)->tv_nsec / 1000; \
+    }
+#endif
+
 enum logtype {STD, DBG};
 
 #define SLOG(...)                             \
@@ -52,25 +61,22 @@ extern void _log(enum logtype lt, char *fmt, ...);
 
 extern int ad_ls(int argc, char **argv);
 extern int ad_cp(int argc, char **argv);
+extern int ad_rm(int argc, char **argv);
+extern int ad_mv(int argc, char **argv);
+extern int ad_find(int argc, char **argv);
 
 /* ad_util.c */
 extern int openvol(const char *path, afpvol_t *vol);
 extern void closevol(afpvol_t *vol);
-extern cnid_t cnid_for_path(const struct volinfo *vi, const struct vol *vol, const char *path);
-extern char *utompath(const struct volinfo *volinfo, char *upath);
-
-struct FTWELEM {
-    const struct FTW  *ftw;
-    const char        *ftw_path;
-    int               ftw_base_off;
-    int               ftw_tflag;
-    const struct stat *ftw_statp;
-};
+extern cnid_t cnid_for_path(const afpvol_t *vol, const char *path, cnid_t *did);
+extern cnid_t cnid_for_paths_parent(const afpvol_t *vol, const char *path, cnid_t *did);
+extern char *utompath(const struct volinfo *volinfo, const char *upath);
+extern int convert_dots_encoding(const afpvol_t *svol, const afpvol_t *dvol, char *path, size_t buflen);
 
 typedef struct {
     char *p_end;/* pointer to NULL at end of path */
     char *target_end;/* pointer to end of target base */
-    char p_path[PATH_MAX];/* pointer to the start of a path */
+    char p_path[MAXPATHLEN + 2];/* pointer to the start of a path */
 } PATH_T;
 
 extern PATH_T to;