X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=bin%2Fad%2Fad.h;h=d97f4b0643df9543e9b333179caf533c72af3a53;hb=84c3a8f52deced7429f9d72276232ee282b3b823;hp=85cdbda38a54d69dae44a40cbfaffad662f3dc67;hpb=ea9e8d043fb0920e216f97e0ee9dc615a86a36d7;p=netatalk.git diff --git a/bin/ad/ad.h b/bin/ad/ad.h index 85cdbda3..d97f4b06 100644 --- a/bin/ad/ad.h +++ b/bin/ad/ad.h @@ -1,5 +1,5 @@ /* - Copyright (c) 2009 Frank Lahm + Copyright (c) 2009,2011 Frank Lahm This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,21 +15,28 @@ #ifndef AD_H #define AD_H -#define _XOPEN_SOURCE 600 +#include #include #include #include +#include #include -#include #include - -#define STRCMP(a,b,c) (strcmp(a,c) b 0) +#include +#include #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(...) \ @@ -42,8 +49,7 @@ enum logtype {STD, DBG}; } while (0) typedef struct { - struct volinfo volinfo; - struct vol volume; + struct vol *vol; char db_stamp[ADEDLEN_PRIVSYN]; } afpvol_t; @@ -52,15 +58,16 @@ 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, - cnid_t *did); -extern char *utompath(const struct volinfo *volinfo, const char *upath); +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 vol *, const char *); extern int convert_dots_encoding(const afpvol_t *svol, const afpvol_t *dvol, char *path, size_t buflen); typedef struct {