1 #include <stdio.h> 2 #include <unistd.h> 3 #include <blacklist.h> 4 5 #include "pfilter.h" 6 7 static struct blacklist *blstate; 8 9 void 10 pfilter_open(void) 11 { 12 if (blstate == NULL) 13 blstate = blacklist_open(); 14 } 15 16 void 17 pfilter_notify(int what, const char *msg) 18 { 19 pfilter_open(); 20 21 if (blstate == NULL) 22 return; 23 24 blacklist_r(blstate, what, STDIN_FILENO, msg); 25 } 26