]> git.sur5r.net Git - cc65/blobdiff - src/ar65/list.c
Merge pull request #307 from groessler/something_to_pull2
[cc65] / src / ar65 / list.c
index c54f65efe66dcaf303ca79d68bcb344a5d72e7a2..6562998605e616b91c7e832357334613ddc1416e 100644 (file)
@@ -1,15 +1,15 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                 list.c                                   */
+/*                                  list.c                                   */
 /*                                                                           */
-/*                  Module listing for the ar65 archiver                    */
+/*                   Module listing for the ar65 archiver                    */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 #include <stdio.h>
 #include <stdlib.h>
 
+/* ar65 */
 #include "error.h"
-#include "objdata.h"
 #include "library.h"
 #include "list.h"
+#include "objdata.h"
 
 
 
 /*****************************************************************************/
-/*                                          Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
 void ListObjFiles (int argc, char* argv [])
 /* List modules in a library */
 {
-    ObjData* O;
+    unsigned I;
+    const ObjData* O;
 
     /* Check the argument count */
     if (argc <= 0) {
-       Error ("No library name given");
+        Error ("No library name given");
     }
     if (argc > 2) {
-       Error ("Too many arguments");
+        Error ("Too many arguments");
     }
 
     /* Open the library, read the index */
     LibOpen (argv [0], 1, 0);
 
     /* List the modules */
-    O = ObjRoot;
-    while (O) {
-       printf ("%s\n", O->Name);
-       O = O->Next;
+    for (I = 0; I < CollCount (&ObjPool); ++I) {
+
+        /* Get the entry */
+        O = CollConstAt (&ObjPool, I);
+
+        /* Print the name */
+        printf ("%s\n", O->Name);
+
     }
 
     /* Create a new library file and close the old one */
@@ -78,6 +84,3 @@ void ListObjFiles (int argc, char* argv [])
     /* Successful end */
     exit (EXIT_SUCCESS);
 }
-
-
-