]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/enumerate.c
don't store in struct volume pointers to charset function table, we only need texten...
[netatalk.git] / etc / afpd / enumerate.c
index 463e59aad34dfb788a5e06109f25fd0355db972e..4608ecb4e3fb03edae1ecdcd366d94b742a69269 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: enumerate.c,v 1.42 2005-04-28 20:49:41 bfernhomberg Exp $
+ * $Id: enumerate.c,v 1.47 2009-10-15 10:43:13 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-
-#include <atalk/logger.h>
 #include <sys/file.h>
 #include <sys/param.h>
 
+#include <atalk/logger.h>
 #include <atalk/afp.h>
 #include <atalk/adouble.h>
+#include <atalk/vfs.h>
 #include <atalk/cnid.h>
 #include "desktop.h"
 #include "directory.h"
@@ -97,16 +97,16 @@ static int enumerate_loop(struct dirent *de, char *mname _U_, void *data)
 */
 char *check_dirent(const struct vol *vol, char *name)
 {
-
     if (!strcmp(name, "..") || !strcmp(name, "."))
         return NULL;
 
-    if (!vol->vfs->validupath(vol, name))
+    if (!vol->vfs->vfs_validupath(vol, name))
         return NULL;
 
     /* check for vetoed filenames */
     if (veto_file(vol->v_veto, name))
         return NULL;
+
 #if 0
     char *m_name = NULL;
 
@@ -155,16 +155,16 @@ for_each_dirent(const struct vol *vol, char *name, dir_loop fn, void *data)
 #define REPLY_PARAM_MAXLEN (4 + 104 + 1 + MACFILELEN + 4 + 2 + 255 + 1)
 
 /* ----------------------------- */
-static int enumerate(obj, ibuf, ibuflen, rbuf, rbuflen, ext )
-AFPObj       *obj _U_;
-char        *ibuf, *rbuf;
-unsigned int ibuflen _U_, *rbuflen;
-int     ext;
+static int enumerate(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, 
+    char *rbuf, 
+    size_t *rbuflen, 
+    int ext)
 {
     static struct savedir      sd = { 0, 0, 0, NULL, NULL, 0 };
     struct vol                 *vol;
     struct dir                 *dir;
-    int                                did, ret, esz, len, first = 1;
+    int                                did, ret, len, first = 1;
+    size_t                     esz;
     char                        *data, *start;
     u_int16_t                  vid, fbitmap, dbitmap, reqcnt, actcnt = 0;
     u_int16_t                  temp16;
@@ -367,7 +367,7 @@ int     ext;
             if ( dbitmap == 0 ) {
                 continue;
             }
-            dir = dirsearch_byname(curdir, s_path.u_name);
+            dir = dirsearch_byname(vol, curdir, s_path.u_name);
             if (!dir && NULL == (dir = adddir( vol, curdir, &s_path) ) ) {
                     return AFPERR_MISC;
                 }
@@ -451,28 +451,25 @@ int     ext;
 }
 
 /* ----------------------------- */
-int afp_enumerate(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj       *obj;
-char        *ibuf, *rbuf;
-unsigned int ibuflen, *rbuflen;
+int afp_enumerate(AFPObj *obj, char *ibuf, size_t ibuflen, 
+    char *rbuf, 
+    size_t *rbuflen)
 {
     return enumerate(obj, ibuf,ibuflen ,rbuf,rbuflen , 0);
 }
 
 /* ----------------------------- */
-int afp_enumerate_ext(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj       *obj;
-char        *ibuf, *rbuf;
-unsigned int ibuflen, *rbuflen;
+int afp_enumerate_ext(AFPObj *obj, char *ibuf, size_t ibuflen, 
+    char *rbuf, 
+    size_t *rbuflen)
 {
     return enumerate(obj, ibuf,ibuflen ,rbuf,rbuflen , 1);
 }
 
 /* ----------------------------- */
-int afp_enumerate_ext2(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj       *obj;
-char        *ibuf, *rbuf;
-unsigned int ibuflen, *rbuflen;
+int afp_enumerate_ext2(AFPObj *obj, char *ibuf, size_t ibuflen, 
+    char *rbuf, 
+    size_t *rbuflen)
 {
     return enumerate(obj, ibuf,ibuflen ,rbuf,rbuflen , 2);
 }