X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=bin%2Fad%2Fad_find.c;h=093414a1d5e104f5e224c3697dac1e7ef01a9ce8;hb=f254fd618b53e97cc5382b23709d4f3de1e70b41;hp=8501500c7c7ff9acb229a3a005a0279db55442d3;hpb=954f1435c53be3c861e662d9a6699227c612de57;p=netatalk.git diff --git a/bin/ad/ad_find.c b/bin/ad/ad_find.c index 8501500c..093414a1 100644 --- a/bin/ad/ad_find.c +++ b/bin/ad/ad_find.c @@ -27,8 +27,7 @@ #include #include -#include -#include +#include #include #include #include @@ -83,7 +82,7 @@ static void usage_find(void) ); } -int ad_find(int argc, char **argv) +int ad_find(int argc, char **argv, AFPObj *obj) { int c, ret; afpvol_t vol; @@ -112,14 +111,14 @@ int ad_find(int argc, char **argv) set_signal(); cnid_init(); - if (openvol(srchvol, &vol) != 0) + if (openvol(obj, srchvol, &vol) != 0) ERROR("Cant open volume \"%s\"", srchvol); uint16_t flags = CONV_TOLOWER; char namebuf[MAXPATHLEN + 1]; - if (convert_charset(vol.volinfo.v_volcharset, - vol.volinfo.v_volcharset, - vol.volinfo.v_maccharset, + if (convert_charset(vol.vol->v_volcharset, + vol.vol->v_volcharset, + vol.vol->v_maccharset, argv[optind], strlen(argv[optind]), namebuf, @@ -130,7 +129,7 @@ int ad_find(int argc, char **argv) int count; char resbuf[DBD_MAX_SRCH_RSLTS * sizeof(cnid_t)]; - if ((count = cnid_find(vol.volume.v_cdb, + if ((count = cnid_find(vol.vol->v_cdb, namebuf, strlen(namebuf), resbuf, @@ -146,7 +145,7 @@ int ad_find(int argc, char **argv) bufp += sizeof(cnid_t); bstring path = NULL; - bstring volpath = bfromcstr(vol.volinfo.v_path); + bstring volpath = bfromcstr(vol.vol->v_path); BSTRING_STRIP_SLASH(volpath); char buffer[12 + MAXPATHLEN + 1]; int buflen = 12 + MAXPATHLEN + 1; @@ -155,7 +154,7 @@ int ad_find(int argc, char **argv) struct bstrList *pathlist = bstrListCreateMin(32); while (did != DIRDID_ROOT) { - if ((name = cnid_resolve(vol.volume.v_cdb, &did, buffer, buflen)) == NULL) + if ((name = cnid_resolve(vol.vol->v_cdb, &did, buffer, buflen)) == NULL) goto next; bstrListPush(pathlist, bfromcstr(name)); }