---
name: "auparse_add_callback"
section: "3"
platform: "linux"
package: "audit"
version: "4.2.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/auparse_add_callback"
---

# auparse\_add\_callback(3)

add a callback handler for notifications

## NAME

auparse\_add\_callback - add a callback handler for notifications

## SYNOPSIS

**#include \<auparse.h\>**

```
void auparse_add_callback(auparse_state_t *au, auparse_callback_ptr callback, void *user_data, user_destroy user_destroy_func);
```

## DESCRIPTION

auparse\_add\_callback adds a callback function to the parse state which is invoked to notify the application of parsing events. This is part of the event feed API.

The signature of the callback is:

```
void
auparse_callback(auparse_state_t *au, auparse_cb_event_t cb_event_type,
                 void *user_data);
```

When the callback is invoked it is passed:

- *au*

   a pointer to the parse\_state

- *cb\_event\_type*

  enumerated value indicating the reason why the callback was invoked

- *user\_data*

  pointer to user supplied private data. May be NULL.

- *user\_destroy\_func*

  pointer to function called when user\_data is destroyed. May be NULL. The signature is:\

  ```
  void destroy(void *user_data);
  ```

  The destroy() function should be prepared to accept user\_data possibly being NULL.

The *cb\_event\_type* argument indicates why the callback was invoked. It's possible values are:\

- **AUPARSE\_CB\_EVENT\_READY**

  A complete event has been parsed and is ready to be examined. This is logically equivalent to the parse state immediately following *auparse\_next\_event()*

See [auparse\_feed(3)](/auparse_feed/3.md) for a complete code example.

## RETURN VALUE

None.

## SEE ALSO

[**auparse\_feed**(3)](/auparse_feed/3.md), [**auparse\_flush\_feed**(3)](/auparse_flush_feed/3.md).

## AUTHOR

John Dennis
