uss: Tidy up header includes
[openafs.git] / src / uss / uss_fs.c
index 3b87470..77cdb2b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
+#include <roken.h>
 
-#include "uss_fs.h"            /*Interface to this module */
-#include <sys/types.h>
-#include <errno.h>
-#include <sys/socket.h>
 #ifdef AFS_SUN5_ENV
 #include <sys/ioccom.h>
 #endif
-#include <netinet/in.h>
-
-#include <string.h>
 
 #include <afs/venus.h>
-#include "uss_common.h"
+#include <rx/rx.h>
+#include <afs/sys_prototypes.h>
 
+#include "uss_common.h"
+#include "uss_fs.h"            /*Interface to this module */
 
 /*
  * ---------------------- Private definitions ---------------------
@@ -70,13 +65,9 @@ static struct ViceIoctl *blobP = &blob;      /*Ptr to above */
  *------------------------------------------------------------------------*/
 
 static int
-InAFS(a_path)
-     register char *a_path;
-
+InAFS(char *a_path)
 {                              /*InAFS */
-
-    static char rn[] = "uss_fs:InAFS";
-    register afs_int32 code;
+    afs_int32 code;
 
     blob.in = NULL;
     blob.in_size = 0;
@@ -104,7 +95,7 @@ InAFS(a_path)
  *     char *a_path         : Pathname to ancestorize.
  *     char *a_parentBuff   : Ptr to parent buffer to use.
  *     char **a_componentPP : Ptr to the final component.
- *     
+ *
  *
  * Returns:
  *     Ptr to the buffer containing the parent dir name.
@@ -117,14 +108,8 @@ InAFS(a_path)
  *------------------------------------------------------------------------*/
 
 static char *
-ParentAndComponent(a_path, a_parentBuff, a_componentPP)
-     char *a_path;
-     char *a_parentBuff;
-     char **a_componentPP;
-
+ParentAndComponent(char *a_path, char *a_parentBuff, char **a_componentPP)
 {                              /*ParentAndComponent */
-
-    static char rn[] = "uss_fs:Parent";
     char *rightSlashP;
 
     /*
@@ -175,16 +160,12 @@ ParentAndComponent(a_path, a_parentBuff, a_componentPP)
  *------------------------------------------------------------------------*/
 
 static int
-CarefulPioctl(a_path, a_opcode, a_blobP, a_sl)
-     char *a_path;
-     int a_opcode;
-     struct ViceIoctl *a_blobP;
-     int a_sl;
-
+CarefulPioctl(char *a_path, int a_opcode, struct ViceIoctl *a_blobP, int a_sl)
 {                              /*CarefulPioctl */
-
+#ifdef USS_FS_DB
     static char rn[] = "uss_fs:CarefulPioctl";
-    register afs_int32 code;
+#endif
+    afs_int32 code;
 
     /*
      * Call the pioctl() the first time, return if things worked
@@ -226,15 +207,12 @@ CarefulPioctl(a_path, a_opcode, a_blobP, a_sl)
  *------------------------------------------------------------------------*/
 
 afs_int32
-uss_fs_GetACL(a_dirPath, a_aclBuff, a_aclBuffBytes)
-     char *a_dirPath;
-     char *a_aclBuff;
-     afs_int32 a_aclBuffBytes;
-
+uss_fs_GetACL(char *a_dirPath, char *a_aclBuff, afs_int32 a_aclBuffBytes)
 {                              /*uss_fs_GetACL */
-
+#ifdef USS_FS_DB
     static char rn[] = "uss_fs_GetACL";        /*Routine name */
-    register afs_int32 code;   /*pioctl() result */
+#endif
+    afs_int32 code;    /*pioctl() result */
 
     blob.in = NULL;
     blob.in_size = 0;
@@ -269,15 +247,12 @@ uss_fs_GetACL(a_dirPath, a_aclBuff, a_aclBuffBytes)
  *------------------------------------------------------------------------*/
 
 afs_int32
-uss_fs_SetACL(a_dirPath, a_aclBuff, a_aclBuffBytes)
-     char *a_dirPath;
-     char *a_aclBuff;
-     afs_int32 a_aclBuffBytes;
-
+uss_fs_SetACL(char *a_dirPath, char *a_aclBuff, afs_int32 a_aclBuffBytes)
 {                              /*uss_fs_SetACL */
-
+#ifdef USS_FS_DB
     static char rn[] = "uss_fs_SetACL";        /*Routine name */
-    register afs_int32 code;   /*pioctl() result */
+#endif
+    afs_int32 code;    /*pioctl() result */
 
     blob.in = a_aclBuff;
     blob.in_size = a_aclBuffBytes;
@@ -313,15 +288,13 @@ uss_fs_SetACL(a_dirPath, a_aclBuff, a_aclBuffBytes)
  *------------------------------------------------------------------------*/
 
 afs_int32
-uss_fs_GetVolStat(a_mountpoint, a_volStatBuff, a_volStatBuffBytes)
-     char *a_mountpoint;
-     char *a_volStatBuff;
-     afs_int32 a_volStatBuffBytes;
-
+uss_fs_GetVolStat(char *a_mountpoint, char *a_volStatBuff,
+                 afs_int32 a_volStatBuffBytes)
 {                              /*uss_fs_GetVolStat */
-
+#ifdef USS_FS_DB
     static char rn[] = "uss_fs_GetVolStat";    /*Routine name */
-    register afs_int32 code;   /*pioctl() result */
+#endif
+    afs_int32 code;    /*pioctl() result */
 
     blob.in = NULL;
     blob.in_size = 0;
@@ -356,15 +329,13 @@ uss_fs_GetVolStat(a_mountpoint, a_volStatBuff, a_volStatBuffBytes)
  *------------------------------------------------------------------------*/
 
 afs_int32
-uss_fs_SetVolStat(a_mountpoint, a_volStatBuff, a_volStatBuffBytes)
-     char *a_mountpoint;
-     char *a_volStatBuff;
-     afs_int32 a_volStatBuffBytes;
-
+uss_fs_SetVolStat(char *a_mountpoint, char *a_volStatBuff,
+                 afs_int32 a_volStatBuffBytes)
 {                              /*uss_fs_SetVolStat */
-
+#ifdef USS_FS_DB
     static char rn[] = "uss_fs_SetVolStat";    /*Routine name */
-    register afs_int32 code;   /*pioctl() result */
+#endif
+    afs_int32 code;    /*pioctl() result */
 
     blob.in = a_volStatBuff;
     blob.in_size = a_volStatBuffBytes;
@@ -399,11 +370,12 @@ uss_fs_SetVolStat(a_mountpoint, a_volStatBuff, a_volStatBuffBytes)
  *------------------------------------------------------------------------*/
 
 afs_int32
-uss_fs_CkBackups()
+uss_fs_CkBackups(void)
 {                              /*uss_fs_CkBackups */
-
+#ifdef USS_FS_DB
     static char rn[] = "uss_fs_CkBackups";     /*Routine name */
-    register afs_int32 code;   /*pioctl() result */
+#endif
+    afs_int32 code;    /*pioctl() result */
 
     blob.in = NULL;
     blob.in_size = 0;
@@ -440,16 +412,12 @@ uss_fs_CkBackups()
  *------------------------------------------------------------------------*/
 
 afs_int32
-uss_fs_MkMountPoint(a_volname, a_cellname, a_rw, a_mountpoint)
-     char *a_volname;
-     char *a_cellname;
-     afs_int32 a_rw;
-     char *a_mountpoint;
-
+uss_fs_MkMountPoint(char *a_volname, char *a_cellname, afs_int32 a_rw,
+                   char *a_mountpoint)
 {                              /*uss_fs_MkMountPoint */
     extern int local_Cell;
     static char rn[] = "uss_fs_MkMountPoint";  /*Routine name */
-    register afs_int32 code;   /*pioctl() result */
+    afs_int32 code;    /*pioctl() result */
     char *tp;                  /*Temporary */
 
 #ifdef USS_FS_DB
@@ -504,13 +472,10 @@ uss_fs_MkMountPoint(a_volname, a_cellname, a_rw, a_mountpoint)
  *------------------------------------------------------------------------*/
 
 afs_int32
-uss_fs_RmMountPoint(a_mountpoint)
-     char *a_mountpoint;
-
+uss_fs_RmMountPoint(char *a_mountpoint)
 {                              /*uss_fs_RmMountPoint */
-
     static char rn[] = "uss_fs_RmMountPoint";  /*Routine name */
-    register afs_int32 code;   /*pioctl() result */
+    afs_int32 code;    /*pioctl() result */
     char *parentDirP;          /*Ptr to parent */
     char *componentP;          /*Ptr to last component */
 
@@ -577,14 +542,14 @@ struct tokenInfo {
 };
 
 /*
- * Build a list of tokens, delete the bad ones (the ones to remove from the 
+ * Build a list of tokens, delete the bad ones (the ones to remove from the
  * permissions list,) destroy all tokens, and then re-register the good ones.
  * Ugly, but it works.
  */
-uss_fs_UnlogToken(celln)
-     char *celln;
+int
+uss_fs_UnlogToken(char *celln)
 {
-    unsigned count = 0, index, index2;
+    int count = 0, index, index2;
     afs_int32 code = 0, cnt = 0;
     struct ktc_principal serviceName;
     struct tokenInfo *tokenInfoP, *tp;
@@ -610,7 +575,7 @@ uss_fs_UnlogToken(celln)
            }
        }
     }
-    if (code = ktc_ForgetAllTokens()) {
+    if ((code = ktc_ForgetAllTokens())) {
        printf("uss_fs_UnlogToken: could not discard tickets, code %d\n",
               code);
        exit(1);