# 2.6 Event Handlers

typedef SerdStatus (*SerdBaseSink)(void *handle, const SerdNode *uri)

  Sink (callback) for base URI changes.

  Called whenever the base URI of the serialisation changes.

typedef SerdStatus (*SerdEndSink)(void *handle, const SerdNode *node)

  Sink (callback) for anonymous node end markers.

  This is called to indicate that the anonymous node with the given `value` will no longer be referred to by any future statements (i.e. the anonymous serialisation of the node is finished).

typedef SerdStatus (*SerdErrorSink)(void *handle, const SerdError *error)

  Sink (callback) for errors.

  Param handle:

    Handle for user data.

  Param error:

    Error description.

typedef SerdStatus (*SerdPrefixSink)(void *handle, const SerdNode *name, const SerdNode *uri)

  Sink (callback) for namespace definitions.

  Called whenever a prefix is defined in the serialisation.

typedef uint32_t SerdStatementFlags

  Bitwise OR of `SerdStatementFlag` values.

typedef SerdStatus (*SerdStatementSink)(void *handle, SerdStatementFlags flags, const SerdNode *graph, const SerdNode *subject, const SerdNode *predicate, const SerdNode *object, const SerdNode *object_datatype, const SerdNode *object_lang)

  Sink (callback) for statements.

  Called for every RDF statement in the serialisation.

enum SerdStatementFlag

  Flags indicating inline abbreviation information for a statement.

  enumerator SERD_EMPTY_S

    Empty blank node subject.

  enumerator SERD_EMPTY_O

    Empty blank node object.

  enumerator SERD_ANON_S_BEGIN

    Start of anonymous subject.

  enumerator SERD_ANON_O_BEGIN

    Start of anonymous object.

  enumerator SERD_ANON_CONT

    Continuation of anonymous node.

  enumerator SERD_LIST_S_BEGIN

    Start of list subject.

  enumerator SERD_LIST_O_BEGIN

    Start of list object.

  enumerator SERD_LIST_CONT

    Continuation of list.

struct SerdError

  An error description.

  SerdStatus status

    Error code.

  const uint8_t *filename

    File with error.

  unsigned line

    Line in file with error or 0.

  unsigned col

    Column in file with error.

  const char *fmt

    Printf-style format string.

  va_list *args

    Arguments for fmt.