Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > by-pkgid > 72e0913cefe7683427338e51dd70bbde > files > 207

python-cython-0.11.3-1mdv2009.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;
  }
}