示例#1
0
文件: queue.c 项目: tomyo/Dinic
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));
}
示例#2
0
/**
 * 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);
}
示例#3
0
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");
}
示例#4
0
static void printlist(SList *l) {
	printf("<");
	slist_foreach(l, print_int, NULL);
	printf(">\n");
}