Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 0a30b3a9f9f116957655e4520b1f2301 > files > 496

python-cython-0.19.1-4.mga4.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;
  }
}