/*****************************************************************************/
/* */
-/* 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>
+/* common */
+#include "print.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 size if verbose */
+ Print (stdout, 1, "%5lu ", O->Size);
+ /* Print the name */
+ puts (O->Name);
+
}
/* Create a new library file and close the old one */
/* Successful end */
exit (EXIT_SUCCESS);
}
-
-
-