Next: Adding New Filters Up: Sample Applications Previous: Sample C Application using C Shortcuts

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 */
                                  "");          /* matching all defined values for "text" tag */

  /* second throttle... */
  cmlog_slac_set_throttle_long   ("foo",        /* in field "foo" */
                                  1,            /* allow 1 message */
                                  60.0,         /* every 60 seconds */
                                  "");          /* matching all defined values for "foo" tag */

  cmlog_slac_throttle_show ();			/* display list of throttles */

  cmlog_slac_throttle_off ();			/* disable all throttles */

  cmlog_slac_throttle_on ();			/* re-enable all throttles */


James Silva
2002-10-28