You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
323 B
22 lines
323 B
/*
|
|
* 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;
|
|
}
|
|
}
|
|
|