26 lines
351 B
C
26 lines
351 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <blocklist.h>
|
|
|
|
#include "pfilter.h"
|
|
|
|
static struct blocklist *blstate;
|
|
|
|
void
|
|
pfilter_open(void)
|
|
{
|
|
if (blstate == NULL)
|
|
blstate = blocklist_open();
|
|
}
|
|
|
|
void
|
|
pfilter_notify(int what, const char *msg)
|
|
{
|
|
pfilter_open();
|
|
|
|
if (blstate == NULL)
|
|
return;
|
|
|
|
blocklist_r(blstate, what, STDIN_FILENO, msg);
|
|
}
|