Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 98d2a8067c38f8ad1c90c28223e6ee59 > files > 118

python-pyrex-0.9.6.4-1mdv2008.1.x86_64.rpm

/*
 *   An example of a C API that provides a callback mechanism.
 */

#include "cheesefinder.h"

static char *cheeses[] = {
  "cheddar",
  "camembert",
  "that runny one",
  0
};

void find_cheeses(cheesefunc user_func, void *user_data) {
  char **p = cheeses;
  while (*p) {
    user_func(*p, user_data);
    ++p;
  }
}