struct VSL_data *VSL_New(void);
void VSL_Select(struct VSL_data *vd, unsigned tag);
int VSL_OpenLog(struct VSL_data *vd);
+void VSL_NonBlocking(struct VSL_data *vd, int nb);
int VSL_Dispatch(struct VSL_data *vd, vsl_handler *func, void *priv);
int VSL_NextLog(struct VSL_data *lh, unsigned char **pp);
int VSL_Arg(struct VSL_data *vd, int arg, const char *opt);
unsigned flags;
#define F_SEEN_IX (1 << 0)
+#define F_NON_BLOCKING (1 << 1)
unsigned char map[NFD];
#define M_CLIENT (1 << 0)
/*--------------------------------------------------------------------*/
+void
+VSL_NonBlocking(struct VSL_data *vd, int nb)
+{
+ if (nb)
+ vd->flags |= F_NON_BLOCKING;
+ else
+ vd->flags &= ~F_NON_BLOCKING;
+}
+
+/*--------------------------------------------------------------------*/
+
static int
vsl_nextlog(struct VSL_data *vd, unsigned char **pp)
{
continue;
}
if (*p == SLT_ENDMARKER) {
+ if (vd->flags & F_NON_BLOCKING)
+ return (-1);
w += SLEEP_USEC;
usleep(SLEEP_USEC);
continue;