X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Far65%2Flist.c;h=6562998605e616b91c7e832357334613ddc1416e;hb=2f486b620144b0a87a1b4a38dfd84b8097ee6592;hp=c54f65efe66dcaf303ca79d68bcb344a5d72e7a2;hpb=53dd513176425872128ef26031d00952ef7a0628;p=cc65 diff --git a/src/ar65/list.c b/src/ar65/list.c index c54f65efe..656299860 100644 --- a/src/ar65/list.c +++ b/src/ar65/list.c @@ -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 */ @@ -36,15 +36,16 @@ #include #include +/* ar65 */ #include "error.h" -#include "objdata.h" #include "library.h" #include "list.h" +#include "objdata.h" /*****************************************************************************/ -/* Code */ +/* Code */ /*****************************************************************************/ @@ -52,24 +53,29 @@ 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); } - - -