Ejemplo n.º 1
0
int print_list(const List *ls, const char *label) {
  int stat;
  ListIter li;
  const int32 *pelem;
  if ((stat=ListIter_init(&li, ls)) != OK) return ERROR(stat);
  NL_printf("%s(length=%2d):", label, ls->length(ls));
  while ((pelem=li.get(&li)) != NULL) {
    NL_printf(" %d", (int)(*pelem));
  }
  NL_printf("\n");
  ListIter_done(&li);
  return OK;
}