venus: Tidy up header includes
[openafs.git] / src / venus / twiddle.c
index 95fd737..94d83dc 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
@@ -9,51 +9,34 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
-RCSID
-    ("$Header$");
+#include <roken.h>
 
 #include <rx/xdr.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <errno.h>
-#include <stdio.h>
-#include <netinet/in.h>
-#include <sys/stat.h>
-#include <afs/stds.h>
+#include <afs/com_err.h>
 #include <afs/vice.h>
 #include <afs/venus.h>
-#ifdef AFS_AIX32_ENV
-#include <signal.h>
-#endif
 #undef VIRTUE
 #undef VICE
 #include "afs/prs_fs.h"
 #include <afs/afsint.h>
-#include <afs/auth.h>>
-#include <errno.h
 #include <afs/cellconfig.h>
 #include <afs/cmd.h>
-#include <strings.h>
+#include <afs/com_err.h>
+#include <afs/afs_consts.h>
+#include <afs/sys_prototypes.h>
 
-
-#define        MAXSIZE 2048
 #define MAXINSIZE 1300         /* pioctl complains if data is larger than this */
 #define VMSGSIZE 128           /* size of msg buf in volume hdr */
 
-static char space[MAXSIZE];
-static char tspace[1024];
-static struct ubik_client *uclient;
-
+static void Die(int code, char *filename);
 
-extern struct cmd_syndesc *cmd_CreateSyntax();
 static char pn[] = "fs";
 static int rxInitDone = 0;
 
-static
-Twiddle(as)
-     struct cmd_syndesc *as;
+static int
+Twiddle(struct cmd_syndesc *as, void *arock)
 {
     afs_int32 code;
     struct ViceIoctl blob;
@@ -130,17 +113,16 @@ Twiddle(as)
 
 #include "AFS_component_version_number.c"
 
-main(argc, argv)
-     int argc;
-     char **argv;
+int
+main(int argc, char **argv)
 {
-    register afs_int32 code;
-    register struct cmd_syndesc *ts;
+    afs_int32 code;
+    struct cmd_syndesc *ts;
 
 #ifdef AFS_AIX32_ENV
     /*
-     * The following signal action for AIX is necessary so that in case of a 
-     * crash (i.e. core is generated) we can include the user's data section 
+     * The following signal action for AIX is necessary so that in case of a
+     * crash (i.e. core is generated) we can include the user's data section
      * in the core dump. Unfortunately, by default, only a partial core is
      * generated which, in many cases, isn't too useful.
      */
@@ -154,7 +136,7 @@ main(argc, argv)
     /* try to find volume location information */
 
 
-    ts = cmd_CreateSyntax(NULL, Twiddle, 0, "adjust rx parms");
+    ts = cmd_CreateSyntax(NULL, Twiddle, NULL, "adjust rx parms");
     cmd_AddParm(ts, "-initReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
     cmd_AddParm(ts, "-maxReceiveWindow ", CMD_SINGLE, CMD_OPTIONAL, "16");
     cmd_AddParm(ts, "-initSendWindow ", CMD_SINGLE, CMD_OPTIONAL, "8");
@@ -172,9 +154,8 @@ main(argc, argv)
     exit(code);
 }
 
-Die(code, filename)
-     int code;
-     char *filename;
+static void
+Die(int code, char *filename)
 {                              /*Die */
 
     if (errno == EINVAL) {
@@ -206,6 +187,6 @@ Die(code, filename)
            fprintf(stderr, "%s:'%s'", pn, filename);
        else
            fprintf(stderr, "%s", pn);
-       fprintf(stderr, ": %s\n", error_message(errno));
+       fprintf(stderr, ": %s\n", afs_error_message(errno));
     }
 }                              /*Die */