Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > media > main-release > by-pkgid > 1a52c27bfef57af124a82326839f87e6 > files > 113

python-pyrex-0.9.8.5-3mdv2010.0.noarch.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;
  }
}