You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
948 B

  1. #include <stdio.h>
  2. #include "data.h"
  3. #include "util.h"
  4. int main(int argc, char *argv[])
  5. {
  6. struct packages_t taskpkgs, pkgs;
  7. struct package_t **taskpackages, *package;
  8. char *pkgname;
  9. int i, j;
  10. #ifdef DEBUG
  11. atexit(memleak_check);
  12. #endif
  13. packages_readlist(&taskpkgs, &pkgs);
  14. taskpackages = packages_enumerate(&taskpkgs);
  15. for (i = 0; i < taskpkgs.count; i++) {
  16. printf("Task package %d: %s\n", i+1, taskpackages[i]->name);
  17. if (taskpackages[i]->dependscount > 0) {
  18. printf("\tDepends:\n");
  19. for (j = 0; j < taskpackages[i]->dependscount; j++)
  20. pkgname = taskpackages[i]->depends[j];
  21. package = packages_find(&pkgs, pkgname);
  22. printf("\t\t%s: %s\n", pkgname, (package ? package->shortdesc : "(no description available)"));
  23. }
  24. printf("\tDescription: %s\n%s\n\n",
  25. taskpackages[i]->shortdesc, taskpackages[i]->longdesc);
  26. /* ... */
  27. }
  28. packages_free(&taskpkgs, &pkgs);
  29. return 0;
  30. }