Debian Codegraph @

upstream/debian-unstable/man3/auparse_add_callback.3

raw
1 .TH "AUPARSE_ADD_CALLBACK" "3" "May 2007" "Red Hat" "Linux Audit API"
2 .SH NAME
3 auparse_add_callback \- add a callback handler for notifications
4 .SH "SYNOPSIS"
5 .B #include <auparse.h>
6 .sp
7 .nf
8 .BI "void auparse_add_callback(auparse_state_t *" au ", auparse_callback_ptr " callback ", void *" user_data ", user_destroy " user_destroy_func ");"
9 .fi
10 .SH "DESCRIPTION"
11 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.
12
13 The signature of the callback is:
14
15 .nf
16 void
17 auparse_callback(auparse_state_t *au, auparse_cb_event_t cb_event_type,
18 void *user_data);
19 .fi
20
21 When the callback is invoked it is passed:
22
23 .TP
24 .I au
25 a pointer to the parse_state
26 .TP
27 .I cb_event_type
28 enumerated value indicating the reason why the callback was invoked
29 .TP
30 .I user_data
31 pointer to user supplied private data. May be NULL.
32 .
33 .TP
34 .I user_destroy_func
35 pointer to function called when user_data is destroyed. May be NULL.
36 The signature is:
37 .br
38 .sp
39 .nf
40 void destroy(void *user_data);
41 .fi
42 .br
43 .sp
44 The destroy() function should be prepared to accept user_data possibly being NULL.
45 .PP
46 The
47 .I cb_event_type
48 argument indicates why the callback was invoked. It's possible values are:
49 .br
50 .TP
51 .B AUPARSE_CB_EVENT_READY
52 A complete event has been parsed and is ready to be examined. This is logically equivalent to the parse state immediately following
53 .I auparse_next_event()
54 .PP
55 See auparse_feed(3) for a complete code example.
56 .
57 .SH "RETURN VALUE"
58
59 None.
60
61 .SH "SEE ALSO"
62
63 .BR auparse_feed (3),
64 .BR auparse_flush_feed (3).
65
66 .SH AUTHOR
67 John Dennis