AUPARSE_FLUSH_FEED(3)

NAME
auparse_flush_feed - flush any unconsumed feed data through parser.

SYNOPSIS
#include <auparse.h>

int auparse_flush_feed(auparse_state_t *au);"

DESCRIPTION
auparse_flush_feed should be called to signal the end of feed input data and flush any pending parse data through the parsing system. auparse_add_callback() must be called before flushing feed data so that complete events have a consumer. Malformed feed records are rejected and are not passed to the callback. If malformed records are found, parsing continues for the rest of the available feed data before auparse_flush_feed returns an error.

RETURN VALUE
Returns -1 if an error occurs; otherwise, 0 for success. When -1 is returned, errno is set to indicate the error. The value of errno is meaningful only after an error return; callers should not assume it is cleared after a successful call. Applications that may run with libauparse from before audit-4.1.5 should set errno to 0 before calling auparse_flush_feed. If auparse_flush_feed returns -1 and errno is still 0, the runtime library is using the older error behavior and did not set errno. Clearing errno first avoids treating a pre-existing value as if it were set by auparse_flush_feed.

ERRORS

EINVAL
    The parser state is invalid, the parser was not initialized with AUSOURCE_FEED, or no callback has been registered.

ENOMEM
    Memory allocation failed while parsing feed data.

EBADMSG
    A malformed feed record was found. The malformed record was rejected and was not passed to the callback. Parsing continues for the rest of the available feed data before this error is returned.

EIO An internal parser failure occurred without a more specific error code.

SEE ALSO
auparse_feed(3), auparse_feed_age_events(3), auparse_feed_has_data(3)

AUTHOR
John Dennis