]> arthur.barton.de Git - netatalk.git/commitdiff
Implement path_isadir() as macro. Please do not put function implementations
authorsrittau <srittau>
Fri, 6 Jun 2003 20:36:59 +0000 (20:36 +0000)
committersrittau <srittau>
Fri, 6 Jun 2003 20:36:59 +0000 (20:36 +0000)
into header files.

etc/afpd/directory.c
etc/afpd/directory.h

index e52c44537bc1543498a277a5df883995dbfde4aa..eb16cdd25091de3d5ff5f2ec6989ff049e292524 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.75 2003-06-05 09:17:11 didg Exp $
+ * $Id: directory.c,v 1.76 2003-06-06 20:36:59 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -122,18 +122,6 @@ u_int32_t  did;
 }
 
 /* ------------------- */
-#ifdef ATACC
-int path_isadir(struct path *o_path)
-{
-    return o_path->dir != NULL;
-#if 0
-    return o_path->m_name == '\0' || /* we are in a it */
-           !o_path->st_valid ||      /* in cache but we can't chdir in it */ 
-           (!o_path->st_errno && S_ISDIR(o_path->st.st_mode)); /* not in cache an can't chdir */
-#endif
-}
-#endif
-
 int get_afp_errno(const int param)
 {
     if (afp_errno != AFPERR_DID1)
index 4cb1891b094a38d94103d17b5b55428a251eafc4..d23768289cd034308ef59760275af4e87c6658d9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.h,v 1.16 2003-06-05 09:17:11 didg Exp $
+ * $Id: directory.h,v 1.17 2003-06-06 20:36:59 srittau Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -69,20 +69,15 @@ struct path {
     struct stat st;
 };
 
-#ifndef ATACC
-static __inline__ int path_isadir(struct path *o_path)
-{
-    return o_path->dir != NULL;
+#define path_isadir(o_path) \
+       ((o_path)->dir != NULL)
 #if 0
-    return o_path->m_name == '\0' || /* we are in a it */
-           !o_path->st_valid ||      /* in cache but we can't chdir in it */ 
-           (!o_path->st_errno && S_ISDIR(o_path->st.st_mode)); /* not in cache an can't chdir */
+       ((o_path)->m_name == '\0' || /* we are in a it */ \
+        !(o_path)->st_valid ||      /* in cache but we can't chdir in it */ \
+        (!(o_path)->st_errno && S_ISDIR((o_path)->st.st_mode)) /* not in cache an can't chdir */ \
+       )
 #endif
-}
-#else
-extern int path_isadir(struct path *o_path);
-#endif
-
+          
 /* child addition/removal macros */
 #define dirchildadd(a, b) do { \
        if (!(a)->d_child) \