void queue_foreach (Queue *queue, UserFunc(func), void *user_data) { /* Precondition */ assert(queue != NULL); slist_foreach(queue->head, func, user_data); /* Postcondicion */ assert((int) queue->length == slist_length(queue->head)); }
/** * Dump whole header on specified file, followed by trailer string * (if not NULL) and a final "\n". */ void header_dump(FILE *out, const header_t *o, const char *trailer) { header_check(o); if (!log_file_printable(out)) return; if (o->fields) { slist_foreach(o->fields, header_dump_item, out); } if (trailer) fprintf(out, "%s\n", trailer); }
void lt_dlloader_dump (void) { fprintf (stderr, "loaders: "); if (!loaders) { fprintf (stderr, "(empty)"); } else { const lt_dlvtable *head = (const lt_dlvtable *) loaders->userdata; fprintf (stderr, "%s", (head && head->name) ? head->name : "(null)"); if (slist_tail (loaders)) slist_foreach (slist_tail (loaders), loader_dump_callback, NULL); } fprintf (stderr, "\n"); }
static void printlist(SList *l) { printf("<"); slist_foreach(l, print_int, NULL); printf(">\n"); }