cmd: Make the original test suite build
[openafs.git] / src / cmd / test / ctest.c
index 17d4e57..e9220c8 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header$");
+#include <roken.h>
 
-#include "cmd.h"
-#include <stdio.h>
+#include <afs/cmd.h>
 
-static cproc1 (as, arock)
-char *arock;
-struct cmd_syndesc *as; {
+static int
+cproc1(struct cmd_syndesc *as, void *arock)
+{
     printf("in the apple command\n");
     return 0;
 }
 
-static cproc2 (as, arock)
-char *arock;
-struct cmd_syndesc *as; {
-    register struct cmd_item *ti;
+static int
+cproc2(struct cmd_syndesc *as, void *arock)
+{
+    struct cmd_item *ti;
     printf("in the pear command\n");
     printf("number is %s\n", as->parms[0].items->data);
-    if (as->parms[1].items) printf("running unauthenticated\n");
-    for(ti=as->parms[2].items; ti; ti=ti->next) {
+    if (as->parms[1].items)
+       printf("running unauthenticated\n");
+    for (ti = as->parms[2].items; ti; ti = ti->next) {
        printf("spotspos %s\n", ti->data);
     }
     if (as->parms[8].items)
@@ -37,21 +37,21 @@ struct cmd_syndesc *as; {
     return 0;
 }
 
-main(argc, argv)
-int argc;
-char **argv; {
-    register struct cmd_syndesc *ts;
-    
-    ts = cmd_CreateSyntax("apple", cproc1, (char *) 0, "describe apple");
+int
+main(int argc, char **argv)
+{
+    struct cmd_syndesc *ts;
+
+    ts = cmd_CreateSyntax("apple", cproc1, NULL, "describe apple");
     cmd_CreateAlias(ts, "appl");
 
-    ts = cmd_CreateSyntax("pear", cproc2, (char *) 0, "describe pear");
+    ts = cmd_CreateSyntax("pear", cproc2, NULL, "describe pear");
     cmd_AddParm(ts, "-num", CMD_LIST, 0, "number of pears");
     cmd_AddParm(ts, "-noauth", CMD_FLAG, CMD_OPTIONAL, "don't authenticate");
     cmd_AddParm(ts, "-spotpos", CMD_LIST, CMD_OPTIONAL | CMD_EXPANDS, 0);
     cmd_Seek(ts, 8);
     cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
     cmd_CreateAlias(ts, "alias");
-    
+
     return cmd_Dispatch(argc, argv);
 }