summaryrefslogtreecommitdiffstats
path: root/runtime/docs/examples/foreach.c
blob: fc11067433ae351d75ab80e025ab73ea2a8d6290 (plain)
1
2
3
4
5
6
7
8
9
/* example showing how to print all the stats in a map using foreach() */

struct map_node_stat *ptr;

foreach (map, ptr)
     printf ("map[%s,%ld] = [c=%lld s=%lld min=%lld max=%lld]\n", key1str(ptr), 
	     key2int(ptr), ptr->stats.count, ptr->stats.sum, ptr->stats.min, 
	     ptr->stats.max);