more-anonymous-pointer-cleanup-20071031
[openafs.git] / src / auth / test / testcellconf.c
index 15a4485..1bc9cae 100644 (file)
@@ -25,7 +25,8 @@ Creation date:
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID("$Header$");
+RCSID
+    ("$Header$");
 
 #include <sys/types.h>
 #include <stddef.h>
@@ -39,25 +40,25 @@ RCSID("$Header$");
 #endif
 #include <afs/cellconfig.h>
 
-PrintOneCell(ainfo, arock, adir)
-struct afsconf_cell *ainfo;
-char *arock;
-struct afsconf_dir *adir; {
+int 
+PrintOneCell(struct afsconf_cell *ainfo, void *arock, struct afsconf_dir *adir)
+{
     register int i;
     long temp;
 
     printf("Cell %s:\n", ainfo->name);
-    for(i=0;i<ainfo->numServers;i++) {
+    for (i = 0; i < ainfo->numServers; i++) {
        memcpy(&temp, &ainfo->hostAddr[i].sin_addr, sizeof(long));
-       printf("    host %s at %x.%x\n", ainfo->hostName[i], temp, ainfo->hostAddr[i].sin_port);
+       printf("    host %s at %x.%x\n", ainfo->hostName[i], temp,
+              ainfo->hostAddr[i].sin_port);
     }
     return 0;
 }
 
 /*Main for testcellconfig*/
 main(argc, argv)
-int argc;
-char *argv[];
+     int argc;
+     char *argv[];
 {
     struct afsconf_dir *theDir;
     char tbuffer[1024];
@@ -67,7 +68,8 @@ char *argv[];
     char *dirName;
 
     if (argc < 2) {
-       printf("usage: testcellconfig <conf-dir-name> [<cell-to-display>]*\n");
+       printf
+           ("usage: testcellconfig <conf-dir-name> [<cell-to-display>]*\n");
        exit(1);
     }
 
@@ -77,7 +79,7 @@ char *argv[];
        printf("could not open configuration files in '%s'\n", dirName);
        exit(1);
     }
-    
+
     /* get the cell */
     code = afsconf_GetLocalCell(theDir, tbuffer, sizeof(tbuffer));
     if (code != 0) {
@@ -85,34 +87,36 @@ char *argv[];
        exit(1);
     }
     printf("Local cell is '%s'\n\n", tbuffer);
-    
+
     if (argc == 2) {
        printf("About to print cell database contents:\n");
        afsconf_CellApply(theDir, PrintOneCell, 0);
        printf("Done.\n\n");
        /* do this junk once */
        printf("start of special test\n");
-       code = afsconf_GetCellInfo(theDir, (char *) 0, "afsprot", &theCell);
-       if (code) printf("failed to find afsprot service (%d)\n", code);
+       code = afsconf_GetCellInfo(theDir, NULL, "afsprot", &theCell);
+       if (code)
+           printf("failed to find afsprot service (%d)\n", code);
        else {
            printf("AFSPROT service:\n");
-           PrintOneCell(&theCell, (char *) (char *) 0, theDir);
+           PrintOneCell(&theCell, NULL, theDir);
        }
        code = afsconf_GetCellInfo(theDir, 0, "bozotheclown", &theCell);
-       if (code == 0) printf("unexpectedly found service 'bozotheclown'\n");
-       code = afsconf_GetCellInfo(theDir, (char *) 0, "telnet", &theCell);
+       if (code == 0)
+           printf("unexpectedly found service 'bozotheclown'\n");
+       code = afsconf_GetCellInfo(theDir, NULL, "telnet", &theCell);
        printf("Here's the telnet service:\n");
-       PrintOneCell(&theCell, (char *) 0, theDir);
+       PrintOneCell(&theCell, NULL, theDir);
        printf("done with special test\n");
-    }
-    else {
+    } else {
        /* now print out specified cell info */
-       for(i = 2; i<argc; i++) {
+       for (i = 2; i < argc; i++) {
            code = afsconf_GetCellInfo(theDir, argv[i], 0, &theCell);
            if (code) {
-               printf("Could not find info for cell '%s', code %d\n", argv[i], code);
-           }
-           else PrintOneCell(&theCell, (char *) 0, theDir);
+               printf("Could not find info for cell '%s', code %d\n",
+                      argv[i], code);
+           } else
+               PrintOneCell(&theCell, NULL, theDir);
        }
     }