Imported Upstream version 2.4.3
[platform/upstream/audit.git] / docs / auparse_init.3
1 .TH "AUPARSE_INIT" "3" "Feb 2007" "Red Hat" "Linux Audit API"
2 .SH NAME
3 auparse_init \- initialize an instance of the audit parsing library
4 .SH "SYNOPSIS"
5 .B #include <auparse.h>
6 .sp
7 auparse_state_t *auparse_init(ausource_t source, const void *b);
8
9 .SH "DESCRIPTION"
10
11 auparse_init initializes an instance of the audit parsing library. The function returns an opaque pointer to the parser's internal state. It is used in subsequent calls to the library so. The source variable determines where the library looks for data. Legal values can be:
12
13 .nf
14         AUSOURCE_LOGS - use audit logs
15         AUSOURCE_FILE - use a file
16         AUSOURCE_FILE_ARRAY - use several files
17         AUSOURCE_BUFFER - use a buffer
18         AUSOURCE_BUFFER_ARRAY - use an array of buffers
19         AUSOURCE_DESCRIPTOR - use a particular descriptor
20         AUSOURCE_FILE_POINTER - use a stdio FILE pointer
21         AUSOURCE_FEED - feed data to parser with auparse_feed()
22 .fi
23
24 The pointer 'b' is used to set the file name, array of filenames, the buffer address, or an array of pointers to buffers, or the descriptor number based on what source is given. When the data source is an array of files or buffers, you would create an array of pointers with the last one being a NULL pointer. Buffers should be NUL terminated.
25
26 .SH "RETURN VALUE"
27
28 Returns a NULL pointer if an error occurs; otherwise, the return value is an opaque pointer to the parser's internal state.
29
30 .SH "SEE ALSO"
31
32 .BR auparse_reset (3), 
33 .BR auparse_destroy (3).
34 .BR auparse_feed (3).
35
36 .SH AUTHOR
37 Steve Grubb