Next: Sample C Application using C Shortcuts Up: Sample Applications Previous: Sample C++ Application using "wildcarding"
#include <cmlog.h>
cmlog_client_t client; /* client pointer */
client = cmlog_open (argv[0]); /* set up client connection */
cmlog_new_slac_filter(); /* create/install SLAC filter */
/* first throttle... */
cmlog_slac_set_throttle_string ("text", /* in field "text" */
2, /* allow 2 messages */
10.0, /* every 10 seconds */
"agv"); /* matching substring "agv" */
/* second throttle... */
cmlog_slac_set_throttle_long ("foo", /* in field "foo" */
1, /* allow 1 message */
60.0, /* every 60 seconds */
(long)101); /* when its value == 101 */
cmlog_slac_throttle_show (); /* display list of throttles */
cmlog_slac_throttle_off (); /* disable all throttles */
cmlog_slac_throttle_on (); /* re-enable all throttles */